quickstart helloworld client
rwiesemann Sep 30, 2007 7:39 AMHello,
i have attempt the esb sample quickstart->helloworld on a jboss environment JBaoss-AS-4.2.0. It works excellently.
Now, i want to refactor the sample 'SendEsbMessage' from the ant launcher to my own console-client like:
public class SendEsbMessage { public static void main(String args[]) throws Exception { // Setting the ConnectionFactory such that it will use scout System.setProperty( "javax.xml.registry.ConnectionFactoryClass" ,"org.apache.ws.scout.registry.ConnectionFactoryImpl"); Message esbMessage = MessageFactory.getInstance().getMessage(); esbMessage.getBody().setByteArray( "Hello - Straight to ESB listener - no Gateway".getBytes()); new ServiceInvoker("FirstServiceESB", "SimpleListener").deliverAsync(esbMessage); } }
It is exactly the 'quickstart->helloworld' sample.
To start the application, i have to provide all necesary libraries for a JBoss-Esb client sending esb messages.
The sample from the ant context use a very big class-path:
classpath refid="exec-classpath".
I have printed this content with
<pathconvert property="formatted-path" refid="exec-classpath" pathsep="${line.separator}" /> <echo message="path = ${formatted-path}" />
and found nearly all jars on server side.
Can you tell me, what is the necessary subset of jar files for this sample?
I have provide all this jar files to my sample and the configuration files:
- jbossesb-properties.xml
- jndi.properties
- juddi.properties
- log4j.xml
from the 'quickstart->helloworld' sample.
But the result is not the same as from 'quickstart->helloworld'.
The result is a exception:
12:43:38,757 ERROR [main][JAXRRegistryImpl] Could not set up a connection to the Registry. Invalid queryManagerURL: jnp://localhost:1099/InquiryService?org.apache.juddi.registry.rmi.Inquiry#inquire javax.xml.registry.InvalidRequestException: Invalid queryManagerURL: jnp://localhost:1099/InquiryService?org.apache.juddi.registry.rmi.Inquiry#inquire at org.apache.ws.scout.registry.ConnectionFactoryImpl.createConnection(ConnectionFactoryImpl.java:77) at org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl.getConnection(JAXRRegistryImpl.java:108) at org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl.findEPRs(JAXRRegistryImpl.java:314) at org.jboss.soa.esb.listeners.RegistryUtil.getEprs(RegistryUtil.java:216) at org.jboss.soa.esb.client.ServiceInvoker.loadServiceClusterInfo(ServiceInvoker.java:412) at org.jboss.soa.esb.client.ServiceInvoker.<init>(ServiceInvoker.java:117) at org.jboss.soa.esb.client.ServiceInvoker.<init>(ServiceInvoker.java:140) at labesb42.SendEsbMessage.main(SendEsbMessage.java:52) Caused by: java.net.MalformedURLException: unknown protocol: jnp at java.net.URL.<init>(URL.java:574) at java.net.URL.<init>(URL.java:464) at java.net.URL.<init>(URL.java:413) at org.apache.ws.scout.registry.ConnectionFactoryImpl.createConnection(ConnectionFactoryImpl.java:74) ... 7 more Exception in thread "main" java.lang.NullPointerException at org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl.findService(JAXRRegistryImpl.java:436)12:43:38,787 ERROR [main][JAXRRegistryImpl] Could not set up a connection to the Registry. Invalid queryManagerURL: jnp://localhost:1099/InquiryService?org.apache.juddi.registry.rmi.Inquiry#inquire javax.xml.registry.InvalidRequestException: Invalid queryManagerURL: jnp://localhost:1099/InquiryService?org.apache.juddi.registry.rmi.Inquiry#inquire at org.apache.ws.scout.registry.ConnectionFactoryImpl.createConnection(ConnectionFactoryImpl.java:77) at org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl.getConnection(JAXRRegistryImpl.java:108) at org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl.findService(JAXRRegistryImpl.java:433) at org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl.findEPRs(JAXRRegistryImpl.java:316) at org.jboss.soa.esb.listeners.RegistryUtil.getEprs(RegistryUtil.java:216) at org.jboss.soa.esb.client.ServiceInvoker.loadServiceClusterInfo(ServiceInvoker.java:412) at org.jboss.soa.esb.client.ServiceInvoker.<init>(ServiceInvoker.java:117) at org.jboss.soa.esb.client.ServiceInvoker.<init>(ServiceInvoker.java:140) at labesb42.SendEsbMessage.main(SendEsbMessage.java:52) Caused by: java.net.MalformedURLException: unknown protocol: jnp at java.net.URL.<init>(URL.java:574) at java.net.URL.<init>(URL.java:464) at java.net.URL.<init>(URL.java:413) at org.apache.ws.scout.registry.ConnectionFactoryImpl.createConnection(ConnectionFactoryImpl.java:74) ... 8 more at org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl.findEPRs(JAXRRegistryImpl.java:316) at org.jboss.soa.esb.listeners.RegistryUtil.getEprs(RegistryUtil.java:216) at org.jboss.soa.esb.client.ServiceInvoker.loadServiceClusterInfo(ServiceInvoker.java:412) at org.jboss.soa.esb.client.ServiceInvoker.<init>(ServiceInvoker.java:117) at org.jboss.soa.esb.client.ServiceInvoker.<init>(ServiceInvoker.java:140) at labesb42.SendEsbMessage.main(SendEsbMessage.java:52)
Can you tell me, what is the reason for this?
Thank you.