Gayan Dinuzhka
Gayan Dinuzhka

Reputation: 331

JavaEE app with EJB - glassfish configurations inside project

I have a JavaEE application with EJB, deployed in glassfish. If i add the connection pools, jndi resources, jms resources to the glassfish, then the project is working fine. But is there anyway i can do these things without adding these configurations from the glassfish admin console.

The purpose for this is, when i need to send my project to another person, he/she will also have to add these configs to glassfish. I need to prevent it

Upvotes: 0

Views: 42

Answers (1)

flogy
flogy

Reputation: 937

Best way to achieve this are probably command line scripts (bat, sh). There you can administrate GlassFish using the asadmin command. Here is a list of all asadmin subcommands: http://docs.oracle.com/cd/E18930_01/html/821-2416/gcode.html

Example to add a JNDI resource:

asadmin create-jndi-resource --user admin --passwordfile passwords.txt 
--host pigeon --port 4001 --jndilookupname sample_jndi --restype queue 
--factoryclass sampleClass --description "this is a sample jndi 
resource" sample_jndi_resource

(Example source: http://docs.oracle.com/cd/E19879-01/820-4332/6nfq988q6/index.html)

Upvotes: 1

Related Questions