2 Replies Latest reply on Jan 14, 2010 2:29 PM by Adrian Brock

    JBOSS deploy cannot success

    calvin design Newbie

      When i deploy the webapp using JBOSS 4.0.4, after success deploy EJB, it should follow by deploy validation rules. But it gives me error:

      ERROR [MessageResourcesFactory] MessageResourcesFactory.createFactory
      java.lang.NoClassDefFoundError: org/apache/struts/util/MessageResourcesFactory
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
      at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
      at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
      at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
      at org.jboss.mx.loading.RepositoryClassLoader.findClassLocally(RepositoryClassLoader.java:672)
      at org.jboss.mx.loading.RepositoryClassLoader.findClass(RepositoryClassLoader.java:652)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
      at org.jboss.mx.loading.RepositoryClassLoader.loadClassLocally(RepositoryClassLoader.java:190)
      at org.jboss.mx.loading.ClassLoadingTask$ThreadTask.run(ClassLoadingTask.java:131)
      at org.jboss.mx.loading.LoadMgr3.nextTask(LoadMgr3.java:399)
      at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:517)
      at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:405)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:299)


      when i paste the struts library in the server\default\lib folder, it gives me ClassCastException. Anyone have idea about this? thanks.

        • 1. Re: JBOSS deploy cannot success
          Ben Coster Newbie

          I am getting the same ClassCastException when deploying.

           

          10:55:27,063 ERROR [MessageResourcesFactory] MessageResourcesFactory.createFactory
          java.lang.ClassCastException: org.apache.struts.util.PropertyMessageResourcesFactory
                  at org.apache.struts.util.MessageResourcesFactory.createFactory(MessageResourcesFactory.java:172)
                  at org.apache.struts.util.MessageResources.getMessageResources(MessageResources.java:523)
                  at org.apache.struts.action.ActionServlet.initInternal(ActionServlet.java:1045)
                  at org.apache.struts.action.ActionServlet.init(ActionServlet.java:326)
                  at org.apache.beehive.netui.pageflow.AutoRegisterActionServlet.init(AutoRegisterActionServlet.java:103)
                  at org.apache.beehive.netui.pageflow.PageFlowActionServlet.init(PageFlowActionServlet.java:133)
                  at javax.servlet.GenericServlet.init(GenericServlet.java:212)
                  at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)
                  at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981)
                  at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4071)
                  at org.apache.catalina.core.StandardContext.start(StandardContext.java:4375)
                  at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:790)
                  at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:770)
                  at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:553)
                  at sun.reflect.GeneratedMethodAccessor147.invoke(Unknown Source)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                  at java.lang.reflect.Method.invoke(Method.java:585)
                  at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:296)
                  at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
                  at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                  at org.apache.catalina.core.StandardContext.init(StandardContext.java:5312)
                  at sun.reflect.GeneratedMethodAccessor143.invoke(Unknown Source)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                  at java.lang.reflect.Method.invoke(Method.java:585)
                  at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:296)
                  at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
                  at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)

           

          Does anyone have any ideas?

           

          Thanks,

          Ben

          • 2. Re: JBOSS deploy cannot success
            Adrian Brock Master

            You can't put some struts classes in server/default/lib and some in your web-app.

            The classes in server/default/lib can't see classes inside the war.

             

            So you'll get one of:

             

            ClassNotFoundException - the class is missing from server/default/lib but its in the war - its inaccessible to classes in server/default/lib

            (assuming the class isn't just missing altogether)

             

            ClassCastException - one of the classes is in both places while others are not, the others see different versions of the duplicated classes

             

            There's a longer explanation in the docs

            http://www.jboss.org/file-access/default/members/jbossas/freezone/docs/Server_Configuration_Guide/4/html/Class_Loading_and_Types_in_Java-ClassCastExceptions___Im_Not_Your_Type.html