2 Replies Latest reply on Mar 31, 2009 11:08 AM by marius.bogoevici

    Spring in Jboss

    dito.subandono

      Hi there. I'm quite new to jboss. I have some questions
      I'm running
      - JDK 1.6
      - JBoss 4.2.3
      - Spring Framework 2.5.6
      - Netbean IDE 6.5

      I'm trying to deploy a simple Spring project without spring lib packaged
      inside the war but i want the spring lib are copied inside /server/default/lib so the lib is shared. I have copied

      jstl.jar
      spring-2.5.jar
      spring-webmvc-2.5.jar
      standard.jar

      to /server/default/lib

      when i access a jsp file with the following code :

      <%@page contentType="text/html" pageEncoding="UTF-8"%>
      <%@taglib uri="http://www.springframework.org/tags" prefix="spring" %>
      
      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
      
      <html>
       <head>
       <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
       <title>Enter your name</title>
       </head>
       <body>
       <h2>Enter your name</h2>
      
       <spring:nestedPath path="name">
       <form action="" method="post">
       Name:
       <spring:bind path="value">
       <input type="text" name="${status.expression}" value="${status.value}">
       </spring:bind>
       <input type="submit" value="OK">
       </form>
       </spring:nestedPath>
      
       </body>
      </html>



      i get this following error :

      org.apache.jasper.JasperException: The absolute uri: http://www.springframework.org/tags cannot be resolved in either web.xml or the jar files deployed with this application
      



      i think JBoss/Spring integration could help me solve the problem.
      But when i download spring-deployer 2.1 and deploy it to jboss i get this following error :

      10:21:35,561 ERROR [MainDeployer] Could not create deployment: file:/Users/dito/servers/jboss-4.2.3.GA/server/default/deploy/jboss-spring.deployer/
      org.jboss.deployment.DeploymentException: Cannot instanciate MBean: org.jboss.spring.deployment.SpringDeployer; - nested throwable: (javax.management.NotCompliantMBeanException: Cannot instanciate MBean: org.jboss.spring.deployment.SpringDeployer)


      really appreciate any help.
      thanks in advance






        • 1. Re: Spring in Jboss
          dito.subandono

          forgot to include another error report. when the project was deployed
          i get this error :

          11:21:17,918 WARN [JAXWSDeployerHookPreJSE] Cannot load servlet class: org.springframework.web.servlet.DispatcherServlet
          11:21:17,921 INFO [TomcatDeployer] deploy, ctxPath=/HelloSpring, warUrl=.../tmp/deploy/tmp7829HelloSpring-exp.war/
          11:21:17,971 ERROR [[/HelloSpring]] Error configuring application listener of class org.springframework.web.context.ContextLoaderListener
          java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener


          as if the spring in /server/default/lib is not loaded or recognized.

          thank you

          • 2. Re: Spring in Jboss
            marius.bogoevici

            A few hints:

            1) If you're running a web application using Spring in JBoss, you won't need the Spring Deployer. So, just go ahead and deploy your application as a regular web-app.

            2) The fact that the taglibs are not recognized won't be solved by using the Spring deployer. The jars in /server/default/lib won't be scanned for tag definitions automatically (the classes, however, will be found). You can either place the jars in your WEB-INF/lib directory of your Jar, or set them correspondingly in jboss-web.deployer.

            3) for org.springframework.web.context.ContextLoaderListener you will also need to have spring-web.jar on your classpath.

            Hope that helps,
            Marius