0 Replies Latest reply on Mar 16, 2012 1:04 PM by Rajnish Kumar

    org.apache.ws.scout.transport.TransportException: java.lang.IllegalArgumentException: object is not an instance of declaring class

    Rajnish Kumar Newbie

      Hi,

      I am trying to call a ESB service from a client. I get below error, any help would be appreciated.

       

      Client side code :-

       

      private void sendMessage() throws Exception{
        System.setProperty("javax.xml.registry.ConnectionFactoryClass",
                      "org.apache.ws.scout.registry.ConnectionFactoryImpl");
        ServiceInvoker invoker = new ServiceInvoker("JBOSSESBTest.FirstServiceESB","Simple Test Service");
        System.out.println("ServiceInvoker obtained: "+invoker);
        Message message = MessageFactory.getInstance().getMessage();

        message.getBody().add(" Hi there - Message from Transport Agnostic Service Client");
        invoker.deliverAsync(message);

      }

       

      Client side configuration :-

       

      <properties name="registry">

           <!-- property name="org.jboss.soa.esb.registry.queryManagerURI" value="org.apache.juddi.v3.client.transport.wrapper.UDDIInquiryService#inquire" /-->

           <property name="org.jboss.soa.esb.registry.queryManagerURI" value="jnp://localhost:1099/juddiv3/UDDIInquiryService?org.apache.juddi.v3.client.transport.wrapper.UDDIInquiryService#inquire" />

           <!-- property name="org.jboss.soa.esb.registry.lifeCycleManagerURI" value="org.apache.juddi.v3.client.transport.wrapper.UDDIPublicationService#publish" /-->

           <property name="org.jboss.soa.esb.registry.lifeCycleManagerURI" value="jnp://localhost:1099/PublishService?org.apache.juddi.registry.rmi.Publish#publish" />

           <!-- property name="org.jboss.soa.esb.registry.securityManagerURI" value="org.apache.juddi.v3.client.transport.wrapper.UDDISecurityService#secure" /-->

        <property name="org.jboss.soa.esb.registry.securityManagerURI" value="jnp://localhost:1099/SecurityService?org.apache.juddi.registry.rmi.Security#secure" />

           <property name="org.jboss.soa.esb.registry.implementationClass" value="org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl" />

           <property name="org.jboss.soa.esb.registry.factoryClass" value="org.apache.ws.scout.registry.ConnectionFactoryImpl" />

           <property name="org.jboss.soa.esb.registry.user" value="****" />

           <property name="org.jboss.soa.esb.registry.password" value="******" />

          

           <!-- property name="org.jboss.soa.esb.scout.proxy.transportClass" value="org.apache.ws.scout.transport.LocalTransport" /-->

           <property name="org.jboss.soa.esb.scout.proxy.transportClass" value="org.apache.ws.scout.transport.RMITransport" />

          

      <property name="org.jboss.soa.esb.scout.proxy.uddiVersion" value="3.0" />

      <property name="org.jboss.soa.esb.scout.proxy.uddiNameSpace" value="urn:uddi-org:api_v3" />

              <property name="org.jboss.soa.esb.registry.interceptors" value="org.jboss.internal.soa.esb.services.registry.InVMRegistryInterceptor, org.jboss.internal.soa.esb.services.registry.CachingRegistryInterceptor" />

              <property name="org.jboss.soa.esb.registry.cache.maxSize" value="100" />

              <property name="org.jboss.soa.esb.registry.orgCategory" value="org.jboss.soa.esb.:category" />

      </properties>

       

      Error :-

      Caused by: javax.xml.registry.JAXRException: org.apache.ws.scout.transport.TransportException: java.lang.IllegalArgumentException: object is not an instance of declaring class

      at org.apache.ws.scout.registry.BusinessQueryManagerV3Impl.findConcepts(BusinessQueryManagerV3Impl.java:535)

      at org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl.getJBossESBTModel(JAXRRegistryImpl.java:795)

      at org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl.findEPRs(JAXRRegistryImpl.java:327)

      ... 7 more

       

       

      If I change the above line as below then I get a diff error.

      <property name="org.jboss.soa.esb.registry.queryManagerURI" value="jnp://localhost:1099/juddiv3/UDDIInquiryService?org.apache.juddi.rmi.UDDIInquiryService#inquire" />

       

      Error changes to :-

      Caused by: javax.xml.registry.JAXRException: org.apache.ws.scout.transport.TransportException: java.lang.NoSuchMethodException: org.apache.juddi.rmi.UDDIInquiryService.inquire(org.w3c.dom.Element)

      at org.apache.ws.scout.registry.BusinessQueryManagerV3Impl.findConcepts(BusinessQueryManagerV3Impl.java:535)

      at org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl.getJBossESBTModel(JAXRRegistryImpl.java:795)

      at org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl.findEPRs(JAXRRegistryImpl.java:327)

      ... 7 more

       

      Same service works when called from the same server instance from a jsp. JSP code snippet as below :-

      <%

          try {
            ServiceInvoker invoker = new ServiceInvoker("JBOSSESBTest.FirstServiceESB","Simple Test Service");
         Message message = MessageFactory.getInstance().getMessage();

         message.getBody().add(" Hi there - Message from Transport Agnostic Service Client");
         invoker.deliverAsync(message);
              } catch (Exception e) {
              out.println("Caught Exception: " + e);
          }
      %>

       

       

      Any thoughts from JBOSS ESB Gurus what could be wrong... Please dont suggest me to use WS to call the service, I want to try the RMI before trying for WS.