Skip to main content

How do I edit environment entries of web applications?

5 replies [Last post]
kohsuke
Offline
Joined: 2003-06-09

I got an web application that has some environment entries that are supposed to be configured when it's deployed.

That is, it has web.xml that says something like:

</p>
<p>    HUDSON_HOME</p>
<p>    java.lang.String</p>
<p>

Now, when I deploy this in Tomcat, I can change this from the admin webui very easily. I'm trying to do the same with Glassfish, but I can't find anything like that in the admin console. If I click my web application under "Application Server" > "Appliations" > "Web Applications" > "Hudson" (my app), I only get general and descriptor tabs, and neither page contains any link that lets me edit env. entries.

I then hit Google, only to find
http://swforums.sun.com/jive/thread.jspa?threadID=20966

Now, where can I find it?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
vbkraemer
Offline
Joined: 2003-09-03

Actually, the user can also use asadmin deploy --deploymentplan to achieve a variation of what they are requesting.

vbk

km105526
Offline
Joined: 2005-04-04

I don't think GlassFish Admin Console/Deployment has the capability of being able to edit the deployment descriptors of "deployed" applications. The ways suggested in the thread is something that the users have thought on their own (it is an innovation). You have to redeploy the application after modifying the DD and repackaging it.

An alternate way to curtail the woes:

- Use the directory deploy feature. You can use the auto-deploy directory as the directory where you develop the applications.
- Use the IDE to modify the web.xml.
- Touch a file called .reload in the top level directory of the application. See if the application gets reloaded. (I am not sure if this applies to changes in deployment descriptor).

I think there is an RFE filed for being able to edit the deployment descriptors (at least those that make sense to be modified post deployment -- is one example).

kohsuke
Offline
Joined: 2003-06-09

Thank you very much for a response.

I'm not talking about changing the deployment descriptors. DDs only define variables, and the actual values can be determined by the administrator, not by a developer. It's exactly like environment variables (hence the name). It's an input to the program, not a part of the program. This is how this feature is defined in servlet --- I even talked to Yuta to make sure that that's the case.

I mean, if you think about it, if developers are responsible for setting the value correctly, what's the point of declaring it in web.xml? I might just as well define it in a static variable. I delcare it in web.xml because I want the administrator to be able to override it.

It's sad to see that Glassfish doesn't support it, but at least I now know it doesn't.

kohsuke
Offline
Joined: 2003-06-09

Just as a datapoint, when I edit environment entries in Tomcat, it doesn't modify web.xml. It keeps the setting in
$TOMCAT_HOME/conf/Catalina/localhost/hudson.xml which will look like this:

[code]




[/code]

So I hope you see that setting environment entries is definitely not about editing web.xml.

amyroh
Offline
Joined: 2004-05-06

You can find more information about context.xml support such as suggested in my blog - http://weblogs.java.net/blog/amyroh/archive/2007/05/context_webapp_1.html

Thanks,
Amy

> Just as a datapoint, when I edit environment entries
> in Tomcat, it doesn't modify web.xml. It keeps the
> setting in
> $TOMCAT_HOME/conf/Catalina/localhost/hudson.xml which
> will look like this:
>
> [code]
>
> > path="/hudson" reloadable="true"
> workDir="work/Catalina/localhost/hudson">
> > type="java.lang.String" value="/files/hudson"/>
> /Context>
> [/code]
>
> So I hope you see that setting environment entries is
> definitely not about editing web.xml.