Announcement Announcement Module
Collapse
No announcement yet.
Application Context and Bean Verification Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Application Context and Bean Verification

    I am having troubles getting a delegate declared for the primary business controller to instantiate and allow the controller to start. Here is the code.


    The DispatcherServlet configuration file is called icarabineer-servlet.xml

    The Application Context file is called: applicationContext-hibernate.xml I am following the example in PetClinic using Hibernate rather than JPetStore, which uses iBatis.


    I have the following controller defined in icarabineer-servlet.xml:

    <bean id="tomController" class="org.fin_it.icarabineer.icaraorder.tom.contr ollers.TomController">
    <property name="methodNameResolver"><ref local="tomControllerResolver"/></property>
    <property name=" tom "><ref bean="tom"/></property>
    </bean>

    I have the following transaction proxy set up in applicationContext-hibernate.xml:

    <bean id="baseTransactionProxy" class="org.springframework.transaction.interceptor .TransactionProxyFactoryBean" abstract="true">
    <property name="transactionManager"><ref bean="transactionManager"/></property>
    <property name="transactionAttributes">
    <props>
    <prop key="find*">PROPAGATION_REQUIRED,readOnly</prop>
    <prop key="load*">PROPAGATION_REQUIRED,readOnly</prop>
    <prop key="store*">PROPAGATION_REQUIRED</prop>
    </props>
    </property>
    </bean>


    The following is the primary business object referenced in the Controller.

    <!--
    - TOM primary business object: Hibernate implementation, as an inner bean
    - wrapped by an outer transactional proxy. The two bean definitions could have been
    - separate, but this is cleaner as there is no need to ever access the unwrapped object.
    -->
    <bean id=" tom " parent="baseTransactionProxy">
    <property name="target">
    <bean class="org.fin_it.icarabineer.icaraorder.tom.hiber nate.HibernateTOM">
    <property name="sessionFactory"><ref local="sessionFactory"/></property>
    </bean>
    </property>
    </bean>



    web.xml:


    <context-param>
    <param-name>webAppRootKey</param-name>
    <param-value>icarabineer.root</param-value>
    </context-param>

    <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>/WEB-INF/applicationContext-hibernate.xml</param-value>

    </context-param>


    <servlet>
    <servlet-name>context</servlet-name>
    <servlet-class>org.springframework.web.context.ContextLoade rlistener</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet>
    <servlet-name>icarabineer</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherSe rvlet</servlet-class>
    <load-on-startup>2</load-on-startup>
    </servlet>

    <servlet-mapping>
    <!-- Maps the icarabineer dispatcher to /*.htm -->
    <servlet-name>icarabineer</servlet-name>
    <url-pattern>*.htm</url-pattern>
    </servlet-mapping>
    <!-- Maps the icarabineer dispatcher to /*.form -->
    <servlet-mapping>
    <servlet-name>icarabineer</servlet-name>
    <url-pattern>*.form</url-pattern>
    </servlet-mapping>


    The error stated in the stack traces says the bean "tomController" can't be created because it can not resolve the bean "tom". Could the problem be with my configuration of "tom" or in the code for "tom"'s target HibernateTOM?

    Here's the code in HibernateTOM:


    package org.fin_it.icarabineer.icaraorder.tom.hibernate;

    import java.util.Collection;
    import org.springframework.dao.DataAccessException;
    import org.springframework.orm.hibernate.support.Hibernat eDaoSupport;
    import org.fin_it.icarabineer.icaraorder.tom.domain.ITom;
    import org.fin_it.icarabineer.icaraorder.tom.domain.order s.Order;

    public class HibernateTOM extends HibernateDaoSupport implements ITom
    {

    public Collection findOrders(String tr_CIOrdID) throws DataAccessException {
    return getHibernateTemplate().find("from Owner order where order.tr_CIOrdID like ?", tr_CIOrdID + "%");
    }

    public Order loadOrder(int id) throws DataAccessException {
    return (Order) getHibernateTemplate().load(Order.class, new Integer(id));
    }

    public void storeOrder(Order order) throws DataAccessException {
    getHibernateTemplate().saveOrUpdate(order);
    }
    }


    HibernateTOM implements ITom. Here is the code for ITom:

    package org.fin_it.icarabineer.icaraorder.tom.domain;
    import java.util.Collection;
    import org.fin_it.icarabineer.icaraorder.tom.domain.order s.Order;
    import org.springframework.dao.DataAccessException;

    public interface ITom {

    public Collection findOrders(String tr_CIOrdID) throws DataAccessException;

    public Order loadOrder(int id) throws DataAccessException;

    public void storeOrder(Order order) throws DataAccessException;

    }



    I followed the example in JPetStore. When I try and load the app I get the following stack trace - all suggestions would be much appreciated:

    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'tomController' defined in resource [/WEB-INF/icarabineer-servlet.xml] of ServletContext: Can't resolve reference to bean 'tom' while setting property 'tom'; nested exception is org.springframework.beans.factory.NoSuchBeanDefini tionException: No bean named 'tom' is defined: org.springframework.beans.factory.support.DefaultL istableBeanFactory defining beans [viewResolver,tomController,tomControllerResolver,f indOrdersForm,addOrderForm,editOrderForm,orderVali dator,changeAccountTypeForm,changeAccountTypeValid ator,orderMan,order1,order2,order3,messageSource,e xceptionResolver,urlMapping]; Root of BeanFactory hierarchy org.springframework.beans.factory.NoSuchBeanDefini tionException: No bean named 'tom' is defined: org.springframework.beans.factory.support.DefaultL istableBeanFactory defining beans [viewResolver,tomController,tomControllerResolver,f indOrdersForm,addOrderForm,editOrderForm,orderVali dator,changeAccountTypeForm,changeAccountTypeValid ator,orderMan,order1,order2,order3,messageSource,e xceptionResolver,urlMapping]; Root of BeanFactory hierarchy at org.springframework.beans.factory.support.DefaultL istableBeanFactory.getBeanDefinition(DefaultListab leBeanFactory.java:291) at org.springframework.beans.factory.support.Abstract BeanFactory.getMergedBeanDefinition(AbstractBeanFa ctory.java:554) at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:165) at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:136) at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.resolveReference(Abstra ctAutowireCapableBeanFactory.java:903) at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.resolveValueIfNecessary (AbstractAutowireCapableBeanFactory.java:844) at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.applyPropertyValues(Abs tractAutowireCapableBeanFactory.java:785) at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.populateBean(AbstractAu towireCapableBeanFactory.java:637) at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:271) at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:208) at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:204) at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:136) at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:230) at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:284) at org.springframework.web.context.support.XmlWebAppl icationContext.refresh(XmlWebApplicationContext.ja va:131) at org.springframework.web.servlet.FrameworkServlet.c reateWebApplicationContext(FrameworkServlet.java:2 82) at org.springframework.web.servlet.FrameworkServlet.i nitWebApplicationContext(FrameworkServlet.java:230 ) at org.springframework.web.servlet.FrameworkServlet.i nitServletBean(FrameworkServlet.java:200) at org.springframework.web.servlet.HttpServletBean.in it(HttpServletBean.java:102) at javax.servlet.GenericServlet.init(GenericServlet.j ava:211) at org.apache.catalina.core.StandardWrapper.loadServl et(StandardWrapper.java:1029) at org.apache.catalina.core.StandardWrapper.allocate( StandardWrapper.java:687) at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:144) at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:520) at org.apache.catalina.core.StandardContextValve.invo keInternal(StandardContextValve.java:198) at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:152) at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:520) at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:137) at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:104) at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:117) at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:102) at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:520) at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:109) at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:520) at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:929) at org.apache.coyote.tomcat5.CoyoteAdapter.service(Co yoteAdapter.java:160) at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:799) at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.processConnection(Http11Protocol.jav a:705) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(P oolTcpEndpoint.java:577) at org.apache.tomcat.util.threads.ThreadPool$ControlR unnable.run(ThreadPool.java:683) at java.lang.Thread.run(Thread.java:534) Cookies:

  • #2
    In the config as you list it here, there is definitely a problem in that you are referring to a bean "tom", but you define it as " tom " (note the spaces), which is not the same thing...

    Comment


    • #3
      Sorry Colin, this was a cut and paste error in the this message not the actual code. I had posted a piece meal thread on the Core forum and since it was to messed up I cut and pasted it over here. The spaces show up because in the other thread I had it formated with [color]. The tags put the extra spaces in. The code doesn't have them.

      I am at a complete stand still on adopting Spring at this time over this problem. I have looked at every line of code for spelling, syntax, and making sure it is just like the JPetStore example. I can not find the source of the problem.

      If you could help me out I would very much appreciate it.

      Thanks

      Comment


      • #4
        Whoa, hold on. This is _not_like the Petclinic/JPetstore samples. You're trying to use ContextLoaderListener, but configuring it as a servlet!

        Now the samples use ContextLoaderServlet, as opposed to ContextLoaderListener (the preferred mechanism) so that they work even in slightly older containers. But either one will work, as long as you configure it properly. Either put the ContextLoaderListener in a <listener> element, or put ContextLoaderServlet in a <servlet> element... Note also that you misspelled ContextLoaderListener as ContextLoaderlistener.

        Hopefully this should get you going...

        Comment


        • #5
          I've killed the other thread that was a duplicate of this.

          Comment


          • #6
            Colin,

            I guess this is why pair-programming has caught on in some circles. I looked over that code a dozen or two times and didn't catch that. Thanks. I got past that problem; however, I've moved on to the next problem.

            The app is not initializing my TransactionProxyFactoryBean because it can't find a referenced HibernateTransactionManager.

            Here's my code. I noticed in the JPetStore application that "dataSource" is declared in the dataAccessContext-local.xml file where I have it in the applicationContext-hibernate.xml file. Any issues here in regards to ordering? This file is (exept for possible typo's due to poor eye sight) exactly like the PetClinic applicationContext-hibernate.xml file. Is there a problem with the way I combined the two sample app configurations?

            applicationContext-hibernate.xml:


            <beans>

            <!-- ========================= GENERAL DEFINITIONS ========================= -->

            <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.Pr opertyPlaceholderConfigurer">
            <property name="location"><value>/WEB-INF/jdbc.properties</value></property>
            </bean>

            <bean id="messageSource" class="org.springframework.context.support.Resourc eBundleMessageSource">
            <property name="basename"><value>messages</value></property>
            </bean>

            <!-- ========================= RESOURCE DEFINITIONS ========================= -->

            <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverM anagerDataSource">
            <property name="driverClassName"><value>${jdbc.driverClassNa me}</value></property>
            <property name="url"><value>${jdbc.url}</value></property>
            <property name="username"><value>${jdbc.username}</value></property>
            <property name="password"><value>${jdbc.password}</value></property>
            </bean>

            <!-- Hibernate SessionFactory -->
            <bean id="sessionFactory" class="org.springframework.orm.hibernate.LocalSess ionFactoryBean">
            <property name="dataSource"><ref local="dataSource"/></property>
            <property name="mappingResources">
            <value>icarabineer.hbm.xml</value>
            </property>
            <property name="hibernateProperties">
            <props>
            <prop key="hibernate.dialect">${hibernate.dialect}</prop>
            </props>
            </property>
            </bean>

            <!-- Transaction manager for a single Hibernate SessionFactory -->
            <bean id="transactionManager" class="org.springframework.orm.hibernate.Hibernate TransactionManager">
            <property name="sessionFactory"><ref local="sessionFactory"/></property>
            </bean>

            <!-- ========================= BUSINESS OBJECT DEFINITIONS ========================= -->

            <bean id="baseTransactionProxy" class="org.springframework.transaction.interceptor .TransactionProxyFactoryBean" abstract="true">
            <property name="transactionManager"><ref bean="transactionManager"/></property>
            <property name="transactionAttributes">
            <props>
            <prop key="find*">PROPAGATION_REQUIRED,readOnly</prop>
            <prop key="load*">PROPAGATION_REQUIRED,readOnly</prop>
            <prop key="store*">PROPAGATION_REQUIRED</prop>
            </props>
            </property>
            </bean>

            <!--
            - TOM primary business object: Hibernate implementation, as an inner bean -->
            <bean id="tom" parent="baseTransactionProxy">
            <property name="target">
            <bean class="org.fin_it.icarabineer.icaraorder.tom.hiber nate.HibernateTOM">
            <property name="sessionFactory"><ref local="sessionFactory"/></property>
            </bean>
            </property>
            </bean>
            </beans>


            Stack Trace:

            Internal error

            org.springframework.beans.factory.BeanDefinitionSt oreException: Error registering bean with name 'baseTransactionProxy' defined in resource [/WEB-INF/applicationContext-hibernate.xml] of ServletContext: Class that bean class [org.springframework.transaction.interceptor.Transa ctionProxyFactoryBean] depends on not found; nested exception is java.lang.NoClassDefFoundError: org/aopalliance/aop/Advice java.lang.NoClassDefFoundError: org/aopalliance/aop/Advice at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:219) at org.springframework.beans.factory.support.BeanDefi nitionReaderUtils.createBeanDefinition(BeanDefinit ionReaderUtils.java:50) at org.springframework.beans.factory.xml.DefaultXmlBe anDefinitionParser.parseBeanDefinition(DefaultXmlB eanDefinitionParser.java:279) at org.springframework.beans.factory.xml.DefaultXmlBe anDefinitionParser.parseBeanDefinition(DefaultXmlB eanDefinitionParser.java:239) at org.springframework.beans.factory.xml.DefaultXmlBe anDefinitionParser.registerBeanDefinition(DefaultX mlBeanDefinitionParser.java:205) at org.springframework.beans.factory.xml.DefaultXmlBe anDefinitionParser.registerBeanDefinitions(Default XmlBeanDefinitionParser.java:173) at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.registerBeanDefinitions(XmlBeanDefinit ionReader.java:164) at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:128) at org.springframework.context.support.AbstractXmlApp licationContext.loadBeanDefinitions(AbstractXmlApp licationContext.java:124) at org.springframework.context.support.AbstractXmlApp licationContext.refreshBeanFactory(AbstractXmlAppl icationContext.java:64) at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:239) at org.springframework.web.context.support.XmlWebAppl icationContext.refresh(XmlWebApplicationContext.ja va:131) at org.springframework.web.context.ContextLoader.crea teWebApplicationContext(ContextLoader.java:156) at org.springframework.web.context.ContextLoader.init WebApplicationContext(ContextLoader.java:97) at org.springframework.web.context.ContextLoaderServl et.init(ContextLoaderServlet.java:80) at javax.servlet.GenericServlet.init(GenericServlet.j ava:211) at org.apache.catalina.core.StandardWrapper.loadServl et(StandardWrapper.java:1029) at org.apache.catalina.core.StandardWrapper.load(Stan dardWrapper.java:862) at org.apache.catalina.core.StandardContext.loadOnSta rtup(StandardContext.java:4013) at org.apache.catalina.core.StandardContext.start(Sta ndardContext.java:4357) at org.apache.catalina.core.StandardContext.reload(St andardContext.java:3043) at org.apache.catalina.manager.ManagerServlet.reload( ManagerServlet.java:1014) at org.apache.catalina.manager.HTMLManagerServlet.rel oad(HTMLManagerServlet.java:476) at org.apache.catalina.manager.HTMLManagerServlet.doG et(HTMLManagerServlet.java:98) at javax.servlet.http.HttpServlet.service(HttpServlet .java:689) at javax.servlet.http.HttpServlet.service(HttpServlet .java:802) at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:237) at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:157) at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:214) at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:520) at org.apache.catalina.core.StandardContextValve.invo keInternal(StandardContextValve.java:198) at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:152) at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:104) at org.apache.catalina.authenticator.AuthenticatorBas e.invoke(AuthenticatorBase.java:540) at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:102) at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:520) at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:137) at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:104) at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:117) at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:102) at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:520) at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:109) at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:520) at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:929) at org.apache.coyote.tomcat5.CoyoteAdapter.service(Co yoteAdapter.java:160) at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:799) at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.processConnection(Http11Protocol.jav a:705) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(P oolTcpEndpoint.java:577) at org.apache.tomcat.util.threads.ThreadPool$ControlR unnable.run(ThreadPool.java:683) at java.lang.Thread.run(Thread.java:534) Cookies:

            Comment


            • #7
              Your stack trace (right at the top) is showing an error about not being able to find an aopalliance class. You need to include aopalliance.jar in your app.

              Comment


              • #8
                Colin,

                I really appreciate the help. I can tell by your comments your getting annoyed by my inexperience with all of this. I hope I don't wear out your patience, but here goes. I put the aopalliance.jar in the WEB-INF/lib folder and added it to the projects build path. I used ANT to clean, undeploy, build, and redeploy.
                I don't have any experience in following up an exception chain to really understand what's going on. If there's a quick point you have that would help me with Spring. I would appreciate that tool. For example, I don't know what "java.lang.NoClassDefFoundError: javax/transaction/TransactionManager" is trying to tell me.


                here's the next stack trace.

                Internal error

                org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'sessionFactory' defined in resource [/WEB-INF/applicationContext-hibernate.xml] of ServletContext: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: javax/transaction/TransactionManager java.lang.NoClassDefFoundError: javax/transaction/TransactionManager at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.ja va:1655) at java.lang.Class.getDeclaredMethods(Class.java:1139 ) at java.beans.Introspector$1.run(Introspector.java:11 27) at java.security.AccessController.doPrivileged(Native Method) at java.beans.Introspector.getPublicDeclaredMethods(I ntrospector.java:1125) at java.beans.Introspector.getTargetMethodInfo(Intros pector.java:990) at java.beans.Introspector.getBeanInfo(Introspector.j ava:371) at java.beans.Introspector.getBeanInfo(Introspector.j ava:145) at org.springframework.beans.CachedIntrospectionResul ts.(CachedIntrospectionResults.java:138) at org.springframework.beans.CachedIntrospectionResul ts.forClass(CachedIntrospectionResults.java:80) at org.springframework.beans.BeanWrapperImpl.setIntro spectionClass(BeanWrapperImpl.java:244) at org.springframework.beans.BeanWrapperImpl.setWrapp edInstance(BeanWrapperImpl.java:225) at org.springframework.beans.BeanWrapperImpl.setWrapp edInstance(BeanWrapperImpl.java:209) at org.springframework.beans.BeanWrapperImpl.(BeanWra pperImpl.java:163) at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:256) at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:208) at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:204) at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:136) at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:224) at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:284) at org.springframework.web.context.support.XmlWebAppl icationContext.refresh(XmlWebApplicationContext.ja va:131) at org.springframework.web.context.ContextLoader.crea teWebApplicationContext(ContextLoader.java:156) at org.springframework.web.context.ContextLoader.init WebApplicationContext(ContextLoader.java:97) at org.springframework.web.context.ContextLoaderServl et.init(ContextLoaderServlet.java:80) at javax.servlet.GenericServlet.init(GenericServlet.j ava:211) at org.apache.catalina.core.StandardWrapper.loadServl et(StandardWrapper.java:1029) at org.apache.catalina.core.StandardWrapper.load(Stan dardWrapper.java:862) at org.apache.catalina.core.StandardContext.loadOnSta rtup(StandardContext.java:4013) at org.apache.catalina.core.StandardContext.start(Sta ndardContext.java:4357) at org.apache.catalina.core.StandardHostDeployer.star t(StandardHostDeployer.java:830) at org.apache.catalina.core.StandardHost.start(Standa rdHost.java:991) at org.apache.catalina.manager.ManagerServlet.start(M anagerServlet.java:1322) at org.apache.catalina.manager.HTMLManagerServlet.sta rt(HTMLManagerServlet.java:530) at org.apache.catalina.manager.HTMLManagerServlet.doG et(HTMLManagerServlet.java:104) at javax.servlet.http.HttpServlet.service(HttpServlet .java:689) at javax.servlet.http.HttpServlet.service(HttpServlet .java:802) at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:237) at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:157) at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:214) at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:520) at org.apache.catalina.core.StandardContextValve.invo keInternal(StandardContextValve.java:198) at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:152) at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:104) at org.apache.catalina.authenticator.AuthenticatorBas e.invoke(AuthenticatorBase.java:540) at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:102) at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:520) at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:137) at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:104) at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:117) at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:102) at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:520) at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:109) at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:520) at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:929) at org.apache.coyote.tomcat5.CoyoteAdapter.service(Co yoteAdapter.java:160) at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:799) at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.processConnection(Http11Protocol.jav a:705) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(P oolTcpEndpoint.java:577) at org.apache.tomcat.util.threads.ThreadPool$ControlR unnable.run(ThreadPool.java:683) at java.lang.Thread.run(Thread.java:534) Cookies:

                Comment


                • #9
                  do you have the lib\j2ee\jta.jar in your classpath?

                  Comment


                  • #10
                    OK, I can see a new debugging design pattern emerging here. I call it "Check The Damn Libraries Pattern".

                    Comment


                    • #11
                      I'm starting to catch on. I also found that dom4j.jar was missing. Now I'm getting the following:

                      Internal error

                      org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'sessionFactory' defined in resource [/WEB-INF/applicationContext-hibernate.xml] of ServletContext: Initialization of bean failed; nested exception is java.io.FileNotFoundException: Could not open class path resource [icarabineer.hbm.xml] java.io.FileNotFoundException: Could not open class path resource [icarabineer.hbm.xml] at org.springframework.core.io.ClassPathResource.getI nputStream(ClassPathResource.java:86) at org.springframework.orm.hibernate.LocalSessionFact oryBean.afterPropertiesSet(LocalSessionFactoryBean .java:353) at


                      What jar am I missing now???

                      Comment


                      • #12
                        Well since you apologized ahead of time, I'm not annoyed :-) However you can certainly save yourself some time (as well as me :-) ) by just carefully reading the exception. Here you're getting a FileNotFoundException, complaining about not finding one of the Hibernate mapping files, 'icarabineer.hbm.xml'

                        If your'e working off one of the samples, then it should generally be in the sample place as the ones in teh sample.

                        Comment

                        Working...
                        X