8 Replies Latest reply on Jun 25, 2014 4:03 PM by Pat Guilbert

    Moving from Glassfish 3.1 to JBoss 6.2.0, error while deploying war

    Pat Guilbert Newbie

      Hi!

       

      Our company develops several web applications on Glassfish and we have to move one of them from Glassfish to JBoss EAP 6.2.

       

       

      We have Ant scripts that setup, start and deploy the applications on the correct domains on Glassfish, and I never really used JBoss, so I tried doing all the steps manually with the administration console to see if the deployment would work. The next step would then to make a CLI script to do it automatically.

       

      Our application uses one XADatasource, one ear deployed on a different domain and a business-ear deployed on the same domain than the presentation-war.

       

      I tried adding the XADatasource manually, tried the connection within the administration console and it was a success. I'm not exactly sure how domains work on JBoss, so I just deployed manually all the ear/war on the same port. I then enabled all of them. It was all a success except the presentation.war, which is the application we used to launch on Glassfish. This is the server.log error :

       

      11:03:10,430 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-9) JBAS015876: Starting deployment of "medrec-web" (runtime-name: "medrec")

      11:03:10,521 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-10) MSC000001: Failed to start service jboss.deployment.unit.medrec.INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit.medrec.INSTALL: JBAS018733: Failed to process phase INSTALL of deployment "medrec"

          at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:127) [jboss-as-server-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]

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

          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) [rt.jar:1.6.0_45]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) [rt.jar:1.6.0_45]

          at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_45]

      Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS012650: Failed to load annotated class: org.mcgill.phire.jsf.tags.Tooltip

          at org.jboss.as.jsf.deployment.JSFAnnotationProcessor.deploy(JSFAnnotationProcessor.java:115)

          at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:120) [jboss-as-server-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]

          ... 5 more

       

      11:03:10,530 ERROR [org.jboss.as.server] (HttpManagementService-threads - 1) JBAS015870: Deploy of deployment "medrec" was rolled back with the following failure message:

      {"JBAS014671: Failed services" => {"jboss.deployment.unit.medrec.INSTALL" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.medrec.INSTALL: JBAS018733: Failed to process phase INSTALL of deployment \"medrec\"

          Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS012650: Failed to load annotated class: org.mcgill.phire.jsf.tags.Tooltip"}}

      11:03:10,536 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-11) JBAS015877: Stopped deployment medrec-web (runtime-name: medrec) in 6ms

       

      I tried removing all uses of the custom tag in the code, and the error switched to the next tag in the code, so that's not the correct way to do it. The application deploys correctly on Glassfish.

       

      Some more info: I'm new to the company and web apps development, so I still have some trouble understanding Glassfish and all (and my task was to migrate it to Jboss!), but I'll do my best to provide you guys with more information if needed.

       

      Glassfish version: 3.1
      Jboss EAP version: 6.2
      Java JDK : 1.6u45
      OS : Windows 7 64 bits (deploying it locally)

      DB : Oracle 11g (I deployed the .jar driver with the deployment tools on Jboss)

       

      Thanks!

        • 1. Re: Moving from Glassfish 3.1 to JBoss 6.2.0, error while deploying war
          jaikiran pai Master

          Pat, welcome to the forums!

           

          To get started with domain management in JBoss EAP, you might want to check the community documentation of JBoss AS7 (on which JBoss EAP 6 is based) here https://docs.jboss.org/author/display/AS71/Admin+Guide

          Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS012650: Failed to load annotated class: org.mcgill.phire.jsf.tags.Tooltip

              at org.jboss.as.jsf.deployment.JSFAnnotationProcessor.deploy(JSFAnnotationProcessor.java:115)

              at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:120) [jboss-as-server-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]

              ... 5 more

          Is that and other such classes not part of your deployment?

          • 2. Re: Moving from Glassfish 3.1 to JBoss 6.2.0, error while deploying war
            Pat Guilbert Newbie

            Hi jaikiran pai !

             

            I already started reading the documentation but it's very heavy (and I don't even fully understand Glassfish yet so that migration might be harder than I thought).

             

            The Tooltip class (like a lot of other classes in our code, are annotated like this and implements a UIComponent from the primefaces framework :

            @FacesComponent(value = "tooltip")

            @ResourceDependencies({

                @ResourceDependency(library="js", name="jQuery.js", target = "head"),

                @ResourceDependency(library="js/common", name="tooltip.js"),d

                @ResourceDependency(library="css/common", name="tooltip.css", target = "head")

            })

            public class Tooltip extends UIComponentBase {

            ...

            }

             

            If I try to remove every reference/instance of that class, the error just changes to Failed to load annotated class : (next annotated class in the code).

             

            I tried updating our Primefaces library (I don't know if the jsf-impl (mojarra) of Jboss has anything to do with it, but for now I guess I'll keep looking in the admin guide.

             

            Thank you for the reply!

             

            Also, I added the Redhat Windup plugin to our pom.xml, and that is the output target of what could be causing trouble in our migration :

             

            /medrec/medrec-business-ear/target/medrec-business-ear/META-INF1EAR Application Descriptor
            /medrec/medrec-business-ear/target1EAR Application Descriptor
            /medrec/medrec-ear/target/medrec-ear/META-INF1EAR Application Descriptor
            /medrec/medrec-ear/target1EAR Application Descriptor
            /medrec/medrec-web/target/medrec-web/WEB-INF4CDI Configuration, JavaServer Faces Config, WAR Application Descriptor, Facelet Taglib
            /medrec/medrec-web/src/main/webapp/WEB-INF4CDI Configuration, JavaServer Faces Config, WAR Application Descriptor, Facelet Taglib
            Total:36 Total with Testing & App Migration Factors

             

            According to this tool, the only modifications needed would be in the descriptors/configuration files correct?

            • 3. Re: Moving from Glassfish 3.1 to JBoss 6.2.0, error while deploying war
              Pat Guilbert Newbie

              Gentle bump,

               

              Some more info, on Glassfish, we have a .ear running on port 11048 that is accessed by the .war along with another .ear running on port 7048. For testing purposes, we tried putting all the .ear/war on the same standalone configuration (same server-group and whatnot). Changing to managed mode still gives me the same error.

               

              Also, why do my JDBC connection has to start with java:/ on JBoss, isn't there a way to keep the old name that works on Glassfish i.e jdbc/medrec-prod instead of java:/jdbc/medrec-prod?

               

              Thank you!

              • 4. Re: Moving from Glassfish 3.1 to JBoss 6.2.0, error while deploying war
                Tomaz Cerar Master

                Pat Guilbert wrote:

                Also, why do my JDBC connection has to start with java:/ on JBoss, isn't there a way to keep the old name that works on Glassfish i.e jdbc/medrec-prod instead of java:/jdbc/medrec-prod?

                 

                You can map such jndi names in jboss-web.xml

                • 6. Re: Moving from Glassfish 3.1 to JBoss 6.2.0, error while deploying war
                  Pat Guilbert Newbie

                  I just verified to make sure and all the classes with the @Component tag fail to load. We also have another project here that we tried to import to Jboss and it gets the same error (although it works fine on Glassfish). The first project use Primefaces as the JSF implementation whereas the second one uses RichFaces. We have something missing here and I have no idea where to look.

                  • 7. Re: Moving from Glassfish 3.1 to JBoss 6.2.0, error while deploying war
                    Pat Guilbert Newbie

                    This is getting very annoying, none of our projects seems to deploy correctly on Jboss and it all has something to do with the jsf-impl (Primefaces or Richfaces). I was thinking that there may a conflict with the default jsf-impl that JBoss uses and that the classloader would load the wrong classes (the default implementation instead of ours). I tried disabling the classloader by adding a jboss-deployment-structure.xml file to the WEB-INF folder of our .war:

                     

                    <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">

                        <deployment>

                            <exclusions>

                                <module name="javax.faces.api" slot="main"/>

                                    <module name="com.sun.jsf-impl" slot="main"/>

                                <module name="javax.faces.api" slot="1.2"/>

                                    <module name="com.sun.jsf-impl" slot="1.2"/>

                            </exclusions>

                        </deployment>

                    </jboss-deployment-structure>

                     

                    but I still get some errors:

                    Internal Server Error

                    {

                      "outcome" => "failed",

                      "failure-description" => {"JBAS014671: Failed services" => {"jboss.deployment.unit.medrec.INSTALL" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.medrec.INSTALL: JBAS018733: Failed to process phase INSTALL of deployment \"medrec\"

                      Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.jboss.as.jsf.deployment.JSFAnnotationProcessor$FacesAnnotation"}},

                      "rolled-back" => true

                    }

                     

                    There must be something we're not understanding well enough with JBoss and or classloading in AS 7.1 right?

                     

                    Thanks

                    • 8. Re: Moving from Glassfish 3.1 to JBoss 6.2.0, error while deploying war
                      Pat Guilbert Newbie

                      I don't know if external links are allowed, but here's the Stackoverflow question we posted:

                       

                      http://stackoverflow.com/questions/24417244/jboss-failed-to-load-annotated-class

                       

                      So yeah by downloading the Wildfly source code and attaching the remote debug to the running JBoss application, we were able to see exactly what method was causing the problem.

                       

                      We're still headbanging on this one... All of our applications seem to fail at this step.

                       

                      Thanks!