Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 2878

javax.naming.NamingException when performing local lookup

$
0
0

Hi experts,

 

When performing local lookup I get the following exception no matter which lookup string I tried:

 

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 

Error occurs while the EJB Scheme Context Factory trying to resolve an EJB with scheme ejb:/beanName=SubstMgr, interfaceName=com.ep.it.substmgr.ejb.SubstMgrLocal. Check server's trace files for more details.
[EXCEPTION]
javax.naming.NamingException: Error occurs while the EJB Object Factory trying to resolve JNDI reference Reference Class Name: EJB Reference
Type: schemeLookup
Content: true
Type: interfaceType
Content: undetermined
Type: undetermined
Content: com.ep.it.substmgr.ejb.SubstMgrLocal
Type: ejb-link
Content: SubstMgr

com.sap.engine.services.ejb3.runtime.impl.refmatcher.EJBResolvingException: Cannot find EJB matching the criterions defined by JNDI reference: 'Reference Class Name: EJB Reference
Type: schemeLookup
Content: true
Type: interfaceType
Content: undetermined
Type: undetermined
Content: com.ep.it.substmgr.ejb.SubstMgrLocal
Type: ejb-link
Content: SubstMgr


---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


I have 1 development component of type EJB module, inside this DC, I have two session beans, one of it is for JPA to read and store information into Portal database custom table, another session bean is for Apache Olingo for OData services.

I have also a web module development component for my SAPUI5 application, inside this DC it has the servlet mappings which refers to the EJB DC.

Finally I wrap the the web archive (.war file) in an enterprise application DC for deployment.


Now that in one of my java class, I need to perform lookup to the JPA session bean for storing information into database table.

My local lookup is as following:


SubstMgrLocal bean = (SubstMgrLocal) new InitialContext().lookup("ejb:/beanName=SubstMgr, interfaceName=com.ep.it.substmgr.ejb.SubstMgrLocal");

bean.storeSubstTemplateToDb("testUser", "0001", "Template0001", "N");

 


Please correct me if the lookup string is not the correct ones. Also, please advise me if there is anything to be added into the deployment description (web.xml, ejb-j2ee-engine.xml) etc

I sincerely thank all of you for your advice/guidance on this topic.

 

Thanks & Regards,

Goh


Viewing all articles
Browse latest Browse all 2878

Trending Articles