2
votes

This question is related to Weblogic 12c.

I have an EAR file that I want to deploy in various environments (dev, QA, pre-prod and prod). However, my application requires a username and a password (to connect to another server) and they're not the same across the four environments. I don't want to package 4 different property files in 4 different EAR files. I want a single generic EAR file. Beside, I don't want to handle the prod password during packaging.

Ideally, I'd like the admin of each environment to provide the appropriate username nad password for the environment. Unlike Tomcat, Jetty or JBoss(?), I think it's not possible for a WebLogic Admin to specify this information in a way that it will become available under the java:comp/env JNDI context.

How can an application obtain some admin-defined configuration strings from Weblogic?

BTW, it's not a username/password for a JDBC connection.

3

3 Answers

2
votes

From what I understand, you need to change parameters based on the environment you are using right? If you would like to override parameterss on the fly you can use WebLogic deployment plan concept.

0
votes

Did you mean that you need to provide username/password to start-up the application? If so, you may accomplish that by creating a script with WLST http://docs.oracle.com/cd/E15051_01/wls/docs103/config_scripting/using_WLST.html

0
votes

As far as I know, the WebLogic way is to

  • Define your username/password as env-entry in the deployment descriptor
  • Deploy your application together with the plan.mxl whereas each environment admin maintains his own envrionemnt-specific version of the plan.xml

That way you get them into /comp/env/config

More details here: http://docs.oracle.com/cd/E11035_01/wls100/deployment/config.html

Only drawback known to me: plan.xml will always contain the unencrypted password but as the admin knows the password anyway and this is "his" file on "his" maschine that should be fine.