Salve a todos..
Per un esame all'università devo sviluppare un'applicazione java client-server per la distribuzione di contenuti (una specie di bitTorrent insomma)...
Dopo aver quasi completamente realizzato il progetto con Eclipse come abiente di sviluppo, dovendo realizzare anche una semplice interfaccia grafica all'applicazione mi sono installato NetBeans 6.5.1 che possiede di suo il GUI Builder.
Nonostante prima funzionasse tutto quanto, adesso durante la registrazione iniziale del client al server (questo è il codice):
codice:
public class RMIClient {
private static CallbackClientInterface stub = null;
private static CallbackServerInterface callbackServer = null;
private static Registry registry;
public static void register (String serverIP) {
try {
registry = LocateRegistry.getRegistry(serverIP);
callbackServer = (CallbackServerInterface) registry.lookup("CallbackServer");
CallbackClientImpl callbackClient = new CallbackClientImpl();
stub = (CallbackClientInterface) UnicastRemoteObject.exportObject(callbackClient, 0);
/*Registrazione presso il server*/
callbackServer.registerMe(stub);
} catch (Exception e) { e.printStackTrace(); }
}
Mi viene sollevata la seguente eccezione, alla riga dove effettuo la registry.lookup:
java.lang.ClassCastException: $Proxy0 cannot be cast to GUI.CallbackServerInterface
at GUI.RMIClient.register(RMIClient.java:23)
at GUI.BitCreekPeerGUI.ConnectedActionPerformed(BitCr eekPeerGUI.java:140)
at GUI.BitCreekPeerGUI.access$100(BitCreekPeerGUI.jav a:19)
at GUI.BitCreekPeerGUI$2.actionPerformed(BitCreekPeer GUI.java:76)
at javax.swing.AbstractButton.fireActionPerformed(Unk nown Source)
at javax.swing.AbstractButton$Handler.actionPerformed (Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed (Unknown Source)
at javax.swing.JToggleButton$ToggleButtonModel.setPre ssed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseRe leased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent( Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(U nknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unkno wn Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilter s(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(U nknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarch y(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Non sono riuscito a trovare niente sul web.. qualcuno sa e può darmi una mano?? Grazie in anticipo..