cancel
Showing results for 
Search instead for 
Did you mean: 

Error while deploying a message driven bean

Former Member
0 Kudos

I am getting the following errors while deploying message driven bean example(WAS). I have alreday configured connection factories/topics/ queues.

=> deployed with warning : file:/C:/DOCUME1/SHILPA1/LOCALS~1/Temp/temp25375MessageEAR.ear

Finished with warnings: development component 'MessageEAR'/'sap.com'/'localhost'/'2007.01.17.09.43.36':

Caught exception during application startup from SAP J2EE Engine's deploy service:

java.rmi.RemoteException: Error occurred while starting application sap.com/MessageEAR and wait. Reason: Clusterwide exception: server ID 4380950:com.sap.engine.services.jmsconnector.exceptions.BaseDeploymentException: Naming error.

at com.sap.engine.services.jmsconnector.deploy.ContainerImpl.loadFactory(ContainerImpl.java:1902)

at com.sap.engine.services.jmsconnector.deploy.ContainerImpl.prepareStart(ContainerImpl.java:715)

at com.sap.engine.services.deploy.server.application.StartTransaction.prepareCommon(StartTransaction.java:231)

at com.sap.engine.services.deploy.server.application.StartTransaction.prepare(StartTransaction.java:179)

at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhasesOnOneServer(ApplicationTransaction.java:301)

at com.sap.engine.services.deploy.server.application.ParallelAdapter.makeAllPhasesImpl(ParallelAdapter.java:327)

at com.sap.engine.services.deploy.server.application.ParallelAdapter.runInTheSameThread(ParallelAdapter.java:111)

at com.sap.engine.services.deploy.server.application.ParallelAdapter.makeAllPhasesAndWait(ParallelAdapter.java:230)

at com.sap.engine.services.deploy.server.DeployServiceImpl.startApplicationAndWait(DeployServiceImpl.java:4680)

at com.sap.engine.services.deploy.server.DeployServiceImpl.startApplicationAndWait(DeployServiceImpl.java:4585)

at com.sap.engine.services.deploy.server.DeployServiceImpl.startApplicationAndWait(DeployServiceImpl.java:4558)

at com.sap.engine.services.deploy.server.DeployServiceImplp4_Skel.dispatch(DeployServiceImplp4_Skel.java:1163)

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

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

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

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

at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)

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

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

Caused by: javax.naming.NoInitialContextException: Cannot instantiate class: [Root exception is java.lang.ClassNotFoundException: ]

at com.sap.engine.system.naming.provider.ResolverManager.findInitialContextFactory(ResolverManager.java:489)

at com.sap.engine.system.naming.provider.DefaultInitialContext._getDefaultInitCtxt(DefaultInitialContext.java:60)

at com.sap.engine.system.naming.provider.DefaultInitialContext.<init>(DefaultInitialContext.java:46)

at com.sap.engine.system.naming.provider.DefaultInitialContextFactory.getInitialContext(DefaultInitialContextFactory.java:41)

at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662)

at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)

at javax.naming.InitialContext.init(InitialContext.java:219)

at javax.naming.InitialContext.<init>(InitialContext.java:195)

at com.sap.engine.services.jmsconnector.deploy.ContainerImpl.loadFactory(ContainerImpl.java:1899)

... 20 more

Caused by: java.lang.ClassNotFoundException:

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java:219)

at com.sap.engine.system.naming.provider.ResolverManager.findInitialContextFactory(ResolverManager.java:472)

... 28 more

(message ID: com.sap.sdm.serverext.servertype.inqmy.extern.EngineApplOnlineDeployerImpl.performAction(DeploymentActionTypes).REMEXC)

Please provide some help.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

seems you enterprise bean is not correct. It looks like that it can't create the InitialContext.

Maybe the JNDI name is not correct.

regards

daniel

former_member187702
Active Participant
0 Kudos

Hi

I am trying the WAS MDB example(with default settings).

I am getting the following error

Error occurred: com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException: Path to object does not exist at java:comp, the whole lookup name is java:comp/env/MessageSender.

and for the receive.jsp the following error:

Error ocurred: com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException: Path to object does not exist at java:comp, the whole lookup name is java:comp/env/ConfirmationQueueFactory.

Former Member
0 Kudos

Have you deployed the example?

BTW are you using Sneak-Preview?

former_member187702
Active Participant
0 Kudos

I am not directly deploying the example. But copied the code and made a new application of it. N what is Sneak_preview??

Former Member
0 Kudos

sneak preview is what you call as trial versions in case of other softwares. if you are using the sneak-preview then on the home page of the server you will see J2EE engine examples link.you can deploy it from there itself and run too..

former_member187702
Active Participant
0 Kudos

ye the examples are running fine. Bt when I am creating a new application fo it by copying the code I am getting the errors.

Although I have not made any modification to the code.

Can u please check the code of given MDB example and see if thers any change to be made to it.

Former Member
0 Kudos

Pls elaborate what you are copying and how are you trying to run things..

former_member187702
Active Participant
0 Kudos

I have copied the code of the MDB example , made new jsp's,ejb and mdb.

I am not getting errors while deploying bt while running I am getting the error.

I have copied the ejb-jar.xml and ejb-j2ee-engine .xml also.

Error occurred: com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException: Path to object does not exist at java:comp, the whole lookup name is java:comp/env/MessageSender.

Why is it not recoginising MessageSender(reference name for Sender Bean)

Former Member
0 Kudos

what I understand from all this is,

you have ejb module which has a stateless session bean which sends message to queue / topic and the jndi name for this stateless session bean is

<b>MessageSender</b>.

you also have an ejb module inside which you have an jsp which is looking up this ejb with name = <b>java:comp/env/MessageSender</b>

if so, then make sure you have set reference to the ejb inside your web.xml.

also if your session bean has local interfaces then you can look it up as <b>localejbs/MessageSender</b> and no entries in the web.xml are required.

hope this helps..

former_member187702
Active Participant
0 Kudos

Ye u r right Amol

The actual bean is SenderBean and its jndi reference(jndi-name) is MessageSender.

But I ahve already added a reference in web-xml ejb/SenderBean but it does not work. In fact adding ejb/MessageSender also does work out.

former_member187702
Active Participant
0 Kudos

I have solved the problem of java:comp/env/MessageSender by giving reference in the web-xml. But 1 error still persists in Receive.jsp:-

com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException: Path to object does not exist at java:comp, the whole lookup name is java:comp/env/ConfirmationQueueFactory.

Do I have to give reference to ConfirmationQueueFactory also in the web-xml. If yes , how?

Former Member
0 Kudos

Hi Shilpa,

Like it has been already noticed you are having problems with the access from the jsp to the ejb. You might want to compare the web.xml from the sample code, which is working, to your modified application.

Btw, perhaps you could try first to play with a more simple application (the calculator for example) that has one jsp and ejb and later move to the mdb.

Best Regards

Peter

former_member187702
Active Participant
0 Kudos

Actually the code for web.xml and web-j2ee-engine is not given in the sample application.And I ahve tried the calculator application-it works fine.

former_member187702
Active Participant
0 Kudos

The problem is solved. Changes had to be made in web.xml.

Thanks a lot

Vlado
Advisor
Advisor
0 Kudos

> also if your session bean has local interfaces then

> you can look it up as <b>localejbs/MessageSender</b>

> and no entries in the web.xml are required.

This is not quite correct! The recommended way for J2EE / Java EE components (what servelts and JSPs are) is to use the standard ejb-ref mechanism and lookup from the <b>java:comp/env/</b> environment naming context (ENC). The root lookup with (localejbs/)<jndi-name> should be used only when the standard way is not possible.

For more information please refer to <a href="http://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/0736159e-0301-0010-9ea4-c63d83d0797b">this</a> guide.

Former Member
0 Kudos

Vladimir,

In case of XI , when we configure the adapter modules for an adapter, we have to use <i>localejbs/modulejndiname</i>

and even SAP standard adapter module is configured into the module chain by default as

<i>localejbs/CallSapAdapter</i>. In this case because the client code which is going to access the EJB doesnt have a DD , is it required to make use of (localejbs/)<jndi-name>...is that what you mean by <b>only when the standard way is not possible.</b>

-- Amol

Vlado
Advisor
Advisor
0 Kudos

Exactly!

Former Member
0 Kudos

well..in that case I apologize for giving <b>slightly incorrect</b> information to Shilpa :)...

Vladimir

you can deduct those 10 points awarded for that answer:)

Vlado
Advisor
Advisor
0 Kudos

No apologies necessary, I guess

The important thing is that the problem is solved and also it is hopefully clear now when to lookup with java:comp/env/ and when - from the naming root.

-Vladimir

Answers (1)

Answers (1)

Vlado
Advisor
Advisor
0 Kudos

Hi Shilpa,

You have to specify the initial context factory in the jms-factories.xml. It should be:

<initial-context-factory>com.sap.engine.services.jndi.InitialContextFactoryImpl</initial-context-factory>

Please check these links:

http://help.sap.com/saphelp_nw04/helpdata/en/d1/259a53c73ab043a413e096e0523d54/frameset.htm

http://help.sap.com/saphelp_nw04/helpdata/en/e8/48ef3d5e10af5ee10000000a114084/frameset.htm

HTH!

-Vladimir