You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Turner, John" <JT...@AAS.com> on 2003/01/08 17:31:16 UTC

DTD for server.xml??

Hello -

I notice that the top of web.xml has:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
     PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
     "http://java.sun.com/dtd/web-app_2_3.dtd">

yet the top of server.xml has nothing.

I'm very new to XML, so forgive me if this is a lame or FA question, but is
there a DTD for server.xml?  If so, why isn't it specified in server.xml,
and what is the URL?  Is server.xml "real, official XML" or just
"convenience" XML?

- John

============================================
John Turner
jturner@aas.com | 248-488-3466
Advertising Audit Service
http://www.aas.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: DTD for server.xml??

Posted by Tim Funk <fu...@joedog.org>.
It would be almost impossible to write a DTD for server.xml since an 
admin may inject custom classes (Listeners/Loggers).

To have a dtd, we would need to know every property which can be set for 
every class (which may be made known in server.xml) since tomcat uses 
reflection from Diegester.

-Tim

Turner, John wrote:
> Hello -
> 
> I notice that the top of web.xml has:
> 
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <!DOCTYPE web-app
>      PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
>      "http://java.sun.com/dtd/web-app_2_3.dtd">
> 
> yet the top of server.xml has nothing.
> 
> I'm very new to XML, so forgive me if this is a lame or FA question, but is
> there a DTD for server.xml?  If so, why isn't it specified in server.xml,
> and what is the URL?  Is server.xml "real, official XML" or just
> "convenience" XML?
> 
> - John
> 
> ============================================
> John Turner
> jturner@aas.com | 248-488-3466
> Advertising Audit Service
> http://www.aas.com
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 
> 
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: DTD for server.xml??

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Thu, 9 Jan 2003, Martin Jacobson wrote:

> Date: Thu, 09 Jan 2003 16:06:27 +0100
> From: Martin Jacobson <ma...@libero.it>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: Tomcat Users List <to...@jakarta.apache.org>
> Subject: Re: DTD for server.xml??
>
> Craig R. McClanahan wrote:
> >
> > On Wed, 8 Jan 2003, Turner, John wrote:
> >
> >
> >>Date: Wed, 8 Jan 2003 11:31:16 -0500
> >>From: "Turner, John" <JT...@AAS.com>
> >>Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> >>To: "'tomcat-user@jakarta.apache.org'" <to...@jakarta.apache.org>
> >>Subject: DTD for server.xml??
> >>
> >>
> >>Hello -
> >>
> >>I notice that the top of web.xml has:
> >>
> >><?xml version="1.0" encoding="ISO-8859-1"?>
> >><!DOCTYPE web-app
> >>     PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
> >>     "http://java.sun.com/dtd/web-app_2_3.dtd">
> >>
> >>yet the top of server.xml has nothing.
> >>
> >>I'm very new to XML, so forgive me if this is a lame or FA question, but is
> >>there a DTD for server.xml?  If so, why isn't it specified in server.xml,
> >>and what is the URL?  Is server.xml "real, official XML" or just
> >>"convenience" XML?
> >>
> >
> >
> > There is no DTD for server.xml because there cannot be.
> >
> > The problem is that server.xml is extensible -- for example, the set of
> > attributes recognized by a <Valve> or <Context> element depends on the
> > implementation class of the internal component that corresponds to it.
> > The startup process uses Java reflection to match them up to property
> > setters on the corresponding beans.  There is no way to express this kind
> > of thing in a DTD.
> >
> > Your server.xml is (and must be) "well formed" XML.  It just cannot be
> > validated.
> >
>
> There may be other good reasons, but this isn't one of them :-)
> Here is an extract from my server.xml...
> <Logger className="org.apache.catalina.logger.FileLogger"
>   prefix="catalina_log." suffix=".txt"
>   timestamp="true"
> />
>
> This could be equally well expressed as
> <Logger className="org.apache.catalina.logger.FileLogger">
>    <property>
>      <property-name>prefix</property-name>
>      <property-value>catalina_log.</property-value>
>    </property>
>    <property>
>      <property-name>suffix</property-name>
>      <property-value>.txt</property-value>
>    </property>
>    <property>
>      <property-name>timestamp</property-name>
>      <property-value>true</property-value>
>    </property>
> </Logger>
>
> or, more concisely as
>
> <Logger className="org.apache.catalina.logger.FileLogger">
>    <property name="prefix" value="catalina_log."/>
>    <property name="suffix" value=".txt"/>
>    <property name="timestamp" value="true"/>
> </Logger>
>
> In both cases, the abstraction of property names allows a DTD to be
> defined that is inherently extensible, and thus would allow an XML
> parser to validate server.xml even if extended by an admin.
>
> Or am I missing something?
>

Well, most people edit server.xml by hand, and even your more "concise"
version is a lot of extra typing :-).  It also doesn't cover the case
where a <Listener> element that you might have dynamically creates some
new digester rules (commons-digester is what Tomcat uses to read
server.xml and web.xml files) to recognize additional elements on the fly.

The right answer to editing server.xml files is to not do it -- let a tool
do it for you.  That way, the syntax is irrelevant to the user.

> Martin

Craig



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: DTD for server.xml??

Posted by Martin Jacobson <ma...@libero.it>.
Craig R. McClanahan wrote:
> 
> On Wed, 8 Jan 2003, Turner, John wrote:
> 
> 
>>Date: Wed, 8 Jan 2003 11:31:16 -0500
>>From: "Turner, John" <JT...@AAS.com>
>>Reply-To: Tomcat Users List <to...@jakarta.apache.org>
>>To: "'tomcat-user@jakarta.apache.org'" <to...@jakarta.apache.org>
>>Subject: DTD for server.xml??
>>
>>
>>Hello -
>>
>>I notice that the top of web.xml has:
>>
>><?xml version="1.0" encoding="ISO-8859-1"?>
>><!DOCTYPE web-app
>>     PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
>>     "http://java.sun.com/dtd/web-app_2_3.dtd">
>>
>>yet the top of server.xml has nothing.
>>
>>I'm very new to XML, so forgive me if this is a lame or FA question, but is
>>there a DTD for server.xml?  If so, why isn't it specified in server.xml,
>>and what is the URL?  Is server.xml "real, official XML" or just
>>"convenience" XML?
>>
> 
> 
> There is no DTD for server.xml because there cannot be.
> 
> The problem is that server.xml is extensible -- for example, the set of
> attributes recognized by a <Valve> or <Context> element depends on the
> implementation class of the internal component that corresponds to it.
> The startup process uses Java reflection to match them up to property
> setters on the corresponding beans.  There is no way to express this kind
> of thing in a DTD.
> 
> Your server.xml is (and must be) "well formed" XML.  It just cannot be
> validated.
> 

There may be other good reasons, but this isn't one of them :-)
Here is an extract from my server.xml...
<Logger className="org.apache.catalina.logger.FileLogger"
  prefix="catalina_log." suffix=".txt"
  timestamp="true"
/>

This could be equally well expressed as
<Logger className="org.apache.catalina.logger.FileLogger">
   <property>
     <property-name>prefix</property-name>
     <property-value>catalina_log.</property-value>
   </property>
   <property>
     <property-name>suffix</property-name>
     <property-value>.txt</property-value>
   </property>
   <property>
     <property-name>timestamp</property-name>
     <property-value>true</property-value>
   </property>
</Logger>

or, more concisely as

<Logger className="org.apache.catalina.logger.FileLogger">
   <property name="prefix" value="catalina_log."/>
   <property name="suffix" value=".txt"/>
   <property name="timestamp" value="true"/>
</Logger>

In both cases, the abstraction of property names allows a DTD to be 
defined that is inherently extensible, and thus would allow an XML 
parser to validate server.xml even if extended by an admin.

Or am I missing something?

Martin


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: One other freaky thing

Posted by Jason Koeninger <jk...@jjcc.com>.
I've seen the same thing on Tomcat 3.3.x.  Our upgrade to Tomcat 4.0.6 
seems to have corrected it.

Good luck...

Best Regards,

Jason Koeninger
J&J Computer Consulting
http://www.jjcc.com

On Wed, 8 Jan 2003 19:59:25 -0500 (EST), Jason Pyeron wrote:

>We had a similar problem running tomcat 3.x (3.3?) and apache 1.x (1.19?)
>
>mod_jk sometimes would deliver static html/gfx from one context to 
>another. Also there would be session corruption.
>
>To the best of my knowledge there was a on-line casino which had the same 
>problem.
>
>I was never able to track this down. My only solution was to connect 
>directly to tomcat.
>
>-jason pyeron
>
>
>On Wed, 8 Jan 2003, Michael Molloy wrote:
>
>Our application is running on a server in Pennsylvania. A user there 
>was working as well as a user in Tennessee. The user in Tennessee got 
>an error on a page, hit her back key, and the user in Pennsylvania's 
>screen showed up on the Tennessee user's screen.  The people in 
>Tennessee are connected to the Pennsylvania system via a frame relay.
>
>Everything is contained within each user's session, so this should 
>never happen. The application has been under development for a year 
>now, and this has never happened before.
>
>Some kind of weird bug that we shouldn't worry about, or something that 
>someone else has encountered?
>
>Thanks for any help,
>--Michael Molloy
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
>-- 
>-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
>-                                                               -
>- Jason Pyeron                   http://www.pyerotechnics.com   -
>- Owner & Lead                  Pyerotechnics Development, Inc. -
>- +1 410 808 6646 (c)           500 West University Parkway #1S -
>- +1 410 467 2266 (f)           Baltimore, Maryland  21210-3253 -
>-                                                               -
>-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
>
>This message is for the designated recipient only and may contain 
>privileged, proprietary, or otherwise private information. If you
>have received it in error, purge the message from your system and 
>notify the sender immediately.  Any other use of the email by you 
>is prohibited.
>
>
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: One other freaky thing

Posted by Jason Pyeron <ja...@pyeron.com>.
We had a similar problem running tomcat 3.x (3.3?) and apache 1.x (1.19?)

mod_jk sometimes would deliver static html/gfx from one context to 
another. Also there would be session corruption.

To the best of my knowledge there was a on-line casino which had the same 
problem.

I was never able to track this down. My only solution was to connect 
directly to tomcat.

-jason pyeron


On Wed, 8 Jan 2003, Michael Molloy wrote:

Our application is running on a server in Pennsylvania. A user there 
was working as well as a user in Tennessee. The user in Tennessee got 
an error on a page, hit her back key, and the user in Pennsylvania's 
screen showed up on the Tennessee user's screen.  The people in 
Tennessee are connected to the Pennsylvania system via a frame relay.

Everything is contained within each user's session, so this should 
never happen. The application has been under development for a year 
now, and this has never happened before.

Some kind of weird bug that we shouldn't worry about, or something that 
someone else has encountered?

Thanks for any help,
--Michael Molloy


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-                                                               -
- Jason Pyeron                   http://www.pyerotechnics.com   -
- Owner & Lead                  Pyerotechnics Development, Inc. -
- +1 410 808 6646 (c)           500 West University Parkway #1S -
- +1 410 467 2266 (f)           Baltimore, Maryland  21210-3253 -
-                                                               -
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

This message is for the designated recipient only and may contain 
privileged, proprietary, or otherwise private information. If you
have received it in error, purge the message from your system and 
notify the sender immediately.  Any other use of the email by you 
is prohibited.




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


One other freaky thing

Posted by Michael Molloy <mm...@ncycles.com>.
Our application is running on a server in Pennsylvania. A user there 
was working as well as a user in Tennessee. The user in Tennessee got 
an error on a page, hit her back key, and the user in Pennsylvania's 
screen showed up on the Tennessee user's screen.  The people in 
Tennessee are connected to the Pennsylvania system via a frame relay.

Everything is contained within each user's session, so this should 
never happen. The application has been under development for a year 
now, and this has never happened before.

Some kind of weird bug that we shouldn't worry about, or something that 
someone else has encountered?

Thanks for any help,
--Michael Molloy


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Tomcat oddities

Posted by "Noel J. Bergman" <no...@devtech.com>.
> Tomcat 4.1.12 is running behind Apache on Windows 2000 on a
> single cpu box, and Oracle is running on a separate Windows
> 2000 2-way box. (Windows was the client decision, not ours.)

Have you checked the 4.1 change log to see if there are fixes past 4.1.12
that might impact you?

> When there are several users on the system, maybe up to 15,
> there is a freeze during which no one can get any responses
> back from Tomcat.  This period usually lasts from 5 to 15
> minutes, after which the system returns to normal and everything
> zips along.

That doesn't sound like GC (not for 5 - 15 min).  That sounds like a
resource lockup hanging things until it times out.  Is it possible that
you're locking up on the database?  Which JVM and JDBC driver?

> nor do we have access to the server so we can't check task manager.

Might I suggest that you fix that situation?

> We've had two reports where a user has had data from an old session
> show up in his/her current session.

Are you *sure* that the session was terminated?  You might want to use the
TomcatTestListener class that I posted last year to watch what happens.  The
sort of thing you are describing is similar to why I wrote it.

	--- Noel


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Tomcat oddities

Posted by Michael Molloy <mm...@ncycles.com>.
My company is in the deployment stage of a project that uses tomcat to 
serve information from an oracle database to about 25 people. When the 
app goes live, there will be about 150 people connected at any one 
time. Tomcat 4.1.12 is running behind Apache on Windows 2000 on a 
single cpu box, and Oracle is running on a separate Windows 2000 2-way 
box. (Windows was the client decision, not ours.)

Issue One
We're seeing two serious issues, the first of which happens about once 
a day, sometimes more. When there are several users on the system, 
maybe up to 15, there is a freeze during which no one can get any 
responses back from Tomcat. This period usually lasts from 5 to 15 
minutes, after which the system returns to normal and everything zips 
along.

We've tuned queries, so we don't think that is the problem. There may 
still be a rogue query out there causing problems, but we think it's 
unlikely. Besides, I don't know why that would stop everyone, which is 
what's happening.

Another possibility that we've discussed is that tomcat is simply using 
all of the memory and everything basically stops until GC occurs. This 
seems the most likely to me, but I wanted to ask the group. I don't 
know what the page file size is, nor do we have access to the server so 
we can't check task manager.

Can anyone think of any other possibilities?

Issue Two
We've had two reports where a user has had data from an old session 
show up in his/her current session. For example, I wrote a class that 
stores information from 14 different JSPs. The object is put into the 
user's session. In these two occasions, the user entered a new record 
using these screens & saved the data to the database. The user took an 
hour lunch break, which would have been long enough to timeout (set at 
20 minutes), returned, and queried a different record. Some of the data 
from the previous record showed up in the holder class in his/her 
current session and was saved to the database.

Any idea what that could be? The only thing I can think of is that IE 
is doing some data caching & mixing things up a bit.

Any suggestions will be greatly appreciated. We really need to get this 
figured out quickly.

Thanks
--Michael Molloy


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: DTD for server.xml??

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Wed, 8 Jan 2003, Turner, John wrote:

> Date: Wed, 8 Jan 2003 11:31:16 -0500
> From: "Turner, John" <JT...@AAS.com>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: "'tomcat-user@jakarta.apache.org'" <to...@jakarta.apache.org>
> Subject: DTD for server.xml??
>
>
> Hello -
>
> I notice that the top of web.xml has:
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <!DOCTYPE web-app
>      PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
>      "http://java.sun.com/dtd/web-app_2_3.dtd">
>
> yet the top of server.xml has nothing.
>
> I'm very new to XML, so forgive me if this is a lame or FA question, but is
> there a DTD for server.xml?  If so, why isn't it specified in server.xml,
> and what is the URL?  Is server.xml "real, official XML" or just
> "convenience" XML?
>

There is no DTD for server.xml because there cannot be.

The problem is that server.xml is extensible -- for example, the set of
attributes recognized by a <Valve> or <Context> element depends on the
implementation class of the internal component that corresponds to it.
The startup process uses Java reflection to match them up to property
setters on the corresponding beans.  There is no way to express this kind
of thing in a DTD.

Your server.xml is (and must be) "well formed" XML.  It just cannot be
validated.

> - John

Craig


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>