users@glassfish.java.net

Re: How to deploy existing tomcat web application in Glassfish ?

From: Wolfram Rittmeyer <w.rittmeyer_at_jsptutorial.org>
Date: Thu, 10 Jul 2008 21:08:59 +0200

glassfish_at_javadesktop.org wrote:
> I have an existing web application (comprised of mainly servlets and some JSPs). I do not have a WAR file for the app just the context root containing a WEB-INF directory (with the Tomcat web.xml) and all the other js, html & css files.
>
> Here's how I tried to deploy this app using Glassfish admin console.
>
> In the "Deploy Enterprise Applications/Modules" screen :
> - set Type to WAR (even though I do not have a WAR file)
> - Location was local directory (current Tomcat context root /productname/webapps)


This looks weird. In Tomcat the directory layout is
TOMCAT_ROOT/webapps/contextName. And for the root context (/) it is
webapps/ROOT. So webapps doesn't look like the correct directory to me.

> - Application Name (productname)
> - Context Root was set to / (not sure abt this)

If your app has been in the root context (see my comment above) this is
correct. Otherwise you would have to take the name of the directoy
actually containing your web app.

> - Status was Enabled.
>
> Is this correct ?
>
> However when I deploy this app and try to access it, I get a HTTP 500 - Internal server error in my browser.
>

There should be s.th. in the server.log about this error. Can you post
the relevant parts? If no errors can be found in here, please enhance
the log level to fine for the web container.

> In my Glassfish Web admin tool, I can see (under Applications -> Web Applications) that the Sub components were recognized (from web.xml). Is the problem because my base directory (/productname/webapps) is different from /opt/glassfish/domains/domain1/config ?
>
> Thanks in advance for your help.
> [Message sent by forum member 'fishglass' (fishglass)]
>
> http://forums.java.net/jive/thread.jspa?messageID=285757
>