Précédent   Forum du club des développeurs et IT Pro > Java > Serveurs, conteneurs, et Java EE > Autres
Autres Vos questions sur les autres serveurs d'application Java.
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse
 
Outils de la discussion
Publicité
'
Vieux 19/03/2012, 15h28   #1
sam14
Invité de passage
 
Homme
Développeur Java
Inscription : février 2012
Messages : 27
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : France, Calvados (Basse Normandie)

Informations professionnelles :
Activité : Développeur Java
Secteur : High Tech - Éditeur de logiciels

Informations forums :
Inscription : février 2012
Messages : 27
Points : 4
Points : 4
Par défaut java.rmi.server.ExportException quipeu m'aider?

Bonjour j'ai créer une apllication qui lit et decortique un fichier texte, je veu mettre cette application sur serveur rmi, mais quand je lance mon programme j'ai le message d'erreur suivant:

Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
java.rmi.server.ExportException: remote object implements illegal remote interface; nested exception is: 
	java.lang.IllegalArgumentException: illegal remote method encountered: public abstract java.util.Vector Interface.vDetect()
	at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:181)
	at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:293)
	at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:235)
	at java.rmi.server.UnicastRemoteObject.<init>(UnicastRemoteObject.java:133)
	at java.rmi.server.UnicastRemoteObject.<init>(UnicastRemoteObject.java:119)
	at Serveur.<init>(Serveur.java:18)
	at Serveur.main(Serveur.java:30)
Caused by: java.lang.IllegalArgumentException: illegal remote method encountered: public abstract java.util.Vector Interface.vDetect()
	at sun.rmi.server.Util.checkMethod(Util.java:244)
	at sun.rmi.server.Util.getRemoteInterfaces(Util.java:223)
	at sun.rmi.server.Util.getRemoteInterfaces(Util.java:193)
	at sun.rmi.server.Util.createProxy(Util.java:126)
	at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:179)
	... 6 more
Exception in thread "main" java.lang.NullPointerException: cannot bind to null
	at java.rmi.Naming.rebind(Naming.java:158)
	at Serveur.main(Serveur.java:39)
voici le code de mon serveur:

Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
public class Serveur extends UnicastRemoteObject implements Interface {
 
	public Serveur() throws RemoteException {
		try {
 
			LocateRegistry.createRegistry(1099);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
 
	public static void main(String[] args){
		Serveur serv = null;
		try {
			serv = new Serveur();
		} catch (RemoteException e1) {
			e1.printStackTrace();
		}
		try {
			/**
			 * publication du service
			 * */
			try {
				Naming.rebind("rmi://localhost:1099/Client", serv);
			} catch (RemoteException e) {
				e.printStackTrace();
			}
 
		} catch (MalformedURLException e) {
			e.printStackTrace();
		}
 
	}
 
	@Override
	public Vector<Detecteur> vDetect() {
 
		Vector<Detecteur> vDetect = new Vector<Detecteur>();
 
		String ligne;
		String fichier = "test.txt";
 
		// lecture du fichier
		try {
			InputStream ips = new FileInputStream(fichier);
			InputStreamReader ipsr = new InputStreamReader(ips);
			BufferedReader br = new BufferedReader(ipsr);
                        ...
Est ce que quelqu'un peut m'aider? merci
sam14 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 19/03/2012, 15h49   #2
tchize_
Expert Confirmé Sénior
 
Avatar de tchize_
 
Homme
Responsable de service informatique
Inscription : avril 2007
Messages : 18 278
Détails du profil
Informations personnelles :
Sexe : Homme
Âge : 33
Localisation : Belgique

Informations professionnelles :
Activité : Responsable de service informatique
Secteur : Service public

Informations forums :
Inscription : avril 2007
Messages : 18 278
Points : 32 754
Points : 32 754
Envoyer un message via MSN à tchize_ Envoyer un message via Skype™ à tchize_
en RMI, toutes les méthodes de ton interface doivent être déclarées "throws RemoteException", c'est bien le cas?
__________________
⥀⥁ Чиз faq java, cours java, javadoc. Pensez à et
Laisse entrer le jour après une nuit sombre. Si tu es toujours là, tu n'es pas faite pour mourir.
tchize_ est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 19/03/2012, 15h52   #3
sam14
Invité de passage
 
Homme
Développeur Java
Inscription : février 2012
Messages : 27
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : France, Calvados (Basse Normandie)

Informations professionnelles :
Activité : Développeur Java
Secteur : High Tech - Éditeur de logiciels

Informations forums :
Inscription : février 2012
Messages : 27
Points : 4
Points : 4
Non Je l'avais oublier merci
sam14 est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Cette discussion est résolue.
Outils de la discussion

Navigation rapide


Fuseau horaire GMT +2. Il est actuellement 00h11.


 
 
 
 
Partenaires

Hébergement Web