Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-4785

Wicket + JBoss AS7: ClassNotFoundException: org.jboss.msc.service.ServiceName on deserialization

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Not A Problem
    • 1.5.8
    • None
    • wicket
    • None
    • JBoss AS 7.1.x

    Description

      Wicket's serialization causes problems when deployed on JBoss AS 7.
      AS 7 has the new higly modular architecture, which only makes relevant classes available to war's classloader. org.jboss.msc.* is not amongst them.

      I guess Wicket serializes this class because it traverses to it through CDI proxy's fields.
      Then upon deserialization, it fails.

      This is making Wicket unsuitable for production in AS 7, which is quite pity, since AS 7 is good impl of Java EE 6 with all the goodies like CDI; and also think about OpenShift.com which hosts on AS 7.

      I have briefly discussed this with AS devs and they said this needs relatively simple fix in the serialization code. Or, maybe, a special serializer could be written for integration with AS 7.

      ClassNotFoundException: org.jboss.msc.service.ServiceName from [Module "deployment.ROOT.war:main" from Service Module Loader]
      at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)

      Steps to reproduce:

      • See http://test-ondra.rhcloud.com/
      • Add some record, then go to / , refresh few times.
      • Wicket will redirect you e.g. to /?4
      • When you change that to a lower number, Wicket tries to get the old page state by deserializing.
      • That's why it happens during deserialization.
      Root cause:
      
      java.lang.ClassNotFoundException: org.jboss.msc.service.ServiceName from [Module "deployment.ROOT.war:main" from Service Module Loader]
      at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
      at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
      at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
      at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423)
      at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
      at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:264)
      at org.apache.wicket.application.AbstractClassResolver.resolveClass(AbstractClassResolver.java:108)
      at org.apache.wicket.serialize.java.JavaSerializer$ClassResolverObjectInputStream.resolveClass(JavaSerializer.java:216)
      at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1592)
      at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1513)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1749)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1346)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:368)
      at java.util.HashMap.readObject(HashMap.java:1047)
      at java.lang.reflect.Method.invoke(Method.java:616)
      at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:988)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1865)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1770)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1346)
      at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1963)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1887)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1770)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1346)
      at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1963)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1887)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1770)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1346)
      at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1963)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1887)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1770)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1346)
      at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1963)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1887)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1770)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1346)
      at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1963)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1887)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1770)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1346)
      at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1963)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1887)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1770)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1346)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:368)
      at org.apache.wicket.serialize.java.JavaSerializer.deserialize(JavaSerializer.java:120)
      at org.apache.wicket.pageStore.DefaultPageStore.deserializePage(DefaultPageStore.java:388)
      at org.apache.wicket.pageStore.DefaultPageStore.getPage(DefaultPageStore.java:127)
      at org.apache.wicket.page.PageStoreManager$SessionEntry.getPage(PageStoreManager.java:192)
      at org.apache.wicket.page.PageStoreManager$PersistentRequestAdapter.getPage(PageStoreManager.java:327)
      at org.apache.wicket.page.AbstractPageManager.getPage(AbstractPageManager.java:102)
      at org.apache.wicket.page.PageManagerDecorator.getPage(PageManagerDecorator.java:50)
      at org.apache.wicket.page.PageAccessSynchronizer$2.getPage(PageAccessSynchronizer.java:257)
      at org.apache.wicket.DefaultMapperContext.getPageInstance(DefaultMapperContext.java:117)
      at org.apache.wicket.request.handler.PageProvider.getStoredPage(PageProvider.java:292)
      at org.apache.wicket.request.handler.PageProvider.isNewPageInstance(PageProvider.java:205)
      at org.apache.wicket.request.mapper.AbstractBookmarkableMapper.mapHandler(AbstractBookmarkableMapper.java:349)
      at org.apache.wicket.request.mapper.MountedMapper.mapHandler(MountedMapper.java:366)
      at org.apache.wicket.request.mapper.CompoundRequestMapper.mapHandler(CompoundRequestMapper.java:157)
      at org.apache.wicket.request.cycle.RequestCycle.mapUrlFor(RequestCycle.java:404)
      at org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:146)
      at org.apache.wicket.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:167)
      at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:781)
      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:185)
      at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:241)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
      at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50)
      at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:154)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930)
      at java.lang.Thread.run(Thread.java:679)
      
      Complete stack:
      
      java.lang.RuntimeException: Could not deserialize object using: class org.apache.wicket.serialize.java.JavaSerializer$ClassResolverObjectInputStream
      at org.apache.wicket.serialize.java.JavaSerializer.deserialize(JavaSerializer.java:137)
      at org.apache.wicket.pageStore.DefaultPageStore.deserializePage(DefaultPageStore.java:388)
      at org.apache.wicket.pageStore.DefaultPageStore.getPage(DefaultPageStore.java:127)
      at org.apache.wicket.page.PageStoreManager$SessionEntry.getPage(PageStoreManager.java:192)
      at org.apache.wicket.page.PageStoreManager$PersistentRequestAdapter.getPage(PageStoreManager.java:327)
      at org.apache.wicket.page.AbstractPageManager.getPage(AbstractPageManager.java:102)
      at org.apache.wicket.page.PageManagerDecorator.getPage(PageManagerDecorator.java:50)
      at org.apache.wicket.page.PageAccessSynchronizer$2.getPage(PageAccessSynchronizer.java:257)
      at org.apache.wicket.DefaultMapperContext.getPageInstance(DefaultMapperContext.java:117)
      at org.apache.wicket.request.handler.PageProvider.getStoredPage(PageProvider.java:292)
      at org.apache.wicket.request.handler.PageProvider.isNewPageInstance(PageProvider.java:205)
      at org.apache.wicket.request.mapper.AbstractBookmarkableMapper.mapHandler(AbstractBookmarkableMapper.java:349)
      at org.apache.wicket.request.mapper.MountedMapper.mapHandler(MountedMapper.java:366)
      at org.apache.wicket.request.mapper.CompoundRequestMapper.mapHandler(CompoundRequestMapper.java:157)
      at org.apache.wicket.request.cycle.RequestCycle.mapUrlFor(RequestCycle.java:404)
      at org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:146)
      at org.apache.wicket.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:167)
      at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:781)
      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:185)
      

      Attachments

        1. wicket-4785.zip
          13 kB
          Sebastien Briquet

        Activity

          People

            Unassigned Unassigned
            pekarna Ondra Žižka
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: