Hi,
wanted to check with other application developers who may be deploying to
GlassFish, while using JNDI. The following workflow actually WORKS as a
workflow for deploying WARS from my local machine (where I usually develop
against Jetty) to my test server (GlassFish).
Wanted to get an idea how to optimize this workflow? Can I use the Maven
production profile to help with this?
I'm unpacking the WAR file on the server.
1. mkdir myappfuse-app
2. cd myappfuse-app
3. jar xvf ../myappfuse-app-1.0-SNAPSHOT.war
... then edit the files (see below) ...
4. jar cvf ../myappfuse-app.war *
And I make the following edits to files:
1. uncomment the JNDI element in
WEB-INF/classes/applicationContext-resources.xml
and comment out the datasource definition.
2. add the following lines at the end of web-xml
<!-- jndi resources -->
<resource-ref>
<res-ref-name>jdbc/MyAppFuseDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<resource-ref>
<res-ref-name>mail/Session</res-ref-name>
<res-type>javax.mail.Session</res-type>
<res-auth>Container</res-auth>
</resource-ref>
3. add a sun-web.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sun-web-app PUBLIC '-//Sun Microsystems, Inc.//DTD Application
Server 8.1 Servlet 2.4//EN' '
http://www.sun.com/software/appserver/dtds/sun-web-app_2_4-1.dtd'>
<sun-web-app>
<session-config>
<session-manager>
</session-manager>
</session-config>
<resource-ref>
<res-ref-name>jdbc/MyAppFuseDB</res-ref-name>
<jndi-name>jdbc/MyAppFuseDB</jndi-name>
</resource-ref>
<resource-ref>
<res-ref-name>mail/Session</res-ref-name>
<jndi-name>mail/Session</jndi-name>
</resource-ref>
</sun-web-app>
Thanks for any advice you can give!
Alex Coles