RE: Class Cast Exception

<[email protected]> Wed, 28 Sep 2005 15:15:38 +0100
Newsgroups gmane.comp.java.jxta.user
Message-ID <4E28CEA517A795438B120F62D182A8C972A247@I2KM11-UKBR.domain1.systemhost.net>
Any news on the PipeAdvert Class Cast problem? 


Martin Roberts



-----Original Message-----
From: Mohamed Abdelaziz [mailto:[email protected]] 
Sent: 27 September 2005 17:51
To: [email protected]
Subject: Re: [JXTA user] Class Cast Exception

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(PipeAdvertisem
> en
> t.getAdvertisementType());
> 	        	
> myAdv.setPipeID(IDFactory.newPeerID(peerNet.getPeerGroupID()));
> myAdv.setName(From.getClass().getName());
> myAdv.setType(PipeService.UnicastType);
> discovery.publish(myAdv,DiscoveryService.ADV,PeerGroup.DEFAULT_LIFETIM
> E,
> PeerGroup.DEFAULT_EXPIRATION);
> discovery.remotePublish(myAdv,DiscoveryService.ADV,PeerGroup.DEFAULT_E
> XP
> 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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]