3 Replies Latest reply on Aug 16, 2009 11:58 AM by jaikiran

    Help for jboss-structure.xml to eliminate jaxb-xjc.jar probl

    vavasthi

      I have a .ear file that contains a war (containing a rest webservices using resteasy), a jar file containing ejbs. Since the project pulls in jaxb-xjc.jar file and that results in IllegalStateException because of the jaxb-xjc.jar file containing nested directories with sub directories also containing META-INF and MANIFEST files. I read on another that I should use jboss-structure.xml file to get around the problem and I tried to do that. Here is the xml file that I have written.

      <structure>
       <context>
       <path name=""/>
       <metaDataPath>
       <path name="META-INF"/>
       </metaDataPath>
       <classpath>
       <path name="" suffixes=".jar" />
       </classpath>
       </context>
       <context>
       <path name="Myejb.jar"/>
       <metaDataPath>
       <path name="META-INF"/>
       </metaDataPath>
       <classpath>
       <path name="" suffixes=".jar" />
       </classpath>
       </context>
      </structure>

      With this change, when I try to deploy the ear file, I don't file the persistence manager which is defined in persistence.xml file in Myejb.jar file. Can anybody point me to what I am doing wrong.

        • 1. Re: Help for jboss-structure.xml to eliminate jaxb-xjc.jar p
          jaikiran

           

          "vavasthi" wrote:

          With this change, when I try to deploy the ear file, I don't file the persistence manager which is defined in persistence.xml file in Myejb.jar file. Can anybody point me to what I am doing wrong.


          Can you post that log/exception stacktrace which shows the persistence.xml is not found?

          • 2. Re: Help for jboss-structure.xml to eliminate jaxb-xjc.jar p
            vavasthi

            Here is the exception. BTW, I am using jboss 5.1.0 GA

            11:14:03,522 ERROR [Ejb3Deployment] Exception while processing container metadata for EJB: MySessionBean in unit: My.ear
            11:14:03,523 ERROR [AbstractKernelController] Error installing to Real: name=vfszip:/opt/tools/jboss-5.1.0.GA/server/default/deploy/My.ear/ state=PreReal mode=Manual requiredState=Real
            org.jboss.deployers.spi.DeploymentException: Error deploying My.ear: Exception while processing container metadata for EJB: MySessionBean in unit: My.ear
             at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:196)
             at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:99)
             at org.jboss.deployers.vfs.spi.deployer.AbstractVFSRealDeployer.internalDeploy(AbstractVFSRealDeployer.java:45)
             at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
             at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
             at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
             at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
             at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
             at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
             at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
             at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
             at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
             at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
             at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)


            and further
            Caused by: java.lang.IllegalArgumentException: Can't find a persistence unit named 'null' in AbstractVFSDeploymentContext@359971180{vfszip:/opt/tools/jboss-5.1.0.GA/server/default/deploy/My.ear/}
             at org.jboss.jpa.resolvers.BasePersistenceUnitDependencyResolver.resolvePersistenceUnitSupplier(BasePersistenceUnitDependencyResolver.java:107)
             at org.jboss.ejb3.Ejb3Deployment.resolvePersistenceUnitSupplier(Ejb3Deployment.java:770)
             at org.jboss.ejb3.EJBContainer.resolvePersistenceUnitSupplier(EJBContainer.java:1428)
             at org.jboss.injection.PersistenceUnitHandler.addPUDependency(PersistenceUnitHandler.java:130)
             ... 33 more
            11:14:03,529 WARN [HDScanner] Failed to process changes
            org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):


            • 3. Re: Help for jboss-structure.xml to eliminate jaxb-xjc.jar p
              jaikiran

              Do you really need that jaxb-xjc.jar file in your application packaging? If not the easiest approach is to remove it.

              In the meantime, i'll give this a try locally to see what's the expected behaviour with the jboss-structure.xml that you posted.