ANY23-419 Add J2EE dependencies such that service runs under JDK11 #132
Conversation
@lewismc FYI, I believe that some of these dependencies are already pulled in by Tika. Running
leaving (I believe) the only library not already pulled in by Tika to be the Out of curiosity though, where are these libraries actually used by the service? Are they required by jetty? |
The issue I was having was when running it in Tomcat. From what I could tell Tomcat does not ship with these libraries either so they need to be added manually. Please try it out yourself and see where you get. I am by no means a Tomcat, Servlet Container or J2EE expert to I am not 100% sure this fix is optimum. |
@lewismc I have zero experience with Tomcat, so I'm just as in-the-dark as you in this regard. Did you get an error message or stacktrace you could post here? I'd recommend removing all the newly added dependencies except for |
@lewismc Also, now that they've granted me access, how do I actually access the VM? https://issues.apache.org/jira/browse/INFRA-17224 |
We need to document where everything is, in short however it resides here Tomcat9 deployment That will get you going. You need |
@lewismc when I try to use
It gives me a
Any ideas? |
First thing is 1) you don't need to access BUILDING.txt however 2) see https://apache.org/dev/freebsd-jails#opie |
@HansBrende The J2EE APIs (and implementations in some cases) were provided in the past by the JDK itself, not Tomcat or other J2EE containers, and they are not necessarily new dependencies. The new design (since Java-9) is to pull them in as maven artifacts rather than relying on them existing in the JDK. |
@ansell Right. And I know that Tika (as of 1.19.0) already pulls in all but one of these dependencies (I think). The only difference being, Tika uses the jaxb-core module from glassfish rather than |
I am not sure what the tika situation is, there is a reference in this commit to "removing jaxb" from tika in 1.17, but that may just have been tika-core, not tika-parsers apache/tika@ac25932 |
@ansell Well, this is what I see when I run
|
Interesting that they went down the route of adding compile-time dependencies on the implementation, rather than compile on the api and runtime on the implementation. Based on fixing this in other libraries I have had success using the api artifacts in the maven compile scope with the implementations in runtime scope. Could possibly exclude the tika dependencies and switch to that strategy in Any23 rather than adding them all to compile scope here. |
OK, let me rework things on my end and see what I can come up with. |
@lewismc @ansell of interest may be TIKA-2743, entitled, "Replace com.sun.xml.bind:jaxb-impl and jaxb-core by org.glassfish.jaxb:jaxb-runtime and jaxb-core", which states:
|
Indeed, when I navigate to https://javalibs.com/bom/com.sun.xml.bind/jaxb-impl
|
ALSO: it appears that, as of |
ALSO: it appears that In any case, Cf. https://mvnrepository.com/artifact/org.glassfish.jaxb/jaxb-runtime/2.3.1 |
Created an issue about this in Tika: https://issues.apache.org/jira/projects/TIKA/issues/TIKA-2778 |
OK folks, PR updated. Thank you for the review. I've tested locally and inclusion of only of dependency now enables deploying Any23 master in Tomcat 9 running JDK11. |
Only having to add the jaxws to get it working simplifies things. Moving the J2EE APIs out seems very useful, so should be short term pain for long term gain in this case. |
Any objections to merge? |
No objections from me! |
This issue addresses https://issues.apache.org/jira/browse/ANY23-419