New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Entity object is invalid #885
Comments
Please share your entity and -Karthik |
|
If module with entities is in the classpath of module 2, Kundera should be able to pick the classes. Try adding classes to the
-Karthik |
Lets discuss more on Gitter? -Karthik |
Thank you for your response. Adding classes to the persistence.xml file won't help unfortunately. I want to avoid adding classes manually to the pesistence.xml file. This seems feasible for few classes, but if the number of classes increases then all needs to be defined in the persistence.xml file. The other solution is to define the jar file in the persistence.xml file. It works fine, but as said earlier, I want my module 2 to be independent of the module 1 so ideally I don't want to make any changes in the module 2. |
I have two different modules in my project. Module 1 contains client side code (Servlet) and the module 2 contains the business logic and uses Kundera platform. I want my module 2 to be application independent so I can use module 2 to persist data of any application (module 1) without making changes in module 2.
Therefore, all the entities are defined in module 1 and Kundera code (persistence.xml) is defined in module 2. I am using module 2 jars in module 1 to call methods of module 2 e.g., Persist. When I call Persist method of Kundera, I am getting an exception
com.impetus.kundera.KunderaException: java.lang.IllegalArgumentException: Entity object is invalid, operation failed. Please check previous log message for details
at com.impetus.kundera.persistence.EntityManagerImpl.persist(EntityManagerImpl.java:180)
at com.leuven.distrinet.persist.data.access.service.DataAccessService.store(DataAccessService.java:59)
at com.leuven.distrinet.persist.data.management.services.DataManagementService.persist(DataManagementService.java:53)
at com.leuven.distrinet.lmaas.controller.LogDataStorage.doGet(LogDataStorage.java:46)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:528)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1100)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:687)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1520)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1476)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
I know that Kundera (in module 2) couldn't find the entities as they are defined in module 1. I don't want to move all entities to module 2 as it doesn't make sense + I want module 2 to be applicaiton independent. How can I solve this problem so that my module 2 is independent of module 1?
The text was updated successfully, but these errors were encountered: