cancel
Showing results for 
Search instead for 
Did you mean: 

Problem With JNDI LookUp

Former Member
0 Kudos

hi,

i have two ejb projects(ProjectOne ane ProjectTwo)

In ProjectOne i have given JNDI name as "General"

(in ejb_j2ee_engine.xml).

While lookup this JNDI name in ProjectTwo it is giving Exception like below.

javax.ejb.<i><b>ObjectNotFoundException:</b></i> com.sap.engine.services.ejb.exceptions.BaseObjectNotFoundException: The requested object does not exist.

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 SoapServlet.doPost(SoapServlet.java:51)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:391)

at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:265)

at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:345)

at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:323)

at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:865)

at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:240)

at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)

at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)

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:162)

<u><b>code</b></u>

Object o= ctx.lookup("General");

MaterialGeneralDataEntityHome objMaterialGeneralDataEntityHome=(MaterialGeneralDataEntityHome)o;

regards

Guru

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member182372
Active Contributor
0 Kudos

Hi Guru,

Object o= ctx.lookup("General");
MaterialGeneralDataEntityHome objMaterialGeneralDataEntityHome=(MaterialGeneralDataEntityHome)o;

is not able to throw ObjectNotFoundException, because according to <a href="http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/ejb/ObjectNotFoundException.html">ObjectNotFoundException</a> <i>The ObjectNotFoundException exception is thrown by a finder method to indicate that the specified EJB object does not exist.</i>. Could you please post a code which causes this exception and the whole stacktrace.

Best regards, Maksim Rashchynski.

Former Member
0 Kudos

hi,

Object o= ctx.lookup("NewGeneral");

MaterialGeneralDataEntityHome objMaterialGeneralDataEntityHome=(MaterialGeneralDataEntityHome)o;

String strmaterialDesc = objMaterialGeneralDataEntity.getStrMaterialDesc();

regards

Guru

Former Member
0 Kudos

hi,

Object o= ctx.lookup("<i><b>General</b></i>");

MaterialGeneralDataEntityHome objMaterialGeneralDataEntityHome=(MaterialGeneralDataEntityHome)o;

String strmaterialDesc = objMaterialGeneralDataEntity.getStrMaterialDesc();

regards

Guru

former_member182372
Active Contributor
0 Kudos

Hi Guru,

Where do you get reference to component interface (objMaterialGeneralDataEntity)? You should call create or find method in your home interface to get reference to compoennt interface.

Best regards, Maksim Rashchynski.

Former Member
0 Kudos

hi,

this is code;

Object o= ctx.lookup("General");

MaterialGeneralDataEntityHome objMaterialGeneralDataEntityHome=(MaterialGeneralDataEntityHome)o;

<u><i><b>MaterialGeneralDataEntity objMaterialGeneralDataEntity = objMaterialGeneralDataEntityHome.findDivisionBymat</b></i></u>(strMat);

String strmaterialDesc = objMaterialGeneralDataEntity.getStrMaterialDesc();

former_member182372
Active Contributor
0 Kudos

Are you working with CMP entity bean? Seems like you just don`t have an entity in your DB matching your conditions ( findDivisionBymat(strMat) ). You are trying to load non-existing entity. So, you can create MaterialGeneralDataEntity or report exception to the user, that entity for given search criteria doesnt exist.

Former Member
0 Kudos

hi,

i am working with CMP .This code has been working fine from 2 days .today suddenly it is Giving exception.

regards

Guru

former_member182372
Active Contributor
0 Kudos

Someone has deleted the enitity ( or entities) .

Former Member
0 Kudos

hi,

it is there.i have seen it in server with the help of visualAdim(EJBContainer).

regards

Guru

former_member182372
Active Contributor
0 Kudos

No, no....not a EJB, but entity. Directly from DB or using delete method of home interface. Check your DB for appropriate table.

Former Member
0 Kudos

hi,

it is there in maxdb(tmp_mat).entity bean is also there in server.

<i><b>can i change any settings in server to run this.</b></i>

regards

Guru

former_member182372
Active Contributor
0 Kudos

Where MaterialGeneralDataEntity is stored, in which table? Insert a record to this table which matches your search criteria (mat==strMat).

Former Member
0 Kudos

Is your application ProjectOne deployed correctly?

Have you checked if the EJB you are trying to bind with the name <b>"General"</b> has been correctly deployed on the WebAS? If you have access to JNDI Registry / Visual administrator you can check this.

HTH,

Rgds,

Amol

Former Member
0 Kudos

hi,

i have checked jndi name with the help of visualadmin.the jndi name "General" is there.But it is Giving exception.

Regards

Guru

Former Member
0 Kudos

This exception might be thrown by a finder method in your entity bean that should return a unique value.If you have written any finder methods in your bean then verify the implementation.