title: not able to invoke messge bean from restful webservice
body: <p>I am trying to create Restful Webservice as a client of Message Driven Bean, But when i invoke the restful method its giving me following error when </p>
  
  <pre><code>Connection connection =  connectionFactory.createConnection();
  
  SEVERE: The RuntimeException could not be mapped to a response, re-throwing to the HTTP container
  java.lang.NullPointerException
          at com.quant.ws.GetConnection.startThread(GetConnection.java:99)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
  </code></pre>
  
  <p>here is the following code:</p>
  
  <pre><code>// Inside class declaration
  @Resource(mappedName = "jms/testFactory")
  private static ConnectionFactory connectionFactory;
  
  @Resource(mappedName = "jms/test")
  private static Queue queue;
  </code></pre>
  
  <p>Web services Method</p>
  
  <pre><code>@GET
  @Path("startThread")
  @Produces("application/xml")
  public String startThread()
  {
  
      try{
      Connection connection =  connectionFactory.createConnection(); // its line number 99
      Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
      MessageProducer producer = session.createProducer( queue);
      Message message = session.createTextMessage();
      message.setStringProperty("name", "start");
      producer.send(message);
      }catch(JMSException e){
          System.out.println(e);
      }
     return "&lt;data&gt;START&lt;/data&gt;";
  }
  </code></pre>
  
  <p>Do i need to specify anything in sun-web.xml or web.xml ?</p>