cancel
Showing results for 
Search instead for 
Did you mean: 

Error in Getting Database Connection from datasource

Former Member
0 Kudos

Hi,

I am getting the following error when I tried to get the connection from the datasource object.

The call is made by the client proxy and the code is getting executed on the server side.

InitialContext ic = new InitialContext();

DataSource ods = (DataSource)ic.lookup(dataSourceJndiName);

conn = ods.getConnection();

ods.getConnection() is giving the following error

Caused by: com.sap.engine.services.dbpool.exceptions.BaseSQLException: ResourceException occured in method ConnectionFactoryImpl.getConnection(): com.sap.engine.services.connector.exceptions.BaseResourceException: Not allowed to open connection!

at com.sap.engine.services.dbpool.cci.ConnectionFactoryImpl.getConnection(ConnectionFactoryImpl.java:59)

at com.delos.cmx.server.datalayer.DataSourceConnectionData.getDatabaseConnection(DataSourceConnectionData.java:132)

... 37 more

Caused by: com.sap.engine.services.connector.exceptions.BaseResourceException: Not allowed to open connection!

at com.sap.engine.services.connector.resource.impl.RestrictedResourceSetImpl.getSharedEventHandler(RestrictedResourceSetImpl.java:64)

at com.sap.engine.services.connector.jca.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:172)

at com.sap.engine.services.dbpool.cci.ConnectionFactoryImpl.getConnection(ConnectionFactoryImpl.java:51)

... 38 more

at com.sap.engine.services.ejb.exceptions.BaseRuntimeException.writeReplace(BaseRuntimeException.java:273)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:324)

at java.io.ObjectStreamClass.invokeWriteReplace(ObjectStreamClass.java:896)

at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1011)

at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)

at com.sap.engine.services.rmi_p4.DispatchImpl.throwException(DispatchImpl.java:120)

at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:270)

at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:165)

at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:102)

at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:37)

at com.sap.engine.core.cluster.impl6.session.UnorderedChannel$MessageRunner.run(UnorderedChannel.java:71)

at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)

at java.security.AccessController.doPrivileged(Native Method)

at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:94)

at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:140)

I am unable to proceed because of this error.

I would appreciate any help on this.

Thanks

Kavitha

Accepted Solutions (0)

Answers (2)

Answers (2)

guru_subramanianb
Active Contributor
0 Kudos

Hi Kavitha,

Have you included the drivers.jar in your lib folder oof your project structure.Check it.seems the problem is aroung there.

Regards,

Guru

Former Member
0 Kudos

Hi Kavitha,

If u have not gone through the link given below then

plz visit it, it may help u.

http://help.sap.com/saphelp_nw04/helpdata/en/5c/2f2c4142aef623e10000000a155106/content.htm

Regards,

Narinder

Former Member
0 Kudos

Hi Narinder,

I have arleady gone through the link, this error does not belong to that. The databse connection works fine at the server start up. The exception comes from the client call.

Thanks,

Kavitha

Former Member
0 Kudos

I'm having exactly the same error. I'm trying

to port a JBoss application and everything works

fine, except I cannot get the Datasource to work.

I'm using Postrgesql (don't have Oracle installed

on my notebook) if that matters.

Did you find the cause of your problem?

Tom

Former Member
0 Kudos

I found the solution to my problem.

A datasource ABC should be retrieved from JNDI at

jdbc/notx/ABC

NOT from jdbc/ABC

Former Member
0 Kudos

jdbc/notx/ABC? What's 'notx'?

Former Member
0 Kudos

I guess that notx (NoTransaction) means that tranactions

are/should be managed by the application server, not by the

application which accesses the Datasource.

I could find nothing about the notx in the SAP-WAS

documentation...