cancel
Showing results for 
Search instead for 
Did you mean: 

Data Source not found

Former Member
0 Kudos

Hi EveryBody

I deploy jtds sql server2000 driver successfully

then I deploy datasource providing drivername successfully

after that I am using it in my web/hibernate application.

I use it in hibernate.cfg.xml file like

<property name="connection.datasource">java:comp/env/YTSQLS2K</property>

where "YTSQLS2K" is the name of deployed datasource.

When I start to deploy the application on the SAP jee 5 Server. The exception is produce in the file in following location

C:\SAP\SS1\JC00\j2ee\cluster\server0\log\defaultTrace.0.trc

-


Caused by: org.hibernate.HibernateException: Could not find datasource

at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:56)

at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124)

at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:56)

at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:366)

at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:60)

at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1881)

at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1174)

at com.yousifi.hibernate.util.HibernateUtil.<clinit>(HibernateUtil.java:21)

... 47 more

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

at com.sap.engine.services.jndi.implserver.ServerContextImpl.lookup(ServerContextImpl.java:650)

at com.sap.engine.services.jndi.implclient.ClientContext.lookup(ClientContext.java:344)

at com.sap.engine.services.jndi.implclient.OffsetClientContext.lookup(OffsetClientContext.java:266)

at com.sap.engine.services.jndi.implclient.OffsetClientContext.lookup(OffsetClientContext.java:286)

at javax.naming.InitialContext.lookup(InitialContext.java:351)

at javax.naming.InitialContext.lookup(InitialContext.java:351)

at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:52)

... 54 more

Is there any entry require in the web.xml file or anywhere else to find "YTSQLS2K"(DataSource).

Thank You,

Best Regards,

Syed Saifuddin

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi EveryBody

Now the datasource is found but a jdbc transaction error occur when I deploy the application on the server .

Below is the stack trace

#SAP J2EE Engine JTA Transaction : [03bfffffffd3a000ffffffc0]####Application [13]##0#0#Error#1#/System/Audit#Java###Exception #1#com.sap.engine.services.dbpool.exceptions.BaseSQLException: Cannot commit transaction from this connection of "YTSQLS2K" DataSource. This resource participates in a local or distributed transaction. #SAP J2EE Engine JTA Transaction : [03bfffffffd3a000ffffffc0]####Application [13]##0#0#Error#1#/System/Audit#Java###Exception #1#com.sap.engine.services.dbpool.exceptions.BaseSQLException: Cannot initiate transaction from a connection of "YTSQLS2K" DataSource. Local or distributed transaction has already started.

#SAP J2EE Engine JTA Transaction : [03bfffffffd3a000ffffffc0]####Application [13]##0#0#Error#1#/System/Audit#Java###Exception #1#com.sap.engine.services.dbpool.exceptions.BaseSQLException: Cannot commit transaction from this connection of "YTSQLS2K" DataSource. This resource participates in a local or distributed transaction.

Any idea about it

I use the jdbc version in datasource <jdbc-1.x>

is there a need to replace it with <jdbc-2.0>

Thank You

Syed Saifuddin

Former Member
0 Kudos

please try to install jdbc driver 2.0 for me this issue was resolved by installation of newest version of jdbc driver

nikolai_tankov
Explorer
0 Kudos

Hi,

The problem is that there is a JTA transaction started from your application and connection which is acquired from hibernate is enlisted into this JTA transaction. Hibernate has own transaction management based on jdbc transaction but jdbc transactions are not allowed for connections that are enlisted into JTA transactions.

The solution is to not start JTA transactions from your application. If JTA transaction is needed for other purposes you have to use jdbc connections that are not enlisted into Jta transactions. You can do this with following :

<property name="connection.datasource">jdbc/notx/YTSQLS2K</property>

Jdbc2.0 or 2-phase commit will not solve this problem.

Best regards,

Nikolai.