11 Replies Latest reply on Oct 30, 2014 6:34 AM by Anton Arhipov

    Spring Petclinic (2013 version) doesn't work in JBoss AS 7

    John Anderson Newbie

      I'm trying to run the Spring Petclinic example on JBoss AS 7.1.1. I've imported the maven project from https://github.com/SpringSource/spring-petclinic/ to Eclipse Juno and successfully deployed it, but http://localhost:8080/petclinic/ gives me HTTP Status 404 error.
      The only problem I can see from the log is

       

      JBAS011006: Not installing optional component org.springframework.web.context.request.async.StandardServletAsyncWebRequest due to exception: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011054: Could not find default constructor for class org.springframework.web.context.request.async.StandardServletAsyncWebRequest

       

      but according to http://stackoverflow.com/questions/13786685/spring3-2-and-jboss-as-7 it's normal behavior.
      I've found some advices about modifying the Petclinic sample for JBoss, but all of them are for the old version of the sample, not the updated 2013 version (http://blog.springsource.org/2013/03/21/spring-petclinic-is-on-github/).
      The sample works fine with Tomcat 7.0.39.

        • 1. Re: Spring Petclinic (2013 version) doesn't work in JBoss AS 7
          John Anderson Newbie

          I tried it with JBoss EAP6.1.0/AS7.2.0.Final, but got the same problem - can't even see the main page. I also tried Glassfish 3.1.2.2 and Weblogic 12.1.1 and it worked with it, so the problem is only with JBoss. I even installed everything from scratch on a clean Windows 7 virtual machine, but still no luck.

          • 2. Re: Spring Petclinic (2013 version) doesn't work in JBoss AS 7
            Benoit Xhenseval Newbie

            Hi John

             

            We seem to have the same issue upgrading our application from Spring 3.1.4.RELEASE to 3.2.3 under JBoss 7.1.3.Final.

             

            Have you managed to solve it?

             

            Many thanks

             

            Regards

             

            Benoit

            • 3. Re: Spring Petclinic (2013 version) doesn't work in JBoss AS 7
              Tomaz Cerar Master

              You should be telling us more about problems you have.

               

              what is the server log? there must be some warnings / exceptions in log.

              The warning about non-default constructor is irrelevant everything else might give use some insight.

              • 4. Re: Spring Petclinic (2013 version) doesn't work in JBoss AS 7
                Benoit Xhenseval Newbie

                Is there a new dependency to include with 3.2.3 for web war? i.e. may be a transitive dependency that is no longer there?

                 

                We included the usual in our maven build:

                spring-aop-3.2.3.RELEASE.jar                    spring-jdbc-3.2.3.RELEASE.jar                   spring-security-taglibs-3.1.3.RELEASE.jar

                spring-beans-3.2.3.RELEASE.jar                  spring-jms-3.2.3.RELEASE.jar                    spring-security-web-3.1.3.RELEASE.jar

                spring-context-3.2.3.RELEASE.jar                spring-orm-3.2.3.RELEASE.jar                    spring-tx-3.2.3.RELEASE.jar

                spring-context-support-3.2.3.RELEASE.jar        spring-security-acl-3.1.3.RELEASE.jar           spring-web-3.2.3.RELEASE.jar

                spring-core-3.2.3.RELEASE.jar                   spring-security-config-3.1.3.RELEASE.jar        spring-webmvc-3.2.3.RELEASE.jar

                spring-expression-3.2.3.RELEASE.jar             spring-security-core-3.1.3.RELEASE.jar


                 

                Actually, I just noticed that my colleague posted this here: https://community.jboss.org/thread/231235?tstart=0

                 

                Sorry for the x-posting....we still need to figure out what has changed...

                 

                 

                JBAS014775:    New missing/unsatisfied dependencies:

                      service jboss.deployment.subunit."xxxx-ear.ear"."xxxx-web.war".component."org.springframework.web.context.request.async.StandardServletAsyncWebRequest".START

                (missing) dependents: [service

                jboss.deployment.subunit."xxxx-ear.ear"."xxxx-ejb.jar".INSTALL]

                      service jboss.naming.context.java.comp.xxxx-ear.xxxx-ejb.xxxxStartup

                (missing) dependents: [service

                jboss.naming.context.java.comp.xxxx-ear.xxxx-ejb.xxxxStartup.ValidatorFactory,

                service jboss.naming.context.java.comp.xxxx-ear.xxxx-ejb.xxxxStartup.HandleDelegate,

                service jboss.naming.context.java.comp.xxxx-ear.xxxx-ejb.xxxxStartup.ORB,

                service jboss.naming.context.java.comp.xxxx-ear.xxxx-ejb.xxxxStartup.Validator]

                      service jboss.naming.context.java.comp.xxxx-ear.xxxx-ejb.AuditMonitoringForPersistenceMDB

                (missing) dependents: [service

                jboss.naming.context.java.comp.xxxx-ear.xxxx-ejb.AuditMonitoringForPersistenceMDB.Validator,

                service jboss.naming.context.java.comp.xxxx-ear.xxxx-ejb.AuditMonitoringForPersistenceMDB.HandleDelegate,

                service jboss.naming.context.java.comp.xxxx-ear.xxxx-ejb.AuditMonitoringForPersistenceMDB.ORB,

                service jboss.naming.context.java.comp.xxxx-ear.xxxx-ejb.AuditMonitoringForPersistenceMDB.ValidatorFactory]

                      service jboss.naming.context.java.comp.xxxx-ear.xxxx-ejb.BusinessEventClientRouterMDB

                (missing) dependents: [service

                jboss.naming.context.java.comp.xxxx-ear.xxxx-ejb.BusinessEventClientRouterMDB.ORB,

                service jboss.naming.context.java.comp.xxxx-ear.xxxx-ejb.BusinessEventClientRouterMDB.ValidatorFactory,

                service jboss.naming.context.java.comp.xxxx-ear.xxxx-ejb.BusinessEventClientRouterMDB.HandleDelegate,

                service jboss.naming.context.java.comp.xxxx-ear.xxxx-ejb.BusinessEventClientRouterMDB.Validator]

                      service jboss.naming.context.java.comp.xxxx-ear.xxxx-ejb.BusinessEventMonitoringForProceedingStageablesMDB

                (missing) dependents: [service

                jboss.naming.context.java.comp.xxxx-ear.xxxx-ejb.BusinessEventMonitoringForProceedingStageablesMDB.Validator,

                service jboss.naming.context.java.comp.xxxx-ear.xxxx-ejb.BusinessEventMonitoringForProceedingStageablesMDB.HandleDelegate,

                service jboss.naming.context.java.comp.xxxx-ear.xxxx-ejb.BusinessEventMonitoringForProceedingStageablesMDB.ValidatorFactory,

                service jboss.naming.context.java.comp.xxxx-ear.xxxx-ejb.BusinessEventMonitoringForProceedingStageablesMDB.ORB]

                      service jboss.naming.context.java.comp.xxxx-ear.xxxx-ejb.BusinessEventMonitoringMDB

                (missing) dependents: [service

                jboss.naming.context.java.comp.xxxx-ear.xxxx-ejb.BusinessEventMonitoringMDB.HandleDelegate,

                service jboss.naming.context.java.comp.xxxx-ear.xxxx-ejb.BusinessEventMonitoringMDB.ORB,

                service jboss.naming.context.java.comp.xxxx-ear.xxxx-ejb.BusinessEventMonitoringMDB.Validator,

                service jboss.naming.context.java.comp.xxxx-ear.xxxx-ejb.BusinessEventMonitoringMDB.ValidatorFactory]

                      service jboss.naming.context.java.comp.xxxx-ear.xxxx-ejb.BusinssEventForPersistenceMDB

                (missing) dependents: [service

                jboss.naming.context.java.comp.xxxx-ear.xxxx-ejb.BusinssEventForPersistenceMDB.ValidatorFactory,

                service jboss.naming.context.java.comp.xxxx-ear.xxxx-ejb.BusinssEventForPersistenceMDB.ORB,

                service jboss.naming.context.java.comp.xxxx-ear.xxxx-ejb.BusinssEventForPersistenceMDB.HandleDelegate,

                service jboss.naming.context.java.comp.xxxx-ear.xxxx-ejb.BusinssEventForPersistenceMDB.Validator]


                ....


                ERROR [org.jboss.as] (Controller Boot Thread) JBAS015875: JBoss AS

                7.1.3.Final "Arges" started (with errors) in 12188ms - Started 550 of

                738 services (88 services failed or missing dependencies, 97 services

                are passive or on-demand)

                • 5. Re: Spring Petclinic (2013 version) doesn't work in JBoss AS 7
                  Tomaz Cerar Master

                  Hi,

                   

                  i would say that you are mixing 3.1.3 and 3.2.3 spring jars...

                   

                  lets continue in other thread

                  • 7. Re: Spring Petclinic (2013 version) doesn't work in JBoss AS 7
                    heng li Newbie

                    Hi,John,

                     

                    Have you managed to solve it?   I meet the same problem using Spring  3.2.3 under JBoss 7.1.1.Final.

                     

                    If it was really a bug , what shall we do ?

                     

                    Many thanks

                     

                    Regards

                     

                    heng li

                    • 8. Re: Spring Petclinic (2013 version) doesn't work in JBoss AS 7
                      John Anderson Newbie

                      Hi heng li,

                       

                      Please see stackoverflow link in my previous post, I described the solution there.

                      • 9. Re: Spring Petclinic (2013 version) doesn't work in JBoss AS 7
                        Chris Bitmead Newbie

                        I don't see any solution given above. I'm NOT deploying in eclipse, I'm building and deploying straight to JBoss and I get the same error in my app. Spring 4, JBoss EAS 6.1.

                        • 10. Re: Spring Petclinic (2013 version) doesn't work in JBoss AS 7
                          John Anderson Newbie

                          Ok, if you don't see it, I just copypaste it here:

                          The problem only occurs when I run the sample from Eclipse using JBoss. As Andrzej said, building the app with standalone maven and deploying the resulting war works fine. The problem is JBoss/JBoss Tools use incorrect war name and context root when deploying from Eclipse. In pom.xml the war name is specified as <warName>petclinic</warName>, but JBoss uses "spring-petclinic" instead. Tomcat, Glassfish, and Weblogic don't have this problem and work correctly with deployment from Eclipse.

                          The workaround is either to use http://localhost:8080/spring-petclinic/ instead of http://localhost:8080/petclinic/ or configure the context root via WEB-INF/jboss-web.xml:

                          <jboss-web>
                              <context-root>petclinic</context-root>
                          </jboss-web>

                           

                          As you can see, it clearly states that in my case the problem only occurs when deploying from Eclipse, so if you don't use Eclipse you must have another unrelated problem.

                          If you're talking about Benoit's issue, you can find the solution here: https://community.jboss.org/thread/231235

                          • 11. Re: Spring Petclinic (2013 version) doesn't work in JBoss AS 7
                            Anton Arhipov Newbie

                            Unfortunately, the hint above is not helping. There are several errors when running the latest petclinic app with JBoss 7.1.1.Final, and it fails in the same was if you run it from IDE or from the command line.. it just doesn't matter.

                            Latest petclinic uses JPA 2.1 and JBoss 7.1.1 comes with JPA 2.0 and that will cause deployment failure:

                             

                            11:42:38,247 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/petclinic]] (MSC service thread 1-3) Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [spring/business-config.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: javax.persistence.JoinColumn.foreignKey()Ljavax/persistence/ForeignKey;

                              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1568) [spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE]

                              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:540) [spring-beans-4.1.1.RELEASE.jar:4.1.1.RELEASE]

                             

                            Upgrading to WildFly 8.1 does help - the application deploys, but then the Dandelion library does not support VFS, and the fix is scheduled for 0.11.0 milestone which is not released yet: https://github.com/dandelion/dandelion/issues/23

                             

                            So there are multiple issues for running latest spring petclinic on JBoss 7.1: need to downgrade the persistence libraries, and rewrite a bit of JSP code.