Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JAX-WS intergation via SpringBeanAutowiringSupport doesn't work in Weblogic 10.3 [SPR-5652] #10323

Closed
spring-projects-issues opened this issue Apr 6, 2009 · 6 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: bug A general bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

Dmitri Maximovich opened SPR-5652 and commented

Method for injecting dependencies in JAX-WS endpoint class, as described in the link below, doesn't work in Weblogic 10.3

http://static.springframework.org/spring/docs/2.5.x/reference/remoting.html#remoting-web-services-jaxws-export-servlet

It looks like Weblogic processes JAX-WS calls in separate classloader from web-app classloader. In the log files it's evident that Spring's context getting loaded twice: first on web-app startup (from org.springframework.web.context.ContextLoaderListener) and then upon handling of JAX-WS call. Following message from SpringBeanAutowiringSupport observed in log file as well:

2009-04-06 10:05:45,701 DEBUG [[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] (org.springframework.web.context.support.SpringBeanAutowiringSupport:processInjectionBasedOnCurrentContext:87) - Current WebApplicationContext is not available for processing of AuthenticationWs: Make sure this class gets constructed in a Spring web application. Proceeding without injection.

As a result dependencies annotated with @Autowired are not set.


Affects: 2.5.6

Referenced from: commits db2d323, 87eb3f9

1 votes, 7 watchers

@spring-projects-issues
Copy link
Collaborator Author

Michael Isvy commented

I am wondering if this is Weblogic-specific. I am using Tomcat+CXF and I can see the same error message.

@spring-projects-issues
Copy link
Collaborator Author

Jörg Sischka commented

I don't think so. I see the same message on JBoss5.1 (for jdk6) with JBossWS-Metro.

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

I've revised this for Spring 3.0.1: not only checking the ClassLoader match now, but also storing a static WebApplicationContext reference if - and only if - the Spring libraries get deployed in the same web application as the ContextLoader. That should typically be the case if you add the Spring jars to your WEB-INF/lib directory.

Juergen

@spring-projects-issues
Copy link
Collaborator Author

Lucus Darnell commented

I am using version 3.0.2, but am still having the same problem. I am running on Tomcat and I still see the following error:

14 Jun 2010 15:31:46 DEBUG org.springframework.web.context.support.SpringBeanAutowiringSupport - Current WebApplicationContext is not available for processing of CarpetWebservice: Make sure this class gets constructed in a Spring web application. Proceeding without injection.

Does anyone else out there in Spring land have this working and / or know of a work around? Any help would be greatly appreciated.

Thanks in advance...

@spring-projects-issues
Copy link
Collaborator Author

Chris Beams commented

Lucus,

It's been quite a while since you reopened this issue; if it's still a concern for you, please create a new issue and mention this issue ID when doing so. Thanks!

@spring-projects-issues
Copy link
Collaborator Author

Ivo Smid commented

I had same problem on WebLogic 10.3.2.0 and it was because Thread.currentThread().getContextClassLoader() called in ContextLoader.initWebApplicationContext (while web app is starting) method returns different classloader instance compared to classloader returned while calling .getContextClassLoader in ContextLoader.getCurrentWebApplicationContext method (while SpringBeanAutowiringSupport child instance is created inside http request context).
I do not know why WLS behaves like this and I have solved it by calling SpringBeanAutowiringSupport.processInjectionBasedOnServletContext in "legacy" class constructor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants