axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sagara Gunathunga (JIRA)" <>
Subject [jira] [Commented] (AXIS2-5354) JNDI NameNotFoundException with Axis2 1.6.2 JAXWS webservice.
Date Mon, 02 Jul 2012 05:47:28 GMT


Sagara Gunathunga  commented on AXIS2-5354:

Commenting that line breaks JAX-WS handler framework hence it's not the ideal solution. Can
you please add a sample to reproduce this issue with clear instructions ?   
> JNDI NameNotFoundException with Axis2 1.6.2 JAXWS webservice.
> -------------------------------------------------------------
>                 Key: AXIS2-5354
>                 URL:
>             Project: Axis2
>          Issue Type: Bug
>          Components: jaxws
>    Affects Versions: 1.6.2
>         Environment: JDK 1.6, Tomcat 7
>            Reporter: praveen Vijayan
> I am facing a problem with JNDI lookup when we moved our JAX-WS based web service from
Axis2 1.6.1 to axis 1.6.2 library.
> Following is the exception that gets thrown from the Impl class :
> Caused by: javax.naming.NameNotFoundException: Name java:comp is not bound in this Context
>     at org.apache.naming.NamingContext.lookup(
>     at org.apache.naming.NamingContext.lookup(
>     at javax.naming.InitialContext.lookup(
> The service runs on Tomcat 7 (JDK 6) and deployed as a WAR application. It was working
fine (i.e. it was able to lookup the name) when I was using 1.6.1 version of axis jar.I have
declared the JNDI resource names in context.xml.The problem started when I discarded 1.6.1
jars and started using 1.6.2 Axis2 jars.
> It looks like the issue is happening due to Thread Context Class Loader (TCCL) setting
in is the block of code that I suspect is causing the issue
for us.
>         AxisService service = axisRequestMsgCtx.getAxisService();
>         // we need to set the deployment class loader as the TCCL. This is because, in
>         // services, there can be situations where we have to load classes from the deployment
>         // artifact (JAX-WS jar file) in the message flow. Ex: Handler classes in the
>         // artifact. Adding this as a fix for AXIS2-4930.
>         setContextClassLoader(service.getClassLoader());
> I think when the service class's class loader is set as TCCL, the JNDI object present
in WebAppClassLoader become invisible to the current TCCL. If I comment 'setContextClassLoader(...)'
statement the JNDI lookup passes (i.e. it works fine.).

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message