我已经构建了一个包含以下内容的 ear 文件:
myear.ear
- > META-INF
- > mywar.war
战争文件的内容是:
mywar.war
- > META-INF
- > WEB-INF
- > classes
- > jsp
- > lib
- > myjar.jar
- > applicationContext.xml
- > ....
其中 myjar.jar 包含类:
com.myapp.config.Configurator
现在,当我在 websphere 8.5.0.1 中部署这个 war 文件时,我得到:
[11-04-13 10:16:54:875 CEST] 00000065 servlet I com.ibm.ws.webcontainer.servlet.ServletWrapper init SRVE0242I: [isclite] [/ibm/console] [/com.ibm.ws.console.appmanagement/CtxRootForWebMod.jsp]: Initialization successful.
[11-04-13 10:23:30:488 CEST] 00000062 servlet E com.ibm.ws.webcontainer.servlet.ServletWrapper service Uncaught service() exception thrown by servlet resourceLoader: java.lang.NoClassDefFoundError: com.myapp.config.Configurator (initialization failure)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:168)
at com.myapp.web.servlet.WebResourceServlet.doPost(WebResourceServlet.java:60)
at com.myapp.web.servlet.WebResourceServlet.doGet(WebResourceServlet.java:45)
当类位于 ear 存档中时,为什么会出现此错误?