Skip to Content
Former Member
Apr 28, 2005 at 10:57 AM

problems connecting to SAP DB from BMP EJB



i wrote an BMP EJB (MyAccountBean), which should connect to the table TMP_ACCOUNT in the SAP DB but i am getting the exception: Path to object does not exist at : java:comp

I created the new table through an sda file that i successfully deployed (i have checked if this table exists with the sql studio).

I create a data-source-aliases.xml in the EAR Project:






I defined in the ejb-jar.xml a reference to ACCOUNT:
















<res-sharing-scope>Shareable</res-sharing- scope>














I created an alias with the Visual Administrator under the topic JDBC: ACCOUNT (deployer: SAP J2EDB DataSource) and i create the connection to the database from MyAccountEJB with:

javax.sql.DataSource ds =

(javax.sql.DataSource) ctx.lookup("java:comp/env/jdbc/ACCOUNT");

The client application initialize the context in this way:

Properties p = new Properties();


p.put(Context.PROVIDER_URL, "localhost:50004");

p.put(Context.SECURITY_PRINCIPAL, <login>);

p.put(Context.SECURITY_CREDENTIALS, <password>);

could you please help me to know what i am doing wrong?.