Announcement Announcement Module
Collapse
No announcement yet.
Run time exception in holidayService example Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Run time exception in holidayService example

    I'm trying to get the holidayService example running that's described here: http://static.springsource.org/sprin.../tutorial.html. I've built and deployed a WAR to a local JBoss instance and when I hit the URL http://localhost:8080/holidayService/holiday.wsdl I receive the stack trace below. I think that the root-cause is in the HumanResourceService class. The tutorial just mentions it once and doesn't indicate how to prepare/annotate it for dependency injection into the HolidayEndpoint class. Can someone help me out?

    org.springframework.beans.factory.UnsatisfiedDepen dencyException: Error creating bean with name 'holidayEndpoint' defined in file [C:\jboss-4.0.5.GA\server\default\.\tmp\deploy\tmp7750629345 957352693holidayService-exp.war\WEB-INF\classes\com\mycompany\hr\ws\HolidayEndpoint.cl ass]: Unsatisfied dependency expressed through constructor argument with index 0 of type [com.mycompany.hr.service.HumanResourceService]: : No matching bean of type [com.mycompany.hr.service.HumanResourceService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}; nested exception is org.springframework.beans.factory.NoSuchBeanDefini tionException: No matching bean of type [com.mycompany.hr.service.HumanResourceService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}
    org.springframework.beans.factory.support.Construc torResolver.createArgumentArray(ConstructorResolve r.java:730)
    org.springframework.beans.factory.support.Construc torResolver.autowireConstructor(ConstructorResolve r.java:196)
    org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.autowireConstructor(Abs tractAutowireCapableBeanFactory.java:1003)
    org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBeanInstance(Abst ractAutowireCapableBeanFactory.java:907)
    org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:485)
    org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:456)
    org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject(AbstractBeanFactory.java:2 91)
    org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry.getSingleton(DefaultSingleton BeanRegistry.java:222)
    org.springframework.beans.factory.support.Abstract BeanFactory.doGetBean(AbstractBeanFactory.java:288 )
    org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:190)
    org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:580)
    org.springframework.context.support.AbstractApplic ationContext.finishBeanFactoryInitialization(Abstr actApplicationContext.java:895)
    org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:425)
    org.springframework.web.servlet.FrameworkServlet.c reateWebApplicationContext(FrameworkServlet.java:4 42)
    org.springframework.web.servlet.FrameworkServlet.c reateWebApplicationContext(FrameworkServlet.java:4 58)
    org.springframework.web.servlet.FrameworkServlet.i nitWebApplicationContext(FrameworkServlet.java:339 )
    org.springframework.web.servlet.FrameworkServlet.i nitServletBean(FrameworkServlet.java:306)
    org.springframework.web.servlet.HttpServletBean.in it(HttpServletBean.java:127)
    javax.servlet.GenericServlet.init(GenericServlet.j ava:211)
    org.jboss.web.tomcat.security.SecurityAssociationV alve.invoke(SecurityAssociationValve.java:175)
    org.jboss.web.tomcat.security.JaccContextValve.inv oke(JaccContextValve.java:74)
    org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:105)
    org.jboss.web.tomcat.tc5.jca.CachedConnectionValve .invoke(CachedConnectionValve.java:156)
    org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:148)
    org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:869)
    org.apache.coyote.http11.Http11BaseProtocol$Http11 ConnectionHandler.processConnection(Http11BaseProt ocol.java:664)
    org.apache.tomcat.util.net.PoolTcpEndpoint.process Socket(PoolTcpEndpoint.java:527)
    org.apache.tomcat.util.net.MasterSlaveWorkerThread .run(MasterSlaveWorkerThread.java:112)
    java.lang.Thread.run(Thread.java:595)

    root cause

    org.springframework.beans.factory.NoSuchBeanDefini tionException: No matching bean of type [com.mycompany.hr.service.HumanResourceService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}
    org.springframework.beans.factory.support.DefaultL istableBeanFactory.raiseNoSuchBeanDefinitionExcept ion(DefaultListableBeanFactory.java:920)
    org.springframework.beans.factory.support.DefaultL istableBeanFactory.doResolveDependency(DefaultList ableBeanFactory.java:789)
    org.springframework.beans.factory.support.DefaultL istableBeanFactory.resolveDependency(DefaultListab leBeanFactory.java:703)
    org.springframework.beans.factory.support.Construc torResolver.resolveAutowiredArgument(ConstructorRe solver.java:795)
    org.springframework.beans.factory.support.Construc torResolver.createArgumentArray(ConstructorResolve r.java:723)
    org.springframework.beans.factory.support.Construc torResolver.autowireConstructor(ConstructorResolve r.java:196)
    org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.autowireConstructor(Abs tractAutowireCapableBeanFactory.java:1003)
    org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBeanInstance(Abst ractAutowireCapableBeanFactory.java:907)
    org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:485)
    org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:456)
    org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject(AbstractBeanFactory.java:2 91)
    org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry.getSingleton(DefaultSingleton BeanRegistry.java:222)
    org.springframework.beans.factory.support.Abstract BeanFactory.doGetBean(AbstractBeanFactory.java:288 )
    org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:190)
    org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:580)
    org.springframework.context.support.AbstractApplic ationContext.finishBeanFactoryInitialization(Abstr actApplicationContext.java:895)
    org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:425)
    org.springframework.web.servlet.FrameworkServlet.c reateWebApplicationContext(FrameworkServlet.java:4 42)
    org.springframework.web.servlet.FrameworkServlet.c reateWebApplicationContext(FrameworkServlet.java:4 58)
    org.springframework.web.servlet.FrameworkServlet.i nitWebApplicationContext(FrameworkServlet.java:339 )
    org.springframework.web.servlet.FrameworkServlet.i nitServletBean(FrameworkServlet.java:306)
    org.springframework.web.servlet.HttpServletBean.in it(HttpServletBean.java:127)
    javax.servlet.GenericServlet.init(GenericServlet.j ava:211)
    org.jboss.web.tomcat.security.SecurityAssociationV alve.invoke(SecurityAssociationValve.java:175)
    org.jboss.web.tomcat.security.JaccContextValve.inv oke(JaccContextValve.java:74)
    org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:105)
    org.jboss.web.tomcat.tc5.jca.CachedConnectionValve .invoke(CachedConnectionValve.java:156)
    org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:148)
    org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:869)
    org.apache.coyote.http11.Http11BaseProtocol$Http11 ConnectionHandler.processConnection(Http11BaseProt ocol.java:664)
    org.apache.tomcat.util.net.PoolTcpEndpoint.process Socket(PoolTcpEndpoint.java:527)
    org.apache.tomcat.util.net.MasterSlaveWorkerThread .run(MasterSlaveWorkerThread.java:112)

  • #2
    I was able to find the source code for the whole project here: http://www.springsource.com/download...ty?sid=1102977 under "Spring Web Services". Just download "spring-ws-2.0.1.RELEASE-full.zip" and examine the contents. I've compiled it and it works just fine.

    Comment


    • #3
      Hi

      I did the same and still having issues. I see the dynamically generated WSDL when i try the url
      Code:
      http://localhost:8080/tutorial-0.0.1-SNAPSHOT/holiday.wsdl
      but when i try to access the service using soapui i am getting the error

      Code:
      <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
      <HTML><HEAD>
      <TITLE>404 Not found</TITLE>
      </HEAD><BODY><H1>Not found</H1>
      The requested URL /tutorial&#45;0.0.1&#45;SNAPSHOT/holidayService/ was not found on this server</BODY></HTML>
      what are the other ways i can test the application. I am running it on tomcat server

      Comment


      • #4
        I was wondering it has anything to do with the transformLocation property set to true

        location in wsdl
        Code:
        <wsdl:service name="HumanResourceService">
        
            <wsdl:port binding="tns:HumanResourceSoap11" name="HumanResourceSoap11">
        
              <soap:address location="http://localhost:8080/tutorial-1.0/holidayService/"/>
        
            </wsdl:port>
        
          </wsdl:service>
        I can access the wsdl in the url

        http://localhost:8080/tutorial-1.0/holiday.wsdl


        in that context with transformLocation set to true what will be my URI to WSDL and the end point URI for my service.

        Thanks
        Thomas

        Comment

        Working...
        X