简体   繁体   中英

java.lang.NoClassDefFoundError from websphere

I have a problem that I can't figure out.

Context :

was 7.0.0.19 version (with no preCompileJsp) Caused by: java.lang.NoClassDefFoundError: org/apache/jsp/_xxx (wrong name: com/ibm/_jsp/_xxx) at java.lang.ClassLoader.defineClassImpl(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:275) at java.lang.ClassLoader.defineClass(ClassLoader.java:212) at com.ibm.ws.jsp.webcontainerext.JSPExtensionClassLoader.defClass(JSPExtensionClassLoader.java:181) at com.ibm.ws.jsp.webcontainerext.JSPExtensionClassLoader._loadClass(JSPExtensionClassLoader.java:133)

It's the only JSP that give problem, and only on a specific environment (no problem on the others environments with the same configuration) the xxx.class is well present in my profile/tmp directory with others jsp in the same directory (that all give no problem) and the filesystem is not full.

Tests

I did a copy of xxx.jsp to xxxNew.jsp in the same directory I can access the xxxNew.jsp without any problem (so there is no coding problem) So I did a mv from xxx.jsp to xxx1.jsp and had no problem to access the jsp new named I deleted the xxx.class in the tmp directory I did the mv back to the first name (xxx.jsp) and still get the error with a newly xxx.class in the tmp directory. Is there a class cache anywhere in websphere that could explain this ? (no cachespec.xml for dynacache found in the war module).

Why Websphere try to find a class from the org.apache.jsp package and not from com.ibm._jsp ? (how the AS choose the mapping from the URL to the classes ?)

Thxs !

Make sure you are not including in your webapp classpath any JSP engine or other implementation of standard JSP libraries that might be incompatible with WebSphere's runtime. Also, once you delete all potentially incompatible jars, try deleting the generated classes from JSP compilation (which are under {WAS_HOME}/AppServer/profiles/{YOUR_PROFILE}/temp), so recompilation would be triggered and discard any stale .class generated with a previous classpath state.

It would be helpful if you posted the list of JARs in your app's classpath.

尝试在WAS控制台上更改Web应用程序类的加载策略:PARENT_FIRST / PARENT_LAST。

this bug is due to websphere incorrect log : the original exception is not displayed.

You should check for instance if there is no missing jsp tag libraries in your page.

See https://www-01.ibm.com/support/docview.wss?uid=swg1PI09596

Regards.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM