Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Web Services Certification (SCDJWS/OCEJWSD) and the fly likes Context injection failed on service access Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Web Services Certification (SCDJWS/OCEJWSD)
Bookmark "Context injection failed on service access" Watch "Context injection failed on service access" New topic
Author

Context injection failed on service access

Kumar Raja
Ranch Hand

Joined: Mar 18, 2010
Posts: 518
    
    2

Hello All,

I have my SEI designed as below



My service is deployed in GlassFish v3.0 and on service access, I'm receiving the below error message indicating that dependency injection failed.



Any advice on why I'm seeing this and what should be done to avoid this.


Regards
KumarRaja

Kumar Raja
Ranch Hand

Joined: Mar 18, 2010
Posts: 518
    
    2

Hmm, after referring to Ivan's notes I realized that I need to inject WebServiceContext instead of MessageContext, which I retried again but still receiving the injection failure exception as mentioned before. The surprise part is, when I tried the example given by Ivan in his material, it worked great. But in my version, I started accessing the WebServiceContext instead of mere declaration using @Resource.



My SOAP Request and response are as below

Request


Response
Kumar Raja
Ranch Hand

Joined: Mar 18, 2010
Posts: 518
    
    2

Can somebody advice me ,why I'm getting injection failure.
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
Start from the example in my study notes that work and modify it step-by-step until your problem appears.
Test after each step. This way you can determine what caused injection of the context to fail.
Best wishes!


My free books and tutorials: http://www.slideshare.net/krizsan
Kumar Raja
Ranch Hand

Joined: Mar 18, 2010
Posts: 518
    
    2

Well I got this exception fixed. I don't know how it got fixed, but after couple of reattempts, it ran fine.
 
jQuery in Action, 2nd edition
 
subject: Context injection failed on service access