2

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 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.

Update:

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>
Community
  • 1
  • 1
John29
  • 3,340
  • 3
  • 32
  • 50

1 Answers1

1

The Spring Petclinic (2013 version) works well with Jboss AS7. Tried it with two Jboss versions. What you need is to build app with maven and deploy it to standalone/deployments folder. Problem is running it from Eclipse Juno.

Andrzej Łach
  • 307
  • 2
  • 5
  • Thanks, but it didn't help me. It's one of the many articles about the old Petclinic sample. The new one was significantly changed. – John29 Apr 26 '13 at 18:11
  • Right, I missed that you refer to the latest and refactored Petclinic version – Andrzej Łach Apr 26 '13 at 20:02
  • I gave it a quick try and was able to run it. My Jboss is 6.0.0.GA (AS 7.1.2.Final-redhat-1). Can see main page and navigate app. – Andrzej Łach Apr 27 '13 at 01:59
  • Ok, thanks, I'll try to update my JBoss. Anyway it would be good to know what is the problem with AS 7.1.1.Final and how can I debug 404 errors like this one? – John29 Apr 27 '13 at 08:26
  • 1
    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 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. Maybe I need to change some settings in JBoss? – John29 Apr 29 '13 at 09:03
  • I started jboss with default configuration: standalone.bat. 404 error would mean that jboss has started but app wasn't deployed. Difficult to answer where the problem is. Sorry, but I never worked with spring mvc. In your place I would try to start with scratch application, as simple as possible like web.xml with some static page and then start adding components one by one to find when it fails. – Andrzej Łach Apr 29 '13 at 12:07
  • JBoss says it's deployed: `INFO [org.jboss.as.server] (ServerService Thread Pool -- 26) JBAS0 18559: Deployed "spring-petclinic.war" (runtime-name : "spring-petclinic.war")`. I tried a few very simple spring mvc examples and they worked. The problem is I'm new to spring mvc and adding components one by one is not an easy task for me. – John29 Apr 29 '13 at 13:23
  • Tried with 7.1.1.Final and it works;) See log: '16:54:09,648 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "petclinic.war"'. I see that your app is 'spring-petclinic.war' when mine is 'petclinic.war' ?. I build it with maven and copied spring-petclinic-master\target\petclinic.war to %JBOSS_HOME%\standalone\deployments\ – Andrzej Łach Apr 29 '13 at 15:04
  • I guess that's the difference: you've used standalone maven and I used eclipse with maven and jboss plugins. I'll try to do it the same way, but if you have eclipse I'd really appreciate if you could try to run it in there. – John29 Apr 29 '13 at 16:18
  • Actually I dont use Eclipse and I also don't have experience on integrating it with Jboss. I edited my answer, please edit your question or raise a new one indicating that the Eclipse is the issue. Maybe google for Eclipse issues with such case. – Andrzej Łach Apr 29 '13 at 20:50
  • I finally figured out what the problem was. The key is the different war names. Thank you very much for pointing it out! I edited my question to describe the solution. – John29 Apr 30 '13 at 15:28