users@glassfish.java.net

Re: How to detect Glassfish at runtime?

From: Sahoo <Sahoo_at_Sun.COM>
Date: Sat, 26 Jul 2008 05:40:12 +0530

Even if a class like

/com/sun/enterprise/glassfish/bootstrap/ASMainHK2.class

exists, your web-app may not be able to load it, as we are trying to
hide implementation classes from applications. I was going to suggest to
use a class like org.glassfish.api.Version, but that's not there in
glassfish-api module.

You may be able to get that information using admin interface. Kedar?
any suggestion.

Otherwise, file an RFE asking for a class that tells you the name and
version of the server.

Thanks,
Sahoo

glassfish_at_javadesktop.org wrote:
> For a feature I am working on I need to accurately predict the major version of webcontainer my webapp is running on.
>
> We have code where we try to load a webcontainer specific class and based on that decide the webcontainer type.
>
> For glassfish v2 I can use the class: /com/sun/appserv/ClassLoaderUtil.class
>
> However for V3 this class was not available to the webapp and we used:
> /com/sun/enterprise/glassfish/bootstrap/ASMainHK2.class
>
> But soon after TP2 builds, this class is also not available. Is there a reliable way to detect glassfish at runtime from the webapp?
>
> _raju
> [Message sent by forum member 'uppalapati' (uppalapati)]
>
> http://forums.java.net/jive/thread.jspa?messageID=289461
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>