rm5248 / java-rmi-example Goto Github PK
View Code? Open in Web Editor NEWA simple example of a Java-RMI setup using Maven
A simple example of a Java-RMI setup using Maven
In the README.md
: java.rmiserver.codebase
should be java.rmi.server.codebase
.
When I try to run the code I get the following error:
Error: Could not find or load main class com.rm5248.rmiserver.RMIServerMain
I built the project with: mvn clean install
Then I ran the code using:
java -Djava.rmi.server.useCodebaseOnly=false -Djava.rmi.server.codebase=file:/Java-RMI-Example/ com.rm5248.rmiserver.RMIServerMain
ANd I get the above error.
Please help
I compiled everything from the root using mvn package
, I ran compile
first, but then thought may be I need to package for the modules to work. Then i tried running it. I have rmiregistry
running like this
justin@justin-Precision-3520 14:16:42 ~/Repos/Java-RMI-Example/RMIServer
$ rmiregistry -J-Djava.rmi.server.useCodebaseOnly=false
But trying to run the Server fails like this saying can't find the Interface classes. I am using latest maven btw.
justin@justin-Precision-3520 14:13:58 ~/Repos/Java-RMI-Example/RMIServer/target/classes
$ pwd
/home/justin/Repos/Java-RMI-Example/RMIServer/target/classes
justin@justin-Precision-3520 14:15:15 ~/Repos/Java-RMI-Example/RMIServer/target/classes
$ java -Djava.rmi.server.useCodebaseOnly=false -Djava.rmi.server.codebase=file:/home/justin/Repos/Java-RMI-Example/RMIServer/target/classes/com/rm5248/rmiserver/ com.rm5248.rmiserver.RMIServerMain
Exception in thread "main" java.lang.NoClassDefFoundError: com/rm5248/rmiinterfaces/PrintingInterface
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)
at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at com.rm5248.rmiserver.RMIServerMain.main(RMIServerMain.java:28)
Caused by: java.lang.ClassNotFoundException: com.rm5248.rmiinterfaces.PrintingInterface
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 13 more
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.