17/02/09 15:39
ingnuccio
Sto utilizzando un offuscatore per cercare di proteggere i file class, in rete ho visto che il più consigliato è proGuard. Dopo aver settato il tutto l'offuscatore mi tira fuori il file jar, però quando mando in esecuzione il programma va in errore. Dall'errore il problema è relativo al fatto che utilizzo RMI!
Nella guida su proGuard ho trovato la seguente:
Reportedly, the easiest way to handle RMI code is to process the code with ProGuard first and then invoke the rmic tool. If that is not possible, you may want to try something like this:
-keepattributes Exceptions
-keep interface * extends java.rmi.Remote {
<methods>;
}
-keep class * implements java.rmi.Remote {
<init>(java.rmi.activation.ActivationID, java.rmi.MarshalledObject);
}
The first -keep option keeps all your Remote interfaces and their methods. The second one keeps all the implementations, along with their particular RMI constructors, if any.
The Exceptions attribute has to be kept too, because the RMI handling code performs introspection to check whether the method signatures are compatible.
Ora io sto utilizzando la gui di proGuard, sono andato in Shrinking ed ho spuntato l'opzione:
RMI interfaces ed RMI implementantions aggiungendo le classi relative!! Ma ugualmente il programma va in errore!!!
Questo è l'errore:
17-feb-2009 16.25.26 server.grafica.ServerInitFrame <init>
GRAVE: null
java.rmi.server.ExportException: remote object implements illegal remote interface; nested exception is:
java.lang.IllegalArgumentException: illegal remote method encountered: public abstract boolean interfacce.IDatabase.connetti()
at sun.rmi.server.UnicastServerRef.exportObject(Unknown Source)
at java.rmi.server.UnicastRemoteObject.exportObject(Unknown Source)
at java.rmi.server.UnicastRemoteObject.exportObject(Unknown Source)
at java.rmi.server.UnicastRemoteObject.<init>(Unknown Source)
at java.rmi.server.UnicastRemoteObject.<init>(Unknown Source)
at server.dipacam.Database.<init>(Unknown Source)
at server.dipacam.c.<init>(Unknown Source)
at server.grafica.ServerInitFrame.<init>(Unknown Source)
at server.grafica.a.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.IllegalArgumentException: illegal remote method encountered: public abstract boolean interfacce.IDatabase.connetti()
at sun.rmi.server.Util.checkMethod(Unknown Source)
at sun.rmi.server.Util.getRemoteInterfaces(Unknown Source)
at sun.rmi.server.Util.getRemoteInterfaces(Unknown Source)
at sun.rmi.server.Util.createProxy(Unknown Source)
... 17 more
Uncaught error fetching image:
java.lang.NullPointerException
at sun.awt.image.URLImageSource.getConnection(Unknown Source)
at sun.awt.image.URLImageSource.getDecoder(Unknown Source)
at sun.awt.image.InputStreamImageSource.doFetch(Unknown Source)
at sun.awt.image.ImageFetcher.fetchloop(Unknown Source)
at sun.awt.image.ImageFetcher.run(Unknown Source)
Qualcuno ha qualche soluzione? Sicuramente sbaglio io in qualcosa perchè non ho mai utilizzato proGuard e questa è la prima volta!
Altrimenti mi potete proporre un offuscatore che magari già utilizzate?
Da premettere che nella mia applicazione utilizzo come tecnologie: RMI, HSQLDB come database, Jasper report per fare i report di stampa, e bouncycastel per la crittografia.
Grazie a chiunque possa darmi un aiuto
Grazie
Nella guida su proGuard ho trovato la seguente:
Reportedly, the easiest way to handle RMI code is to process the code with ProGuard first and then invoke the rmic tool. If that is not possible, you may want to try something like this:
-keepattributes Exceptions
-keep interface * extends java.rmi.Remote {
<methods>;
}
-keep class * implements java.rmi.Remote {
<init>(java.rmi.activation.ActivationID, java.rmi.MarshalledObject);
}
The first -keep option keeps all your Remote interfaces and their methods. The second one keeps all the implementations, along with their particular RMI constructors, if any.
The Exceptions attribute has to be kept too, because the RMI handling code performs introspection to check whether the method signatures are compatible.
Ora io sto utilizzando la gui di proGuard, sono andato in Shrinking ed ho spuntato l'opzione:
RMI interfaces ed RMI implementantions aggiungendo le classi relative!! Ma ugualmente il programma va in errore!!!
Questo è l'errore:
17-feb-2009 16.25.26 server.grafica.ServerInitFrame <init>
GRAVE: null
java.rmi.server.ExportException: remote object implements illegal remote interface; nested exception is:
java.lang.IllegalArgumentException: illegal remote method encountered: public abstract boolean interfacce.IDatabase.connetti()
at sun.rmi.server.UnicastServerRef.exportObject(Unknown Source)
at java.rmi.server.UnicastRemoteObject.exportObject(Unknown Source)
at java.rmi.server.UnicastRemoteObject.exportObject(Unknown Source)
at java.rmi.server.UnicastRemoteObject.<init>(Unknown Source)
at java.rmi.server.UnicastRemoteObject.<init>(Unknown Source)
at server.dipacam.Database.<init>(Unknown Source)
at server.dipacam.c.<init>(Unknown Source)
at server.grafica.ServerInitFrame.<init>(Unknown Source)
at server.grafica.a.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.IllegalArgumentException: illegal remote method encountered: public abstract boolean interfacce.IDatabase.connetti()
at sun.rmi.server.Util.checkMethod(Unknown Source)
at sun.rmi.server.Util.getRemoteInterfaces(Unknown Source)
at sun.rmi.server.Util.getRemoteInterfaces(Unknown Source)
at sun.rmi.server.Util.createProxy(Unknown Source)
... 17 more
Uncaught error fetching image:
java.lang.NullPointerException
at sun.awt.image.URLImageSource.getConnection(Unknown Source)
at sun.awt.image.URLImageSource.getDecoder(Unknown Source)
at sun.awt.image.InputStreamImageSource.doFetch(Unknown Source)
at sun.awt.image.ImageFetcher.fetchloop(Unknown Source)
at sun.awt.image.ImageFetcher.run(Unknown Source)
Qualcuno ha qualche soluzione? Sicuramente sbaglio io in qualcosa perchè non ho mai utilizzato proGuard e questa è la prima volta!
Altrimenti mi potete proporre un offuscatore che magari già utilizzate?
Da premettere che nella mia applicazione utilizzo come tecnologie: RMI, HSQLDB come database, Jasper report per fare i report di stampa, e bouncycastel per la crittografia.
Grazie a chiunque possa darmi un aiuto
Grazie
aaa