tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lazar Kirchev (JIRA)" <j...@apache.org>
Subject [jira] [Created] (TOMEE-2058) Problem with persistence in application specifying a context path through sun-web.xml
Date Fri, 09 Jun 2017 12:16:18 GMT
Lazar Kirchev created TOMEE-2058:
------------------------------------

             Summary: Problem with persistence in application specifying a context path through
sun-web.xml
                 Key: TOMEE-2058
                 URL: https://issues.apache.org/jira/browse/TOMEE-2058
             Project: TomEE
          Issue Type: Bug
          Components: TomEE Core Server
    Affects Versions: 7.0.3
            Reporter: Lazar Kirchev


I am deploying a very simple application with JPA on TomEE Plume. 
The application uses a sun-web.xml to specify an alternative context root. It defines one
entity (Person) and in a servlet creates an instance of this entity and tries to persist it.

If the application is requested through the context root specified in sun-web.xml (http://localhost:8080/Test/TestServlet),
the persisting fails with the following exception:

{code}
java.lang.IllegalArgumentException: Object: my.test.entity.Person@1 is not a known Entity
type.
	at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.registerNewObjectForPersist(UnitOfWorkImpl.java:4226)
	at org.eclipse.persistence.internal.jpa.EntityManagerImpl.persist(EntityManagerImpl.java:507)
	at org.apache.openejb.persistence.JtaEntityManager.persist(JtaEntityManager.java:193)
	at my.test.TestServlet.doGet(TestServlet.java:28)
	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:230)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
	at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:44)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:474)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
	at org.apache.tomee.catalina.OpenEJBSecurityListener$RequestCapturer.invoke(OpenEJBSecurityListener.java:97)
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:624)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:783)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:798)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1434)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	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:807)
{code}

On the other hand, if the application is requested through the context path, defined by the
war name (http://localhost:8080/TestPersistence/TestServlet), the entity is successfully persisted.

You can reproduce the problem with the [ application | https://github.com/lkirchev/Misc ].
For the Data Source resource definition you could use:

{code}
<Resource id="myDS" type="DataSource">
    JdbcDriver org.hsqldb.jdbcDriver
    JdbcUrl jdbc:hsqldb:file:hsqldb
    UserName sa
    Password
</Resource>
{code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message