I wrote an simple project using java rmi and exported to an executable jar file. When I tries to run it, sometimes i got exceptions and sometimes it works. When I specify -Djava.rmi.server.codebase=file:serverClasses/, it seems it didn't create the jar file correctly.
Here is the stacktrace:
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: com.ServerBootstrap.IServer
at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:413)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:267)
at sun.rmi.transport.Transport$1.run(Transport.java:177)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:173)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:553)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:808)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:667)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:636)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:273)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:251)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:377)
at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
at java.rmi.Naming.rebind(Naming.java:177)
at com.v3q6.eece411.A2.ServerBootstrap.ChatRoomServer.main(ChatRoomServer.java:37)
Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: com.ServerBootstrap.IServer
at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:403)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:267)
at sun.rmi.transport.Transport$1.run(Transport.java:177)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:173)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:553)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:808)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:667)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:636)
Caused by: java.lang.ClassNotFoundException: com.ServerBootstrap.IServer
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:336)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at sun.rmi.server.LoaderHandler.loadProxyInterfaces(LoaderHandler.java:728)
at sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:672)
at sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:609)
at java.rmi.server.RMIClassLoader$2.loadProxyClass(RMIClassLoader.java:646)
at java.rmi.server.RMIClassLoader.loadProxyClass(RMIClassLoader.java:311)
at sun.rmi.server.MarshalInputStream.resolveProxyClass(MarshalInputStream.java:255)
at java.io.ObjectInputStream.readProxyDesc(ObjectInputStream.java:1548)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1510)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1749)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1346)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:368)
... 12 more
It seems the program doesn't recognize the codebase. In my case, all the files are local. Does anyone know what is the problem? thanks
Try explicitly specifying the name of the JAR file containing the com.ServerBootstrap.IServer class in your codebase, e.g.
-Djava.rmi.server.codebase=file:serverClasses/myjarfile.jar
The "Dynamic code downloading using JavaTM RMI (Using the java.rmi.server.codebase Property)" doc provides more information on the use of codebase and the options for its specification.
With a relative path specified for java.rmi.server.codebase, make sure that you are in the correct directory (the parent directory of "serverClasses") when starting the client. If that's hard to ensure, an absolute path for the codebase might be more reliable.
Also, remember that when running with the -jar option, the -classpath option is completely ignored. I don't think that's a problem here; the RMIClassLoader should still be able to work using the server's codebase setting. But if you are relying on the client having access to additional classes specified on the classpath, that won't work. You'll need to use the Class-path attribute in the main JAR file's manifest.
That's not a complete stacktrace, and I think you may have left out the part that shows the root cause of your problem.
If I recall correctly, ClassNotFoundException can sometimes be due to an exception thrown during static initialization of the class that is being loaded, or some class that it depends on. If this occurs, it will show up as a nested exception in the first stacktrace for the problem, at the next level of nesting. I recall (maybe incorrectly) that if your application repeats the attempted class load, the initialization exception is not in the resulting stacktrace.
EDIT: The complete stacktrace says that my theory is not correct.
Related
I am recently moved to ESAPi-2.5.0.0 so that blackduck doesnt complain about log4j. However i am getting the below error.
org.owasp.esapi.errors.ConfigurationException: java.lang.reflect.InvocationTargetException Encoder class (org.owasp.esapi.reference.DefaultEncoder) CTOR threw exception.
at org.owasp.esapi.util.ObjFactory.make(ObjFactory.java:129)
at org.owasp.esapi.ESAPI.encoder(ESAPI.java:101)
at
Caused by:
java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor104.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.owasp.esapi.util.ObjFactory.make(ObjFactory.java:86)
... 5 more
Caused by:
org.owasp.esapi.errors.ConfigurationException: java.lang.ClassNotFoundException: org.owasp.esapi.reference.Log4JLogFactory LogFactory class (org.owasp.esapi.reference.Log4JLogFactory) must be in class path.
at org.owasp.esapi.util.ObjFactory.make(ObjFactory.java:108)
at org.owasp.esapi.ESAPI.logFactory(ESAPI.java:139)
at org.owasp.esapi.ESAPI.getLogger(ESAPI.java:155)
Below are my ESAPI.prperties:
ESAPI.AccessControl=org.owasp.esapi.reference.DefaultAccessController
FileBasedAuthenticator requires users.txt file in .esapi directory
ESAPI.Authenticator=org.owasp.esapi.reference.FileBasedAuthenticator
ESAPI.Encoder=org.owasp.esapi.reference.DefaultEncoder
ESAPI.Encryptor=org.owasp.esapi.reference.crypto.JavaEncryptor
ESAPI.Executor=org.owasp.esapi.reference.DefaultExecutor
ESAPI.HTTPUtilities=org.owasp.esapi.reference.DefaultHTTPUtilities
ESAPI.IntrusionDetector=org.owasp.esapi.reference.DefaultIntrusionDetector
Log4JFactory Requires log4j.xml or log4j.properties in classpath - ``http://www.laliluna.de/log4j-tutorial.html
ESAPI.Logger=org.owasp.esapi.reference.JavaLogFactory
ESAPI.Randomizer=org.owasp.esapi.reference.DefaultRandomizer
ESAPI.Validator=org.owasp.esapi.reference.DefaultValidator
any help would be highly appreciated.
Tried Upgrading to ESAPI-2.5.0.0.
If I had to make a guess, it looks as though your ESAPI.properties file has the ESAPI.Logger property still set to org.owasp.esapi.reference.Log4JLogFactory. Log4J support was removed from ESAPI in release 2.5.0.0 so that class was removed with it. (It had been deprecated for just over 2 years before we removed it.) And that class had been renamed to org.owasp.esapi.logging.log4j.Log4JLogFactory at least as far back as 2.3.0.0.
But since you noted that you had set it to ESAPI.Logger to use JUL, it seems likely that you are not picking up the ESAPI.properties file that you think you are picking up because the last 'caused by' in the exception stack trace clearly shows org.owasp.esapi.reference.Log4JLogFactory as what is giving the ClassNotFoundError. (Or else you are using that class somewhere in your code.)
I couldn't find jar for
oracle.wsm.common.config.WsmConfig
I'm getting exception when running OBIEE webservice
Caused by: java.lang.NoClassDefFoundError: oracle/wsm/common/config/WsmConfig
at oracle.wsm.config.ConfigurationProcessor.populateConfigurationFromPapConfigFile(ConfigurationProcessor.java:536)
at oracle.wsm.config.ConfigurationProcessor.processConfiguration(ConfigurationProcessor.java:729)
at oracle.wsm.config.ConfigurationManager.resetAccessors(ConfigurationManager.java:1902)
at oracle.wsm.config.ConfigurationManager$2.run(ConfigurationManager.java:1862)
at oracle.wsm.config.ConfigurationManager$2.run(ConfigurationManager.java:1860)
at java.security.AccessController.doPrivileged(Native Method)
at oracle.wsm.config.ConfigurationManager.reset(ConfigurationManager.java:1859)
at oracle.wsm.config.ConfigurationManager.getRepositoryAccessor(ConfigurationManager.java:1512)
at oracle.wsm.policyaccess.impl.PolicyAccessorImpl$1.run(PolicyAccessorImpl.java:164)
at oracle.wsm.policyaccess.impl.PolicyAccessorImpl$1.run(PolicyAccessorImpl.java:162)
at java.security.AccessController.doPrivileged(Native Method)
at oracle.wsm.policyaccess.impl.PolicyAccessorImpl.<init>(PolicyAccessorImpl.java:160)
at oracle.integration.platform.common.mgmt.PolicyCacheImpl.<init>(PolicyCacheImpl.java:354)
at oracle.integration.platform.common.mgmt.PolicyCacheImpl.getInstance(PolicyCacheImpl.java:81)
at oracle.j2ee.ws.client.jaxws.DispatchImpl.getPolicySet(DispatchImpl.java:470)
at oracle.j2ee.ws.client.jaxws.DispatchImpl.getPolicySet(DispatchImpl.java:457)
at oracle.j2ee.ws.client.jaxws.OracleDispatchImpl.getPolicySet(OracleDispatchImpl.java:178)
at oracle.j2ee.ws.rm.util.RMUtils.getClientConfigurationInfo(RMUtils.java:144)
Anyone help me to find the jar file for above class?
oracle/oracle_common/webservices/wsclient_extended.jar matches
oracle/oracle_common/modules/oracle.webservices_11.1.1/oracle.webservices.standalone.client.jar matches
oracle/oracle_common/modules/oracle.wsm.common_11.1.1/wsm-policy-core.jar matches
Are the jars I see containing the class, from wherever your jdev is installed. Which version of jdev you are using as the class is not required in newwer jdev i guess.
I am running a test case using java & fitnesse...
while Clicking on the "Test" button from below image,
It showing error as follows:
Standard Error:
Exception in thread "main" java.lang.NoClassDefFoundError: ":build/classes://////var/www/git/vodaware/java/Build:/root/leadout-tests///////var/www/git/vodaware/java/supportLibs/mockito-all-1/9/5/jar:/root/leadout-tests///////var/www/git/vodaware/java/supportLibs/jsp-api/jar:/root/leadout-tests///////var/www/git/vodaware/java/supportLibs/testng-6/8/7/jar:/root/leadout-tests///////var/www/git/vodaware/java/supportLibs/servlet-api/jar:/root/leadout-tests///////var/www/git/vodaware/java/supportLibs/jcip-annotations-1/0/jar
Caused by: java.lang.ClassNotFoundException: ":build.classes:......var.www.git.vodaware.java.Build:.root.leadout-tests.......var.www.git.vodaware.java.supportLibs.mockito-all-1.9.5.jar:.root.leadout-tests.......var.www.git.vodaware.java.supportLibs.jsp-api.jar:.root.leadout-tests.......var.www.git.vodaware.java.supportLibs.testng-6.8.7.jar:.root.leadout-tests.......var.www.git.vodaware.java.supportLibs.servlet-api.jar:.root.leadout-tests.......var.www.git.vodaware.java.supportLibs.jcip-annotations-1.0.jar
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
Could not find the main class: ":build/classes:../../var/www/git/vodaware.java/Build:/root/leadout-tests/../../var/www/git/vodaware.java/supportLibs/mockito-all-1.9.5.jar:/root/leadout-tests/../../var/www/git/vodaware.java/supportLibs/jsp-api.jar:/root/leadout-tests/../../var/www/git/vodaware.java/supportLibs/testng-6.8.7.jar:/root/leadout-tests/../../var/www/git/vodaware.java/supportLibs/servlet-api.jar:/root/leadout-tests/../../var/www/git/vodaware.java/supportLibs/jcip-annotations-1.0.jar. Program will exit.
What is the cause of this logs? Please anyone help me.
As the error says, the program is not able to find the java class. You need to make sure the
class path is set properly and also make sure the package location is set properly.
Ex:
classpath: foo/bar/
package: jane/doe.class
See to it that you mention the package hierarchy properly while setting it in the fitnesse column.
Hope this helps.
I have a big problem according to the bluecove library which I am trying to use in an ANT project.
My project is a platform which receive messages from different agents, such as TCP agents, SunSpot agents (which use UDP), and now I'm trying to set bluetooth agents.
For this purpose is required the bluecove library, but result in conflict with javax.microedition.io used for example in the UDP classes that I'm implementing.
I guess that it's a library conflict, I have tried to put the bluecove-2.1.1 jar into the jdk1.6_xx/jre/lib/ext but this throws an exception in the UDP classes:
Error checking for shared basestation: javax.microedition.io.ConnectionNotFoundException: radiogram
javax.microedition.io.ConnectionNotFoundException: udp
javax.microedition.io.ConnectionNotFoundException: udp
at com.intel.bluetooth.MicroeditionConnector.openImpl(MicroeditionConnector.java:185)
at com.intel.bluetooth.MicroeditionConnector.open(MicroeditionConnector.java:162)
at javax.microedition.io.Connector.open(Connector.java:83)
at org.sunspotworld.SunSpotListener.run(SunSpotListener.java:48)
However if I remove from the content of bluecove2.1.1 jar the folder javax/microedition the error thrown is completely different:
Exception in thread "main" java.lang.NoClassDefFoundError: javax/microedition/io/Connection
Exception in thread "main" java.lang.NoClassDefFoundError: javax/microedition/io/Connection
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at com.intel.bluetooth.Utils.class$(Utils.java:44)
at com.intel.bluetooth.Utils.<clinit>(Utils.java:44)
at javax.bluetooth.UUID.<init>(UUID.java:224)
at org.sunspotworld.BTListener.<clinit>(BTListener.java:28)
at org.sunspotworld.SunSpotHostApplication.run(SunSpotHostApplication.java:67)
at org.sunspotworld.SunSpotHostApplication.main(SunSpotHostApplication.java:342)
Caused by: java.lang.ClassNotFoundException: javax.microedition.io.Connection
Caused by: java.lang.ClassNotFoundException: javax.microedition.io.Connection
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:229)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 8 more
... 8 more
I have read some solution involving xbootclasspath/a but I have no any idea what is that o how I can manage it...
Edit: I have used Xboothclasspath/a and /p to add the bluecove jar route, and the only thing I got was the chance to remove the jar import from my NetBeans project. Still not working. =(
Thank you very much in advance !!
I don't know why you decided this error is caused by a conflict between the two libs as i don't see any mention to this in the error.
The second error (after removing the lib) simply states that it can't find the required classes (which is logical since you removed them :) ).
I'd suggest you check that the firewall is not blocking you.
I'm working on Java RMI application, and having problem binding a server to the registry. I'm working on eclipse using rmi plugin, and everything worked fine before I had to format my pc. Also, I'm sure the code is ok since it's the one given to me as a solution, so there must be something wrong with my configuration.
Here's the code:
public static void main (String[] args){
try{
RMIChatServer myObject = new RMIChatServerImpl();
System.setSecurityManager(new RMISecurityManager());
Naming.rebind("Hello", myObject);
System.out.println("Remote object bound to registry");
}
catch( Exception e){
System.out.println("Failed to register object " + e);
e.printStackTrace();
System.exit(1);
}
}
Exceptions it gives:
Failed to register object java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: access to class loader denied
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: access to class loader denied
at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:419)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:267)
at sun.rmi.transport.Transport$1.run(Transport.java:177)
at sun.rmi.transport.Transport$1.run(Transport.java:174)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:173)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:553)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:808)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:667)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:273)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:251)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:377)
at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
at java.rmi.Naming.rebind(Naming.java:177)
at RMIChatServerImpl.main(RMIChatServerImpl.java:175)
Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: access to class loader denied
at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:409)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:267)
at sun.rmi.transport.Transport$1.run(Transport.java:177)
at sun.rmi.transport.Transport$1.run(Transport.java:174)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:173)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:553)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:808)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:667)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.ClassNotFoundException: access to class loader denied
at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:447)
at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:184)
at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:637)
at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:264)
at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:216)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1593)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1514)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1750)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1347)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:369)
... 13 more
Caused by: java.security.AccessControlException: access denied ("java.io.FilePermission" "\D:\uni\YEAR 3\Enterprise Programming\java\czat solution 2\bin\-" "read")
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:366)
at java.security.AccessController.checkPermission(AccessController.java:555)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
at sun.rmi.server.LoaderHandler$Loader.checkPermissions(LoaderHandler.java:1176)
at sun.rmi.server.LoaderHandler$Loader.access$000(LoaderHandler.java:1130)
at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:411)
... 22 more
I researched the problem and most say that it's because of codebase settings (I also use security policy), I have tried different settings, and currently using 'compute from classpath' option provided by rmi plugin, which worked before, but fails now :( Please advice!
FWIW
I upgraded from JDK1.6.0_33 to 1.7.0_21 and had the same problem. I found this document and resolved the problem by starting rmiregistry with:
rmiregistry -J-Djava.rmi.server.useCodebaseOnly=false
So, quick summary of the problem and the solution:
If you're running on JDK 7.1/ 6.29 (possible some other version) RMI server will not bind if you set its codebase to the file or directory on your hard disk. The same code works just fine under older version of JDK (tested on 6.24).
Thanks for your help!
The underlying problem here is that the RMI Registry is running under a SecurityManager and its .policy file doesn't grant java.io.FilePermission" "\D:\uni\YEAR 3\Enterprise Programming\java\czat solution 2\bin\-" "read".
The clue to that is that this is a ServerException, i.e. thrown at the target of the call, and that the call itself is rebind().
See this post for an explanation.
Yes this problem occurs in Java 1.7 and above. So always go through the enhancements document if you upgrade your Java version. It is a fairly simple solution. You just need to start the rmiregistry in a different way.
Go through this document- http://docs.oracle.com/javase/7/docs/technotes/guides/rmi/enhancements-7.html
Have you tried to explicitly give access to the file using the *.policy file?
as described on
http://docs.oracle.com/javase/7/docs/technotes/guides/security/permissions.html
grant codebase "file:/path/to/code" {
permission java.io.FilePermission "\D:\uni\YEAR 3\Enterprise Programming\java\czat solution 2\bin\-", "read";
}
I have the same issue with openjdk... probably caused by this commit:
http://hg.openjdk.java.net/jdk7u/jdk7u-gate/jdk/rev/7ed2fd310470