Hi,
mein Server
will nicht starten.
Ich bekomm folgende Fehlermeldung:
[jonas@TuxM ds]$ java classroombookingfactory.ClassroomBookingServer -Djava.security.policy=/home/jonas/Documents/Studium/Irland/ds/classroombookingfactory/policy
Error: access denied (java.net.SocketPermission 127.0.0.1:1099 connect,resolve)
java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:1099 connect,resolve)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkConnect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(Unknown Source)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown Source)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)
at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
at sun.rmi.server.UnicastRef.newCall(Unknown Source)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at java.rmi.Naming.lookup(Unknown Source)
at classroombookingfactory.ClassroomBookingServer.main(ClassroomBookingServer.java:17)
Bei folgender Policy File:
[jonas@TuxM ds]$ more classroombookingfactory/policy
grant {
permission java.security.AllPermission;
};
Jemand ne Agnung wo der Fahler verstekct liegt?
VlG Jonas
mein Server
Code:
package classroombookingfactory;
import java.rmi.*;
import java.rmi.activation.*;
import java.util.Properties;
public class ClassroomBookingServer {
public static void main( String argv[ ] ) {
System.setSecurityManager( new RMISecurityManager() );
try {
Properties props = new Properties();
// props.put("java.security.policy","file:/home/jonas/Documents/Studium/Irland/ds/classroombookingfactory");
props.put("java.security.policy","file:/home/jonas/Documents/Studium/Irland/ds/classroombookingfactory/java.security.policy");
ActivationGroupDesc.CommandEnvironment ace = null;
ActivationGroupDesc group = new ActivationGroupDesc(props,ace);
// ActivationSystem system = (ActivationSystem) Naming.lookup("//:1099/java.rmi.activation.ActivationSystem");
ActivationGroupID agid = ActivationGroup.getSystem().registerGroup(group);
String src = "file:/home/jonas/Documents/Studium/Irland/ds/classroombookingfactory";
MarshalledObject data = null;
ActivationDesc desc = new ActivationDesc(agid,"classroombookingfactory.ClassroomBookingFactoryImpl",src,data);
ClassroomBookingFactory stub = (ClassroomBookingFactory)Activatable.register(desc);
System.out.println("Got the stub");
Naming.rebind("ActivatableClassroomBooking",stub);
System.out.println("Exported Activation");
} catch ( Exception e ) {
System.out.println( "Error: " + e.getMessage() );
e.printStackTrace();
}
}
}
will nicht starten.
Ich bekomm folgende Fehlermeldung:
[jonas@TuxM ds]$ java classroombookingfactory.ClassroomBookingServer -Djava.security.policy=/home/jonas/Documents/Studium/Irland/ds/classroombookingfactory/policy
Error: access denied (java.net.SocketPermission 127.0.0.1:1099 connect,resolve)
java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:1099 connect,resolve)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkConnect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(Unknown Source)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown Source)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)
at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
at sun.rmi.server.UnicastRef.newCall(Unknown Source)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at java.rmi.Naming.lookup(Unknown Source)
at classroombookingfactory.ClassroomBookingServer.main(ClassroomBookingServer.java:17)
Bei folgender Policy File:
[jonas@TuxM ds]$ more classroombookingfactory/policy
grant {
permission java.security.AllPermission;
};
Jemand ne Agnung wo der Fahler verstekct liegt?
VlG Jonas