You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "Iyengar, Kumar" <ku...@bmc.com> on 2010/10/05 01:45:05 UTC

class cast exception when creating ServiceClient

Hi all,

I had this code working with Axis2 1.3.x but recently I moved to 1.5.1 and I get an error. The line is:

ServiceClient Client = new ServiceClient();

The error I get is:

org.apache.axis2.transport.tcp.TCPTransportSender cannot be cast to org.apache.axis2.transport.TransportSender.

Any help is appreciated.

Thanks,

--kumar

RE: class cast exception when creating ServiceClient

Posted by "Iyengar, Kumar" <ku...@bmc.com>.
Hi Glen,

I don't have any client configuration file defined (is this the axis2.xml file or some other file?). That is what is confusing me. Is the default in Axis2 1.5.1 TCP instead of HTTP? 

Thanks for your help,

--kumar

-----Original Message-----
From: Glen Daniels [mailto:glen@thoughtcraft.com] 
Sent: Tuesday, October 05, 2010 9:25 AM
To: java-user@axis.apache.org
Subject: Re: class cast exception when creating ServiceClient

Hi Kumar,

Are you in fact using the TCP transport?  If not, you want to remove it from
your client configuration file (that is where the transport senders are
defined).  If so, it seems you have an incompatible version - you probably
have an old version on your classpath somewhere.  Probably a good idea to
find and remove that anyway. :)

--Glen

On 10/5/2010 12:04 PM, Iyengar, Kumar wrote:
> Hi Deepal,
> 
>  
> 
> I have upgraded to Axis 1.5.1 but I am not able to figure out how to resolve
> this error. Why am I getting a class cast exception? Should I be using a
> different type of client in Axis2 1.5.1? I have checked the documentation and
> they all indicate that what I am doing is correct.
> 
>  
> 
> Thanks,
> 
>  
> 
> --kumar
> 
>  
> 
> -----------------------------------------------------------------------------
> 
> *From:* Deepal jayasinghe [mailto:deepalk@gmail.com]
> *Sent:* Monday, October 04, 2010 5:17 PM
> *To:* java-user@axis.apache.org
> *Subject:* Re: class cast exception when creating ServiceClient
> 
>  
> 
> That is correct, we have done a lot of code re-factoring after 1.3 release.
> So I suggest you to upgrade to new version.
> 
> Deepal
> 
> Hi all,
> 
>  
> 
> I had this code working with Axis2 1.3.x but recently I moved to 1.5.1 and I
> get an error. The line is:
> 
>  
> 
> ServiceClient Client = new ServiceClient();
> 
>  
> 
> The error I get is:
> 
>  
> 
> org.apache.axis2.transport.tcp.TCPTransportSender cannot be cast to
> org.apache.axis2.transport.TransportSender.
> 
>  
> 
> Any help is appreciated.
> 
>  
> 
> Thanks,
> 
>  
> 
> --kumar
> 
>  
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Re: class cast exception when creating ServiceClient

Posted by Glen Daniels <gl...@thoughtcraft.com>.
Hi Kumar,

Are you in fact using the TCP transport?  If not, you want to remove it from
your client configuration file (that is where the transport senders are
defined).  If so, it seems you have an incompatible version - you probably
have an old version on your classpath somewhere.  Probably a good idea to
find and remove that anyway. :)

--Glen

On 10/5/2010 12:04 PM, Iyengar, Kumar wrote:
> Hi Deepal,
> 
>  
> 
> I have upgraded to Axis 1.5.1 but I am not able to figure out how to resolve
> this error. Why am I getting a class cast exception? Should I be using a
> different type of client in Axis2 1.5.1? I have checked the documentation and
> they all indicate that what I am doing is correct.
> 
>  
> 
> Thanks,
> 
>  
> 
> --kumar
> 
>  
> 
> -----------------------------------------------------------------------------
> 
> *From:* Deepal jayasinghe [mailto:deepalk@gmail.com]
> *Sent:* Monday, October 04, 2010 5:17 PM
> *To:* java-user@axis.apache.org
> *Subject:* Re: class cast exception when creating ServiceClient
> 
>  
> 
> That is correct, we have done a lot of code re-factoring after 1.3 release.
> So I suggest you to upgrade to new version.
> 
> Deepal
> 
> Hi all,
> 
>  
> 
> I had this code working with Axis2 1.3.x but recently I moved to 1.5.1 and I
> get an error. The line is:
> 
>  
> 
> ServiceClient Client = new ServiceClient();
> 
>  
> 
> The error I get is:
> 
>  
> 
> org.apache.axis2.transport.tcp.TCPTransportSender cannot be cast to
> org.apache.axis2.transport.TransportSender.
> 
>  
> 
> Any help is appreciated.
> 
>  
> 
> Thanks,
> 
>  
> 
> --kumar
> 
>  
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


RE: class cast exception when creating ServiceClient

Posted by "Iyengar, Kumar" <ku...@bmc.com>.
Hi Deepal,

I have upgraded to Axis 1.5.1 but I am not able to figure out how to resolve this error. Why am I getting a class cast exception? Should I be using a different type of client in Axis2 1.5.1? I have checked the documentation and they all indicate that what I am doing is correct.

Thanks,

--kumar

________________________________
From: Deepal jayasinghe [mailto:deepalk@gmail.com]
Sent: Monday, October 04, 2010 5:17 PM
To: java-user@axis.apache.org
Subject: Re: class cast exception when creating ServiceClient

That is correct, we have done a lot of code re-factoring after 1.3 release. So I suggest you to upgrade to new version.

Deepal

Hi all,

I had this code working with Axis2 1.3.x but recently I moved to 1.5.1 and I get an error. The line is:

ServiceClient Client = new ServiceClient();

The error I get is:

org.apache.axis2.transport.tcp.TCPTransportSender cannot be cast to org.apache.axis2.transport.TransportSender.

Any help is appreciated.

Thanks,

--kumar


Re: class cast exception when creating ServiceClient

Posted by Deepal jayasinghe <de...@gmail.com>.
 That is correct, we have done a lot of code re-factoring after 1.3
release. So I suggest you to upgrade to new version.

Deepal
>
> Hi all,
>
>  
>
> I had this code working with Axis2 1.3.x but recently I moved to 1.5.1
> and I get an error. The line is:
>
>  
>
> ServiceClient Client = new ServiceClient();
>
>  
>
> The error I get is:
>
>  
>
> org.apache.axis2.transport.tcp.TCPTransportSender cannot be cast to
> org.apache.axis2.transport.TransportSender.
>
>  
>
> Any help is appreciated.
>
>  
>
> Thanks,
>
>  
>
> --kumar
>