• Post Reply Bookmark Topic Watch Topic
  • New Topic

Configuration files situated out of the EAR/WAR file.

 
Avor Nadal
Ranch Hand
Posts: 152
Java Netbeans IDE Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi:

All Java EE servers that I know allow to deploy exploded applications/modules. This makes it possible to customize the configuration files and the deployment descriptors specifically for each deployment, which is great. But this also means that, every time that you release a new version, you've to manually decompress the file(s) and re-configure the same parameters again and again.

Because of that, I'm experimenting with deploying my applications as pure EAR/WAR files, and loading the configuration specific to my application from a properties file, situated out of the compressed file. The path to load that file is obtained from a system property, which is passed to the server on start.

I like this solution, but I'm realizing that there are aspects related to the deployment that can't be externalized. Indeed, I doubt that this situation ever change, given the nature of Java EE. For example, the data-source used for the persistence unit must still be indicated in the "persistence.xml" file. Or the context root of a Web module, or the virtual host in which it has to run, which have to be set in a file specific of each server ("jboss-web.xml" in the case of Wildfly).

So my question is this: Is the idea of deploying a static EAR/WAR file just an illusion in most of the real situations? Because, except the very simple applications, all them require that you configure at least the data-source to the database.

Thank you.
 
L Foster
Ranch Hand
Posts: 213
11
Android Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Avor, Hello.

I cannot answer the entire question, because I have not recently tried deploying things that way.  More and more, Wildfly seems to want you to use their command line interface for deployment (correct me if I am wrong, here, because I have not worked with Wildfly for a few months).

However, I think you can put everything into a war file now, and can dispense with the ear.

Also, it sounds like you are trying to hot-deploy tiny little files into the exploded area.  I have found hot deploy has been problematic with JBoss in the past.  It might be better for the newer Wildfly (which I have read you can do with their CLI).  But, I have sort of grown to distrust the use of hot deploy in application servers.

The place I would like if I were you, is at the CLI itself.  See if this kind of thing is supported.

I hope it helps.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!