Announcement Announcement Module
Collapse
No announcement yet.
JMSMessaging - getObject() Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • JMSMessaging - getObject()

    I use jboss4.2.2GA and messaging 1.3.0GA with spring 2.0


    I send message :

    Code:
    public void sendMessage(final MyMessage s) {
    		
    		jmsTemplate.convertAndSend(s);
    }
    where is MyMessage is simple POJO, also it is an external jar file included in both applications.

    and on the other side I have web application for listening :
    Code:
    public void onMessage(Message m) {
    		try {
    			if (m instanceof ObjectMessage) {
    //           MyMessage myMsg = new MyMessage(); // this works fine
                                    ObjectMessage om = (ObjectMessage) m;
    				MyMessage mm = (MyMessage) om.getObject();
                       } catch(Exception e) {
    			e.printStackTrace();
    		   }
    }
    but it doesn't work properly, i get error :


    ERROR [STDERR] java.lang.RuntimeException: No ClassLoaders found for: com.message.MyMessage
    ....

    whats wrong here?!

  • #2
    Is the class for MyMessage in the classpath for the web application that is receiving the JMS message?

    Comment


    • #3
      class path is empty, and MyMessage is deployed in the same dir where are other jars.

      but if i declare variable myMsg without rest of code in method onMessage() it works fine and there is no error...according to that web application knows where is MyMessage class/jar.

      Comment


      • #4
        Make sure that it is only once on the classpath, I suspect some classloader issues here.

        Comment


        • #5
          I make both applications as web application and everything works fine, but there is a question (didn't try it with classpath, i will try it but i don't have much time now) is there any way to do this if message dispatcher is not a web application?

          Comment

          Working...
          X