1 Reply Latest reply on Nov 25, 2011 9:49 AM by marius.bogoevici

    hello world example not working

    kdougan

      I am new to Spring 3 so I thought I would try out Snowdrop 2 on Jboss 6.  So I downloaded the spring deployer from http://www.jboss.org/snowdrop/downloads and selected the JBoss AS 6 with Spring 3. Seems pretty easy to install in JBoss's server/default/deployers/spring.deployer/ directory.  I did however bundle the spring .jars within the application archive as you will see below.

       

      I found a simple hello world example to try out: http://viralpatel.net/blogs/2010/06/spring-3-mvc-create-hello-world-application-spring-3-mvc.html.  However I could not get the example to work so I am frustrated.  I also didn't like that I have to do this all through eclipse.  I wanted to understand how to deploy a .war/.jar directly to server/default/deploy/.

       

      So what I did was package the example with the following:

       

      C:\MyProjects\eclipse\workspace\Spring3MVC\dist>jar tvf Spring3MVC.war
           0 Thu Nov 24 09:18:24 MST 2011 META-INF/
          71 Thu Nov 24 09:18:24 MST 2011 META-INF/MANIFEST.MF
         144 Mon Jun 21 17:38:52 MDT 2010 index.jsp
           0 Thu Nov 24 09:17:34 MST 2011 WEB-INF/
           0 Thu Nov 24 09:17:34 MST 2011 WEB-INF/classes/
           0 Thu Nov 24 09:17:34 MST 2011 WEB-INF/classes/net/
           0 Thu Nov 24 09:17:34 MST 2011 WEB-INF/classes/net/viralpatel/
           0 Thu Nov 24 09:17:34 MST 2011 WEB-INF/classes/net/viralpatel/spring3/
           0 Thu Nov 24 09:17:34 MST 2011 WEB-INF/classes/net/viralpatel/spring3/controller/
        1022 Wed Nov 23 21:50:20 MST 2011 WEB-INF/classes/net/viralpatel/spring3/controller/HelloWorldController.class
           0 Thu Nov 24 09:17:34 MST 2011 WEB-INF/jsp/
         131 Mon Jun 21 17:39:02 MDT 2010 WEB-INF/jsp/hello.jsp
           0 Thu Nov 24 09:17:34 MST 2011 WEB-INF/lib/
        4467 Fri Aug 26 21:19:32 MDT 2011 WEB-INF/lib/aopalliance.jar
      69784 Tue Oct 18 15:51:00 MDT 2011 WEB-INF/lib/snowdrop-deployers.jar
      22804 Tue Oct 18 15:50:48 MDT 2011 WEB-INF/lib/snowdrop-vfs.jar
      321428 Tue Oct 18 15:50:38 MDT 2011 WEB-INF/lib/spring-aop.jar
      53082 Tue Oct 18 15:50:36 MDT 2011 WEB-INF/lib/spring-asm.jar
      556590 Tue Oct 18 15:50:42 MDT 2011 WEB-INF/lib/spring-beans.jar
      101450 Tue Oct 18 15:50:40 MDT 2011 WEB-INF/lib/spring-context-support.jar
      670258 Tue Oct 18 15:50:38 MDT 2011 WEB-INF/lib/spring-context.jar
      382184 Tue Oct 18 15:50:38 MDT 2011 WEB-INF/lib/spring-core.jar
      169752 Tue Oct 18 15:50:38 MDT 2011 WEB-INF/lib/spring-expression.jar
      398149 Tue Oct 18 15:50:44 MDT 2011 WEB-INF/lib/spring-web.jar
      419488 Tue Oct 18 15:50:40 MDT 2011 WEB-INF/lib/spring-webmvc.jar
         922 Sat Jun 19 15:58:10 MDT 2010 WEB-INF/spring-servlet.xml
         806 Mon Jun 21 19:20:26 MDT 2010 WEB-INF/web.xml

       

      If you need to see the source then go to http://viralpatel.net/blogs/2010/06/spring-3-mvc-create-hello-world-application-spring-3-mvc.html.   I didn't change anything.  All I did was create a deployable archive.  But it doesn't not work when I click on the 'Say Hello' link in the index.jsp I get the following message:

       

      message /Spring3MVC/hello

       

      description The requested resource (/Spring3MVC/hello) is not available.


      If I look in the Jboss \server\default\work\ directory I only see the index.jsp servlet.  So there must be something wrong with the deployment package and the spring .xml files.

       

      Does anyone have any advice how to fix this please?

       

      Thanks

      Ken

        • 1. Re: hello world example not working
          marius.bogoevici

          Ken,

           

          The example does not use the deployer directly, so you can leave that part out.

           

          Please submit a stacktrace to figure out the issue. One thing I can see from the start: the example is using Spring 3.0.1 which is not working on JBoss AS 6 due to: https://jira.springframework.org/browse/SPR-7197, so please upgrade to Spring 3.0.6 (latest, which is always best).

           

          Marius