0

I have an application named "lab-4-eureka-server" which I have made a war file for. I am deploying this application into my standalone tomcat. When I deploy the app, since no spring.profiles.active is specified, the webapp starts with the default default. After reading online, I found that I could pass specific parameters to my webapp if I created a context.xml in the base/conf/Catalina/localhost folder. I have created a "lab-4-eureka-server.xml" inside the localhost folder with the following contents (which is just a shot in the dark to show what I'm trying to do).

<?xml version="1.0" encoding="UTF-8"?>
<!-- Context configuration file for my web application -->
<Context>
<Resource name="profile" type="spring.profiles.active" value="primary" />
</Context>

I can see that when tomcat deploys my webapp, it is attempting to use this file with the below exception: Tomcat Exception Pic

What should my context.xml say in order to load the profile? I've read that I could edit some catalina.sh, or other files, but (from my understanding), those configurations will send the same java arguments to all deployed webapps. I'm going to the context.xml route because I plan to send different java arguments to different webapps

(note: I do know that spring boot could start it's own tomcat server. I will have mutiple webapps deployed into 1 tomcat server, so that is why I need this)

GSUgambit
  • 4,459
  • 6
  • 25
  • 31
  • I know you state trying to not use Spring Boot and putting this into a single container. What I don't understand is why you would want to do this. You are making it way more complicated than it should be. Spring Cloud is designed to take advantage of Spring Boot. Once you get past this issue you are going to find deployment and long term maint to become pretty complicated since you are going fully against the grain with your approach. – code Aug 24 '15 at 09:00
  • the biggest reason is because the war files i plan to use are connectors. There will need to be possibly teens-20 of these. If all of them run their own tomcat server, that's a bunch of installations that will need to happen instead of separate war deployments. Also, each tomcat server installation would require a different Windows Service installation. I think the one container gives the advantage of having on one installer and one windows service. I know w/ the microservices approach, you would like to separately deploy and install each, but the use case seems to be more fitting for war file – GSUgambit Aug 24 '15 at 15:30

0 Answers0