0

我有一个检票口应用程序,我正在使用 Ebean ORM 映射。我已经在 ebean.properties 中设置了所有凭据。但是当我在服务器上部署它时,我收到一条错误消息“无法初始化类 com.avaje.ebean.Ebean”,它给出的错误如下

Last cause: Could not initialize class com.avaje.ebean.Ebean
WicketMessage: Can't instantiate page using constructor 'public com.zipgrocery.pages.HomePageNew(org.apache.wicket.request.mapper.parameter.PageParameters)' and argument ''. Might be it doesn't exist, may be it is not visible (public).

Stacktrace

Root cause:

java.lang.NoClassDefFoundError: Could not initialize class com.avaje.ebean.Ebean
     at com.zipgrocery.data.Merchant.getMerchantsByZone(Merchant.java:374)
     at com.zipgrocery.pages.HomePageNew.<init>(HomePageNew.java:77)
     at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
     at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:173)
     at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:77)
     at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:47)
     at org.apache.wicket.DefaultMapperContext.newPageInstance(DefaultMapperContext.java:103)
     at org.apache.wicket.request.handler.PageProvider.resolvePageInstance(PageProvider.java:264)
     at org.apache.wicket.request.handler.PageProvider.getPageInstance(PageProvider.java:165)
     at org.apache.wicket.request.handler.render.PageRenderer.getPage(PageRenderer.java:78)
     at org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:105)
     at org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:224)
     at org.apache.wicket.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:167)
     at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:784)
     at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
     at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:255)
     at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:212)
     at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:283)
     at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:188)
     at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:244)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
     at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
     at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:311)
     at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:776)
     at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:705)
     at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:898)
     at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
     at java.lang.Thread.run(Thread.java:619)

Complete stack:

org.apache.wicket.WicketRuntimeException: Can't instantiate page using constructor 'public com.zipgrocery.pages.HomePageNew(org.apache.wicket.request.mapper.parameter.PageParameters)' and argument ''. Might be it doesn't exist, may be it is not visible (public).
     at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:196)
     at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:77)
     at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:47)
     at org.apache.wicket.DefaultMapperContext.newPageInstance(DefaultMapperContext.java:103)
     at org.apache.wicket.request.handler.PageProvider.resolvePageInstance(PageProvider.java:264)
     at org.apache.wicket.request.handler.PageProvider.getPageInstance(PageProvider.java:165)
     at org.apache.wicket.request.handler.render.PageRenderer.getPage(PageRenderer.java:78)
     at org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:105)
     at org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:224)
     at org.apache.wicket.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:167)
     at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:784)
     at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
     at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:255)
     at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:212)
     at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:283)
     at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:188)

java.lang.reflect.InvocationTargetException
     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
     at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
     at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:173)
     at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:77)
     at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:47)
     at org.apache.wicket.DefaultMapperContext.newPageInstance(DefaultMapperContext.java:103)
     at org.apache.wicket.request.handler.PageProvider.resolvePageInstance(PageProvider.java:264)
     at org.apache.wicket.request.handler.PageProvider.getPageInstance(PageProvider.java:165)
     at org.apache.wicket.request.handler.render.PageRenderer.getPage(PageRenderer.java:78)
     at org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:105)
     at org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:224)
     at org.apache.wicket.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:167)
     at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:784)
     at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
     at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:255)
     at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:212)
     at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:283)
     at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:188)

但是当我将它部署在我的本地主机上时它工作正常。我试图找到解决方案,但没有得到。所以帮帮我...

4

1 回答 1

1

我对“Ebean ORM”这个家伙不熟悉,但是错误跟踪非常通用,似乎与“Ebean ORM”本身没有任何关系。根据我过去的经验,它更像是一个类加载器问题。你说它在本地运行良好,然后?哪里坏了?当您遇到诸如“NoClassDefFoundError”之类的问题时,请始终检查正在使用的类加载器。此外,值得检查您的损坏环境是否有多个版本的类/jar,以及服务器是否具有此类/jar 的嵌入式版本。

于 2013-02-01T13:13:54.980 回答