我试图用argo建立eclipse工程,出现java.lang.IllegalArgumentException: URI is not hierarchical
我希望建立一个eclipse的web工程,在eclipse里运行tomcat,出现一下错误 GroupConventionFactory.java 38: ClassLoader cl = Thread.currentThread().getContextClassLoader();
44: URL url = cl.getResource(".");
url是这样的file:/usr/lib/jvm/java-6-openjdk-common/jre/lib/ext/pulse-java.jar!/
2013-4-10 15:44:11 org.apache.catalina.core.AprLifecycleListener init
信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/lib/jvm/java-6-openjdk-amd64/jre/lib/amd64/server:/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/amd64:/usr/lib/jvm/java-6-openjdk-amd64/jre/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib
2013-4-10 15:44:11 org.apache.tomcat.util.digester.SetPropertiesRule begin
警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:argo-sample' did not find a matching property.
2013-4-10 15:44:12 org.apache.coyote.AbstractProtocolHandler init
信息: Initializing ProtocolHandler ["http-bio-8080"]
2013-4-10 15:44:12 org.apache.coyote.AbstractProtocolHandler init
信息: Initializing ProtocolHandler ["ajp-bio-8009"]
2013-4-10 15:44:12 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 2296 ms
2013-4-10 15:44:12 org.apache.catalina.core.StandardService startInternal
信息: Starting service Catalina
2013-4-10 15:44:12 org.apache.catalina.core.StandardEngine startInternal
信息: Starting Servlet Engine: Apache Tomcat/7.0.12
2013-4-10 15:44:18 org.apache.catalina.util.SessionIdGenerator createSecureRandom
信息: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [5,589] milliseconds.
2013-4-10 15:44:20 org.apache.catalina.core.ApplicationContext log
严重: failed to argo initialize, system exit!!!
java.lang.IllegalArgumentException: URI is not hierarchical
at java.io.File.
从 Log 上看当前 Thread 的 context class loader 貌似是一个 Extension Class Loader,但是 Thread context class loader 默认应该是 system class loader 吧?有什么地方改了当前线程的 context class loader? 正常的话当前线程的 context class loader 应该是一个什么 Tomcat 的 class loader 吧
断点显示确实是WebappClassLoader
看一下这个 WebappClassLoader 实例的 delegate 属性是否为 true,有无 Parent Class Loader,如果都是的话,那是调用 Parent Class Loader 的 getResource 方法
delegate为false
2013/4/10 aliyang [email protected]
看一下这个 WebappClassLoader 实例的 delegate 属性是否为 true,有无 Parent Class Loader,如果都是的话,那是调用 Parent Class Loader 的 getResource 方法
— Reply to this email directly or view it on GitHubhttps://github.com/58code/Argo/issues/9#issuecomment-16172238 .
我发现在linux上运行任何ClassLoader.getResource(".")都会得到那个奇怪的路径,正在纠结中:http://stackoverflow.com/questions/16317789/thread-currentthread-getcontextclassloader-getresource-has-different-re