Hello Stack Overflow...
I have been developing a (somewhat complex) application using RMI to read a file and JSON its contents. I have been coding this app on Netbeans 6.7, therefore I have a folder structure as follows:
Under C:\MyApp:
-build
--- classes
------- MyApp <--- That's a package. My .class files are in there. Also, I ran rmiregistry from here.
-dist
---lib
--------- [some .jar libraries]
-src
...
[Some files]
My application uses a library from the dist\libs folder, and it loads a single file for reading from the current directory, in the [Some files] section.
However, whenever I run the application using: (from the build\classes folder)
java -cp .;..\..\dist\lib\gson-1.4.jar;..\..\..\MyApp -Djava.security.policy=C:\java.policy MyApp.Main
I keep getting ClassNotFoundException errors and a list of errors regarding my RMI interface not being found. The one time it ran, it could not locate the file I need to read. (Got a NullPointerException in my app).
Would you people be able to tell me what I am doing wrong? I believe it's related to the classpath.
Also, if there was a way to run the RMI application from Netbeans itself, it'd be great, but I haven't been able to find any way to do this while searching around.
Oh, rmiregistry is running. And my policy file contains a simple, one-line grant All.
Please help! Thanks!