1 Reply Latest reply on Mar 8, 2002 4:55 PM by 3004

    Problem with JMS AQ in Oracle 8i

    b39sako
      Hi Everyone
      I found an exception when I tried to publish the message which shown below. The connection is already established bit it's exception at publisher.publish(topic, obj_message);
      Could anyone please help me sort it out?
      The exception is:

      java.lang.NullPointerException at oracle.jms.AQjmsTextMessage.populateTextMessageContainer(AQjmsTextMessage.java:179)

      My code is:

      public void publish(javax.jms.TopicSession jms_session, javax.jms.TextMessage obj_message) {
      javax.jms.TopicPublisher publisher;
      javax.jms.Topic topic;
      try{
           /* get a handle to the booked_orders topic */
           System.out.println("Get Topic");
           topic = ((oracle.jms.AQjmsSession) jms_session).getTopic("WWW","THINK_QUEUE");
           System.out.println("Finished");
           publisher = jms_session.createPublisher(topic);
           System.out.println("CreatePublisher");
           publisher.publish(topic, obj_message);

           
           System.out.println("Finished");
           jms_session.commit();
      }
      catch (javax.jms.JMSException ex)
      {
           System.out.println("Exception: " + ex);
      }

           
      }



      Many Thanks,

        • 1. re:Problem with JMS AQ in Oracle 8i
          3004

          Hi,
          Are you sure the text message is populated. Add the following before the publish
          obj_message.setText("abc");

          Hi Everyone
          I found an exception when I tried to publish the message which shown below. The connection is already established bit it's exception at publisher.publish(topic, obj_message);
          Could anyone please help me sort it out?
          The exception is:
          java.lang.NullPointerException at oracle.jms.AQjmsTextMessage.populateTextMessageContainer(AQjmsTextMessage.java:179)
          My code is:
          public void publish(javax.jms.TopicSession jms_session, javax.jms.TextMessage obj_message) {
          javax.jms.TopicPublisher publisher;
          javax.jms.Topic topic;
          try{
               /* get a handle to the booked_orders topic */
               System.out.println("Get Topic");
               topic = ((oracle.jms.AQjmsSession) jms_session).getTopic("WWW","THINK_QUEUE");
               System.out.println("Finished");
               publisher = jms_session.createPublisher(topic);
               System.out.println("CreatePublisher");
               publisher.publish(topic, obj_message);
               
               System.out.println("Finished");
               jms_session.commit();
          }
          catch (javax.jms.JMSException ex)
          {
               System.out.println("Exception: " + ex);
          }
               
          }
          Many Thanks,