EJB and JMS (newbie)
I'm looking to deploy what is essentially a message-broking service. A bean that
will invoke a helper class which will dequeue messages.
Basically I want to set up our consumer to invoke a handler, which will invoke
a bean that provides message-broking services as described above.
The handler that invokes the bean is to be called from the WLSConsumer. The problem
is that I'm now getting a java.io.NotSerializableException on the WLS consumer.
This is probably a really obvious question, but how can I get around this?
My structure is:
Consumer >> Handler >> Bean >> Helper
The consumer is to call the handler, which uses the bean's helper class to pull
a message off the queue, and do some intermediate processing on it.
We're using an older version of J2EE, on Weblogic 5.1.
Which classes do I need to implement Serializable?
Thanks in anticipation.
Hi Seoh!
Both stateles and JMS can participate in a single transaction, but because two
resource managers are being used they must use the 2PC protocol, In oreder to
use the 2PC u need to get the license from the bea and after that u need to enable
the 2PC in WLS through admin conbsole. But remember that transactions in stateless
beans cant span across multiple method incocations
Thanx,
Aravind
Similar Messages
-
Problem with EJB and JMS - Failed to obtain/create connection
hello ejb and jms programmers,
My problem is my topic MDB keep on retrieving the same message when there is a database connection failure. Maybe somebody could help me how to prevent to retrieve the same data?
Given:
- I purposedly turn off the pointbase database because im testing my error handling.
- Im using SJSAS 8 as my application server.
- My message Driven Bean of topic type.
- Im using CMP for my entity bean
Here is the scenario of whats happening - step by step:
1. A separate application publishes a message to JMS queue server
2. My MDB retrieves this message and do some processing then inserts a record (transaction history) in my database
3. But my db is turned off or down
4. My MDB sends a successful processing reply to the JMS queue server
5. Then i noticed that my server.log keeps on growing so when i opened it, the record was not inserted and printed the stacktrace below "RAR5117 : Failed to obtain/create connection. Reason : javax.transaction.SystemException" (complete stacktrace below)
6. I understand the cause of the stacktrace is because the DB is turned off. But what i dont understand is that my MDB keeps on reading the same message. Since my MDB is of topic type, isnt a topic MDB supposedly reads a message only once???
So my questions are:
1. how do i handle insert database error?
2. how can i stop my MDB from processing the same message?
3. any better suggestions?
Thank you in advance :)
leigh
*** more complete stack trace ***
[#|2005-01-09T15:35:57.097+0800|WARNING|sun-appserver-pe8.0.0_01|javax.enterprise.system.core.transaction|_ThreadID=17;|JTS5041: The resource manager is doing work outside a global transaction
javax.transaction.xa.XAException
at com.pointbase.xa.xaException.getXAException(Unknown Source)
at com.pointbase.xa.xaConnectionResource.start(Unknown Source)
at com.sun.gjc.spi.XAResourceImpl.start(XAResourceImpl.java:162)
[#|2005-01-09T15:35:57.167+0800|SEVERE|sun-appserver-pe8.0.0_01|javax.enterprise.resource.resourceadapter|_ThreadID=17;|RAR5027:Unexpected exception in resource pooling
javax.transaction.SystemException
at com.sun.jts.jta.TransactionImpl.enlistResource(TransactionImpl.java:185)
at com.sun.enterprise.distributedtx.J2EETransaction.enlistResource(J2EETransaction.java:360)
at com.sun.enterprise.distributedtx.J2EETransactionManagerImpl.enlistResource(J2EETransactionManagerImpl.java:303)
at com.sun.enterprise.distributedtx.J2EETransactionManagerOpt.enlistResource(J2EETransactionManagerOpt.java:115)
[#|2005-01-09T15:35:57.177+0800|WARNING|sun-appserver-pe8.0.0_01|javax.enterprise.resource.resourceadapter|_ThreadID=17;|RAR5117 : Failed to obtain/create connection. Reason : javax.transaction.SystemException|#]
[#|2005-01-09T15:35:57.227+0800|WARNING|sun-appserver-pe8.0.0_01|javax.enterprise.resource.resourceadapter|_ThreadID=17;|RAR5114 : Error allocating connection : [Error in allocating a connection. Cause: javax.transaction.SystemException]|#]
[#|2005-01-09T15:35:57.237+0800|SEVERE|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.ejb|_ThreadID=17;|EJB5071: Some remote or transactional roll back exception occurred
com.sun.jdo.api.persistence.support.JDODataStoreException: JDO77006: SQL exception: state = null, error code = 0.
NestedException: java.sql.SQLException: Error in allocating a connection. Cause: javax.transaction.SystemException
FailedObjectArray: [[email protected]5ac]
at com.sun.jdo.spi.persistence.support.sqlstore.impl.TransactionImpl.getConnectionInternal(TransactionImpl.java:1444)
at com.sun.jdo.spi.persistence.support.sqlstore.impl.TransactionImpl.getConnection(TransactionImpl.java:1339)Hi annie,
Wherever you are handling database transactions,
you'd not be able to create a Connection if database
is closed (I think you mentioned turning off the
database) then at this condition, you should
certainly throw a System level exception and stop all
processing with some meaningful flow to indicate a
failure (like display message on UI). Even
network problems are handled by exceptions... so I
don't see a reason why you didn't wrap it in the
first place.
Anyway, try handling specific exceptions rather than
the general Exception... this will give you a better
idea of what to do in case of an exception.Yes i know this. I am practicing this in my non-j2ee server applications. But the j2ee app im making, i just pass the db url in the descriptor and the app server automatically creates the connection for my app. So where would i put exception handling?
2. how can i stop my MDB from processing the same
message?Guaranteed delivery is not supposed to stop
processing. It will continue to process the message
after certain intervals till the message is
delivered. You shouldn't deliver it at all, if you
are able to detect that the database is off
The problem here is that my MDB automatically retrieves the message from the JMS queue server. Im not the one retrieving the messages manually.
My assumed behavior of topic MDB is once the a certain MDB retrieves a message it will not retrieve the same message anymore.
thank you in advance.
leigh -
EJB and JMs cannot be resolved
hello,
I was running an example of message bean driven and it worked.
I am on Windows XP, j2sdk 1.4.1_02, and jonas 3.1 and eclipse 2.1. all my classpath seem to be set correctly.
I use a ant script to compile it but when I run on the concole this is the same error.
But today nothing works when I am compiling the code I 've got the following error:
[javac] ----------
[javac] 1. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbBean.java (at line 34)
[javac] import javax.ejb.MessageDrivenBean;
[javac] ^^^^^^^^^^^^^^^^^^^^^^^^^^^
[javac] The import javax.ejb cannot be resolved
[javac] ----------
[javac] 2. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbBean.java (at line 35)
[javac] import javax.ejb.MessageDrivenContext;
[javac] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[javac] The import javax.ejb cannot be resolved
[javac] ----------
[javac] 3. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbBean.java (at line 36)
[javac] import javax.jms.JMSException;
[javac] ^^^^^^^^^^^^^^^^^^^^^^
[javac] The import javax.jms cannot be resolved
[javac] ----------
[javac] 4. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbBean.java (at line 37)
[javac] import javax.jms.Message;
[javac] ^^^^^^^^^^^^^^^^^
[javac] The import javax.jms cannot be resolved
[javac] ----------
[javac] 5. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbBean.java (at line 38)
[javac] import javax.jms.MessageListener;
[javac] ^^^^^^^^^^^^^^^^^^^^^^^^^
[javac] The import javax.jms cannot be resolved
[javac] ----------
[javac] 6. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbBean.java (at line 39)
[javac] import javax.jms.TextMessage;
[javac] ^^^^^^^^^^^^^^^^^^^^^
[javac] The import javax.jms cannot be resolved
[javac] ----------
[javac] 7. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbBean.java (at line 49)
[javac] public class MdbBean implements MessageDrivenBean, MessageListener {
[javac] ^^^^^^^^^^^^^^^^^
[javac] MessageDrivenBean cannot be resolved or is not a valid superinterface
[javac] ----------
[javac] 8. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbBean.java (at line 49)
[javac] public class MdbBean implements MessageDrivenBean, MessageListener {
[javac] ^^^^^^^^^^^^^^^
[javac] MessageListener cannot be resolved or is not a valid superinterface
[javac] ----------
[javac] 9. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbBean.java (at line 51)
[javac] private transient MessageDrivenContext mdbContext;
[javac] ^^^^^^^^^^^^^^^^^^^^
[javac] MessageDrivenContext cannot be resolved (or is not a valid type) for the field MdbBean.mdbContext
[javac] ----------
[javac] 10. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbBean.java (at line 78)
[javac] public void setMessageDrivenContext(MessageDrivenContext ctx) {
[javac] ^^^^^^^^^^^^^^^^^^^^
[javac] MessageDrivenContext cannot be resolved (or is not a valid type) for the argument ctx of the method setMessageDrivenContext
[javac] ----------
[javac] 11. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbBean.java (at line 80)
[javac] mdbContext = ctx;
[javac] ^^^^^^^^^^
[javac] mdbContext cannot be resolved
[javac] ----------
[javac] 12. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbBean.java (at line 107)
[javac] public void onMessage(Message message) {
[javac] ^^^^^^^
[javac] Message cannot be resolved (or is not a valid type) for the argument message of the method onMessage
[javac] ----------
[javac] 13. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbBean.java (at line 110)
[javac] TextMessage mess = (TextMessage)message;
[javac] ^^^^^^^^^^^
[javac] TextMessage cannot be resolved or is not a type
[javac] ----------
[javac] 14. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbBean.java (at line 110)
[javac] TextMessage mess = (TextMessage)message;
[javac] ^^^^^^^^^^^
[javac] TextMessage cannot be resolved or is not a type
[javac] ----------
[javac] 15. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbBean.java (at line 112)
[javac] }catch(JMSException ex){
[javac] ^^^^^^^^^^^^
[javac] JMSException cannot be resolved or is not a type
[javac] ----------
[javac] ----------
[javac] 16. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbClient.java (at line 34)
[javac] import javax.jms.Session;
[javac] ^^^^^^^^^^^^^^^^^
[javac] The import javax.jms cannot be resolved
[javac] ----------
[javac] 17. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbClient.java (at line 35)
[javac] import javax.jms.TextMessage;
[javac] ^^^^^^^^^^^^^^^^^^^^^
[javac] The import javax.jms cannot be resolved
[javac] ----------
[javac] 18. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbClient.java (at line 36)
[javac] import javax.jms.Topic;
[javac] ^^^^^^^^^^^^^^^
[javac] The import javax.jms cannot be resolved
[javac] ----------
[javac] 19. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbClient.java (at line 37)
[javac] import javax.jms.TopicConnection;
[javac] ^^^^^^^^^^^^^^^^^^^^^^^^^
[javac] The import javax.jms cannot be resolved
[javac] ----------
[javac] 20. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbClient.java (at line 38)
[javac] import javax.jms.TopicConnectionFactory;
[javac] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[javac] The import javax.jms cannot be resolved
[javac] ----------
[javac] 21. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbClient.java (at line 39)
[javac] import javax.jms.TopicPublisher;
[javac] ^^^^^^^^^^^^^^^^^^^^^^^^
[javac] The import javax.jms cannot be resolved
[javac] ----------
[javac] 22. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbClient.java (at line 40)
[javac] import javax.jms.TopicSession;
[javac] ^^^^^^^^^^^^^^^^^^^^^^
[javac] The import javax.jms cannot be resolved
[javac] ----------
[javac] 23. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbClient.java (at line 53)
[javac] static TopicConnectionFactory tcf = null;
[javac] ^^^^^^^^^^^^^^^^^^^^^^
[javac] TopicConnectionFactory cannot be resolved (or is not a valid type) for the field MdbClient.tcf
[javac] ----------
[javac] 24. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbClient.java (at line 54)
[javac] static TopicPublisher tp = null;
[javac] ^^^^^^^^^^^^^^
[javac] TopicPublisher cannot be resolved (or is not a valid type) for the field MdbClient.tp
[javac] ----------
[javac] 25. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbClient.java (at line 55)
[javac] static Topic topic = null;
[javac] ^^^^^
[javac] Topic cannot be resolved (or is not a valid type) for the field MdbClient.topic
[javac] ----------
[javac] 26. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbClient.java (at line 66)
[javac] tcf = (TopicConnectionFactory) ictx.lookup(conFactName );
[javac] ^^^
[javac] tcf cannot be resolved
[javac] ----------
[javac] 27. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbClient.java (at line 66)
[javac] tcf = (TopicConnectionFactory) ictx.lookup(conFactName );
[javac] ^^^^^^^^^^^^^^^^^^^^^^
[javac] TopicConnectionFactory cannot be resolved or is not a type
[javac] ----------
[javac] 28. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbClient.java (at line 67)
[javac] System.out.println("JMS client: tcf = " + tcf.toString());
[javac] ^^^
[javac] tcf cannot be resolved
[javac] ----------
[javac] 29. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbClient.java (at line 69)
[javac] topic = (Topic) ictx.lookup(topicName);
[javac] ^^^^^
[javac] topic cannot be resolved
[javac] ----------
[javac] 30. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbClient.java (at line 69)
[javac] topic = (Topic) ictx.lookup(topicName);
[javac] ^^^^^
[javac] Topic cannot be resolved or is not a type
[javac] ----------
[javac] 31. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbClient.java (at line 75)
[javac] TopicConnection tc = null;
[javac] ^^^^^^^^^^^^^^^
[javac] TopicConnection cannot be resolved or is not a type
[javac] ----------
[javac] 32. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbClient.java (at line 76)
[javac] TopicSession session = null;
[javac] ^^^^^^^^^^^^
[javac] TopicSession cannot be resolved or is not a type
[javac] ----------
[javac] 33. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbClient.java (at line 78)
[javac] tc = tcf.createTopicConnection();
[javac] ^^^
[javac] tcf cannot be resolved
[javac] ----------
[javac] 34. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbClient.java (at line 80)
[javac] session = tc.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
[javac] ^^^^^^^^^^^^^^^^^^^^^^^^
[javac] Session cannot be resolved
[javac] ----------
[javac] 35. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbClient.java (at line 81)
[javac] tp = session.createPublisher(topic);
[javac] ^^
[javac] tp cannot be resolved
[javac] ----------
[javac] 36. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbClient.java (at line 81)
[javac] tp = session.createPublisher(topic);
[javac] ^^^^^
[javac] topic cannot be resolved
[javac] ----------
[javac] 37. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbClient.java (at line 90)
[javac] TextMessage message;
[javac] ^^^^^^^^^^^
[javac] TextMessage cannot be resolved or is not a type
[javac] ----------
[javac] 38. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbClient.java (at line 94)
[javac] tp.publish(message);
[javac] ^^
[javac] tp cannot be resolved
[javac] ----------
[javac] 38 problems (38 errors)
[javac] BUILD FAILED: file:C:/Java/Workspace/MDBTest/com/iratensolutions/test/build.xml:107: Compile failed; see the compiler error output for details.
Total time: 610 milliseconds
Thank you for your helpHi,
You need to place ejb.jar and jms.jar present in
<jonAs-home>\lib\common\j2ee directory in the classpath.
-Amol -
Hi,
I want to deploy a bean to remove messages from a JMS Queue and plug them into a table - basically a straight broking service.
How can I pass through a handle to a queue receiver/queue sender object? At present I keep getting a notserializable exception.
Can I do this, or will it violate J2EE specification in some way (I have a horrible feeling that it will instantiate threads for the JMS receiver).
Does anyone have any information on this?
Thanks very much.EJB 2.0 has a class specifically for this: the MessageDrivenBean. Most current appservers support this Class.
-
Authentication problem w MDB on WL8.1 and JMS Queue on WL6.1
Hi,
I'm having problems with a MessageDrivenBean that is deployed on a Weblogic 8.1
server. It listens to a JMS Queue on a Weblogic 6.1 server.
I'm getting the following error message upon deployment:
[java.lang.SecurityException: Authentication for user system denied in realm wl_realm
I've made sure that both servers are installed with the user "system" and a password
of "password".
This worked fine for two WL6.1 servers.
Here's my ejb-jar.xml:
<!DOCTYPE ejb-jar PUBLIC
'-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN'
'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>
<ejb-jar>
<enterprise-beans>
<message-driven>
<ejb-name>WebResponseJMSBean</ejb-name>
<ejb-class>com.ditech.webresponse.jms.WebResponseJMSBean</ejb-class>
<transaction-type>Container</transaction-type>
<message-driven-destination>
<destination-type>javax.jms.Queue</destination-type>
</message-driven-destination>
</message-driven>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<description>Transaction attributes for 'WebResponseJMSBean' methods</description>
<method>
<ejb-name>WebResponseJMSBean</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>NotSupported</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
Here's my weblogic-ejb-jar.xml:
<?xml version="1.0"?>
<!DOCTYPE weblogic-ejb-jar PUBLIC
'-//BEA Systems, Inc.//DTD WebLogic 6.0.0 EJB//EN'
'http://www.bea.com/servers/wls600/dtd/weblogic-ejb-jar.dtd'>
<weblogic-ejb-jar>
<weblogic-enterprise-bean>
<ejb-name>WebResponseJMSBean</ejb-name>
<message-driven-descriptor>
<destination-jndi-name>com.ditech.jms.CowResponseQueue</destination-jndi-name>
<provider-url>t3://localhost:7003</provider-url>
<connection-factory-jndi-name>com.ptp.jms.AppOnlineConnectionFactory</connection-factory-jndi-name>
</message-driven-descriptor>
<jndi-name>ejb/WebResponseJMSBean</jndi-name>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>
Can anyone give me any suggestions?
Thanks in advance,
-Ben
We are facing a similar issue, between MDB's and JMS Queues on 2 separated WebLogic
8.1 domains. What I will test next week are:
1. In the domain where my MDB's are deployed, configure Foreign JMS Servers/Connection
Factories/Queues, for which passwords can be specified (not possible in weblogic-ejb-jar.xml)
2. If No.1 does not work, I will add CredentialGenerated="false" in <SecurityConfiguration>
in config.xml in both domains
3. If No. 2 still does not work, I will specify run-as principal and security-role
in my MDB DD files, and specify CredentialMapping via the WebLogic admin console.
Maybe you can try the same?
Eric Ma
"B Liu" <[email protected]> wrote:
>
>Hi,
>
>I'm having problems with a MessageDrivenBean that is deployed on a Weblogic
>8.1
>server. It listens to a JMS Queue on a Weblogic 6.1 server.
>
>I'm getting the following error message upon deployment:
>
>[java.lang.SecurityException: Authentication for user system denied in
>realm wl_realm
>
>I've made sure that both servers are installed with the user "system"
>and a password
>of "password".
>
>This worked fine for two WL6.1 servers.
>
>Here's my ejb-jar.xml:
>
><!DOCTYPE ejb-jar PUBLIC
>
>'-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN'
>
>'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>
>
>
><ejb-jar>
>
> <enterprise-beans>
>
> <message-driven>
>
> <ejb-name>WebResponseJMSBean</ejb-name>
> <ejb-class>com.ditech.webresponse.jms.WebResponseJMSBean</ejb-class>
> <transaction-type>Container</transaction-type>
> <message-driven-destination>
> <destination-type>javax.jms.Queue</destination-type>
> </message-driven-destination>
>
> </message-driven>
>
> </enterprise-beans>
>
> <assembly-descriptor>
>
> <container-transaction>
>
> <description>Transaction attributes for 'WebResponseJMSBean'
>methods</description>
> <method>
> <ejb-name>WebResponseJMSBean</ejb-name>
> <method-name>*</method-name>
> </method>
> <trans-attribute>NotSupported</trans-attribute>
>
> </container-transaction>
>
> </assembly-descriptor>
>
></ejb-jar>
>
>Here's my weblogic-ejb-jar.xml:
>
><?xml version="1.0"?>
>
>
>
><!DOCTYPE weblogic-ejb-jar PUBLIC
>
>'-//BEA Systems, Inc.//DTD WebLogic 6.0.0 EJB//EN'
>
>'http://www.bea.com/servers/wls600/dtd/weblogic-ejb-jar.dtd'>
>
>
><weblogic-ejb-jar>
>
> <weblogic-enterprise-bean>
>
> <ejb-name>WebResponseJMSBean</ejb-name>
>
> <message-driven-descriptor>
>
> <destination-jndi-name>com.ditech.jms.CowResponseQueue</destination-jndi-name>
> <provider-url>t3://localhost:7003</provider-url>
> <connection-factory-jndi-name>com.ptp.jms.AppOnlineConnectionFactory</connection-factory-jndi-name>
> </message-driven-descriptor>
>
> <jndi-name>ejb/WebResponseJMSBean</jndi-name>
>
> </weblogic-enterprise-bean>
>
></weblogic-ejb-jar>
>
>
>Can anyone give me any suggestions?
>
>Thanks in advance,
>-Ben
>
-
MDB and JMS on different servers
Hi,
My MDB is deployed on a different domain from the JMS server. Both are on weblogic.
While deploying weblogic, I m getting an error: Unable to create a connection.
Can anyone give pointers?
I have ensured the following:
1. The JMS server starts before the MDB server
2. The following data is mentioned in weblogic-ejb-jar.xml:
jndi name of the remote queue
provider url--- t3://hostName:port
jndi name of the remote connection factory
is there anyting else that i m missing ?
thanx and regards
Shivraman GiriHi,
Thanx for responding.
I will keep in mind these points when I use a foreign JMS provider. T
Right now I m getting problem when the JMS provider is remote but native ie. MDB and JMS are both on Weblogic. This obviates the need to mention Initial Context. Only the provider URL is to be specified.
Can you suggest a reason as to why i my EJB container (first weblogic ) is unable to connect to JMS provider (another weblogic)
regards
S.G -
Hello, i have a problem with an Applet. I want to connect to the JMS on a the J2EE server that is packaged with the jsdkee(SunOne?).
I use the following code
env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.cosnaming.CNCtxFactory");
env.put(Context.PROVIDER_URL, "iiop://localhost:3700");
try
ic = new InitialContext(env);
jmsFactory = (TopicConnectionFactory)ic.lookup("jms/PS/playerTopicFactory");
catch(NamingException ne) {System.err.println("NamingException in LocalAccount.initMyConnectionFactory(): "+ne);}I get the following error
NamingException in LocalAccount.initMyConnectionFactory(): javax.naming.NameNotFoundException [Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]Does that mean that he can't access the Class? But i dont want to put rt.jar (including CNCtxFactory) into the applet! Maybe I misunderstand something...
Please help me I can't figure this out8.1 provides a "thin client" jar. See the "new JMS features" in the
8.1 release notes.
For previous WL versions, check out the
"Small Footprint Client Options for BEA WebLogic Server" white-paper
available on dev2dev.bea.com.
Note that if you choose not to use JMS, you can use the JDK's
built-in IIOP client, where 0 (zero, nada, no) WebLogic classes
are required in the client. (rmi-iiop newsgroup for details).
Tom, BEA
yag wrote:
> I am a newbie in applet and jms,I think it's possible to use the applet as the
> jms receiver client,however,I have the following quesitons need your helps:
> 1.need i configure a webapplication including the applet?which jars I need to
> package(the whole weblogic.jar) ?and how can I deploy it?
> 2.how can I specify the jndi parameters the applet need to use,such as the "weblogic.jndi.WLInitialContextFactory"
> and so on
> where and how?
>
> thanks ahead
-
if i use JCOM to communicate Microsoft Client and JMS server,can i code the client
just like in the java,get connectionFactory,create connection,create session,create
sub,implement onMessage method,set Listener,then wait coming message
just use class reference(idl) to instead the true class,is it right?
jerry8006 wrote:
> if i use JCOM to communicate Microsoft Client and JMS server,can i code the client
> just like in the java,get connectionFactory,create connection,create session,create
> sub,implement onMessage method,set Listener,then wait coming message
>
> just use class reference(idl) to instead the true class,is it right?
I think so, but I'm not sure how JCOM would work async - try the jcom
newsgroup. Note that coding it this way would mean that every call
would end up being a remote call, including things like
"textMessage.getText()". It would be simpler and better peforming to
just to use WebLogic JMS C client or the ActiveJMS generic JMS wrapper.
If you plan to use JCOM I would seriously consider using simple session
beans as wrappers that make a the JMS calls on the server side (a
"proxy" pattern). For example, the ejb proxy "send(destName, text)"
call would create the jms connection-factory/connection/session/sender
if they don't already exist, and then call sender.send().
Tom, BEA
-
I tried using JCOM example given in weblogic documentation. In the example an excel sheet macro tries to connect to the weblogic server and looks up an object bound on the JNDI tree.
but I am getting following error : "An error occured while binding EJB objects." Could anyone please throw some light on whats happening and how can I correct this error.
Thanks in advance,
Tarunjerry8006 wrote:
> if i use JCOM to communicate Microsoft Client and JMS server,can i code the client
> just like in the java,get connectionFactory,create connection,create session,create
> sub,implement onMessage method,set Listener,then wait coming message
>
> just use class reference(idl) to instead the true class,is it right?
I think so, but I'm not sure how JCOM would work async - try the jcom
newsgroup. Note that coding it this way would mean that every call
would end up being a remote call, including things like
"textMessage.getText()". It would be simpler and better peforming to
just to use WebLogic JMS C client or the ActiveJMS generic JMS wrapper.
If you plan to use JCOM I would seriously consider using simple session
beans as wrappers that make a the JMS calls on the server side (a
"proxy" pattern). For example, the ejb proxy "send(destName, text)"
call would create the jms connection-factory/connection/session/sender
if they don't already exist, and then call sender.send().
Tom, BEA
-
Using socket and JMS protocol in the same logic for OSB
Hi frnds,
In my organization...the only communication protocol used is "socket" protocol. However, I want to use JMS protocol to process incoming messages. Can somebody help me figuring out how to go about it.
Using some nice OSB blogs, I am able to create the JMS connection factory and JMS queues in weblogic. And that works fine when I select the communication protocol as JMS while creating the BS and PS.
What should be my message flow when the communication protocol used is "socket" for both BS and PS.
salilHi,
Make the BS as JMS and the PS as socket, in the PS's flow do a route for the BS... Then if an external call is made to the PS via socket, it will send a messages to a JMS queue...
Hope this helps...
Cheers,
Vlad -
Can EJB and BC exist at the same time in one project?
having to use ADF's BC and EJB to access data in both way due to the special requirements, but I am always getting the deployment failure.
can Ejbs and BC components exist at the same time in one project?thanks for your reply.
I considered to separate the BC and EJB as the separate project. I just use the EJB component to implement the dynamic tree menu, whether a little make a mountain out of a molehill if you as a separate project. -
Compare creation of Datasources and JMS Queues : SAP vs (Weblogic/Websphere
I am used to creating JDBC Datasources and JMS Queues on Weblogic/Websphere thru their Admin applications.
Can someone compare/contrast that process to that on SAP's netweaver ( either using NWA or Visual Administrator).
ThanksHi Parag,
For the process of creating JDBC datasources and JMS resources @ SAP NetWeaver you can refer to the documents here on SDN and help.sap.com, and compare that process for yourself, thus not being influenced by others' biased or unbiased opinions.
For NetWeaver 04 and 04s these would be:
<a href="http://help.sap.com/saphelp_nw04/helpdata/en/b0/6e62f30cbe9e44977c78dbdc7a6b27/frameset.htm">JDBC Connector Service</a>
<a href="http://help.sap.com/saphelp_nw04/helpdata/en/22/cf4e71c46cdb4da31153be96c5389f/frameset.htm">JMS Connector Service</a>
For the <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/javaee5">Java EE 5 Edition</a>:
<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/7bb9751d-0e01-0010-febd-c3adce2c408c">Working with Database Tables, DataSources and JMS Resources</a>
<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/806e75a0-0e01-0010-2587-fc518de8ac1a">Administration Guide</a> -> section "Application Resources Management" (pages 89-104)
Hope that helps!
Your feedback/findings are very welcome!
-Vladimir -
What is the Difference between AQ adpater and JMS adapter??
What is the Difference between AQ adpater and JMS adapter in BPEL11g??
In what scenarios we go for AQ and for what scenarios we go for JMS adapter???Go for AQ when using Oracle Advanced Queueing (the database stuff).
Use JMS when using JMS (in memory of file queues)
hth,
Peter Paul -
Content Conversion - JDBC and JMS
Can we use File Content Conversion with JDBC and JMS ?
Hi,
How To Use the Content Conversion Module in JMS Adapter - https://websmp106.sap-ag.de/~form/sapnet?_SHORTKEY=01100035870000582377&
check this for JMS content conversion:
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/f02d12a7-0201-0010-5780-8bfc7d12f891
Check the how to guide provided by prabhu and also this link on the XMl To TeXtCoversion Module,
http://help.sap.com/saphelp_nw04/helpdata/en/44/748d595dab6fb5e10000000a155369/content.htm
Ref How To Use the Content Conversion Module in JMS Adapter -
https://websmp106.sap-ag.de/~form/sapnet?_SHORTKEY=01100035870000582377&
See this weblogs which was shown with examples:
How to use SAP's WebAS J2EE's JMS Queue in Exchange Infrastructure
Sync/Async communication in JMS adapter without BPM (SP19)
Async/Sync Communication using JMS adapter without BPM (SP 19)
Exploring JMS and SAP-XI JMS Adaper
Configuring the sender JMS adapter
http://help.sap.com/saphelp_nw2004s/helpdata/en/f4/2d6189f0e27a4894ad517961762db7/content.htm
Configuring the receiver JMS adapter
http://help.sap.com/saphelp_nw2004s/helpdata/en/10/b1b4c8575a6e47954ad63438d303e4/content.htm
Check JMS Adapter section of this blog by Sravya:
Aspirant to learn SAP XI...You won the Jackpot if you read this!-Part III
Also information related to Provider-specific settings are available
http://help.sap.com/saphelp_nw2004s/helpdata/en/cd/d85a9d6fab7d4dbb7ae421f710626c/frameset.htm
Plz do refer the following threads:
JMS Content Conversion - no CR/LF
Message (Data) getting lost after JMS Content Conversion(Sender)
Message (Data) getting lost after JMS Content Conversion(Sender)
Message (Data) getting lost after JMS Content Conversion(Sender)
Regards,
Vinod. -
Configuration for JMS Adapter Sensor action and JMS Queue sensor action..!!
Hi,
Id like my BPEL process to send an XML message to JMS on Websphere,I was able to do this through a JMS adapter.But I would more like to add sensors into my process which would really do the same thing - send an XML message to JMS Q.
Now I understand that there are two ways to do this,JMS Queue and JMS Adapter - thorugh bpel sensor action.
I am able to use JMS Queue and it works fine , but adds its own xml tags to the message,Is there any way I could send only my xml payload as a message to the queue??
Also could any1 tell me what is the configuration for JMS Adapter sensor action?
Any suggestions how do I go about it??Hey Anirudh,
Thanx for the response :-)
All these hold good when I have an AQ adaptor right,But the thing is I want to send a message to a 'JMS' queue with out actually using an adapter configuration wizard and everythng..So I resolved to JMS queue Sensor action..Heres the xml snippet from the sensorAction.xml files which is generated..
<actions targetNamespace="http://xmlns.oracle.com/Test_JMS_Logging" xmlns="http://xmlns.oracle.com/bpel/sensor" xmlns:tns="http://xmlns.oracle.com/Test_JMS_Logging" xmlns:pc="http://xmlns.oracle.com/bpel/sensor">
<action name="JMS_LogEntry" publishName="" publishType="JMSQueue" enabled="true" filter="" publishTarget="jms/L_Queue">
<property name="JMSConnectionFactory">jms/L_QueueCF</property>
<sensorName>ActivitySensor_JMS</sensorName>
</action>
</actions>
This works grt and adds messages to the queue..But adds its own header info according to the sensor.xsd loacted at the Oracle_home\bpel\system\xmllib\ folder.
Right now the XML message added to the Queue is:-
<actionData xmlns="http://xmlns.oracle.com/bpel/sensor">
<header>
<sensor sensorName="ActivitySensor_JMS" classname="oracle.tip.pc.services.reports.dca.agents.BpelActivitySensorAgent" kind="activity" target="AddLEntr
y" xmlns:pc="http://xmlns.oracle.com/bpel/sensor" xmlns:ns2="http://www.ulrhome.com/2008/10/L_Entry" xmlns:tns="http://xmlns.oracle.com/Test_JMS">
<activityConfig evalTime="completion">
<variable outputDataType="string" outputNamespace="http://www.w3.org/2001/XMLSchema" target="$WriteL_Produce_Message_InputVariable/L_Entry/ns2:L_Entry/ns2:LCName"/>
</activityConfig>
</sensor>
<instanceId>950016</instanceId>
<processName>Test_JMS</processName>
<processRevision>v2009_04_15__40833</processRevision>
<domain>default</domain>
<timestamp>2009-04-15T11:21:23.596-04:00</timestamp>
<midTierInstance>app01.ulrhome.com:9700</midTierInstance>
</header>
<payload>
<activityData>
<activityType>scope</activityType>
<evalPoint>completion</evalPoint>
<durationInSeconds>0.011</durationInSeconds>
<duration>PT0.011S</duration>
</activityData>
<variableData>
<dataType>12</dataType>
<data>
<ns0:LCName xmlns:ns0="LC_Test1http://www.ulrhome.com/2008/10/L_Entry">LC_Test1</ns0:LCName>
</data>
<queryName/>
<target>$WriteL_Produce_Message_InputVariable/L_Entry/ns2:L_Entry/ns2:LCName</target>
<updaterName>AddL_Entry</updaterName>
<updaterType>scope</updaterType>
</variableData>
</payload>
</actionData>
My requirement is that I need to add a sensor to the BPEL process which posts 'Only my payload message to the JMS queue'..
What I would want the message in the Queue to be is : -
<data>
<ns0:LCName xmlns:ns0="LC_Test1http://www.ulrhome.com/2008/10/L_Entry">LC_Test1</ns0:LCName>
</data>
Also while creating a Sensor action I get another option as JMS Adaptor,I am not sure of what value to type in this wizard..Heres what I keyed in..M sure this is not right..Cos it dosnt work :-)
<action name="SensorAction_JMS" publishName="" publishType="JMSAdapter" enabled="true" filter="" publishTarget="jms/LoggingQueue">
<property name="JMSConnectionName">Log</property>
</action>
</actions>
Could any 1 tel me what values are the right values..And does JMS Adapter mean that I have to create a JMS Apator in the project and give that connection name as a Value..
I am not finding sufficiant Documentation for 'JMS Adapter' so M clueless and right now any help will be appriciated :-)
Regards,
Akshatha.
Maybe you are looking for
-
Why capital letters change in lower after copying them from a PDF document (Made by InDesign), or otherwise, why some uppercase are in fact lowercase when I look in the Text Property in any PDF Reader.
-
HT204291 we can only get the sound to transfer to the apple TV and not the picture
Using the NBC app on my iPhone and we are trying to get it to play through the TV. Not sure why only the sound will transfter.
-
Vendor consignment - an output generated periodically when it is consumed
Hi SAP Experts we have a requirement to have an output should be generated periodically in case of vendor consignment when the quantities are consumed from the consignment stock . We basically want to inform the buyer,vendor periodically of the cons
-
How to show korean fonts/characters on 5800xm?
how to show korean fonts/characters on 5800xm?
-
Issues with merging layers with layer styles
Just downloaded CS6 Photoshop off the creative cloud and the merge layer command does not work. What is happening is there is one layer with a layer style then a shape layer and when I hit Cmd E it merges the layers but the layer style will not merge