Guillaume Dufrene wrote:
Hi,

I have this problem when I try to call an External Service with SOAP.
A ClassCastException is thrown in a Proxy.
Here the client trace : (there's no error on catalina)

Exception in thread "main" java.lang.ClassCastException: org.apache.tuscany.sdo.impl.DynamicDataObjectImpl
   at $Proxy16.getOperations(Unknown Source)
   at bank.ClientImpl.run(ClientImpl.java:57)
   at bank.Main.main(Main.java:21)

And here the sources :

Main :
----------

   public static void main(String[] args) throws Exception {
       // Obtain Tuscany runtime
       TuscanyRuntime tuscany = new TuscanyRuntime("bank", null);

       // Start the runtime
       tuscany.start();

       // Obtain SCA module context.
       ModuleContext moduleContext = CurrentModuleContext.getContext();
             // Locate and Launch Client.
((Runnable) moduleContext.locateService("ClientComponent")).run(); // <--------- Line 21
       // Stop the runtime
       tuscany.stop();
   }

ClientImpl :
------------------

   static {
       SDOUtil.registerStaticTypes(BankFactory.class);
   }
     @Reference
   public AccountService as;

   public void run() {
       System.out.println("Client run call...");

       Iterator<Operation> it = null;
       try {
it = as.getOperations( "" ).getOperation().iterator(); // <--------- Line 57
       } catch (RemoteException e) {
           e.printStackTrace();
           return;
       }
       int i = 0;
       while (it.hasNext()) {
               i++;
               System.out.println(i+"/\t" + it.next());
       }
       if (i == 0) System.out.println("No withdraw on this account");
   }


Have you ever encounter this kind of problem ?
I have seen a JIRA (333) about ClassCastException but I don't know if it is
the same problem ...

Thanks,

--
Guillaume DufrĂȘne.

Hi Guillaume,

This could be related to TUSCANY-333, or maybe not :) Could you please create another JIRA and attach your test case to it with a brief description of any necessary steps to reproduce the problem, and one of us will take a look and will debug it. Thanks!

--
Jean-Sebastien

Reply via email to