You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by B W <bw...@gmail.com> on 2013/08/22 14:48:31 UTC

Migrating from GlassFish to Tomcat 7

 I have a GWT application which currently is running on GlassFish 3.x. I
want to migrate to Tomcat 7. Previously, I would store properties that the
GWT application could retrieve by
org.apache.commons.configuration.SystemConfiguration. I would put these
settings in my domain.xml for GlassFish. What is the Tomcat equivalent? I
tried putting settings under my WEB-INF\web.xml file as
context-paramsection. However, my GWT application cannot see them
still.

Where should I put settings that can be read by calling
org.apache.commons.configuration.SystemConfiguration from my GWT app from
Tomcat?

Re: Migrating from GlassFish to Tomcat 7

Posted by Daniel Mikusa <dm...@gopivotal.com>.
On Aug 26, 2013, at 7:52 AM, B W <bw...@gmail.com> wrote:

> Looks like catalina.properties it is !

+1 catalina.properties is great for simple things, and it's more portable.

One, not so common reason you might want to use setenv.sh is if you want to do something dynamic.  Since setenv.sh is a shell script, you could dynamically capture some value and store it in a system property.

Contrived Ex:

  CATALINA_OPTS="-Dhostname=`hostname`"

Dan


> On Thu, Aug 22, 2013 at 6:30 PM, Christopher Schultz <
> chris@christopherschultz.net> wrote:
> 
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA256
>> 
>> B W,
>> 
>> On 8/22/13 4:30 PM, B W wrote:
>>> What is the advantage to using catalina.properties vs setenv.sh?
>> 
>> If you use setenv.sh, then those system properties will only be
>> available if you use the Tomcat scripts to launch. If you use jsvc or
>> the Microsoft Windows Service Wrapper, they will not be available.
>> 
>> Using catalina.properties should allow you to set system properties
>> that will be loaded regardless of how you launch Tomcat.
>> 
>> - -chris
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v1.4.14 (Darwin)
>> Comment: GPGTools - http://gpgtools.org
>> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>> 
>> iQIcBAEBCAAGBQJSFpD/AAoJEBzwKT+lPKRYvbEQALWOa8chxGNMyDTb7032vnnX
>> iMgD0bdTyfXKHQUpseCikP185gksIXdBajxHKNyKH6lDEJLyl4udHg8dtAAPPlmZ
>> FvveRHCuyxlcZXg3qAe7Zsnd83fPVMa5F/ysGDUHUbNIKSAq8YiQtFsnujLRQrKY
>> Y+LZdoDMFbS6wNohBaxIQZtsjiOWu+/JblUAcqwOZ6JV0ZhCl6vhtGgp10UFxsjx
>> BRz5hE6K8vZcYt2zvVGqB9+Kjy7APIPBB1TJTnp8ieA5Y6+Va/6wCtI6ve1FsH83
>> aj4aEzOejHx5x7shGvz8yr8LfbGGBfRBvHVwVteicffAiBvEPx+5C/t29nR0xJcn
>> wvojyA5oSD5/O+W24mrgf27fmsY8JrgivZsnaSPyx2dHp31bbhkfQz7+FI0Hoh02
>> jNzNRoRKECOtmxWH/qI9zd9igOa3Merve1e6x0JWtoT9UOY7YFZRRl0jwDoTM75a
>> Ogs0c/kKOlpb57/8iXpffMl9LHD54tCD+XgVb+Dlln7+aSic56eCx+edGqm241fe
>> bWtB9o8nOsjzERjwwlkFFyZsXo1cfJza2LOlNSrsJjx+10KT+3cGxwBt+ywn5Q5j
>> AhYX/YO8WkdCxei2DcZleFYzuuUyInmHnezoxDHvPfZSOzoPvbXfzyZQP8flSvgQ
>> /Q2Pj4X4p65yhV/7s4bj
>> =h6mX
>> -----END PGP SIGNATURE-----
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>> 
>> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Migrating from GlassFish to Tomcat 7

Posted by B W <bw...@gmail.com>.
Looks like catalina.properties it is !


On Thu, Aug 22, 2013 at 6:30 PM, Christopher Schultz <
chris@christopherschultz.net> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> B W,
>
> On 8/22/13 4:30 PM, B W wrote:
> > What is the advantage to using catalina.properties vs setenv.sh?
>
> If you use setenv.sh, then those system properties will only be
> available if you use the Tomcat scripts to launch. If you use jsvc or
> the Microsoft Windows Service Wrapper, they will not be available.
>
> Using catalina.properties should allow you to set system properties
> that will be loaded regardless of how you launch Tomcat.
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.14 (Darwin)
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQIcBAEBCAAGBQJSFpD/AAoJEBzwKT+lPKRYvbEQALWOa8chxGNMyDTb7032vnnX
> iMgD0bdTyfXKHQUpseCikP185gksIXdBajxHKNyKH6lDEJLyl4udHg8dtAAPPlmZ
> FvveRHCuyxlcZXg3qAe7Zsnd83fPVMa5F/ysGDUHUbNIKSAq8YiQtFsnujLRQrKY
> Y+LZdoDMFbS6wNohBaxIQZtsjiOWu+/JblUAcqwOZ6JV0ZhCl6vhtGgp10UFxsjx
> BRz5hE6K8vZcYt2zvVGqB9+Kjy7APIPBB1TJTnp8ieA5Y6+Va/6wCtI6ve1FsH83
> aj4aEzOejHx5x7shGvz8yr8LfbGGBfRBvHVwVteicffAiBvEPx+5C/t29nR0xJcn
> wvojyA5oSD5/O+W24mrgf27fmsY8JrgivZsnaSPyx2dHp31bbhkfQz7+FI0Hoh02
> jNzNRoRKECOtmxWH/qI9zd9igOa3Merve1e6x0JWtoT9UOY7YFZRRl0jwDoTM75a
> Ogs0c/kKOlpb57/8iXpffMl9LHD54tCD+XgVb+Dlln7+aSic56eCx+edGqm241fe
> bWtB9o8nOsjzERjwwlkFFyZsXo1cfJza2LOlNSrsJjx+10KT+3cGxwBt+ywn5Q5j
> AhYX/YO8WkdCxei2DcZleFYzuuUyInmHnezoxDHvPfZSOzoPvbXfzyZQP8flSvgQ
> /Q2Pj4X4p65yhV/7s4bj
> =h6mX
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Migrating from GlassFish to Tomcat 7

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

B W,

On 8/22/13 4:30 PM, B W wrote:
> What is the advantage to using catalina.properties vs setenv.sh?

If you use setenv.sh, then those system properties will only be
available if you use the Tomcat scripts to launch. If you use jsvc or
the Microsoft Windows Service Wrapper, they will not be available.

Using catalina.properties should allow you to set system properties
that will be loaded regardless of how you launch Tomcat.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.14 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJSFpD/AAoJEBzwKT+lPKRYvbEQALWOa8chxGNMyDTb7032vnnX
iMgD0bdTyfXKHQUpseCikP185gksIXdBajxHKNyKH6lDEJLyl4udHg8dtAAPPlmZ
FvveRHCuyxlcZXg3qAe7Zsnd83fPVMa5F/ysGDUHUbNIKSAq8YiQtFsnujLRQrKY
Y+LZdoDMFbS6wNohBaxIQZtsjiOWu+/JblUAcqwOZ6JV0ZhCl6vhtGgp10UFxsjx
BRz5hE6K8vZcYt2zvVGqB9+Kjy7APIPBB1TJTnp8ieA5Y6+Va/6wCtI6ve1FsH83
aj4aEzOejHx5x7shGvz8yr8LfbGGBfRBvHVwVteicffAiBvEPx+5C/t29nR0xJcn
wvojyA5oSD5/O+W24mrgf27fmsY8JrgivZsnaSPyx2dHp31bbhkfQz7+FI0Hoh02
jNzNRoRKECOtmxWH/qI9zd9igOa3Merve1e6x0JWtoT9UOY7YFZRRl0jwDoTM75a
Ogs0c/kKOlpb57/8iXpffMl9LHD54tCD+XgVb+Dlln7+aSic56eCx+edGqm241fe
bWtB9o8nOsjzERjwwlkFFyZsXo1cfJza2LOlNSrsJjx+10KT+3cGxwBt+ywn5Q5j
AhYX/YO8WkdCxei2DcZleFYzuuUyInmHnezoxDHvPfZSOzoPvbXfzyZQP8flSvgQ
/Q2Pj4X4p65yhV/7s4bj
=h6mX
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Migrating from GlassFish to Tomcat 7

Posted by B W <bw...@gmail.com>.
What is the advantage to using catalina.properties vs setenv.sh?


On Thu, Aug 22, 2013 at 11:37 AM, Konstantin Kolinko <knst.kolinko@gmail.com
> wrote:

> 2013/8/22 Daniel Mikusa <dm...@gopivotal.com>:
> > On Aug 22, 2013, at 8:48 AM, B W <bw...@gmail.com> wrote:
> >
> >> I have a GWT application which currently is running on GlassFish 3.x. I
> >> want to migrate to Tomcat 7. Previously, I would store properties that
> the
> >> GWT application could retrieve by
> >> org.apache.commons.configuration.SystemConfiguration.
> >
> > Looks like this class is loading items from system properties.
> >
> >> I would put these
> >> settings in my domain.xml for GlassFish. What is the Tomcat equivalent?
> I
> >> tried putting settings under my WEB-INF\web.xml file as
> >> context-paramsection. However, my GWT application cannot see them
> >> still.
> >>
> >> Where should I put settings that can be read by calling
> >> org.apache.commons.configuration.SystemConfiguration from my GWT app
> from
> >> Tomcat?
> >
> > Based on that, you'd want to add system properties in
> "$CATALINA_BASE/bin/setenv.sh".  Note this file doesn't exist by default,
> you'll need to create it.
> >
> > Ex:
> >
> >    CATALINA_OPTS="-Dmy.property.1=xyz -Dmy.property.2=abc"
> >
>
> Properties that are used by a web application (and not by Java itself
> during its startup) can also be added to conf/catalina.properties
> file.
>
> http://tomcat.apache.org/tomcat-7.0-doc/config/index.html
>
> Best regards,
> Konstantin Kolinko
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Migrating from GlassFish to Tomcat 7

Posted by Konstantin Kolinko <kn...@gmail.com>.
2013/8/22 Daniel Mikusa <dm...@gopivotal.com>:
> On Aug 22, 2013, at 8:48 AM, B W <bw...@gmail.com> wrote:
>
>> I have a GWT application which currently is running on GlassFish 3.x. I
>> want to migrate to Tomcat 7. Previously, I would store properties that the
>> GWT application could retrieve by
>> org.apache.commons.configuration.SystemConfiguration.
>
> Looks like this class is loading items from system properties.
>
>> I would put these
>> settings in my domain.xml for GlassFish. What is the Tomcat equivalent? I
>> tried putting settings under my WEB-INF\web.xml file as
>> context-paramsection. However, my GWT application cannot see them
>> still.
>>
>> Where should I put settings that can be read by calling
>> org.apache.commons.configuration.SystemConfiguration from my GWT app from
>> Tomcat?
>
> Based on that, you'd want to add system properties in "$CATALINA_BASE/bin/setenv.sh".  Note this file doesn't exist by default, you'll need to create it.
>
> Ex:
>
>    CATALINA_OPTS="-Dmy.property.1=xyz -Dmy.property.2=abc"
>

Properties that are used by a web application (and not by Java itself
during its startup) can also be added to conf/catalina.properties
file.

http://tomcat.apache.org/tomcat-7.0-doc/config/index.html

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Migrating from GlassFish to Tomcat 7

Posted by B W <bw...@gmail.com>.
Thank you - it's working!




On Thu, Aug 22, 2013 at 9:04 AM, Daniel Mikusa <dm...@gopivotal.com>wrote:

> On Aug 22, 2013, at 8:48 AM, B W <bw...@gmail.com> wrote:
>
> > I have a GWT application which currently is running on GlassFish 3.x. I
> > want to migrate to Tomcat 7. Previously, I would store properties that
> the
> > GWT application could retrieve by
> > org.apache.commons.configuration.SystemConfiguration.
>
> Looks like this class is loading items from system properties.
>
> > I would put these
> > settings in my domain.xml for GlassFish. What is the Tomcat equivalent? I
> > tried putting settings under my WEB-INF\web.xml file as
> > context-paramsection. However, my GWT application cannot see them
> > still.
> >
> > Where should I put settings that can be read by calling
> > org.apache.commons.configuration.SystemConfiguration from my GWT app from
> > Tomcat?
>
> Based on that, you'd want to add system properties in
> "$CATALINA_BASE/bin/setenv.sh".  Note this file doesn't exist by default,
> you'll need to create it.
>
> Ex:
>
>    CATALINA_OPTs="-Dmy.property.1=xyz -Dmy.property.2=abc"
>
> Dan
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Migrating from GlassFish to Tomcat 7

Posted by Daniel Mikusa <dm...@gopivotal.com>.
On Aug 22, 2013, at 8:48 AM, B W <bw...@gmail.com> wrote:

> I have a GWT application which currently is running on GlassFish 3.x. I
> want to migrate to Tomcat 7. Previously, I would store properties that the
> GWT application could retrieve by
> org.apache.commons.configuration.SystemConfiguration.

Looks like this class is loading items from system properties.

> I would put these
> settings in my domain.xml for GlassFish. What is the Tomcat equivalent? I
> tried putting settings under my WEB-INF\web.xml file as
> context-paramsection. However, my GWT application cannot see them
> still.
> 
> Where should I put settings that can be read by calling
> org.apache.commons.configuration.SystemConfiguration from my GWT app from
> Tomcat?

Based on that, you'd want to add system properties in "$CATALINA_BASE/bin/setenv.sh".  Note this file doesn't exist by default, you'll need to create it.

Ex:

   CATALINA_OPTs="-Dmy.property.1=xyz -Dmy.property.2=abc"

Dan


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org