Well it might be a classloader issue because an aar uses a different
classloader than a servlet. You can of course have an aar which can
see classes in a higher classloader - for example you can have an aar
whcih references your ServiceClass that is placed in WEB-INF/lib or
WEB-INF/classes ... but the aar itself merely contains just the
services.xml . I'd try that. Or alternatively you can have you Servlet
init a singleton or something and just get your connection from that
inside the service.

HTH,
Robert

On 9/21/06, Johan Lundberg <[EMAIL PROTECTED]> wrote:
Hi Robert

I tried to do this from a special servlet in axis2/WEB-INF/classes and
the lookup works like a charm. Why isn't it accessible from the aar
classes? feature or bug? If it is a feature, how do I get access to the
context from initContext.lookup("java:comp/env"); ?

My final goal is to use the tomcat DataSource jdbc pooling.

/johan

robert lazarski wrote:
> Can you do the same lookup successfully via a non-axis2 class inside
> WEB-INF/classes ?
>
> Robert
>
> On 9/21/06, Johan Lundberg <[EMAIL PROTECTED]> wrote:
>> I am using Axis2 nightly build from 31 August and cannot lookup the
>> java:comp/env context from a created InitialContext created inside a
>> class in the aar-file
>>
>> When I do this:
>> Context initContext = new InitialContext();
>> Context envContext = (Context)initContext.lookup("java:comp/env");
>>
>> I get a NameNotFoundException.
>>
>> By the way, I am using the distributed axis2.war in tomcat 5.5.17
>>
>> Any ideas?
>> johan
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to