Announcement Announcement Module
Collapse
No announcement yet.
spring-ws and Maven Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • spring-ws and Maven

    Hi,

    I'm building an application that uses spring-ws and Maven. I've worked through a number of issues, and am now running into one that I can't seem to get past. When I run a maven install I get an error loading the class that contains the @Endpoint annotation. The class is located in /src/main/java/ws/StoreEndOfDayEndpoint and is in package ws.StoreEndOfDayEndpoint. Do I need to do something else? to make Spring or Maven aware of the package?

    Here is the actual error:

    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'org.springframework.ws.server.endpoint.mapping.Pa yloadRootAnnotationMethodEndpointMapping#0' defined in URL [file:/Projects/EEIS Admin Services/EEIS Admin Services/eeisAdminService/src/main/webapp/WEB-INF/spring-ws-servlet.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.CannotLoadBeanCl assException: Cannot find class [ws.StoreEndOfDayEndpoint] for bean with name 'storeEndOfDayEndpoint' defined in URL [file:/Projects/EEIS Admin Services/EEIS Admin Services/eeisAdminService/src/main/webapp/WEB-INF/spring-ws-servlet.xml]; nested exception is java.lang.ClassNotFoundException: ws.StoreEndOfDayEndpoint
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:480)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory$1.run(AbstractAutowireC apableBeanFactory.java:409)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:380)
    at org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject(AbstractBeanFactory.java:2 64)
    at org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry.getSingleton(DefaultSingleton BeanRegistry.java:222)
    at org.springframework.beans.factory.support.Abstract BeanFactory.doGetBean(AbstractBeanFactory.java:261 )
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:185)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:164)
    at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:429)
    at org.springframework.context.support.AbstractApplic ationContext.finishBeanFactoryInitialization(Abstr actApplicationContext.java:728)
    at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:380)
    at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:139)
    at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:93)
    at org.codehaus.mojo.springws.SpringWsMojo.execute(Sp ringWsMojo.java:69)
    at org.apache.maven.plugin.DefaultPluginManager.execu teMojo(DefaultPluginManager.java:579)
    at org.apache.maven.lifecycle.DefaultLifecycleExecuto r.executeGoalAndHandleFailures(DefaultLifecycleExe cutor.java:498)
    at org.apache.maven.lifecycle.DefaultLifecycleExecuto r.executeTaskSegmentForProject(DefaultLifecycleExe cutor.java:265)
    at org.apache.maven.lifecycle.DefaultLifecycleExecuto r.executeTaskSegments(DefaultLifecycleExecutor.jav a:191)
    at org.apache.maven.lifecycle.DefaultLifecycleExecuto r.execute(DefaultLifecycleExecutor.java:149)
    at org.apache.maven.DefaultMaven.execute_aroundBody0( DefaultMaven.java:223)
    at org.apache.maven.DefaultMaven.execute_aroundBody1$ advice(DefaultMaven.java:304)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven .java:1)
    at org.apache.maven.embedder.MavenEmbedder.execute_ar oundBody2(MavenEmbedder.java:904)
    at org.apache.maven.embedder.MavenEmbedder.execute_ar oundBody3$advice(MavenEmbedder.java:304)
    at org.apache.maven.embedder.MavenEmbedder.execute(Ma venEmbedder.java:1)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java :176)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:6 3)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.codehaus.plexus.classworlds.launcher.Launcher. launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher. launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher. mainWithExitCode(Launcher.java:408)
    at org.codehaus.plexus.classworlds.launcher.Launcher. main(Launcher.java:351)
    at org.codehaus.classworlds.Launcher.main(Launcher.ja va:31)



    Here is my spring-ws-servlet.xml file:

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">

    <!-- Register PayloadRootAnnotationMethodEndpointMapping -->
    <bean class="org.springframework.ws.server.endpoint.mapp ing.PayloadRootAnnotationMethodEndpointMapping"/>

    <!-- Register endpoint -->
    <bean id="storeEndOfDayEndpoint" class="ws.StoreEndOfDayEndpoint">
    <description>
    This endpoint handles store EOD requests.
    </description>
    <property name="storeEodService" ref="StoreEodService"/>
    </bean>

    <bean id="storeEodService" class="service.impl.StoreEndOfDayService">
    <description>
    The business service bean.
    </description>
    </bean>

    <bean id="storeEod" class="org.springframework.ws.wsdl.wsdl11.DynamicW sdl11Definition">
    <property name="builder">
    <bean class="org.springframework.ws.wsdl.wsdl11.builder. XsdBasedSoap11Wsdl4jDefinitionBuilder">
    <property name="schema" value="/WEB-INF/StoreEndOfDay.xsd"/>
    <property name="portTypeName" value="storeEod"/>
    <property name="locationUri" value="http://localhost:8080/EEISAdminServices/"/>
    <property name="targetNamespace" value="http://www.companyname.com/pos/eeis/schemas/StoreEndOfDay"/>
    </bean>
    </property>
    </bean>

    <bean id="schema" class="org.springframework.xml.xsd.SimpleXsdSchema ">
    <property name="xsd" value="../xsd/StoreEndOfDay.xsd" />
    </bean>

    <!-- Configure XML Marshaller -->
    <bean class="org.springframework.ws.server.endpoint.adap ter.GenericMarshallingMethodEndpointAdapter">
    <constructor-arg ref="marshaller"/>
    </bean>

    <bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshalle r">
    <property name="classesToBeBound">
    <list>
    <value>jaxb.com.companyname.eeis.schemas.storeendo fday.StoreEodType</value>
    <value>jaxb.com.companyname.eeis.schemas.storeendo fday.StoreEodReturn</value>
    </list>
    </property>
    </bean>

    </beans>



    I'm new to both Spring and Maven, so any help is greatly appreciated! Thanks!
    Last edited by gstipton; Nov 20th, 2009, 07:33 AM. Reason: obscuring company name
Working...
X