-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
tomcat_logging_support isn't compatible with java9 #530
Comments
Link to Tomcat release notes with change. Under "Improve handling of endorsed directories": http://tomcat.apache.org/tomcat-8.5-doc/changelog.html#Tomcat_8.5.24_(markt) |
Yep, on my mind when I said "nothing else is ready to go". I have no idea what the work around is for something endorsed in Tomcat though. Maybe I'll have a chat with @markt-asf. |
Was there a special use case for the endorsed functionality? If not, I see three options:
|
@mayrstefan Here is the original issue that added this functionality: #30 In my past experience ${catalina.base}/lib wasn't early enough in the classloader for logging.properties to pick up custom logging config but perhaps that has changed over the years? |
I did some quick and dirty tests. I had some offline buildpacks on my machine that included different Tomcat versions:
In those zip-files I patched lib/java_buildpack/container/tomcat/tomcat_logging_support.rb to be
Then I deployed a small servlet that did a System.out.println and System.err.println. Both lines were streamed to cf logs. Those tests were done using Java 8 (I only wanted to get rid of the endorsed directory). That seemed to work so far. Is there a test application to verify all logging cases? |
It is not. The logging is Tomcat's own container logging. This is why it is up so high in endorsed, so that Tomcat will load those JARs in it’s root classloader. The test is to use our configuration while putting the JARs into alternate locations and seeing all the results stream out to stdout. |
Okay. I had a look into the Tomcat catalina.sh script. It generates a classpath string with the tomcat-juli.jar appended to it. To extend the CLASSPATH variable we can use setenv.sh. More copy & paste resulted into this patch:
I'm not sure if everything I did is really needed or correct. But my modified 4.6 offline buildpack now runs without an endorsed directory and my outout from java.uitl.logging.Logger starts with [CONTAINER] |
Java9 removed support for the -Djava.endorsed.dirs system property. When starting with this command I get the following error in my logs:
It appears Tomcat 8.5.24 made it so that if the "endorsed" directory doesn't exist it won't attempt to add that argument. However, the java buildpack adds that directory to support tomcat_logging_support.
It appears we'll need to provide a different mechanism to support this feature in java9+Tomcat.
The text was updated successfully, but these errors were encountered: