You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Parveen Fatima <fp...@yahoo.com> on 2011/04/28 05:38:56 UTC

cxfclient fails with a Clas CastException (weblogic )

Hi,
I am creating CXF client  and trying to configure the http timeout value on the services , but getting the  classCastException 
Here is what I am trying to do. 
How do I overwrite default classloader information ,so that i won't get classcast exception
 
  private static ABCDMapServer getService() { 
            try { 
               
     
                ClientProxyFactoryBean factory = new ClientProxyFactoryBean(); 
     
                factory.setServiceClass(ABCDMapServer.class); 
                factory.setServiceName(SERVICE); 
                factory.setAddress("http://a.b.c.d:port/arcgis/services/a_b_dots/MapServer"); 
                factory.setWsdlLocation(MAP_SERVER_URL.toString()); 
                ABCDMapServer client = 
                    //new ABCDMapServer ( MAP_SERVER_URL ); 
                    (ABCDMapServer ) factory.create(); 
                final Client cl = ClientProxy.getClient(client);               
                
                final HTTPConduit http = (HTTPConduit) cl.getConduit(); 
                //cl.getInInterceptors().add(new LoggingInInterceptor()); 
                //cl.getOutInterceptors().add(new LoggingOutInterceptor()); 
     
                final HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy(); 
     
                httpClientPolicy.setReceiveTimeout(TIME_OUT); 
                httpClientPolicy.setAllowChunking(false); 
                httpClientPolicy.setConnectionTimeout(TIME_OUT); 
     
                http.setClient(httpClientPolicy); 
     
                return client; 
            } catch (Exception e) { 
                e.printStackTrace();          
                return null; 
            } 
        } 

Thanks for your help.. 



Thanks, 
Parveen Fatima

Re: cxfclient fails with a Clas CastException (weblogic )

Posted by Daniel Kulp <dk...@apache.org>.
On Wednesday, April 27, 2011 11:38:56 PM Parveen Fatima wrote:
> Hi,
> I am creating CXF client  and trying to configure the http timeout value on
> the services , but getting the  classCastException Here is what I am
> trying to do.
> How do I overwrite default classloader information ,so that i won't get
> classcast exception 

What's the class and/or stack trace that is resulting in this exception?  


Did you also check the instructions at:
http://cxf.apache.org/docs/application-server-specific-configuration-guide.html#ApplicationServerSpecificConfigurationGuide-WebLogic



Dan


>   private static ABCDMapServer getService() {
>             try {
>               
>     
>                 ClientProxyFactoryBean factory = new
> ClientProxyFactoryBean(); 
>                 factory.setServiceClass(ABCDMapServer.class);
>                 factory.setServiceName(SERVICE);
>                
> factory.setAddress("http://a.b.c.d:port/arcgis/services/a_b_dots/MapServer
> "); factory.setWsdlLocation(MAP_SERVER_URL.toString()); ABCDMapServer
> client =
>                     //new ABCDMapServer ( MAP_SERVER_URL );
>                     (ABCDMapServer ) factory.create();
>                 final Client cl =
> ClientProxy.getClient(client);               
>                 final HTTPConduit http = (HTTPConduit) cl.getConduit();
>                 //cl.getInInterceptors().add(new LoggingInInterceptor());
>                 //cl.getOutInterceptors().add(new LoggingOutInterceptor());
>     
>                 final HTTPClientPolicy httpClientPolicy = new
> HTTPClientPolicy(); 
>                 httpClientPolicy.setReceiveTimeout(TIME_OUT);
>                 httpClientPolicy.setAllowChunking(false);
>                 httpClientPolicy.setConnectionTimeout(TIME_OUT);
>     
>                 http.setClient(httpClientPolicy);
>     
>                 return client;
>             } catch (Exception e) {
>                 e.printStackTrace();         
>                 return null;
>             }
>         }
> 
> Thanks for your help..
> 
> 
> 
> Thanks,
> Parveen Fatima

-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog
Talend - http://www.talend.com