-
1. Re: Error accessing JBossWS service via JbossESB SoapProcess
sagolsb Oct 23, 2009 7:25 AM (in response to sagolsb)Sorry missed the URL:
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4261840#4261840
thanks,
Biramani -
2. Re: Error accessing JBossWS service via JbossESB SoapProcess
kconner Oct 23, 2009 11:17 AM (in response to sagolsb)Your issue is because you are attempting to use the ServletContext in an invocation which is not occurring over HTTP. There is no servlet context from which to retrieve attributes.
If you can provide us with an example of what you are trying to achieve then we can certainly see if we can mimic this within the ESB.
Kev -
3. Re: Error accessing JBossWS service via JbossESB SoapProcess
sagolsb Oct 27, 2009 6:19 AM (in response to sagolsb)Hi Kev,
I thought the SOAPProcessor action was simulating/making a web service request to the web service on JBossWS? I certainly get an instance of org.jboss.soa.esb.actions.soap.adapter.SOAPProcessorServletContext which is an implementation of ServletContext interface; but as you mentioned I can not retrieve attributes from it. The following is what I have been trying to do:
1. Start the Spring WebApplicationContext when the JBossWS web application is started byt adding the following in the web.xml<listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener>
2. Inject the WebServiceContext to the POJO service implementation through the @Resource annotation as follows:@Resource WebServiceContext context;
3. Then get the ServletContext from it:ServletContext servletContext = (ServletContext) context.getMessageContext().get( MessageContext.SERVLET_CONTEXT);
This way I can get hold of the MessageContext as well as the ServletContext.
4. The retrieve the Spring WebApplicationContext started earlier from the ServletContext:servletContext.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);
But it fails as the ServletContext doesn't have attributes registered with it, with the following error message:
........................
ERROR [InvocationHandlerJAXWS] Method invocation failed with exception: null
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Caused by: java.lang.UnsupportedOperationException: Not yet supported
at org.jboss.soa.esb.actions.soap.adapter.SOAPProcessorServletContext.getAttribute(SOAPProcessorServletContext.java:45)
..................................
This works ok if I access the service directly bypassing the ESB.
Thanks,
Biramani -
4. Re: Error accessing JBossWS service via JbossESB SoapProcess
kconner Oct 27, 2009 7:14 AM (in response to sagolsb)"sagolsb" wrote:
I thought the SOAPProcessor action was simulating/making a web service request to the web service on JBossWS?
It is, but it does that by pretending to be coming over HTTP. There was no InVM invocation for JBossWS at the time this was written and I believe this may still be the case. In any case, any JBossWS InVM mechanism would probably suffer from the same issue as it would likely bypass the web app."sagolsb" wrote:
I certainly get an instance of org.jboss.soa.esb.actions.soap.adapter.SOAPProcessorServletContext which is an implementation of ServletContext interface; but as you mentioned I can not retrieve attributes from it.
Sure, but this is coming from ESB and not via any web app."sagolsb" wrote:
1. Start the Spring WebApplicationContext when the JBossWS web application is started byt adding the following in the web.xml
This is started within the context of the web application, but we have had to bypass that in order to support co-located web services."sagolsb" wrote:
4. The retrieve the Spring WebApplicationContext started earlier from the ServletContext:servletContext.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);
But it fails as the ServletContext doesn't have attributes registered with it, with the following error message:
It fails because it is not coming via the web app, and ESB knows nothing about any of the web application settings."sagolsb" wrote:
This works ok if I access the service directly bypassing the ESB.
The web app does have that knowledge, hence it is available through that ServletContext.
We will need to investigate this and see what is possible. Could you please create a JIRA for this feature request?
Thanks,
Kev