Results 1 to 12 of 12
  1. #1
    shashi5543 is offline Member
    Join Date
    Jun 2012
    Posts
    6
    Rep Power
    0

    Default URGENT HELP needed : org.springframework.beans.factory.BeanCreationExce ption

    following is the stack-trace:
    SEVERE: Exception sending context initialized event to listener instance of class com.village.pampers.web.listener.InitListener
    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/conf/spring/spring-hibernate.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Mapping directory location [ServletContext resource [/WEB-INF/classes/com/village/pampers/core/magazine/dao/hibernate/mapping/]] does not denote a directory

    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.initializeBean(Abstract AutowireCapableBeanFactory.java:1412)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:519)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:456)
    at org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject(AbstractBeanFactory.java:2 91)
    at org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry.getSingleton(DefaultSingleton BeanRegistry.java:222)
    at org.springframework.beans.factory.support.Abstract BeanFactory.doGetBean(AbstractBeanFactory.java:288 )
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:190)
    at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:546)
    at org.springframework.context.support.AbstractApplic ationContext.finishBeanFactoryInitialization(Abstr actApplicationContext.java:872)
    at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:423)
    at org.springframework.web.context.ContextLoader.crea teWebApplicationContext(ContextLoader.java:276)
    at org.springframework.web.context.ContextLoader.init WebApplicationContext(ContextLoader.java:197)
    at org.springframework.web.context.ContextLoaderListe ner.contextInitialized(ContextLoaderListener.java: 47)
    at org.apache.catalina.core.StandardContext.listenerS tart(StandardContext.java:4205)
    at org.apache.catalina.core.StandardContext.start(Sta ndardContext.java:4704)
    at org.apache.catalina.core.ContainerBase.addChildInt ernal(ContainerBase.java:799)
    at org.apache.catalina.core.ContainerBase.addChild(Co ntainerBase.java:779)
    at org.apache.catalina.core.StandardHost.addChild(Sta ndardHost.java:601)
    at org.apache.catalina.startup.HostConfig.deployDescr iptor(HostConfig.java:675)
    at org.apache.catalina.startup.HostConfig.deployDescr iptors(HostConfig.java:601)
    at org.apache.catalina.startup.HostConfig.deployApps( HostConfig.java:502)
    at org.apache.catalina.startup.HostConfig.start(HostC onfig.java:1315)
    at org.apache.catalina.startup.HostConfig.lifecycleEv ent(HostConfig.java:324)
    at org.apache.catalina.util.LifecycleSupport.fireLife cycleEvent(LifecycleSupport.java:142)
    at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1061)
    at org.apache.catalina.core.StandardHost.start(Standa rdHost.java:840)
    at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1053)
    at org.apache.catalina.core.StandardEngine.start(Stan dardEngine.java:463)
    at org.apache.catalina.core.StandardService.start(Sta ndardService.java:525)
    at org.apache.catalina.core.StandardServer.start(Stan dardServer.java:754)
    at org.apache.catalina.startup.Catalina.start(Catalin a.java:595)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.catalina.startup.Bootstrap.start(Bootst rap.java:289)
    at org.apache.catalina.startup.Bootstrap.main(Bootstr ap.java:414)
    Caused by: java.lang.IllegalArgumentException: Mapping directory location [ServletContext resource [/WEB-INF/classes/com/village/pampers/core/magazine/dao/hibernate/mapping/]] does not denote a directory
    at org.springframework.orm.hibernate3.LocalSessionFac toryBean.buildSessionFactory(LocalSessionFactoryBe an.java:707)
    at org.springframework.orm.hibernate3.AbstractSession FactoryBean.afterPropertiesSet(AbstractSessionFact oryBean.java:211)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.invokeInitMethods(Abstr actAutowireCapableBeanFactory.java:1469)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.initializeBean(Abstract AutowireCapableBeanFactory.java:1409)
    ... 36 more
    Last edited by shashi5543; 06-13-2012 at 10:15 AM.

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,224
    Rep Power
    20

    Default Re: URGENT HELP needed : org.springframework.beans.factory.BeanCreationExce ption

    Seems fairly c lear from the message:
    [/WEB-INF/classes/com/village/pampers/core/magazine/dao/hibernate/mapping/
    isn't a directory.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    shashi5543 is offline Member
    Join Date
    Jun 2012
    Posts
    6
    Rep Power
    0

    Default Re: URGENT HELP needed : org.springframework.beans.factory.BeanCreationExce ption

    Quote Originally Posted by Tolls View Post
    Seems fairly c lear from the message:
    [/WEB-INF/classes/com/village/pampers/core/magazine/dao/hibernate/mapping/
    isn't a directory.
    Thx for replying Tolls, but why can't it be a directory.
    here is my spring-hibernate.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
    xmlns:tx="http://www.springframework.org/schema/tx" xmlns:jee="http://www.springframework.org/schema/jee"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schem...-beans-2.0.xsd
    Index of /schema/aop http://www.springframework.org/schem...ng-aop-2.0.xsd
    Index of /schema/tx http://www.springframework.org/schem...ing-tx-2.0.xsd
    Index of /schema/jee http://www.springframework.org/schema/jee/spring-jee-2.0.xsd">

    <jee:jndi-lookup id="dataSource" jndi-name="java:comp/env/jdbc/Pamp25weDevDataSource"/>
    <bean id="sessionFactory"
    class="org.springframework.orm.hibernate3.LocalSes sionFactoryBean">
    <property name="dataSource">
    <ref local="dataSource" />
    </property>
    <property name="mappingDirectoryLocations">
    <list>
    <value>WEB-INF/classes/com/village/pampers/core/contentengine/dao/hibernate/mapping/</value>
    <value>WEB-INF/classes/com/village/pampers/core/user/dao/hibernate/mapping/</value>
    <value>WEB-INF/classes/com/village/pampers/core/locale/dao/hibernate/mapping/</value>
    <value>WEB-INF/classes/com/village/pampers/core/urlmapper/dao/hibernate/mapping/</value>
    <value>WEB-INF/classes/com/village/pampers/core/tools/babynamer/dao/hibernate/mapping/</value>
    <value>WEB-INF/classes/com/village/pampers/core/tools/widget/dao/hibernate/mapping/</value>
    <value>WEB-INF/classes/com/village/pampers/core/jforum/dao/hibernate/mapping/</value>
    <value>WEB-INF/classes/com/village/liveworld/dao/hibernate/mapping/</value>
    <value>WEB-INF/classes/com/village/pampers/core/braun/dao/hibernate/mapping/</value>
    <value>WEB-INF/classes/com/village/pampers/core/m3pp/dao/hibernate/mapping/</value>
    <value>WEB-INF/classes/com/village/pampers/core/daycare/dao/hibernate/mapping/</value>
    <value>WEB-INF/classes/com/village/pampers/core/gtg/dao/hibernate/mapping/</value>
    <value>WEB-INF/classes/com/village/pampers/core/feedback/dao/hibernate/mapping/</value>
    <value>WEB-INF/classes/com/village/pampers/core/tools/rtmMailUpdate/dao/hibernate/mapping/</value>
    <value>WEB-INF/classes/com/village/pampers/core/magazine/dao/hibernate/mapping/</value>
    </list>
    </property>
    <property name="hibernateProperties">
    <props>
    <prop key="hibernate.cache.use_second_level_cache">true</prop>
    <prop key="hibernate.cache.use_query_cache">true</prop>
    <prop key="hibernate.cache.region.factory_class">net.sf. ehcache.hibernate.EhCacheRegionFactory</prop>
    <prop key="net.sf.ehcache.configurationResourceName">/ehcache.xml</prop>
    <prop key="hibernate.dialect">org.hibernate.dialect.Orac le10gDialect</prop>
    <prop key="hibernate.default_batch_fetch_size">50</prop>
    <!-- PLeaase keep it commented on Production server -->
    <prop key="hibernate.show_sql">false</prop>
    <prop key="hibernate.format_sql">false</prop>
    </props>
    </property>
    </bean>
    <bean id="transactionManager"
    class="org.springframework.orm.hibernate3.Hibernat eTransactionManager">
    <property name="sessionFactory" ref="sessionFactory" />
    </bean>
    <!-- Transaction Advice -->
    <tx:advice id="txAdvice">
    <tx:attributes>
    <tx:method name="*" />
    </tx:attributes>
    </tx:advice>
    </beans>

    suggest me the changes if any.

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,224
    Rep Power
    20

    Default Re: URGENT HELP needed : org.springframework.beans.factory.BeanCreationExce ption

    Does that directory exist?
    If not then the error is self explanatory.
    You have told Spring that there is a directory at that location which may or may not contain spring mapping files, except there isn't a directory there.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  5. #5
    shashi5543 is offline Member
    Join Date
    Jun 2012
    Posts
    6
    Rep Power
    0

    Default Re: URGENT HELP needed : org.springframework.beans.factory.BeanCreationExce ption

    Yes the directory exists at this path :build\classes\com\village\pampers\core\contenteng ine\dao\hibernate\mapping i changed the property value to this path and in the mapping folder lots of hbm files are present but the error is still the same.
    SEVERE: Exception sending context initialized event to listener instance of class com.village.pampers.web.listener.InitListener
    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/conf/spring/spring-hibernate.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Mapping directory location [ServletContext resource [/build/classes/com/village/pampers/core/magazine/dao/hibernate/mapping/]] does not denote a directory
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.initializeBean(Abstract AutowireCapableBeanFactory.java:1412)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:519)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:456)
    at org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject(AbstractBeanFactory.java:2 91)
    at org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry.getSingleton(DefaultSingleton BeanRegistry.java:222)
    at org.springframework.beans.factory.support.Abstract BeanFactory.doGetBean(AbstractBeanFactory.java:288 )
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:190)
    at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:546)
    at org.springframework.context.support.AbstractApplic ationContext.finishBeanFactoryInitialization(Abstr actApplicationContext.java:872)
    at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:423)
    at org.springframework.web.context.ContextLoader.crea teWebApplicationContext(ContextLoader.java:276)
    at org.springframework.web.context.ContextLoader.init WebApplicationContext(ContextLoader.java:197)
    at org.springframework.web.context.ContextLoaderListe ner.contextInitialized(ContextLoaderListener.java: 47)
    at org.apache.catalina.core.StandardContext.listenerS tart(StandardContext.java:4205)
    at org.apache.catalina.core.StandardContext.start(Sta ndardContext.java:4704)
    at org.apache.catalina.core.ContainerBase.addChildInt ernal(ContainerBase.java:799)
    at org.apache.catalina.core.ContainerBase.addChild(Co ntainerBase.java:779)
    at org.apache.catalina.core.StandardHost.addChild(Sta ndardHost.java:601)
    at org.apache.catalina.startup.HostConfig.deployDescr iptor(HostConfig.java:675)
    at org.apache.catalina.startup.HostConfig.deployDescr iptors(HostConfig.java:601)
    at org.apache.catalina.startup.HostConfig.deployApps( HostConfig.java:502)
    at org.apache.catalina.startup.HostConfig.start(HostC onfig.java:1315)
    at org.apache.catalina.startup.HostConfig.lifecycleEv ent(HostConfig.java:324)
    at org.apache.catalina.util.LifecycleSupport.fireLife cycleEvent(LifecycleSupport.java:142)
    at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1061)
    at org.apache.catalina.core.StandardHost.start(Standa rdHost.java:840)
    at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1053)
    at org.apache.catalina.core.StandardEngine.start(Stan dardEngine.java:463)
    at org.apache.catalina.core.StandardService.start(Sta ndardService.java:525)
    at org.apache.catalina.core.StandardServer.start(Stan dardServer.java:754)
    at org.apache.catalina.startup.Catalina.start(Catalin a.java:595)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.catalina.startup.Bootstrap.start(Bootst rap.java:289)
    at org.apache.catalina.startup.Bootstrap.main(Bootstr ap.java:414)
    Caused by: java.lang.IllegalArgumentException: Mapping directory location [ServletContext resource [/build/classes/com/village/pampers/core/magazine/dao/hibernate/mapping/]] does not denote a directory
    at org.springframework.orm.hibernate3.LocalSessionFac toryBean.buildSessionFactory(LocalSessionFactoryBe an.java:707)
    at org.springframework.orm.hibernate3.AbstractSession FactoryBean.afterPropertiesSet(AbstractSessionFact oryBean.java:211)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.invokeInitMethods(Abstr actAutowireCapableBeanFactory.java:1469)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.initializeBean(Abstract AutowireCapableBeanFactory.java:1409)
    ... 36 more

  6. #6
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,224
    Rep Power
    20

    Default Re: URGENT HELP needed : org.springframework.beans.factory.BeanCreationExce ption

    Which is wrong.
    You are running this up on a server, which usually does not have a build directory.
    If you (as in you, not Spring) are looking for the directory in your project rather than where it is deployed on the server then you'll never get this right.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  7. #7
    shashi5543 is offline Member
    Join Date
    Jun 2012
    Posts
    6
    Rep Power
    0

    Default Re: URGENT HELP needed : org.springframework.beans.factory.BeanCreationExce ption

    i created the directories in web-inf as required by spring-hibernate.hbm ............but same error :(

  8. #8
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,224
    Rep Power
    20

    Default Re: URGENT HELP needed : org.springframework.beans.factory.BeanCreationExce ption

    So, show us here the directory structure in the webapp directory on the server then, and the current Spring/hinbernat config, because they don't have a habit of lying.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  9. #9
    shashi5543 is offline Member
    Join Date
    Jun 2012
    Posts
    6
    Rep Power
    0

    Default Re: URGENT HELP needed : org.springframework.beans.factory.BeanCreationExce ption

    webapps/pamp25we-dev/WEB-INF/classes/com/village/pampers/core/magazine/dao/hibernate/mapping

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
    xmlns:tx="http://www.springframework.org/schema/tx" xmlns:jee="http://www.springframework.org/schema/jee"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schem...-beans-2.0.xsd
    Index of /schema/aop http://www.springframework.org/schem...ng-aop-2.0.xsd
    Index of /schema/tx http://www.springframework.org/schem...ing-tx-2.0.xsd
    Index of /schema/jee http://www.springframework.org/schema/jee/spring-jee-2.0.xsd">

    <jee:jndi-lookup id="dataSource" jndi-name="java:comp/env/jdbc/Pamp25weDevDataSource"/>
    <bean id="sessionFactory"
    class="org.springframework.orm.hibernate3.LocalSes sionFactoryBean">
    <property name="dataSource">
    <ref local="dataSource" />
    </property>
    <property name="mappingDirectoryLocations">
    <list>
    <value>WEB-INF/classes/com/village/pampers/core/contentengine/dao/hibernate/mapping/</value>
    <value>WEB-INF/classes/com/village/pampers/core/user/dao/hibernate/mapping/</value>
    <value>WEB-INF/classes/com/village/pampers/core/locale/dao/hibernate/mapping/</value>
    <value>WEB-INF/classes/com/village/pampers/core/urlmapper/dao/hibernate/mapping/</value>
    <value>WEB-INF/classes/com/village/pampers/core/tools/babynamer/dao/hibernate/mapping/</value>
    <value>WEB-INF/classes/com/village/pampers/core/tools/widget/dao/hibernate/mapping/</value>
    <value>WEB-INF/classes/com/village/pampers/core/jforum/dao/hibernate/mapping/</value>
    <value>WEB-INF/classes/com/village/liveworld/dao/hibernate/mapping/</value>
    <value>WEB-INF/classes/com/village/pampers/core/braun/dao/hibernate/mapping/</value>
    <value>WEB-INF/classes/com/village/pampers/core/m3pp/dao/hibernate/mapping/</value>
    <value>WEB-INF/classes/com/village/pampers/core/daycare/dao/hibernate/mapping/</value>
    <value>WEB-INF/classes/com/village/pampers/core/gtg/dao/hibernate/mapping/</value>
    <value>WEB-INF/classes/com/village/pampers/core/feedback/dao/hibernate/mapping/</value>
    <value>WEB-INF/classes/com/village/pampers/core/tools/rtmMailUpdate/dao/hibernate/mapping/</value>
    <value>WEB-INF/classes/com/village/pampers/core/magazine/dao/hibernate/mapping/</value>
    </list>
    </property>
    <property name="hibernateProperties">
    <props>
    <prop key="hibernate.cache.use_second_level_cache">true</prop>
    <prop key="hibernate.cache.use_query_cache">true</prop>
    <prop key="hibernate.cache.region.factory_class">net.sf. ehcache.hibernate.EhCacheRegionFactory</prop>
    <prop key="net.sf.ehcache.configurationResourceName">/ehcache.xml</prop>
    <prop key="hibernate.dialect">org.hibernate.dialect.Orac le10gDialect</prop>
    <prop key="hibernate.default_batch_fetch_size">50</prop>
    <!-- PLeaase keep it commented on Production server -->
    <prop key="hibernate.show_sql">false</prop>
    <prop key="hibernate.format_sql">false</prop>
    </props>
    </property>
    </bean>
    <bean id="transactionManager"
    class="org.springframework.orm.hibernate3.Hibernat eTransactionManager">
    <property name="sessionFactory" ref="sessionFactory" />
    </bean>
    <!-- Transaction Advice -->
    <tx:advice id="txAdvice">
    <tx:attributes>
    <tx:method name="*" />
    </tx:attributes>
    </tx:advice>
    </beans>

  10. #10
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,224
    Rep Power
    20

    Default Re: URGENT HELP needed : org.springframework.beans.factory.BeanCreationExce ption

    And you're getting the same excewption:
    Caused by: java.lang.IllegalArgumentException: Mapping directory location [ServletContext resource [/WEB-INF/classes/com/village/pampers/core/magazine/dao/hibernate/mapping/]] does not denote a directory
    ?
    I'd have to dig out the documentation for it then (which I can't seem to find).
    It's possible you're doing something wrong, or there's a bug in the version of Spring you're using.

    Sorry I can't be more help than that.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  11. #11
    shashi5543 is offline Member
    Join Date
    Jun 2012
    Posts
    6
    Rep Power
    0

    Default Re: URGENT HELP needed : org.springframework.beans.factory.BeanCreationExce ption

    there are other directories also on the server as per the mapping in spring.hibernate.xml why aren't they causing any exception.................

  12. #12
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,224
    Rep Power
    20

    Default Re: URGENT HELP needed : org.springframework.beans.factory.BeanCreationExce ption

    Who knows.
    If it was me I'd dig up the relevant source code and see exactly what event causes this sort of exception.
    It's possible it's picked that entry simply because it's the last in the list.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. Replies: 4
    Last Post: 03-15-2011, 10:13 AM
  2. Urgent Help Needed
    By debu_cha in forum Advanced Java
    Replies: 3
    Last Post: 12-07-2010, 10:02 PM
  3. Replies: 5
    Last Post: 02-17-2010, 08:40 PM
  4. Urgent Help needed!
    By mlwong in forum New To Java
    Replies: 0
    Last Post: 03-19-2009, 09:51 AM
  5. hi help needed, this is urgent
    By msciriha in forum NetBeans
    Replies: 1
    Last Post: 02-07-2009, 07:16 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •