You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by tom909 <tl...@ephibian.com> on 2008/02/05 18:00:08 UTC

Tomcat webservice webapp/MessageConext always null

Looking for any insight or assistance as to why a web service would return a
null MessageContext called from within the service method itself.  This web
service has worked perfectly for some time now deployed to a tomcat 5.5
server, within a .war file with all the axis jars embedded. 

The problem is, I now need to add a new feature where I need to access the
incoming request URL, and from what I've found the only way to do this is
with the MessageContext using MessageContext.getCurrentMessageContext() or
(MessageContext)MessageContext.currentMessageContext.get().  Both of these
calls return null.  

I can see the axis log messages flying by in catalina.out when I do
requests, and like I said the service has been working fine, why wouldn't I
be able to access the MessageContext in the service method?  I was thinking
of trying to repackage my .war as an .aar and deploy the service again
through axis administration but I haven't had any luck (I get class not
found errors).  Any ideas or help is appreciated.

Tom

-- 
View this message in context: http://www.nabble.com/Tomcat-webservice-webapp-MessageConext-always-null-tp15292925p15292925.html
Sent from the Axis - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


Re: Tomcat webservice webapp/MessageContext always null

Posted by tom909 <tl...@ephibian.com>.
I found what the problem was, and perhaps it will save someone the hours it
took me to find the answer.  To make my service implementation class aware
of the MessageContext using getCurrentMessageContext(), I needed to add a
scope parameter to the deploy.wsdd file (scope="application").  Once I added
that, my call to get the MessageContext was successful.  

 <service name="serviceName" provider="java:RPC" style="wrapped"
scope="application" use="literal" >



tom909 wrote:
> 
> Looking for any insight or assistance as to why a web service would return
> a null MessageContext called from within the service method itself.  This
> web service has worked perfectly for some time now deployed to a tomcat
> 5.5 server, within a .war file with all the axis jars embedded. 
> 
> The problem is, I now need to add a new feature where I need to access the
> incoming request URL, and from what I've found the only way to do this is
> with the MessageContext using MessageContext.getCurrentMessageContext() or
> (MessageContext)MessageContext.currentMessageContext.get().  Both of these
> calls return null.  
> 
> I can see the axis log messages flying by in catalina.out when I do
> requests, and like I said the service has been working fine, why wouldn't
> I be able to access the MessageContext in the service method?  I was
> thinking of trying to repackage my .war as an .aar and deploy the service
> again through axis administration but I haven't had any luck (I get class
> not found errors).  Any ideas or help is appreciated.
> 
> Tom
> 
> 

-- 
View this message in context: http://www.nabble.com/Tomcat-webservice-webapp-MessageContext-always-null-tp15292925p15306967.html
Sent from the Axis - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org