5 Replies Latest reply on Mar 11, 2012 2:52 PM by chaatna

    EJB 2.1 deployment issue on Jboss 5.1

    chaatna Newbie

      We have migrated a have application from Websphere to Jboss 5.1 where we have eJB 2.1.

      Application is deployed with the following message"

       

      15:32:26,623 INFO  [LogNotificationListener] Adding notification listener for logging mbean "jboss.system:service=Logging,type=Log4jService" to server org.jboss.mx.server.MBeanServerImpl@d37b87[ defaultDomain='jboss' ]
         
      15:32:33,067 ERROR [AbstractKernelController] Error installing to Parse: name=vfszip:/C:/JBoss51/jboss-eap-5.1/jboss-as/server/DEV_server0/deploy/biz-app-1.0-SNAPSHOT.ear/ state=PreParse mode=Manual requiredState=Parse
          org
      .jboss.deployers.spi.DeploymentException: Error creating managed object for vfszip:/C:/JBoss51/jboss-eap-5.1/jboss-as/server/DEV_server0/deploy/biz-app-1.0-SNAPSHOT.ear/lib/common.jar/spring-hibernate.xml
      at org
      .jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
      at org
      .jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:362)
      at org
      .jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:322)
      at org
      .jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:294)
      at org
      .jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.deploy(AbstractParsingDeployerWithOutput.java:234)
      at org
      .jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:179)
      at org
      .jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1454)
      at org
      .jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1172)
      at org
      .jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1225)
      at org
      .jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1225)
      at org
      .jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1113)
      at org
      .jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
      at org
      .jboss.dependency.plugins.AbstractController.install(AbstractController.java:1652)
      at org
      .jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:938)
      at org
      .jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
      at org
      .jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:988)
      at org
      .jboss.dependency.plugins.AbstractController.change(AbstractController.java:826)
      at org
      .jboss.dependency.plugins.AbstractController.change(AbstractController.java:556)
      at org
      .jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:789)
      at org
      .jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:699)
      at org
      .jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
      at org
      .jboss.system.server.profileservice.repository.ProfileDeployAction.install(ProfileDeployAction.java:70)
      at org
      .jboss.system.server.profileservice.repository.AbstractProfileAction.install(AbstractProfileAction.java:53)
      at org
      .jboss.system.server.profileservice.repository.AbstractProfileService.install(AbstractProfileService.java:403)
      at org
      .jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
      at org
      .jboss.dependency.plugins.AbstractController.install(AbstractController.java:1652)
      at org
      .jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:938)
      at org
      .jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
      at org
      .jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:988)
      at org
      .jboss.dependency.plugins.AbstractController.install(AbstractController.java:778)
      at org
      .jboss.dependency.plugins.AbstractController.install(AbstractController.java:543)
      at org
      .jboss.system.server.profileservice.repository.AbstractProfileService.registerProfile(AbstractProfileService.java:308)
      at org
      .jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:256)
      at org
      .jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:461)
      at org
      .jboss.Main.boot(Main.java:221)
      at org
      .jboss.Main$1.run(Main.java:556)
      at java
      .lang.Thread.run(Thread.java:619)
         
      Caused by: java.lang.ClassCastException
      at java
      .lang.Class.cast(Class.java:2990)
      at org
      .jboss.xb.util.JBossXBHelper.parse(JBossXBHelper.java:194)
      at org
      .jboss.xb.util.JBossXBHelper.parse(JBossXBHelper.java:166)
      at org
      .jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer.parse(SchemaResolverDeployer.java:137)
      at org
      .jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer.parse(SchemaResolverDeployer.java:121)
      at org
      .jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer.parseAndInit(AbstractVFSParsingDeployer.java:304)
      at org
      .jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer.parse(AbstractVFSParsingDeployer.java:269)
      at org
      .jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:355)
      ... 35 more
       

      Is it related to any API from jars conflict or any schemea conflict?

      But the same file from common.jar/spring-hibernate is working for remaining applications being in "common" project.

       

      This is schema I have in jboss.xml for EJB 2.1. this jboss.xml is in EJBproject/META-INF folder

       

      <?xml version="1.0" encoding="UTF-8"?>

      <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 4.0//EN" "http://www.jboss.org/j2ee/dtd/jboss_5_0.dtd">

       

      When I enable <version>6</version> in ear project pom.xml, I used to get the following exception:

      Caused by: org.jboss.xb.binding.JBossXBRuntimeException: -1:-1 160:49 src-resolve: Cannot resolve the name 'javaee:descriptionGroup' to a(n) 'group' component.

      at org.jboss.xb.binding.sunday.unmarshalling.XsdBinderTerminatingErrorHandler.handleError(XsdBinderTerminatingErrorHandler.java:40)

       

      So I commented that version configuration in ear project pom.xml. Now I am getting the top exception.

       

      Is "persistence.xml" mandatory for EJB 2.1 on JBoss 5.1?

       

      Please help me regarding this:

      Thanks,

        • 1. Re: EJB 2.1 deployment issue on Jboss 5.1
          Wolf-Dieter Fink Master

          What is common.jar? If it is a library that is also within the JBoss installation you should remove it in your application.

           

          regarding the persistence.xml, this is a EE6 artifact that you don't need for EJB2, you should not have to change the version to '6'

          • 2. Re: EJB 2.1 deployment issue on Jboss 5.1
            chaatna Newbie

            Hi wolf,

             

            Thanks for your reply.

             

            "common.jar" is dependent jar for this ear. We need that application jar for this ear. We have some more application which uses the same "common.jar" working fine. But those are WARs and not EARs.

             

            I current scenario it is a EAR which depends on "common.jar".

             

            Could I know why I am getting that ClassCastException in that configuration file" spring-hibernate.xml"?

             

            Could you let me know whether it is the proper XML schema for jboss.xml for EJB 2.1.

             

            <?xml version="1.0" encoding="UTF-8"?>

            <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 4.0//EN" "http://www.jboss.org/j2ee/dtd/jboss_5_0.dtd">

             

            I have removed even XercesImpl.jar also from the EAR with the suspect of API conflct.

             

            Please let me know what is causing the above deployment failure.

             

            Thanks,

            Chaatna

            • 3. Re: EJB 2.1 deployment issue on Jboss 5.1
              Wolf-Dieter Fink Master

              Class loading of EAR and WAR are different see ClassLoadingWiki's.

              If you have third-party classes in your ear which are also provided by JBoss you might have such ClassCast trouble.

              This can also happen for calls between Bean'S if you use the default classloading and call-by-reference (if you call a bean of another EAR)

               

              https://community.jboss.org/wiki/ClassLoadingOverview

              https://community.jboss.org/wiki/ClassLoadingConfiguration

              https://community.jboss.org/wiki/JBossClassLoadingUseCases

              • 4. Re: EJB 2.1 deployment issue on Jboss 5.1
                chaatna Newbie

                Hi Wolf,

                 

                I am getting the same exception though I remove the EJB module from the EAR. now EAr contains only Web Module. Still same error.

                 

                I thought there may be some clash between the identies of shared code among EJB module and WEB module.

                 

                following is my EAR module configuration:

                 

                 

                 

                <plugin>

                 

                <groupId>org.apache.maven.plugins</groupId>

                 

                <artifactId>maven-ear-plugin</artifactId>

                 

                <version>2.7</version>

                 

                <configuration>

                 

                <modules>

                 

                <ejbModule>

                 

                <groupId>com.test</groupId>

                 

                <artifactId>test-ejb</artifactId>

                 

                <bundleFileName>test-ejb.jar</bundleFileName>

                 

                <excluded>true</excluded>

                 

                </ejbModule>

                 

                <webModule>

                 

                <groupId>com.test</groupId>

                 

                <artifactId>test-web</artifactId>

                 

                <bundleFileName>test-web.war</bundleFileName>

                 

                <bundleDir>/</bundleDir>

                 

                </webModule>

                 

                </modules>

                 

                 

                <generateApplicationXml>true</generateApplicationXml>

                 

                <displayName>Test App</displayName>

                 

                <fileNameMapping>no-version</fileNameMapping>

                 

                <jboss>

                 

                <version>5</version>

                 

                <unauthenticated-principal>guest</unauthenticated-principal>

                 

                <loader-repository>test:loader=test-app.ear</loader-repository>

                 

                <loader-repository-config>java2ParentDelegation=false</loader-repository-config>

                 

                </jboss>

                <!-- <version>6</version> -->

                 

                <defaultLibBundleDir>lib</defaultLibBundleDir>

                 

                <packagingExcludes>lib/xmlParserAPIs.jar,lib/xercesImpl.jar</packagingExcludes>

                 

                </configuration>

                 

                </plugin>

                 

                Please suggest what is going wrong to get that exception.

                 

                Thanks,

                • 5. Re: EJB 2.1 deployment issue on Jboss 5.1
                  chaatna Newbie

                  I am answering my question myself.

                   

                  I put all jars and wars directly in root path of EAR rather than putting the shared library inside lib of EAR/ putting all the library inside WAR/WEB-INF/lib.

                   

                  Put all jars/wars inside EAR directly. Condifure the WAR pom.xml accordingly to remove the jars from WEB-INF/lib. Add following config in web project pom.xml.

                   

                   

                  <configuration>

                   

                   

                   

                  <packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes> <archive>

                  <manifest>

                  <addClasspath>true</addClasspath></manifest>

                  </archive>

                  </configuration>

                   

                   

                   

                   

                  add EAR pom.xml as follows:

                   

                  <defaultJavaBundleDir>/</defaultJavaBundleDir>

                   

                  The above configuration fixed my above issue.

                   

                  Thanks

                  1 of 1 people found this helpful