Guillaume,
I don't know exactly what the problem is, but as a general rule whenever
you see ClassCastException on an instance of DynamicDataObjectImpl it
means that the generated SDO class isn't registered/available. SDO is
"smart" and if there's no generated class for a particular type it uses a
dynamic SDO implementation class for it. This is the right behavior if
there really is no generated class, but if clients expect one, you
generally get this kind of ClassCastException.
Frank.
Guillaume Dufrene <[EMAIL PROTECTED]> wrote on 05/10/2006 10:55:30
AM:
> 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.
>