Showing results for 
Search instead for 
Did you mean: 

JNDI lookup does not work after migrating to SAP Web AS

Former Member
0 Kudos


I have exposed a bean as a web service. The web-jar.xml created with NetWeaver looks the following:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "">
	<description>EJB JAR description</description>
	<display-name>EJB JAR</display-name>
				<description>Describes in which directory to store the obtained file</description>
				<description>Another directory where to store the uploaded files</description>

In the code of my Bean, I like to retrieve the value of deploydir with the following lines:

Context ctx=new InitialContext();

This code worked on JBoss, WebSphere, Jonas ...,

but not on SAP.

After playing a little bit with the Visual Administrator I found out, that there are multiple contexts for my bean:




and I found my entries in the ejbcontext but not in the webContainer context.

I added them to the webContainer context but still nothing happens.

What is the initial context of a web service, so?

Thanks in advance

Johannes Nicolai

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hello Johannes,

the lookup String should be "java:comp/env/deploydir" not "java:/comp/env/deploydir".

Best regards,


Former Member
0 Kudos

Thanks for your answer. Strange that the other containers did not recognize my typo.

Answers (0)