Results 1 to 5 of 5

Thread: WebServiceDemo

  1. #1
    Join Date
    Sep 2008
    Location
    Mannheim,Germany
    Posts
    125

    Default WebServiceDemo

    Hi I tried to invoke a SpringWS same way as new realease as WebServiceDemo.Would apprecaite help.

    GidSI.java
    Code:
    public static void main(String[] args) {
    ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("SI.xml", GidSI.class);
    String requestXml =
    "<hr:CompanyRequest xmlns:hr=\"http://mycompany.com/hr/schemas\">" +
    "<hr:Company>"+
    "<hr:CompanyName>TestRequest</hr:CompanyName>"+
    "</hr:Company>"+
    "</hr:CompanyRequest>";
    
    Message<String> message = MessageBuilder.withPayload(requestXml)
    				.setHeader(AbstractWebServiceOutboundGateway.SOAP_ACTION_PROPERTY_KEY, "http://mycompany.com/hr/schemas")
    				.build();
    
    ((MessageChannel) context.getBean("sendChannel")).send(message);
    	
    }
    SI.xml
    Code:
    <message-bus/>
    <channel id="sendChannel"/>
    <ws:outbound-gateway id="simpleGateway" request-channel="sendChannel" 
    reply-channel="receiveChannel" uri="http://localhost:8080/Trial1/companyservice"/>
    <beans:bean id="simpleGateway" class="org.springframework.integration.ws.SimpleWebServiceOutboundGateway">
    <beans:constructor-arg index="0" value="http://localhost:8080/Trial1/companyservice"/>
    </beans:bean>
    <stream:stdout-channel-adapter id="receiveChannel"/>
    
    </beans:beans>
    Error message
    Code:
    Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.integration.ws.SimpleWebServiceOutboundGateway#0': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.integration.ws.SimpleWebServiceOutboundGateway]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: javax/xml/soap/SOAPException
    	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:254)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:925)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:835)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
    	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
    	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
    	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
    	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:197)
    	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:172)
    	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:158)
    	at org.springframework.integration.rc.GidSI.main(GidSI.java:16)
    Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.integration.ws.SimpleWebServiceOutboundGateway]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: javax/xml/soap/SOAPException
    	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:115)
    	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:87)
    	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:248)
    	... 18 more
    Caused by: java.lang.NoClassDefFoundError: javax/xml/soap/SOAPException
    	at java.lang.Class.getDeclaredConstructors0(Native Method)
    	at java.lang.Class.privateGetDeclaredConstructors(Class.java:2357)
    	at java.lang.Class.getConstructor0(Class.java:2671)
    	at java.lang.Class.getDeclaredConstructor(Class.java:1953)
    	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:78)
    	at org.springframework.ws.support.DefaultStrategiesHelper.instantiateBean(DefaultStrategiesHelper.java:133)
    	at org.springframework.ws.support.DefaultStrategiesHelper.getDefaultStrategies(DefaultStrategiesHelper.java:115)
    	at org.springframework.ws.support.DefaultStrategiesHelper.getDefaultStrategy(DefaultStrategiesHelper.java:200)
    	at org.springframework.ws.support.DefaultStrategiesHelper.getDefaultStrategy(DefaultStrategiesHelper.java:184)
    	at org.springframework.ws.client.core.WebServiceTemplate.initMessageFactory(WebServiceTemplate.java:314)
    	at org.springframework.ws.client.core.WebServiceTemplate.initDefaultStrategies(WebServiceTemplate.java:303)
    	at org.springframework.ws.client.core.WebServiceTemplate.<init>(WebServiceTemplate.java:133)
    	at org.springframework.integration.ws.AbstractWebServiceOutboundGateway.<init>(AbstractWebServiceOutboundGateway.java:54)
    	at org.springframework.integration.ws.SimpleWebServiceOutboundGateway.<init>(SimpleWebServiceOutboundGateway.java:56)
    	at org.springframework.integration.ws.SimpleWebServiceOutboundGateway.<init>(SimpleWebServiceOutboundGateway.java:52)
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    	at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
    	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:100)
    	... 20 more
    Last edited by ashleyvijay; Nov 5th, 2008 at 07:03 AM.

  2. #2

    Default

    There are two ways of spreading the light ... Be the lamp that emits, or the mirror that reflects it

  3. #3
    Join Date
    Sep 2008
    Location
    Mannheim,Germany
    Posts
    125

    Default

    Thanks so much for the reply.It has reduced the errors alot.But I have the following exception now:Would appreciate help in this

    Code:
    Exception in thread "main" org.springframework.integration.message.MessageDeliveryException: Dispatcher has no subscribers.
    	at org.springframework.integration.dispatcher.SimpleDispatcher.dispatch(SimpleDispatcher.java:39)
    	at org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:56)
    	at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:116)
    	at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:94)
    	at org.springframework.integration.rc.GidSI.main(GidSI.java:34)
    If I remove the following from my xml(shown in the beginning of the thread) it shows this:

    Code:
    <beans:bean id="simpleGateway" class="org.springframework.integration.ws.SimpleWebServiceOutboundGateway">
    <beans:constructor-arg index="0" value="http://localhost:8080/Trial1/companyservice"/>
    </beans:bean>
    Code:
    Exception in thread "main" java.lang.NoClassDefFoundError: javax/activation/DataSource
    	at org.springframework.ws.soap.saaj.SaajSoapMessageFactory.createWebServiceMessage(SaajSoapMessageFactory.java:143)
    	at org.springframework.ws.context.DefaultMessageContext.<init>(DefaultMessageContext.java:42)
    	at org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(WebServiceTemplate.java:499)
    	at org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(WebServiceTemplate.java:456)
    	at org.springframework.ws.client.core.WebServiceTemplate.sendSourceAndReceiveToResult(WebServiceTemplate.java:402)
    	at org.springframework.ws.client.core.WebServiceTemplate.sendSourceAndReceiveToResult(WebServiceTemplate.java:393)
    	at org.springframework.integration.ws.SimpleWebServiceOutboundGateway.doHandle(SimpleWebServiceOutboundGateway.java:69)
    	at org.springframework.integration.ws.AbstractWebServiceOutboundGateway.handleRequestMessage(AbstractWebServiceOutboundGateway.java:89)
    	at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:101)
    	at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:48)
    	at org.springframework.integration.dispatcher.AbstractDispatcher.sendMessageToHandler(AbstractDispatcher.java:75)
    	at org.springframework.integration.dispatcher.SimpleDispatcher.dispatch(SimpleDispatcher.java:45)
    	at org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:56)
    	at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:116)
    	at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:94)
    	at org.springframework.integration.rc.GidSI.main(GidSI.java:34)
    Last edited by ashleyvijay; Nov 5th, 2008 at 06:53 AM.

  4. #4
    Join Date
    Sep 2008
    Location
    Mannheim,Germany
    Posts
    125

    Default

    Ok I just added the "activation.jar" and it works!!

  5. #5
    Join Date
    May 2007
    Location
    Netherlands
    Posts
    614

    Default

    Hmmm, does this mean that the NCDFE is swallowed completely, or did you change other things too? If you have code to reproduce the swallowing of the error please create an issue in JIRA and attach.

Posting Permissions

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