1 Reply Latest reply on Jun 25, 2008 7:39 PM by gopikrishna krishna

    Error using ServiceInvoker

    Seema Gupta Newbie

      Hi Friends,

      I'm trying to access message through ServiceInvoker. Please find below the code I have in a java class.

       try{
       ServiceInvoker invoker = new ServiceInvoker("myCategory", "myFileListener");
       Message message = MessageFactory.getInstance().getMessage();
       } catch(MessageDeliverException mde){}
      


      I'm calling this java from the ant target - runtest.

      There is no compilation error. however, at runtime getting following error:



      
       [java] 14:18:48,140 ERROR [main][JAXRConnectionFactory] Could not set up a connection to the Registry. Failed to create instance of: nu
      ll
       [java] javax.xml.registry.JAXRException: Failed to create instance of: null
       [java] at javax.xml.registry.ConnectionFactory.newInstance(ConnectionFactory.java:75)
       [java] at org.jboss.internal.soa.esb.services.registry.JAXRConnectionFactory.getConnection(JAXRConnectionFactory.java:102)
       [java] at org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl.findEPRs(JAXRRegistryImpl.java:305)
       [java] at org.jboss.soa.esb.listeners.RegistryUtil.getEprs(RegistryUtil.java:226)
       [java] at org.jboss.soa.esb.client.ServiceInvoker.loadServiceClusterInfo(ServiceInvoker.java:428)
       [java] at org.jboss.soa.esb.client.ServiceInvoker.<init>(ServiceInvoker.java:155)
       [java] at org.jboss.soa.esb.client.ServiceInvoker.<init>(ServiceInvoker.java:136)
       [java] at org.jboss.soa.esb.client.ServiceInvoker.<init>(ServiceInvoker.java:178)
       [java] at org.jboss.soa.esb.autodesk.ftpaction.test.CreateTestFile.main(CreateTestFile.java:44)
       [java] Caused by: java.lang.NullPointerException
       [java] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:261)
       [java] at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
       [java] at javax.xml.registry.ConnectionFactory.newInstance(ConnectionFactory.java:70)
       [java] ... 8 more
       [java] 14:18:48,156 ERROR [main][JAXRConnectionFactory] Could not set up a connection to the Registry. Failed to create instance of: nu
      ll
       [java] Exception in thread "main" java.lang.NullPointerException
       [java] javax.xml.registry.JAXRException: Failed to create instance of: null
       [java] at org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl.findService(JAXRRegistryImpl.java:461)
       [java] at javax.xml.registry.ConnectionFactory.newInstance(ConnectionFactory.java:75)
       [java] at org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl.findEPRs(JAXRRegistryImpl.java:307)
       [java] at org.jboss.internal.soa.esb.services.registry.JAXRConnectionFactory.getConnection(JAXRConnectionFactory.java:102)
       [java] at org.jboss.soa.esb.listeners.RegistryUtil.getEprs(RegistryUtil.java:226)
       [java] at org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl.findService(JAXRRegistryImpl.java:458)
       [java] at org.jboss.soa.esb.client.ServiceInvoker.loadServiceClusterInfo(ServiceInvoker.java:428)
       [java] at org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl.findEPRs(JAXRRegistryImpl.java:307)
       [java] at org.jboss.soa.esb.client.ServiceInvoker.<init>(ServiceInvoker.java:155)
       [java] at org.jboss.soa.esb.listeners.RegistryUtil.getEprs(RegistryUtil.java:226)
       [java] at org.jboss.soa.esb.client.ServiceInvoker.<init>(ServiceInvoker.java:136)
       [java] at org.jboss.soa.esb.client.ServiceInvoker.loadServiceClusterInfo(ServiceInvoker.java:428)
       [java] at org.jboss.soa.esb.client.ServiceInvoker.<init>(ServiceInvoker.java:178)
       [java] at org.jboss.soa.esb.client.ServiceInvoker.<init>(ServiceInvoker.java:155)
       [java] at org.jboss.soa.esb.autodesk.ftpaction.test.CreateTestFile.main(CreateTestFile.java:44)
       [java] at org.jboss.soa.esb.client.ServiceInvoker.<init>(ServiceInvoker.java:136)
       [java] at org.jboss.soa.esb.client.ServiceInvoker.<init>(ServiceInvoker.java:178)
       [java] at org.jboss.soa.esb.autodesk.ftpaction.test.CreateTestFile.main(CreateTestFile.java:44)
       [java] Caused by: java.lang.NullPointerException
       [java] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:261)
       [java] at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
       [java] at javax.xml.registry.ConnectionFactory.newInstance(ConnectionFactory.java:70)
       [java] ... 9 more
      
      BUILD FAILED
      


      Can somebody pinpoint my problem/mistake?

      Is there a sample code that I can refer to in order to use ServiceInvoker and Service Registry? Do I need to write a code to register my endpoints?

      Appreciate your help.
      Thanks.