users@glassfish.java.net

Re: Tomcat to Glassfish with a context fragment file

From: <glassfish_at_javadesktop.org>
Date: Fri, 14 May 2010 10:09:27 PDT

You can not deploy this directly. These properties are configured in different parts of the system.

The first part is the context path. That can be specified in a sun-web.xml file. Put it in the same place as your web.xml in the WAR.

[code]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN" "http://www.sun.com/software/appserver/dtds/sun-web-app_2_5-0.dtd">
<sun-web-app error-url="">
  <context-root>/mc_metrics</context-root>
</sun-web-app>
[/code]

Or you can specify that location when you deploy the WAR.

The second part is a Database Connection Pool, that's set up through the admin console.

The third part is an application specific Log file. I don't recall if Glassfish will let you specify a log file for a specific application.

The final part is for persisting sessions, so that they'll survive and be reloaded across server restarts. Glassfish already does this automatically, but it's not currently using a database. It serializes out to a file. Dunno how important that specific implementation detail is for your application, and I don't know how to configure that specifically. If you need more than the default capability, you can come back with a specific question regarding configuring that if you can't find it in the documentation.

But, simply put, if you configure that DB Pool, and add that sun-web.xml or deploy it to the right spot, it should "just work" with similar functionality to what you have now. It will certainly get you farther down field.
[Message sent by forum member 'whartung']

http://forums.java.net/jive/thread.jspa?messageID=469838