TopicConnection.createDurableConnectionConsumer
Hi, we are using Weblogic 6.1 sp 2 under Linux and we are having problems
when trying to create durable consummers, the problem is tat, even when it
doesn't seems to be any problem when creating them they don't receive
messages sended to the topics they are subscribed. We can see the messages
getting hold onto the message queue.
Here is the code of a function we use to subscribe our consummers:
TopicConnectionFactory tconFactory;
TopicConnection tcon;
TopicSession tsession;
Topic topic;
ServerSessionPool sessionPool;
ConnectionConsumer consumer;
String connectionFactory = (String)args.get("connectionFactory");
String topicName = (String)args.get("topic");
String action = (String)args.get("action");
String name = (String)args.get("name");
String persistence = "";
String selector = "";
int maxsessions = 1; // 1 by default
int maxmessages = 1; // 1 by default
if (args.get("selector") != null)
selector = (String)args.get("selector");
if (args.get("persistence") != null)
persistence = (String)args.get("persistence");
if (args.get("maxsessions") != null)
maxsessions = Integer.parseInt((String)args.get("maxsessions"));
if (args.get("maxmessages") != null)
maxmessages = Integer.parseInt((String)args.get("maxmessages"));
if (connectionFactory == null || topicName == null)
throw new IllegalArgumentException("connectionFactory=" +
connectionFactory + ", topicName=" + topicName);
try
tconFactory = (TopicConnectionFactory) ctx.lookup(connectionFactory);
tcon = tconFactory.createTopicConnection();
tcon.setClientID(topicName + ++uqTopicID);
tsession = tcon.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
topic = (Topic) ctx.lookup(topicName);
tcon.start();
sessionPool =
sessionPoolFactory.getServerSessionPool(tcon,maxsessions,false,Session.AUTO_
ACKNOWLEDGE,name);
if (!selector.equals(""))
if (persistence.equals("Y"))
consumer = tcon.createDurableConnectionConsumer(topic, name ,
selector, sessionPool, maxmessages);
else
consumer = tcon.createConnectionConsumer(topic, selector, sessionPool,
maxmensajes);
catch (NamingException ne)
ne.printStackTrace();
catch (javax.jms.JMSException jmse)
jmse.printStackTrace();
of course this is just the code of a function we call from a loop in order
to make the subscriptions.
As you can see in this part of the code:
if (persistence.equals("Y"))
consumer = tcon.createDurableConnectionConsumer(topic, name ,
selector, sessionPool, maxmessages);
else
consumer = tcon.createConnectionConsumer(topic, selector, sessionPool,
maxmensajes);
we use a variable in order to make the subscription durable or not. The
problem is that all the subscriptions that are not durable are getting the
messages but the durable ones don't.
We don't really know in any case what the second parameter (name) on the
createDurableConnectionConsumer method should contain, we have tried with
the client ID we set to the TopicConnection a few lines above but still
doesn't work.
Are we doing something wrong?
I have readed another post in this newsgroup from Alex Lui asking a similar
question:
<quote>
Alex Lui
Wednesday, 29 May 2002 4:59
weblogic.developer.interest.jms
TopicConnection.createDurableConnectionConsumer
According to 7.0 documentation, this operation is still not supported. Is
there any plan which release will support it?
</quote>
then, Tom Barnes answers him:
<quote>
Tom Barnes
Wednesday, 29 May 2002 21:42
weblogic.developer.interest.jms
Re: TopicConnection.createDurableConnectionConsumer
Nothing planned in near term (that I know of). This is not a J2EE
requirement.
Contact BEA customer support and put in an enhancement request if this is
important to you. Meanwhile, use an MDB with a durable subscriber. For
almost all use cases, MDBs are more apable than connection consumers.
Tom
</quote>
We do really need to subscribe a "class" instead of an instance of an object
in order to process messages concurrently.
If our aproach is not feasible, what would be the right one?
Notice that we are not using MDBs as we are currently using EJB 1.1
specification. Would it be possible to use both EJB 1.0 and EJB 2.0 at the
same time by packaging them into two .jar files earch one having a different
ejb-jar.xml and weblogic-ejb-jar.xml files for each one with different EJB
versions? Will it be possible then to call EJB 1.0 beans from the MDB 2.0
subscribers?
Thanks in advance
Regards,
Ignacio G. Dupont.
Nothing planned in near term (that I know of). This is not a J2EE requirement.
Contact BEA customer support
and put in an enhancement request if this is important to you. Meanwhile, use an MDB
with a
durable subscriber. For almost all use cases, MDBs are more capable than connection
consumers.
Tom
Alex Lui wrote:
> According to 7.0 documentation, this operation is still not supported. Is there any
> plan which release will support it?
Similar Messages
-
Problem with TopicConnection.createDurableConnectionConsumer
Hi, we are using Weblogic 6.1 sp 2 under Linux and we are having problems
when trying to create durable consummers, the problem is tat, even when it
doesn't seems to be any problem when creating them they don't receive
messages sended to the topics they are subscribed. We can see the messages
getting hold onto the message queue.
Here is the code of a function we use to subscribe our consummers:
TopicConnectionFactory tconFactory;
TopicConnection tcon;
TopicSession tsession;
Topic topic;
ServerSessionPool sessionPool;
ConnectionConsumer consumer;
String connectionFactory = (String)args.get("connectionFactory");
String topicName = (String)args.get("topic");
String action = (String)args.get("action");
String name = (String)args.get("name");
String persistence = "";
String selector = "";
int maxsessions = 1; // 1 by default
int maxmessages = 1; // 1 by default
if (args.get("selector") != null)
selector = (String)args.get("selector");
if (args.get("persistence") != null)
persistence = (String)args.get("persistence");
if (args.get("maxsessions") != null)
maxsessions = Integer.parseInt((String)args.get("maxsessions"));
if (args.get("maxmessages") != null)
maxmessages = Integer.parseInt((String)args.get("maxmessages"));
if (connectionFactory == null || topicName == null)
throw new IllegalArgumentException("connectionFactory=" +
connectionFactory + ", topicName=" + topicName);
try
tconFactory = (TopicConnectionFactory) ctx.lookup(connectionFactory);
tcon = tconFactory.createTopicConnection();
tcon.setClientID(topicName + ++uqTopicID);
tsession = tcon.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
topic = (Topic) ctx.lookup(topicName);
tcon.start();
sessionPool =
sessionPoolFactory.getServerSessionPool(tcon,maxsessions,false,Session.AUTO_
ACKNOWLEDGE,name);
if (!selector.equals(""))
if (persistence.equals("Y"))
consumer = tcon.createDurableConnectionConsumer(topic, name ,
selector, sessionPool, maxmessages);
else
consumer = tcon.createConnectionConsumer(topic, selector, sessionPool,
maxmensajes);
catch (NamingException ne)
ne.printStackTrace();
catch (javax.jms.JMSException jmse)
jmse.printStackTrace();
of course this is just the code of a function we call from a loop in order
to make the subscriptions.
As you can see in this part of the code:
if (persistence.equals("Y"))
consumer = tcon.createDurableConnectionConsumer(topic, name ,
selector, sessionPool, maxmessages);
else
consumer = tcon.createConnectionConsumer(topic, selector, sessionPool,
maxmensajes);
we use a variable in order to make the subscription durable or not. The
problem is that all the subscriptions that are not durable are getting the
messages but the durable ones don't.
We don't really know in any case what the second parameter (name) on the
createDurableConnectionConsumer method should contain, we have tried with
the client ID we set to the TopicConnection a few lines above but still
doesn't work.
Are we doing something wrong?
I have readed another post in this newsgroup from Alex Lui asking a similar
question:
<quote>
Alex Lui
Wednesday, 29 May 2002 4:59
weblogic.developer.interest.jms
TopicConnection.createDurableConnectionConsumer
According to 7.0 documentation, this operation is still not supported. Is
there any plan which release will support it?
</quote>
then, Tom Barnes answers him:
<quote>
Tom Barnes
Wednesday, 29 May 2002 21:42
weblogic.developer.interest.jms
Re: TopicConnection.createDurableConnectionConsumer
Nothing planned in near term (that I know of). This is not a J2EE
requirement.
Contact BEA customer support and put in an enhancement request if this is
important to you. Meanwhile, use an MDB with a durable subscriber. For
almost all use cases, MDBs are more apable than connection consumers.
Tom
</quote>
We do really need to subscribe a "class" instead of an instance of an object
in order to process messages concurrently.
If our aproach is not feasible, what would be the right one?
Notice that we are not using MDBs as we are currently using EJB 1.1
specification. Would it be possible to use both EJB 1.0 and EJB 2.0 at the
same time by packaging them into two .jar files earch one having a different
ejb-jar.xml and weblogic-ejb-jar.xml files for each one with different EJB
versions? Will it be possible then to call EJB 1.0 beans from the MDB 2.0
subscribers?
Thanks in advance
Regards,
Ignacio G. Dupont.
You are correct, durable connection consumers are not supported.
A work around would be to use the weblogic messaging bridge (available
in SP3), to forward a standard durable subscription into some queue, and
then put your consumer on that.
As for mixing EJB 1.0 and EJB 2.0 in order to use MDBs, I do not know what
the issues might be. I suspect there aren't any. Try posting your question to
the weblogic.developer.interest.ejb newsgroup.
Tom
"Ignacio G. Dupont" wrote:
> Hi, we are using Weblogic 6.1 sp 2 under Linux and we are having problems
> when trying to create durable consummers, the problem is tat, even when it
> doesn't seems to be any problem when creating them they don't receive
> messages sended to the topics they are subscribed. We can see the messages
> getting hold onto the message queue.
>
> Here is the code of a function we use to subscribe our consummers:
>
> TopicConnectionFactory tconFactory;
> TopicConnection tcon;
> TopicSession tsession;
> Topic topic;
> ServerSessionPool sessionPool;
> ConnectionConsumer consumer;
>
> String connectionFactory = (String)args.get("connectionFactory");
> String topicName = (String)args.get("topic");
> String action = (String)args.get("action");
> String name = (String)args.get("name");
> String persistence = "";
> String selector = "";
> int maxsessions = 1; // 1 by default
> int maxmessages = 1; // 1 by default
>
> if (args.get("selector") != null)
> selector = (String)args.get("selector");
> if (args.get("persistence") != null)
> persistence = (String)args.get("persistence");
> if (args.get("maxsessions") != null)
> maxsessions = Integer.parseInt((String)args.get("maxsessions"));
> if (args.get("maxmessages") != null)
> maxmessages = Integer.parseInt((String)args.get("maxmessages"));
>
> if (connectionFactory == null || topicName == null)
> {
> throw new IllegalArgumentException("connectionFactory=" +
> connectionFactory + ", topicName=" + topicName);
> }
> try
> {
> tconFactory = (TopicConnectionFactory) ctx.lookup(connectionFactory);
> tcon = tconFactory.createTopicConnection();
> tcon.setClientID(topicName + ++uqTopicID);
> tsession = tcon.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
> topic = (Topic) ctx.lookup(topicName);
> tcon.start();
>
> sessionPool =
> sessionPoolFactory.getServerSessionPool(tcon,maxsessions,false,Session.AUTO_
> ACKNOWLEDGE,name);
>
> if (!selector.equals(""))
> {
> if (persistence.equals("Y"))
> consumer = tcon.createDurableConnectionConsumer(topic, name ,
> selector, sessionPool, maxmessages);
> else
> consumer = tcon.createConnectionConsumer(topic, selector, sessionPool,
> maxmensajes);
> }
> }
> catch (NamingException ne)
> {
> ne.printStackTrace();
> }
> catch (javax.jms.JMSException jmse)
> {
> jmse.printStackTrace();
> }
>
> of course this is just the code of a function we call from a loop in order
> to make the subscriptions.
>
> As you can see in this part of the code:
>
> if (persistence.equals("Y"))
> consumer = tcon.createDurableConnectionConsumer(topic, name ,
> selector, sessionPool, maxmessages);
> else
> consumer = tcon.createConnectionConsumer(topic, selector, sessionPool,
> maxmensajes);
>
> we use a variable in order to make the subscription durable or not. The
> problem is that all the subscriptions that are not durable are getting the
> messages but the durable ones don't.
>
> We don't really know in any case what the second parameter (name) on the
> createDurableConnectionConsumer method should contain, we have tried with
> the client ID we set to the TopicConnection a few lines above but still
> doesn't work.
>
> Are we doing something wrong?
>
> I have readed another post in this newsgroup from Alex Lui asking a similar
> question:
>
> <quote>
>
> Alex Lui
> Wednesday, 29 May 2002 4:59
> weblogic.developer.interest.jms
> TopicConnection.createDurableConnectionConsumer
>
> According to 7.0 documentation, this operation is still not supported. Is
> there any plan which release will support it?
>
> </quote>
>
> then, Tom Barnes answers him:
>
> <quote>
>
> Tom Barnes
> Wednesday, 29 May 2002 21:42
> weblogic.developer.interest.jms
> Re: TopicConnection.createDurableConnectionConsumer
>
> Nothing planned in near term (that I know of). This is not a J2EE
> requirement.
> Contact BEA customer support and put in an enhancement request if this is
> important to you. Meanwhile, use an MDB with a durable subscriber. For
> almost all use cases, MDBs are more apable than connection consumers.
>
> Tom
>
> </quote>
>
> We do really need to subscribe a "class" instead of an instance of an object
> in order to process messages concurrently.
>
> If our aproach is not feasible, what would be the right one?
>
> Notice that we are not using MDBs as we are currently using EJB 1.1
> specification. Would it be possible to use both EJB 1.0 and EJB 2.0 at the
> same time by packaging them into two .jar files earch one having a different
> ejb-jar.xml and weblogic-ejb-jar.xml files for each one with different EJB
> versions? Will it be possible then to call EJB 1.0 beans from the MDB 2.0
> subscribers?
>
> Thanks in advance
>
> Regards,
>
> Ignacio G. Dupont.
-
07/02/19 11:21:47 javax.jms.JMSException: TopicConnection[Oc4jJMS.Connection.dsc
p18056.3b2816fc:110d886e29f:-8000.35]: cannot invoke method "setClientID" within
the J2EE container.
07/02/19 11:21:47 at com.evermind.server.jms.JMSUtils.make(JMSUtils.java:1
034)
07/02/19 11:21:47 at com.evermind.server.jms.JMSUtils.toJMSException(JMSUt
ils.java:1114)
07/02/19 11:21:47 at com.evermind.server.jms.JMSUtils.toJMSException(JMSUt
ils.java:1085)
07/02/19 11:21:47 at com.evermind.server.jms.JMSUtils.assertNotContainer(J
MSUtils.java:1500)
07/02/19 11:21:47 at com.evermind.server.jms.EvermindConnection.setClientI
D(EvermindConnection.java:254)
07/02/19 11:21:47 at oracle.otnsamples.oc4jjms.ChatSubscriber.createSubscr
iber(Unknown Source)
07/02/19 11:21:47 at oracle.otnsamples.oc4jjms.GetMessage.doGet(Unknown So
urce)
07/02/19 11:21:47 at javax.servlet.http.HttpServlet.service(HttpServlet.ja
va:743)
07/02/19 11:21:47 at javax.servlet.http.HttpServlet.service(HttpServlet.ja
va:856)
07/02/19 11:21:47 at com.evermind.server.http.ServletRequestDispatcher.inv
oke(ServletRequestDispatcher.java:719)
07/02/19 11:21:47 at com.evermind.server.http.ServletRequestDispatcher.for
wardInternal(ServletRequestDispatcher.java:376)
07/02/19 11:21:47 at com.evermind.server.http.HttpRequestHandler.doProcess
Request(HttpRequestHandler.java:870)
07/02/19 11:21:47 at com.evermind.server.http.HttpRequestHandler.processRe
quest(HttpRequestHandler.java:451)
07/02/19 11:21:47 at com.evermind.server.http.HttpRequestHandler.serveOneR
equest(HttpRequestHandler.java:218)
07/02/19 11:21:47 at com.evermind.server.http.HttpRequestHandler.run(HttpR
equestHandler.java:119)
07/02/19 11:21:47 at com.evermind.server.http.HttpRequestHandler.run(HttpR
equestHandler.java:112)
07/02/19 11:21:47 at oracle.oc4j.network.ServerSocketReadHandler$SafeRunna
ble.run(ServerSocketReadHandler.java:260)
07/02/19 11:21:47 at oracle.oc4j.network.ServerSocketAcceptHandler.procCli
entSocket(ServerSocketAcceptHandler.java:230)
07/02/19 11:21:47 at oracle.oc4j.network.ServerSocketAcceptHandler.access$
800(ServerSocketAcceptHandler.java:33)
07/02/19 11:21:47 at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptH
andlerHorse.run(ServerSocketAcceptHandler.java:831)
07/02/19 11:21:47 at com.evermind.util.ReleasableResourcePooledExecutor$My
Worker.run(ReleasableResourcePooledExecutor.java:303)
07/02/19 11:21:47 at java.lang.Thread.run(Thread.java:595)This is a J2EE 1.4 restriction.
See section: J2EE.6.6 Java Service (JMS) 1.1 Requirements
"The following methods may only be used by application components
executing in the application client container:
javax.jms.Connection method setClientID"
For in-container connections, you should set clientID via the .xml.
-Jeff -
TopicConnection.createSession hanging
Hi everyone,
We're expermenting with Oracle AQ as JMS provider, since we're using an Oracle DB (specifically Oracle Database 11g Release 11.1.0.0.0 - Production) underneath anyway. We managed to connect using a "toy" application which also receives messages. However, in our "real" applications, we can get a ConnectionFactory, use that to create that Connection, start the Connection, but when creating a Session, the Thread is just hanging up.
Here's a code snippet:
final TopicConnection con = AQjmsFactory
.getTopicConnectionFactory("<hostIP>",
"<SID>",
<port>,
"thin")
.createTopicConnection("<aqUser>",
"<aqUserPassword>");
con.start();
final AQjmsSession session = (AQjmsSession) con.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
As mentioned above, createTopicSession is hanging and never returns.
We managed to extract the StackTrace for the hanging Thread:
"AWT-EventQueue-0" Id=19 in RUNNABLE (running in native)
java.net.SocketInputStream.socketRead0(Native Method)
java.net.SocketInputStream.read(SocketInputStream.java:129)
java.io.ObjectInputStream$PeekInputStream.read(ObjectInputStream.java:2265)
java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2278)
java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2749)
java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:779)
java.io.ObjectInputStream.(ObjectInputStream.java:279)
fr.dyade.aaa.jndi2.client.NamingConnection.open(NamingConnection.java:100)
fr.dyade.aaa.jndi2.client.NamingConnection.invoke(NamingConnection.java:75)
fr.dyade.aaa.jndi2.client.NamingContextImpl.lookup(NamingContextImpl.java:106)
javax.naming.InitialContext.lookup(InitialContext.java:392)
oracle.jms.EmulatedXAHandler.(EmulatedXAHandler.java:69)
oracle.jms.AQjmsSession.(AQjmsSession.java:364)
oracle.jms.AQjmsConnection.createTopicSession(AQjmsConnection.java:739)
As you can see, apparently the AQ code is trying a lookup inside the client JVM's default JNDI context (which is a Joram messaging server - exactly the one we're planning to replace, but we'll still need it for now). We're a bit lost here and open for suggestions.What version of OC4J are you using? Remember that OC4J JMS is only fully supported starting in 904 (developer release is OK).
If you are using the 904 developer release, try to get a stack trace of the client and server JVMs (send them a SIGKILL). -
TopicConnection authentication
Hello,
I would like to permit connection to my JMS service only to authenticated users.
I know that there is a method
TopicConnectionFactory.createTopicConnection(username, password);
that allow the user to create TopicConnection only if he has a username and password.
But where do I must to store those credentials?
I' m using J2ee.
Help me.
Thank you.on j2ee there is "Unauthenicated User Name" that allows anyone to have credential of a generic unauthenticated user.
what I must make in order not to allow this? -
JMSListenerResourceAdapter on SJAS8.1EE
Hi folks,
Application Server : Sun Java Application Server 8.1 EE
Node agent is not running. Using a single instance in a stand-alone mode.
No cluster setup done.
Operating System : Windows XP Prof.
IDM version : 6.0
Resource Adapter being configured : The JMSListener Resource Adapter
JMS Administered Objects Setup : I've set a ConnectionFactory (for Topics) and a
Topic via the Admin Console and created the corresponding Physical Destination.
When I set the following attributes on the JMSListenerResourceAdapter :
JNDIProperties (for InitialContext creation)
java.naming.factory.initial=com.sun.enterprise.naming.SerialInitContextFactory
java.naming.provider.url=localhost:1099
and specify the correct JNDI name for the ConnectionFactory and the Destination, I get
an error on the JSP :
Test connection failed for resource(s):
InboundTicketsListener: com.sun.messaging.jms.JMSException: MQRA:CA:Unsupported-setClientID()
Unfortunately, I dont get a complete Exception Stack Trace anywhere (even after a level 4
trace on the Adapter class) .
On researching the above exception, I found the following bug opened by Nokia on SJAS 8.1 EE.
Note the developer's comments when closing the bug:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6197813
The IDM Resource Adapter for JMS does the same thing as com.nokia.oss.ossj.sa.ri.order.OrderScheduler
tried .
In the JMSListener Resource Adapter, is it possible that we doing something like ....?
connection.setExceptionListener(...);
As per Section 6.6 of the J2EE1.4 spec :
<from14Jee>
The following methods may only be used by application components
executing in the application client container:
javax.jms.Session method setMessageListener
javax.jms.Session method getMessageListener
javax.jms.Session method run
javax.jms.QueueConnection method createConnectionConsumer
javax.jms.TopicConnection method createConnectionConsumer
javax.jms.TopicConnection method createDurableConnectionConsumer
javax.jms.MessageConsumer method getMessageListener
javax.jms.MessageConsumer method setMessageListener
javax.jms.Connection method setExceptionListener
javax.jms.Connection method stop
javax.jms.Connection method setClientID
A J2EE container may throw a JMSException (if allowed by the method) if the
application component violates these restrictions
</from14Jee>
Looking at the support for setting up a MessageListener to monitor the Message Consumption lifecycle and the support for Durable subscriptions, the JMSListenerResourceAdapter also probably calls setMessageListener and setClientID(for Durable subscriptions),both of which are illegal in a non ACC scenario .
Has the JMSListenerAdapter been tested on SJAS8.1 EE (one of the supported Application server platforms)?
It's possible that WebLogic and Websphere may not be throwing the above error since the spec says :
A J2EE container "may" throw a JMSException.... in the above case ..
Any pointers or tips on how we can get around this issue would be really helpful !
CiaoThanks Wilfred .
Wilfred : On version 6 these kinds of exceptions should be logged in the syslog table (new logging table in the database) check if you have an exception there.
CB : I did try to run lh syslog and didnt retrieve any records. Do I need to make any configuration changes to have all exceptions go to syslog or does every exception out of the box go into syslog ?
Wilfred : The other possibility is that the html source does contain the full stacktrace as a comment. Please check that also.
CB: Checked that too - View Source doesnt give the full stack unfortunately.
Wilfred : If it is reproducible log a support case with the traces.
CB: It is reproducible. We are in the process of filing a support case
Wilfred : FYI bug 6197813 has been closed as not a bug as the app server is allowed to throw that exception if the component is not in the client container of the app server.
CB: Yes, I understood that .. I know that it's not an Application server bug.
However you didnt answer my main questions :)
The J2EE spec says that the application server "may" throw the exception if the component calling connection.setExceptionListener() is not an AppClient.
First - Isnt it true that the IDM Resource adapter is not running in an appclient? Isnt it running inside a WebContainer?
Second - Is it possible that SJAS throws the exception but WebLogic/Websphere dont in the above scenario?
Third - Has the JMSListener Resource adapter been tested and certified on Sun Java Application Server? -
Error while deploying a message driven bean
I am deployeing a MDB which is done successfully but the message is not retrieved(No message in teh queue). The following description is given in the log file.
#1.5#0016E6197593004B0000000B000013040004288DE20D6CD8#1170489754872#com.sap.security.core.policy.PolicyInfoManagerImpl##com.sap.security.core.policy.PolicyInfoManagerImpl.copyApplicationConfiguration#Administrator#523####e5dbec01b35c11db90e70016e6197593#SAPEngine_Application_Thread[impl:3]_39##0#0#Error#1#/System/Security/WS/SecurityProtocol#Java###An error occured while copying configurations for application . Reason: #3#sap.com/MessageEAR#com.sap.engine.frame.core.configuration.NameNotFoundException#A configuration with the path "webservices/services/sap.com/MessageEAR" does not exist.#
Can you please tell where to look for it and what to do?the session bean is ::
public class SenderBean implements SessionBean {
public static final boolean DEBUG = false;
private SessionContext ctx;
private TopicConnectionFactory factory;
private TopicConnection connection;
private Topic topic;
public SenderBean() {
log("constructor");
public void ejbCreateSender() throws CreateException {
log("ejbCreate");
try {
InitialContext naming = new InitialContext();
factory = (TopicConnectionFactory)naming.lookup("jmsfactory/default/ExceptionTopicFactory");
topic = (Topic)naming.lookup("jmstopics/default/ExceptionTopic");
log("factory: " + factory);
allocateResources();
} catch (Exception exc) {
log("exception occured during ejbCreate().");
throw new CreateException("Unexpected exception in ejbCreate().");
public void ejbCreate() throws CreateException {
public void ejbActivate() {
log("ejbActivate");
try {
allocateResources();
} catch (Exception exc) {
exc.printStackTrace();
public void ejbPassivate() {
log("ejbPassivate");
try {
releaseResources();
} catch (Exception exc) {
exc.printStackTrace();
public void ejbRemove() {
log("ejbRemove");
public void setSessionContext(SessionContext _ctx) {
log("setSessionContext");
ctx = _ctx;
public void sendMessage(String text) throws MessageNotSentException {
log("sendMessage");
log("text = " + text);
TopicSession session = null;
try {
session = connection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
log("topic = " + topic);
TopicPublisher publisher = session.createPublisher(topic);
TextMessage textMessage = session.createTextMessage();
textMessage.setText(text);
publisher.publish(textMessage);
System.out.println("Message Sent");
log("message sent");
} catch (JMSException jmse) {
jmse.printStackTrace();
throw new MessageNotSentException(jmse.toString());
} finally {
try {
if (session != null) {
session.close();
} catch (Exception exc) {
private void releaseResources() throws JMSException {
connection.close();
connection = null;
private void allocateResources() throws JMSException {
connection = factory.createTopicConnection();
log("connection = " + connection);
connection.start();
log("connection started");
private void log(String message) {
if (DEBUG) {
System.out.println("SenderBean: " + message);
the mdb is::
public class MessageDisplayBean implements MessageDrivenBean, MessageListener {
public static final boolean DEBUG = false;
private MessageDrivenContext ctx;
private QueueConnectionFactory factory;
private QueueConnection connection;
private Queue queue;
public MessageDisplayBean() {
System.out.println("In constructor");
log("constructor");
public void onMessage(Message message) {
TextMessage textMessage = (TextMessage)message;
try {
String text = textMessage.getText();
log("message received. Text follows:\n\n " + text + "\n\n");
connection = factory.createQueueConnection();
connection.start();
QueueSession session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
TextMessage confirmation = session.createTextMessage();
confirmation.setText("Message \""+ textMessage.getText() + "\" received.");
//queue = session.createQueue("ConfirmationQueue");
QueueSender sender = session.createSender(queue);
sender.send(confirmation);
session.close();
connection.close();
System.out.println("Message received");
} catch (javax.jms.JMSException jmse) {
public void ejbRemove() {
log("ejbRemove()");
public void setMessageDrivenContext(MessageDrivenContext _ctx) {
log("setMessageDrivenContext()");
ctx = _ctx;
System.out.println("In context");
public void ejbCreate() {
try {
System.out.println("In ejbcreate");
InitialContext naming = new InitialContext();
factory = (QueueConnectionFactory)naming.lookup("jmsfactory/default/ExceptionQueueFactory");
queue = (Queue)naming.lookup("jmsqueues/default/ExceptionQueue");
log("factory: " + factory);
} catch (Exception exc) {
log("exception occured during ejbCreate().");
log("ejbCreate()");
private void log(String str) {
if (DEBUG) {
System.out.println("MessageDisplayBean: " + str);
th ejb-j2ee-engine.xml is::
<ejb-j2ee-engine>
<enterprise-beans>
<enterprise-bean>
<ejb-name>MessageDisplayBean</ejb-name>
<jndi-name>MessageDisplayBean</jndi-name>
<message-props>
<destination-name>ExceptionTopic</destination-name>
<connection-factory-name>ExceptionTopicFactory</connection-factory-name>
</message-props>
</enterprise-bean>
<enterprise-bean>
<ejb-name>MessageSender</ejb-name>
<jndi-name>MessageSender</jndi-name>
<session-props/>
</enterprise-bean>
</enterprise-beans>
</ejb-j2ee-engine>
the ejb-jar.xml is::
<ejb-jar>
<display-name> Message Driver Bean Example </display-name>
<enterprise-beans>
<session>
<display-name> MessageSender </display-name>
<ejb-name>MessageSender</ejb-name>
<home>com.sap.message.sender.SenderHome</home>
<remote>com.sap.message.sender.Sender</remote>
<local-home>com.sap.message.sender.SenderLocalHome</local-home>
<local>com.sap.message.sender.SenderLocal</local>
<ejb-class>com.sap.message.sender.SenderBean</ejb-class>
<session-type>Stateful</session-type>
<transaction-type>Container</transaction-type>
<ejb-local-ref>
<ejb-ref-name>ejb/SenderBean</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>com.sap.message.sender.SenderLocalHome</local-home>
<local>com.sap.message.sender.SenderLocal</local>
<ejb-link>MyEJB.jar#MessageSender</ejb-link>
</ejb-local-ref>
<resource-ref>
<res-ref-name>ExceptionTopicFactory</res-ref-name>
<res-type>javax.jms.TopicConnectionFactory</res-type>
<res-auth> Container</res-auth>
</resource-ref>
<resource-env-ref>
<resource-env-ref-name>ExceptionTopic </resource-env-ref-name>
<resource-env-ref-type> javax.jms.Topic </resource-env-ref-type>
</resource-env-ref>
</session>
<message-driven>
<ejb-name>MessageDisplayBean</ejb-name>
<ejb-class>com.sap.message.mdb.MessageDisplayBean</ejb-class>
<transaction-type>Container</transaction-type>
<message-driven-destination>
<destination-type>javax.jms.Topic</destination-type>
</message-driven-destination>
<resource-ref>
<res-ref-name> ExceptionQueueFactory </res-ref-name>
<res-type> javax.jms.QueueConnectionFactory </res-type>
<res-auth> Container </res-auth>
</resource-ref>
<resource-env-ref>
<resource-env-ref-name> ExceptionQueue </resource-env-ref-name>
<resource-env-ref-type> javax.jms.Queue </resource-env-ref-type>
</resource-env-ref>
</message-driven>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>MessageDisplayBean</ejb-name>
<method-name>onMessage</method-name>
</method>
<trans-attribute> NotSupported </trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar> -
Topic consumer does not show up in destination after WLS restart
Hello JMS cracks
<p>We have following setup: <br>
- 1 Admin and 2 Managed WLS 8.1 SP4 on same host:<br>
- distributed topic destination<br>
- external jms topic subscriber client (using weblogic.jar)
</p>
<p>
The client subscribes to the topic in the following way:
<p>
TopicConnectionFactory fact = (TopicConnectionFactory) ctx.lookup("factName");<br>
TopicConnection tcon = fact.createTopicConnection();<br>
tcon.setExceptionListener(exceptionListener); <br>
TopicSession tsession = tcon.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);<br>
Topic topic = (Topic) ctx.lookup("logicNameOfDistributedTopic");<br>
TopicSubscriber treceiver = tsession.createSubscriber(topic,selector,false);<br>
treceiver.setMessageListener(messageListener);
</p>
<p>
Test scenario: <br>
- start admin WLS and both managed WLS with URLs t3://host1:27100 and t3://host1:27200, respectively<br>
<br>
- start client with URL t3://host1:27100<br>
=> client receives messages :-)<br>
<br>
- kill client and start client again with URL t3://host1:27200<br>
=> client receives messages :-)<br>
<br>
- kill client and start client again with URL t3://host1:27100,host1:27200<br>
=> client receives messages :-)<br>
<br>
- kill WLS instance, e.g. t3://host1:27100<br>
=> Two possibilies: <br>
1) the client was connected to t3://host1:27100 and it has not to reconnect; it still receives messages :-) (however, an internal tester told me, that it also may stop receiving messages :-(<br>
<br>
2) client receives an Exception and reconnects to t3://host1:27200 (exceptionListener). It <b>may or may not receive messages</b> :-( <br>
<br>
- start WLS instance t3://host1:27100 again<br>
- kill client which is connected to t3://host1:27200 and start client with URL t3://host1:27100<br>
=> client connects to t3://host1:27100, but it <b>may or may not receive messages</b> :-( <br>
<br>
- kill client which is connected to t3://host1:27100 and start client with URL t3://host1:27200<br>
=> client connects to t3://host1:27200, but it <b>may or may not receive messages</b> :-( <br>
</p>
<p>
Going to the Weblogic console <myClusterDomain> > JMS Servers> <my JMS Server on t3://host1:27200> Active JMS Destinations one can see that the topic subscriber may or may not be added to the consumer count. If it is not added, the client does not receive any messages and vice versa.
</p>
<p>
This is very very annoying.
</p>
<p>
Please, can somebody tell me what can lead to this behaviour? Is something wrong with the configuration (if yes which parameter have I to adjust)? Is this just a timeing problem? Is there a workaround? Or is this normal (I hope not)?
</p>
<p>
Thanks very much for your help.
</p>
<p>
Peter
</p>Please find below the relevant parts of our config.xml.
Thanks for your help, Peter
<?xml version="1.0" encoding="UTF-8"?>
<Domain ConfigurationVersion="8.1.4.0" Name="devtClusterDomain">
<Cluster ClusterAddress="zueux32.sma.ch:27100,zueux32.sma.ch:27200"
MulticastAddress="237.0.0.1" MulticastPort="27900" Name="devtCluster"/>
<Server AcceptBacklog="50" Cluster="" DefaultProtocol="t3"
DefaultSecureProtocol="t3s" ExpectedToRun="false"
HttpdEnabled="true" ListenAddress="zueux32.sma.ch"
ListenPort="27000" Machine="zueux32" Name="devtAdmin"
NativeIOEnabled="true" ReliableDeliveryPolicy="RMDefaultPolicy"
ServerVersion="8.1.4.0" StdoutDebugEnabled="false"
StdoutSeverityLevel="32" TransactionLogFilePrefix="./logs/"
TunnelingClientPingSecs="45" TunnelingClientTimeoutSecs="40">
<WebServer AuthCookieEnabled="true"
LogFileName="./logs/access.log" LoggingEnabled="true" Name="devtAdmin"/>
<COM Name="devtAdmin"/>
<ServerStart
Arguments="-Dlog4j.configuration=file:/opt/bea/weblogic81/common/lib/workshopLogCfg.xml"
BeaHome="/opt/bea/weblogic81"
ClassPath="/opt/bea/weblogic81/server/lib/weblogic_knex_patch.jar:/opt/bea/weblogic81/common/lib/log4j.jar:/opt/bea/weblogic81/server/lib/debugging.jar:/opt/bea/weblogic81/server/lib/knex.jar:/opt/bea/weblogic81/javelin/lib/javelin.jar:/opt/bea/weblogic81/server/lib/wlw-lang.jar:/opt/bea/jdk142_05/lib/tools.jar:/opt/bea/weblogic81/server/lib/weblogic_sp.jar:/opt/bea/weblogic81/server/lib/weblogic.jar:/opt/bea/weblogic81/server/lib/ant/ant.jar:/opt/bea/jdk142_05/jre/lib/rt.jar::/opt/bea/weblogic81/common/eval/pointbase/lib/pbclient44.jar:/opt/bea/weblogic81/server/lib/webserviceclient.jar:/opt/bea/weblogic81/server/lib/webserviceclient+ssl.jar:/opt/bea/weblogic81/server/lib/xbean.jar:/opt/bea/weblogic81/server/lib/wlxbean.jar:/opt/bea/weblogic81/server/lib/xqrl.jar:/opt/bea/weblogic81/server/lib/netui/netui-compiler.jar:/opt/bea/weblogic81/server/lib/wli.jar:/opt/bea/weblogic81/server/lib/fop.jar:/opt/bea/weblogic81/integration/adapters/sample/lib/sample-eis.jar"
JavaHome="/opt/bea/jkd142_05" Name="devtAdmin"
RootDirectory="/var/bea/domains/devtClusterDomain" SecurityPolicyFile="/opt/bea/weblogic81/server/lib/weblogic.policy"/>
<SSL Enabled="false" IdentityAndTrustLocations="KeyStores" Name="devtAdmin"/>
<Log FileMinSize="20000" Name="devtAdmin" RotationType="bySize"/>
<KernelDebug Name="devtAdmin"/>
<KernelDebug Name="devtAdmin"/>
<ServerDebug Name="devtAdmin"/>
<ExecuteQueue Name="weblogic.kernel.Default"/>
<JTAMigratableTarget Name="devtAdmin" UserPreferredServer="devtAdmin"/>
</Server>
<Server Cluster="devtCluster" ExpectedToRun="true"
GracefulShutdownTimeout="30" ListenAddress="zueux32.sma.ch"
ListenPort="27100" MSIFileReplicationEnabled="true"
Machine="zueux32" Name="devtMan1" NativeIOEnabled="true" ServerVersion="8.1.4.0">
<SSL Enabled="false" IdentityAndTrustLocations="KeyStores" Name="devtMan1"/>
<ExecuteQueue Name="weblogic.kernel.Default"/>
<ServerStart
Arguments="-Dlog4j.configuration=file:/opt/bea/weblogic81/common/lib/workshopLogCfg.xml"
BeaHome="/opt/bea/weblogic81"
ClassPath="/opt/bea/weblogic81/server/lib/weblogic_knex_patch.jar:/opt/bea/weblogic81/common/lib/log4j.jar:/opt/bea/weblogic81/server/lib/debugging.jar:/opt/bea/weblogic81/server/lib/knex.jar:/opt/bea/weblogic81/javelin/lib/javelin.jar:/opt/bea/weblogic81/server/lib/wlw-lang.jar:/opt/bea/jdk142_05/lib/tools.jar:/opt/bea/weblogic81/server/lib/weblogic_sp.jar:/opt/bea/weblogic81/server/lib/weblogic.jar:/opt/bea/weblogic81/server/lib/ant/ant.jar:/opt/bea/jdk142_05/jre/lib/rt.jar::/opt/bea/weblogic81/common/eval/pointbase/lib/pbclient44.jar:/opt/bea/weblogic81/server/lib/webserviceclient.jar:/opt/bea/weblogic81/server/lib/webserviceclient+ssl.jar:/opt/bea/weblogic81/server/lib/xbean.jar:/opt/bea/weblogic81/server/lib/wlxbean.jar:/opt/bea/weblogic81/server/lib/xqrl.jar:/opt/bea/weblogic81/server/lib/netui/netui-compiler.jar:/opt/bea/weblogic81/server/lib/wli.jar:/opt/bea/weblogic81/server/lib/fop.jar:/opt/bea/weblogic81/integration/adapters/sample/lib/sample-eis.jar"
JavaHome="/opt/bea/jkd142_05" Name="devtMan1"
OutputFile="/var/bea/domains/devtClusterDomain/./NodeManagerClientLogs/devtClusterDomain_devtMan1/startServer_12_07_2006-16_42_57-4.log"
PasswordEncrypted="{3DES}wgEfvC0PoLDAO9eJ0RGXBg=="
RootDirectory="/var/bea/domains/devtClusterDomain"
SecurityPolicyFile="/opt/bea/weblogic81/server/lib/weblogic.policy" Username="weblogic"/>
</Server>
<Server Cluster="devtCluster" ExpectedToRun="true"
GracefulShutdownTimeout="30" ListenAddress="zueux32.sma.ch"
ListenPort="27200" MSIFileReplicationEnabled="true"
Machine="zueux32" Name="devtMan2" NativeIOEnabled="true" ServerVersion="8.1.4.0">
<SSL Enabled="false" IdentityAndTrustLocations="KeyStores" Name="devtMan2"/>
<ExecuteQueue Name="weblogic.kernel.Default"/>
<ServerStart
Arguments="-Dlog4j.configuration=file:/opt/bea/weblogic81/common/lib/workshopLogCfg.xml"
BeaHome="/opt/bea/weblogic81"
ClassPath="/opt/bea/weblogic81/server/lib/weblogic_knex_patch.jar:/opt/bea/weblogic81/common/lib/log4j.jar:/opt/bea/weblogic81/server/lib/debugging.jar:/opt/bea/weblogic81/server/lib/knex.jar:/opt/bea/weblogic81/javelin/lib/javelin.jar:/opt/bea/weblogic81/server/lib/wlw-lang.jar:/opt/bea/jdk142_05/lib/tools.jar:/opt/bea/weblogic81/server/lib/weblogic_sp.jar:/opt/bea/weblogic81/server/lib/weblogic.jar:/opt/bea/weblogic81/server/lib/ant/ant.jar:/opt/bea/jdk142_05/jre/lib/rt.jar::/opt/bea/weblogic81/common/eval/pointbase/lib/pbclient44.jar:/opt/bea/weblogic81/server/lib/webserviceclient.jar:/opt/bea/weblogic81/server/lib/webserviceclient+ssl.jar:/opt/bea/weblogic81/server/lib/xbean.jar:/opt/bea/weblogic81/server/lib/wlxbean.jar:/opt/bea/weblogic81/server/lib/xqrl.jar:/opt/bea/weblogic81/server/lib/netui/netui-compiler.jar:/opt/bea/weblogic81/server/lib/wli.jar:/opt/bea/weblogic81/server/lib/fop.jar:/opt/bea/weblogic81/integration/adapters/sample/lib/sample-eis.jar"
JavaHome="/opt/bea/jkd142_05" Name="devtMan2"
OutputFile="/var/bea/domains/devtClusterDomain/./NodeManagerClientLogs/devtClusterDomain_devtMan2/startServer_12_13_2006-14_29_44-4.log"
PasswordEncrypted="{3DES}wgEfvC0PoLDAO9eJ0RGXBg=="
RootDirectory="/var/bea/domains/devtClusterDomain"
SecurityPolicyFile="/opt/bea/weblogic81/server/lib/weblogic.policy" Username="weblogic"/>
</Server>
<MigratableTarget Cluster="devtCluster" Name="devtMan1 (migratable)"
Notes="This is a system generated default migratable target for a server. Do not delete manually." UserPreferredServer="devtMan1"/>
<MigratableTarget Cluster="devtCluster" Name="devtMan2 (migratable)"
Notes="This is a system generated default migratable target for a server. Do not delete manually." UserPreferredServer="devtMan2"/>
<UnixMachine Name="zueux32" PostBindGID="gs-weblogic"
PostBindGIDEnabled="true" PostBindUID="weblogic" PostBindUIDEnabled="true">
<NodeManager ListenAddress="localhost" Name="zueux32"/>
</UnixMachine>
<ApplicationManager Name="devtClusterDomain"/>
<Application Deployed="true" LoadOrder="1000"
Name="JWSQueueTransport" Path="/opt/bea/weblogic81/server/lib"
StagedTargets="devtMan1,devtMan2" TwoPhase="true">
<EJBComponent Name="QueueTransportEJB" Targets="devtCluster" URI="QueueTransportEJB.jar"/>
</Application>
<SNMPAgent Name="devtClusterDomain"/>
<Log FileMinSize="20000" FileName="./wl-domain.log"
Name="devtClusterDomain" RotationType="bySize"/>
<JMSConnectionFactory
JNDIName="weblogic.jws.jms.QueueConnectionFactory"
Name="cgQueue"
Notes="User transactions must be enabled to ensure transaction coordination for persistence and asynchronous operations"
Targets="devtCluster" UserTransactionsEnabled="true"/>
<JMSDistributedQueue JNDIName="jws.queue"
Name="dist_cgJWSQueue_auto" Targets="devtCluster">
<JMSDistributedQueueMember JMSQueue="cgJWSQueue_auto_1" Name="cgJWSQueue_auto_1_OF_cgJMSServer_auto_1"/>
<JMSDistributedQueueMember JMSQueue="cgJWSQueue_auto_2" Name="cgJWSQueue_auto_2_OF_cgJMSServer_auto_2"/>
</JMSDistributedQueue>
<JMSFileStore Directory="rmfilestore" Name="FileStore"/>
<JMSJDBCStore ConnectionPool="cgJMSPool-nonXA"
Name="cgJMSStore_auto_1" PrefixName="dev_1"/>
<JMSJDBCStore ConnectionPool="cgJMSPool-nonXA"
Name="cgJMSStore_auto_2" PrefixName="dev_2"/>
<JMSServer Name="cgJMSServer_auto_1" Store="cgJMSStore_auto_1" Targets="devtMan1 (migratable)">
<JMSQueue JNDIName="jws.queue_auto_1" Name="cgJWSQueue_auto_1"
RedeliveryLimit="2" StoreEnabled="default"/>
</JMSServer>
<JMSServer Name="cgJMSServer_auto_2" Store="cgJMSStore_auto_2" Targets="devtMan2 (migratable)">
<JMSQueue JNDIName="jws.queue_auto_2" Name="cgJWSQueue_auto_2"
RedeliveryLimit="2" StoreEnabled="default"/>
</JMSServer>
<WSReliableDeliveryPolicy DefaultRetryCount="10"
DefaultTimeToLive="60000" Name="RMDefaultPolicy" Store="FileStore"/>
<JMSServer Name="WSStoreForwardInternalJMSServerdevtAdmin"
Store="FileStore" Targets="devtAdmin">
<JMSQueue CreationTime="1137587420880"
JNDIName="jms.internal.queue.WSStoreForwardQueue"
JNDINameReplicated="false" Name="WSInternaljms.internal.queue.WSStoreForwardQueuedevtAdmin"/>
<JMSQueue CreationTime="1137587421219"
JNDIName="jms.internal.queue.WSDupsEliminationHistoryQueue"
JNDINameReplicated="false" Name="WSInternaljms.internal.queue.WSDupsEliminationHistoryQueuedevtAdmin"/>
</JMSServer>
<JDBCConnectionPool ConnectionCreationRetryFrequencySeconds="30"
ConnectionReserveTimeoutSeconds="30"
DriverName="weblogic.jdbc.oracle.OracleDriver"
InactiveConnectionTimeoutSeconds="30" InitialCapacity="3"
MaxCapacity="10" Name="DataDispatcher Connection Pool"
PasswordEncrypted="{3DES}JLyzhkaCG14="
Properties="user=datdisp;SID=DWHDEVT"
ShrinkFrequencySeconds="60" StatementCacheSize="50"
Targets="devtMan1,devtMan2" TestConnectionsOnReserve="true"
TestFrequencySeconds="240"
TestTableName="SQL SELECT * FROM V_DB_STATUS" URL="jdbc:bea:oracle://zueux33:1521"/>
<JDBCTxDataSource EnableTwoPhaseCommit="true"
JNDIName="jdbc/datadispatcher" Name="DataDispatcher Data Source"
PoolName="DataDispatcher Connection Pool" Targets="devtCluster"/>
<JMSTemplate DeliveryModeOverride="Persistent"
ExpirationPolicy="Log" MessagesMaximum="1000"
Name="Default JMS Template" RedeliveryDelayOverride="1000" RedeliveryLimit="20"/>
<JMSFileStore
Directory="/var/bea/domains/devtClusterDomain/filestores/devtMan1/ddreceiver" Name="Receiver File Store Man1"/>
<JMSFileStore
Directory="/var/bea/domains/devtClusterDomain/filestores/devtMan2/ddreceiver" Name="Receiver File Store Man2"/>
<JMSFileStore
Directory="/var/bea/domains/devtClusterDomain/filestores/devtMan1/ddsender" Name="Sender File Store Man1"/>
<JMSFileStore
Directory="/var/bea/domains/devtClusterDomain/filestores/devtMan2/ddsender" Name="Sender File Store Man2"/>
<JMSServer Name="Receiver JMS-Server Man1"
Store="Receiver File Store Man1" Targets="devtMan1 (migratable)" TemporaryTemplate="Default JMS Template">
<JMSQueue CreationTime="1137593696886"
JNDIName="jms/dataDispatcher.receiver@Receiver JMS-Server Man1"
Name="DataDispatcher Receiver Distributed Queue@Receiver JMS-Server Man1" Template="DataDispatcher Receiver Distributed Queue"/>
</JMSServer>
<JMSServer Name="Receiver JMS-Server Man2"
Store="Receiver File Store Man2" Targets="devtMan2 (migratable)" TemporaryTemplate="Default JMS Template">
<JMSQueue CreationTime="1137593696919"
JNDIName="jms/dataDispatcher.receiver@Receiver JMS-Server Man2"
Name="DataDispatcher Receiver Distributed Queue@Receiver JMS-Server Man2" Template="DataDispatcher Receiver Distributed Queue"/>
</JMSServer>
<JMSServer Name="Sender JMS-Server Man1"
Store="Sender File Store Man1" Targets="devtMan1 (migratable)" TemporaryTemplate="Default JMS Template">
<JMSQueue CreationTime="1137593759170"
JNDIName="jms/dataDispatcher.sender@Sender JMS-Server Man1"
Name="DataDispatcher Sender Distributed Queue@Sender JMS-Server Man1" Template="DataDispatcher Sender Distributed Queue"/>
<JMSQueue CreationTime="1137593828640"
JNDIName="jms/dataDispatcher.jmsHandlerQueue@Sender JMS-Server Man1"
Name="JMSHandler Distributed Queue@Sender JMS-Server Man1" Template="JMSHandler Distributed Queue"/>
<JMSTopic CreationTime="1138625625006"
DeliveryModeOverride="Persistent"
JNDIName="jms/dataDispatcher.jmsHandlerTopic@Sender JMS-Server Man1"
Name="JMSHandler Distributed Topic@Sender JMS-Server Man1" Template="JMSHandler Distributed Topic"/>
</JMSServer>
<JMSServer Name="Sender JMS-Server Man2"
Store="Sender File Store Man2" Targets="devtMan2 (migratable)" TemporaryTemplate="Default JMS Template">
<JMSQueue CreationTime="1137593759133"
JNDIName="jms/dataDispatcher.sender@Sender JMS-Server Man2"
Name="DataDispatcher Sender Distributed Queue@Sender JMS-Server Man2" Template="DataDispatcher Sender Distributed Queue"/>
<JMSQueue CreationTime="1137593828610"
JNDIName="jms/dataDispatcher.jmsHandlerQueue@Sender JMS-Server Man2"
Name="JMSHandler Distributed Queue@Sender JMS-Server Man2" Template="JMSHandler Distributed Queue"/>
<JMSTopic CreationTime="1138625624566"
DeliveryModeOverride="Persistent"
JNDIName="jms/dataDispatcher.jmsHandlerTopic@Sender JMS-Server Man2"
Name="JMSHandler Distributed Topic@Sender JMS-Server Man2" Template="JMSHandler Distributed Topic"/>
</JMSServer>
<JMSTemplate DeliveryModeOverride="Persistent"
ExpirationPolicy="Log"
Name="DataDispatcher Receiver Distributed Queue"
RedeliveryDelayOverride="1000" RedeliveryLimit="20"/>
<JMSDistributedQueue JNDIName="jms/dataDispatcher.receiver"
Name="DataDispatcher Receiver Distributed Queue"
Targets="devtCluster" Template="DataDispatcher Receiver Distributed Queue">
<JMSDistributedQueueMember
JMSQueue="DataDispatcher Receiver Distributed Queue@Receiver JMS-Server Man1" Name="DataDispatcher Receiver Distributed Queue@Receiver JMS-Server Man1"/>
<JMSDistributedQueueMember
JMSQueue="DataDispatcher Receiver Distributed Queue@Receiver JMS-Server Man2" Name="DataDispatcher Receiver Distributed Queue@Receiver JMS-Server Man2"/>
</JMSDistributedQueue>
<JMSTemplate DeliveryModeOverride="Persistent"
ExpirationPolicy="Log"
Name="DataDispatcher Sender Distributed Queue"
RedeliveryDelayOverride="1000" RedeliveryLimit="20"/>
<JMSDistributedQueue JNDIName="jms/dataDispatcher.sender"
Name="DataDispatcher Sender Distributed Queue"
Targets="devtCluster" Template="DataDispatcher Sender Distributed Queue">
<JMSDistributedQueueMember
JMSQueue="DataDispatcher Sender Distributed Queue@Sender JMS-Server Man2" Name="DataDispatcher Sender Distributed Queue@Sender JMS-Server Man2"/>
<JMSDistributedQueueMember
JMSQueue="DataDispatcher Sender Distributed Queue@Sender JMS-Server Man1" Name="DataDispatcher Sender Distributed Queue@Sender JMS-Server Man1"/>
</JMSDistributedQueue>
<JMSTemplate ExpirationPolicy="Log"
Name="JMSHandler Distributed Queue"
RedeliveryDelayOverride="1000" RedeliveryLimit="20"/>
<JMSDistributedQueue ForwardDelay="60"
JNDIName="jms/dataDispatcher.jmsHandlerQueue"
Name="JMSHandler Distributed Queue" Targets="devtCluster" Template="JMSHandler Distributed Queue">
<JMSDistributedQueueMember
JMSQueue="JMSHandler Distributed Queue@Sender JMS-Server Man2" Name="JMSHandler Distributed Queue@Sender JMS-Server Man2"/>
<JMSDistributedQueueMember
JMSQueue="JMSHandler Distributed Queue@Sender JMS-Server Man1" Name="JMSHandler Distributed Queue@Sender JMS-Server Man1"/>
</JMSDistributedQueue>
<JMSTemplate DeliveryModeOverride="Persistent"
ExpirationPolicy="Log" Name="JMSHandler Distributed Topic"
RedeliveryDelayOverride="1000" RedeliveryLimit="20" TimeToLiveOverride="-1"/>
<JMSDistributedTopic JNDIName="jms/dataDispatcher.jmsHandlerTopic"
Name="JMSHandler Distributed Topic" Targets="devtCluster" Template="JMSHandler Distributed Topic">
<JMSDistributedTopicMember
JMSTopic="JMSHandler Distributed Topic@Sender JMS-Server Man2" Name="JMSHandler Distributed Topic@Sender JMS-Server Man2"/>
<JMSDistributedTopicMember
JMSTopic="JMSHandler Distributed Topic@Sender JMS-Server Man1" Name="JMSHandler Distributed Topic@Sender JMS-Server Man1"/>
</JMSDistributedTopic>
<Application Name="xplg" Path="/var/tmp"
StagedTargets="devtMan1,devtMan2,devtAdmin" StagingMode="stage" TwoPhase="true">
<WebAppComponent Name="xplg" Targets="devtCluster" URI="xplg"/>
</Application>
<JDBCConnectionPool DriverName="weblogic.jdbc.oracle.OracleDriver"
Name="methodenPool" PasswordEncrypted="{3DES}NIZOVDL+tBI="
Properties="user=meteoch;portNumber=1521;SID=dwhdevt;serverName=zueux33"
Targets="devtCluster" TestTableName="SQL SELECT 1 FROM DUAL" URL="jdbc:bea:oracle://zueux33:1521"/>
<JDBCTxDataSource JNDIName="jdbc/methoden" Name="methodenDataSource"
PoolName="methodenPool" Targets="devtCluster"/>
<Application Name="ws_dwh_methodenSession"
Path="/var/tmp/scp/ws_dwh_methodenSession.ear"
StagedTargets="devtMan1,devtAdmin,devtMan2" StagingMode="stage" TwoPhase="true">
<WebServiceComponent Name="dwh_methodenSession"
Targets="devtCluster" URI="dwh_methodenSession.war"/>
<EJBComponent Name="MethodenWebServiceEJB.jar"
Targets="devtCluster" URI="MethodenWebServiceEJB.jar"/>
</Application>
<Server Cluster="c1" ExpectedToRun="true" ListenPort="1111"
Machine="zueux32" Name="m1" ServerVersion="8.1.4.0">
<ServerDebug Name="m1"/>
<SSL IdentityAndTrustLocations="KeyStores" Name="m1"/>
<KernelDebug Name="m1"/>
<Log Name="m1"/>
<ServerStart Name="m1"
OutputFile="/var/bea/domains/devtClusterDomain/./NodeManagerClientLogs/devtClusterDomain_m1/startServer_12_07_2006-11_16_05-110.log"
PasswordEncrypted="{3DES}wgEfvC0PoLDAO9eJ0RGXBg==" Username="weblogic"/>
<WebServer Name="m1"/>
<COM Name="m1"/>
<IIOP Name="m1"/>
<JTAMigratableTarget Name="m1" UserPreferredServer="m1"/>
<JTARecoveryService Name="m1"/>
</Server>
<Server Cluster="c1" ExpectedToRun="true" ListenPort="2222"
Machine="zueux32" Name="m2" ServerVersion="8.1.4.0">
<ServerDebug Name="m2"/>
<SSL IdentityAndTrustLocations="KeyStores" Name="m2"/>
<KernelDebug Name="m2"/>
<Log Name="m2"/>
<ServerStart Name="m2"
OutputFile="/var/bea/domains/devtClusterDomain/./NodeManagerClientLogs/devtClusterDomain_m2/startServer_12_07_2006-11_10_32-82.log"
PasswordEncrypted="{3DES}wgEfvC0PoLDAO9eJ0RGXBg==" Username="weblogic"/>
<WebServer Name="m2"/>
<COM Name="m2"/>
<IIOP Name="m2"/>
<JTAMigratableTarget Name="m2" UserPreferredServer="m2"/>
<JTARecoveryService Name="m2"/>
</Server>
<Cluster Name="c1"/>
<MigratableTarget Cluster="c1" Name="m1 (migratable)"
Notes="This is a system generated default migratable target for a server. Do not delete manually." UserPreferredServer="m1"/>
<MigratableTarget Cluster="c1" Name="m2 (migratable)"
Notes="This is a system generated default migratable target for a server. Do not delete manually." UserPreferredServer="m2"/>
<JMSServer Name="j1" Targets="m1 (migratable)">
<JMSTopic CreationTime="1165485063006" JNDIName="t1" Name="t1"/>
</JMSServer>
<JMSServer Name="j2" Targets="m2 (migratable)">
<JMSTopic CreationTime="1165485075834" JNDIName="t2" Name="t2"/>
</JMSServer>
<JMSTemplate Name="d1"/>
<JMSDistributedTopic JNDIName="d1" Name="d1" Targets="c1" Template="d1">
<JMSDistributedTopicMember JMSTopic="t1" Name="dt1"/>
<JMSDistributedTopicMember JMSTopic="t2" Name="dt2"/>
</JMSDistributedTopic>
<JMSConnectionFactory JNDIName="f1" Name="f1" Targets="c1"/>
<Application Name="DataDispatcher"
Path="/home/zue/users/kep/proj/datadispatcher/dist/DataDispatcher.ear"
StagingMode="nostage" TwoPhase="true">
<EJBComponent Name="DataDispatcherBeans.jar"
Targets="devtCluster" URI="DataDispatcherBeans.jar"/>
<WebAppComponent Name="DataDispatcherAdminWeb"
Targets="devtCluster" URI="DataDispatcherAdminWeb"/>
<WebAppComponent Name="ReceiverServlet" Targets="devtCluster" URI="ReceiverServlet"/>
<WebAppComponent Name="SenderServlet" Targets="devtCluster" URI="SenderServlet"/>
<WebAppComponent Name="datadispatcherui" Targets="devtCluster" URI="datadispatcherui"/>
</Application>
</Domain>
Edited by peter05 at 12/18/2006 11:59 PM -
MDB container managed transaction demarcation not working in wls 6.1 beta
I have an MDB which sends the messages it receives onto another JMS
destination within the onMessage method. These messages are not sent to
the JMS destination unless I explicitly use a transacted session for the
destination and subsequently commit the session. If I set the transacted
parameter to Session as false the messages are sent. If I set the
transacted parameter to true the messages will only be output if the
session is committed. This is the standard behaviour for a JMS session
but this is not the correct behaviour for an MDB running with
container-managed transaction demarcation.
For a start the transacted parameter to session should be ignored when
run in the context of a container transaction and the commit method
should thrown an exception as it is not allowed within the context of a
container transaction.
This is the MDB code and the deployment descriptor: -
public class MessageBean implements MessageDrivenBean, MessageListener
private String topicName = null;
private TopicConnectionFactory topicConnectionFactory = null;
private TopicConnection topicConnection = null;
private TopicSession topicSession = null;
private Topic topic = null;
private TopicPublisher topicPublisher = null;
private TextMessage textMessage=null;
private transient MessageDrivenContext messageDrivenContext = null;
private Context jndiContext;
public final static String
JMS_FACTORY="weblogic.examples.jms.TopicConnectionFactory";
public final static String
TOPIC="weblogic.examples.jms.exampleTopic";
public MessageBean()
public void setMessageDrivenContext(MessageDrivenContext
messageDrivenContext)
this.messageDrivenContext = messageDrivenContext;
public void ejbCreate()
public void onMessage(Message inMessage)
try
jndiContext = new InitialContext();
topicConnectionFactory =
(TopicConnectionFactory)jndiContext.lookup(JMS_FACTORY);
topic = (Topic) jndiContext.lookup(TOPIC);
topicConnection =
topicConnectionFactory.createTopicConnection();
topicConnection.start();
// The transacted parameter should be ignored in the context of a
container tx
topicSession = topicConnection.createTopicSession(true,
Session.AUTO_ACKNOWLEDGE);
topicPublisher = topicSession.createPublisher(topic);
textMessage = (TextMessage)inMessage;
topicPublisher.publish(inMessage);
// this is illegal in a container transaction
topicSession.commit();
topicConnection.close();
catch (JMSException je)
throw new EJBException(je);
catch (NamingException ne)
throw new EJBException(ne);
public void ejbRemove()
<?xml version="1.0" encoding="UTF-8"?>
<!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>
<display-name>MessageBean</display-name>
<ejb-name>MessageBean</ejb-name>
<ejb-class>MessageBean</ejb-class>
<transaction-type>Container</transaction-type>
<message-driven-destination>
<destination-type>javax.jms.Queue</destination-type>
</message-driven-destination>
<security-identity>
<description></description>
<run-as>
<description></description>
<role-name></role-name>
</run-as>
</security-identity>
</message-driven>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>MessageBean</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
Please see the response in the EJB newsgroup.
Also, could you kindly only post to a single newsgroup?
Thanks.
"Jimmy Johns" <[email protected]> wrote in message
news:[email protected]...
> I have an MDB which sends the messages it receives onto another JMS
> destination within the onMessage method. These messages are not sent to
> the JMS destination unless I explicitly use a transacted session for the
>
> destination and subsequently commit the session. If I set the transacted
>
> parameter to Session as false the messages are sent. If I set the
> transacted parameter to true the messages will only be output if the
> session is committed. This is the standard behaviour for a JMS session
> but this is not the correct behaviour for an MDB running with
> container-managed transaction demarcation.
>
> For a start the transacted parameter to session should be ignored when
> run in the context of a container transaction and the commit method
> should thrown an exception as it is not allowed within the context of a
> container transaction.
>
> This is the MDB code and the deployment descriptor: -
>
> public class MessageBean implements MessageDrivenBean, MessageListener
> {
> private String topicName = null;
> private TopicConnectionFactory topicConnectionFactory = null;
> private TopicConnection topicConnection = null;
> private TopicSession topicSession = null;
> private Topic topic = null;
> private TopicPublisher topicPublisher = null;
> private TextMessage textMessage=null;
> private transient MessageDrivenContext messageDrivenContext = null;
>
> private Context jndiContext;
>
> public final static String
> JMS_FACTORY="weblogic.examples.jms.TopicConnectionFactory";
> public final static String
> TOPIC="weblogic.examples.jms.exampleTopic";
>
> public MessageBean()
> {
> }
>
> public void setMessageDrivenContext(MessageDrivenContext
> messageDrivenContext)
> {
> this.messageDrivenContext = messageDrivenContext;
> }
>
> public void ejbCreate()
> {
> }
>
> public void onMessage(Message inMessage)
> {
> try
> {
> jndiContext = new InitialContext();
> topicConnectionFactory =
> (TopicConnectionFactory)jndiContext.lookup(JMS_FACTORY);
> topic = (Topic) jndiContext.lookup(TOPIC);
> topicConnection =
> topicConnectionFactory.createTopicConnection();
> topicConnection.start();
> // The transacted parameter should be ignored in the context of a
> container tx
> topicSession = topicConnection.createTopicSession(true,
> Session.AUTO_ACKNOWLEDGE);
> topicPublisher = topicSession.createPublisher(topic);
> textMessage = (TextMessage)inMessage;
> topicPublisher.publish(inMessage);
> // this is illegal in a container transaction
> topicSession.commit();
> topicConnection.close();
> }
> catch (JMSException je)
> {
> throw new EJBException(je);
> }
> catch (NamingException ne)
> {
> throw new EJBException(ne);
> }
> }
>
> public void ejbRemove()
> {
> }
> }
>
>
>
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <!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>
> <display-name>MessageBean</display-name>
> <ejb-name>MessageBean</ejb-name>
> <ejb-class>MessageBean</ejb-class>
> <transaction-type>Container</transaction-type>
> <message-driven-destination>
> <destination-type>javax.jms.Queue</destination-type>
> </message-driven-destination>
> <security-identity>
> <description></description>
> <run-as>
> <description></description>
> <role-name></role-name>
> </run-as>
> </security-identity>
> </message-driven>
> </enterprise-beans>
> <assembly-descriptor>
> <container-transaction>
> <method>
> <ejb-name>MessageBean</ejb-name>
> <method-name>*</method-name>
> </method>
> <trans-attribute>Required</trans-attribute>
> </container-transaction>
> </assembly-descriptor>
> </ejb-jar>
>
>
>
>
>
>
>
>
-
JMS Client disconnects often randomly in Weblogic10.3 cluster setup
Hi,
It would be very helpful for us if someone can suggest the way to overcome the below jms issue.
Our application recently migrated to Weblogic 10.3 from Weblogic8.1, It is a clustered set up with two managed servers each on different solaris machine.
Client connects to jms using wljmsclient.jar and wlclient.jar with t3 protocol.
When client starts jms connection, it is getting connected to server with no errors, however we often see that client jms connection disconnects in between,
It sometimes calls onException() and some times we do not even see any error message in console log when it disconnects,
When onException() is called, we can see below exception stack trace:
==========================
JMS exception class = weblogic.messaging.dispatcher.DispatcherException: java.rmi.MarshalException: CORBA COMM_FAILURE 1398079697 No; nested exception is:
org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 209 completed: No
weblogic.jms.common.JMSException: weblogic.messaging.dispatcher.DispatcherException: java.rmi.MarshalException: CORBA COMM_FAILURE 1398079697 No; nested exception is:
org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 209 completed: No
at weblogic.jms.dispatcher.DispatcherAdapter.convertToJMSExceptionAndThrow(DispatcherAdapter.java:116)
at weblogic.jms.dispatcher.DispatcherAdapter.dispatchSyncNoTran(DispatcherAdapter.java:61)
at weblogic.jms.client.JMSSession.acknowledge(JMSSession.java:2191)
at weblogic.jms.client.JMSSession.acknowledge(JMSSession.java:2120)
at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:4588)
at weblogic.jms.client.JMSSession.execute(JMSSession.java:4233)
at weblogic.jms.client.JMSSession.executeMessage(JMSSession.java:3709)
JMS exception class = java.rmi.MarshalException: CORBA COMM_FAILURE 1398079697 No; nested exception is:
org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 209 completed: No
weblogic.jms.common.LostServerException: java.rmi.MarshalException: CORBA COMM_FAILURE 1398079697 No; nested exception is:
org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 209 completed: No
at weblogic.jms.client.JMSConnection.dispatcherPeerGone(JMSConnection.java:1436)
at weblogic.messaging.dispatcher.DispatcherWrapperState.run(DispatcherWrapperState.java:692)
at weblogic.messaging.dispatcher.DispatcherWrapperState.timerExpired(DispatcherWrapperState.java:617)
at weblogic.timers.internal.TimerImpl.run(TimerImpl.java:273)
=======================
When onException() is triggered, TopicConnection and TopicSession gets recreated in program, however jms is not getting reconnected once onException() is called. Some times jms session is lost in between with out any errors in log. We did not see this issue when our app used Weblogic8.1.
We greatly appreciate if someone can help to resolve this issue.Hi,
This is a common issue if you use wljmsclient.jar and wlclient.jar at client side. Many times we get "org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 209 completed: No" Please try using weblogic.jar at client end or even there is a better option to create the "*wlfullclient.jar*" using the jarBuilder utility provided as part of WebLogic.
To create the "wlfullclient.jar" please refer to the following link:
[http://download-llnw.oracle.com/docs/cd/E11035_01/wls100/client/jarbuilder.html#wp1077742|http://download-llnw.oracle.com/docs/cd/E11035_01/wls100/client/jarbuilder.html#wp1077742]
Thanks
Jay SenSharma
http://jaysensharma.woardpress.com -
i m new to java,,, running one simple code in JMS Topic... using weblogic.... server.. please help me as it is givng me the error.. that i have pasted below. thanx in advance
Deepali
my publisher code i m giving below :
***************************************88
import javax.naming.*;
import javax.naming.InitialContext;
import javax.jms.JMSException;
import javax.jms.Topic;
import javax.jms.Session;
import javax.jms.TextMessage;
import javax.jms.TopicPublisher;
import javax.jms.DeliveryMode;
import javax.jms.TopicSession;
import javax.jms.TopicConnection;
import javax.jms.TopicConnectionFactory;
import java.io.StringReader;
import java.util.ArrayList;
import java.util.*;
public class Publisher
public static void main(String[] args) throws Exception
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
env.put(Context.PROVIDER_URL, "t3://localhost:7001");
// get the initial context
InitialContext ctx = new InitialContext(env);
//InitialContext ctx = getInitialContext("t3://localhost:7001");
// lookup the topic object
Topic topic = (Topic) ctx.lookup("topic0");
// lookup the topic connection factory
TopicConnectionFactory connFactory = (TopicConnectionFactory) ctx.
lookup("topic/connectionFactory");
// create a topic connection
TopicConnection topicConn = connFactory.createTopicConnection();
// create a topic session
TopicSession topicSession = topicConn.createTopicSession(false,
Session.AUTO_ACKNOWLEDGE);
// create a topic publisher
TopicPublisher topicPublisher = topicSession.createPublisher(topic);
topicPublisher.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
// create the "Hello World" message
TextMessage message = topicSession.createTextMessage();
message.setText("Hello World");
// publish the messages
topicPublisher.publish(message);
// print what we did
System.out.println("published: " + message.getText());
// close the topic connection
topicConn.close();
it is givng following error?.. can some one explaine me y?...
Exception in thread "main" javax.naming.NameNotFoundException: Unable to resolve 'topic0' Resolved: '' Unresol
ved:'topic0' ; remaining name 'topic0'
at weblogic.rmi.internal.BasicOutboundRequest.sendReceive(BasicOutboundRequest.java:109)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:263)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:230)
at weblogic.jndi.internal.ServerNamingNode_WLStub.lookup(Unknown Source)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:337)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:332)
at javax.naming.InitialContext.lookup(InitialContext.java:350)
at Publisher.main(Publisher.java:33)Could you tell me how the error was resolved, I am getting same error>
Thanks
i m new to java,,, running one simple code in JMS Topic... using weblogic.... server.. please help me as it is givng me the error.. that i have pasted below. thanx in advance
Deepali
my publisher code i m giving below :
***************************************88
import javax.naming.*;
import javax.naming.InitialContext;
import javax.jms.JMSException;
import javax.jms.Topic;
import javax.jms.Session;
import javax.jms.TextMessage;
import javax.jms.TopicPublisher;
import javax.jms.DeliveryMode;
import javax.jms.TopicSession;
import javax.jms.TopicConnection;
import javax.jms.TopicConnectionFactory;
import java.io.StringReader;
import java.util.ArrayList;
import java.util.*;
public class Publisher
public static void main(String[] args) throws Exception
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
env.put(Context.PROVIDER_URL, "t3://localhost:7001");
// get the initial context
InitialContext ctx = new InitialContext(env);
//InitialContext ctx = getInitialContext("t3://localhost:7001");
// lookup the topic object
Topic topic = (Topic) ctx.lookup("topic0");
// lookup the topic connection factory
TopicConnectionFactory connFactory = (TopicConnectionFactory) ctx.
lookup("topic/connectionFactory");
// create a topic connection
TopicConnection topicConn = connFactory.createTopicConnection();
// create a topic session
TopicSession topicSession = topicConn.createTopicSession(false,
Session.AUTO_ACKNOWLEDGE);
// create a topic publisher
TopicPublisher topicPublisher = topicSession.createPublisher(topic);
topicPublisher.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
// create the "Hello World" message
TextMessage message = topicSession.createTextMessage();
message.setText("Hello World");
// publish the messages
topicPublisher.publish(message);
// print what we did
System.out.println("published: " + message.getText());
// close the topic connection
topicConn.close();
it is givng following error?.. can some one explaine me y?...
Exception in thread "main" javax.naming.NameNotFoundException: Unable to resolve 'topic0' Resolved: '' Unresol
ved:'topic0' ; remaining name 'topic0'
at weblogic.rmi.internal.BasicOutboundRequest.sendReceive(BasicOutboundRequest.java:109)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:263)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:230)
at weblogic.jndi.internal.ServerNamingNode_WLStub.lookup(Unknown Source)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:337)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:332)
at javax.naming.InitialContext.lookup(InitialContext.java:350)
at Publisher.main(Publisher.java:33) -
Question about the use of asdoc
I want to use asdoc to compile the flex SDK documentation myself. The reason is I need it in another format, and for a specific SDK (4.5.1).
I simply cannot get it to run. Out of the box, what should the command line look like if I'm in the bin the bin folder? Everything I try just keeps throwing errors.1002099 wrote:
+"When an application completes, you need to close any connections that you have created. Failure to close a connection can cause resources not to be released by the JMS provider. Closing a connection also closes its sessions and their message producers and message consumers.+
+queueConnection.close();+
+topicConnection.close();+
+Before your application can consume messages, you must call the connection's start method; for details, see Section 3.5, "Message Consumers." If you want to stop message delivery temporarily without closing the connection, you call the stop method."+
Should I close the connection as the last paragraph say?. If so, I don't know how to do it without lose the service, because if I call "close" method on the connection and immediatelyi start it, i will lose all my consumers and producers for a little time.
You should close a connection when you have no further use for it as this will release resources.
You must start a connection if you want to receive messages from it.
Most applications don't use stop(). However if your application needs to temporarily pause delivery of messages (to the application) for some reason, call stop(). When your application wants delivery of messages (to the application) to restart, call start() again.
Nigel -
Question about the use of JMS connections
Good Morning,
I'm a new user of JMS technology. I'm having some problems with the performance of my application. Specifically, i'm developing a 24x7 application. We are using MessageListener for all consumers.
Doing performance and continuity tests I detected memory leaks in certain JMS classes. After passing a profiler tool, I saw a large amount of ObjectMessage and Message instances. We are not closing the session, MessageListeners, MessageConsumers or Connetion instances because we want to reuse them all the time, and we can't close them because we lose the high availability service.
Reading, the JMS tutorial, I'm saw this paragraph in the "Connection" section:
+"When an application completes, you need to close any connections that you have created. Failure to close a connection can cause resources not to be released by the JMS provider. Closing a connection also closes its sessions and their message producers and message consumers.+
+queueConnection.close();+
+topicConnection.close();+
+Before your application can consume messages, you must call the connection's start method; for details, see Section 3.5, "Message Consumers." If you want to stop message delivery temporarily without closing the connection, you call the stop method."+
Should I close the connection as the last paragraph say?. If so, I don't know how to do it without lose the service, because if I call "close" method on the connection and immediatelyi start it, i will lose all my consumers and producers for a little time.
Any suggestion?
Thank you in advance,
Regards1002099 wrote:
+"When an application completes, you need to close any connections that you have created. Failure to close a connection can cause resources not to be released by the JMS provider. Closing a connection also closes its sessions and their message producers and message consumers.+
+queueConnection.close();+
+topicConnection.close();+
+Before your application can consume messages, you must call the connection's start method; for details, see Section 3.5, "Message Consumers." If you want to stop message delivery temporarily without closing the connection, you call the stop method."+
Should I close the connection as the last paragraph say?. If so, I don't know how to do it without lose the service, because if I call "close" method on the connection and immediatelyi start it, i will lose all my consumers and producers for a little time.
You should close a connection when you have no further use for it as this will release resources.
You must start a connection if you want to receive messages from it.
Most applications don't use stop(). However if your application needs to temporarily pause delivery of messages (to the application) for some reason, call stop(). When your application wants delivery of messages (to the application) to restart, call start() again.
Nigel -
Is there any tutorial for jms development with jdeveloper out there ?
Hi
Thank you for reading my post
is there any tutorial which show us how to use jdeveloper +oc4j for JMS stuff ?
I mean an end 2 end tutorial to build mdb+jms resources in oc4j + client
it will be far better if the tutorial shows how we can use jdeveloper features for this task (if it provide any wizard...)This is an example of a client:
public String listeningJMS (Context context) throws Exception
String topicName = "jms/demoTopic";
String topicConnectionFactoryName = "jms/TopicConnectionFactory";
TopicConnectionFactory topicConnectionFactory = null;
TopicConnection topicConnection = null;
TopicSession topicSession = null;
Topic topic = null;
TopicSubscriber topicSubscriber = null;
TextMessage message = null;
String fileName = null;
* Look up connection factory and topic. If either does
* not exist, exit.
try
topicConnectionFactory = (TopicConnectionFactory)
context.lookup(topicConnectionFactoryName);
topic = (Topic) context.lookup(topicName);
* Create connection.
* Create session from connection; false means session is
* not transacted.
* Create subscriber.
* Register message listener (TextListener).
* Receive text messages from topic.
* When all messages have been received, enter Q to quit.
* Close connection.
topicConnection =
topicConnectionFactory.createTopicConnection();
topicSession =
topicConnection.createTopicSession(false,
Session.AUTO_ACKNOWLEDGE);
topicSubscriber =
topicSession.createSubscriber(topic);
topicConnection.start();
System.out.println("Receiving: ");
TextMessage msg = (TextMessage) topicSubscriber.receive();
String xmlString =msg.getText();
topicConnection.close();
System.err.println("Received: "+xmlString);
fileName = this.getFileName(msg.getText());
} catch (Exception e) {
throw e;
} finally {
if (topicConnection != null) {
try {
topicConnection.close();
} catch (JMSException e) {throw e;}
return fileName;
public static Context getInitialContext() throws NamingException {
Hashtable env = new Hashtable();
// Standalone OC4J connection details
env.put( Context.INITIAL_CONTEXT_FACTORY, "oracle.j2ee.rmi.RMIInitialContextFactory" );
env.put( Context.SECURITY_PRINCIPAL, "oc4jadmin" );
env.put( Context.SECURITY_CREDENTIALS, "welcome1" );
env.put(Context.PROVIDER_URL, "ormi://localhost:12401");
//env.put(Context.PROVIDER_URL, "ormi://localhost:23791");
return new InitialContext( env );
} -
JMS problem with Sun Application Server 8.2
Hi!
I've just started trying JMS and found a problem.
I set a connection factory called "QueueConnectionFactory" in the Sun Application Server Admin Consol.
After this I test this code:
import javax.jms.*;
import javax.naming.*;
public class Sun_JNDI
public static void main(String args[]) throws Exception
Context jndiContext = null;
System.setProperty("java.naming.factory.initial","com.sun.enterprise.naming.SerialInitContextFactory" );
System.setProperty("java.naming.factory.url.pkgs","=com.sun.enterprise.naming");
System.setProperty("java.naming.provider.url","localhost:1024");
jndiContext = new InitialContext();
Object O = jndiContext.lookup("QueueConnectionFactory");
System.out.println(jndiContext);
in result I got this long Exception message:
2006.02.12. 10:52:59 com.sun.corba.ee.spi.logging.LogWrapperBase doLog
INFO: "IOP00710299: (INTERNAL) Successfully created IIOP listener on the specified host/port: all interfaces/1356"
2006.02.12. 10:53:00 com.sun.enterprise.connectors.ActiveRAFactory createActiveResourceAdapter
SEVERE: RAR6001 : Class Not found : com.sun.messaging.jms.ra.ResourceAdapter
2006.02.12. 10:53:00 com.sun.enterprise.connectors.ActiveRAFactory createActiveResourceAdapter
SEVERE:
com.sun.enterprise.connectors.ConnectorRuntimeException: Error in creating active RAR
at com.sun.enterprise.connectors.ActiveRAFactory.createActiveResourceAdapter(ActiveRAFactory.java:76)
at com.sun.enterprise.connectors.ResourceAdapterAdminServiceImpl.createActiveResourceAdapter(ResourceAdapterAdminServiceImpl.java:267)
at com.sun.enterprise.connectors.ConnectorRuntime.createActiveResourceAdapter(ConnectorRuntime.java:189)
at com.sun.enterprise.naming.factory.ConnectorObjectFactory.getObjectInstance(ConnectorObjectFactory.java:71)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:293)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at Sun_JNDI.main(Sun_JNDI.java:40)
Caused by: java.lang.ClassNotFoundException: com.sun.messaging.jms.ra.ResourceAdapter
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at com.sun.enterprise.connectors.ActiveRAFactory.createActiveResourceAdapter(ActiveRAFactory.java:50)
... 7 more
2006.02.12. 10:53:00 com.sun.enterprise.naming.SerialContext lookup
SEVERE: NAM0004: Exception during name lookup : {0}
com.sun.enterprise.connectors.ConnectorRuntimeException: Error in creating active RAR
at com.sun.enterprise.connectors.ActiveRAFactory.createActiveResourceAdapter(ActiveRAFactory.java:76)
at com.sun.enterprise.connectors.ResourceAdapterAdminServiceImpl.createActiveResourceAdapter(ResourceAdapterAdminServiceImpl.java:267)
at com.sun.enterprise.connectors.ConnectorRuntime.createActiveResourceAdapter(ConnectorRuntime.java:189)
at com.sun.enterprise.naming.factory.ConnectorObjectFactory.getObjectInstance(ConnectorObjectFactory.java:71)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:293)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at Sun_JNDI.main(Sun_JNDI.java:40)
Caused by: java.lang.ClassNotFoundException: com.sun.messaging.jms.ra.ResourceAdapter
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at com.sun.enterprise.connectors.ActiveRAFactory.createActiveResourceAdapter(ActiveRAFactory.java:50)
... 7 more
Exception in thread "main" javax.naming.CommunicationException: serial context communication ex [Root exception is com.sun.enterprise.connectors.ConnectorRuntimeException: Error in creating active RAR]
at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:317)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at Sun_JNDI.main(Sun_JNDI.java:40)
Caused by: com.sun.enterprise.connectors.ConnectorRuntimeException: Error in creating active RAR
at com.sun.enterprise.connectors.ActiveRAFactory.createActiveResourceAdapter(ActiveRAFactory.java:76)
at com.sun.enterprise.connectors.ResourceAdapterAdminServiceImpl.createActiveResourceAdapter(ResourceAdapterAdminServiceImpl.java:267)
at com.sun.enterprise.connectors.ConnectorRuntime.createActiveResourceAdapter(ConnectorRuntime.java:189)
at com.sun.enterprise.naming.factory.ConnectorObjectFactory.getObjectInstance(ConnectorObjectFactory.java:71)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:293)
... 2 more
Caused by: java.lang.ClassNotFoundException: com.sun.messaging.jms.ra.ResourceAdapter
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at com.sun.enterprise.connectors.ActiveRAFactory.createActiveResourceAdapter(ActiveRAFactory.java:50)
... 7 more
So I tested this code under Netbeans5 and I don't where to find jar file contains the class: com.sun.messaging.jms.ra.ResourceAdapter
Other time I tryied to lookup this URL: "java:comp/env/jms/QueueConnectionFactory"
The result was: javax.naming.NameNotFoundException
I know it is a small code example but if I'm not able to solve this problem I can't go on with JMS.
I would be glad by any help.
Regards:
SandorHello
In my code it looks like that:
1: System.setProperty("com.sun.jndi.ldap.LdapCtxFactory", "iiop://localhost:3700");
2: Context ctx = new InitialContext();
3: TopicConnectionFactory factory = (TopicConnectionFactory)ctx.lookup("jms/DailyDestinationFactory");
4: TopicConnection connection = factory.createTopicConnection();
5: TopicSession session = connection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
6: Topic topic = (Topic)ctx.lookup("jms/DailyBean");
7: TopicPublisher pub = session.createPublisher(topic);
8: TextMessage msg = session.createTextMessage();
9: msg.setText("NewMessage");
10: pub.send(msg);
and it work with Sun App Server 8.2.
Maybe you are looking for
-
Error in CC while using SAP_XI_IDOC/IDOCXmlToFlatConvertor module
Hi, We are getting an error in CC monitoring while using SAP_XI_IDOC/IDOCXmlToFlatConvertor module for converting IDoc XML to flat file. Below is the error text: "Message processing failed. Cause: com.sap.conn.idoc.IDocParseException: (7) IDOC_ERROR_
-
How can I reinstall Bluetooth drivers after loading windows 7 64 bit version on my 2010 iMac?
I have just uninstalled windows 7 32 bit version which I have been using for ages and upgraded to the 64 bit version. I did this from the windows partition in my bootcamp divided hard drive. I then reinstalled the drivers using the application DVD wh
-
HT4279 3 monitors of different types
Hi, I am using a 2012 MacPro tower and was wondering if I can connect the 2 miniports to HDMI and one DVI to DVI? OR connect 2 miniport to DVI and one DVI to HDMI? OR connect 2 miniport to VGA and one DVI to DVI? These configurations aren't listed on
-
Do mini's support dual monitors?
Do mini's support dual monitors? If yes, how are they connected.
-
Logic 8 on a 1.67 ghz?
I thinking of switiching to Logic 8 from Cubase, but I'm worried that my G4 may not be able to handle it as well. Anyone out there running Logic on a powerbook? Any problems so far, lag times etc? I'd be using it to record mostly drums through a Pers