5 Replies Latest reply on Feb 7, 2009 12:57 AM by jaikiran

    ClassCastException @ org.jboss.metadata.ear.spec.JavaModuleM

    ecbdc

      Im trying to deploy an application (.ear file) to JBoss 5, and I'm receiving the following error. The app deploys fine under 4.2.2.

      [CODE]15:31:33,172 ERROR [AbstractKernelController] Error installing to Real: name=vfszip:/C:/ASE/ext/jboss-5.0.0.GA/server/all/dep
      loy/UGC-WS.ear state=PreReal mode=Manual requiredState=Real
      org.jboss.deployers.spi.DeploymentException: Error during deploy: vfszip:/C:/ASE/ext/jboss-5.0.0.GA/server/all/deploy/UGC-WS.
      ear/ugc-ws.war
      at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
      at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:177)
      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.doInstallParentFirst(DeployersImpl.java:1210)
      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:1598)
      at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
      at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
      at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
      at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
      at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
      at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
      at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:545)
      at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:304)
      at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:205)
      at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:405)
      at org.jboss.Main.boot(Main.java:209)
      at org.jboss.Main$1.run(Main.java:547)
      at java.lang.Thread.run(Thread.java:595)
      Caused by: java.lang.ClassCastException: org.jboss.metadata.ear.spec.JavaModuleMetaData
      at org.jboss.wsf.container.jboss50.deployment.metadata.JSEArchiveMetaDataAdapter.buildMetaData(JSEArchiveMetaDataAdap
      ter.java:76)
      at org.jboss.wsf.container.jboss50.deployment.metadata.ContainerMetaDataAdapter.buildContainerMetaData(ContainerMetaD
      ataAdapter.java:76)
      at org.jboss.wsf.container.jboss50.deployment.metadata.ContainerMetaDataDeploymentAspect.create(ContainerMetaDataDepl
      oymentAspect.java:51)
      at org.jboss.wsf.framework.deployment.DeploymentAspectManagerImpl.create(DeploymentAspectManagerImpl.java:121)
      at org.jboss.wsf.container.jboss50.BareWSFRuntime.create(BareWSFRuntime.java:61)
      at org.jboss.wsf.container.jboss50.deployer.ArchiveDeployerHook.deploy(ArchiveDeployerHook.java:84)
      at org.jboss.wsf.container.jboss50.deployer.AbstractDeployerHookEJB.deploy(AbstractDeployerHookEJB.java:43)
      at org.jboss.wsf.container.jboss50.deployer.AbstractWebServiceDeployer.internalDeploy(AbstractWebServiceDeployer.java
      :60)
      at org.jboss.wsf.container.jboss50.deployer.WebServiceDeployerEJB.internalDeploy(WebServiceDeployerEJB.java:112)
      at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
      at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
      ... 19 more
      15:31:33,203 ERROR [ProfileServiceBootstrap] Failed to load profile: Summary of incomplete deployments (SEE PREVIOUS ERRORS F
      OR DETAILS):

      *** CONTEXTS IN ERROR: Name -> Error

      vfszip:/C:/ASE/ext/jboss-5.0.0.GA/server/all/deploy/UGC-WS.ear -> java.lang.ClassCastException: org.jboss.metadata.ear.spec.J
      avaModuleMetaData[/CODE]

        • 1. Re: ClassCastException @ org.jboss.metadata.ear.spec.JavaMod
          jaikiran

          Is there any other exception that you see? What does your application contain? And how is it packaged? Post the output of

          jar -tf ugc-ws.war


          • 2. Re: ClassCastException @ org.jboss.metadata.ear.spec.JavaMod
            ecbdc

             

            "jaikiran" wrote:
            Is there any other exception that you see? What does your application contain? And how is it packaged? Post the output of

            jar -tf ugc-ws.war

            That is the only exception that shows up.

            The application just contains web services and a servlet that loads on startup to initialize and cache some data.

            We have an EAR file which contains a few JAR files (one of them being named ugc-ws.jar) for libraries that we use, and also a WAR file which has the web.xml to load a servlet - this WAR file also has the same ugc-ws.jar in it's lib directory because the servlet is inside that JAR. So basically we have the main EAR file, and within it multiple jar files, as well as a WAR file - which also has a JAR file inside it's lib directory. And the error looks like it's coming from the WAR.

            This is the output from "jar -tf ugc-ws.war":
            >jar -tf ugc-ws.war
            META-INF/
            META-INF/MANIFEST.MF
            WEB-INF/
            WEB-INF/web.xml
            WEB-INF/lib/
            WEB-INF/jboss-web.xml
            WEB-INF/lib/ugc-ws.jar
            


            Just for testing, I remvoed the .WAR file from the .EAR and the application deploys without any errors, but obviously w/out the data from the WAR, i can't use the application. The way I'm deploying is just dropping the .EAR file into the server\all\deploy directory.

            Thanks

            • 3. Re: ClassCastException @ org.jboss.metadata.ear.spec.JavaMod
              jaikiran

               

              The application just contains web services and a servlet that loads on startup to initialize and cache some data.
              this WAR file also has the same ugc-ws.jar in it's lib directory because the servlet is inside that JAR.


              So you have a jar (ugc-ws.jar) which

              1) Is placed in more than one location (the EAR and the WEB-INF/lib of war)
              2) Contains both the servlets as well as the webservices

              Did i understand this right? If yes, then try doing this:

              1) Break up the ugc-ws.jar to contain only the webservices.
              2) Place the ugc-ws.jar only in the EAR
              3) Create a separate jar for the servlets and place that jar in .war/WEB-INF/lib folder (or place the servlets in the .war/WEB-INF/classes folder).

              I am suggesting this based on a wild guess. If this doesn't work, please post back with more details.



              • 4. Re: ClassCastException @ org.jboss.metadata.ear.spec.JavaMod
                ecbdc

                 

                "jaikiran" wrote:
                The application just contains web services and a servlet that loads on startup to initialize and cache some data.
                this WAR file also has the same ugc-ws.jar in it's lib directory because the servlet is inside that JAR.


                So you have a jar (ugc-ws.jar) which

                1) Is placed in more than one location (the EAR and the WEB-INF/lib of war)
                2) Contains both the servlets as well as the webservices

                Did i understand this right? If yes, then try doing this:

                1) Break up the ugc-ws.jar to contain only the webservices.
                2) Place the ugc-ws.jar only in the EAR
                3) Create a separate jar for the servlets and place that jar in .war/WEB-INF/lib folder (or place the servlets in the .war/WEB-INF/classes folder).

                I am suggesting this based on a wild guess. If this doesn't work, please post back with more details.



                Yes, you are correct.

                I tried doing as you listed above, by splitting up the webservices and the servlet (there's only one) into two separate JARs, and I received the same error as in the first post. Also, rather than have a 2nd JAR with only the servlet in it, I just put the java classes into the .war/WEB-INF/classes folder, and received the same error.

                We have another application that's packaged the same way and it receives the same error as well.

                The only way I've been able to deploy without any errors, is remove the WAR from the EAR file. However, this is not a solution because we need the servlet to be run for our application.

                Thanks

                • 5. Re: ClassCastException @ org.jboss.metadata.ear.spec.JavaMod
                  jaikiran

                  Not much information there, in those logs. Any chance of uploading that app to some accessible place?