1 2 3 Previous Next 33 Replies Latest reply on Jun 12, 2013 7:32 AM by chandrasachin16 Go to original post
      • 15. Re: Problems deploying my older application on Jboss 7 (Failed to define class)
        chandrasachin16

        Hi Stephen,

         

        The jms messages are sent from the class which I have attached for your reference.The EventMessageSender calls the JmsHelper which posts the message on jms topic. Also I have attached the server log.

         

         

        Regards

        Sachin

        • 16. Re: Problems deploying my older application on Jboss 7 (Failed to define class)
          sfcoy

          Looking more closely at the files you provided, I see you have resource-ref and resource-env-ref elements declared in your ejb-jar.xml file. Such as

          {code:xml}<message-driven>

               <ejb-name>com.performix.mes.integration.PlanMgrMessageRouter</ejb-name>

               <ejb-class>com.performix.mes.integration.PlanMgrMessageRouter</ejb-class>

               <messaging-type>javax.jms.MessageListener</messaging-type>

               <transaction-type>Bean</transaction-type>

               <message-destination-type>javax.jms.Topic</message-destination-type>

               <resource-ref>

                    <description>description</description>

                    <res-ref-name>ConnectionFactory</res-ref-name>

                    <res-type>javax.jms.ConnectionFactory</res-type>

                    <res-auth>Application</res-auth>

                    <res-sharing-scope>Shareable</res-sharing-scope>

               </resource-ref>

               <resource-env-ref>

                     <resource-env-ref-name>jms/topic/xMESTopicPlanMgrMessage</resource-env-ref-name>

                     <resource-env-ref-type>javax.jms.Topic</resource-env-ref-type>

                </resource-env-ref>

          </message-driven>{code}

           

          Given that this is "legacy" code, I assume that somewhere in java code you're performing a JNDI lookup to access these resources:

          {code:java}     Context initialContext = new InitialContext();

               ConnectionFactory jmsConnectionFactory = (ConnectionFactory)initialContext.lookup("java:comp/env/ConnectionFactory");

               Topic xMESTopic = (Topic)initialContext.lookup("java:comp/env/jms/xMESTopicPlanMgrMessage");{code}

          where the lookup arguments are the fully expanded component environment names.

           

          The presence of these resource-ref and resource-env-ref elements means that your jboss-ejb3.xml file needs corresponding entries that map the java:comp/env names onto real physical resources:

          {code:xml}<message-driven>

               <ejb-name>com.performix.mes.integration.PlanMgrMessageRouter</ejb-name>

               <activation-config>

                    <activation-config-property>

                    <activation-config-property-name>destination</activation-config-property-name>

                    <activation-config-property-value>jms/topic/xMESTopicPlanMgrMessage</activation-config-property-value>

                    </activation-config-property>

               </activation-config>

               <resource-ref>

                    <res-ref-name>ConnectionFactory</res-ref-name>

                    <mapped-name>java:/ConnectionFactory</mapped-name>

               </resource-ref>

               <resource-env-ref>

                     <resource-env-ref-name>jms/topic/xMESTopicPlanMgrMessage</resource-env-ref-name>

                    <mapped-name>java:/topic/xMESTopicPlanMgrMessage</mapped-name>

                </resource-env-ref>

          </message-driven>{code}

          • 17. Re: Problems deploying my older application on Jboss 7 (Failed to define class)
            chandrasachin16

            Ok, this looks new to me.  I will try with this.

             

             

            Sachin

            • 18. Re: Problems deploying my older application on Jboss 7 (Failed to define class)
              sfcoy

              To simplify your life you can add the activation-config and mapped-name elements directly to the ejb-jar.xml file and do away with the jboss-ejb3.xml file for now.

              {code:xml}<message-driven>

                   <ejb-name>com.performix.mes.integration.PlanMgrMessageRouter</ejb-name>

                   <ejb-class>com.performix.mes.integration.PlanMgrMessageRouter</ejb-class>

                   <messaging-type>javax.jms.MessageListener</messaging-type>

                   <transaction-type>Bean</transaction-type>

                   <message-destination-type>javax.jms.Topic</message-destination-type>

               

                   <activation-config>

                        <activation-config-property>

                             <activation-config-property-name>destination</activation-config-property-name>

                             <activation-config-property-value>jms/topic/xMESTopicPlanMgrMessage</activation-config-property-value>

                        </activation-config-property>

                   </activation-config>

               

                   <resource-ref>

                        <description>description</description>

                        <res-ref-name>ConnectionFactory</res-ref-name>

                        <res-type>javax.jms.ConnectionFactory</res-type>

                        <res-auth>Application</res-auth>

                        <res-sharing-scope>Shareable</res-sharing-scope>

                        <mapped-name>java:/ConnectionFactory</mapped-name>

                   </resource-ref>

                   <resource-env-ref>

                        <resource-env-ref-name>jms/topic/xMESTopicPlanMgrMessage</resource-env-ref-name>

                        <resource-env-ref-type>javax.jms.Topic</resource-env-ref-type>

                        <mapped-name>java:/topic/xMESTopicPlanMgrMessage</mapped-name>

                    </resource-env-ref>

              </message-driven>{code}

               

              (although I'm not sure if JBoss supports mapped-name here, as it's optional in the spec)

              • 19. Re: Problems deploying my older application on Jboss 7 (Failed to define class)
                chandrasachin16

                Hi Stephen,

                                Tried with the following in jboss-ejb3.xml:-

                 

                          <resource-ref>

                                <res-ref-name>ConnectionFactory</res-ref-name>

                                <mapped-name>java:comp/env/ConnectionFactory</mapped-name>

                          </resource-ref>

                          <resource-env-ref>

                                <resource-env-ref-name>jms/topic/xMESTopicSystemEventMsg</resource-env-ref-name>

                                <mapped-name>java:/topic/xMESTopicSystemEventMsg</mapped-name>

                          </resource-env-ref>

                 

                 

                but got errors while deploying as follows-------------------

                 

                     at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

                     at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.7.0]

                     at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0]

                     at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0]

                sed by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011058: Failed to install component com.performix.mes.integration.OpcMessageRouter

                     at org.jboss.as.ee.component.deployers.ComponentInstallProcessor.deploy(ComponentInstallProcessor.java:100)

                     at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.0.Final.jar:7.1.0.Final]

                     ... 5 more

                sed by: java.lang.IllegalArgumentException: JBAS011043: Circular dependency installing java:comp/env/ConnectionFactory

                     at org.jboss.as.ee.component.deployers.ComponentInstallProcessor.processBindings(ComponentInstallProcessor.java:257)

                     at org.jboss.as.ee.component.deployers.ComponentInstallProcessor.deployComponent(ComponentInstallProcessor.java:189)

                     at org.jboss.as.ee.component.deployers.ComponentInstallProcessor.deploy(ComponentInstallProcessor.java:93)

                     ... 6 more

                 

                 

                 

                 

                So I commented it and again it was fine. Well the problem for missing dependencies as I understood, was that there is a file (mes.xml which is a custom defined xml file) and it had a parameter pointing to a war  at wrong location.

                 

                But now the errors I get are related to class versioning conflict.Please find the logs attached( line no. 2251 ).

                 

                ARN  [org.jboss.modules] (MSC service thread 1-1) Failed to define class org.apache.xml.serializer.ToXMLStream in Module "org.apache.xalan:main" from local module loader @431d9d (roots: D:\trunkV79JBoss7\external\tools\jboss-as-7.1.0.Final\modules): java.lang.OutOfMemoryError: PermGen space

                    at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.7.0]

                    at java.lang.ClassLoader.defineClass(Unknown Source) [rt.jar:1.7.0]

                 

                 

                 

                 

                 

                As mentioned by you in your previous posts removing jars solves the conflict, but I don't have any xalan.jar  in my ear's lib folder,so how is this conflict occurs ? To remove conflicts I had moved my old jars into a seperate module and loaded it through jboss-deployment-structure.xml( just correct me if it is the right way to do ), since it is bound to happen if there are different versions of jar in app server and in the ear file.Please suggest.

                 

                Sachin

                • 20. Re: Problems deploying my older application on Jboss 7 (Failed to define class)
                  sfcoy

                  Sachin Chandra wrote:

                   

                  Hi Stephen,

                                  Tried with the following in jboss-ejb3.xml:-

                   

                            <resource-ref>

                                  <res-ref-name>ConnectionFactory</res-ref-name>

                                  <mapped-name>java:comp/env/ConnectionFactory</mapped-name>

                            </resource-ref>

                  ...

                  This is not what I have above. In fact the mapped name is the same as the res-ref-name (which has an implicit java:comp/env in front of it), which is why it's circular - it's pointing at itself.

                   

                  Please read my final response to Message-driven bean activation-config and JNDI for an explanation of java:comp/env JNDI names.

                  • 21. Re: Problems deploying my older application on Jboss 7 (Failed to define class)
                    chandrasachin16

                    Extremely sorry, it was my mistake which I did in jboss-ejb3.xml. The link  https://community.jboss.org/thread/222185  was really helpfull.

                     

                    But I am still struggling with my previous errors ---- Failed to define class org.apache.xml.serializer.CharInfo in Module "org.apache.xalan:main"

                     

                    id=B2MMLInterfaceBean

                    address=http://localhost:3390/servicelayer/B2MMLInterfaceBean

                    implementor=com.performix.servicelayer.interfacemanager.B2MMLInterfaceBean

                    invoker=org.jboss.wsf.stack.cxf.JBossWSInvoker

                    serviceName={http://interfacemanager.servicelayer.performix.com/}B2MMLInterfaceBeanService

                    portName={http://interfacemanager.servicelayer.performix.com/}B2MMLInterfaceBeanPort

                    wsdlLocation=null

                    mtomEnabled=false

                    properties=[org.jboss.as.webservices.metadata.modelEjbComponentViewName -> service jboss.deployment.subunit."xmes.ear"."servicelayer.jar".component.B2MMLInterfaceBean.VIEW."com.performix.servicelayer.interfacemanager.B2MMLInterfaceBean".SERVICE_ENDPOINT]

                    13:48:05,881 INFO  [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] (MSC service thread 1-2) Creating Service {http://interfacemanager.servicelayer.performix.com/}B2MMLInterfaceBeanService from class com.performix.servicelayer.interfacemanager.B2MMLInterface

                    13:48:09,391 INFO  [org.apache.cxf.endpoint.ServerImpl] (MSC service thread 1-2) Setting the server's publish address to be http://localhost:3390/servicelayer/B2MMLInterfaceBean

                    13:48:11,089 WARN  [org.jboss.modules] (MSC service thread 1-2) Failed to define class org.apache.xml.serializer.CharInfo in Module "org.apache.xalan:main" from local module loader @1a3617c (roots: D:\trunkV79JBoss7\external\tools\jboss-as-7.1.0.Final\modules): java.lang.OutOfMemoryError: PermGen space

                        at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.7.0]

                        at java.lang.ClassLoader.defineClass(Unknown Source) [rt.jar:1.7.0]

                        at java.security.SecureClassLoader.defineClass(Unknown Source) [rt.jar:1.7.0]

                        at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:327)

                        at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:391)

                        at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:243)

                        at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:73)

                        at org.jboss.modules.Module.loadModuleClass(Module.java:517)

                        at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:182)

                        at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)

                        at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)

                        at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)

                        at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)

                        at org.apache.xml.serializer.ToXMLStream.<init>(ToXMLStream.java:50) [serializer-2.7.1.jbossorg-1.jar:2.7.1]

                        at org.apache.xml.serializer.ToUnknownStream.<init>(ToUnknownStream.java:141) [serializer-2.7.1.j

                     

                     

                     

                     

                    I don't have xalan jar in lib folder of ear so how does this conflict occur ? Only Jboss has xalan.jar.

                    • 22. Re: Problems deploying my older application on Jboss 7 (Failed to define class)
                      sfcoy

                      This:

                      {quote}JBoss AS 7.1.0.Final "Thunder" started (with errors) in 174664ms - Started 1312 of 1440 services{quote}

                      makes me think your application is quite large.

                       

                      Perhaps you really are running out of memory?

                       

                      Are you using the standard memory settings?

                      • 23. Re: Problems deploying my older application on Jboss 7 (Failed to define class)
                        chandrasachin16

                        Hi Stephen,

                         

                        Yes it's a large application. Can you please throw some more light on standard memory settings-

                        My Jboss standalone.conf.bat memory settings is as below

                         

                        set "JAVA_OPTS=-Xms1024M -Xmx1024M -XX:MaxPermSize=256M -XX:MaxNewSize=448m -XX:NewSize=448m"

                         

                        My system is having 3GB RAM (32 bit).

                        • 24. Re: Problems deploying my older application on Jboss 7 (Failed to define class)
                          sfcoy

                          Try setting MaxPermSize=320M and see if it gets any further.

                          • 25. Re: Problems deploying my older application on Jboss 7 (Failed to define class)
                            chandrasachin16

                            Hi Stephen,

                             

                            Tried with that also but couldn't resolve it. I have attached the server log for your reference.

                            • 26. Re: Problems deploying my older application on Jboss 7 (Failed to define class)
                              sfcoy

                              What is your server environment?

                               

                              OS

                              Java version and vendor   (I can't find a reference for the "-XX:MaxNewSize=448m -XX:NewSize=448m" options)

                              • 27. Re: Problems deploying my older application on Jboss 7 (Failed to define class)
                                chandrasachin16

                                Hi Stephen ,

                                 

                                My server enviornment is Windows 7 Professional, Intel Core 2 Duo(2.10 GHz)

                                Java Version 1.7.0.

                                 

                                Regarding the  -XX:MaxNewSize=448m -XX:NewSize=448m , I don't know why it is not available in the logs but I am attaching the standalone.conf.bat for your reference.

                                • 28. Re: Problems deploying my older application on Jboss 7 (Failed to define class)
                                  sfcoy

                                  I found the reference at Java HotSpot VM Options .

                                   

                                  These are not the stock settings and they smell of premature optimisation. You or someone else has added these settings and reduced the standard heap size as well.

                                   

                                  In any event, I suggest you remove these, restore the "-Xmx1303M" setting and increase the MaxPermSize to 512M to see if that makes a difference.

                                  • 29. Re: Problems deploying my older application on Jboss 7 (Failed to define class)
                                    chandrasachin16

                                    Hi Stephen,

                                     

                                     

                                    Sorry couldn't update you on this front. I reverted the settings  to

                                     

                                    set "JAVA_OPTS=-Xms64M -Xmx1303M -XX:MaxPermSize=512M"   the standard settings but didn't had any luck . I still get the same error--

                                     

                                    Failed to define class org.apache.xml.serializer.CharInfo in Module "org.apache.xalan:main" from local module loader @431d9d (roots: D:\trunkV79JBoss7\external\tools\jboss-as-7.1.0.Final\modules): java.lang.OutOfMemoryError: PermGen space

                                    at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.7.0]

                                        at java.lang.ClassLoader.defineClass(Unknown Source) [rt.jar:1.7.0]

                                        at java.security.SecureClassLoader.defineClass(Unknown Source) [rt.jar:1.7.0]

                                        at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:327)

                                        at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:391)

                                        at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:243)

                                        at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:73)

                                        at org.jboss.modules.Module.loadModuleClass(Module.java:517)

                                        at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:182)

                                     

                                     

                                    I wanted to ask one question may be it's a very silly question.My question is I am building the schemas as well as webservices using old jaxb  jars, axis jars and wsdl4j-1.5.1 jars using ant  which are kept in a custom folder called buildtimejar .But there are few other jars which are referred from Jboss7 jars( xalan.jar and more in modules folder ) to build web services and which are not available in this buildtime folder.Earlier I used to point to jboss 5 bundeled library jars which used to contain xalan jars, but now it is building the webservices using the new xalan jars and perhaps few more jars of jboss 7,but schemas are build using older jars, so do you think this could cause some problem, or rather would it be a wise thing to use jboss 5 jars to build webservices rather than the jboss 7 and then deploy it in jboss 7.

                                     

                                    Need your suggestions.

                                     

                                    Sachin