Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

我试图用argo建立eclipse工程,出现java.lang.IllegalArgumentException: URI is not hierarchical #9

Open
liuchunhua opened this issue Apr 10, 2013 · 5 comments

Comments

@liuchunhua
Copy link

我希望建立一个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.(File.java:380)
at com.bj58.argo.convention.GroupConventionFactory.getGroupConvention(GroupConventionFactory.java:45)
at com.bj58.argo.servlet.ArgoDispatcherFactory.create(ArgoDispatcherFactory.java:15)
at com.bj58.argo.servlet.ArgoFilter.init(ArgoFilter.java:28)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:273)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:254)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:372)
at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:98)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4562)
at org.apache.catalina.core.StandardContext$2.call(StandardContext.java:5240)
at org.apache.catalina.core.StandardContext$2.call(StandardContext.java:5235)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:679)

@ghost
Copy link

ghost commented Apr 10, 2013

从 Log 上看当前 Thread 的 context class loader 貌似是一个 Extension Class Loader,但是 Thread context class loader 默认应该是 system class loader 吧?有什么地方改了当前线程的 context class loader? 正常的话当前线程的 context class loader 应该是一个什么 Tomcat 的 class loader 吧

@liuchunhua
Copy link
Author

断点显示确实是WebappClassLoader

@ghost
Copy link

ghost commented Apr 10, 2013

看一下这个 WebappClassLoader 实例的 delegate 属性是否为 true,有无 Parent Class Loader,如果都是的话,那是调用 Parent Class Loader 的 getResource 方法

@liuchunhua
Copy link
Author

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//issues/9#issuecomment-16172238
.

@greenlaw110
Copy link

我发现在linux上运行任何ClassLoader.getResource(".")都会得到那个奇怪的路径,正在纠结中:http://stackoverflow.com/questions/16317789/thread-currentthread-getcontextclassloader-getresource-has-different-re

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants