-
45. Re: Trouble with jms-topic
standard Mar 14, 2008 8:28 AM (in response to standard)Hi,
Just in case I do need that patch after all:
Which libs do I have to exchange,
only rosetta, or the other mentioned too?
Right now it seems like replacing only rosetta
is the only way I can start the server afterwards,
so I would go with that, but wanted to be completely sure.
Thanks
Andreas -
46. Re: Trouble with jms-topic
beve Mar 14, 2008 8:47 AM (in response to standard)Hi Andreas,
I think the easiest thing for you would be to modfiy a checked out version of 4.2GA locally and building and deploy it.
The only change that was made was to JmsCourier:--- rosetta/src/org/jboss/internal/soa/esb/couriers/JmsCourier.java (revision 18948) +++ rosetta/src/org/jboss/internal/soa/esb/couriers/JmsCourier.java (working copy) @@ -437,7 +437,7 @@ } else if (JMSEpr.TOPIC_TYPE.equals(sType)) { TopicSession tSess = _pool.getTopicSession(); _jmsSession = tSess; - Topic topic = tSess.createTopic(_epr.getDestinationName()); + Topic topic = (Topic)oJndiCtx.lookup(_epr.getDestinationName()); _messageConsumer = tSess.createConsumer(topic, _epr.getMessageSelector()); } else {
You could manually add this change and bulid. This class will be put in jbossesb-rosetta.jar so that will be the only jar that needs to be updated.
Regards,
Daniel -
47. Re: Trouble with jms-topic
standard Mar 14, 2008 8:53 AM (in response to standard)Hi,
thanks I will try that.
Regards
Andreas -
48. Re: Trouble with jms-topic
standard Mar 14, 2008 11:38 AM (in response to standard)Hi,
I tried using the JMSRouter class from the 4.2.1 trunk now in my publishing service. Problem is, that JMSRouter has some dependencies that are now broken. I tried to also copy some of the referenced classes to my service, but I think this goes nowhere, because I only get more problems that way.
Problems in the JMSRouter class where:
- org.jboss.soa.esb.helpers.NamingContextException
- org.jboss.soa.esb.helpers.NamingContextPool
- super constructor of AbstractRouter with ConfigTree as argument
- org.apache.log4j.Logger, which I suppose I can just exchange with org.jboss.logging which I already have in the classpath
Is there any way I can get this to work, perhaps just putting some additional things in the classpath, or will I get even more problems that way?
Thanks
Andreas -
49. Re: Trouble with jms-topic
beve Mar 14, 2008 12:34 PM (in response to standard)I don't think updating more libs is the way to go.
If you replace the static member class JMSSendQueueSetup in JMSRouter with this one:private static class JMSSendQueueSetup { Session jmsSession; Destination jmsDestination; MessageProducer jmsProducer; String destinationName; JmsConnectionPool pool; Properties environment; private JMSSendQueueSetup(String queueName) throws NamingException, JMSException, ConnectionException { environment = new Properties(); environment.setProperty(Context.PROVIDER_URL, Configuration.getJndiServerURL()); environment.setProperty(Context.INITIAL_CONTEXT_FACTORY, Configuration.getJndiServerContextFactory()); environment.setProperty(Context.URL_PKG_PREFIXES, Configuration.getJndiServerPkgPrefix()); Context oCtx = NamingContext.getServerContext(environment); pool = JmsConnectionPoolContainer.getPool(environment, "ConnectionFactory", JMSEpr.QUEUE_TYPE); this.destinationName = queueName; try { jmsSession = pool.getQueueSession(); jmsDestination = (Destination) oCtx.lookup(destinationName); } catch (NamingException ne) { try { oCtx = NamingContext.getFreshServerContext(environment); jmsDestination = (Destination) oCtx.lookup(destinationName); } catch (NamingException nex) { //ActiveMQ jmsDestination = jmsSession.createQueue(destinationName); } } jmsProducer = jmsSession.createProducer(jmsDestination); } private void close() { try { if (jmsProducer!=null) jmsProducer.close(); pool.closeSession(jmsSession); } catch (Exception e) { logger.error("Unable to close JMS Queue Setup.", e); } } }
And also update the references to queueSetup.queueName to queueSetup.destinationName this should compile. I tried this with the following router action configuration:<action name="routeToReplyTopic" class="org.jboss.soa.esb.actions.routing.JMSRouter"> <property name="jndi-context-factory" value="org.jnp.interfaces.NamingContextFactory"/> <property name="jndi-URL" value="127.0.0.1:1099"/> <property name="jndi-pkg-prefix" value="org.jboss.naming:org.jnp.interfaces"/> <property name="connection-factory" value="ConnectionFactory"/> <property name="jndiName" value="topic/testTopic"/> <property name="unwrap" value="true"/> </action>
Let us know if this works for you.
Regards,
Daniel -
50. Re: Trouble with jms-topic
standard Mar 14, 2008 10:07 PM (in response to standard)Hi,
I changed the JMSRouter as you sayed, but still can't compile
We are still talking about the JMSRouter class taken from the 4.2.1 trunk, don't we?
I get following errors:
- I'm missing that super-constructor from AbstractRouter that takes a ConfigTree as argument
- missing method "getPayloadProxy" also from AbstractRouter I think
I tried to not extend AbstractRouter by directly extending AbstractActionPipelineProcessor and
integrating all the stuff from AbstractRouter into the JMSRouter (dunno if that could've ever worked out),
but then I'm missing at least MessagePayloadProxy plus some other stuff.
To the 4.2.1 side of the problem:
I used a test-app like u sayed, and could send messages on queues in the ESB from there,
using the exact same libs that are deployed in Tomcat with my client app.
I then tried sending a message back to the test-app, and receiving the message there,
(still same libs) and that worked too.
So I think this means either the deployment in Tomcat goes wrong (lib-order or something),
or the client itself messes things up, without giving notice.
Either way not much I can do, I guess.
But I'm still very open for suggestions on that one, too.
Regards
Andreas -
51. Re: Trouble with jms-topic
beve Mar 15, 2008 2:24 AM (in response to standard)
If you replace the static member class JMSSendQueueSetup in JMSRouter with this one
So, you have replaced the static nested class JMSSendQueueSetup in JMSRouter with that code, in a checked out version of 4.2GA?
Regards,
Daniel -
52. Re: Trouble with jms-topic
standard Mar 15, 2008 6:02 PM (in response to standard)Hi,
I did, but was still using the 4.2.1 version of the class.
I can compile now using the 4.2 one.
Although when I run this and try to send messages on the topic,
I get the following Exception:java.lang.NullPointerException at org.jboss.soa.esb.util.Util.deserialize(Util.java:216) at org.jboss.internal.soa.esb.couriers.JmsCourier.pickup(JmsCourier.java:360) at org.jboss.internal.soa.esb.couriers.TwoWayCourierImpl.pickup(TwoWayCourierImpl.java:223) at org.jboss.internal.soa.esb.couriers.TwoWayCourierImpl.pickup(TwoWayCourierImpl.java:205) at org.jboss.soa.esb.listeners.message.MessageAwareListener.waitForEventAndProcess(MessageAwareListener.java:268) at org.jboss.soa.esb.listeners.message.MessageAwareListener.doRun(MessageAwareListener.java:252) at org.jboss.soa.esb.listeners.lifecycle.AbstractThreadedManagedLifecycle.run(AbstractThreadedManagedLifecycle.java:115) at java.lang.Thread.run(Thread.java:619)
I did change the JmsCourier as you told me,
and rebuild the 4.2GA server from the repository,
and also tried it with the patched rosetta.jar, to be completely sure.
Do I have to pack messages to be send over that topic in any special way now?
The messages worked the way they are with the 4.2.1 setup,
and also with my queues.
Regards
Andreas -
53. Re: Trouble with jms-topic
beve Mar 17, 2008 5:20 AM (in response to standard)Hi Andreas,
It sounds like the unwrap property is set to "true" and in your case I think it should be "false":<action name="routeToReplyTopic" class="org.jboss.soa.esb.actions.routing.JMSRouter"> .... <property name="unwrap" value="false"/> </action>
* 'unwrap' true will extract the message payload from the ESB Message object before sending
* 'unwrap' false will send the serialized ESB Message object
I might have tricked you into setting it to 'true' when I posted the example.
This was because I was routing off the bus and I believe you are routing to another server. Sorry about that :(
Regards,
/Daniel -
54. Re: Trouble with jms-topic
standard Mar 17, 2008 7:24 AM (in response to standard)Hi,
thanks that did the trick!
Seems like it's working now.
I will test this some more,
and I still hope that I can get the new esb version to work some day,
but until then, I'm very glad I have a working setup.
Thanks ALLOT for all the help!
Regards
Andreas -
55. Re: Trouble with jms-topic
standard Mar 17, 2008 5:08 PM (in response to standard)Hi,
just out of interest:
I tried deploying JBM 1.3 in a esb-server 4.2.1.
I didn't get any errors or something,
but it didn't solve my problem at first try.
Is that even possible?
Can I deploy JBM1.3 in a 4.2.1 esb-server?
Thanks for the Info!
Regards
Andreas -
56. Re: Trouble with jms-topic
beve Mar 18, 2008 5:24 AM (in response to standard)Hi Andreas,
It might be possible as long as the correct versions of jboss-messaging and jboss remoting are inplace.
But I don't think this would be recommended.
You are "only" having trouble with one web application, is that correct? Could you tell us a little more about it. Is it perhaps scoped?
Thanks,
Daniel -
57. Re: Trouble with jms-topic
standard Mar 18, 2008 9:07 AM (in response to standard)Hi,
I tried deploying JBM 1.3 on a 4.2.1GA esb server now,
using the libs from a 4.2GA esb server (messaging & remoting),
and it seems to work (as long as I patch a fresh esb server).
My client can receive/send messages from/to the esb now,
but only if the client hasn't remoting deployed.
When I use the following libs, it works (might be some are not necessary):
- javassist.jar
- jbossall-client.jar
- jboss-aop-jdk50.jar
- jboss-messaging-client.jar (1.3 right now)
- log4j.jar
- trove.jar
But if you think its not recommended,
I give the new JBM another shot.
I try to get more Infos about that app,
and get back to you.
Just to help me with all that libs in the meantime:
Whats remoting for?
Do I need it with a client that only wants to send/receive JMS messages?
I kinda suspect the remoting lib to be the cause of my problems right now,
so I wanna rule things out.
Regards
Andreas
P.S: Yes its just one app, but its the one I have to get the ESB working with :-) -
58. Re: Trouble with jms-topic
beve Mar 18, 2008 9:21 AM (in response to standard)Hi,
you can get information about the required libs here:
http://labs.jboss.com/file-access/default/members/jbossmessaging/freezone/docs/userguide-1.3.0.GA/html_single/index.html#inst.remoteclient
This is just a link to the JBM documentation.
JBoss Messaging uses JBoss Remoting for all client to server communication.
Take a look at the messaging docs and remoting docs to find out more.
I think you are right and Kevin was thinking this aswell about remoting being the cause of this.
Did you check what Kevin mentioned about jbossall-client.jar might be infront of jboss-remoting.jar in the webapp. (remoting should come first that is).
Regards,
Daniel -
59. Re: Trouble with jms-topic
standard Mar 18, 2008 9:43 AM (in response to standard)Hi,
yea I read that.
I'm actually using jbossall-client.jar, and I read about remoting.jar having to precede that.
The thing is, my client app is deployed on a Tomcat server,
and I don't have that much ways (that I know of) to tell Tomcat about the order of the libs.
I read that when I put a lib into "Tomcat\common\endorsed\" its treated with higher priority, but thats about all I can do.
I can't really tell if it's working though.
Could it be that my setup right now is working, because the client uses the required classes in jbossall-client.jar, so it doesn't need remoting.jar?
I just wondered how it works right now, without the remoting lib.
The thing is, as soon as I use remoting on the client side, even with JBM 1.3,
the client cant get messages.
Regards
Andreas