https://issues.apache.org/bugzilla/show_bug.cgi?id=56387
--- Comment #6 from qiubo...@qq.com --- (In reply to Konstantin Kolinko from comment #5) > 1. What exactly is your version of Tomcat? > > So that I can interpret those line numbers in the exception. we use tomcat 7.0.27. > 2. I agree that the code could be improved to provide more detail. > > a) It cannot throw an IllegalStateException (per the API contract), but it > can nest one into ClassNotFoundException that it throws. I agree with you idea,nest one into ClassNotFoundException will be prefect. > b) In WebappClassLoader.loadClass(String, boolean) > > if (!started) { > try { > throw new IllegalStateException(); > } catch (IllegalStateException e) { > log.info(sm.getString("webappClassLoader.stopped", name), e); > } > } > > That is some logic that logs the access. It would be better to follow that > by failing fast via throwing an ClassNotFoundException instead of continuing. > > c) In WebappClassLoader.findClass(String) > > It fails fast, but does not provide any details, nor logs this access. > > // Cannot load anything from local repositories if class loader is > stopped > if (!started) { > throw new ClassNotFoundException(name); > } > > > > Add volatile keyword to org.apache.catalina.loader.WebappClassLoader#started > > can help us to find problem quickly. > > That would not hurt, but I do not believe that that would help you. I do not > believe that your thread saw stale value of that flag. NoClassDefFoundError happen Occasionally.and I analyze the code,only thread see stale value of that flag will cause the exception. > I am REOPENING this issue and changing severity and title. I do not see a > bug here, but the behaviour can be improved. thanks your help.^_^ -- You are receiving this mail because: You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org