You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@continuum.apache.org by John DeStefano <jo...@gmail.com> on 2012/03/08 22:01:44 UTC

Re: Setting appserver.base for RHEL 6

Hi,

Even after hard-coding the Tomcat path in every Continuum file I could
find that referenced an application/appserver/catalina variable, I
still see related errors in catalina.out:

Mar 8, 2012 11:53:04 AM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor continuum.xml
Could not resolve placeholder 'appserver.base' in
[file:${appserver.base}/conf/continuum.xml] as system property:
neither system property nor environment variable found

The webapp seems to load, but now two stray directories based on
variable names (`$` and `${appserver.base}`) are being created in
Tomcat's home on start.

I should note that I've changed the file referenced above
(conf/continuum.xml) to point to the absolute Tomcat path, so either
this placeholder is coming from elsewhere, or the variable information
has been cached and not updated.

~John

On Wed, Mar 7, 2012 at 4:58 PM, John DeStefano <jo...@gmail.com> wrote:
> Hi,
>
> I'm trying to migrate a few Tomcat webapps from RHEL 5 to RHEL 6.2,
> and as with other Apache webapps, I'm having trouble with getting the
> latest Continuum .WAR running, likely because Tomcat 6.0.24 in RHEL
> 6.2 no longer permits loading of environment variables via setenv.sh,
> as was done previously: Tomcat 6 for RHEL does not ship with this file
> and does not honor it on start.  As a result, on Tomcat start,
> Continuum creates a directory in what was previously known as
> $CATALINA_HOME called `${appserver.base}`, attempts to populate this
> directory, and fails to load, with little feedback that I can find
> (catalina.out simply says "INFO: Deploying configuration descriptor
> continuum.xml").
>
> Is there a workaround to this?  I was able to get another webapp
> (Archiva) working by hard-coding some paths in a few XML files, but
> this doesn't seem to help in this case.
>
> Thank you,
> ~John

Re: Setting appserver.base for RHEL 6

Posted by Louis Smith <dr...@gmail.com>.
This is a trick we use.. .throw this into an app somewhere, and hit it.
 See what system properties are and (more importantly) are NOT being passed
in....in many servers, the env vars are NOT passed into a "child" java
run... particularly if it is a 2nd generation child...hence our defining it
as close to the internal java start command as we can..

Good luck!

file: SysProps.jsp

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <title>System Properties</title>
</head>
<body leftmargin="25" rightmargin="25" bgcolor="lightblue">
<%@ page language="java" import="java.util.*" %>
<%out.println("<center><h1>System Properties Listing
</h1><h1><hr></h1></center>");
//Get all system properties
Properties props = System.getProperties();
String propName = "";
String propValue = "";
// Enumerate all system properties
Enumeration e = props.propertyNames(); out.println("<ol>");
for (; e.hasMoreElements(); ) {
  // Get property name
  propName =(String)e.nextElement();
  // Get property value
  propValue =(String)props.get(propName);
  out.println("<li>Property Name: " +propName + ", Value: " );
    if(propValue.indexOf(":") >= 0 ){
      if(propValue.indexOf("http://") == 0 ){
          out.println(propValue + "</li>");
      }
      else{
        out.println("<ol>");
        String[] result = propValue.split(":");
        for (int x=0; x<result.length; x++){
                out.println("<li>" + result[x] + "</li>");
            }
        out.println("</ol>");
      }
      //out.println("</ol>");
    }
    else{
      out.println(propValue + "</li>\n");
    }
  }
  out.println("</ol>\n");
%>
<hr>
</body>
</html>

On Fri, Mar 9, 2012 at 3:22 PM, John DeStefano <jo...@gmail.com>wrote:

> Hi Louis,
>
> On Fri, Mar 9, 2012 at 7:15 AM, Louis Smith <dr...@gmail.com>
> wrote:
> > Correct.  Those never took effect for us either - we always had to place
> > them into the internal scripts that are passed to the java startup
> command
> > buried in the layers and layers of scripts... have you tried starting it
> in
> > foreground vs background?  I recall that as a startup option at one time.
> > Not sure if that makes any difference.
>
> In more "normal" Tomcat deployments, running in the foreground would
> be done simply by running `bin/catalina.sh run`.  However, the RHEL 6
> Tomcat package does not ship with catalina.sh or an equivalent script.
>
> As I just mentioned in an Archiva thread regarding a similar problem,
> the sane route may be to forget managing Tomcat via the stock RHEL 6.2
> package and install it manually.  I'd much prefer to stay with the
> RPM, but unless there's a simple solution, it seems silly to keep
> fighting with these variables that should simply work.
>
> Thanks,
> ~John
>



-- 
Dr. Louis Smith, ThD
Chief Technology Officer, Kyra InfoTech
Colonel, Commemorative Air Force

Re: Setting appserver.base for RHEL 6

Posted by John DeStefano <jo...@gmail.com>.
Hi Louis,

On Fri, Mar 9, 2012 at 7:15 AM, Louis Smith <dr...@gmail.com> wrote:
> Correct.  Those never took effect for us either - we always had to place
> them into the internal scripts that are passed to the java startup command
> buried in the layers and layers of scripts... have you tried starting it in
> foreground vs background?  I recall that as a startup option at one time.
> Not sure if that makes any difference.

In more "normal" Tomcat deployments, running in the foreground would
be done simply by running `bin/catalina.sh run`.  However, the RHEL 6
Tomcat package does not ship with catalina.sh or an equivalent script.

As I just mentioned in an Archiva thread regarding a similar problem,
the sane route may be to forget managing Tomcat via the stock RHEL 6.2
package and install it manually.  I'd much prefer to stay with the
RPM, but unless there's a simple solution, it seems silly to keep
fighting with these variables that should simply work.

Thanks,
~John

Re: Setting appserver.base for RHEL 6

Posted by Louis Smith <dr...@gmail.com>.
Correct.  Those never took effect for us either - we always had to place
them into the internal scripts that are passed to the java startup command
buried in the layers and layers of scripts... have you tried starting it in
foreground vs background?  I recall that as a startup option at one time.
Not sure if that makes any difference.

On Thu, Mar 8, 2012 at 4:19 PM, John DeStefano <jo...@gmail.com>wrote:

> Hi Louis,
>
> On Thu, Mar 8, 2012 at 4:09 PM, Louis Smith <dr...@gmail.com>
> wrote:
> > We placed this in the geronimo.sh file itself:
> >
> > GERONIMO_OPTS="-Dappserver.base=/opt/geronimo/current/var/catalina
> > -Dappserver.home=/opt/geronimo/current/var/catalina"
> >
> > Louis
>
> Thanks.  I'm running via Tomcat.  I've added similar CATALINA_*
> options to the Tomcat init script, but these don't seem to be taking
> effect.
> # grep ^export /etc/init.d/tomcat6
> export CATALINA_HOME=/usr/share/tomcat6
> export CATALINA_BASE=${CATALINA_HOME}
> export CATALINA_OPTS="-Dappserver.home=${CATALINA_HOME}
> -Dappserver.base=${CATALINA_BASE}"
> export JAVA_HOME=/usr/java/default
> export JAVA_OPTS=${CATALINA_OPTS}
> export PATH=${PATH}:${JAVA_HOME}/bin
>
> ~John
>
> > On Thu, Mar 8, 2012 at 4:01 PM, John DeStefano <john.destefano@gmail.com
> >wrote:
> >
> >> Hi,
> >>
> >> Even after hard-coding the Tomcat path in every Continuum file I could
> >> find that referenced an application/appserver/catalina variable, I
> >> still see related errors in catalina.out:
> >>
> >> Mar 8, 2012 11:53:04 AM org.apache.catalina.startup.HostConfig
> >> deployDescriptor
> >> INFO: Deploying configuration descriptor continuum.xml
> >> Could not resolve placeholder 'appserver.base' in
> >> [file:${appserver.base}/conf/continuum.xml] as system property:
> >> neither system property nor environment variable found
> >>
> >> The webapp seems to load, but now two stray directories based on
> >> variable names (`$` and `${appserver.base}`) are being created in
> >> Tomcat's home on start.
> >>
> >> I should note that I've changed the file referenced above
> >> (conf/continuum.xml) to point to the absolute Tomcat path, so either
> >> this placeholder is coming from elsewhere, or the variable information
> >> has been cached and not updated.
> >>
> >> ~John
> >>
> >> On Wed, Mar 7, 2012 at 4:58 PM, John DeStefano <
> john.destefano@gmail.com>
> >> wrote:
> >> > Hi,
> >> >
> >> > I'm trying to migrate a few Tomcat webapps from RHEL 5 to RHEL 6.2,
> >> > and as with other Apache webapps, I'm having trouble with getting the
> >> > latest Continuum .WAR running, likely because Tomcat 6.0.24 in RHEL
> >> > 6.2 no longer permits loading of environment variables via setenv.sh,
> >> > as was done previously: Tomcat 6 for RHEL does not ship with this file
> >> > and does not honor it on start.  As a result, on Tomcat start,
> >> > Continuum creates a directory in what was previously known as
> >> > $CATALINA_HOME called `${appserver.base}`, attempts to populate this
> >> > directory, and fails to load, with little feedback that I can find
> >> > (catalina.out simply says "INFO: Deploying configuration descriptor
> >> > continuum.xml").
> >> >
> >> > Is there a workaround to this?  I was able to get another webapp
> >> > (Archiva) working by hard-coding some paths in a few XML files, but
> >> > this doesn't seem to help in this case.
> >> >
> >> > Thank you,
> >> > ~John
> >>
> >
> >
> >
> > --
> > Dr. Louis Smith, ThD
> > Chief Technology Officer, Kyra InfoTech
> > Colonel, Commemorative Air Force
>



-- 
Dr. Louis Smith, ThD
Chief Technology Officer, Kyra InfoTech
Colonel, Commemorative Air Force

Re: Setting appserver.base for RHEL 6

Posted by John DeStefano <jo...@gmail.com>.
Hi Louis,

On Thu, Mar 8, 2012 at 4:09 PM, Louis Smith <dr...@gmail.com> wrote:
> We placed this in the geronimo.sh file itself:
>
> GERONIMO_OPTS="-Dappserver.base=/opt/geronimo/current/var/catalina
> -Dappserver.home=/opt/geronimo/current/var/catalina"
>
> Louis

Thanks.  I'm running via Tomcat.  I've added similar CATALINA_*
options to the Tomcat init script, but these don't seem to be taking
effect.
# grep ^export /etc/init.d/tomcat6
export CATALINA_HOME=/usr/share/tomcat6
export CATALINA_BASE=${CATALINA_HOME}
export CATALINA_OPTS="-Dappserver.home=${CATALINA_HOME}
-Dappserver.base=${CATALINA_BASE}"
export JAVA_HOME=/usr/java/default
export JAVA_OPTS=${CATALINA_OPTS}
export PATH=${PATH}:${JAVA_HOME}/bin

~John

> On Thu, Mar 8, 2012 at 4:01 PM, John DeStefano <jo...@gmail.com>wrote:
>
>> Hi,
>>
>> Even after hard-coding the Tomcat path in every Continuum file I could
>> find that referenced an application/appserver/catalina variable, I
>> still see related errors in catalina.out:
>>
>> Mar 8, 2012 11:53:04 AM org.apache.catalina.startup.HostConfig
>> deployDescriptor
>> INFO: Deploying configuration descriptor continuum.xml
>> Could not resolve placeholder 'appserver.base' in
>> [file:${appserver.base}/conf/continuum.xml] as system property:
>> neither system property nor environment variable found
>>
>> The webapp seems to load, but now two stray directories based on
>> variable names (`$` and `${appserver.base}`) are being created in
>> Tomcat's home on start.
>>
>> I should note that I've changed the file referenced above
>> (conf/continuum.xml) to point to the absolute Tomcat path, so either
>> this placeholder is coming from elsewhere, or the variable information
>> has been cached and not updated.
>>
>> ~John
>>
>> On Wed, Mar 7, 2012 at 4:58 PM, John DeStefano <jo...@gmail.com>
>> wrote:
>> > Hi,
>> >
>> > I'm trying to migrate a few Tomcat webapps from RHEL 5 to RHEL 6.2,
>> > and as with other Apache webapps, I'm having trouble with getting the
>> > latest Continuum .WAR running, likely because Tomcat 6.0.24 in RHEL
>> > 6.2 no longer permits loading of environment variables via setenv.sh,
>> > as was done previously: Tomcat 6 for RHEL does not ship with this file
>> > and does not honor it on start.  As a result, on Tomcat start,
>> > Continuum creates a directory in what was previously known as
>> > $CATALINA_HOME called `${appserver.base}`, attempts to populate this
>> > directory, and fails to load, with little feedback that I can find
>> > (catalina.out simply says "INFO: Deploying configuration descriptor
>> > continuum.xml").
>> >
>> > Is there a workaround to this?  I was able to get another webapp
>> > (Archiva) working by hard-coding some paths in a few XML files, but
>> > this doesn't seem to help in this case.
>> >
>> > Thank you,
>> > ~John
>>
>
>
>
> --
> Dr. Louis Smith, ThD
> Chief Technology Officer, Kyra InfoTech
> Colonel, Commemorative Air Force

Re: Setting appserver.base for RHEL 6

Posted by Louis Smith <dr...@gmail.com>.
We placed this in the geronimo.sh file itself:

GERONIMO_OPTS="-Dappserver.base=/opt/geronimo/current/var/catalina
-Dappserver.home=/opt/geronimo/current/var/catalina"

Louis

On Thu, Mar 8, 2012 at 4:01 PM, John DeStefano <jo...@gmail.com>wrote:

> Hi,
>
> Even after hard-coding the Tomcat path in every Continuum file I could
> find that referenced an application/appserver/catalina variable, I
> still see related errors in catalina.out:
>
> Mar 8, 2012 11:53:04 AM org.apache.catalina.startup.HostConfig
> deployDescriptor
> INFO: Deploying configuration descriptor continuum.xml
> Could not resolve placeholder 'appserver.base' in
> [file:${appserver.base}/conf/continuum.xml] as system property:
> neither system property nor environment variable found
>
> The webapp seems to load, but now two stray directories based on
> variable names (`$` and `${appserver.base}`) are being created in
> Tomcat's home on start.
>
> I should note that I've changed the file referenced above
> (conf/continuum.xml) to point to the absolute Tomcat path, so either
> this placeholder is coming from elsewhere, or the variable information
> has been cached and not updated.
>
> ~John
>
> On Wed, Mar 7, 2012 at 4:58 PM, John DeStefano <jo...@gmail.com>
> wrote:
> > Hi,
> >
> > I'm trying to migrate a few Tomcat webapps from RHEL 5 to RHEL 6.2,
> > and as with other Apache webapps, I'm having trouble with getting the
> > latest Continuum .WAR running, likely because Tomcat 6.0.24 in RHEL
> > 6.2 no longer permits loading of environment variables via setenv.sh,
> > as was done previously: Tomcat 6 for RHEL does not ship with this file
> > and does not honor it on start.  As a result, on Tomcat start,
> > Continuum creates a directory in what was previously known as
> > $CATALINA_HOME called `${appserver.base}`, attempts to populate this
> > directory, and fails to load, with little feedback that I can find
> > (catalina.out simply says "INFO: Deploying configuration descriptor
> > continuum.xml").
> >
> > Is there a workaround to this?  I was able to get another webapp
> > (Archiva) working by hard-coding some paths in a few XML files, but
> > this doesn't seem to help in this case.
> >
> > Thank you,
> > ~John
>



-- 
Dr. Louis Smith, ThD
Chief Technology Officer, Kyra InfoTech
Colonel, Commemorative Air Force