简体   繁体   中英

Exception in thread "main" java.lang.NoClassDefFoundError: si.gov.fu.InvoiceRequest - how to resolve?

I get this error when I try to run my code, project builds normally, also I get no errors while compiling and packaging everything into .jar file. I am using Intellij software.

eveything stops when I try to call this line:

JAXBContext jaxbContext = JAXBContext.newInstance(InvoiceRequest.class);

I have imported the: import si.gov.fu.*; import si.gov.fu.InvoiceRequest;

But at first, when I tried to import second library, I had the InvoiceRequest crossed, like I cannot use it, even though it has been compiled and packed up like it should.

Any clue?

Best regards

You are getting a runtime error. Guess your program was compiled and linked successfully, but the InvoiceRequest is not available at runtime, that is it is changed since compilation.

InvoiceRequest is in the classpath, otherwise you would have got a ClassNotFoundException, the NoClassDefFoundError is a runtime error.

So recompile and deploy again with the dependencies in proper order.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM