Announcement Announcement Module
Collapse
No announcement yet.
Error while deploying Travel sample war Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Error while deploying Travel sample war

    Hi I am trying since past few days to deploy swf-booking-mvc.war in tomcat 6 following http://www.springsource.org/webflow-samples but get below error.

    SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListe ner
    org.springframework.beans.factory.UnsatisfiedDepen dencyException: Error creating bean with name 'hotelsController' defined in file [C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\swf-booking-mvc\WEB-INF\classes\org\springframework\webflow\samples\bo oking\HotelsController.class]: Unsatisfied dependency expressed through constructor argument with index 0 of type [org.springframework.webflow.samples.booking.Bookin gService]: : Error creating bean with name 'bookingService': Injection of persistence dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'entityManagerFactory' defined in ServletContext resource [/WEB-INF/config/data-access-config.xml]: Invocation of init method failed; nested exception is java.lang.RuntimeException: error trying to scan <jar-file>: file:/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%206.0/webapps/swf-booking-mvc/WEB-INF/classes/; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'bookingService': Injection of persistence dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'entityManagerFactory' defined in ServletContext resource [/WEB-INF/config/data-access-config.xml]: Invocation of init method failed; nested exception is java.lang.RuntimeException: error trying to scan <jar-file>: file:/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%206.0/webapps/swf-booking-mvc/WEB-INF/classes/
    at org.springframework.beans.factory.support.Construc torResolver.createArgumentArray(ConstructorResolve r.java:718)
    at org.springframework.beans.factory.support.Construc torResolver.autowireConstructor(ConstructorResolve r.java:194)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.autowireConstructor(Abs tractAutowireCapableBeanFactory.java:993)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBeanInstance(Abst ractAutowireCapableBeanFactory.java:897)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:485)
    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:574)
    at org.springframework.context.support.AbstractApplic ationContext.finishBeanFactoryInitialization(Abstr actApplicationContext.java:895)
    at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:425)
    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:4135)
    at org.apache.catalina.core.StandardContext.start(Sta ndardContext.java:4630)
    at org.apache.catalina.manager.ManagerServlet.start(M anagerServlet.java:1276)
    at org.apache.catalina.manager.HTMLManagerServlet.sta rt(HTMLManagerServlet.java:624)
    at org.apache.catalina.manager.HTMLManagerServlet.doG et(HTMLManagerServlet.java:136)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:617)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:717)
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:191)
    at org.apache.catalina.authenticator.AuthenticatorBas e.invoke(AuthenticatorBase.java:563)
    at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:298)
    at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:857)
    at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.process(Http11Protocol.java:588)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run( JIoEndpoint.java:489)
    at java.lang.Thread.run(Unknown Source)
    Caused by: org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'bookingService': Injection of persistence dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'entityManagerFactory' defined in ServletContext resource [/WEB-INF/config/data-access-config.xml]: Invocation of init method failed; nested exception is java.lang.RuntimeException: error trying to scan <jar-file>: file:/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%206.0/webapps/swf-booking-mvc/WEB-INF/classes/


    I am not able to understand if I am missing something. All I have done is downloaded the war and deployed in tomcat.

  • #2
    You may get such error if one of constructor arguments you specify is resolved into null. In you case, it seems that the bean with problematic constructor is entityManagerFactory which is defined in /WEB-INF/config/data-access-config.xml. I can assume that this happens, for instance, because you data source is misconfigured. Please check entityManagerFactory or post the content of your data-access-config.xml
    You can also have such error if you're using @Autowired beans - is your
    Code:
    <context:component-scan base-package="your.base.package"/>
    element points to correct package?

    Comment


    • #3
      I did some search. I just had to add a
      jboss-archive-browsing.jar

      Comment

      Working...
      X