cancel
Showing results for 
Search instead for 
Did you mean: 

NamingException and ClassCastException during jndi lookup

Former Member
0 Kudos

Hi,

I am trying to access the SAP database(MaxDb)using JNDI lookup in WebDynpro simple java project.

But, during lookup I am getting the following error

com.sap.engine.services.jndi.persistent.exceptions.NamingException: Exception during lookup operation of object with name : jdbc/VSLOOKUP , can not resolve object reference [Root exception is java.lang.ClassCastException]

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

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

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

at com.vitalspring.healthbenefits.dbaccess.DBAccessHelper.main(DBAccessHelper.java:51)

Caused by: java.lang.ClassCastException

at com.sap.engine.services.connector.ResourceObjectFactory.getObjectInstance(ResourceObjectFactory.java:149)

at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:301)

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

... 3 more

Can anybody throw some light on it?

Because, it's urgent for my project.

I would appreciate any kind of help in this regard.

Thanks & Regards,

Rambabu Kancharla

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Rambabu,

Can you provide your code for JNDI lookup? I guess you have not specified your home class correctly.

Regards,

Bhavik

Former Member
0 Kudos

Hello Bhavik,

Sorry for delay in reply as I was on out of work and didn't get chance to check the SDN forums.

I was able to do it in latest version sneak preview 11.

Thanks,

Rambabu

Former Member
0 Kudos

Hi Rambabu,

Please create JDBC DataSource with name "VSLOOKUP".

1. Open VisualAdministrator.

2. Go to services->JDBC and create a DataSource with the baove name and run the application once again

Regards, Anilkumar

Former Member
0 Kudos

Hello Anilkumar,

Sorry for delay in reply as I was on out of work and didn't get chance to check the SDN forums.

I was able to do it in latest version sneak preview 11.

I think the problem with the version.

Thanks,

Rambabu