Re: context.xml file location

2024-05-30 Thread David Rush
I don't know about any docker-related differences, but

I think that if you put a context config file under Catalina/localhost you
need to name the .xml file the same as your .war file.  So if you have
foo.war, then you'd have Catalina/localhost/foo.xml

You can also put a file named context.xml into the .war file itself, under
META-INF directory.

David

On Thu, May 30, 2024 at 7:35 AM firstName lastName 
wrote:

> I am trying to setup JNDI for tomcat with a java webapp. I am using the
> official tomcat docker image (version 10.1.24-jdk21-temurin-jammy).
> However, I'm a bit confused about where to put the context.xml file. I
> tried putting it in /usr/local/tomcat/conf/Catalina/localhost/context.xml
> but tomcat refuses to start with the error "The main resource set specified
> [/usr/local/tomcat/webapps/context] is not a directory or war file, or is
> not readable'. I put my war file in /usr/local/tomcat/webapps/ROOT.war
>
> Are these paths correct or should I have put the context.xml or war file in
> a different directory? My hosting provider does not want me to edit the
> server.xml file (I have found google articles suggesting defining the JNDI
>  tag in the server.xml and then using a  in the
> context.xml, but my hosting provider wants me to define the  tag
> in the context.xml file instead of the server.xml file).
>
> Thanks for your help!
>

-- 

E-Mail to and from me, in connection with the transaction 
of public 
business, is subject to the Wyoming Public Records 
Act and may be 
disclosed to third parties.


Nothing but 404 errors

2024-09-05 Thread David Rush
I've been an avid user of "apt install tomcat9" for years on Ubuntu 22.04
and prior with great success, but I've discovered that the package manager
on Ubuntu 24.04 doesn't support tomcat9.

So I'm trying to install it from the core binary D/L from tomcat.apache.org

I want to use distinct CATALINA_HOME and CATALINA_BASE so that I can more
easily upgrade Tomcat without interfering with the configuration and
deployed webapps.
My CATALINA_HOME is /opt/tomcat9/home (which is a symlink to
/opt/tomcat9/apache-tomcat-9.0.93)
My CATALINA_BASE is /var/opt/tomcat9

I have it set up as a systemd service, and Tomcat runs (stopping and
starting with "sudo systemctl start tomcat9.service" and "sudo systemctl
stop tomcat9.service"), but I'm only ever getting 404 errors with the
familiar Tomcat 404 error page with distinctive dark tuquoise trim and it
correctly identifies the version I have just installed, 9.0.93.

I copied the ROOT webapp from my CATALINA_HOME/webapps to my
CATALINA_BASE/webapps, and I see in my /var/opt/tomcat9/logs/catalina.out
that it was found:

Sep 05, 2024 2:18:53 PM org.apache.catalina.startup.HostConfig
deployDirectory
INFO: Deployment of web application directory
[/var/opt/tomcat9/webapps/ROOT] has finished in [251] ms

Same for the examples webapp:

Sep 05, 2024 2:18:53 PM org.apache.catalina.startup.HostConfig
deployDirectory
INFO: Deploying web application directory
[/var/opt/tomcat9/webapps/examples]

I'm seeing nothing but 404 errors in my
/var/opt/tomcat9/logs/localhost_access_log.2024-09-05.txt

Trying http://localhost:8080/ and http://localhost:8080/index.jsp and
http://localhost:8080/examples/ and
http://localhost:8080/examples/index.html I only ever get a 404 error.

I can stop the tomcat9.service and then I get a "Cannot connect" error.  So
I am hitting Tomcat.

I can change the listening port in /var/opt/tomcat9/conf/server.xml which
means I can get 404 errors on that different port (but demonstrates that
it's finding the right server.xml in my CATALINA_BASE).

What dumb mistake am I making?

-- 

E-Mail to and from me, in connection with the transaction 
of public 
business, is subject to the Wyoming Public Records 
Act and may be 
disclosed to third parties.


Re: Nothing but 404 errors

2024-09-05 Thread David Rush
Doh!  I have resolved it.

When creating my CATALINA_BASE/conf, server.xml was the only file that I
copied into it (in my defense it's the only file explicitly mentioned as
going into the conf directory under the CATALINA_BASE section on running
multiple tomcat instances in the RUNNING.txt file).

Copying EVERYTHING from CATALINA_HOME/conf to CATALINA_BASE/conf resolved
the issue.

David

On Thu, Sep 5, 2024 at 8:54 AM David Rush  wrote:

> Sebastian:
>
> I want to keep HOME and BASE separate so that when a new version of Tomcat
> comes out it's easy to swap the new binary download in at CATALINA_HOME
> without impacting my configuration or webapps in CATALINA_BASE
>
> David
>
> On Thu, Sep 5, 2024 at 8:52 AM Sebastian Trost
>  wrote:
>
>> David,
>>
>> On 05.09.2024 16:13, David Rush wrote:
>> > My CATALINA_HOME is /opt/tomcat9/home (which is a symlink to
>> > /opt/tomcat9/apache-tomcat-9.0.93)
>> > My CATALINA_BASE is /var/opt/tomcat9
>> Why are you setting the CATALINA_BASE-variable? If you're running just
>> one Tomcat instance, this variable is not needed. Also, you point this
>> variable to a different directory?
>>
>> See
>>
>> https://tomcat.apache.org/tomcat-10.1-doc/introduction.html#CATALINA_HOME_and_CATALINA_BASE
>>
>> Sebastian
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>
>>

-- 

E-Mail to and from me, in connection with the transaction 
of public 
business, is subject to the Wyoming Public Records 
Act and may be 
disclosed to third parties.


Re: Nothing but 404 errors

2024-09-05 Thread David Rush
Darryl:

Do you have a script or something that copies the "needed files" from the
previous version to the new version?

Seems like you would need to copy all your webapps and any customizations
in your config files (I sometimes tweak my server.xml and
logging.properties).

David

On Thu, Sep 5, 2024 at 9:29 AM Darryl Baker 
wrote:

> My method for updating Tomcat is that it lives behind a symbolic link.
> /opt/tomcat/latest points to the version I want to run.
> /opt/tomcat/apache-tomcat-9.0.XX when I want to upgrade I untar the latest
> version, stop the running version, copy over the needed files to the new
> version, repoint the link, and start up the new version. The system control
> file use the symbolic link so needs no changes.
>
> Darryl Baker, GSEC, GCLD (he/him/his)
> Sr. System Administrator
> Distributed Application Platform Services
> Northwestern University
> 4th Floor
> 2020 Ridge Avenue
> Evanston, IL 60208-0801
> darryl.ba...@northwestern.edu <mailto:darryl.ba...@northwestern.edu>
> (847) 467-6674 
>
>
>
>
> On 9/5/24, 9:56 AM, "David Rush"  david.r...@wyo.gov>> wrote:
>
>
> Sebastian:
>
>
> I want to keep HOME and BASE separate so that when a new version of Tomcat
> comes out it's easy to swap the new binary download in at CATALINA_HOME
> without impacting my configuration or webapps in CATALINA_BASE
>
>
> David
>
>
> On Thu, Sep 5, 2024 at 8:52 AM Sebastian Trost
> mailto:m...@sebastiantrost.de.inva>lid>
> wrote:
>
>
> > David,
> >
> > On 05.09.2024 16:13, David Rush wrote:
> > > My CATALINA_HOME is /opt/tomcat9/home (which is a symlink to
> > > /opt/tomcat9/apache-tomcat-9.0.93)
> > > My CATALINA_BASE is /var/opt/tomcat9
> > Why are you setting the CATALINA_BASE-variable? If you're running just
> > one Tomcat instance, this variable is not needed. Also, you point this
> > variable to a different directory?
> >
> > See
> >
> >
> https://urldefense.com/v3/__https://tomcat.apache.org/tomcat-10.1-doc/introduction.html
> <
> https://urldefense.com/v3/__https://tomcat.apache.org/tomcat-10.1-doc/introduction.html>*CATALINA_HOME_and_CATALINA_BASE__;Iw!!Dq0X2DkFhyF93HkjWTBQKhk!Rc7C8HkZWIbxfAm38rp_i-EV1fH7v3D-qSOqznnMXuPLPia3Lv6Ln8BmtPmJv0LMLNRTToWFeSGEIMSE9xhvPZvlufqjKXI$
>
> >
> > Sebastian
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org  users-unsubscr...@tomcat.apache.org>
> > For additional commands, e-mail: users-h...@tomcat.apache.org  users-h...@tomcat.apache.org>
> >
> >
>
>
> --
>
>
> E-Mail to and from me, in connection with the transaction
> of public
> business, is subject to the Wyoming Public Records
> Act and may be
> disclosed to third parties.
>
>
>
>

-- 

E-Mail to and from me, in connection with the transaction 
of public 
business, is subject to the Wyoming Public Records 
Act and may be 
disclosed to third parties.


Re: Help with deploying multiple .WAR files in Tomcat

2022-08-05 Thread David Rush
We successfully deploy multiple webapps by simply dropping .war files into
the webapps directory all the time.  No problems here.  Just sharing my
perspective.

David

On Thu, Aug 4, 2022 at 4:10 PM James H. H. Lampert
 wrote:

> Multiple WAR files work fine for us. But we don't simply "drop [the WAR
> files] in the webapps folder (and for the most part, that *doesn't* work
> for us, even with *only one* webapp).
>
> We always deploy through the Manager webapp (which we always customize
> to increase the allowable WAR file size by an order of magnitude, every
> time we update somebody's Tomcat), and there are plenty of installations
> where we have multiple nearly-identical contexts based on completely
> identical WAR files (and note that another customization we make when
> installing Tomcat is to disable re-expansion of WAR files when Tomcat
> launches, since that would overwrite parameters manually inserted into
> the contexts after deployment).
>
> --
> JHHL
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>

-- 

E-Mail to and from me, in connection with the transaction 
of public 
business, is subject to the Wyoming Public Records 
Act and may be 
disclosed to third parties.


Re: running two instances of tomcat

2006-03-24 Thread David Rush

I'm confused.

I first installed 5.5.15 using the exe (testing on a WinXP machine right 
now), and got it working.


But to run multiple instances, it looks as though I need the service.bat 
script, which is not included in the .exe.  So I de-installed Tomcat, 
downloaded the .zip, and expanded it.  Now I have service.bat, but I no 
longer have tomcat5.exe in the bin directory (or anywhere else).


So I need to do one .exe install, then use the .zip for the 2nd, 3rd, 
etc. installs, or what?


I see that Nic has posted a rather detailed "howto"... is that with the 
.exe installation?


David

David Kerber wrote:
I got it working no problem on Windows, running 5.5.12.  Just had to 
mess with the service installation scripts a bit to give each of them 
different names.  A little hassle, but not a big one.



Nic Daniau wrote:


That was the case in 4.1 yes, but it doesn't work with 5.5 on Windows
platform, because of the way the service is set up from the nsi scrip 
(that
you can read from tomcat source). I've written down a procedure to 
overcome

this and I will post it tomorrow (its on my laptop which I left at the
office tonight). I've tested it on live servers it works fine.

Ideally I hope the guys who write the windows deployer will one day 
allow

the installer to ask for
1) the name of the servive and not force it to Tomcat5 (whic is the main
issue)
2) use that service name for setting up the reg keys (and not use 
constants)

3) let the user choose the name of the Program menu it's copying the
shortucut to
If I have the time I will post a feature request on bugzilla...

Will definitively post my step-by-step procedure tomorrow
Nic

On 22/03/06, David Kerber <[EMAIL PROTECTED]> wrote:
 


Jim the Standing Bear wrote:

  

Hi,

Is there a way to run two instances of tomcat 5.5 on the same machine?
Because me and a coworker were developing some webapps using the same


node,
  

but under two different tomcat instances.  We just learned a painful


lesson
  
that as soon as the second instance of tomcat is launched, the 
first one

dies.  Is there a way to get around the problem? Thank you.

-- Jim




I'm running about 4 instances of tomcat on a single machine, so yes 
it's

no problem.  But they need to all be listening on different ports, and
might need to be supporting different contexts.




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


  


 





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: running two instances of tomcat

2006-04-05 Thread David Rush
I've tried following the instructions below, and tried using 
service.bat, but either way I always end up with a small pop-up window 
with "Application System ..." in the title bar, and it says "NonAlpha 45".


Any clue what's going on here?

David

Nic Daniau wrote:

OK here we go. What was said above is true but it's not all about the
service, therefore the service.bat script is not enough to resolve the
problem. If you read the nsi install script from the source, you can see
everything that it does, and the setup of the service is just one thing. The
tested procedure which I've used live is as follows:

I assume you have installed tomcat under C:\tomcat-x1 with the intention to
install C:\tomcat-x2, C:\tomcat-x3, etc..
The service names will be called TomcatX1, TomcatX2, TomcatX3, etc.
The Display Names will be "Apache Tomcat #1", "Apache Tomcat #2", etc.
And of course the ports will be configurred differently (I use for shutdown:
40051, 40052, etc., for http/1.1: 40801, 40802, etc. for ajp/1.3: 40091,
40092, etc.)

First run the following after adapting to your environment:

set TOMCAT_NO=1
set JAVA_HOME=C:\jdk1.5.0_03
set CATALINA_HOME=C:\tomcat-x1
As you can see %TOMCAT_NO% is the iterative number I give to the Tomcat
install I'm dealing with.

Then you can run
%CATALINA_HOME%\bin\tomcat5.exe //DS//Tomcat5
as the service name is hardcoded "Tomcat5" in the current tomcat dist.

Then you're free to run:

%CATALINA_HOME%\bin\tomcat5.exe //IS//TomcatX%TOMCAT_NO% --DisplayName
"Apache Tomcat #%TOMCAT_NO%" --Description "v5.5.16" --LogPath
"D:\logs\tomcat-x%TOMCAT_NO%" --Install "%CATALINA_HOME%\bin\tomcat5.exe"
--Jvm "%JAVA_HOME%\jre\bin\server\jvm.dll" --StartPath "%CATALINA_HOME%"
--StopPath "%CATALINA_HOME%" --Startup auto --Classpath
"%CATALINA_HOME%\bin\bootstrap.jar" --StartClass
org.apache.catalina.startup.Bootstrap --StopClass
org.apache.catalina.startup.Bootstrap --StartParams start --StopParams stop
--StartMode jvm --StopMode jvm --JvmOptions "-
Dcatalina.home=%CATALINA_HOME%#-Dcatalina.base=%CATALINA_HOME%#-Djava.endorsed.dirs=%CATALINA_HOME%\common\endorsed#-Djava.io.tmpdir=%CATALINA_HOME%\temp#-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager#-Djava.util.logging.config.file=%CATALINA_HOME%\conf\logging.properties"
--StdOutput auto --StdError auto

(my logs go to a specially created folder on another drive
D:/logs/tomcat-x1)

This was inspired by the .nsi script, which to my mind is more reliable than
the service.bat one.

But that's not all. You need to edit the registry:

"HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\Tomcat\5.5"
-> rename it to "HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software
Foundation\Tomcat\#1"

"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Apache
Tomcat 5.5"
-> rename it to
"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Apache
Tomcat #1"
and change DisplayName value to "Apache Tomcat #1 (remove only)"

"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run"
-> remove entry "ApacheTomcatMonitor" (yes: DELETE, you can always access
the monitor with the menu, it's not needed in the tray esp. if you have many
tomcats)

And lastly, the menu in Program that has been created has also been
hardcoded, so change
"Start / All Programs / Apache Tomcat 5.5" menu entry to "Apache
Tomcat #1"and change the
targets for Configure and Monitor (replace ..//Tomcat5 by ..//TomcatX1).
Thar's where you can start the monitor for each tomcat if you really want to
(IMHO you wont)

That's it and it works like a charm! Don't take my word for it have a look
into the .nsi script and you will see for yourself there is nothing else.

Just a note if you need to unsistall, do a regular uninstallation followed
by:

- delete registry key "HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software
Foundation\Tomcat\#1"
- delete registry key
"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Apache
Tomcat #1"
- remove "Start / All Programs / Apache Tomcat #1" menu entry

HTH

Nic

On 22/03/06, Jim the Standing Bear <[EMAIL PROTECTED]> wrote:
  

Thanks, Chuck.  I will take a closer look at RUNNING.txt.  However, i
still
think there is something else causing our problems..  We installed two
copies of the tomcat code, one running at root, and the other running as a
regular user.  Now, even if the ports were conflicting, it would prevent
one
instance from being launched, instead of killing another instance, would
it?  At one time when i was playing with it on a testing platform (also
linux), the launching of the 2nd instance of tomcat 5.5 even killed a
running tomcat 4.1.31! It was incredible :P

-- Jim



On 3/22/06, Caldarale, Charles R <[EMAIL PROTECTED]> wrote:


From: Jim the Standing Bear [mailto:[EMAIL PROTECTED]
Subject: Re: running two instances of tomcat

Is there anything special we need to configure to
allow the co-existence (other than the port numbers)?


That should be it, just make sure yout get 

Re: running two instances of tomcat

2006-04-05 Thread David Rush

Aha.  That did the trick. Thanks!

David

Nic Daniau wrote:

service name must be A-Za-z0-9 (no space no _ or any funky character)

On 05/04/06, David Rush <[EMAIL PROTECTED]> wrote:
  

I've tried following the instructions below, and tried using
service.bat, but either way I always end up with a small pop-up window
with "Application System ..." in the title bar, and it says "NonAlpha 45".

Any clue what's going on here?

David

Nic Daniau wrote:


OK here we go. What was said above is true but it's not all about the
service, therefore the service.bat script is not enough to resolve the
problem. If you read the nsi install script from the source, you can see
everything that it does, and the setup of the service is just one thing.
  

The


tested procedure which I've used live is as follows:

I assume you have installed tomcat under C:\tomcat-x1 with the intention
  

to


install C:\tomcat-x2, C:\tomcat-x3, etc..
The service names will be called TomcatX1, TomcatX2, TomcatX3, etc.
The Display Names will be "Apache Tomcat #1", "Apache Tomcat #2", etc.
And of course the ports will be configurred differently (I use for
  

shutdown:


40051, 40052, etc., for http/1.1: 40801, 40802, etc. for ajp/1.3: 40091,
40092, etc.)

First run the following after adapting to your environment:

set TOMCAT_NO=1
set JAVA_HOME=C:\jdk1.5.0_03
set CATALINA_HOME=C:\tomcat-x1
As you can see %TOMCAT_NO% is the iterative number I give to the Tomcat
install I'm dealing with.

Then you can run
%CATALINA_HOME%\bin\tomcat5.exe //DS//Tomcat5
as the service name is hardcoded "Tomcat5" in the current tomcat dist.

Then you're free to run:

%CATALINA_HOME%\bin\tomcat5.exe //IS//TomcatX%TOMCAT_NO% --DisplayName
"Apache Tomcat #%TOMCAT_NO%" --Description "v5.5.16" --LogPath
"D:\logs\tomcat-x%TOMCAT_NO%" --Install
  

"%CATALINA_HOME%\bin\tomcat5.exe"


--Jvm "%JAVA_HOME%\jre\bin\server\jvm.dll" --StartPath "%CATALINA_HOME%"
--StopPath "%CATALINA_HOME%" --Startup auto --Classpath
"%CATALINA_HOME%\bin\bootstrap.jar" --StartClass
org.apache.catalina.startup.Bootstrap --StopClass
org.apache.catalina.startup.Bootstrap --StartParams start --StopParams
  

stop


--StartMode jvm --StopMode jvm --JvmOptions "-

  

Dcatalina.home=%CATALINA_HOME%#-Dcatalina.base=%CATALINA_HOME%#-Djava.endorsed.dirs=%CATALINA_HOME%\common\endorsed#-Djava.io.tmpdir=%CATALINA_HOME%\temp#-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager#-Djava.util.logging.config.file=%CATALINA_HOME%\conf\logging.properties
"


--StdOutput auto --StdError auto

(my logs go to a specially created folder on another drive
D:/logs/tomcat-x1)

This was inspired by the .nsi script, which to my mind is more reliable
  

than


the service.bat one.

But that's not all. You need to edit the registry:

"HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\Tomcat\5.5"
-> rename it to "HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software
Foundation\Tomcat\#1"


  

"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Apache


Tomcat 5.5"
-> rename it to

  

"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Apache


Tomcat #1"
and change DisplayName value to "Apache Tomcat #1 (remove only)"

"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run"
-> remove entry "ApacheTomcatMonitor" (yes: DELETE, you can always
  

access


the monitor with the menu, it's not needed in the tray esp. if you have
  

many


tomcats)

And lastly, the menu in Program that has been created has also been
hardcoded, so change
"Start / All Programs / Apache Tomcat 5.5" menu entry to "Apache
Tomcat #1"and change the
targets for Configure and Monitor (replace ..//Tomcat5 by ..//TomcatX1).
Thar's where you can start the monitor for each tomcat if you really
  

want to


(IMHO you wont)

That's it and it works like a charm! Don't take my word for it have a
  

look


into the .nsi script and you will see for yourself there is nothing
  

else.


Just a note if you need to unsistall, do a regular uninstallation
  

followed


by:

- delete registry key "HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software
Foundation\Tomcat\#1"
- delete registry key

  

"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Apache


Tomcat #1"
- remove "Start / All Programs / Apache Tomcat #1" menu entry

HTH

Nic

On 22/03/06, Jim the Standing Bear <[EMAIL PROTECTED]> wrote:

  

Thanks, Chuck.  I will take a closer look at RUNNING.txt.  However, i
still
think there is something else causing our problems..  We

CATALINA_BASE and multiple instances

2006-04-19 Thread David Rush
I'm trying to get Tomcat 5.5.16 set up for multiple independent 
instances (for use by multiple developers w/out stepping on each others' 
toes) in Windows XP (and eventually 2003 Server).


I've got the binaries installed in c:\Apache\Tomcat5, and this is where 
the environment variable CATALINA_HOME points.


I've got one instance set up in c:\arcims-tomcat, and this is where 
CATALINA_BASE points.


However, when I tried to install log4j, I had to put the .jar files and 
log4j.properties files under CATALINA_HOME/common in order for it to 
work.  Putting them under CATALINA_BASE/common did not work.  Obviously 
this is a problem because then multiple instances, which all share 
CATALINA_HOME would be intermixed in one log file.  It also points to 
the bigger problem of all instances sharing CATALINA_HOME/common for 
everything.


Is there a way to get each instance of tomcat to use its own 
CATALINA_BASE/common directory?


There's also the problem of getting multiple service-based tomcat 
instances to have their own idea of what CATALINA_BASE points to.


David

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: CATALINA_BASE and multiple instances

2006-04-19 Thread David Rush


Is there a way to get each instance of tomcat to use its own 
CATALINA_BASE/common directory?



Yes.  Clone the entire installation several times.  This has the
advantage that developers can upgrade 'their' instances as they require.
  
Okay, that looks like it will work for me.  I was hoping for a more 
elegant solution, but now "what works" beats "elegant".


Thanks.

David

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: servlet mapping request

2006-04-20 Thread David Rush
I've got the example invoker servlet stuff uncommented from 
conf/web.xml, and have restarted Tomcat, but am unable to get a simple 
test servlet to function.  The test servlet class file 
(SimpleServlet.class) file is under 
WEB-INF/classes/SimpleServlet.class.  A simple HTML file located in the 
web app's root works, so I know I've got the web app at least partially 
configured right and pointed in the right directory.


When I shove the URL of my test servlet 
(http://teton:8018/servlet/SimpleServlet) into my browser, I get the 
Tomcat 404 error page ("The requested resource (/servlet/SimpleServlet) 
is not available.").  Tomcat is on an unusual port in order to 
accommodate multiple instances (although only one is running right now).


I do understand that there are security issues with doing things this 
way, but I'd like to see something this simple work before I press on to 
other stuff.


What could be wrong?

David


You are trying to use the invoker servlet. This is evil. See
http://tomcat.apache.org/faq/misc.html#invoker If you insist on doing
this you will need to enable the invoker servlet in conf/web.xml and
restart Tomcat.

Mark


  


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Logging?

2006-04-21 Thread David Rush

Should Tomcat be logging the HTTP requests that it gets?

I'm debugging 5.5.16 on Windows.  I've installed commons-logging.jar and 
log4j-1.2.13.jar into common/lib, and log4j.properties into common/lib.  
My log4j.properties looks like this right now:


#log4j.rootLogger=INFO, RFA
log4j.appender.RFA=org.apache.log4j.RollingFileAppender
log4j.appender.RFA.File=${catalina.base}/logs/tomcat.log
log4j.appender.RFA.MaxFileSize=50MB
log4j.appender.RFA.MaxBackupIndex=10
log4j.appender.RFA.layout=org.apache.log4j.PatternLayout
log4j.appender.RFA.layout.ConversionPattern=%d %p %t %c - %m%n
#log4j.logger.org.apache=INFO, RFA
log4j.logger.org.apache.catalina=DEBUG, RFA


When I have that last line set to DEBUG, I get so much volume in the log 
file that it's hard to tell which way is up.  When I set it to INFO, I 
don't get any messages that appear to correspond to requests.


How can I get requests and the results of requests to show up in that 
log file, or any log file for that matter?  I've not found any other log 
file that seems to have it.  In the logs directory, I see stdout_*, 
stderr_*.log, and jakarta_service_*.log files, as well as the log4j 
tomcat.log file, but none of these seem to have request/result info.


David

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Problem with auto-deploy

2007-01-09 Thread David Rush

I'm having trouble with the auto-deploy of .war files on Tomcat 5.5.20
running on Windows 2003 Server.

When I drop a new .war file into the appropriate webapps directory,
Tomcat's finding it and trying to deploy it, but it fails.  It succeeds
in removing the old directory (that a previous auto-deployment created)
in the webapps directory, but it fails to complete the deployment with:

2007-01-09 11:21:44,859
(org.apache.catalina.startup.ContextConfig,init(),ERROR) Exception 
fixing docBase: {0}

java.util.zip.ZipException: The process cannot access the file because
it is being used by another process

and

2007-01-09 11:21:44,875
(org.apache.catalina.core.StandardContext,resourcesStart(),ERROR) Error
starting static Resources
java.lang.IllegalArgumentException: Invalid or unreadable WAR file : The
process cannot access the file because it is being used by another process

If I stop the Tomcat service and restart it (without touching the .war
file at all), Tomcat comes up fine, discovers the .war file a few
seconds later, and deploys it without a problem (thus demonstrating that
the .war file itself is fine).

Any ideas?  I have two machines that are exhibiting this same behavior,
and a third that never has this problem (using the same .war file in all
cases).  The "no problem" machine is my developmental machine running
Windows XP, and the two problematic machines are running Windows 2003
Server.

David


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem with auto-deploy

2007-01-10 Thread David Rush

Chuck:

Thanks for the tip.  I played a bit with both attributes, with no luck 
(but admittedly I don't fully understand them, so I was playing somewhat 
blind).  I was able to get different errors, but no joy.


Here's what I've since discovered

My normal mode of operation is to copy my .war files, of significant 
size, over a non-local, relatively slow connection, which normally takes 
about 25 seconds.


When I made a test .war file, with minimal contents and small size which 
copies quickly (1 second or so), things usually work fine.


What I think may be happening is that when I start the copy, it's not 
done when the next auto-load cycle comes around (every 10 seconds).  It 
tries loading an incomplete .war file, which may be locked because it's 
not done copying.  So it gives up completely, not even trying again in 
subsequent auto-load cycles.


When I copy the small .war file, it takes about 1 second, and hits "in 
between" auto-deploy cycles (at least usually).


Hmmm if I set the auto-deploy cycle to a longer time frame, in 
excess of the expected file copy time, that should improve my odds.  
I'll give it a try.


David


Caldarale, Charles R wrote:

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Subject: Problem with auto-deploy

2007-01-09 11:21:44,859
(org.apache.catalina.startup.ContextConfig,init(),ERROR)
Exception fixing docBase: {0}
java.util.zip.ZipException: The process cannot access the
file because it is being used by another process



Look at the antiJARLocking and antiResourceLocking attributes of the
 element:
http://tomcat.apache.org/tomcat-5.5-doc/config/context.html

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


  


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem with auto-deploy

2007-01-10 Thread David Rush
I have further evidence that the problem has to do with my new .war file 
being copied in when the background processor (auto-deploy) cycle "hits" 
and tries to reload.


I've slowed the process to every 30 seconds rather than the apparent 
default of every 10 seconds (by setting backgroundProcessorDelay="30" in 
the Engine element of server.xml). 

If I target the upload of my new .war file (which takes about 25 
seconds) to start right after a background processor cycle, and it 
finishes before the next cycle, everything works fine.  The new .war 
file is deployed and works.


If I target the upload to span a background processor cycle "hit" (that 
is, the file is still copying when a cycle hits), the deployment fails.  
The old expanded directory is removed, but it is not recreated and the 
web application no longer functions.


If I subsequently upload "in between" background processor cycle hits, 
the web application will start functioning again (and gets expanded again).


It strikes me as strange that, by default, the process relies on .war 
file replacements to land cleanly in between background processor 
cycles.  Now in most cases where .war files are being copied more or 
less locally and quickly, it usually works, so I guess it's not a huge 
problem for most people.


Now to figure out a good way around this

David

Caldarale, Charles R wrote:

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Subject: Problem with auto-deploy

2007-01-09 11:21:44,859
(org.apache.catalina.startup.ContextConfig,init(),ERROR)
Exception fixing docBase: {0}
java.util.zip.ZipException: The process cannot access the
file because it is being used by another process



Look at the antiJARLocking and antiResourceLocking attributes of the
 element:
http://tomcat.apache.org/tomcat-5.5-doc/config/context.html

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


  


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Browser shows source of .jsp file. Why?

2009-04-25 Thread David Rush
I'm having the same problem, where markup is sometimes appearing in the browser 
window instead of the rendered HTML.

I'm using my own server (MS Windows Server 2003), with Tomcat 6.0.18 behind a 
reverse proxy on Apache 2.2.11.

When I access one of my webapps via Tomcat's port 
(http://myserver:8080/Construction/) it works fine.  When I access it via the 
reverse proxy (http://myserver/Construction) using Firefox 3.0.9 I see the HTML 
markup displayed in the browser's window.  When I access the webapp via IE 
either way, it works fine.  Google Chrome produces the same results as Firefox.

Via Live HTTP Headers, when I access through the reverse proxy I see:

HTTP/1.x 200 OK
Date: Sat, 25 Apr 2009 11:39:11 GMT
Server: Apache-Coyote/1.1
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/plain

I suspect the "Content-Type: text/plain" is a clue.  Straight to Tomcat I see:

HTTP/1.x 200 OK
Server: Apache-Coyote/1.1
Set-Cookie: JSESSIONID=53C3EC973BB365AAF92A1EC66F03271A; Path=/Construction
Transfer-Encoding: chunked
Date: Sat, 25 Apr 2009 11:37:06 GMT

No "Content-Type" produced at all.

When I access it with Firefox via the Apache reverse proxy via the URL 
http://myserver/Construction/index.html (which is just mapped in web.xml to the 
controlling servlet, and my welcome-file is index.html), the webapp displays 
correctly, and the headers say:

HTTP/1.x 200 OK
Date: Sat, 25 Apr 2009 11:42:27 GMT
Server: Apache-Coyote/1.1
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html

I have 3 different webapps, but I only see the problem with one of them.

My reverse proxy configuration includes:

ProxyPass/Construction http://localhost:8080/Construction
ProxyPassReverse /Construction http://localhost:8080/Construction

David

dfobox wrote:
> I have JSP-based website running on my own server and I want to move it to
> hosting company. I've copied the files, they said they have enabled Tomcat
> for me, but browser shows source of the pages, even of those which don't
> have any script code inside - only properly formatted html. What could be a
> problem? Thanks!

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



Re: Browser shows source of .jsp file. Why?

2009-04-27 Thread David Rush
I checked my web.xml, and found no mime-mapping elements at all.  I tried 
adding one explicitly mapping the jsp extension to text/html, but it had no 
effect.  I'm still getting HTML markup in the browser window with Firefox.

David

Martin Gainty wrote:
> David
> 
> did you check your mime-mapping in your web.xml 
> perchance are you mapping jsp to text/plain?
> is any other extension mapped to text/plain?
> 
> 
> jsp
> text/plain
> 
> 
> Martin 
> __ 
> Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung / Note 
> de déni et de confidentialité 
> This message is confidential. If you should not be the intended receiver, 
> then we ask politely to report. Each unauthorized forwarding or manufacturing 
> of a copy is inadmissible. This message serves only for the exchange of 
> information and has no legal binding effect. Due to the easy manipulation of 
> emails we cannot take responsibility over the the contents.
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
> sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
> oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich 
> dem Austausch von Informationen und entfaltet keine rechtliche 
> Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen 
> wir keine Haftung fuer den Inhalt uebernehmen.
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
> destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
> l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci 
> est interdite. Ce message sert à l'information seulement et n'aura pas 
> n'importe quel effet légalement obligatoire. Étant donné que les email 
> peuvent facilement être sujets à la manipulation, nous ne pouvons accepter 
> aucune responsabilité pour le contenu fourni.
> 
> 
> 
> 
> 
> 
>> Date: Sat, 25 Apr 2009 05:46:03 -0600
>> From: da...@rushtone.com
>> To: users@tomcat.apache.org
>> Subject: Re: Browser shows source of .jsp file. Why?
>>
>> I'm having the same problem, where markup is sometimes appearing in the 
>> browser window instead of the rendered HTML.
>>
>> I'm using my own server (MS Windows Server 2003), with Tomcat 6.0.18 behind 
>> a reverse proxy on Apache 2.2.11.
>>
>> When I access one of my webapps via Tomcat's port 
>> (http://myserver:8080/Construction/) it works fine.  When I access it via 
>> the reverse proxy (http://myserver/Construction) using Firefox 3.0.9 I see 
>> the HTML markup displayed in the browser's window.  When I access the webapp 
>> via IE either way, it works fine.  Google Chrome produces the same results 
>> as Firefox.
>>
>> Via Live HTTP Headers, when I access through the reverse proxy I see:
>>
>> HTTP/1.x 200 OK
>> Date: Sat, 25 Apr 2009 11:39:11 GMT
>> Server: Apache-Coyote/1.1
>> Keep-Alive: timeout=5, max=100
>> Connection: Keep-Alive
>> Transfer-Encoding: chunked
>> Content-Type: text/plain
>>
>> I suspect the "Content-Type: text/plain" is a clue.  Straight to Tomcat I 
>> see:
>>
>> HTTP/1.x 200 OK
>> Server: Apache-Coyote/1.1
>> Set-Cookie: JSESSIONID=53C3EC973BB365AAF92A1EC66F03271A; Path=/Construction
>> Transfer-Encoding: chunked
>> Date: Sat, 25 Apr 2009 11:37:06 GMT
>>
>> No "Content-Type" produced at all.
>>
>> When I access it with Firefox via the Apache reverse proxy via the URL 
>> http://myserver/Construction/index.html (which is just mapped in web.xml to 
>> the controlling servlet, and my welcome-file is index.html), the webapp 
>> displays correctly, and the headers say:
>>
>> HTTP/1.x 200 OK
>> Date: Sat, 25 Apr 2009 11:42:27 GMT
>> Server: Apache-Coyote/1.1
>> Keep-Alive: timeout=5, max=100
>> Connection: Keep-Alive
>> Transfer-Encoding: chunked
>> Content-Type: text/html
>>
>> I have 3 different webapps, but I only see the problem with one of them.
>>
>> My reverse proxy configuration includes:
>>
>> ProxyPass/Construction http://localhost:8080/Construction
>> ProxyPassReverse /Construction http://localhost:8080/Construction
>>
>> David
>>
>> dfobox wrote:
>>> I have JSP-based website running on my own server and I want to move it to
>>> hosting company. I've copied the files, they said they have enabled Tomcat
>>> for me, but browser shows source of the pages, even of those which don't
>>> have any script code inside - only properly formatted html. What could be a
>>> problem? Thanks!
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>
> 
> _
> Rediscover Hotmail®: Get e-mail storage that grows with you. 
> http://windowslive.com/RediscoverHotmail?ocid=TXT_TAGLM_WL_HM_Rediscover_Storage2_042009


Re: Browser shows source of .jsp file. Why?

2009-04-27 Thread David Rush
Pid:

Yes, I've removed the explicit mapping.

"Sometimes" because when I use the URL http://myserver:8080/Construction 
(direct to Tomcat listening port) it works fine (HTML is rendered).
When I use http://myserver/Construction (via reverse proxy forwarding through 
Apache httpd) it fails (I get HTML markup in the browser window).
When I use http://myserver/Construction/index.html (where index.html is mapped 
in web.xml to a controller servlet and index.html is my sole welcome-file) it 
works fine.

I'm not using AJP.  I'm just using straight reverse-proxy style HTTP forwarding 
with mod_proxy, with this snippet from my httpd.conf file:

...
ProxyPass/Construction http://localhost:8080/Construction
ProxyPassReverse /Construction http://localhost:8080/Construction
...

My Apache httpd docroot has always been separate and distinct from my Tomcat 
webapps directory.

David

Pid wrote:
> David Rush wrote:
>> I checked my web.xml, and found no mime-mapping elements at all.  I tried 
>> adding one explicitly mapping the jsp extension to text/html, but it had no 
>> effect.  I'm still getting HTML markup in the browser window with Firefox.
>>
>> David
> 
> Ignore that, it's a red herring, you don't need to add mime-mappings.
> 
> You say the problem occurs 'sometimes' with Firefox, can you elaborate
> on which times and if there's a commonality between these requests?
> 
> 
> The fault is usually in the AJP mapping you've configured.  Are you
> using mod_jk, and if so, what is the config?
> 
> Also, try splitting your HTTP docroot and Tomcat webapps folders (a
> correct mapping will mean it still works properly).  If the JSPs are in
> another location than the HTTP docs, they can't be served as raw HTML,
> by accident.
> 
> 
> p
> 
> 
> 
> 
> 
>> Martin Gainty wrote:
>>> David
>>>
>>> did you check your mime-mapping in your web.xml 
>>> perchance are you mapping jsp to text/plain?
>>> is any other extension mapped to text/plain?
>>>
>>> 
>>> jsp
>>> text/plain
>>> 
>>>
>>> Martin 
>>> __ 
>>> Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung / Note 
>>> de déni et de confidentialité 
>>> This message is confidential. If you should not be the intended receiver, 
>>> then we ask politely to report. Each unauthorized forwarding or 
>>> manufacturing of a copy is inadmissible. This message serves only for the 
>>> exchange of information and has no legal binding effect. Due to the easy 
>>> manipulation of emails we cannot take responsibility over the the contents.
>>> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene 
>>> Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte 
>>> Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht 
>>> dient lediglich dem Austausch von Informationen und entfaltet keine 
>>> rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von 
>>> E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
>>> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
>>> destinataire prévu, nous te demandons avec bonté que pour satisfaire 
>>> informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie 
>>> de ceci est interdite. Ce message sert à l'information seulement et n'aura 
>>> pas n'importe quel effet légalement obligatoire. Étant donné que les email 
>>> peuvent facilement être sujets à la manipulation, nous ne pouvons accepter 
>>> aucune responsabilité pour le contenu fourni.
>>>
>>>
>>>
>>>
>>>
>>>
>>>> Date: Sat, 25 Apr 2009 05:46:03 -0600
>>>> From: da...@rushtone.com
>>>> To: users@tomcat.apache.org
>>>> Subject: Re: Browser shows source of .jsp file. Why?
>>>>
>>>> I'm having the same problem, where markup is sometimes appearing in the 
>>>> browser window instead of the rendered HTML.
>>>>
>>>> I'm using my own server (MS Windows Server 2003), with Tomcat 6.0.18 
>>>> behind a reverse proxy on Apache 2.2.11.
>>>>
>>>> When I access one of my webapps via Tomcat's port 
>>>> (http://myserver:8080/Construction/) it works fine.  When I access it via 
>>>> the reverse proxy (http://myserver/Construction) using Firefox 3.0.9 I see 
>>>> the HTML

Re: Browser shows source of .jsp file. Why?

2009-04-27 Thread David Rush
The URL http://myserver/Construction/ (with trailing slash) yields the same 
results as http://myserver/Construction (without trailing slash).

I think I may have solved the problem.  I didn't write this webapp, but have 
inherited it so I'm still learning it's inner workings.

The controller servlet is using three 

rd = req.getRequestDispatcher("something.jsp");
rd.include(req,resp);

blocks (with essentially header, main content, and footer .jsp files) to 
assemble the final output page.  Initially there was no req.setContentType() at 
all.  Once I added req.setContentType("text/html") it appears to have resolved 
the problem.

w00t.

I've used rd.forward() and don't think I ever had to use setContentType(), but 
have never used rd.include() in my own webapps.  I guess since include() adds 
only a portion of a page, you have to treat the whole deal more like a servlet 
and explicitly set the content-type.

Thanks for the help.

David

Pid wrote:
> David Rush wrote:
>> Pid:
>>
>> Yes, I've removed the explicit mapping.
>>
>> "Sometimes" because when I use the URL http://myserver:8080/Construction 
>> (direct to Tomcat listening port) it works fine (HTML is rendered).
>> When I use http://myserver/Construction (via reverse proxy forwarding 
>> through Apache httpd) it fails (I get HTML markup in the browser window).
> 
> What about "http://myserver/Construction/"; (note extra slash)
> 
>> When I use http://myserver/Construction/index.html (where index.html is 
>> mapped in web.xml to a controller servlet and index.html is my sole 
>> welcome-file) it works fine.
>>
>> I'm not using AJP.  I'm just using straight reverse-proxy style HTTP 
>> forwarding with mod_proxy, with this snippet from my httpd.conf file:
> 
> (Sorry, I spotted that after I'd sent the reply.)
> 
> 
>> ...
>> ProxyPass/Construction http://localhost:8080/Construction
>> ProxyPassReverse /Construction http://localhost:8080/Construction
>> ...
>>
>> My Apache httpd docroot has always been separate and distinct from my Tomcat 
>> webapps directory.
> 
> Looking at your headers again, I see that Tomcat is trying to serve the
> result as plain html.  What happens if you use "index.jsp" as the sole
> welcome file (and map that to the controller, obviously)?
> 
> Check "index.jsp" is included in the DirectoryIndex in HTTPD.
> 
> 
> p
> 
> 
> 
>> David
>>
>> Pid wrote:
>>> David Rush wrote:
>>>> I checked my web.xml, and found no mime-mapping elements at all.  I tried 
>>>> adding one explicitly mapping the jsp extension to text/html, but it had 
>>>> no effect.  I'm still getting HTML markup in the browser window with 
>>>> Firefox.
>>>>
>>>> David
>>> Ignore that, it's a red herring, you don't need to add mime-mappings.
>>>
>>> You say the problem occurs 'sometimes' with Firefox, can you elaborate
>>> on which times and if there's a commonality between these requests?
>>>
>>>
>>> The fault is usually in the AJP mapping you've configured.  Are you
>>> using mod_jk, and if so, what is the config?
>>>
>>> Also, try splitting your HTTP docroot and Tomcat webapps folders (a
>>> correct mapping will mean it still works properly).  If the JSPs are in
>>> another location than the HTTP docs, they can't be served as raw HTML,
>>> by accident.
>>>
>>>
>>> p
>>>
>>>
>>>
>>>
>>>
>>>> Martin Gainty wrote:
>>>>> David
>>>>>
>>>>> did you check your mime-mapping in your web.xml 
>>>>> perchance are you mapping jsp to text/plain?
>>>>> is any other extension mapped to text/plain?
>>>>>
>>>>> 
>>>>> jsp
>>>>> text/plain
>>>>> 
>>>>>
>>>>> Martin 
>>>>> __ 
>>>>> Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung / 
>>>>> Note de déni et de confidentialité 
>>>>> This message is confidential. If you should not be the intended receiver, 
>>>>> then we ask politely to report. Each unauthorized forwarding or 
>>>>> manufacturing of a copy is inadmissible. This message serves only for the 
>>>>> exchange of information and has no legal binding effect. Due to the eas

Re: Browser shows source of .jsp file. Why?

2009-04-27 Thread David Rush
Martin:

I'm aware that Apache httpd will do that for its pages.  But in my case it 
appears the reverse proxy forwarding is happening before httpd would try to add 
the index.html, indicated by Tomcat access log showing a request to 
/Construction/ without the index.html.

It also appears that Tomcat (rather than Apache httpd) is initially responding 
to my http://myserver/Construction URL with a 302 (Moved Temporarily) and a 
suggestion that the browser try http://myserver/Construction/ (with trailing 
slash), as it should.  I say Tomcat's doing that rather than Apache httpd since 
the 302 response says it's from Apache-Coyote/1.1 rather than Apache/2.2.11.

Anyway, it appears that adding the setContentType("text/html") before the 
include() calls has fixed my problem.

Thanks for your help.

David

Martin Gainty wrote:
> David
> 
> Apache will automaticly append index.html to requested folder via
> http://httpd.apache.org/docs/1.3/mod/mod_dir.html#directoryindex
> 
> Does this help?
> Martin 
> __ 
> Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung / Note 
> de déni et de confidentialité 
> This message is confidential. If you should not be the intended receiver, 
> then we ask politely to report. Each unauthorized forwarding or manufacturing 
> of a copy is inadmissible. This message serves only for the exchange of 
> information and has no legal binding effect. Due to the easy manipulation of 
> emails we cannot take responsibility over the the contents.
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
> sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
> oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich 
> dem Austausch von Informationen und entfaltet keine rechtliche 
> Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen 
> wir keine Haftung fuer den Inhalt uebernehmen.
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
> destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
> l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci 
> est interdite. Ce message sert à l'information seulement et n'aura pas 
> n'importe quel effet légalement obligatoire. Étant donné que les email 
> peuvent facilement être sujets à la manipulation, nous ne pouvons accepter 
> aucune responsabilité pour le contenu fourni.
> 
> 
> 
> 
> 
> 
>> Date: Mon, 27 Apr 2009 14:46:25 +0100
>> From: p...@pidster.com
>> To: users@tomcat.apache.org
>> Subject: Re: Browser shows source of .jsp file. Why?
>>
>> David Rush wrote:
>>> Pid:
>>>
>>> Yes, I've removed the explicit mapping.
>>>
>>> "Sometimes" because when I use the URL http://myserver:8080/Construction 
>>> (direct to Tomcat listening port) it works fine (HTML is rendered).
>>> When I use http://myserver/Construction (via reverse proxy forwarding 
>>> through Apache httpd) it fails (I get HTML markup in the browser window).
>> What about "http://myserver/Construction/"; (note extra slash)
>>
>>> When I use http://myserver/Construction/index.html (where index.html is 
>>> mapped in web.xml to a controller servlet and index.html is my sole 
>>> welcome-file) it works fine.
>>>
>>> I'm not using AJP.  I'm just using straight reverse-proxy style HTTP 
>>> forwarding with mod_proxy, with this snippet from my httpd.conf file:
>> (Sorry, I spotted that after I'd sent the reply.)
>>
>>
>>> ...
>>> ProxyPass/Construction http://localhost:8080/Construction
>>> ProxyPassReverse /Construction http://localhost:8080/Construction
>>> ...
>>>
>>> My Apache httpd docroot has always been separate and distinct from my 
>>> Tomcat webapps directory.
>> Looking at your headers again, I see that Tomcat is trying to serve the
>> result as plain html.  What happens if you use "index.jsp" as the sole
>> welcome file (and map that to the controller, obviously)?
>>
>> Check "index.jsp" is included in the DirectoryIndex in HTTPD.
>>
>>
>> p
>>
>>
>>
>>> David
>>>
>>> Pid wrote:
>>>> David Rush wrote:
>>>>> I checked my web.xml, and found no mime-mapping elements at all.  I tried 
>>>>> adding one explicitly mapping the jsp extension to text/html, but it had 
>>>>> no effect.  I'm still getting HTML markup in the browser window wit

Re: Browser shows source of .jsp file. Why?

2009-04-27 Thread David Rush
Andre-John:

Actually it was the original poster who was using a hosting company.  I'm using 
machines that I have full control of.

My problem was resolved by calling setContentType("text/html") in the 
controller servlet before it used include() to send control to some .jsp files.

David

Andre-John Mas wrote:
> 
> On 27-Apr-2009, at 09:04, Pid wrote:
> 
>> David Rush wrote:
>>> I checked my web.xml, and found no mime-mapping elements at all.  I
>>> tried adding one explicitly mapping the jsp extension to text/html,
>>> but it had no effect.  I'm still getting HTML markup in the browser
>>> window with Firefox.
>>>
>>> David
>>
>> Ignore that, it's a red herring, you don't need to add mime-mappings.
>>
>> You say the problem occurs 'sometimes' with Firefox, can you elaborate
>> on which times and if there's a commonality between these requests?
>>
>>
>> The fault is usually in the AJP mapping you've configured.  Are you
>> using mod_jk, and if so, what is the config?
>>
>> Also, try splitting your HTTP docroot and Tomcat webapps folders (a
>> correct mapping will mean it still works properly).  If the JSPs are in
>> another location than the HTTP docs, they can't be served as raw HTML,
>> by accident.
> 
> He indicated in an earlier post that it was his hosting provider who
> deployed
> his application.
> 
> David, have you been able to find out how your hosting company deployed
> your
> application? Also, what is there "server" header value in the response
> header?
> 
> If your web application is properly deployed then there is no reason your
> web browser should see the raw JSP. This is because if everything works
> correctly Tomcat will have interpreted the JSP and returned you the result
> of that.
> 
> If in doubt, try to simulate the set up on your machine. Even if it doesn't
> solve the hosting provider side of things, it should help you gain a better
> understanding of how things work.
> 
> André-John
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 
> 
> 

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



Re: Browser shows source of .jsp file. Why?

2009-04-28 Thread David Rush
Andre-John Mas wrote:
...
> 
> BTW since you are using a JSP, you should be able to specify the content
> type in the JSP:
> 
> <%@ page language="java" contentType="text/html; charset=UTF-8"
> pageEncoding="UTF-8"%>
> 

Actually I tried that first, adding it to all 3 .jsp files that were included 
(rather than a single forward), but it had no obvious effect on the problem.

David

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



Tomcat 7 won't run as Windows service

2011-10-14 Thread David Rush
I've been running Tomcat 6.0.18 for a long time, and am now trying to 
upgrade to 7.0.22 (64 bit .zip download).


I can start Tomcat 7 with startup.bat and it's working fine.

The script to install it as a service worked without complaint, and the 
service is there.


However when I try to start it I get "Error 1067: The process terminated 
unexpectedly".


commons-daemon.2011-10-14.log says: [error] FindClass 
org/apache/catalina/startup/Bootstrap failed


I'm using Java 7 JDK (1.7.0, 64 bit), JAVA_HOME points to the JDK 
installation, and Java's "bin" is in my system path, on my Windows 7 
machine.


I'm using the setenv.bat in tomcat\bin that I copied from my Tomcat 6 
installation, which explicitly sets JAVA_HOME (which technically may not 
be necessary since I have JAVA_HOME env var set to the same value, but I 
need to have the option to support more that one JVM on my development 
box).  I've added a debug statement in setenv.bat that echoes something 
to a file.  When I run startup.bat, I get the echoed output.  When I try 
to start the service, I do not.


Help?

David

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



Re: Tomcat 7 won't run as Windows service

2011-10-15 Thread David Rush
No, I did not uninstall the old service.  I'd like to be able to keep 
multiple Tomcat instances going at once.  Normally I do keep multiple 
instances, each installed as a service (on different ports with 
different service names), but they've always been of the exact same version.


Would there be an issue with different Tomcat versions installed at once?

On my development box I did get the Tomcat Windows service to run after 
moving back to Java 6.


But my last attempt to install and run a Windows service on our staging 
machine is now failing to run as a service as well, although I'm not 
getting the commons-daemon error like before.  Again I can run it fine 
from startup.bat, and can install the service, but starting the service 
fails.  Nothing notable in stdout or stderr logs, either.  Event viewer 
says "The david2 Tomcat 7 service terminated with service-specific error 
0 (0x0)."  Bah.


What exactly is needed for the Tomcat bootstrapping to "find" the Java 
install that it's to use?  I thought that setting JAVA_HOME in 
setenv.bat was a way, but apparently that's not used when it runs as a 
service.  Is it a matter of having JAVA_HOME set at the time that the 
service is created, and it "keeps" that value in the service 
configuration somehow?  Or does the JAVA_HOME env var have to be set in 
the environment of the service that's trying to run, every time it starts?


David

On 10/15/2011 10:31 AM, Pid wrote:

On 14/10/2011 13:16, Konstantin Kolinko wrote:

2011/10/14 David Rush:

I've been running Tomcat 6.0.18 for a long time, and am now trying to
upgrade to 7.0.22 (64 bit .zip download).

I can start Tomcat 7 with startup.bat and it's working fine.

The script to install it as a service worked without complaint, and the
service is there.

Did you uninstall the old service first?


p




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