on 05-03-2005 11:10 PM
hello,
i am trying to deploy an application on SAP Web AS. I create and send a message to a topic. i have a message driven bean whose onMessage() should get executed upon getting this message. this doesnt happen though.
- I have specified the topic name and connection factory name in the ejb-j2ee-engine.xml
- i have created the topic and the connection factory on the server.
- included them in the jms-factories.xml and jms-destinations.xml in the EAR file.
I dont know if I'm missing something. can someone please help. Would really appreciate.
thanks in advance.
Hi,
In order to receive messages, the message-driven bean should be deployed and started on the J2EE Engine. So first make sure that the application with the message-driven bean has been started successfully. You can do it via the Visual Administrator or the shell command list_app (from the DEPLOY group).
You can also check the server logs in order to find any exceptions during deployment or message processing. Probably you will find some essential information there. You can find the server logs under /usr/sap/<instance_name>/JC<instance_number>/j2ee/cluster/server0/log/defaultTrace.<N>.trc files.
Hope this helps.
Vesselin.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello RD,
One way to check this is to see whether there is a JMS subscriber attached to your topic.
You can do this by executing the following commands in the server shell :
<login>
jump 0
add jms
jms list consumers
If everything is deployed and started correctly than you should see a line similar to :
ConsumerID SessionID ClientID Destination
31231231312 12 32 My_MDB_Topic
Please note that one reason for not receiving messages could be that you are using a transacted MDB with non-transacted connection factory. In that case you will receive only the first message and no more will be delivered. For more info please check :
Best Regards
Peter Peshev
Sorry, the link was to another problem. The correct one should be
And since I may again be wrong , I will describe the problem here :
if you want to use a transacted MDB for topic then please make sure that the JMS factory suports it.
The definition in jms-factories.xml should be :
<link-factory-name>
jmsfactory/default/XATopicConnectionFactory
</link-factory-name>
instead if
<link-factory-name>
jmsfactory/default/TopicConnectionFactory
</link-factory-name>
Hope that helps.
Best Regards
Peter Peshev
thanks peter,
due to some bad exception handling,i wasnt getting the proper error message.now,i kind of figured out the problem. the problem is that my MDB calls create() of another EJB. and, i get an error 'Caller not authorized'.
i tried having <security-identity> defined in my ejb-jar.xml. used <run-as> and <use-caller-identity>. it fails on both. is there any other means? please let me know.
thanks for ur help
RD
thanks vesselin,
I made sure that this role can invoke the create() method of the bean.
the ejb-jar.xml is pretty big. here is the relevant portion of it.
<session >
<description><![CDATA[stateless session bean stores and retrieves events]]></description>
<ejb-name>myBean</ejb-name>
<home>package1.myBeanHome</home>
<remote>package1.myBeanRemote</remote>
<local-home>package1.myBeanLocalHome</local-home>
<local>package1.myBeanLocal</local>
<ejb-class>package1.myBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<security-role-ref>
<role-name>admin</role-name>
<role-link>admin</role-link>
</security-role-ref>
<security-role-ref>
<role-name>dev</role-name>
<role-link>dev</role-link>
</security-role-ref>
<security-role-ref>
<role-name>user</role-name>
<role-link>user</role-link>
</security-role-ref>
<resource-ref >
<res-ref-name>datasource1</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
</session>
MDB:
<message-driven >
<description><![CDATA[Receives Events and inserts them into Event_History_Log]]></description>
<display-name>Test Message Driven Bean</display-name>
<ejb-name>TestMDBean</ejb-name>
<ejb-class>package2.TestMDBean</ejb-class>
<transaction-type>Container</transaction-type>
<message-driven-destination>
<destination-type>javax.jms.Topic</destination-type>
<subscription-durability>NonDurable</subscription-durability>
</message-driven-destination>
<security-identity>
<run-as>
<role-name>admin</role-name>
</run-as>
</security-identity>
</message-driven>
please let me know.
thanks
RD
Hi RD,
Defining security-role-ref elements for the session bean does not mean that these roles can invoke its methods. In order to assign the admin role to the session bean's methods, you should define a proper assembly-descriptor element in your ejb-jar.xml.
Here is an example:
<assembly-descriptor>
<security-role>
<description>admin role</description>
<role-name>admin</role-name>
</security-role>
<method-permission>
<description>...</description>
<role-name>admin</role-name>
<method>
<description>...</description>
<ejb-name>myBean</ejb-name>
<method-name>*</method-name>
</method>
</method-permission>
</assembly-descriptor>
In ejb-j2ee-engine.xml, you can map your admin role to a J2EE Engine server user (for example Administrator):
<security-permission>
<security-role-map>
<role-name>admin</role-name>
<user-name>Administrator</user-name>
<group-name>Administrators</group-name>
</security-role-map>
</security-permission>
... or a server role:
<security-permission>
<security-role-map>
<role-name>admin</role-name>
<server-role-name>admin</server-role-name>
</security-role-map>
</security-permission>
Hope this helps.
Best regards,
Vesselin.
thanks vesselin,
i forgot to include the assembly-descriptor from the ejb-jar.xml. i do have it and its defined correctly.
i did not have the security-permission in the ejb-j2ee-engine.xml though. I use deploy tool to deploy the application on the server and when i loaded the EAR onto deploy tool, it gave me an error.
"could not parse persistent.xml or storage.xml of ejb.jar. reason: null pointer exception"
can u please tell me where i can get the trace or what the problem is.
thanks again
- RD
Hi RD,
The usage of Deploy Tool is deprecated. You can try one of the following options:
1) Deploy the application using the DEPLOY command from the DEPLOY group in the Shell Console Administrator. For more info:
http://help.sap.com/saphelp_nw04/helpdata/en/fa/40a2ab95dc08429e60bd467df91943/frameset.htm
In brief:
telnet <host> 50008
[supply administrator user name and password]
> jump 0
> add deploy
> deploy <ear-file>
2) Deploy the application using the Deploy Service runtime controls in the Visual Administrator. For more info:
http://help.sap.com/saphelp_nw04/helpdata/en/39/83682615cd4f8197d0612529f2165f/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/53/2d343e32ff1033e10000000a114084/frameset.htm
Hope that helps,
Vladimir
PS: Don't just thank - please consider rewarding points for helpful answers!
thanks vladimir,
i tried visual administrator and here is the stack.
i have the following for <security-permission> in the ejb-j2ee-engine.xml
<security-permission>
<security-role-map>
<role-name>admin</role-name>
<user-name>Admin</user-name>
</security-role-map>
</security-permission>
Admin is the user i created in the security provider of visual administrator.
please let me know how i solve this.
thanks
-RD
com.sap.engine.deploy.exceptions.BaseIOException: Cannot parse persistent.xml or storage.xml for JAR F:\usr\sap\J2E\JC00\j2ee\admin\.\temp\deploying\deploy_temp\reader1115321554134\tap-ejb.jar.
Reason: java.lang.NullPointerException.
at com.sap.engine.deploy.ejb.descriptors.jar.ReadEjbJar.getEjbJarDescriptor(ReadEjbJar.java:130)
at com.sap.engine.deploy.ejb.descriptors.jar.ReadEjbJar.getEjbJarDescriptor(ReadEjbJar.java:150)
at com.sap.engine.deploy.tool.deployer.ExtendedEarReader.loadDescriptorFromFile(ExtendedEarReader.java:230)
at com.sap.engine.deploy.tool.deployer.ExtendedEarReader.getFullEarDescriptor(ExtendedEarReader.java:102)
at com.sap.engine.services.deploy.gui.runtime.EarLoader.loadEar(EarLoader.java:137)
at com.sap.engine.services.deploy.gui.runtime.MainDeployPanelLogical.loadEarAction(MainDeployPanelLogical.java:169)
at com.sap.engine.services.deploy.gui.runtime.EarDialog.setEar(EarDialog.java:79)
at com.sap.engine.services.deploy.gui.DeployDialogLogical.okButtonAction(DeployDialogLogical.java:294)
at com.sap.engine.services.deploy.gui.DeployDialogLogical.performEnterAction(DeployDialogLogical.java:389)
at com.sap.engine.gui.CEscapeDialog.run(CEscapeDialog.java:253)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:454)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:141)
at java.awt.Dialog$1.run(Dialog.java:540)
at java.awt.Dialog.show(Dialog.java:561)
at java.awt.Component.show(Component.java:1133)
at java.awt.Component.setVisible(Component.java:1088)
at com.sap.engine.services.deploy.gui.DeployDialogLogical.showDialog(DeployDialogLogical.java:378)
at com.sap.engine.services.deploy.gui.ApplicationsPanel.deployAction(ApplicationsPanel.java:409)
at com.sap.engine.services.deploy.gui.ApplicationsPanel.actionPerformed(ApplicationsPanel.java:351)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
at java.awt.Component.processMouseEvent(Component.java:5100)
at java.awt.Component.processEvent(Component.java:4897)
at java.awt.Container.processEvent(Container.java:1569)
at java.awt.Component.dispatchEventImpl(Component.java:3615)
at java.awt.Container.dispatchEventImpl(Container.java:1627)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
at java.awt.Container.dispatchEventImpl(Container.java:1613)
at java.awt.Window.dispatchEventImpl(Window.java:1606)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
Caused by: java.lang.NullPointerException
at com.sap.engine.deploy.ejb.descriptors.xml.InqmyEjbParser.processSecurityRoleMap(InqmyEjbParser.java:935)
at com.sap.engine.deploy.ejb.descriptors.xml.InqmyEjbParser.processSecurityPermition(InqmyEjbParser.java:917)
at com.sap.engine.deploy.ejb.descriptors.xml.InqmyEjbParser.parseXml(InqmyEjbParser.java:108)
at com.sap.engine.deploy.ejb.descriptors.jar.ReadEjbJar.getEjbJarDescriptor(ReadEjbJar.java:99)
... 44 more
thanks for the quick reply vladimir,
im sorry i dont understand. do u want me to try using the deploy console.
a brief description of my problem.
i have an MDB which tries to call the create() of another EJB. this MDB is not authorized and i want to put it in the 'admin' security role so it can access it. i added <security-identity> to MDB and <security-permission> to ejb-j2ee-engine.xml to see if it works. i got the trace (the one in my earlier post) after adding <security-permission>. i checked the spellings and iam not sure if using DEPLOY console would make any difference. Again, Iam fairly new to SAP Web AS and I would try it if u think this will help.
thanks
-RD
i did. gave me a 2 line error message.
java.rmi.RemoteException: Cannot deploy application sap.com/TAP..
Reason: Cannot parse ejb-j2ee-engine.xml.; nested exception is:
com.sap.engine.services.ejb.exceptions.deployment.EJBXMLParserException:
Cannot parse ejb-j2ee-engine.xml.
For more information see Error and Debug logs of the DeployService.
in the ejb-j2ee-engine.xml file, does the <security-permission> at the end of the file after the <enterprise-beans> ? coz thats where i have it. Iam almost certain that this is my fault in the file. any suggestions?
i validated the ejb-j2ee-engine.xml against the dtd using altova xml spy and the validation passed. i guess my spelling and structuring are correct.
are persistent.xml and storage.xml needed in the ejb.jar if we include <security-permission>. can someone please let me know.
thanks in advance
RD
Hi RD,
No, neither persistent.xml nor storage.xml are needed in this case. Please have a look in the defaultTrace.trc file under /usr/sap/<SID>/<INSTANCE>/j2ee/cluster/server<N>/log to find the reason for the "Cannot parse ejb-j2ee-engine.xml" error as stated in the message.
Hope that helps!
Vladimir
there was some useful error messages in the defaultTrace. however, i have another error now. where can i find the deploy service trace. here is the trace in the defaultTrace.trc. would very much appreciate any help.
#1.5#000347B22B660060000000330000D2780003F671F88D44C5#1115394291984#com.sap.engine.services.deploy##com.sap.engine.services.deploy######c742e090be4511d9947a000347b22b66#SAPEngine_System_Thread[impl:5]_96##0#0#Error#1#/System/Server#Plain###
Operation startApp over application sap.com/TAP finished with errors on server 7625450. For more detailed information see traces of Deploy Service.#
#1.5#000347B22B660060000000350000D2780003F671F88D480B#1115394291984#com.sap.engine.services.deploy##com.sap.engine.services.deploy######c742e090be4511d9947a000347b22b66#SAPEngine_System_Thread[impl:5]_96##0#0#Error#1#/System/Server#Plain###
Error occurred on server 7625450 during startApp sap.com/TAP : com.sap.engine.services.deploy.exceptions.ServerDeploymentException: Exception while preparing start of application sap.com/TAP.
at com.sap.engine.services.deploy.server.application.StartTransaction.prepareCommon(StartTransaction.java:380)
at com.sap.engine.services.deploy.server.application.StartTransaction.prepare(StartTransaction.java:318)
at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhasesOnOneServer(ApplicationTransaction.java:299)
at com.sap.engine.services.deploy.server.application.ParallelAdapter.makeAllPhasesImpl(ParallelAdapter.java:301)
at com.sap.engine.services.deploy.server.application.ParallelAdapter.run(ParallelAdapter.java:73)
at com.sap.engine.frame.core.thread.Task.run(Task.java:60)
at com.sap.engine.core.thread.impl5.SingleThread.execute(SingleThread.java:73)
at com.sap.engine.core.thread.impl5.SingleThread.run(SingleThread.java:145)
Caused by: java.lang.NullPointerException
at com.sap.engine.services.ejb.message.MessageContainer.initSecurityRunAs(MessageContainer.java:232)
at com.sap.engine.services.ejb.message.MessageContainer.init(MessageContainer.java:99)
at com.sap.engine.services.ejb.message.MessageContainerFP.init(MessageContainerFP.java:53)
at com.sap.engine.services.ejb.EJBAdmin.prepareLoad(EJBAdmin.java:972)
at com.sap.engine.services.ejb.EJBAdmin.prepareStart(EJBAdmin.java:2405)
at com.sap.engine.services.deploy.server.application.StartTransaction.prepareCommon(StartTransaction.java:370)
... 7 more
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.