-
Notifications
You must be signed in to change notification settings - Fork 24
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
Spring Auto Reconfiguration is not operational when deploying EAR #23
Comments
cc @kelapure |
@kelapure and I are starting to look at this @violetagg - one question though, how did you get this condition to trigger to simulate the scenario for the ear file:
|
Any EAR file that contains a WAR using Spring Boot, would do it. |
Thanks @nebhale, however then the war in the ear will have to be in an exploded form right for the jars in there to be visible to the buildpack. I will assume that to be the case and try to simulate the issue that @violetagg is seeing |
That is correct, and that is how the application we were working with was laid out. |
Do you mind providing a sample @nebhale, @violetagg , a sample that I have with a spring boot war packaged in an ear is not starting up at all - https://github.com/bijukunjummen/ear-with-boot, for me to simulate the issue //cc @kelapure |
@violetagg, can you please provide your sample which has this issue. |
Try with this one. You should be able to see
|
Awesome, thanks @violetagg, will give this a try and get back to you |
I can see only a couple of potential fixes @violetagg, @nebhale , @kelapure
1 and 2 should be very easy, 3 I feel will be tricky since there are now potentially more than 1 target folder. Let me know what you think and I can attempt a fix along those lines. |
Hi, In the issue you talk about a exploded EAR (with the wars "unzipped") but I have a EAR structure similar to this:
My wars aren't exploded. And to provide all the common libs out of the WARs included spring libs the skinnyWars option is enabled in maven plugin. But I have the same error in my logs.
The problem is that I would have to put all the libraries inside the WAR due to if I put only the spring libraries the other libraries won't be able to access to spring classes (classpath hierarchy WAR -> EAR -> tomEE) |
Hi @violetagg |
Hi, Can you provide a sample application (with war files that are not exploded)? Thanks, |
Yes of course ear-distribution-0.0.1-SNAPSHOT.ear.zip I use the following manifest
To avoid the error I have to disable the AUTO_RECONFIGURATION, in the other hand if you disable it and run the application to can reproduce the error related with the other issue #32 that I have opened making the following GET request:
|
@mgvinuesa Thanks for the sample app. It helped a lot. In your use case Do you need the Regards, |
@violetagg I supposed, same situation that with exploded ears. Currently I don't need it but maybe in the future, according with what Spring Auto Reconfiguration consists:
The second one maybe we would need in the future but I suppose that we could get the information manually. thanks by your support. |
Should we do point 2 in #23 (comment) @violetagg , @kelapure, I can attempt a PR |
@bijukunjummen - can we explore how to fix this issue with 3 in #23. I feel like just documenting this is not good enough. |
Yes I also think that when we have EAR with exploded war files we will be able to provide Spring Auto Reconfiguration. |
When Spring Auto Reconfiguration is enabled and there is
spring-core*.jar
artifacts [1]in the application binaries, a modification of
web.xml
provided by web module will be madeand Spring Auto Reconfiguration jar file will be added to the additional libraries [2].
When the deployment artifact is WAR file the collection of the additional libraries will be added
to
WEB-INF/lib
[3]. Thus Spring Auto Reconfiguration will be able to load classes provided byspring-core*.jar
.In case of EAR the additional libraries will be added to
<TomEE-Home>/lib
[3]. ThusSpring Auto Reconfiguration will not be able to load the classes provided by
spring-core*.jar
because they are provided by the application binaries and not by TomEE installation.
The exception below will appear:
[1] https://github.com/cloudfoundry-community/tomee-buildpack/blob/master/lib/java_buildpack/framework/spring_auto_reconfiguration.rb#L53
[2] https://github.com/cloudfoundry-community/tomee-buildpack/blob/master/lib/java_buildpack/framework/spring_auto_reconfiguration.rb#L39
[3] https://github.com/cloudfoundry-community/tomee-buildpack/blob/master/lib/java_buildpack/container/tomee/tomee_instance.rb#L62
The text was updated successfully, but these errors were encountered: