ppkarwasz commented on pull request #16:
URL: 
https://github.com/apache/tomcat-jakartaee-migration/pull/16#issuecomment-806658340


   > I still don't understand the setup.
   > Since both Tomcat and the app do not provide the extra API jars how this 
application works/worked on Tomcat 9.x ?
   
   The app **provides** JPA 2.x API jars, but when I configure the 
application's classloader to transform using `jakartaConverter="TOMCAT"` the 
following happens:
   
   1. The application loads a JPA entity class,
   2. The `ClassFileTransformer` changes all `javax.persistence.*` annotations 
into `jakarta.persistence.*` annotations,
   3. The classloader fails to load the `jakarta.persistence.*` classes.
   
   I argue that `javax.persistence.*` and others (EJB, JAX-WS) should be 
removed from the `TOMCAT` profile. The only part of Tomcat's code, where there 
is a reference to JPA is the `InstanceManager`: whenever Tomcat instantiates a 
servlet class, it autowires the fields annotated with `@PersistenceContext`, 
etc. However this only works if there is a JPA implementation in Tomcat's 
_server_ classloader, i.e. we are deploying on TomEE  (`EE` profile) or unusual 
Tomcat + JPA installation.
   
   The remaining two APIs I removed from the `TOMCAT` profile (Java Mail and 
JTA) are, as far as I can see, only referenced in JNDI, so that applications 
can configure a mail `Session` or `UserTransaction` in their application 
context (if they ship with an implementation). For these applications I believe 
the `EE` profile is more appropriate.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to