Re: Class Cast Exception

Mohamed Abdelaziz <[email protected]> Tue, 27 Sep 2005 09:51:06 -0700
Newsgroups gmane.comp.java.jxta.user
Message-ID <[email protected]>
Can provide the exception stack trace?

Mohamed



[email protected] wrote:
> I am getting a class cast exception generated when I create attempt to
> create an Output Pipe.
>
> The problem seems to be the actuall Advert I pass through to it.  If I
> use the advert from the PipeExample.adv file the thing works fine.  But
> if I use the following:
>
> myAdv =
> (PipeAdvertisementAdvertisementFactory.newAdvertisement(PipeAdvertisemen
> t.getAdvertisementType());
> 	        	
> myAdv.setPipeID(IDFactory.newPeerID(peerNet.getPeerGroupID()));
> myAdv.setName(From.getClass().getName());
> myAdv.setType(PipeService.UnicastType);
> discovery.publish(myAdv,DiscoveryService.ADV,PeerGroup.DEFAULT_LIFETIME,
> PeerGroup.DEFAULT_EXPIRATION);
> discovery.remotePublish(myAdv,DiscoveryService.ADV,PeerGroup.DEFAULT_EXP
> IRATION);
>
> I get the exception.  It comes from inside the CreateOutputPipe call.  I
> have printed out both Adverts and they appear in XML form to be the
> same.  So I am completely puzzled as the type of myAdv is the same in
> both cases.
>
>
> Martin Roberts
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>   


-- 
http://blogs.sun.com/roller/page/hamada
http://weblogs.java.net/blog/hamada