Originally from ticket #1749.
Question
Which is the files present on EAR which must be changed , when you want to deploy the ear on a new environment ( Different DataSource location , Different Resource file ).
Answer
The structure of a ETP EAR follows the standard for EJBs. Inside the EAR is a file "ejb_settings.jar". Inside that file is a "ejb-jar.xml" file. It is this file that contains all of the ETP Deployment Settings. For example, the DB connection parameters for the DEFAULT database are:
<env-entry>
<env-entry-name>sql.default.driver</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>org.postgresql.Driver</env-entry-value>
</env-entry>
<env-entry>
<env-entry-name>sql.default.password</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>abc000</env-entry-value>
</env-entry>
<env-entry>
<env-entry-name>sql.default.url</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>jdbc:postgresql://localhost/mark</env-entry-value>
</env-entry>
<env-entry>
<env-entry-name>sql.default.user</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>postgres</env-entry-value>
</env-entry>
You can disassemble and re-assemble the ear using standard shell commands, ANT tasks or Maven rules. You do not need to use the ETP Deployment Wizard. For example, the attached shell script 'replacear.sh' will change 'localhost' to '10.20.30.40' within the file 'etp1.ear' with the command:
replaceear.sh etp1.ear localhost 10.20.30.40
and leave the file in 'new-etp1.ear'.
0 Comments