cancel
Showing results for 
Search instead for 
Did you mean: 

Error while using custom Adapter Module: javax.naming.NamingException

former_member204873
Contributor
0 Kudos

Hi all,

I have deployed an custom adapter module in PI 7.1 and it is successfully deployed(i checked using netweaver administrator),but when i am using it in Communication channel i am getting exception as (com.sap.engine.services.jndi.persistent.exceptions.NamingException: Exception during lookup operation of object with name localejbs/createPDFModule, cannot resolve object reference).

From my RWB I can see:

Message processing failed. Cause: com.sap.engine.services.jndi.persistent.exceptions.NamingException: Exception during lookup operation of object with name localejbs/createPDFModule, cannot resolve object reference. [Root exception is javax.naming.NamingException: Error occurs while the EJB Object Factory trying to resolve JNDI reference Reference Class Name: Type: clientAppName Content: <vendor name>/AdapterModulesPDF Type: interfaceType Content: local Type: ejb-link Content: Createpdf Type: jndi-name Content: createPDFModule Type: local-home Content: com.sap.aii.af.lib.mp.module.ModuleLocalHome Type: local Content: com.sap.aii.af.lib.mp.module.ModuleLocal javax.ejb.EJBException: nested exception is: java.rmi.RemoteException: [ERROR CODE DPL.DS.6125] Error occurred while starting application locally and wait.; nested exception is: com.sap.engine.services.deploy.exceptions.ServerDeploymentException: [ERROR CODE DPL.DS.5082] Exception while preparing start of application <vendor name>/AdapterModulesPDF. at com.sap.engine.services.ejb3.runtime.impl.DefaultContainerRepository.startApp

Also, Is it manadatory to use JNDI name same as class name.

Please help if possible! Thanks!

Mayank

Accepted Solutions (1)

Accepted Solutions (1)

former_member183908
Active Contributor
0 Kudos

Hello Mayank,

Is it manadatory to use JNDI name same as class name.

JNDI and class name need not be same, In your ejbmodule project, you need to give the JNDI name in ejb-j2ee-engine.xml. This jndi name should match with the name of the Module you have given in communication channel module tab. The class name is nothing to do with the jndi name as both are independent to each other. Maintain JNDI name in ejb-j2ee-engine.xml. This resolves your lookup issue.

Thanks

former_member204873
Contributor
0 Kudos

hi Pavan,

I had correctly used localejbs/<JNDI name> in module tab of communication channel. But still same error is coming.

Thanks,

Mayank

prasannakrishna_mynam
Contributor
0 Kudos

Hi,

javax.ejb.EJBException: nested exception is: java.rmi.RemoteException: <a href="http://ERROR" TARGET="test_blank">http://ERROR</a> CODE DPL.DS.6125 Error occurred while starting application locally and wait.; nested exception is: 
com.sap.engine.services.deploy.exceptions.ServerDeploymentException: <a href="http://ERROR" TARGET="test_blank">http://ERROR</a> CODE DPL.DS.5082 Exception while 
preparing start of application <vendor name>/AdapterModulesPDF. at 
com.sap.engine.services.ejb3.runtime.impl.DefaultContainerRepository.startApp

Can you check whether your .ear file is deployed successfully or not, because your <jndi-name> at the module level is ok. If you check the error the last five lines shown ServelDeploymentException, once check this.

Regards,

Prasanna

former_member204873
Contributor
0 Kudos

hi,

What can be the cause of ServerDeploymentException? Any idea about it.

Thanks,

Mayank

prasannakrishna_mynam
Contributor
0 Kudos

Hi,

Check how you packaged your .EAR file. Are you using any external jar files? what jar files you have included in your .EAR?

Regarding ServerDeploymentException check this link.

[ServerDeploymentException|http://help.sap.com/saphelp_nw04/helpdata/en/5f/3733418bb16e24e10000000a155106/content.htm]

Regards,

Prasanna

former_member204873
Contributor
0 Kudos

hi,

I am using few external jar files as mentioned below:

com.sap.aii.af.cpa.svc.api.jar

com.sap.xi.mapping.tool.lib_api.jar

com.sap.aii.af.cpa.svc.api.jar

com.sap.aii.af.lib.mod.jar

com.sap.aii.af.ms.ifc_api.jar

iText-2.1.5.jar - for PDF creation

I have included these JAR files as External Library in my EJB module project.

And then i created an Enterprise application Project and added my EJB project to this EAR project.

Had i done anythig wrong?

Thanks,

Mayank

prasannakrishna_mynam
Contributor
0 Kudos

Hi,

com.sap.aii.af.cpa.svc.api.jar
com.sap.xi.mapping.tool.lib_api.jar
com.sap.aii.af.cpa.svc.api.jar
com.sap.aii.af.lib.mod.jar
com.sap.aii.af.ms.ifc_api.jar
iText-2.1.5.jar - for PDF creation

-You can include the iText-2.1.5.jar file as its the third part one, and remove rest from the .EAR, because rest of the jar are already there in your J2EE engine, you just need to add the reference for that in application-j2ee-engine.xml. Regarding com.sap.xi.mapping.tool.lib_api.jar are you using it any where in your coding, if you are then add the reference of it too.

- In order to remove jar, unzip your .EAR and delete those jars.

Refer this it you need any help.

https://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/f013e82c-e56e-2910-c3ae-c602a67b918e&overrid...

Regards,

Prasanna

former_member204873
Contributor
0 Kudos

hi Prasanna,

My .EAR file has following files:

jms-resources.xml

Manifest.mf

application-j2ee-engine.xml

apaptermodulePDF.jar

Also my application-j2ee-engine.xml has following references:

reference-type="hard">

<reference-target provider-name="sap.com" target-type="service">engine.security.facade</reference-target>

reference-type="hard">

<reference-target provider-name="sap.com" target-type="library">engine.j2ee14.facade</reference-target>

reference-type="hard">

<reference-target provider-name="sap.com" target-type="service">com.sap.aii.af.svc.facade</reference-target>

reference-type="hard">

<reference-target provider-name="sap.com" target-type="interface">com.sap.aii.af.ifc.facade</reference-target>

reference-type="hard">

<reference-target provider-name="sap.com" target-type="library">com.sap.aii.af.lib.facade</reference-target>

reference-type="hard">

<reference-target provider-name="sap.com" target-type="library">com.sap.base.technology.facade</reference-target>

Do i need to add refernces to other jar files that i had added to my EJB project(it is not mentioned in the link u have provided).

Thanks,

Mayank

jyothi_anagani
Active Contributor
0 Kudos

Hi Gupta,

Not required. I have developed a module, in that I have used an exxternal library( jxl) . But I have not added that reference.

The Module is working fine.

Thanks.

former_member204873
Contributor
0 Kudos

hi jyothi,

How u deployed your module?

Using NWDS or JSPM or something else?

Actually i had deployed using JSPM & I checked using Netweaver Administrator-> application modules, there was an entry for my module. Does that mean deployment is successful?

Thanks,

Mayank

jyothi_anagani
Active Contributor
0 Kudos

Hi Gupta,

We have deployed it using SDM(Software Deployment Manager).

Thanks.

jyothi_anagani
Active Contributor
0 Kudos

To Deploy an EAR File using SDM ...Logon to SDM and choose Deployment and add your EAR File....

To check Whether it is deployed Successfully or not ...Logon to Visual Administrator , choose Deplyee , Expand EJB Container and look for your EJB.

To check Whether JNDI name is set correctly in the Visual Administrator choose Service .---> EJB Container--->Runtime Type

select Project, Expand you will see the JNDI name. It should be same as you mentioned while developing the Module.

Thanks.

prasannakrishna_mynam
Contributor
0 Kudos

Hello,

My .EAR file has following files:

jms-resources.xml
Manifest.mf
application-j2ee-engine.xml
apaptermodulePDF.jar

I am using NWDS7.0.14 version and my EAR has following structure,

TransforEDI.jar
application-j2ee-engine.xml
Manifest.mf
application.xml
SAP_Manifest.mf
sda-dd.xml

since i am not using any third party jars i have not specified in my .ear package. but in your case you need to have iText.jar as in your structure.

regarding the references you need to add the jar that you are using for adapter module in your application-j2ee-engine.xml file as specified in the above article.

your .ear should be

jms-resources.xml
Manifest.mf
application-j2ee-engine.xml
*application.xml*
 
*iText.jar* 
apaptermodulePDF.jar

and your application-j2ee-engine.xml

should have all the references that metioned in the above article, you can replace all the exsisting ones with the adapter module jar references..

Regards,

Prasanna

jyothi_anagani
Active Contributor
0 Kudos

This message was moderated.

Former Member
0 Kudos

Hi mayanak,

Jyothi anagani wrotes

To Deploy an EAR File using SDM ...Logon to SDM and choose Deployment and add your EAR File....

To check Whether it is deployed Successfully or not ...Logon to Visual Administrator , choose Deplyee , Expand EJB Container and look for your EJB.

To check Whether JNDI name is set correctly in the Visual Administrator choose Service .-----> EJB Container----->Runtime Type
select Project, Expand you will see the JNDI name. It should be same as you mentioned while developing the Module.

Thanks.

Please ignore the above reply given by jyothi since in PI7.1 we dont have the VISUAL ADMINISTRATOR we have the NWA.

@jyothi :

after deploying the EAR file did you check whether it has deployed or not using the VISUAL ADMINISTRATOR?

and the references which you had given were already present in the document which was given by prasanna simply you copied the code and pasted it here............

@Gupta please check the document you can find the references and follow as per the document.

cheers and all the best,

Sweth.

former_member204873
Contributor
0 Kudos

hi shweta,

since i am using PI 7.1, in order to deploy using JSPM, i had converted EAR file to SDA file using CECLT. Do u have any idea as to what is the meaning of <vendor name> in an SDA file.

Thanks,

Mayank

former_member204873
Contributor
0 Kudos

hi Prasanna,

As mentioned in your reply, that in .EAR file there should be a file named as application.xml. But what should be the content of this xml file.

Thanks,

Mayank

former_member204873
Contributor
0 Kudos

hi jyothi / Shweta,

I have added references in the application-j2ee-engine.xml file based on information available at: https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c0b39e65-981e-2b10-1c9c-fc3f8e67... This link is for PI 7.1. It is mentioned that we need to add reference for these Targets:

engine.j2ee14.facade

com.sap.aii.af.svc.facade

com.sap.aii.af.ifc.facade

com.sap.aii.af.lib.facade

com.sap.base.technology.facade

But in your reply it is mentioned that i need to add references to:

com.sap.aii.af.lib

com.sap.aii.adapter.xi.svc

com.sap.aii.af.svc

com.sap.aii.af.cpa.svc

Can someone pls tell me which references i need to add in my application-j2ee-engine.xml file if i am using PI 7.1.

Thanks,

Mayank

former_member204873
Contributor
0 Kudos

hi,

How can i check in Netweaver Administrator (NWA) that my EJB module is successfully deployed & JNDI name is set correctly? I am using PI 7.1.

Thanks,

Mayank

stefan_grube
Active Contributor
0 Kudos

Choose "problem monitor" -> JNDI browser

former_member204873
Contributor
0 Kudos

Hi Stefan,

I checked my module in NWA -> JNDI browser. But my EJB JNDI name is not coming under any classification like AF_Module. JNDI name is coming as unclassified. It is coming as (<My JNDI name> class Name: javax.naming.Reference).

My doubt is what all will come in "problem monitor" -> JNDI browser, is it that all modules having some problem will come?

Also, should my module come under any classification(like AF_Module) or is it ok if it is coming as unclassified?

Thanks,

Mayank

former_member204873
Contributor
0 Kudos

Hi,

Copying the full Error Text:

Message processing failed. Cause: com.sap.engine.services.jndi.persistent.exceptions.NamingException: Exception during lookup operation of object with name localejbs/createPDFModule, cannot resolve object reference. [Root exception is javax.naming.NamingException: Error occurs while the EJB Object Factory trying to resolve JNDI reference Reference Class Name: Type: clientAppName Content: <vendor name>/AdapterModulesPDF Type: interfaceType Content: local Type: ejb-link Content: Createpdf Type: jndi-name Content: createPDFModule Type: local-home Content: com.sap.aii.af.lib.mp.module.ModuleLocalHome Type: local Content: com.sap.aii.af.lib.mp.module.ModuleLocal javax.ejb.EJBException: nested exception is: java.rmi.RemoteException: [ERROR CODE DPL.DS.6125] Error occurred while starting application locally and wait.; nested exception is: com.sap.engine.services.deploy.exceptions.ServerDeploymentException: [ERROR CODE DPL.DS.5082] Exception while preparing start of application <vendor name>/AdapterModulesPDF. at com.sap.engine.services.ejb3.runtime.impl.DefaultContainerRepository.startApp(DefaultContainerRepository.java:236) at com.sap.engine.services.ejb3.runtime.impl.DefaultContainerRepository.getEnterpriseBeanContainer(DefaultContainerRepository.java:105) at com.sap.engine.services.ejb3.runtime.impl.DefaultRemoteObjectFactory.resolveReference(DefaultRemoteObjectFactory.java:53) at com.sap.engine.services.ejb3.runtime.impl.EJBObjectFactory.getObjectInstance(EJBObjectFactory.java:129) at com.sap.engine.services.ejb3.runtime.impl.EJBObjectFactory.getObjectInstance(EJBObjectFactory.java:58) at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:283) at com.sap.engine.services.jndi.implclient.ClientContext.lookup(ClientContext.java:413) 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 com.sap.aii.af.lib.util.ejb.FastEjbFactory.createEjbInstance(FastEjbFactory.java:83) at com.sap.aii.af.lib.util.ejb.FastEjbFactory.createEjbInstance(FastEjbFactory.java:51) at com.sap.aii.af.app.mp.ejb.ModuleProcessorBean.getModuleLocal(ModuleProcessorBean.java:403) at com.sap.aii.af.app.mp.ejb.ModuleProcessorBean.process(ModuleProcessorBean.java:272) at sun.reflect.GeneratedMethodAccessor590.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceedFinal(RequestInvocationContext.java:43) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:166) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatesTransition.invoke(Interceptors_StatesTransition.java:19) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Resource.invoke(Interceptors_Resource.java:71) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Transaction.doWorkWithAttribute(Interceptors_Transaction.java:38) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Transaction.invoke(Interceptors_Transaction.java:22) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:189) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatelessInstanceGetter.invoke(Interceptors_StatelessInstanceGetter.java:16) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_SecurityCheck.invoke(Interceptors_SecurityCheck.java:21) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_ExceptionTracer.invoke(Interceptors_ExceptionTracer.java:16) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.DefaultInvocationChainsManager.startChain(DefaultInvocationChainsManager.java:133) at com.sap.engine.services.ejb3.runtime.impl.DefaultEJBProxyInvocationHandler.invoke(DefaultEJBProxyInvocationHandler.java:164) at $Proxy54.process(Unknown Source) at com.sap.aii.af.app.listener.AFWListenerBean.onMessage(AFWListenerBean.java:318) at sun.reflect.GeneratedMethodAccessor647.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceedFinal(RequestInvocationContext.java:43) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:166) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatesTransition.invoke(Interceptors_StatesTransition.java:19) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Resource.invoke(Interceptors_Resource.java:71) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Transaction.doWorkWithAttribute(Interceptors_Transaction.java:38) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Transaction.invoke(Interceptors_Transaction.java:22) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:189) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatelessInstanceGetter.invoke(Interceptors_StatelessInstanceGetter.java:16) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_SecurityCheck.invoke(Interceptors_SecurityCheck.java:21) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.Interceptors_ExceptionTracer.invoke(Interceptors_ExceptionTracer.java:16) at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:177) at com.sap.engine.services.ejb3.runtime.impl.DefaultInvocationChainsManager.startChain(DefaultInvocationChainsManager.java:133) at com.sap.engine.services.ejb3.runtime.impl.DefaultEJBProxyInvocationHandler.invoke(DefaultEJBProxyInvocationHandler.java:164) at $Proxy67.onMessage(Unknown Source) at com.sap.engine.messaging.impl.spi.ServicesImpl.deliver(ServicesImpl.java:314) at com.sap.aii.adapter.xi.ms.XIEventHandler.onDeliver(XIEventHandler.java:1005) at com.sap.engine.messaging.impl.core.queue.consumer.ReceiveConsumer.processMessage(ReceiveConsumer.java:270) at com.sap.engine.messaging.impl.core.queue.consumer.ReceiveConsumer.onMessage(ReceiveConsumer.java:75) at com.sap.engine.messaging.impl.core.queue.Queue.run(Queue.java:922) at com.sap.engine.messaging.runtime.MSWorkWrapper.run(MSWorkWrapper.java:56) 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:152) at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:247) ]

Please help! if possible.

Thanks,

Mayank

former_member204873
Contributor
0 Kudos

hi Experts,

I am still not able to resolve this issue.

Please help if possible!

Thanks,

Mayank

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi mayank,

How could you resolve thsi issue.

I am having the same error . please help me in this regard.

Thanks.

Regards.

former_member204873
Contributor
0 Kudos

This got resolved by added one more refence i.e. to sap.com/com.sap.xi.repository

application in application-j2ee-engine.xml file. This was added because i was using an external library which got stored at this location.

Edited by: Mayank Gupta on Sep 11, 2009 10:53 AM

Former Member
0 Kudos


Hi Mayank,

Which references you have added finally in application-j2ee-engine.xml file .section 1 or section 2

Section 1 :

engine.j2ee14.facade

com.sap.aii.af.svc.facade

com.sap.aii.af.ifc.facade

com.sap.aii.af.lib.facade

com.sap.base.technology.facade

Section 2 :

com.sap.aii.af.lib

com.sap.aii.adapter.xi.svc

com.sap.aii.af.svc

com.sap.aii.af.cpa.svc

I am also using itext jar.So whether i need to include  sap.com/com.sap.xi.repository along with section1 or section2?

Regards,

Karthiga

Former Member
0 Kudos

It is mandatory to give JNDI name and same should be used in th communication channel MODULE tab where you want to call your custom mocule.

former_member204873
Contributor
0 Kudos

hi,

I had used the same name in channel as i had given JNDI name in ejb-j2ee-engine.xml file.

I had used following names in my ejb-j2ee-engine.xml file

<ejb-name>Createpdf</ejb-name>

<jndi-name>createPDFModule</jndi-name>

And used name as localejbs/createPDFModule in Communication channel.

My Question is: should i use same <ejb-name> & <jndi-name>?

Thanks,

Mayank

jyothi_anagani
Active Contributor
0 Kudos

No need. ejb-name and jndi-name can be different. Even I have used differently and My module has been deployed and it is working fine.

Thanks.

former_member183908
Active Contributor
0 Kudos

Hello Mayank,

My Question is: should i use same <ejb-name> & <jndi-name>?

<ejb-name> is the name you assigned to your bean in ejb-jar.xml and <jndi-name> is used to register your bean with this name and jndi factory uses <jndi-name> to lookup your bean, so both are not related, and name can be different.

Cause: com.sap.engine.services.jndi.persistent.exceptions.NamingException: Exception during lookup operation of object with name localejbs/createPDFModule

To resolve the issue, check the jndi-name in your SDM, because when the deployment is successful and the jndi-name should be displayed in the jndi-name list. If you can see this jndi-name means your bean is deployed and registerd with this jndi-name.

if this is visible, let me know how you packaged your .EAR file.

Thanks

jyothi_anagani
Active Contributor
0 Kudos

Hi Gupta,

You have to use the same name in Module tab of Communication channel which you have specified as JNDI name while developing the module in NWDS.

Use like


localejbs/JNDIName

Thanks.