-
Notifications
You must be signed in to change notification settings - Fork 123
How do I provide files to the embedded Tomcat instance? Specifically a custom classloader jar. #83
Comments
Related: I used a custom Java agent just fine until recently by setting This leaves me with the same problem op has. Please provide some guidance. |
@Jazzepi The plugin instantiates its own classloader to separate the project's classpath from Gradle's general classpath. You might want to try to add the JAR file to the @Emontis Would you mind checking which makes a difference for your project - the new Gradle or Tomcat version? |
Here's a stripped down example of the problem I'm having. The integration tests pass when they're running against a locally installed Tomcat instance on port 8090. When running them by invoking gradlew integrationTest I get a stack trace. https://github.com/Jazzepi/tomcat-gradle-test To run this you'll to start up a local mysql database, and set the application.properties. Should be very straightforward, let me know if you have any questions. https://github.com/Jazzepi/tomcat-gradle-test/blob/master/src/main/resources/application.properties |
@bmuschko Finally had time to nail the culprit down. Turns out it is some change between Tomcat 7.0.50 and 7.0.52. Up until 7.0.50 the
Whereas with 7.0.52 it does not get picked up:
Of course a solution that uses the |
@Emontis Hmm, I am not sure what I can do about this if is broken with a newer version of Tomcat. Would you mind asking about it on the Tomcat user mailing list? It's probably a bug on their end then. |
Will do. It would be great and preferable, however, if you can point out/build a way to use the |
Tomcat's API doesn't allow for just putting the JAR on the classpath.
You will need to use |
Thats true, but usually you create a The |
This issue isn't necessarily high on my priority list. If you want this feature, you might want to look into contributing it. I'd be more than happy to review and pull it in. You should probably also have a look at the Gradle Cargo plugin. It let's you use an isolated and installed container that you can configure the way you want. |
I'm trying to put Spring's custom Tomcat classloader into my embedded Tomcat instance that I use for integration tests in my Gradle project because I plan on using load time weaving. It works fine in my normal install when I place spring-instrument-tomcat-3.2.5.RELEASE.jar into the apache-tomcat-7.0.40/lib folder, but how do I access that folder of an embedded Tomcat instance and place the jar in there before the boostrap classloader finds it?
I've included the stack overflow question if someone would rather answer there :) Either way I will x-post the answer to both places. Thanks in advance!
http://stackoverflow.com/questions/21895507/how-do-a-give-an-embedded-tomcat-instance-a-custom-classloader-when-using-gradle
The text was updated successfully, but these errors were encountered: