Announcement Announcement Module
Collapse
No announcement yet.
BeanCreationException Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • BeanCreationException

    I use Spring 2.0.m3, hibernate , and Tomcat 5.0

    The deployment on Tomcat works fine but I have to deploy the application on
    SunAppServer 8.2 and this is my problem. When I started the deployment process i got the following errors:

    [#|2006-05-31T03:12:34.585+0200|INFO|sun-appserver-pe8.2|javax.enterprise.system.stream.out|_ThreadID =12;|ERROR --- ContextLoader.initWebApplicationContext(205) | Context initialization failed
    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'homeController' defined in ServletContext resource [/WEB-INF/mb-servlet.xml]: Cannot resolve reference to bean 'movieButlerService' while setting bean property 'movieButlerService'; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'movieButlerService' defined in ServletContext resource [/WEB-INF/mb-service.xml]: Cannot resolve reference to bean 'countryService' while setting bean property 'countryService'; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'countryService' defined in ServletContext resource [/WEB-INF/mb-service.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.FatalBeanException: Could not instantiate class [org.springframework.transaction.interceptor.Transa ctionProxyFactoryBean]; constructor threw exception; nested exception is java.lang.ExceptionInInitializerError: null
    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'movieButlerService' defined in ServletContext resource [/WEB-INF/mb-service.xml]: Cannot resolve reference to bean 'countryService' while setting bean property 'countryService'; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'countryService' defined in ServletContext resource [/WEB-INF/mb-service.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.FatalBeanException: Could not instantiate class [org.springframework.transaction.interceptor.Transa ctionProxyFactoryBean]; constructor threw exception; nested exception is java.lang.ExceptionInInitializerError: null
    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'countryService' defined in ServletContext resource [/WEB-INF/mb-service.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.FatalBeanException: Could not instantiate class [org.springframework.transaction.interceptor.Transa ctionProxyFactoryBean]; constructor threw exception; nested exception is java.lang.ExceptionInInitializerError: null
    org.springframework.beans.FatalBeanException: Could not instantiate class [org.springframework.transaction.interceptor.Transa ctionProxyFactoryBean]; constructor threw exception; nested exception is java.lang.ExceptionInInitializerError: null
    java.lang.ExceptionInInitializerError
    at net.sf.cglib.core.KeyFactory$Generator.generateCla ss(KeyFactory.java:166)
    at net.sf.cglib.core.DefaultGeneratorStrategy.generat e(DefaultGeneratorStrategy.java:25)
    at net.sf.cglib.core.AbstractClassGenerator.create(Ab stractClassGenerator.java:216)
    at net.sf.cglib.core.KeyFactory$Generator.create(KeyF actory.java:144)
    at net.sf.cglib.core.KeyFactory.create(KeyFactory.jav a:116)
    at net.sf.cglib.core.KeyFactory.create(KeyFactory.jav a:108)
    at net.sf.cglib.core.KeyFactory.create(KeyFactory.jav a:104)
    at net.sf.cglib.proxy.Enhancer.<clinit>(Enhancer.java :69)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:164)
    at
    .......
    The servlet.xml file looks like this

    <bean name="homeController" class="com.moviebutler.controller.anybody.HomeCont roller">
    <property name="movieButlerService" ref="movieButlerService" />
    <property name="greeting" value="Welcome to the Movie Butler!" />
    </bean>

    <bean name="indexController" class="com.moviebutler.controller.anybody.IndexCon troller">
    <property name="movieButlerService" ref="movieButlerService" />
    </bean>
    .......
    The Service-Xml looks like this

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">

    <beans>
    <bean id="countryService" class="org.springframework.transaction.interceptor .TransactionProxyFactoryBean">
    <property name="transactionManager" ref="transactionManager" />
    <property name="target">
    <bean class="com.moviebutler.service.impl.CountryService ">
    <property name="countryDao" ref="countryDaoHibernate" />
    </bean>
    </property>
    <property name="transactionAttributes">
    <props>
    <prop key="*">PROPAGATION_REQUIRED</prop>
    </props>
    </property>
    </bean>
    .....

    <bean id="trailerService" class="org.springframework.transaction.interceptor .TransactionProxyFactoryBean">
    <property name="transactionManager" ref="transactionManager" />
    <property name="target">
    <bean class="com.moviebutler.service.impl.TrailerService ">
    <property name="trailerDao" ref="trailerDaoHibernate" />
    </bean>
    </property>
    <property name="transactionAttributes">
    <props>
    <prop key="*">PROPAGATION_REQUIRED</prop>
    </props>
    </property>
    </bean>

    <bean id="mediumService" class="org.springframework.transaction.interceptor .TransactionProxyFactoryBean">
    <property name="transactionManager" ref="transactionManager" />
    <property name="target">
    <bean class="com.moviebutler.service.impl.MediumService" >
    <property name="mediumDao" ref="mediumDaoHibernate" />
    </bean>
    </property>
    <property name="transactionAttributes">
    <props>
    <prop key="*">PROPAGATION_REQUIRED</prop>
    </props>
    </property>
    </bean>

    <bean name="ageRestrictionService" class="com.moviebutler.service.impl.AgeRestriction Service">
    <property name="ageRestrictionDao" ref="ageRestrictionDaoHibernate" />
    </bean>

    <bean name="genreService" class="com.moviebutler.service.impl.GenreService">
    <property name="genreDao" ref="genreDaoHibernate"/>
    </bean>

    <bean name="movieButlerService" class="com.moviebutler.service.MovieButlerService" >
    <property name="countryService" ref="countryService" />
    <property name="editionService" ref="editionService" />
    <property name="editionTypeService" ref="editionTypeService" />
    <property name="languageService" ref="languageService" />
    <property name="imageService" ref="imageService" />
    <property name="trailerService" ref="trailerService" />
    <property name="ageRestrictionService" ref="ageRestrictionService" />
    <property name="genreService" ref="genreService" />
    <property name="movieService" ref="movieService" />
    <property name="mediumService" ref="mediumService" />
    <property name="personService" ref="personService" />
    <property name="ratingService" ref="ratingService" />
    <property name="rentalService" ref="rentalService" />
    <property name="roleService" ref="roleService" />
    <property name="userService" ref="userService" />
    <property name="wishlistEntryService" ref="wishlistEntryService" />
    </bean>
    .....
    I already have no clue whats the reason for the problems during the process of deployment.

    Thanks for your Help

  • #2
    I would take the error message at face value, namely that it can't find the Java objects it says it can't find.

    There are probably classloader/library differences between Sun app server and Tomcat. I suspect that is your problem. First of all, make sure that your JARs and compiled classes are all getting deployed to the Sun app server just like they are to Tomcat. Then it may be an issue of determining that the Sun app server is indeed loading all those JARs and compiled classes. I don't know the Sun app server, so I cannot help you there--it may be an issue of going to a Sun forum and asking about how to determine which classes are being loaded by the Sun app server classloader.

    Glen

    Comment


    • #3
      Thanks for your fast replie I will check this

      Comment

      Working...
      X