|
|
JaxRpcPortProxyFactoryBean
Hi,
I have a problem with adding JaxRpcPortProxyFactoryBean to servlet.
When I'm trying to add this :Code:
lt;bean id=quot;accountServicequot; class=quot;wat.account.AccountServiceClientquot;gt;
lt;property name=quot;accountServicequot; ref=quot;jaxRpcProxyquot; /gt;
lt;/beangt;
lt;bean id=quot;jaxRpcProxyquot; class=quot;org..remoting.jaxrpc.JaxRpcPortProxyFactoryBeanquot;gt;
lt;property name=quot;serviceFactoryClassquot;gt;
lt;valuegt;org.apache.axis.client.ServiceFactorylt;/valuegt;
lt;/propertygt;
lt;property name=quot;wsdlDocumentuclquot;gt;
lt;valuegt;accountService/services/AccountService?wsdllt;/valuegt;
lt;/propertygt;
lt;property name=quot;namespaceUriquot;gt;
lt;valuegt;accountService/services/AccountServicelt;/valuegt;
lt;/propertygt;
lt;property name=quot;serviceNamequot;gt;
lt;valuegt;AccountServiceEndpointServicelt;/valuegt;
lt;/propertygt;
lt;property name=quot;portNamequot;gt;
lt;valuegt;AccountServicelt;/valuegt;
lt;/propertygt;
lt;property name=quot;serviceInterfacequot;gt;
lt;valuegt;wat.account.AccountServicelt;/valuegt;
lt;/propertygt;
lt;/beangt;
to my sping-ws-servlet :Code:
lt;?xml version=quot;1.0quot; encoding=quot;UTF-8quot;?gt;
lt;beans xmlns=quot;schema/beansquot; xmlns:xsi=quot;2001/XMLSchema-instancequot; xmlns:sws=quot;schema/web-servicesquot; xsi:schemaLocation=quot;schema/beans schema/beans/spring-beans-2.5.xsd schema/web-services schema/web-services/web-services-1.5.xsdquot;gt;lt;bean id=quot;hypertensionEndpointquot; class=quot;wat.ws.hypertension.MarshallingHypertensionEndpointquot; /gt;
lt;bean class=quot;org..ws.soap.server.endpoint.SoapFaultAnnotationExceptionResolverquot;gt;
lt;property name=quot;orderquot; value=quot;1quot;/gt;
lt;/beangt;
lt;bean class=quot;org..ws.soap.server.endpoint.SoapFaultMappingExceptionResolverquot;gt;
lt;descriptiongt;
This exception resolver maps other exceptions to SOAP Faults. Both UnmarshallingException and
ValidationFailureException are mapped to a SOAP Fault with a quot;Clientquot; fault code.
All other exceptions are mapped to a quot;Serverquot; error code, the default.
lt;/descriptiongt;
lt;property name=quot;defaultFaultquot; value=quot;SERVERquot;/gt;
lt;property name=quot;exceptionMappingsquot;gt;
lt;propsgt;
lt;prop key=quot;org..oxm.UnmarshallingFailureExceptionquot;gt;CLIENT,Invalid requestlt;/propgt;
lt;prop key=quot;org..oxm.ValidationFailureExceptionquot;gt;CLIENT,Invalid requestlt;/propgt;
lt;/propsgt;
lt;/propertygt;
lt;property name=quot;orderquot; value=quot;2quot;/gt;
lt;/beangt;
lt;bean class=quot;org..ws.server.endpoint.adapter.GenericMarshallingMethodEndpointAdapterquot;gt; lt;constructor-arg ref=quot;marshallerquot; /gt; lt;constructor-arg ref=quot;marshallerquot; /gt;
lt;/beangt;
lt;bean id=quot;marshallerquot; class=quot;org..oxm.jaxb.Jaxb2Marshallerquot;gt;
lt;property name=quot;classesToBeBoundquot;gt;
lt;listgt;
lt;valuegt;wat.ws.hypertension.schema.HypertensionRequestlt;/valuegt;
lt;valuegt;wat.ws.hypertension.schema.HypertensionResponselt;/valuegt;
lt;/listgt;
lt;/propertygt;
lt;property name=quot;schemaquot; value=quot;/WEB-INF/schema/cp/hypertension.xsdquot;/gt;
lt;/beangt;
lt;!-- WS-Addressing endpoint --gt;
lt;bean id=quot;actionEndpointquot; class=quot;org..ws.soap.addressing.server.AnnotationActionEndpointMappingquot; gt;
lt;property name=quot;preInterceptorsquot;gt;
lt;listgt; lt;ref bean=quot;wsSecurityInterceptorquot;/gt;
lt;/listgt;
lt;/propertygt;
lt;property name=quot;postInterceptorsquot;gt;
lt;listgt;
lt;bean class=quot;org..ws.server.endpoint.interceptor.PayloadLoggingInterceptorquot; /gt;
lt;bean class=quot;org..ws.soap.server.endpoint.interceptor.SoapEnvelopeLoggingInterceptorquot; /gt;
lt;/listgt;
lt;/propertygt;
lt;/beangt;
lt;!-- PayloadRoot endpoint --gt;
lt;bean id=quot;payloadEndpointquot; class=quot;org..ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMappingquot; gt;
lt;property name=quot;interceptorsquot;gt;lt;listgt;lt;bean class=quot;org..ws.server.endpoint.interceptor.PayloadLoggingInterceptorquot; /gt;
lt;bean class=quot;org..ws.soap.server.endpoint.interceptor.SoapEnvelopeLoggingInterceptorquot; /gt; lt;ref bean=quot;wsSecurityInterceptorquot;/gt;lt;/listgt; lt;/propertygt;
lt;/beangt;
lt;bean class=quot;org..ws.soap.server.SoapMessageDispatcherquot;gt;
lt;property name=quot;endpointAdaptersquot;gt;
lt;listgt;
lt;ref bean=quot;actionEndpointquot;/gt;
lt;ref bean=quot;payloadEndpointquot;/gt;
lt;/listgt;
lt;/propertygt;
lt;/beangt;
lt;bean id=quot;schemaquot; class=quot;org..xml.xsd.SimpleXsdSchemaquot;gt;
lt;property name=quot;xsdquot; value=quot;/WEB-INF/schema/cp/hypertension.xsdquot; /gt;
lt;/beangt;
lt;!-- Here begins the WebService transport layer --gt;
lt;bean id=quot;hypertensionquot; class=quot;org..ws.wsdl.wsdl11.DefaultWsdl11Definitionquot;gt;
lt;property name=quot;schemaquot; ref=quot;schemaquot; /gt;
lt;property name=quot;portTypeNamequot; value=quot;ClinicalPathwaysquot; /gt;
lt;property name=quot;targetNamespacequot; value=quot;hypertensionquot; /gt;
lt;property name=quot;locationUriquot; value=quot;hypertension-ws/servicesquot; /gt;
lt;/beangt;
lt;!-- Security Stuff --gt;
lt;bean id=quot;wsSecurityInterceptorquot; class=quot;org..ws.soap.security.xwss.XwsSecurityInterceptorquot;gt;
lt;property name=quot;policyConfigurationquot; value=quot;/WEB-INF/securityPolicy.xmlquot; /gt;
lt;property name=quot;callbackHandlersquot;gt;
lt;listgt;
lt;!-- lt;ref bean=quot;certificateHandlerquot; /gt; --gt;
lt;!-- lt;ref bean=quot;authenticationHandlerquot; /gt;--gt;
lt;ref bean=quot;passwordValidationHandlerquot; /gt;
lt;/listgt;
lt;/propertygt;
lt;/beangt;
lt;bean id=quot;passwordValidationHandlerquot; class=quot;org..ws.soap.security.xwss.callback.SimplePasswordValidationCallbackHandlerquot;gt;
lt;property name=quot;usersquot;gt;
lt;propsgt;
lt;prop key=quot;guestquot;gt;lt;/propgt;
lt;prop key=quot;watquot;gt;passlt;/propgt;
lt;/propsgt;
lt;/propertygt;
lt;/beangt;
lt;bean id=quot;accountServicequot; class=quot;wat.account.AccountServiceClientquot;gt;
lt;property name=quot;accountServicequot; ref=quot;jaxRpcProxyquot; /gt;
lt;/beangt;
lt;bean id=quot;jaxRpcProxyquot; class=quot;org..remoting.jaxrpc.JaxRpcPortProxyFactoryBeanquot;gt;
lt;property name=quot;serviceFactoryClassquot;gt;
lt;valuegt;org.apache.axis.client.ServiceFactorylt;/valuegt;
lt;/propertygt;
lt;property name=quot;wsdlDocumentuclquot;gt;
lt;valuegt;accountService/services/AccountService?wsdllt;/valuegt;
lt;/propertygt;
lt;property name=quot;namespaceUriquot;gt;
lt;valuegt;accountService/services/AccountServicelt;/valuegt;
lt;/propertygt;
lt;property name=quot;serviceNamequot;gt;
lt;valuegt;AccountServiceEndpointServicelt;/valuegt;
lt;/propertygt;
lt;property name=quot;portNamequot;gt;
lt;valuegt;AccountServicelt;/valuegt;
lt;/propertygt;
lt;property name=quot;serviceInterfacequot;gt;
lt;valuegt;wat.account.AccountServicelt;/valuegt;
lt;/propertygt;
lt;/beangt;
lt;/beansgt;
it simply throw big exception :Code:
org..beans.factory.BeanCreationException: Error creating bean with name 'accountService' defined in ServletContext resource [/WEB-INF/spring-ws-servlet.xml]: Cannot resolve reference to bean 'jaxRpcProxy' while setting bean property 'accountService'; nested exception is org..beans.factory.BeanCreationException: Error creating bean with name 'jaxRpcProxy': Post-processing of the FactoryBean's object failed; nested exception is java.lang.NullPointerException
Where is the problem ? Why can't I inject JaxRpcPortProxyFactoryBean to other bean ? When I delete lt;property name=quot;accountServicequot; ref=quot;jaxRpcProxyquot; /gt; then everything is ok but I need to set this property :gt;
.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:379)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: org..beans.factory.BeanCreationException: Error creating bean with name 'jaxRpcProxy': Post-processing of the FactoryBean's object failed; nested exception is java.lang.NullPointerException
at org..beans.factory.support.FactoryBeanRegistrySupport$1.run(FactoryBeanRegistrySupport.java:142)
at java.security.AccessController.doPrivileged(Native Method)
at org..beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:116)
at org..beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:91)
at org..beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1288)
at org..beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:217)
at org..beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org..beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org..beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:269)
... 34 more
Caused by: java.lang.NullPointerException
at org..ws.soap.addressing.server.AnnotationActionEndpointMapping.postProcessAfterInitialization(AnnotationActionEndpointMapping.java:143)
at org..beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:361)
at org..beans.factory.support.AbstractAutowireCapableBeanFactory.postProcessObjectFromFactoryBean(AbstractAutowireCapableBeanFactory.java:1429)
at org..beans.factory.support.FactoryBeanRegistrySupport$1.run(FactoryBeanRegistrySupport.java:139)
... 42 more
2009-08-21 09:19:04 org.apache.catalina.core.ApplicationContext log
SEVERE: StandardWrapper.ThrowableI hope that is not a Spring bug but I really don't know why there is java.lang.NullPointerException
at org..ws.soap.addressing.server.Anno tationActionEndpointMapping.postProcessAfterInitia lization(AnnotationActionEndpointMapping.java:143)
Code:
Caused by: java.lang.NullPointerException
at org..ws.soap.addressing.server.AnnotationActionEndpointMapping.postProcessAfterInitialization(AnnotationActionEndpointMapping.java:143)
at org..beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:361)
at org..beans.factory.support.AbstractAutowireCapableBeanFactory.postProcessObjectFromFactoryBean(AbstractAutowireCapableBeanFactory.java:1429)
at org..beans.factory.support.FactoryBeanRegistrySupport$1.run(FactoryBeanRegistrySupport.java:139)
... 42 more
Any idea what is going on ?
I expect a circulair reference of some sort. Is the service at the given location up and running?
Try enabling debug level on the org..remoting.jaxrpc package and see if the JaxRpcPortPFB is initializing correctly and if everything gets set properly. If not the getObject call will return null and will give this exception.
Service is running properly. When I shut down this service then client throw different exception ( about wrong wsdl ).
All JaxRpcPortProxyFactoryBean properties are set property as well.
I created jax-rpc client ( without spring ) and this client works correctly.
Any ideas to run Spring based jax-rpc client ?
Well for some reason it looks like the JRPPFB isn't initialized yet or properly. Try moving it to a different xml file and load that xml file with the ContextLoaderListener instead of the servlet. Just see if it works, if it isn't there is probably an issue with your configuration or local setup. |
|