You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Ma...@materna.de on 2011/11/08 10:11:18 UTC

Axis2 JNDI java:comp/env not resolved

After migrating from axis2 1.4.x to axis2 1.5.1 the jndi lookup fails.
The data sources are configured with CATALINA_HOME/conf/context.xml and
run with axis2 1.4.x. Now, with axis2 1.5.1 (also tried 1.5.6) the jndi
lookup fails:

Name java:comp is not bound in this Context

 

CATALINA_HOME/conf/context.xml:

...

<Resource name="jdbc/MyDB" auth="Container"

          type="javax.sql.DataSource" 

          driverClassName="oracle.jdbc.OracleDriver"

          ...

> 

 

We are using this jndi url: java:comp/env/jdbc/MyDB

 

The access path is tomcat->axis2->axis2-service->spring->hibernate, but
also tomcat->axis2->axis2-service fails using direct jndi lookup:

 

InitialContext ic = new ...;

ic.lookup("java:comp/env/jdbc/MyDB"); // fails

ic.lookup("java:comp/env"); // fails

ic.lookup("java:comp"); // fails

 

Very curious: it seems to be a windows problem only. Running the same
tomcat-/axis installation under unix has no problem. (directly copied
system from unix).

 

Setting parameter ServiceTCCL to composite (axis2.xml) has no effect.

 

Any idea what's wrong?

 

Regards,

markus

 


AW: Axis2 JNDI java:comp/env not resolved

Posted by Ma...@materna.de.
Hi Martin,

 

we are using tomcat 5.5 with axis2 1.5.1. Please note, the problem seems to be os specific on windows platforms.

I assume this is an axis2 specific problem, the same environment using axis2 1.4 clearly runs.

 

I assume java:comp or java:comp/env is not available in context of axis archive (.aar file). Seems the axis2 classloader hides this context.

 

Regards,

Markus

 

Von: Martin Gainty [mailto:mgainty@hotmail.com] 
Gesendet: Dienstag, 8. November 2011 13:03
An: java-user@axis.apache.org
Betreff: RE: Axis2 JNDI java:comp/env not resolved

 

Markus

one thing to check in your resource definition
  <!-- A boolean indicating if the jndi-name should be prefixed with java: which causes the DataSource to only be accessible from within the jboss server vm. The default is true. -->
    <use-java-context>true</use-java-context>

another is to check if the naming service is live for your app server..which AppServer are you implementing on?

Mit Freundlichen Gruben
Martin 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.

Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.



 

________________________________

Subject: Axis2 JNDI java:comp/env not resolved
Date: Tue, 8 Nov 2011 10:11:18 +0100
From: Markus.Breuer@materna.de
To: java-user@axis.apache.org

After migrating from axis2 1.4.x to axis2 1.5.1 the jndi lookup fails. The data sources are configured with CATALINA_HOME/conf/context.xml and run with axis2 1.4.x. Now, with axis2 1.5.1 (also tried 1.5.6) the jndi lookup fails:

Name java:comp is not bound in this Context

 

CATALINA_HOME/conf/context.xml:

...

<Resource name="jdbc/MyDB" auth="Container"

          type="javax.sql.DataSource" 

          driverClassName="oracle.jdbc.OracleDriver"

          ...

> 

 

We are using this jndi url: java:comp/env/jdbc/MyDB

 

The access path is tomcat->axis2->axis2-service->spring->hibernate, but also tomcat->axis2->axis2-service fails using direct jndi lookup:

 

InitialContext ic = new ...;

ic.lookup("java:comp/env/jdbc/MyDB"); // fails

ic.lookup("java:comp/env"); // fails

ic.lookup("java:comp"); // fails

 

Very curious: it seems to be a windows problem only. Running the same tomcat-/axis installation under unix has no problem. (directly copied system from unix).

 

Setting parameter ServiceTCCL to composite (axis2.xml) has no effect.

 

Any idea what's wrong?

 

Regards,

markus

 


RE: Axis2 JNDI java:comp/env not resolved

Posted by Dipesh Garg <di...@erevmax.com>.
Is there any good ebook of Activemq

 

Dipesh Garg

9874086340

 

  _____  

From: Martin Gainty [mailto:mgainty@hotmail.com] 
Sent: Tuesday, November 08, 2011 5:33 PM
To: java-user@axis.apache.org
Subject: RE: Axis2 JNDI java:comp/env not resolved

 

Markus

one thing to check in your resource definition
  <!-- A boolean indicating if the jndi-name should be prefixed with java:
which causes the DataSource to only be accessible from within the jboss
server vm. The default is true. -->
    <use-java-context>true</use-java-context>

another is to check if the naming service is live for your app server..which
AppServer are you implementing on?

Mit Freundlichen Gruben
Martin 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte
Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht
dient lediglich dem Austausch von Informationen und entfaltet keine
rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.

Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le
destinataire prévu, nous te demandons avec bonté que pour satisfaire
informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie
de ceci est interdite. Ce message sert à l'information seulement et n'aura
pas n'importe quel effet légalement obligatoire. Étant donné que les email
peuvent facilement être sujets à la manipulation, nous ne pouvons accepter
aucune responsabilité pour le contenu fourni.



 

  _____  

Subject: Axis2 JNDI java:comp/env not resolved
Date: Tue, 8 Nov 2011 10:11:18 +0100
From: Markus.Breuer@materna.de
To: java-user@axis.apache.org

After migrating from axis2 1.4.x to axis2 1.5.1 the jndi lookup fails. The
data sources are configured with CATALINA_HOME/conf/context.xml and run with
axis2 1.4.x. Now, with axis2 1.5.1 (also tried 1.5.6) the jndi lookup fails:

Name java:comp is not bound in this Context

 

CATALINA_HOME/conf/context.xml:

…

<Resource name="jdbc/MyDB" auth="Container"

          type="javax.sql.DataSource" 

          driverClassName="oracle.jdbc.OracleDriver"

          …

> 

 

We are using this jndi url: java:comp/env/jdbc/MyDB

 

The access path is tomcat->axis2->axis2-service->spring->hibernate, but also
tomcat->axis2->axis2-service fails using direct jndi lookup:

 

InitialContext ic = new …;

ic.lookup(“java:comp/env/jdbc/MyDB”); // fails

ic.lookup(“java:comp/env”); // fails

ic.lookup(“java:comp”); // fails

 

Very curious: it seems to be a windows problem only. Running the same
tomcat-/axis installation under unix has no problem. (directly copied system
from unix).

 

Setting parameter ServiceTCCL to composite (axis2.xml) has no effect.

 

Any idea what’s wrong?

 

Regards,

markus

 


RE: Axis2 JNDI java:comp/env not resolved

Posted by Martin Gainty <mg...@hotmail.com>.
Markus

one thing to check in your resource definition  <!-- A boolean indicating if the jndi-name should be prefixed with java: which causes the DataSource to only be accessible from within the jboss server vm. The default is true. -->
    <use-java-context>true</use-java-context>
another is to check if the naming service is live for your app server..which AppServer are you implementing on?

Mit Freundlichen Gruben
Martin 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.

 Subject: Axis2 JNDI java:comp/env not resolved
Date: Tue, 8 Nov 2011 10:11:18 +0100
From: Markus.Breuer@materna.de
To: java-user@axis.apache.org



After migrating from axis2 1.4.x to axis2 1.5.1 the jndi lookup fails. The data sources are configured with CATALINA_HOME/conf/context.xml and run with axis2 1.4.x. Now, with axis2 1.5.1 (also tried 1.5.6) the jndi lookup fails:Name java:comp is not bound in this Context CATALINA_HOME/conf/context.xml:…<Resource name="jdbc/MyDB" auth="Container"          type="javax.sql.DataSource"           driverClassName="oracle.jdbc.OracleDriver"          …>  We are using this jndi url: java:comp/env/jdbc/MyDB The access path is tomcat->axis2->axis2-service->spring->hibernate, but also tomcat->axis2->axis2-service fails using direct jndi lookup: InitialContext ic = new …;ic.lookup(“java:comp/env/jdbc/MyDB”); // failsic.lookup(“java:comp/env”); // failsic.lookup(“java:comp”); // fails Very curious: it seems to be a windows problem only. Running the same tomcat-/axis installation under unix has no problem. (directly copied system from unix). Setting parameter ServiceTCCL to composite (axis2.xml) has no effect. Any idea what’s wrong? Regards,markus  		 	   		  

AW: Axis2 JNDI java:comp/env not resolved

Posted by Ma...@materna.de.
Seems the axis2 class loader caused the missing context problem. The class loader probably returns a copy of a class already loaded
by the tomcats WebAppClassloader. We put the WebAppClassloader into TCCL and it worked.
 
Does axis2 create multiple copies of a loaded class? I heard tomcat uses classes from servlet-api to store java:comp/env objects.
Is there any way to disable this feature? Any more ideas?

________________________________

Von: Breuer, Markus
Gesendet: Di 08.11.2011 10:11
An: java-user@axis.apache.org
Betreff: Axis2 JNDI java:comp/env not resolved



After migrating from axis2 1.4.x to axis2 1.5.1 the jndi lookup fails. The data sources are configured with CATALINA_HOME/conf/context.xml and run with axis2 1.4.x. Now, with axis2 1.5.1 (also tried 1.5.6) the jndi lookup fails:

Name java:comp is not bound in this Context

 

CATALINA_HOME/conf/context.xml:

...

<Resource name="jdbc/MyDB" auth="Container"

          type="javax.sql.DataSource" 

          driverClassName="oracle.jdbc.OracleDriver"

          ...

> 

 

We are using this jndi url: java:comp/env/jdbc/MyDB

 

The access path is tomcat->axis2->axis2-service->spring->hibernate, but also tomcat->axis2->axis2-service fails using direct jndi lookup:

 

InitialContext ic = new ...;

ic.lookup("java:comp/env/jdbc/MyDB"); // fails

ic.lookup("java:comp/env"); // fails

ic.lookup("java:comp"); // fails

 

Very curious: it seems to be a windows problem only. Running the same tomcat-/axis installation under unix has no problem. (directly copied system from unix).

 

Setting parameter ServiceTCCL to composite (axis2.xml) has no effect.

 

Any idea what's wrong?

 

Regards,

markus

 


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