我在加载特定页面时偶尔会遇到以下异常:
java.lang.NoClassDefFoundError: Could not initialize class com.app.item.search.SearchResultPanel
at com.app.item.search.SearchResultPage.initialize(SearchResultPage.java:86)
at com.app.core.layout.BasePage.onInitialize(BasePage.java:147)
at org.apache.wicket.Component.fireInitialize(Component.java:864)
at org.apache.wicket.MarkupContainer.internalInitialize(MarkupContainer.java:955)
at org.apache.wicket.Page.isPageStateless(Page.java:464)
at org.apache.wicket.core.request.mapper.AbstractBookmarkableMapper.getPageInfo(AbstractBookmarkableMapper.java:447 )
at org.apache.wicket.core.request.mapper.AbstractBookmarkableMapper.mapHandler(AbstractBookmarkableMapper.java:391)
at org.apache.wicket.request.mapper.mount.UnmountedMapperAdapter.mapHandler(UnmountedMapperAdapter.java:61)
at org.apache.wicket.request.mapper.mount.MountMapper.mapHandler(MountMapper.java:145)
at org.apache.wicket.request.mapper.CompoundRequestMapper.mapHandler(CompoundRequestMapper.java:215)
at org.apache.wicket.request.cycle.RequestCycle.mapUrlFor(RequestCycle.java:429)
at org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:271)
at org.apache.wicket.core.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:175)
at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:862)
at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:261)
at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:218)
at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:289)
--- CUT ---
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
问题通过重新启动tomcat(可能是2,3,4或5次)来解决,只有在我部署到开发/集成环境时才会发生。在我的开发VM上它从未发生过。它只影响几页/面板(总是它们)。
SearchResultPanel是一个简单的类,它扩展了wicket Panel类。
在catalina.out上我看到搜索结果是从Lucene加载的,但是当它显示页面时,我收到了上面的异常和来自wicket / tomcat的404页面。
SearchResultPanel的构造函数:
public SearchResultPanel(String id, final SearchResult resultList)
生成异常的行(SearchResultPage:86):
SearchResultPanel resultPanel = new SearchResultPanel("searchResults",
results);
SearchResultPanel位于应用程序的WEB-INF文件夹中:
# locate SearchResultPanel
/var/lib/tomcat7/webapps/app/WEB-INF/classes/com/app/item/search/SearchResultPanel$1.class
/var/lib/tomcat7/webapps/app/WEB-INF/classes/com/app/item/search/SearchResultPanel$2.class
/var/lib/tomcat7/webapps/app/WEB-INF/classes/com/app/item/search/SearchResultPanel$3.class
/var/lib/tomcat7/webapps/app/WEB-INF/classes/com/app/item/search/SearchResultPanel$4.class
/var/lib/tomcat7/webapps/app/WEB-INF/classes/com/app/item/search/SearchResultPanel$5.class
/var/lib/tomcat7/webapps/app/WEB-INF/classes/com/app/item/search/SearchResultPanel$6.class
/var/lib/tomcat7/webapps/app/WEB-INF/classes/com/app/item/search/SearchResultPanel$7.class
/var/lib/tomcat7/webapps/app/WEB-INF/classes/com/app/item/search/SearchResultPanel$8.class
/var/lib/tomcat7/webapps/app/WEB-INF/classes/com/app/item/search/SearchResultPanel$ItemFragment$1.class
/var/lib/tomcat7/webapps/app/WEB-INF/classes/com/app/item/search/SearchResultPanel$ItemFragment$2.class
/var/lib/tomcat7/webapps/app/WEB-INF/classes/com/app/item/search/SearchResultPanel$ItemFragment$3.class
/var/lib/tomcat7/webapps/app/WEB-INF/classes/com/app/item/search/SearchResultPanel$ItemFragment.class
/var/lib/tomcat7/webapps/app/WEB-INF/classes/com/app/item/search/SearchResultPanel$SortImageModel.class
/var/lib/tomcat7/webapps/app/WEB-INF/classes/com/app/item/search/SearchResultPanel.class
/var/lib/tomcat7/webapps/app/WEB-INF/classes/com/app/item/search/SearchResultPanel.html
使用:
您能否请进一步告知我如何调试此类加载问题?
非常感谢!