0

Hey I've made a project EAR with two modules. The first module is maven project which is responsible for communicate with DB and have entity classes (I used JPA). The sceond module is a dynamic Web project and for test i created a sample servlet which on doGet method persist hardcoded entity. If I don't add any code with persisting my entity (only creating and closing em and emf) all looks OK, i haven't got any errors, exceptions. But if i persist my entity in body of doGet. I get an exception:

SRVE0777E: Exception thrown by application class 'pl.almost.done.TestServlet.doGet:54'
java.lang.NoClassDefFoundError: pl/test/Person
at pl.almost.done.TestServlet.doGet(TestServlet.java:54)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
at [internal classes]

I tried modyfing class loading in my server.xml but there are no any changes. Maybe someone have an idea why Websphere runtime can't find my class?

  • What jars exist in the WEB-INF/lib of the built war? What does the maven dependency for the war look like? – Alasdair May 10 '16 at 23:59
  • A NoClassDefFoundError is different from ClassNotFoundException. A NoClassDefFoundError is caused when a class is available in compile time, but not available at runtime. So changing class loading won't help. Please check if you have exported all the necessary library in your dynamic web project. – Abelard Chow May 11 '16 at 02:27

0 Answers0