3

Pardon if this feels a bit of "necroposting". I looked and found only one similar question with no answers here (Spring-Boot Embedded Wars).

I have a service packaged into a spring boot (1.0) container. This service uses activiti (www.activiti.org) to manage some buisiness processes. I am trying to deploy inside the same spring boot container, the war for activiti-explorer. This war has its own web.inf, spring config, et cetera, so it may conflict with the existing spring config, but nonetheless, I'd like to try to deploy that war as it is.

I haven't found any way to do that, and suspect that spring boot doesn't support the deployment of pre-package wars into the embedded container, isn't it?

Just as a warning, I think I can't put the extracted war into the spring-boot jar as I feel it needs a fully functional web container. If spring-boot doesn't offer this functionality, no big deal, we're going to deploy that war on its own tomcat, but it would be handy if it could be.

Thanks


Update Just to clear better, I have an already running Spring Application standalone server, with its own embedded Tomcat. Inside the embedded Tomcat I plugged some @Controllers I developed. Then I was also able to map a third-party servlet using a ServletRegistrationBean (mapped to /servlet-path).

Now I'd like to do something similar with another war that contains a full fledged web application (it's a vaadin/spring 3.2 application with its own libraries, jsps, static resources ...) and would like to map it to (say) /war-path.

I would like to drop the war in a well known location and deploy it into tomcar with a (say) WarRegistrationBean that would let Tomcat handle all the classloading hurdles (as I mentioned, the war is using spring 3.2 while I'm using 4.0 with spring boot, ...). I suspect that this last feature is not supported by spring-boot or - possibly - even out of scope for the project itself.

Community
  • 1
  • 1
molleafauss
  • 33
  • 1
  • 4
  • Not sure what you mean by "fully functional". Isn't the embedded tomcat you are looking to add "fully functional"? – Dave Syer Jul 08 '14 at 18:27

1 Answers1

1

You can manually enhance a war archive by adding the stuff that the boot plugin does (classes from the loader and some META-INF information). Easiest would be to simply enhance an "empty" war, and then merge it with the target one (by exploding them both and re-jarring). The only thing you'd need to add might be a main class.

It's still a gap in the Boot tooling. If you think it needs filling please raise an issue and/or send some code.

Dave Syer
  • 56,583
  • 10
  • 155
  • 143
  • Point is that I would not like to touch the third party war (in this case is an open source project and might do it, but that might not be always feasible). Prefer to deploy it "as is", as it comes from maven central or from the third party supplier. I'll see what I can do, meanwhile, thanks for the info. – molleafauss Jul 09 '14 at 09:35
  • Besides, just to be clearer: I would not like my main to be packaged in the third party war. I'd like my main be in its own jar, together with its classes, controller, et cetera and then, _in addition to that_, map another third party war, to a particular endpoint in the embedded Tomcat. – molleafauss Jul 09 '14 at 09:41
  • How about one step at a time? Your main can live anywhere on the classpath. The _in addition_ stuff probably depends a lot on the way the third party war is structured. – Dave Syer Jul 09 '14 at 09:42
  • 1
    @alexmalgaroli so what was your final solution that worked for you ? – yathirigan Feb 17 '15 at 15:00
  • 1
    No real solution, sadly. We kept the war outside on another tomcat instance. We decided not too spend to much effort as probably that needs to be done by registering inside the tomcat (or jetty) some custom handler based on how tomcat (or jetty) deploy a war. So it becomes heavily container-dependent and we didn't want to do that. – molleafauss Feb 18 '15 at 21:00