1 Reply Latest reply on May 31, 2007 10:40 AM by youngm

    Spring Tutorial problem

    berlanda luigi Newbie

      To give this problem better visibility I have also posted this problem in the beginners corner forum.

      While going through the Jboss Seam examples as a tutorial/learning exercise, I encountered a problem with only the Seam-Spring tutorial example.

      The Seam-Spring example generates a java.lang.NullPointerException error.

      2007-05-29 16:56:43,534 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/seam
      -spring]] Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener
      org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML doc
      ument from ServletContext resource [/WEB-INF/applicationContext.xml]; nested exception is java.lang.NullPointerException
      Caused by: java.lang.NullPointerException
       at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.decorateIfRequired(BeanDefinitionParserDelegate.java:1142)

      Based on what I have read in the Jboss forums, I think I have a ClassLoader problem. But I do not know why? (as this is a stock tutorial example)

      The following software versions are installed on my computer.
      Jboss AS=4.0.5-r2
      Spring =2.0.3
      Jboss Seam=1.2.1 GA

      While disecting the problem, I reduced the Spring configuration file applicationContext.xml to the bare minimum while preserving the same generated error. (All other files in the tutorial are untouched)

      <?xml version="1.0" encoding="UTF-8"?>
      <beans xmlns="http://www.springframework.org/schema/beans"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans
       http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
       http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd
       http://jboss.com/products/seam/spring-seam http://jboss.com/products/seam/spring-seam-1.2.xsd
       http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd"
       <bean id="userService" class="org.jboss.seam.example.spring.UserService">
       <property name="entityManager" ref="em"/>
       <seam:component />
       <seam:instance name="entityManager" id="em" proxy="true"/>

      What can I do to make Spring register, the userService bean as a component with Seam/SeamListener ?

      Any ideas anyone?
      Thanks in advance

        • 1. Re: Spring Tutorial problem
          youngm Novice

          It appears that for some reason it's not finding the spring-seam namespace handler. Have you attempted to use a straight build of the example? Does that work with your configuration? Are there any other differences in ear/war structure or difference in .jars in the WEB-INF/lib?