cancel
Showing results for 
Search instead for 
Did you mean: 

Error on datasource at WebDynpro

Former Member
0 Kudos

Hi all,

I set up the datasource refer to the following homepage:

Java Development Manual - Reference - Tutorials - Persistence

- Getting Started with Relational Persistence

- Assembling the Application

- Managing Aliases

After creating the datasource, I can connect to Database on Visual Administrator.

But I can't refer that detasource on WebDynpro.

That code in WebDynpro is :

-


InitialContext ctx = new InitialContext();

DataSource ds = (DataSource) ctx.lookup("jdbc/HSQLJ2EDB");

-


And it occured the following error

=================================

com.sap.engine.services.connector.exceptions.BaseResourceException: ConnectionFactory "HSQLJ2EDB" does not exist. Possible reasons: the connector in which ConnectionFactory "HSQLJ2EDB" is defined is not deployed or not started.

=================================

Have you seen that error and know how to resolve ?

Thanks.

Regards.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi all,

I resolved this question.

My WebDynpro name was different from datasource name.

I can connect to Database after i change the WebDynpro name is HSQLJ2EDB.

WebDynpro code is:

-


InitialContext ctx = new InitialContext();

DataSource ds = (DataSource) ctx.lookup("jdbc/HSQLJ2EDB");

-


thanks.

Former Member
0 Kudos

Sorry koushiro,

what you write have no sense. The WD name and datasource name have nothing in common.

Probabily you had only a deploy problem or you had to restart the Was for the new datasource set.

Bye, Vito

Former Member
0 Kudos

Hi all,

I resolved this question.

My WebDynpro name was different from datasource name.

I can connect to Database after i change the WebDynpro name is HSQLJ2EDB.

WebDynpro code is:

-


InitialContext ctx = new InitialContext();

DataSource ds = (DataSource) ctx.lookup("jdbc/HSQLJ2EDB");

-


thanks.

Former Member
0 Kudos

Dear Naga Raju Meesala.

I try the code you teach, but it occures the following error.

-


com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException: Object not found in lookup of HSQLJ2EDB.

-


and,i try these code, but they get same errors.

ctx.lookup("jdbc/<data-source-name>");

ctx.lookup("<data-source-name>");

Please tell me how to resolve that error.

Former Member
0 Kudos

Hai,

try with this code

DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/HSQLJ2EDB");

regards,

naga

Former Member
0 Kudos

Please,

verify that you have the datasource alias you are using in the Visual Administrator.

Bye,

Vito

Former Member
0 Kudos

Dera Naga Raju Meesala.

I try the code you teach, but it occures the following error.

-


com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException: Path to object does not exist at java:comp, the whole lookup name is java:comp/env/jdbc/HSQLJ2EDB.

-


Please tell me how to resolve that error.

Former Member
0 Kudos

Dear Vito Palasciano.

I verify the datasource alias :

(Info.)

> Driver:

> name = 'HSQL_DRIVER'

> jar = C:\home\opt\hsqldb\lib\hsqldb.jar

>

> DataSource:

> Application Name : local/DCM

> DataSource Name : HSQLJ2EDB

> Aliases : none

> Driver Name: HSQL_DRIVER

> JDBC Version: 1.x (no XA suppoprt)

> JDBC 1.x Compliant

> Driver Class: org.hsqldb.jdbc.Driver

> Database URL: jdbc:hsqldb:hsql://localhost/

> User: SA

> PASSWORD: PASSWORD1

>

> [Additional] Properties:

> url = jdbc:hsqldb:hsql://localhost/

> user = SA

> password = PASSWORD1

>

> [Additional] SQL Engine

> [x] Vendor_SQL

>

> [DB Initialization]

> Execute -> OK

Is it wrong?

Former Member
0 Kudos

Looks like Ok...not issues with the way you configure the Datasource.

Are you deploying the application on the same J2EE engine ?? Pl verify

-Anilkumar

Former Member
0 Kudos

Hai ,

try by giving

DataSource ds = (DataSource) ctx.lookup("jdbc/client/<data-source-name>" );

regards,

naga