Skip to Content
author's profile photo Former Member
Former Member

Data Source not found

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Nov 25, 2006 at 01:36 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • 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.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.