RE: Java q: round to n decimal points?

2002-11-17 Thread Hari Yellina
in NuberFormat, Please use the fucntion setMaximumDecimalPoints and Miminum
Decimal Points.

-Original Message-
From: Josh G [mailto:[EMAIL PROTECTED]]
Sent: Thursday, November 14, 2002 05:54 PM
To: Tomcat Users List
Subject: Java q: round to n decimal points?


Is there a nice easy way to round a double to n decimal points? I couldn't
see anything in Math,Double,String, or NumberFormat...

-Josh
--
And can you tell me doctor why I still can't get to sleep?
And why the channel 7 chopper chills me to my feet?
And what's this rash that comes and goes, can you tell me what it means?
God help me, I was only 19



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


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




RE: Servlet filter mapping

2002-11-17 Thread Reynir Hübner

Thanx craig.

I wonder why this is not a part of the spec, as it could be very usefull.

Is there a way of setting the url-patterns on runtime, or only in web.xml ?

Thanx again, 
-reynir



 
 There are only four standard URL patterns (and this applies 
 to servlet mappings and security constraints as well as 
 filter mappings):
 
 * Exact match (/foo)
 * Path match (/foo/*)
 * Extension match (*.foo)
 * Default servlet (/) which is useful only for servlet mappings
 
 There is no legal syntax to say all but this set of paths.
 
 Craig
 

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




why Tomcat 4.0.4 creates new instance of servlet, when applet make first request to servlet?

2002-11-17 Thread Daniil Ivanov
Given:
Tomcat 4.0.4 and servlet, that was already initialized when browser made
request to it.

When browser window with applet opens, applet begin periodically query the
servlet through standard method doPost. But at the first request applet to
servlet Tmcat creates a new instance to servlet, in spite of that the
servlet was initialized before.
I do't whant to have  a two instances of servlet, because applet must get
from servlet a members of servlet class, that were already changed before by
previous request from browser (not from applet).



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




RE: JSP1.2 xml syntax

2002-11-17 Thread Doug Blackburn
David,
That worked. I was able to set the content type in the page directive. I
guess I was being a little stubborn since it worked on the other two
servers. Tomcat is just not so forgiving.
Thanks again.
Doug

-Original Message-
From: David Tildesley [mailto:[EMAIL PROTECTED]]
Sent: Sunday, November 17, 2002 1:51 AM
To: Tomcat Users List
Subject: RE: JSP1.2 xml syntax


Doug,

If you look at what you are sending to the browser - html right (the stuff
in the CDATA elements)?
yet you have the contenttype set to xml.
IE is therefore told the content type is xml, expects to receive well-formed
xml yet gets fed non-well-formed html from your jsp script and then
correctly tells you what and where the problem is.

Why don't you take the simple step and do:
response.setContentType(text/html;charset=UTF-8)

David.
-Original Message-
From: Doug Blackburn [mailto:[EMAIL PROTECTED]]
Sent: Sunday, 17 November 2002 12:39 p.m.
To: Tomcat Users List
Subject: RE: JSP1.2 xml syntax


David,

Thanks for you suggestion.  I just looked at the Tomcat generated
TableEntry_jsp used to process the requests. It has
response.setContentType(text/xml;charset=UTF-8).  I think that should work
fine. The only difference between that and the servlet generated by the Sun
J2ee Ref Impl Server is that charset=ISO-8859-1.

Am I missing something here?

Doug

-Original Message-
From: David Tildesley [mailto:[EMAIL PROTECTED]]
Sent: Saturday, November 16, 2002 5:34 PM
To: Tomcat Users List
Subject: RE: JSP1.2 xml syntax


reading beween the lines:

it seems IE it not happy because it thinks it needs to display it as XML so
it looks like a mime type setting in the header. Set it it text/html and it
should be fine :-)



-Original Message-
From: Doug Blackburn [mailto:[EMAIL PROTECTED]]
Sent: Sunday, 17 November 2002 10:28 a.m.
To: Tomcat Users List
Subject: RE: JSP1.2 xml syntax


It looks like Tomcat 4.1.12 may not support this jsp1.2 coding style. Any
comments, suggestions?

-Original Message-
From: Doug Blackburn [mailto:[EMAIL PROTECTED]]
Sent: Saturday, November 16, 2002 2:06 AM
To: Tomcat Users List
Subject: RE: JSP1.2 xml syntax


I just ran this jsp successfully on Weblogic 7.0 without any modifications.

-Original Message-
From: Doug Blackburn [mailto:[EMAIL PROTECTED]]
Sent: Saturday, November 16, 2002 12:43 AM
To: Tomcat Users List
Subject: RE: JSP1.2 xml syntax


Ok. I received the following error when running on Tomcat.  This same code
worked fine on Sun J2ee RI server. The code follows the error message.

The XML page cannot be displayed

Cannot view XML input using XSL style sheet.  Please correct the error and
then click the Refresh button, or try again later.

End tag HEAD does not match the start tag 'LINK'. Error processing
resource
'http://localhost:8080/metadataTags/TableEntry.jsp'. Line 8, Position 5

/HEAD


Jsp Code follows:

jsp:root
  xmlns:jsp=http://java.sun.com/JSP/Page;
  xmlns:md=/metadataTags.tld
  version=1.2

jsp:directive.page errorPage=Error.jsp/
jsp:useBean id=mdbean scope=session class=metadataTags.MDBean /
jsp:setProperty name=mdbean property=tablename /

jsp:text![CDATA[
  HTML

  HEAD
  TITLEMeta Data Table Entry/TITLE
  SCRIPT language=JavaScript SRC=common.js/SCRIPT
  LINK rel=stylesheet href=Styles.css type=text/css
  /HEAD

  BODY

  H1Meta Data Display/H1
  BR

  H2Enter Table Name:/H2
  P
  FORM name=tbl method=post onSubmit=return SubmitPressed()
  LABEL for=tablenameTable Name:/LABEL
  INPUT type=text name=tablename size=10
  BR
  INPUT type=submit value=Submit
  /FORM
  /P
]]/jsp:text

md:confirm

  jsp:scriptletSystem.out.println(message BEFORE SCRIPT =  +
message);/jsp:scriptlet

  jsp:text![CDATA[SCRIPT language=JavaScriptCheckMsg(]]/jsp:text
  jsp:expressionmessage/jsp:expression
  jsp:text![CDATA[)/SCRIPT]]/jsp:text

  jsp:scriptletSystem.out.println(message AFTER SCRIPT =  +
message);/jsp:scriptlet

/md:confirm

jsp:forward page=TableDisplay.jsp/

jsp:text![CDATA[
  /BODY
  /HTML
]]/jsp:text

/jsp:root

-Original Message-
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
Sent: Saturday, November 16, 2002 12:18 AM
To: Tomcat Users List
Subject: Re: JSP1.2 xml syntax




On Fri, 15 Nov 2002, Doug Blackburn wrote:

 Date: Fri, 15 Nov 2002 22:57:56 -0500
 From: Doug Blackburn [EMAIL PROTECTED]
 Reply-To: Tomcat Users List [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: JSP1.2 xml syntax

 According to JSP1.2 spec HTML tags within the JSP page written in XML
syntax
 can be encapsulated in jsp:text![CDATA[. ]]/jsp:text. I used
this
 construction successfully when deploying to the J2EE Reference
 Implementation server from Sun. However, when I ported it to Tomcat 4.1.12
I
 received XML parsing errors within the CDATA section.

 Any insight would be greatly appreciated.

How is anyone supposed to be able to offer any useful advice unless you
show us the source for a page that works in one environment but not the
other?  And show us 

RE: why Tomcat 4.0.4 creates new instance of servlet, when applet make first request to servlet?

2002-11-17 Thread Reynir Hübner

If I understand you correctly I think I must say a servlet get's initialized once, 
when it's loaded (by the classloader), and then only again if it's changed.
A servlets runtime is within the scope of one request, so if you want to execute the 
same servlet twice, first to set member variables then with an applet and read from 
the member variables, I cannot see how it could be achived, exept maybe by using 
alternative methods, such as keeping the variables in servlet context, but not as 
member variables in the servlet.

Hope it helps
-reynir


 -Original Message-
 From: Daniil Ivanov [mailto:[EMAIL PROTECTED]] 
 Sent: 17. nóvember 2002 13:58
 To: [EMAIL PROTECTED]
 Subject: why Tomcat 4.0.4 creates new instance of servlet, 
 when applet make first request to servlet?
 
 
 Given:
 Tomcat 4.0.4 and servlet, that was already initialized when 
 browser made request to it.
 
 When browser window with applet opens, applet begin 
 periodically query the servlet through standard method 
 doPost. But at the first request applet to servlet Tmcat 
 creates a new instance to servlet, in spite of that the 
 servlet was initialized before. I do't whant to have  a two 
 instances of servlet, because applet must get from servlet a 
 members of servlet class, that were already changed before by 
 previous request from browser (not from applet).
 
 
 
 --
 To unsubscribe, e-mail:   
 mailto:[EMAIL PROTECTED]
 For 
 additional commands, e-mail: 
 mailto:[EMAIL PROTECTED]
 
 

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




RE: Can I use Structs in Tomcat 4.1.12?

2002-11-17 Thread Reynir Hübner
My guess is you're asking about struts, but not structs ?
Yes you can, see http://jakarta.apache.org/struts

Hope it helps
-reynir


 -Original Message-
 From: Cui Jun [mailto:[EMAIL PROTECTED]] 
 Sent: 17. nóvember 2002 04:52
 To: [EMAIL PROTECTED]
 Subject: Can I use Structs in Tomcat 4.1.12? 
 
 
  
  
 
 __
 Do you Yahoo!?
 Yahoo! Web Hosting - Let the expert host your site 
http://webhosting.yahoo.com

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


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




RE: servlet classpath

2002-11-17 Thread Reynir Hübner
Try putting your servlet into your webapplications lib directory, its usually under, 

Your_web_application/WEB-INF/classes (if it's not packaged) or 
Your_web_application/WEB-INF/lib (if it's packaged in a jar file).

The size of your terminal screen does not matter. 
hope it helps
-reynir


 -Original Message-
 From: chasee [mailto:[EMAIL PROTECTED]] 
 Sent: 16. nóvember 2002 20:31
 To: tomcat user
 Subject: servlet classpath
 
 
 Hello all,
 
 the class loader of my tomcat stand-alone server (jakarta4.0.4) has 
 problems finding classes for my SERVLET. it gives a 
 java.lang.NoClassDefFoundError.
 
 I checked the classpath environment variable using echo 
 %classpath%. It 
 is properly set. The only thing I have doubt about is my 
 classpath is 
 way too long with 20 lines also. (in the command window of a width of 
 80 chars). Would that affect the behavior of the server in any way? 
 
 thanks, Chasee
 
 
 
 -
 Do you Yahoo!?
 Yahoo! Web Hosting - Let the expert host your site
 

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




Re:Re: why Tomcat 4.0.4 creates new instance of servlet, when applet make first request to servlet?

2002-11-17 Thread Daniil Ivanov




 If I understand you correctly I think I must say a servlet get's
initialized once, when it's loaded (by the classloader), and then only again
if it's changed.

It must be so in theory, but in fact I see, that when applet request servlet
(that was already initialized) at first time, the servlet function init()
automatically called, and only after that execute servlet method doPost().
So, the Tomcat creates new instance of servlet - because I see, that the
first instance of servlet(to which were requests only from browser, not from
applet) exists parallel to the new instance().
At the following requests from applet to the servlet function init() does't
execute's and no new instances are created.



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




Re: Can I use Structs in Tomcat 4.1.12?

2002-11-17 Thread Pae Choi
reynir,

Man! You MUST be a good guesser. It would cost to pull
all my hairs to figure out. There's no guarantee that I will
be able to figure out after having no hair at all though. :-)


Pae


- Original Message -
From: Reynir Hübner [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Sunday, November 17, 2002 6:32 AM
Subject: RE: Can I use Structs in Tomcat 4.1.12?


My guess is you're asking about struts, but not structs ?
Yes you can, see http://jakarta.apache.org/struts

Hope it helps
-reynir


 -Original Message-
 From: Cui Jun [mailto:[EMAIL PROTECTED]]
 Sent: 17. nóvember 2002 04:52
 To: [EMAIL PROTECTED]
 Subject: Can I use Structs in Tomcat 4.1.12?





 __
 Do you Yahoo!?
 Yahoo! Web Hosting - Let the expert host your site
http://webhosting.yahoo.com

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


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



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




Re: Unable to find setter method

2002-11-17 Thread Jim Cobban
- Original Message -
From: David M. Karr [EMAIL PROTECTED]
Subject: Re: Unable to find setter method



 And there are no other overloaded setters for these properties in either
of
 these two classes?  Is the base class a public class?  Are there any
getter
 methods for either of these two properties?

Those are the only set methods.  The base class is also declared public.
The get methods for the two properties exist and return the int values.


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




using multiple Contexts

2002-11-17 Thread Adrian
I`m having trouble logging for multiple Contexts.
does this look right
Context path=/mynewdir docbase=mynewdir debug=0
Valve className=org.apache.catalina.valves.AccessLogValve
prefix=mynewdirLog suffix=.txt /
Context/

does this need to nest inside of the default Context ?
If anyone has an server.xml that works in this capacity,
I would appreciate it.

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




RE: servlet classpath

2002-11-17 Thread chasee

My thanks for your response. Actually the trouble is in finding the supporting classes 
of the servlet,not the servlet itself. My servlet is in ROOT\WEB-INF\classes, while 
the supporting classes is in a package outside of tomcat installation dir. I was 
hoping the server classloader would have no problem finding them with the help from 
CLASSPATH. Turns out the class loader refuse to refer to the CLASSPATH. We'd have 
to put everthing under webapp/web-inf. If any of the answerers of this question find 
my statement inproper, pls point out. 
thanks, Chasee
 Reynir_Hübner [EMAIL PROTECTED] wrote:Try putting your servlet into your 
webapplications lib directory, its usually under, 

Your_web_application/WEB-INF/classes (if it's not packaged) or 
Your_web_application/WEB-INF/lib (if it's packaged in a jar file).

The size of your terminal screen does not matter. 
hope it helps
-reynir


 -Original Message-
 From: chasee [mailto:[EMAIL PROTECTED]] 
 Sent: 16. nóvember 2002 20:31
 To: tomcat user
 Subject: servlet classpath
 
 
 Hello all,
 
 the class loader of my tomcat stand-alone server (jakarta4.0.4) has 
 problems finding classes for my SERVLET. it gives a 
 java.lang.NoClassDefFoundError.
 
 I checked the classpath environment variable using echo 
 %classpath%. It 
 is properly set. The only thing I have doubt about is my 
 classpath is 
 way too long with 20 lines also. (in the command window of a width of 
 80 chars). Would that affect the behavior of the server in any way? 
 
 thanks, Chasee
 
 
 
 -
 Do you Yahoo!?
 Yahoo! Web Hosting - Let the expert host your site
 

--
To unsubscribe, e-mail: 
For additional commands, e-mail: 



-
Do you Yahoo!?
Yahoo! Web Hosting - Let the expert host your site


Why do I have to restart the server

2002-11-17 Thread chasee

Hello all,

Running jakarta 4.0.4. Placing my servlet under ROOT\WEB-INF\classes. 

In server.xml, I uncomment the context declaration for ROOT application and make 
reloadable true. Everytime I modify and recompile the servlet class, the tomcat 
window print out a notice of modification of the servlet. However, whenever I try to 
invoke the servlet, the server could not find it.  I have to shutdown and restart the 
server. Any thoughts on it?

Thanks, Chasee



-
Do you Yahoo!?
Yahoo! Web Hosting - Let the expert host your site


Tomcat Startup 2 errors

2002-11-17 Thread Triptpal Singh Lamba
1. I have 3 versions of Tomcat, 2 are associated with Jbuilder.
These 2 versions start off and give me an error described below. The
point to note is that the command window(dos) in which I  run it stays and
does not disappear.

2. Downloaded a version of Tomcat , the  port for which I have chosen as
8000. I have tried starting it from startup.bat and catalina.bat run
options.

In all cases above 1 and 2 , Tomcat is starting off - that is 100% sure. (I
can see http://localhost:portno/ page). In case 1 the tomcat server window
stays on the screen. In case 2 it disappears but I can see it is running as
a process after doing CTRL-ALT-DELETE for windows XP.

The exceptions in all cases is similar :-
Why is this exception coming and how can I remove it.

So my questions are :-
1. How do I remove the exception below.
2. In CASE 2 above, while running tomcat server ,why does the does window
not remain on screen and  disappear ( something like echo on should make
it remain,not go as a background process, I have tried catalina.bat start
also, Funnily the Tomcat servers with JBuilder remain on screen , this is
imp for jsp debugging later on and System.out.printlns etc . )


Thanks
Tript Singh

I am copying pasting the exception below:-

C:\Tomcat4\Tomcat 4.1\bincatalina.bat run
Using CATALINA_BASE:   ..
Using CATALINA_HOME:   ..
Using CATALINA_TMPDIR: ..\temp
Using JAVA_HOME:   c:\j2sdk1.4.1
Nov 17, 2002 12:44:00 PM org.apache.commons.modeler.Registry loadRegistry
INFO: Loading registry information
Nov 17, 2002 12:44:00 PM org.apache.commons.modeler.Registry getRegistry
INFO: Creating new Registry instance
Nov 17, 2002 12:44:01 PM org.apache.commons.modeler.Registry getServer
INFO: Creating MBeanServer
Nov 17, 2002 12:44:02 PM org.apache.coyote.http11.Http11Protocol init
SEVERE: Error initializing endpoint
java.net.BindException: Address already in use: JVM_Bind:8000
at
org.apache.tomcat.util.net.PoolTcpEndpoint.initEndpoint(PoolTcpEndpoint.java
:268)
at
org.apache.coyote.http11.Http11Protocol.init(Http11Protocol.java:150)
at
org.apache.coyote.tomcat4.CoyoteConnector.initialize(CoyoteConnector.java:10
02)
at
org.apache.catalina.core.StandardService.initialize(StandardService.java:579
)
at
org.apache.catalina.core.StandardServer.initialize(StandardServer.java:2245)
at org.apache.catalina.startup.Catalina.start(Catalina.java:509)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
Catalina.start: LifecycleException:  Protocol handler initialization failed:
java.net.BindException
 Address already in use: JVM_Bind:8000
LifecycleException:  Protocol handler initialization failed:
java.net.BindException: Address alread
 in use: JVM_Bind:8000
at
org.apache.coyote.tomcat4.CoyoteConnector.initialize(CoyoteConnector.java:10
04)
at
org.apache.catalina.core.StandardService.initialize(StandardService.java:579
)
at
org.apache.catalina.core.StandardServer.initialize(StandardServer.java:2245)
at org.apache.catalina.startup.Catalina.start(Catalina.java:509)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
Catalina.stop: LifecycleException:  This server has not yet been started
LifecycleException:  This server has not yet been started
at
org.apache.catalina.core.StandardServer.stop(StandardServer.java:2212)
at org.apache.catalina.startup.Catalina.start(Catalina.java:541)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)






--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]

Listener Object

2002-11-17 Thread josh
Hi

i have a HttpSessionListener object that is deployed in the web.xml file. At
Tomcat startup two instances of that listener class are created. Is it
normal that two instances of the listener class are created? Why? If not,
where could the second instance come from?

Thanks for your answers.
Josh



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




Can all vhosts share one Webapp?

2002-11-17 Thread Brandon Cruz
Can I have all my virtual hosts share one webapp?  I would like to avoid
having to declare a context for every single virtual host.  This causes way
too many threads on startup and slows the system down.

Any ideas?  We are using tomcat 4.1.12 and apache 1.3.26.

Thanks!

Brandon


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




RE: Servlet filter mapping

2002-11-17 Thread Craig R. McClanahan


On Sun, 17 Nov 2002, Reynir Hübner wrote:

 Date: Sun, 17 Nov 2002 10:53:20 -
 From: Reynir Hübner [EMAIL PROTECTED]
 Reply-To: Tomcat Users List [EMAIL PROTECTED]
 To: Tomcat Users List [EMAIL PROTECTED]
 Subject: RE: Servlet filter mapping


 Thanx craig.

 I wonder why this is not a part of the spec, as it could be very usefull.


If you map your filter to /*, it can already make whatever dynamic
decisions it wants to about dealing with the request.  Therefore, it
doesn't really need to be in the container.

 Is there a way of setting the url-patterns on runtime, or only in web.xml ?

The only standard mechanism is to create the patterns in web.xml.



 Thanx again,
 -reynir

Craig




 
  There are only four standard URL patterns (and this applies
  to servlet mappings and security constraints as well as
  filter mappings):
 
  * Exact match (/foo)
  * Path match (/foo/*)
  * Extension match (*.foo)
  * Default servlet (/) which is useful only for servlet mappings
 
  There is no legal syntax to say all but this set of paths.
 
  Craig
 

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




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




Re: Can all vhosts share one Webapp?

2002-11-17 Thread Craig R. McClanahan


On Sun, 17 Nov 2002, Brandon Cruz wrote:

 Date: Sun, 17 Nov 2002 15:44:12 -0600
 From: Brandon Cruz [EMAIL PROTECTED]
 Reply-To: Tomcat Users List [EMAIL PROTECTED]
 To: Tomcat Users List [EMAIL PROTECTED]
 Subject: Can all vhosts share one Webapp?

 Can I have all my virtual hosts share one webapp?  I would like to avoid
 having to declare a context for every single virtual host.

You can do this by taking advantage of the defaultHost attribute on the
Engine element.  If a request comes into Tomcat with an unrecognized
host name, it is assigned automatically to the Host element that is
speicified by defaultHost.

The out-of-the-box configuration uses this technique to assign all
requests for all virtual hosts to the Host named localhost, which is
the single set of webapps nested inside that host.

  This causes way
 too many threads on startup and slows the system down.


Unless you are starting threads in your own servlets, the number of host
elements and webapps has neglible impact on the number of threads that
Tomcat starts.  That is driven primarily by how you configure your
Connector elements; and the connector threads that process requests are
shared across all the hosts and webapps.

 Any ideas?  We are using tomcat 4.1.12 and apache 1.3.26.

The above info is about the Tomcat side of things -- you'll need to ask
someone else about the Apache connector configuration for this to work.


 Thanks!

 Brandon

Craig


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




Tomcat on a separate machine

2002-11-17 Thread Lee Grey
I have server1 running both Apache2 and an instance of Tomcat4.  I have
server2 running its own instance of Tomcat4.  The Tomcats on server1 and
server2 are running different applications.

I am currently trying to get requests for urlinone.com received by Apache at
server1 forwarded to the Tomcat at server2.  It seems like they see each
other, because, when I shut down Apache on server1, server2's log shows:

Nov 17, 2002 4:14:29 PM org.apache.jk.common.ChannelSocket processConnection
WARNING: server has closed the current connection (-1)
Nov 17, 2002 4:14:29 PM org.apache.jk.common.ChannelSocket processConnection
WARNING: server has closed the current connection (-1)

However, I don't see any indication that servlet requests are getting from
Apache on server1 to Tomcat on server2.  There is no log activity on server2
to match the requests shown at server1.

On server1, Apache httpd.conf contains, in part:

NameVirtualHost *
IfModule !mod_jk.c
  LoadModule jk_module /usr/local/apache/modules/mod_jk.so
/IfModule
# Am I supposed to have AddModule mod_jk anywhere?  There are no AddModule
statements in this file.
JkWorkersFile /var/tomcat4/conf/jk/workers.properties
JkLogFile /var/tomcat4/logs/mod_jk.log
JkLogLevel info
JkLogStampFormat [%a %b %d %H:%M:%S %Y]
VirtualHost *
ServerName www.urlinone.com
ServerAlias urlinone.com
DocumentRoot /var/tomcat4/webapps/urlinone
ErrorLog /var/tomcat4/logs/urlinone-errorlog
CustomLog /var/tomcat4/logs/urlinone-access.log common
Alias / /var/tomcat4/webapps/urlinone/
JkMount /servlet/* server2
/VirtualHost

Server1's workers.properties file says:

worker.list=server1,server2
worker.server1.type=ajp13
worker.server1.host=192.168.1.80
worker.server1.port=8009

worker.server2.type=ajp13
worker.server2.host=192.168.1.50
worker.server2.port=8009

Server2's server.xml file says, in part:

  Service name=Tomcat-Apache
DefaultContext reloadable=true/
Connector className=org.apache.coyote.tomcat4.CoyoteConnector
 port=8009 minProcessors=5 maxProcessors=75
 enableLookups=true appBase=webapps
 acceptCount=10 debug=0/
Engine name=Standalone defaultHost=www.urlinone.com debug=0
  Logger className=org.apache.catalina.logger.FileLogger
  prefix=urlinone_log. suffix=.txt
  timestamp=true/
  Realm className=org.apache.catalina.realm.MemoryRealm /
/Engine
  /Service

The Apache log shows a request being successfully completed:

192.168.1.1 - - [17/Nov/2002:16:27:27 -0500] GET /index.html HTTP/1.1 304
0
192.168.1.1 - - [17/Nov/2002:16:27:27 -0500] GET /urlinone.js HTTP/1.1 304
0
192.168.1.1 - - [17/Nov/2002:16:27:27 -0500] GET /servlet/PagePump
HTTP/1.1 200 0

But there is no activity, as far as I can see, on server2.  Server1 is
running Red Hat 7.3 and Tomcat 4.1.12, while server2 is running Red Hat 7.2
and Tomcat 4.0.3.  I had to download all the jars at
http://jakarta.apache.org/builds/jakarta-tomcat-connectors/coyote/release/v1
.0-rc2/ to get Coyote running on server2, so I'm wondering if there is some
incompatibility there.  Despite the instructions on that page, I do not have
a jk2.properties file, nor do I have tomcat-jni.jar, because I don't think
I'm using either of those, since I'm using mod_jk.  I also don't believe
there is any need for a workers.properties file on server2, since that is
for mod_jk in Apache, right?

The only other thing, and I don't know if this is a red flag or a red
herring, is that mod_jk.log on server1 gives bursts of errors sometimes,
although 90% of the time it's when Tomcat on server2 is starting up or
shutting down.  I have seen some errors upon a request, though.  I tend to
think the problem is within my configuration, though, and that these errors
are not significant.  I include them for completeness.

[Sun Nov 17 16:53:49 2002] [jk_ajp_common.c (679)]:
ajp_connection_tcp_get_message: Error - jk_tcp_socket_recvfull failed
[Sun Nov 17 16:53:49 2002] [jk_ajp_common.c (1041)]: Error reading reply
[Sun Nov 17 16:53:49 2002] [jk_ajp_common.c (1178)]: In
jk_endpoint_t::service, ajp_get_reply failed in send loop 0
[Sun Nov 17 16:53:49 2002] [jk_ajp_common.c (679)]:
ajp_connection_tcp_get_message: Error - jk_tcp_socket_recvfull failed
[Sun Nov 17 16:53:49 2002] [jk_ajp_common.c (1041)]: Error reading reply
[Sun Nov 17 16:53:49 2002] [jk_ajp_common.c (1178)]: In
jk_endpoint_t::service, ajp_get_reply failed in send loop 0
[Sun Nov 17 16:53:49 2002] [jk_connect.c (177)]: jk_open_socket, connect()
failed errno = 111
[Sun Nov 17 16:53:49 2002] [jk_ajp_common.c (626)]: In
jk_endpoint_t::ajp_connect_to_endpoint, failed errno = 111
[Sun Nov 17 16:53:49 2002] [jk_ajp_common.c (872)]: Error connecting to the
Tomcat process.
[Sun Nov 17 16:53:49 2002] [jk_ajp_common.c (1181)]: In
jk_endpoint_t::service, ajp_send_request failed in send loop 1
[Sun Nov 17 16:53:49 2002] [jk_connect.c (177)]: jk_open_socket, connect()
failed errno = 111
[Sun Nov 17 16:53:49 2002] [jk_ajp_common.c 

Re: Can all vhosts share one Webapp?

2002-11-17 Thread Brandon Cruz
  Can I have all my virtual hosts share one webapp?  I would like to avoid
  having to declare a context for every single virtual host.

 You can do this by taking advantage of the defaultHost attribute on the
 Engine element.  If a request comes into Tomcat with an unrecognized
 host name, it is assigned automatically to the Host element that is
 speicified by defaultHost.

 The out-of-the-box configuration uses this technique to assign all
 requests for all virtual hosts to the Host named localhost, which is
 the single set of webapps nested inside that host.

In simple terms, does this mean that if I have a context called /context1,
and want all vhosts to be able to access and use it, I can just specify the
context one time in the default host and not have to worry about specifying
it for any other host in server.xml?


   This causes way
  too many threads on startup and slows the system down.
 

 Unless you are starting threads in your own servlets, the number of host
 elements and webapps has neglible impact on the number of threads that
 Tomcat starts.  That is driven primarily by how you configure your
 Connector elements; and the connector threads that process requests are
 shared across all the hosts and webapps.

Good to know!  We are upgrading from 3.2.4 and it seems like the number of
processes started up with that was around 300, roughly equal to the number
of contexts we had declared, 150 hosts with two contexts each, which is why
I thought they were related.


  Any ideas?  We are using tomcat 4.1.12 and apache 1.3.26.

 The above info is about the Tomcat side of things -- you'll need to ask
 someone else about the Apache connector configuration for this to work.

One last question, I am going to continue to use our old compiled mod_jk
connector from tomcat 3.2.4.  We are using the Coyote/jk2 AJP 1.3 connector
in server.xml.  Is there anything wrong with this, or should I just take the
time to try to compile a new connector too?


 
  Thanks!
 
  Brandon

 Craig


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



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




RE: how many tomcat in a machine?

2002-11-17 Thread Nicholas Orr
Just on this point of multiple Tomcat Instances, how does the JVM fit into
all of this.
ie does Tomcat1 use JVM1 and Tomcat2 use JVM2. Or does Tomcat1  Tomcat2 use
JVM1?

Also if you had one Tomcat Instances and 3 apps would they all share the one
instance of Log4j and its static methods or would there be three instances
of Log4j??

Nicholas Orr

-Original Message-
From: Turner, John [mailto:[EMAIL PROTECTED]] 
Sent: Friday, 15 November 2002 3:19 AM
To: 'Tomcat Users List'
Subject: RE: how many tomcat in a machine?



OK, thanks for the tip. 

John


 -Original Message-
 From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, November 14, 2002 12:13 PM
 To: Tomcat Users List
 Subject: RE: how many tomcat in a machine?
 
 
 
 
 On Thu, 14 Nov 2002, Turner, John wrote:
 
  Date: Thu, 14 Nov 2002 08:27:56 -0500
  From: Turner, John [EMAIL PROTECTED]
  Reply-To: Tomcat Users List [EMAIL PROTECTED]
  To: 'Tomcat Users List' [EMAIL PROTECTED]
  Subject: RE: how many tomcat in a machine?
 
 
  A key problem to using a single Tomcat instance with multiple web 
  applications is that a problem with Tomcat or a problem
 with one single web
  app effects all the others.  In a shared server environment
 (application
  service provider, for example) you would be better off
 having multiple
  instances of Tomcat so that you can manage each instance
 separately without
  effecting the others.
 
 
 The other side of the coin is that sharing a single Tomcat
 instance saves
 a ***lot*** of memory, because the system classes are shared.
 
 You can mitigate most, but not all, of the impacts apps can
 have on each
 other by using a security manager that is appropriately 
 configured.  Glenn
 Nielsen (a Tomcat developer) has posted quite a few helpful 
 documents to
 TOMCAT-USER on how to set this up -- see the mailing list archives for
 details.  And, if you're coming to Las Vegas for ApacheCon 
 next week, his
 session on how to do this is a must attend for anyone contemplating
 setting up this sort of thing.
 
  John
 
 Craig
 
 
 --
 To unsubscribe, e-mail:   
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]

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


**
The information contained in this e-mail is confidential and is
intended only for the use of the addressee(s).
If you receive this e-mail in error, any use, distribution or
copying of this e-mail is not permitted. You are requested to
forward unwanted e-mail and address any problems to the
MIM Holdings Limited Support Centre.

For general enquires:   ++61 7 3833 8000
Support Centre e-mail:  [EMAIL PROTECTED]
Support Centre phone:   Australia 1800500646
International ++61 7 38338042
**


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




RE: Problems with Tomcat's built in db poolmanager

2002-11-17 Thread Nicholas Orr
Error 2 would suggest you are not releasing your connection back to the
pool. I know you don't use connection.close() but I don't know what ur
suppose to do, as I haven't started using DBCP yet. 

Error 1 I have no idea, maybe if you fix Error 2 this one will fix itself??

Nicholas Orr

-Original Message-
From: Colic, Alex [mailto:[EMAIL PROTECTED]] 
Sent: Friday, 15 November 2002 12:01 AM
To: Tomcat (E-mail)
Subject: Problems with Tomcat's built in db poolmanager


Hi,

I am trying to get an application that is presently working with IBM's
cloudscape database to work with mysql and Tomcat's pool manager.

I have set the poolmanager to have an initial pool of 10 db objects. I have
a screen that allows users to traverse through a record set and view the
records in a table. As they are traversing through this record set I
periodically get the below error.

There is only one user on the system. Can someone suggest what is going on.

Thanks

Alex

ERROR 1

exception java.lang.IllegalArgumentException: JDBC-Troubles: was not able to
create connection, using the following DbConnection:DbConnection =
name=jdbc:mysql://127.0.0.1/fred,jndi=false,conClass=org.gjt.mm.mysql.Drive
r,username=fred
Message JDBC-Troubles: was not able to create connection, using the
following DbConnection:DbConnection =
name=jdbc:mysql://127.0.0.1/fred,jndi=false,conClass=org.gjt.mm.mysql.Drive
r,username=fred

ERROR 2

exception javax.servlet.jsp.JspTagException: java.sql.SQLException: DBCP
could not obtain an idle db connection, pool exhausted Message
java.sql.SQLException: DBCP could not obtain an idle db connection, pool
exhausted

Localized Message java.sql.SQLException: DBCP could not obtain an idle db
connection, pool exhausted

Stack trace
javax.servlet.jsp.JspTagException: java.sql.SQLException: DBCP could
not obtain an idle db connection, pool exhausted
at
org.apache.taglibs.dbtags.connection.ConnectionTag.doEndTag(ConnectionTag.ja
va:235)




This e-mail may be privileged and/or confidential, and the sender does not
waive any related rights and obligations. Any distribution, use or copying
of this e-mail or the information it contains by other than an intended
recipient is unauthorized. If you received this e-mail in error, please
advise me (by return e-mail or otherwise) immediately. 

Ce courriel est confidentiel et protégé. L'expéditeur ne renonce pas aux
droits et obligations qui s'y rapportent. Toute diffusion, utilisation ou
copie de ce message ou des renseignements qu'il contient par une personne
autre que le (les) destinataire(s) désigné(s) est interdite. Si vous recevez
ce courriel par erreur, veuillez m'en aviser immédiatement, par retour de
courriel ou par un autre moyen. 





**
The information contained in this e-mail is confidential and is
intended only for the use of the addressee(s).
If you receive this e-mail in error, any use, distribution or
copying of this e-mail is not permitted. You are requested to
forward unwanted e-mail and address any problems to the
MIM Holdings Limited Support Centre.

For general enquires:   ++61 7 3833 8000
Support Centre e-mail:  [EMAIL PROTECTED]
Support Centre phone:   Australia 1800500646
International ++61 7 38338042
**


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




ROOT/subdir softlinked to another directory fails

2002-11-17 Thread Hanasaki JiJi
For logistical purposes, it is necessary to soft link a directory under 
ROOT to a directory elsewhere in the filesystem (Running Linux ext3). 
Tomcat is reporting that the resource is not available when someone hits 
the page [host]/subdir.

What is the reason for this?  Any suggestions as to how I can accomplish 
this functionality?

Thank you.

--
=
= Management is doing things right; leadership is doing the =
=   right things.- Peter Drucker=
=___=
= http://www.sun.com/service/sunps/jdc/javacenter.pdf   =
=  www.sun.com | www.javasoft.com | http://wwws.sun.com/sunone  =
=


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



Unable to compile class for JSP in Windows

2002-11-17 Thread Salama hussein

I am getting the error below in Windows 2000 SP2, Tomcat 4.1.12 and JDK1.4  
for any JSP program including the examples. I have reinstalled Tomcat 
different versions and tried JDK1.3 but always same problem. Any ideas?

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: -1 in the jsp file: null

.


Salama








_
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. 
http://join.msn.com/?page=features/virus


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



apache + tomcat configuration

2002-11-17 Thread Hong . Sun
hi,
I am trying to integrate apache 1.3.26 and tomcat 4.0.6 on win2000 server.
After an initial configuration, I can get them going, and I can also access
all the examples' servlet through apache, I mean without giving :8080, but
I still have the following problems:
__1. in my apache error.log, every time when I access to a servlet, I would
have an error logged as:
  client denied by server configuration:
c:/tomcat/webapps/examples/web-inf
__2. in my tomcat stderr.log, every time when I start tomcat, it logs:
  mod_jk location: modules\mod_jk.dll
  Make sure it is installed corectly or  set the config location
  Using ApacheConfig modJk=PATH_TO_MOD_JK.SO_OR_DLL /
__3. my mod_jk.log (same location as stderr.log) is always empty.

please help, thanks.

hong



__
The information contained in this message is confidential and is intended
for the addressee(s) only.  If you have received this message in error or
there are any problems please notify the originator immediately.  The
unauthorized use, disclosure, copying or alteration of this message is
strictly forbidden. Warman International Ltd will not be liable for direct,
special, indirect or consequential damages arising from alteration of the
contents of this message by a third party or as a result of any virus being
passed on.

Internet communications are not secure and therefore Warman International
Ltd. does not accept legal responsibility for the contents of this message.
Any views or opinions presented are solely those of the author and do not
necessarily represent those of Warman International Ltd.



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




Fwd: Install Tomcat 4.1.12 on WinXP problem ... solved by installing Microsoft Loopback Adapter

2002-11-17 Thread T S


I am writing to put closure on this subject.  Attached are the e-mails that helped me 
solve the problem.  The bottom line was that Microsoft Loopback Adapter had to be 
installed.  Detailed instructions on how to install Microsoft Loopback Adapter are 
included below. 
I owe a large Thank You to Greg Nieman for following this problem through to 
completion.  Thanks a lot for your help, Greg! 
Tim 
 T S [EMAIL PROTECTED] wrote: Date: Sat, 16 Nov 2002 19:43:30 -0800 (PST)
From: T S 
Subject: RE: Install Tomcat 4.1.12 on WinXP - after Loopback Adapter ... 
http://localhost:8080 works!!!
To: Nieman, Greg 


Greg, 
After following your detailed instructions on how to install Microsoft Loopback 
Adapter, http://localhost:8080 works when Tomcat is running!  I don't think I would 
have been able to install Microsoft Loopback Adapter without your step-by-step 
instructions.  WinXP is still new and foreign to me, I am used to using Win2000 at 
work or WinME at home. 
I have recorded the detailed output of netstat at each step, hoping that it might 
provide you some additional information that could be useful to you. 
   netstat -a -e -n -o -s -p tcp
   startup of Tomcat
   http://localhost:8080
   netstat -a -e -n -o -s -p tcp
   shutdown of Tomcat
   netstat -a -e -n -o -s -p tcp
   net view

I don't know how to say Thank YOU enough.  Two people wrote me with suggestions, 
each with a different suggestion.  The other person stopped giving advice after their 
first suggestion didn't work, but you continued helping me until Tomcat started.  I 
really appreciate your help.  Now I have a whole lot more to learn about Tomcat, but 
at least I am started. 
Thanks!  and God bless! 
Tim 
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Program Files\Jakarta\jakarta-tomcat-4.1.12\binnetstat -a -e -n -o -s -p tcp

Interface Statistics

   ReceivedSent

Bytes 12141   13369
Unicast packets   7   7
Non-unicast packets  80  82
Discards  0   0
Errors0   0
Unknown protocols 0

TCP Statistics for IPv4

  Active Opens= 0
  Passive Opens   = 0
  Failed Connection Attempts  = 0
  Reset Connections   = 0
  Current Connections = 0
  Segments Received   = 0
  Segments Sent   = 0
  Segments Retransmitted  = 0

Active Connections

  Proto  Local Address  Foreign AddressState   PID
  TCP0.0.0.0:1350.0.0.0:0  LISTENING   848
  TCP0.0.0.0:4450.0.0.0:0  LISTENING   4
  TCP0.0.0.0:1025   0.0.0.0:0  LISTENING   892
  TCP0.0.0.0:1032   0.0.0.0:0  LISTENING   4
  TCP0.0.0.0:5000   0.0.0.0:0  LISTENING   1072
  TCP169.254.25.129:139 0.0.0.0:0  LISTENING   4

C:\Program Files\Jakarta\jakarta-tomcat-4.1.12\binstartup
Using CATALINA_BASE:   C:\Program Files\Jakarta\jakarta-tomcat-4.1.12
Using CATALINA_HOME:   C:\Program Files\Jakarta\jakarta-tomcat-4.1.12
Using CATALINA_TMPDIR: C:\Program Files\Jakarta\jakarta-tomcat-4.1.12\temp
Using JAVA_HOME:   C:\Program Files\j2sdk1.4.1

C:\Program Files\Jakarta\jakarta-tomcat-4.1.12\binhttp://localhost:8080!!!


C:\Program Files\Jakarta\jakarta-tomcat-4.1.12\binnetstat -a -e -n -o -s -p tcp

Interface Statistics

   ReceivedSent

Bytes 39608   40836
Unicast packets  97  97
Non-unicast packets  80  82
Discards  0   0
Errors0   0
Unknown protocols 0

TCP Statistics for IPv4

  Active Opens= 2
  Passive Opens   = 2
  Failed Connection Attempts  = 0
  Reset Connections   = 0
  Current Connections = 2
  Segments Received   = 82
  Segments Sent   = 82
  Segments Retransmitted  = 0

Active Connections

  Proto  Local Address  Foreign AddressState   PID
  TCP0.0.0.0:1350.0.0.0:0  LISTENING   848
  TCP0.0.0.0:4450.0.0.0:0  LISTENING   4
  TCP0.0.0.0:1025   0.0.0.0:0  LISTENING   892
  TCP0.0.0.0:1032   0.0.0.0:0  LISTENING   4
  TCP0.0.0.0:1034   0.0.0.0:0  LISTENING   1796
  TCP0.0.0.0:1035   0.0.0.0:0  LISTENING   1796
  TCP0.0.0.0:5000   0.0.0.0:0  LISTENING   1072
  TCP

Re: Unable to compile class for JSP in Windows

2002-11-17 Thread Kwok Peng Tuck
Exactly what did the jsp contain?
I mean the code you put in. Post it on the list and let everyone have a 
look see.

Salama hussein wrote:


I am getting the error below in Windows 2000 SP2, Tomcat 4.1.12 and 
JDK1.4  for any JSP program including the examples. I have reinstalled 
Tomcat different versions and tried JDK1.3 but always same problem. 
Any ideas?

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: -1 in the jsp file: null

.


Salama








_
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. 
http://join.msn.com/?page=features/virus


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





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




Re: whereis that cat?

2002-11-17 Thread Joel Rees
 i installed tomcat rpm on my server, but i am running a hosting company with
 many sites configured on the apache,

That makes things pretty hard for me to guess.

 when i try to run a jsp file i get an
 error saying 404 not found,
 eg http://66.150.223.35/index2.jsp
 
 does anyone know where i should check and what i should look for? i cant
 seem to be able to figure out where tomcat got installed and how to
 configure it properly, all i get is a tomcat error page,
 also when i go to http://66.150.223.35/index.jsp i get a page saying tomcat
 is installed ok

Can you tell if it's apache or tomcat serving that page?

 but none of the links on this page works

Sounds like maybe apache is running, but tomcat is not? or Tomcat is not
hooked up correctly?

 and i cant find
 this page on the server anywhere either :-(

And this sounds like maybe you've got Apache pointing to a tomcat on
another server.

Sorry I don't have any more suggestions, but I would need more specifics
before I could even guess. For instance, you might post the relevant
lines of your apache and tomcat configuration files, and of your webapp
configuration files for tomcat.

-- 
Joel Rees [EMAIL PROTECTED]


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




Re: Can all vhosts share one Webapp?

2002-11-17 Thread Craig R. McClanahan


On Sun, 17 Nov 2002, Brandon Cruz wrote:

 Date: Sun, 17 Nov 2002 16:46:44 -0600
 From: Brandon Cruz [EMAIL PROTECTED]
 Reply-To: Tomcat Users List [EMAIL PROTECTED]
 To: Tomcat Users List [EMAIL PROTECTED]
 Subject: Re: Can all vhosts share one Webapp?

   Can I have all my virtual hosts share one webapp?  I would like to avoid
   having to declare a context for every single virtual host.
 
  You can do this by taking advantage of the defaultHost attribute on the
  Engine element.  If a request comes into Tomcat with an unrecognized
  host name, it is assigned automatically to the Host element that is
  speicified by defaultHost.
 
  The out-of-the-box configuration uses this technique to assign all
  requests for all virtual hosts to the Host named localhost, which is
  the single set of webapps nested inside that host.

 In simple terms, does this mean that if I have a context called /context1,
 and want all vhosts to be able to access and use it, I can just specify the
 context one time in the default host and not have to worry about specifying
 it for any other host in server.xml?


Yes.

 
This causes way
   too many threads on startup and slows the system down.
  
 
  Unless you are starting threads in your own servlets, the number of host
  elements and webapps has neglible impact on the number of threads that
  Tomcat starts.  That is driven primarily by how you configure your
  Connector elements; and the connector threads that process requests are
  shared across all the hosts and webapps.

 Good to know!  We are upgrading from 3.2.4 and it seems like the number of
 processes started up with that was around 300, roughly equal to the number
 of contexts we had declared, 150 hosts with two contexts each, which is why
 I thought they were related.


That's a pretty intriguing coincidence.

 
   Any ideas?  We are using tomcat 4.1.12 and apache 1.3.26.
 
  The above info is about the Tomcat side of things -- you'll need to ask
  someone else about the Apache connector configuration for this to work.

 One last question, I am going to continue to use our old compiled mod_jk
 connector from tomcat 3.2.4.  We are using the Coyote/jk2 AJP 1.3 connector
 in server.xml.  Is there anything wrong with this, or should I just take the
 time to try to compile a new connector too?


I'm not a guru on the web connectors, but it sounds like you can do this.
However, grabbing the most recent connector will probably have some
performance benefits (as well as bug fixes), so you might want to grab it
anyway.

Craig


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




RE: how many tomcat in a machine?

2002-11-17 Thread Craig R. McClanahan


On Mon, 18 Nov 2002, Nicholas Orr wrote:

 Date: Mon, 18 Nov 2002 09:13:35 +1000
 From: Nicholas Orr [EMAIL PROTECTED]
 Reply-To: Tomcat Users List [EMAIL PROTECTED]
 To: 'Tomcat Users List' [EMAIL PROTECTED]
 Subject: RE: how many tomcat in a machine?

 Just on this point of multiple Tomcat Instances, how does the JVM fit into
 all of this.
 ie does Tomcat1 use JVM1 and Tomcat2 use JVM2. Or does Tomcat1  Tomcat2 use
 JVM1?

 Also if you had one Tomcat Instances and 3 apps would they all share the one
 instance of Log4j and its static methods or would there be three instances
 of Log4j??


When people talk about running mulitple Tomcat instances, they are talking
about multiple JVMs, not one.  Out of the box, Tomcat doesn't support
multiple instances within a single JVM.

Within a single JVM, whether things like LogJ are shared or not depends on
where the classes are loaded from -- if they're inside the /WEB-INF/lib
directories, each webapp will have their own; if they are loaded from some
place like the common/lib directory, the classes will be shared.  Howver,
I understand that Log4J still supports per-webapp configuration of loggers
in the shared case if you want it.  See the Log4J docs for more info.

For more background on class loading in Tomcat, see:

http://jakarta.apache.org/tomcat/tomcat-4.1-doc/class-loader-howto.html

 Nicholas Orr

Craig


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




Download files via Internet Explorer with SSL

2002-11-17 Thread Joe Clem
Using Tomcat 4.0.3.
Apache 1.3.26 when integrating with Apache

I am having problem downloading files from a website with internet 
explorer 5.0 .  I am familiar with the Apache/MSIE problems, but those 
fixes did not help my current problem.

If I try to download a file (meaning clicking on a hyperlink to a file 
and click Save to save to my local machine) running Apache using SSL and 
integrating tomcat via mod_jk, IE yells at me and gives me a big error 
message essentially saying that the site is unavailable.  To narrow the 
scope of the problem, I run tomcat in SSL.  I type in the url for the 
file (i.e. https://localhost:8443/test/testfile.doc), IE asks me if I 
would to Open it or Save it.  With either choice, IE gives the same error.

Netscape7 and Mozilla do not have this problem.




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



newbie question creating and serving a context

2002-11-17 Thread James Bender
Hi,

I'm having a really frustrating problem just creating a simple context using 
Tomcat 4 on a Linux server.

I edit server.xml in my conf directory to include:

Context
  path=/jsp_public
  docBase=/var/tomcat4/webapps/jsp_public
  debug=0
  reloadable=true crossContext=true
  Logger className=org.apache.catalina.logger.FileLogger
prefix=localhost_manager_log. suffix=.txt timestamp=true/
/Context

then in /var/tomcat4/webapps/ I created the folder jsp_public as well as a 
subdirectory WEB-INF where I added empty folders classes and lib and the 
following web.xml:

?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;

web-app

 display-namePublic JSP directory/display-name
 descriptionjust trying to create a context for public 
development./description

context-param
 param-namewebmaster/param-name
 param-value[EMAIL PROTECTED]/param-value
 descriptionThe EMAIL address of the administrator to whom questions and 
comments about this application should be addressed./description
 /context-param

session-config
	session-timeout30/session-timeout
/session-config
/web-app

but when I restart the server it always fails to recognize my context.  It 
serves the built in examples contexts just fine out of the same directory.

Anyways, what am I doing wrong?  Can anyone help?  Thanks!

Jim





_
Add photos to your e-mail with MSN 8. Get 2 months FREE*. 
http://join.msn.com/?page=features/featuredemail


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



Escaped versus unescaped cookies

2002-11-17 Thread Lee Grey
I am running the same servlet on two different machines.  One is running
Apache 1.3.26, Tomcat 4.0.3, and J2SDK 1.4.0.  The other is running Apache
2.0.43, Tomcat 4.1.12, and J2SDK 1.4.1.

In the first environment, my cookie comes back in plain text, like:

Cookie 0: set0=(sn=About
URLinOne|ao=y|l=d)%http://www.URLinOne.com/about.html|i=0|h=n

In the second environment, it looks like:

Cookie 14:
set13=%28sn%3DDev%7Cao%3Dn%7Cl%3Dnull%29%25http%3A%2F%2Fwww.autoscripter.com
%7Ci%3D0%7Ch%3Dn%25http%3A%2F%2Fwww.swishzone.com%7Ci%3D1%7Ch%3Dn%25http%3A%
2F%2Fwww.anim-fx.com%7Ci%3D2%7Ch%3Dn%25http%3A%2F%2Fwww.coffeecup.com%2Ffire
starter%7Ci%3D3%7Ch%3Dn

What setting(s) could account for this difference?

Thanks,
Lee Grey
Grey Matter
http://www.URLinOne.com

If you've ever opened more than one browser
window at the same time, you need URL in One
at http://www.URLinOne.com.  There's no
software to install, and it's free!


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




Taglib iterator (4.0.4 / 4.1.12) same code, diff output

2002-11-17 Thread Jay Wright

I have written a taglib to handle iteration, which works well when I deploy
it to tomcat 4.1.12.  When I deploy to tomcat 4.0.4, I receive an odd error.

My Iterator somehow takes on a null value somewhere between the doStartTag()
and doAfterBody() methods.  The doStartTag() correctly grabs the first item
in the Collection, but then when the doAfterBody() kicks in, the Iterator,
which is a protected instance variable, is null.

This is the case only in 4.0.4, not 4.1.12, where it functions as I'd expect
it to.

Is this a bug with 4.0.4, or is 4.1.12 doing something its not suppose to.

Thanks,
Jay


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




RE: Download files via Internet Explorer with SSL

2002-11-17 Thread Joseph Stephen Vaithara
Hi Joe,
I don't have solution to your problem but I am doing something similar and it 
seems to work for me. Please run though config files, maybe something misconfigured 
there.
 
btwn, I am familiar with the Apache/MSIE problems --  What are these, is this 
documented any where ?

Regards,
Joe

-Original Message-
From: Joe Clem [mailto:[EMAIL PROTECTED]]
Sent: Monday, November 18, 2002 7:21 AM
To: [EMAIL PROTECTED]
Subject: Download files via Internet Explorer with SSL


Using Tomcat 4.0.3.
Apache 1.3.26 when integrating with Apache

I am having problem downloading files from a website with internet 
explorer 5.0 .  I am familiar with the Apache/MSIE problems, but those 
fixes did not help my current problem.

If I try to download a file (meaning clicking on a hyperlink to a file 
and click Save to save to my local machine) running Apache using SSL and 
integrating tomcat via mod_jk, IE yells at me and gives me a big error 
message essentially saying that the site is unavailable.  To narrow the 
scope of the problem, I run tomcat in SSL.  I type in the url for the 
file (i.e. https://localhost:8443/test/testfile.doc), IE asks me if I 
would to Open it or Save it.  With either choice, IE gives the same error.

Netscape7 and Mozilla do not have this problem.




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


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




disable directory listing in tomcat 4.1.12

2002-11-17 Thread Yandell Cacton
Hi,

I upgraded my server from Tomcat 3.3 to Tomcat 4.1.12,
and could not figure out how to disable directory
listing.

It was done by setting StaticInterceptor's listing
attribute to false in Tomcat 3.3, but it looks like
StaticInterceptor is no longer part of Tomcat 4.1.12's
server.xml?

I have read the configuration documentation on
jakarta/tomcat web site and can't find any information
re this.

Cheers,
YC

http://careers.yahoo.com.au - Yahoo! Careers
- 1,000's of jobs waiting online for you!

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




Re: newbie question creating and serving a context

2002-11-17 Thread Paul Campbell
Try docBase=jsp_public

At 06:02 PM 11/17/02, you wrote:
Hi,

I'm having a really frustrating problem just creating a simple context using Tomcat 4 
on a Linux server.

I edit server.xml in my conf directory to include:

Context
  path=/jsp_public
  docBase=/var/tomcat4/webapps/jsp_public
  debug=0
  reloadable=true crossContext=true
  Logger className=org.apache.catalina.logger.FileLogger
prefix=localhost_manager_log. suffix=.txt timestamp=true/
/Context

then in /var/tomcat4/webapps/ I created the folder jsp_public as well as a 
subdirectory WEB-INF where I added empty folders classes and lib and the 
following web.xml:

?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;

web-app

 display-namePublic JSP directory/display-name
 descriptionjust trying to create a context for public development./description

context-param
 param-namewebmaster/param-name
 param-value[EMAIL PROTECTED]/param-value
 descriptionThe EMAIL address of the administrator to whom questions and comments 
about this application should be addressed./description
 /context-param

session-config
session-timeout30/session-timeout
/session-config
/web-app

but when I restart the server it always fails to recognize my context.  It serves the 
built in examples contexts just fine out of the same directory.

Anyways, what am I doing wrong?  Can anyone help?  Thanks!

Jim





_
Add photos to your e-mail with MSN 8. Get 2 months FREE*. 
http://join.msn.com/?page=features/featuredemail


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


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




Re: Tomcat on a separate machine

2002-11-17 Thread Paul Campbell
How about trying what I do:

in httpd.conf

ProxyPass /equivhttp://other:8080/equiv
ProxyPassReverse /equiv http://other:8080/equiv

Where other is someother machine


At 02:37 PM 11/17/02, you wrote:
I have server1 running both Apache2 and an instance of Tomcat4.  I have
server2 running its own instance of Tomcat4.  The Tomcats on server1 and
server2 are running different applications.

I am currently trying to get requests for urlinone.com received by Apache at
server1 forwarded to the Tomcat at server2.  It seems like they see each
other, because, when I shut down Apache on server1, server2's log shows:

Nov 17, 2002 4:14:29 PM org.apache.jk.common.ChannelSocket processConnection
WARNING: server has closed the current connection (-1)
Nov 17, 2002 4:14:29 PM org.apache.jk.common.ChannelSocket processConnection
WARNING: server has closed the current connection (-1)

However, I don't see any indication that servlet requests are getting from
Apache on server1 to Tomcat on server2.  There is no log activity on server2
to match the requests shown at server1.

On server1, Apache httpd.conf contains, in part:

NameVirtualHost *
IfModule !mod_jk.c
  LoadModule jk_module /usr/local/apache/modules/mod_jk.so
/IfModule
# Am I supposed to have AddModule mod_jk anywhere?  There are no AddModule
statements in this file.
JkWorkersFile /var/tomcat4/conf/jk/workers.properties
JkLogFile /var/tomcat4/logs/mod_jk.log
JkLogLevel info
JkLogStampFormat [%a %b %d %H:%M:%S %Y]
VirtualHost *
ServerName www.urlinone.com
ServerAlias urlinone.com
DocumentRoot /var/tomcat4/webapps/urlinone
ErrorLog /var/tomcat4/logs/urlinone-errorlog
CustomLog /var/tomcat4/logs/urlinone-access.log common
Alias / /var/tomcat4/webapps/urlinone/
JkMount /servlet/* server2
/VirtualHost

Server1's workers.properties file says:

worker.list=server1,server2
worker.server1.type=ajp13
worker.server1.host=192.168.1.80
worker.server1.port=8009

worker.server2.type=ajp13
worker.server2.host=192.168.1.50
worker.server2.port=8009

Server2's server.xml file says, in part:

  Service name=Tomcat-Apache
DefaultContext reloadable=true/
Connector className=org.apache.coyote.tomcat4.CoyoteConnector
 port=8009 minProcessors=5 maxProcessors=75
 enableLookups=true appBase=webapps
 acceptCount=10 debug=0/
Engine name=Standalone defaultHost=www.urlinone.com debug=0
  Logger className=org.apache.catalina.logger.FileLogger
  prefix=urlinone_log. suffix=.txt
  timestamp=true/
  Realm className=org.apache.catalina.realm.MemoryRealm /
/Engine
  /Service

The Apache log shows a request being successfully completed:

192.168.1.1 - - [17/Nov/2002:16:27:27 -0500] GET /index.html HTTP/1.1 304
0
192.168.1.1 - - [17/Nov/2002:16:27:27 -0500] GET /urlinone.js HTTP/1.1 304
0
192.168.1.1 - - [17/Nov/2002:16:27:27 -0500] GET /servlet/PagePump
HTTP/1.1 200 0

But there is no activity, as far as I can see, on server2.  Server1 is
running Red Hat 7.3 and Tomcat 4.1.12, while server2 is running Red Hat 7.2
and Tomcat 4.0.3.  I had to download all the jars at
http://jakarta.apache.org/builds/jakarta-tomcat-connectors/coyote/release/v1
.0-rc2/ to get Coyote running on server2, so I'm wondering if there is some
incompatibility there.  Despite the instructions on that page, I do not have
a jk2.properties file, nor do I have tomcat-jni.jar, because I don't think
I'm using either of those, since I'm using mod_jk.  I also don't believe
there is any need for a workers.properties file on server2, since that is
for mod_jk in Apache, right?

The only other thing, and I don't know if this is a red flag or a red
herring, is that mod_jk.log on server1 gives bursts of errors sometimes,
although 90% of the time it's when Tomcat on server2 is starting up or
shutting down.  I have seen some errors upon a request, though.  I tend to
think the problem is within my configuration, though, and that these errors
are not significant.  I include them for completeness.

[Sun Nov 17 16:53:49 2002] [jk_ajp_common.c (679)]:
ajp_connection_tcp_get_message: Error - jk_tcp_socket_recvfull failed
[Sun Nov 17 16:53:49 2002] [jk_ajp_common.c (1041)]: Error reading reply
[Sun Nov 17 16:53:49 2002] [jk_ajp_common.c (1178)]: In
jk_endpoint_t::service, ajp_get_reply failed in send loop 0
[Sun Nov 17 16:53:49 2002] [jk_ajp_common.c (679)]:
ajp_connection_tcp_get_message: Error - jk_tcp_socket_recvfull failed
[Sun Nov 17 16:53:49 2002] [jk_ajp_common.c (1041)]: Error reading reply
[Sun Nov 17 16:53:49 2002] [jk_ajp_common.c (1178)]: In
jk_endpoint_t::service, ajp_get_reply failed in send loop 0
[Sun Nov 17 16:53:49 2002] [jk_connect.c (177)]: jk_open_socket, connect()
failed errno = 111
[Sun Nov 17 16:53:49 2002] [jk_ajp_common.c (626)]: In
jk_endpoint_t::ajp_connect_to_endpoint, failed errno = 111
[Sun Nov 17 16:53:49 2002] [jk_ajp_common.c (872)]: Error connecting to the
Tomcat process.
[Sun Nov 17 16:53:49 2002] [jk_ajp_common.c (1181)]: 

http 302 not working with mod_jk

2002-11-17 Thread Jano
Hola all!


Im having 302 problems with Apache2, modjk 1.2, tomcat 4.1, debian.

Everything is OK, except for urls like /examples/jsp/
Tomcat says 302 - examples/jsp/index.html, but the browser doesnt
follow the redirection.

Im pulling my hair out, I've spent hours w/o any success, I saw the same
problem with mod_webapp in another message (see below), is there any
solution for this?


Saludos, Jano


 My configuration is: Apache 2.0.35 and Tomcat 4.0.3 (or 4.0.4, same
 behaviour), with mod_webapp and warp connector. Solaris 8, jdk 1.4.0.
 If I deploy examples webapp and access it through Tomcat's 
 standalone listener (port 8080) everything works ok.
 When I access it through Apache, it works well until I find some kind
 of redirection (ie /examples/ - /examples/index.html), then I get a
 page with the message:
 Apache Tomcat/4.0.3 -HTTP Status 302 - Moved Temporarily
 but redirection is NOT followed by the browser (I've tried various 
  versions of IE, Netscape, Mozilla...).
 If I try to connect using telnet, the response with port 8080 is:
 HTTP/1.1 302 Moved Temporarily
 while through Apache is:
 HTTP/1.1 Moved Temporarily
 Nevertheless, in access.log of Apache the status code for my request 
 is correctly set to 302.
 Same behaviour if I do a sendRedirect from within a servlet or jsp,
 redirecting to another servlet (no static content at all).


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




Re: newbie question creating and serving a context

2002-11-17 Thread Jacob Kjome

I you are serving out of Tomcat's webapps directory, try changing docBase 
to docBase=jsp_public instead of the full path from the root of the 
filesystem.

Jake

At 02:02 AM 11/18/2002 +, you wrote:
Hi,

I'm having a really frustrating problem just creating a simple context 
using Tomcat 4 on a Linux server.

I edit server.xml in my conf directory to include:

Context
  path=/jsp_public
  docBase=/var/tomcat4/webapps/jsp_public
  debug=0
  reloadable=true crossContext=true
  Logger className=org.apache.catalina.logger.FileLogger
prefix=localhost_manager_log. suffix=.txt timestamp=true/
/Context

then in /var/tomcat4/webapps/ I created the folder jsp_public as well as a 
subdirectory WEB-INF where I added empty folders classes and lib and 
the following web.xml:

?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;

web-app

 display-namePublic JSP directory/display-name
 descriptionjust trying to create a context for public 
development./description

context-param
 param-namewebmaster/param-name
 param-value[EMAIL PROTECTED]/param-value
 descriptionThe EMAIL address of the administrator to whom questions 
and comments about this application should be addressed./description
 /context-param

session-config
session-timeout30/session-timeout
/session-config
/web-app

but when I restart the server it always fails to recognize my context.  It 
serves the built in examples contexts just fine out of the same directory.

Anyways, what am I doing wrong?  Can anyone help?  Thanks!

Jim





_
Add photos to your e-mail with MSN 8. Get 2 months FREE*. 
http://join.msn.com/?page=features/featuredemail


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


RE: how many tomcat in a machine?

2002-11-17 Thread Jacob Kjome


 Also if you had one Tomcat Instances and 3 apps would they all share 
the one
 instance of Log4j and its static methods or would there be three instances
 of Log4j??



If you put Log4j in one of the parent classloaders that Tomcat makes 
available to webapps ( shared/lib, common/lib ) then That will be one 
instance of log4j serving many webapps.  Actually, all webapps would use 
the same default logger repository or, hierarchy unless you do specifically 
create a new logger repository for each webapp using a custom logger 
repository selector.  See the following doc on this:

http://qos.ch/containers/sc.html

I implemented a logger repository selector similar to the one described in 
that article called Log4jCRS.  You can find it here:

http://barracuda.enhydra.org/software/cvs/cvsweb.cgi/Projects/EnhydraOrg/toolsTech/Barracuda/src/org/enhydra/barracuda/log4j/

It is used in both a Log4jInit servlet and a servlet context listener 
called Log4jApplicationWatch to initialize and shutdown loggers and 
appenders, respectively.

http://barracuda.enhydra.org/software/cvs/cvsweb.cgi/Projects/EnhydraOrg/toolsTech/Barracuda/src/org/enhydra/barracuda/webapp/log4j/


Log4jCRS needs to be in a classloader visible to log4j.jar.  This means if 
Log4j.jar is in common/lib (where commons logging likes it to be) you can 
put Log4jCRS in shared/lib or common/lib.  You can't put it in WEB-INF/lib 
of your app unless you also place a copy of log4j.jar there as well because 
Log4jCRS needs to talk to classes in Log4j.jar and vice-versa.

Log4jInit and Log4jApplicationWatch *must* be in WEB-INF/lib.  This is 
because the custom logger repositories are keyed on each unique webapp 
classloader and so must be loaded in the webapp classloader of each 
individual application in order to support that condition.

You can store your log4j config file (properties or xml) in WEB-INF and 
provide something like the following to configure Log4jApplicationWatch and 
Log4jInit :


!-- Shuts down all loggers and appenders at webapp shutdown --
listener
listener-class
org.enhydra.barracuda.webapp.log4j.Log4jApplicationWatch
/listener-class
/listener


!-- == --
!--  Log4j declarations--
!-- == --
servlet
servlet-namelog4j-init/servlet-name
servlet-classorg.enhydra.barracuda.webapp.log4j.Log4jInit/servlet-class
init-param
!-- relative path to config file within current webapp --
param-namelog4j-config/param-name
param-valueWEB-INF/log4j.xml/param-value
/init-param
init-param
!-- config file re-reading specified in milliseconds...
 Note that if the webapp is served directly from the
 .war file, configureAndWatch() cannot be used because
 it requires a system file path. In that case, this
 param will be ignored.  Set to 0 or don't specify this
 param to do a normal configure(). --
param-namelog4j-cron/param-name
param-value5000/param-value
/init-param
!-- optional param for use with a File Appender.
 Specifies a path to be read from a log4j xml
 config file as a system property. The property name is
 dynamically generated and takes on the following pattern:
 [webapp name].log.home
 In Barracuda's case, it would be Barracuda.log.home.
 The path defaults to WEB-INF/logs directory, which is created
 if it doesn't exist, unless the webapp is running directly
 from a .war file.
 Note that, if specified, the value is an absolute path, not
 relative to the webapp. --
!-- init-param
param-namelog4j-log-home/param-name
param-value/usr/local/logs/tomcat/param-value
/init-param --
load-on-startup1/load-on-startup
/servlet

And for logging to file, a system variable is automatically created by 
Log4jInit.  The name is different for each webapp and predictable because 
it is based on the context name of the webapp.  For instance,  if I have a 
context with a path of /Barracuda, then in my log4j.xml I use the 
variable ${Barracuda.log.home} to specify my filepath for a file appender 
such as:

appender name=A2 class=org.apache.log4j.FileAppender
param name=File value=${Barracuda.log.home}/main.log /
param name=Append value=false /
layout class=org.apache.log4j.PatternLayout
param name=ConversionPattern value=%-4r [%t] %-5p %c %x - 
%m%n/
/layout
/appender

As you can see above in the configuratin for Log4jInit, there is a param 
you can set called log4-log-home where you can set any 

Re: Starting tomcat as user apache instead of root

2002-11-17 Thread Nikola Milutinovic
Randy Paries wrote:

Thanks
The problem is that they have to both read and write files

The weird thing is if I do a 
su - apache -c $TOMCAT_HOME/bin/startup.sh

It does not start

But if I do a 

su - tomcat -c $TOMCAT_HOME/bin/startup.sh

Is does. The one diff is that in the etc/passwd file
apache:x:48:48:Apache:/var/www:/bin/false
tomcat:x:505:48::/home/tomcat:/bin/bash 

su - user will execute login scripts and activate user's shell. As Apache 
has /bin/false for a shell, it will exit immediately. You should try su 
user -c instead. On our Tru64 UNIX su will complain if you try both - and 
-c.

So I assume it can not start because of the shell.

So how does apache start.


su apache -c /usr/local/apache2/bin/apachectl start


Should I just give apache a shell?


No.

Nix.


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




SUCCESSFUL Tomcat Install!

2002-11-17 Thread Steve R Burrus
 Well, I really haven't bothered to post to this newsgroup in quite some time, but
I just had to proudly announce to anyone interested that I HAVE SUCCESSFULLY
INSTALLED TOMCAT!!! This is the 4.1.12 version that I am now talking about! Any
possible signs of appreciation from anyone in this newsgroup to that dramatic
news [-sic] would be greatly welcomed by myself!!! 

 Well, with that said, I would like to know just how exactly I start to go about
creating the components of the J2EE API, i.e., Servlets and Java Server Pages in
the Tomcat web container?! I would bet--if I were a betting man--that it's a
rather tricky proposition to do so!! Am I wrong? I just know that someone out
there in this newsgroup will send me the hyperlink to access all of the relevant
information that I need to learn about to create these. I developed the thought
some time ago in my mind to start to develop the components of server-side Java
programming as a real career for myself. Am I just flat deluding myself into
thinking that I can possibly make a go of it with trying/attempting to dabble
with such high technology as a basis for a career? Please give some feedback about
this. 

__
Do you Yahoo!?
Yahoo! News - Today's headlines
http://news.yahoo.com

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




Request Does Not Include Session Id - Why?

2002-11-17 Thread bido
For some odd reason the JSP session id is not being written to the  
request object and therefore I get null pointer errors when I try to  
reference session objects within a servlet.  Please note that, I do not  
want to send the client session in the URL.  I tried several different  
browsers  IE, OmniWeb, Chimera, Mozilla. The problem seems to be  
browser independent. Is this a Tomcat 4.1 security issue? I'm very  
confused since I thought that JSPs provide behind the scenes session  
management via cookies.  Too make matters even stranger, every once in  
a while the JSP will work correctly... I still haven't figured out the  
reason... I guess every once in a while the client and server session  
ids match by coincidence -ouch!

Here's a print out of my log messages (note that the request is passed  
correctly, the dates below come from the client)

 
***
JSP Session id: 3F6FC46A183303B69EC4E8097528159E
Request Session id: null
Servlet Active Session id: F8568A66D6EF4BE71AC8AD37FF0921C7
Servlet Active Session new?: true
Is Requested Session Valid? false
Is Requested Session from Cookie? false
Is Requested Session from URL? false
FromDate : Oct/10/2002
ToDate : Oct/19/2002

Any help will be greatly appreciated.

Thanks!
-FB


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



Re: SUCCESSFUL Tomcat Install!

2002-11-17 Thread Jacob Hookom
The best newbie-book i have read for starting with JSP's, Servlets, and
Taglibs is:

Java Developer's Guide to Servlets and JSP by Bill Brogden under Sybex
publishing

It's the book that everyone still borrows from me to read as a starting
point.  Now, I mainly use Jason Hunter's O'Reilly book titled Java Servlet
Programming as a quick reference.

-Jacob

- Original Message -
From: Steve R Burrus [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, November 18, 2002 12:17 AM
Subject: SUCCESSFUL Tomcat Install!


 Well, I really haven't bothered to post to this newsgroup in quite some
time, but
 I just had to proudly announce to anyone interested that I HAVE
SUCCESSFULLY
 INSTALLED TOMCAT!!! This is the 4.1.12 version that I am now talking
about! Any
 possible signs of appreciation from anyone in this newsgroup to that
dramatic
 news [-sic] would be greatly welcomed by myself!!!

  Well, with that said, I would like to know just how exactly I start to go
about
 creating the components of the J2EE API, i.e., Servlets and Java Server
Pages in
 the Tomcat web container?! I would bet--if I were a betting man--that it's
a
 rather tricky proposition to do so!! Am I wrong? I just know that
someone out
 there in this newsgroup will send me the hyperlink to access all of the
relevant
 information that I need to learn about to create these. I developed the
thought
 some time ago in my mind to start to develop the components of server-side
Java
 programming as a real career for myself. Am I just flat deluding myself
into
 thinking that I can possibly make a go of it with trying/attempting to
dabble
 with such high technology as a basis for a career? Please give some
feedback about
 this.

 __
 Do you Yahoo!?
 Yahoo! News - Today's headlines
 http://news.yahoo.com

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



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




Re: SUCCESSFUL Tomcat Install!

2002-11-17 Thread Bill Barker
There are many Jakarta committers that have successfully made a go of it
by having their own Server-Side consulting firms (but I'm not one of them
:).

As every one here should know, Tomcat is not a J2EE container.  For an OS
J2EE container that uses Tomcat for its Servlet/JSP, see
http://www.jboss.org/.

Steve R Burrus [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Well, I really haven't bothered to post to this newsgroup in quite some
time, but
 I just had to proudly announce to anyone interested that I HAVE
SUCCESSFULLY
 INSTALLED TOMCAT!!! This is the 4.1.12 version that I am now talking
about! Any
 possible signs of appreciation from anyone in this newsgroup to that
dramatic
 news [-sic] would be greatly welcomed by myself!!!

  Well, with that said, I would like to know just how exactly I start to go
about
 creating the components of the J2EE API, i.e., Servlets and Java Server
Pages in
 the Tomcat web container?! I would bet--if I were a betting man--that it's
a
 rather tricky proposition to do so!! Am I wrong? I just know that
someone out
 there in this newsgroup will send me the hyperlink to access all of the
relevant
 information that I need to learn about to create these. I developed the
thought
 some time ago in my mind to start to develop the components of server-side
Java
 programming as a real career for myself. Am I just flat deluding myself
into
 thinking that I can possibly make a go of it with trying/attempting to
dabble
 with such high technology as a basis for a career? Please give some
feedback about
 this.

 __
 Do you Yahoo!?
 Yahoo! News - Today's headlines
 http://news.yahoo.com





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




Re: disable directory listing in tomcat 4.1.12

2002-11-17 Thread Bill Barker
Yeah, well, there are a lot of thing that I miss from 3.3 that aren't in
4.1.x :)

To answer your question, you need to edit the $CATALINA_HOME/conf/web.xml
file, and change the param-namelistings/param-name param-value for the
default servlet from true to false.

Yandell Cacton [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi,

 I upgraded my server from Tomcat 3.3 to Tomcat 4.1.12,
 and could not figure out how to disable directory
 listing.

 It was done by setting StaticInterceptor's listing
 attribute to false in Tomcat 3.3, but it looks like
 StaticInterceptor is no longer part of Tomcat 4.1.12's
 server.xml?

 I have read the configuration documentation on
 jakarta/tomcat web site and can't find any information
 re this.

 Cheers,
 YC

 http://careers.yahoo.com.au - Yahoo! Careers
 - 1,000's of jobs waiting online for you!





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




spec compliants vs implementation specific parts?

2002-11-17 Thread Pierre-Laurent Ribault
Hi,
(B
(BI'm in the process of developping a Web application using Tomcat as the
(Bdevelopment testbed. However, I'd like to be able later to deploy the
(Bapplication on another servlet engine with the same specs level.
(BI know that Tomcat is the reference implementation of the servlet/JSP
(Bspec, but is there an easy way (i.e. without reading the whole spec) to
(Bknow what is part of the spec and what is implementation specific in
(BTomcat? For example, among the server settings (datasource, realms, etc).
(B
$B!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=(B
(BPierre-Laurent Ribault
(BFujitsu Info Software Technologies Ltd.
(B
(B
(B
(B
(B
(B
(B
(B
(B
(B
(B
(B
(B
(B--
(BTo unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
(BFor additional commands, e-mail: mailto:[EMAIL PROTECTED]



Re: spec compliants vs implementation specific parts?

2002-11-17 Thread Jon Eaves
Hi,
(B
(BWithout being too flippant, everything in web.xml
(Bis "standard" and everything in server.xml is
(BTomcat specific.
(B
(BYou can rely on most J2EE/Servlet containers to
(Bbe able to provide access to connection pools, and
(Bpotentially JNDI resources and things that Tomcat
(Bprovides in server.xml, however the manner for
(Bconfiguration is generally different (not much)
(Bbetween the various vendors.
(B
(BThe only "code specific" things have generally
(Bbeen:
(B
(B. getting an InitialContext
(B. getting a database connection
(B
(BHowever, if you're really fired up about it, you
(Bcan abstract a lot of that out, or parameterise it.
(B
(BWe've found that the 3 or 4 lines of code that need
(Bto be changed generally haven't been worth the effort.
(B
(BHowever, YMMV.
(B
(BCheers,
(B-- jon
(B
(BPierre-Laurent Ribault wrote:
(B Hi,
(B 
(B I'm in the process of developping a Web application using Tomcat as the
(B development testbed. However, I'd like to be able later to deploy the
(B application on another servlet engine with the same specs level.
(B I know that Tomcat is the reference implementation of the servlet/JSP
(B spec, but is there an easy way (i.e. without reading the whole spec) to
(B know what is part of the spec and what is implementation specific in
(B Tomcat? For example, among the server settings (datasource, realms, etc).
(B 
(B $B!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=(B
(B Pierre-Laurent Ribault
(B Fujitsu Info Software Technologies Ltd.
(B 
(B 
(B 
(B 
(B 
(B 
(B 
(B 
(B 
(B 
(B 
(B 
(B 
(B --
(B To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
(B For additional commands, e-mail: mailto:[EMAIL PROTECTED]
(B 
(B
(B-- 
(BJon Eaves [EMAIL PROTECTED]
(Bhttp://www.eaves.org/jon/
(B
(B
(B--
(BTo unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
(BFor additional commands, e-mail: mailto:[EMAIL PROTECTED]



Re: spec compliants vs implementation specific parts?

2002-11-17 Thread Bill Barker

Pierre-Laurent Ribault [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi,

 I'm in the process of developping a Web application using Tomcat as the
 development testbed. However, I'd like to be able later to deploy the
 application on another servlet engine with the same specs level.
 I know that Tomcat is the reference implementation of the servlet/JSP
 spec, but is there an easy way (i.e. without reading the whole spec) to
 know what is part of the spec and what is implementation specific in
 Tomcat? For example, among the server settings (datasource, realms, etc).

Datasource and Realm (at least in the configuration/implementation), are
Tomcat-specific features.

As a rule of thumb, anything that requires that you edit server.xml is a
Tomcat-specific feature.  If your web-app works without touching the default
server.xml, then there is a good chance that it will work in any 2.3
container.


 $B!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=(B
 Pierre-Laurent Ribault
 Fujitsu Info Software Technologies Ltd.





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