Problem with client calling esb
adorandish Feb 20, 2009 7:50 PMI downloaded the JBoss ESB Server (already bundled with JBoss App Server) version 4.4
I started the application server and everything loaded properly and with no error. The I deployed the "webservice_consumer1" example and it deployed successfully.
I ran the test using ant and it worked perfectly fine.
Then I copied the code content of SendEsbMessage.java from "org.jboss.soa.esb.samples.quickstart.webservice_consumer1.test.SendEsbMessage" to my standalone a java code. Here is the code:
package com.cayenta.services; import org.jboss.soa.esb.message.Message; import org.jboss.soa.esb.message.format.MessageFactory; import org.jboss.soa.esb.message.format.MessageType; import org.jboss.soa.esb.client.ServiceInvoker; public class SendEsbMessage { public void sendMessage(String message) throws Exception { // Create the delivery adapter for the target service (cache it) System.setProperty("javax.xml.registry.ConnectionFactoryClass", "org.apache.ws.scout.registry.ConnectionFactoryImpl"); // Create the delivery adapter for the target service (cache it) ServiceInvoker deliveryAdapter = new ServiceInvoker("MyServiceCategory", "WebserviceConsumer1"); // Create and populate the request message... Message requestMessage = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML); requestMessage.getBody().add(message); // Deliver the request message synchronously - timeout after 20 // seconds... deliveryAdapter.deliverAsync(requestMessage); } public static void main(String args[]) throws Exception { SendEsbMessage sm = new SendEsbMessage(); sm.sendMessage("hello"); } }
The classpath is pointing to [JBOSS_HOME]\lib\* and the jboss esb libraries in the .sar and .esb folder in the deploy folder.
When I execute it I get the following error:
Exception in thread "main" org.jboss.soa.esb.listeners.message.MessageDeliverException: Invocation exception. null at org.jboss.soa.esb.client.ServiceInvoker.loadServiceClusterInfo(ServiceInvoker.java:446) at org.jboss.soa.esb.client.ServiceInvoker.<init>(ServiceInvoker.java:157) at org.jboss.soa.esb.client.ServiceInvoker.<init>(ServiceInvoker.java:138) at org.jboss.soa.esb.client.ServiceInvoker.<init>(ServiceInvoker.java:180) at com.cayenta.services.SendEsbMessage.sendMessage(SendEsbMessage.java:80) at com.cayenta.services.SendEsbMessage.main(SendEsbMessage.java:114) Caused by: org.jboss.soa.esb.services.registry.RegistryException: Invocation exception. null at org.jboss.soa.esb.services.registry.RegistryFactory.createRegistry(RegistryFactory.java:121) at org.jboss.soa.esb.services.registry.RegistryFactory.getRegistry(RegistryFactory.java:86) at org.jboss.soa.esb.listeners.RegistryUtil.getEprs(RegistryUtil.java:220) at org.jboss.soa.esb.client.ServiceInvoker.loadServiceClusterInfo(ServiceInvoker.java:433) ... 5 more Caused by: java.lang.NullPointerException at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:242) at org.jboss.soa.esb.util.ClassUtil.forName(ClassUtil.java:65) at org.jboss.soa.esb.services.registry.RegistryFactory.createRegistry(RegistryFactory.java:110) ... 8 more
* My environment is MacOS X (latest one)
* My IDE is Eclipse with JBoss tools installed on it
what am I doing wrong?