Hi,
I’m facing issue webmethod JMS configuration. I’m new to JMS.
I have follow the steps provided in “Installing Sofware AG’s Universal Messaging Resource Adapter on JBOSS EAP 6.1” guide. (Guide is in attachment).
Then I tried to connect and read the messages. Below is the code.
import javax.ejb.ActivationConfigProperty;
import javax.ejb.MessageDriven;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.TextMessage;
import org.jboss.ejb3.annotation.ResourceAdapter;
@MessageDriven(activationConfig = {
@ActivationConfigProperty(propertyName = “destinationType”, propertyValue = “javax.jms.Queue”),
@ActivationConfigProperty(propertyName = “jndiParameters”, propertyValue = “java.naming.factory.initial=com.pcbsys.nirvana.nSpace.NirvanaContextFactory,java.naming.provider.url=nsp://PROVIDER_HOST:PROVIDER_PORT”),
@ActivationConfigProperty(propertyName = “destination”, propertyValue = “PROVIDER_QUEUE_NAME”),
@ActivationConfigProperty(propertyName = “connectionFactory”, propertyValue = “PROVIDER_CONNECTION_FACTORY”)
})
@ResourceAdapter(“umra.rar”)
public class FetchMessages implements MessageListener {
@Override
public void onMessage(Message message) {
// TODO Auto-generated method stub
try {
System.out.println("Listner Message :******** Start ----- " );
// Lifecycle.beginCall();
TextMessage textMsg = (TextMessage) message;
System.out.println("Listner Message :********" + textMsg.getText());
// Lifecycle.endCall();
} catch (JMSException e) {
// TODO Auto-generated catch block
e.printStackTrace();
throw new RuntimeException(e.getMessage());
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
throw new RuntimeException(e.getMessage());
}
}
}
I’m getting below error on server statup:
17:38:19,148 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool – 56) MSC000001: Failed to start service jboss.deployment.subunit.“admin-ear.ear”.“admin-ejb.jar”.component.FetchMessages.START: org.jboss.msc.service.StartException in service jboss.deployment.subunit.“admin-ear.ear”.“admin-ejb.jar”.component.FetchMessages.START: java.lang.NullPointerException
at org.jboss.as.ee.component.ComponentStartService$1.run(ComponentStartService.java:57) [jboss-as-ee-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [rt.jar:1.8.0_72]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_72]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_72]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_72]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_72]
at org.jboss.threads.JBossThread.run(JBossThread.java:122)
Caused by: java.lang.NullPointerException
at com.sun.genericra.inbound.AbstractConsumer.initializeAdministeredObjects(AbstractConsumer.java:75)
at com.sun.genericra.inbound.AbstractConsumer.(AbstractConsumer.java:63)
at com.sun.genericra.inbound.sync.SyncConsumer.(SyncConsumer.java:45)
at com.sun.genericra.inbound.EndpointConsumerFactory.createEndpointConsumer(EndpointConsumerFactory.java:47)
at com.sun.genericra.GenericJMSRA.endpointActivation(GenericJMSRA.java:215)
at org.jboss.jca.core.rar.EndpointImpl.activate(EndpointImpl.java:191)
at org.jboss.as.ejb3.component.messagedriven.MessageDrivenComponent.activate(MessageDrivenComponent.java:204)
at org.jboss.as.ejb3.component.messagedriven.MessageDrivenComponent.start(MessageDrivenComponent.java:178)
at org.jboss.as.ee.component.ComponentStartService$1.run(ComponentStartService.java:54) [jboss-as-ee-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]
… 6 more
Please let me know if I’m missing some configuration.
JBoss-UM-ResourceAdapter.pdf (2.71 MB)