- This topic has 4 replies, 3 voices, and was last updated 16 years ago by rmcvay.
-
AuthorPosts
-
jhpublicParticipantI’d like to start with a fresh MyEclipse Web Project for an existing web app. I have some deployment challenges, however.
I need to be able to build the WAR with different web app configurations. We have different development, test, and production servers, and I want to be able to easily build for each target. We presently do all this with Ant.
Essentially, the only things that vary between any config are the following:
1. Hibernate configuration parameters (database URL, user name and password, specifically).
2. Miscellaneous servlet context params specified in web.xml (we have a web.xml file for each target). These include settings such as whether our security filter should be enforcing certain rules, debug settings, etc.
3. Log4j properties vary for the different targets as well.
Our Ant scripts deal with these challenges by copying the appropriate files from a target specific config folder that is part of our existing project. I don’t think the MyEclipse Web Project can accomodate something like this (correct?).
The source code, HTML, JSPs, CSS, and JavaScript are identical for all targets, so I don’t want to create multiple Web Projects for each target; that would require me to duplicate these files, and we all know the problems that can lead to.
I’d greatly appreciate some ideas on how to do something like this! I want to take advantage of the MyEclipse way of developing Web apps.
Loyal WaterMemberHi,
I’m afraid there is not way of setting different deployment configurations for development, test and production environments in MyEclipse at the moment. You will have to continue using the ant script.
rmcvayMember1. can be done using server level database connection pools
2. we define stages using property definitions on the server JVM command line
3. #2 can handle that as wellThe bottom line is you want exactly the same code running on all stages or you’ll wind up with configuration management nightmares. Emitting different code from the IDE for different stages is not a good idea.
jhpublicParticipant@rmcvay wrote:
1. can be done using server level database connection pools
2. we define stages using property definitions on the server JVM command line
3. #2 can handle that as wellLet me see if I understand your suggestion.
You are defining a whole slew of system properties to the web app server’s JVM on the command line, thereby allowing each app to just get the server specific properties it needs. Ok, this is an interesting concept I hadn’t considered. In fact this could greatly simplify the complexity of our build scripts (less build targets required per project if we can just assume deployment specific (e.g., dev/test/production) properties the app needs are defined in the host JVM).
I’ll have to go research what server level database connection pools are (and how to set Tomcat up to use them) to understand what you meant by your first point.
Thanks for your suggestions.
rmcvayMemberThe only property we define is the stage; wte, dev, test, prod. Then the app can figure it out from there using file names encoded with the stage, e.g. test.schedule.xml vs prod.schedule.xml.
As far as the database goes, we define the connection pool with a single alias, e.g. jdbc/myAppDS, on every server BUT each pool is configured to point to the appropriate database instance.
Consider using Geronimo/Tomcat instead of bare Tomcat.
-
AuthorPosts