-
Aug 4th, 2008, 03:08 AM
#1
JAX-WS autowiring doesn't work on WebLogic Server
Hi,
Recently I'm trying to add Spring's autowiring support to my JAX-WS web services by having them inherit from SpringBeanAutowiringSupport, i.e.
#WebService
public class Foo extends SpringBeanAutowiringSupport {
#Autowired
private Bar bar;
}
And also, define these services in web.xml:
<listener>
<listener-class>org.springframework.web.context.ContextLoade rListener</listener-class>
</listener>
<servlet>
<servlet-name>Foo</servlet-name>
<servlet-class>xxx.Foo</servlet-class>
<load-on-startup>0</load-on-startup>
</servlet>
But however, at runtime I found the dependency injection never happened. After looking into Spring's code, I guess the problem might be that Spring probably requires that my WS servlet and ContextLoaderListener should be able to get access to exactly the same thread context class loader (i.e. the classloader for the webapp), but when weblogic processes my servlet, it temporarily sets the thread context class loader to a dedicated JAXWS class loader which inherits from the regular webapp class loader, and this causes that my servlet can't share the spring application context of the webapp, so that the DI gets ignored.
If I'm not doing anything wrong, I just wonder if there's any solution on the spring side?
Thanks a lot!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules