[jboss-user] [JBoss Web Services Users] - Re: Spring bean injection to Service implementation

sagolsb do-not-reply at jboss.com
Fri Oct 23 06:15:57 EDT 2009


Here are some more information: when the web application starts up the web application context is started as shown in the stack trace below:

[[/CredentialService]] Initializing Spring root WebApplicationContext
[ContextLoader] Root WebApplicationContext: initialization started
....................
[XmlWebApplicationContext] Bean factory for application context [org.springframework.web.context.support.XmlWebApplicationContext at f582e9]: org.springframework.beans.factory.support.DefaultListableBeanFactory at b9915a
.......
[DefaultListableBeanFactory] Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory at b9915a: defining beans [echoService]; root of factory hierarchy
..............
[ContextLoader] Root WebApplicationContext: initialization completed in 170 ms


Within the web service implementation class, the WebServiceContext is injected through @Resource and the ServletContext is retrieved from this through the MessageContext, both of which are printed out from the service implementation as shown below:


[STDOUT] WebServiceContext: org.jboss.wsf.stack.jbws.WebServiceContextJSE at 477e4c
[STDOUT] ServletContext: org.jboss.soa.esb.actions.soap.adapter.SOAPProcessorServletContext at 1b4e510

But when I try to retrive the WebApplicationContext through:
webApplicationContext = WebApplicationContextUtils.getWebApplicationContext(servletContext);
which in turn internally calls: 
servletContext.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);

throws the exception:

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) 
..................................

Can you please let me know if I'm missing something?

Regards,
Sagol


View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4261838#4261838

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4261838



More information about the jboss-user mailing list