Tomcat 4.1.30 and Cookie problems (HTTP 1.1 spec)

2004-11-18 Thread Kilic, Hakan
Hi all,

When using Tomcat 4.1.30, I haven't been able to determine from the
documentation if it uses Netscape style cookies, or HTTP 1.1 style cookies.
With Netscape style cookies, you get the EXPIRES attribute, and with HTTP
1.1 style, you get the MAXAGE attribute instead.

Also, I'm seeing the following behavior, and would love to know if someone
knows what's going on (here's a snippet from a proxy I was running).


REQUEST THAT COMES IN:
+
GET /myapplication/page1.jsp HTTP/1.1
Accept: */*
Host: myserver
Cache-Control: max-age=0

Cookie: $Version=1; JSESSIONID=4C769DCBFDB7E7099BC78FE092A0A853; $Path=/;
$Domain=myserver

Cookie: $Version=1; JSESSIONID=35300D6FBA7FB8312EC00BAD5BD27138;
$Path=/myapplication; $Domain=myserver

RESPONSE:
++
HTTP/1.1 200 OK

Set-Cookie: JSESSIONID=5CEF133DB1A6D2EB51E8FCCB71FDD8FE; Path=/myapplication

Now I know that previously in my application two cookies are created, one
with $Path=/ and one with $Path=/myapplication.

What I don't understand is if the order that cookie comes in is the problem,
or if the fact that two cookies are sent is the problem.

Why is Tomcat creating a new cookie/session for page1.jsp if it gets sent a
cookie with a valid JSESSIONID for the correct path? Session timeouts?
Invalidation of the session? Wrong cookie order?

Any help is much appreciated,

-HK

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



Tomcat and Apache with TCP TIME_WAIT state

2004-08-19 Thread Kilic, Hakan
Hi everyone,

I'm seeing Tomcat and Apache show many tcp TIME_WAIT connections when
running netstat under a load test. I was wondering, is this because the web
browser client is not closing the connection properly, or is this the normal
behavior of apache/tomcat under load, and the connections simply time out.

Thanks,

-Hakan

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



charset error still on Tomcat 4.1.30

2004-05-12 Thread Kilic, Hakan
I've searched the mailing list and bugzilla, and it looks like this was
addressed in Tomcat 4.1.30, but I still see a problem with 4.1.30. Remy in
his comments mentioned it's probably a configuration issue (and hinted some
actual test/data would be useful). Here is what I did:

1)  Clean install of Tomcat 4.1.30 standalone running on port 80.
2)  Copied over test.jsp (attached) into the ROOT directory of tomcat.
3)  Used CURL to get the server response.

Test.jsp:
++
% 
  response.setContentType(application/pdf);
%

html
head
title
Worked?
/title

body
Charset test
/body
/html
+++

cURL response (using org.apache.coyote.tomcat4.CoyoteConnector):
+++
HTTP/1.1 200 OK
Set-Cookie: JSESSIONID=24F976F993E84090BFC69EC9E77A8710; Path=/
Content-Type: application/pdf;charset=ISO-8859-1
Content-Length: 90
Date: Wed, 12 May 2004 21:34:57 GMT
Server: Apache-Coyote/1.1

cURL response (using org.apache.catalina.connector.http.HttpConnector):
+++
HTTP/1.1 200 OK
Content-Type: application/pdf;charset=ISO-8859-1
Date: Wed, 12 May 2004 21:46:25 GMT
Server: Apache Tomcat/4.1.30 (HTTP/1.1 Connector)
Transfer-Encoding: chunked
Set-Cookie: JSESSIONID=65AABE61AA1C86FDF963B459D67D1573; Path=/



It looks like charset is still being set, which is wrong. Any ideas? Is the
jsp file incorrect?

Thanks.


Tomcat vs Resin - Tag Libraries

2004-03-22 Thread Kilic, Hakan
Hi all,

I'm working on making sure an application I've written works on Tomcat,
Resin and a few others, and I've come across a very interesting problem.

The application is working with tag libraries, and runs on Apache/Tomcat
4.1.12, and Resin 2.1.6.

My tag library is IfSet.

In the _jspService() that Tomcat generates I get the following code snippet:

+
com.mycompany.tags.IfSet _jspx_th_dm_ifSet_0 = new
com.mycompany.tags.IfSet();
_jspx_th_dm_ifSet_0.setPageContext(pageContext);
_jspx_th_dm_ifSet_0.setParent(null);
_jspx_th_dm_ifSet_0.setName(myname);
java.lang.String value = null;

try {
int _jspx_eval_dm_ifSet_0 = _jspx_th_dm_ifSet_0.doStartTag();
  value = (java.lang.String) pageContext.findAttribute(key1);
  if (_jspx_eval_dm_ifSet_0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
try {
if (_jspx_eval_dm_ifSet_0 !=
javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
  out = pageContext.pushBody();
  _jspx_th_dm_ifSet_0.setBodyContent((javax.servlet.jsp.tagext.BodyContent)
out);
  _jspx_th_dm_ifSet_0.doInitBody();


But resin produces this code snippet:

+++
com.caucho.jsp.QBodyContent _jsp_endTagHack0 = null;
  if (_jsp_tag0 == null) {
_jsp_tag0 = new com.mycompany.tags.IfSet();
_jsp_tag0.setPageContext(pageContext);
_jsp_tag0.setParent((javax.servlet.jsp.tagext.Tag) null);
_jsp_tag0.setName(myname);
  }

  int _jspEval1 = _jsp_tag0.doStartTag();
  if (_jspEval1 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspEval1 ==
javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_BUFFERED) {
  out = pageContext.pushBody();
  _jsp_endTagHack0 = (com.caucho.jsp.QBodyContent) out;
  _jsp_tag0.setBodyContent(_jsp_endTagHack0);
}
value = (java.lang.String)pageContext.findAttribute(key1);



All I'm doing in my html is calling %pageContext.findAttribute(key1)%,
and I'm getting an error that value isn't declared. For some reason Tomcat
will declare is using java.lang.String value = null; while Resin will not.
Also, Tomcat is initializing the tag library right away, with the statement 

com.mycompany.tags.IfSet _jspx_th_dm_ifSet_0 = new
com.mycompany.tags.IfSet();

but Resin instead uses 

com.mycompany.tags.IfSet _jsp_tag0 = null;

Is there some part of the spec Tomcat is implementing properly/differently?
Is it how I'm using my tag library?

Any help would be great, since this is in the servlet code generated, and
it's a bit hard to work backwards to figure out what my Tomcat is doing and
why.

Thanks!

-HK

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



RE: Tomcat vs Resin - Tag Libraries

2004-03-22 Thread Kilic, Hakan
A little more info, seems the TagExtraInfo is causing some problems for me.
Here's a snippet from the class:

+
public class ValueTEI extends TagExtraInfo {

private boolean declared = false;

public VariableInfo[] getVariableInfo(TagData tagData) {
if (!declared) {
declared = true;
return new VariableInfo[] {
new
VariableInfo(value,java.lang.String,true,VariableInfo.AT_BEGIN)
};
}
else {
return new VariableInfo[] {
new
VariableInfo(value,java.lang.String,false,VariableInfo.NESTED)
};
}
}
}
++

Why is value being declared for Tomcat but differently for Resin?

And below, replace key1 with value in the snippet. Typo there.

-Hakan

-Original Message-
From: Kilic, Hakan [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 22, 2004 6:55 PM
To: Tomcat Users List
Subject: Tomcat vs Resin - Tag Libraries

Hi all,

I'm working on making sure an application I've written works on Tomcat,
Resin and a few others, and I've come across a very interesting problem.

The application is working with tag libraries, and runs on Apache/Tomcat
4.1.12, and Resin 2.1.6.

My tag library is IfSet.

In the _jspService() that Tomcat generates I get the following code snippet:

+
com.mycompany.tags.IfSet _jspx_th_dm_ifSet_0 = new
com.mycompany.tags.IfSet();
_jspx_th_dm_ifSet_0.setPageContext(pageContext);
_jspx_th_dm_ifSet_0.setParent(null);
_jspx_th_dm_ifSet_0.setName(myname);
java.lang.String value = null;

try {
int _jspx_eval_dm_ifSet_0 = _jspx_th_dm_ifSet_0.doStartTag();
  value = (java.lang.String) pageContext.findAttribute(key1);
  if (_jspx_eval_dm_ifSet_0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
try {
if (_jspx_eval_dm_ifSet_0 !=
javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
  out = pageContext.pushBody();
  _jspx_th_dm_ifSet_0.setBodyContent((javax.servlet.jsp.tagext.BodyContent)
out);
  _jspx_th_dm_ifSet_0.doInitBody();


But resin produces this code snippet:

+++
com.caucho.jsp.QBodyContent _jsp_endTagHack0 = null;
  if (_jsp_tag0 == null) {
_jsp_tag0 = new com.mycompany.tags.IfSet();
_jsp_tag0.setPageContext(pageContext);
_jsp_tag0.setParent((javax.servlet.jsp.tagext.Tag) null);
_jsp_tag0.setName(myname);
  }

  int _jspEval1 = _jsp_tag0.doStartTag();
  if (_jspEval1 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspEval1 ==
javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_BUFFERED) {
  out = pageContext.pushBody();
  _jsp_endTagHack0 = (com.caucho.jsp.QBodyContent) out;
  _jsp_tag0.setBodyContent(_jsp_endTagHack0);
}
value = (java.lang.String)pageContext.findAttribute(key1);



All I'm doing in my html is calling %pageContext.findAttribute(key1)%,
and I'm getting an error that value isn't declared. For some reason Tomcat
will declare is using java.lang.String value = null; while Resin will not.
Also, Tomcat is initializing the tag library right away, with the statement 

com.mycompany.tags.IfSet _jspx_th_dm_ifSet_0 = new
com.mycompany.tags.IfSet();

but Resin instead uses 

com.mycompany.tags.IfSet _jsp_tag0 = null;

Is there some part of the spec Tomcat is implementing properly/differently?
Is it how I'm using my tag library?

Any help would be great, since this is in the servlet code generated, and
it's a bit hard to work backwards to figure out what my Tomcat is doing and
why.

Thanks!

-HK

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

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



RE: jsp page with enctype=MULTIPART/FORM-DATA

2003-12-10 Thread Kilic, Hakan
Hi FTP (nice name),

multipart/form-data doesn't send the value as query string parameters (not a
normal post such as application/url-encoded). You can't just do a
request.getParameter(someparameter) for a multipart/form-data POST.

Try checking out various file upload libraries (oreilly.com has one, as well
as file-upload). This isn't Tomcat specific.

-Hakan Kilic

-Original Message-
From: FTP Admin [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 10, 2003 4:29 PM
To: Tomcat Users List
Subject: jsp page with enctype=MULTIPART/FORM-DATA


Hi,

Hi there,

when I add the following: enctype=MULTIPART/FORM-DATA

in a FORM element in a jsp page, then the values of the FORM parameters 
doesn't get propagated to the action servelet The servlet receives 
nulls only!!! If i skip the enctype=MULTIPART/FORM-DATA in the FORM, 
everything (the parameters do retain their values!) works fine! Any 
explanation???

I need this modification in order to include file upload capabilities 
into my servlet!

Thanks


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

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



request.getremoteAddr() returning 127.0.0.1 (localhost)

2003-11-28 Thread Kilic, Hakan
Hi all,

I've searched the email archive and bugzilla, and come across bug 20041:

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20041 back from June 2003.

I'm using Tomcat 4.1.24 Standalone, and I've attached the server.xml file
I'm using (I'm using the Catalina connector).

Does anyone know what the problem is and if there is a workaround to this? 

Thanks!

-Hakan


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

RE: request.getremoteAddr() returning 127.0.0.1 (localhost)

2003-11-28 Thread Kilic, Hakan
It didn't attach the file. Here it is below:

Server port=8005 shutdown=SHUTDOWN debug=0

  Service name=Tomcat-Standalone
 
Connector className=org.apache.catalina.connector.http.HttpConnector
   port= minProcessors=64 maxProcessors=256
   enableLookups=false redirectPort=8443
   acceptCount=64 debug=0 connectionTimeout=6/

   !-- Define a SSL Coyote HTTP/1.1 Connector on port 8443 --
!--
Connector className=org.apache.coyote.tomcat4.CoyoteConnector
   port=8443 minProcessors=64 maxProcessors=256
   enableLookups=false
   acceptCount=100 debug=0 scheme=https secure=true
   useURIValidationHack=false disableUploadTimeout=true
  Factory
className=org.apache.coyote.tomcat4.CoyoteServerSocketFactory
   clientAuth=false protocol=TLS /
/Connector
--

Engine name=Standalone defaultHost=localhost debug=0

  !-- Global logger unless overridden at lower levels --
  Logger className=org.apache.catalina.logger.FileLogger
  prefix=catalina_log. suffix=.txt
  timestamp=true/

  !-- Because this Realm is here, an instance will be shared globally
--

  Realm className=org.apache.catalina.realm.MemoryRealm /

  !-- Define the default virtual host --
  Host name=localhost debug=0 appBase=webapps 
   unpackWARs=true autoDeploy=true

Valve className=org.apache.catalina.valves.AccessLogValve
 directory=logs prefix=localhost_access_log.
suffix=.txt
 resolveHosts=false pattern=common/

Logger className=org.apache.catalina.logger.FileLogger
 directory=logs  prefix=localhost_log. suffix=.txt
timestamp=true/

!-- Root context --
!-- Context path= docBase=ROOT debug=0/ --

  /Host
/Engine
  /Service
/Server


-Original Message-
From: Kilic, Hakan [mailto:[EMAIL PROTECTED]
Sent: Friday, November 28, 2003 6:07 PM
To: 'Tomcat Users List'
Subject: request.getremoteAddr() returning 127.0.0.1 (localhost)


Hi all,

I've searched the email archive and bugzilla, and come across bug 20041:

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20041 back from June 2003.

I'm using Tomcat 4.1.24 Standalone, and I've attached the server.xml file
I'm using (I'm using the Catalina connector).

Does anyone know what the problem is and if there is a workaround to this? 

Thanks!

-Hakan



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



RE: Tomcat 4.1.24 Standalone max requests serviced java exception

2003-11-26 Thread Kilic, Hakan
Hi all,

After realizing that the application bug wasn't a bug or my main culprit, I
did some checking on my machine setup. I found that Hyperthreading actually
decreased the total load Tomcat could handle. Once I turned HT off, I was
able to significantly increase the amount of load the server could handle
(my application uses a lot of jsp pages).

Just wanted to post a follow up.

-Hakan

-Original Message-
From: Kilic, Hakan [mailto:[EMAIL PROTECTED]
Sent: Friday, November 21, 2003 9:53 AM
To: 'Tomcat Users List'
Subject: RE: Tomcat 4.1.24 Standalone max requests serviced java
exception


Hi Yansheng,

That was a great link, thanks! I did happen to have an error page specified
for my application, and once I removed this, I found that another java
exception was being reported, one from my application itself, that was being
hidden by the illegalstateexception.

Thanks so much!

-Hakan Kilic

-Original Message-
From: Yansheng Lin [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 20, 2003 3:17 PM
To: 'Tomcat Users List'
Subject: RE: Tomcat 4.1.24 Standalone max requests serviced java
exception



Here is a good link explaining the error:

http://www2.real-time.com/rte-tomcat/2000/Jun/msg02488.html



-Original Message-
From: Yansheng Lin [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 20, 2003 1:12 PM
To: 'Tomcat Users List'
Subject: RE: Tomcat 4.1.24 Standalone max requests serviced java exception


I will give this a try:

I don't think this is related to the number of requests.  By default, JSP 
pages will try to create a session.  So if you call a new jsp page after 
the response has been sent committed, this is exactly what is supposed to 
happen. Are you trying to forward or redirect the reponse after it's being 
committed?

How do you test your application, btw?

-Yan

-Original Message-
From: Kilic, Hakan [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 19, 2003 7:47 AM
To: 'Tomcat Users List'
Subject: Tomcat 4.1.24 Standalone max requests serviced java exception


Hi all,

I'm running into this java exception only when increasing my traffic to my
Tomcat web server. I'm running Tomcat 4.1.24 Standalone, and my traffic is
about 100 concurrent connections when this happens. I'm just wondering if

a) This error is really related to reaching the max number of requests my
server can handle
b) How can I increase the number of requests my server can service, already
tinkered around with connections in the server.xml (it's a dual P3 1.4 GHz,
2G ram machine)
c) What's this java exception really mean.

2003-11-18 12:45:17 JspFactoryImpl: Exception initializing page context
java.lang.IllegalStateException: Cannot create a session after the response
has been committed
at
org.apache.coyote.tomcat4.CoyoteRequest.doGetSession(CoyoteRequest.java:1884
)
at
org.apache.coyote.tomcat4.CoyoteRequest.getSession(CoyoteRequest.java:1731)
at
org.apache.coyote.tomcat4.CoyoteRequestFacade.getSession(CoyoteRequestFacade
.java:365)
at
org.apache.coyote.tomcat4.CoyoteRequestFacade.getSession(CoyoteRequestFacade
.java:370)
at
javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWr
apper.java:268)
at
org.apache.jasper.runtime.PageContextImpl._initialize(PageContextImpl.java:1
38)
at
org.apache.jasper.runtime.PageContextImpl.initialize(PageContextImpl.java:11
4)
at
org.apache.jasper.runtime.JspFactoryImpl.internalGetPageContext(JspFactoryIm
pl.java:175)
at
org.apache.jasper.runtime.JspFactoryImpl.getPageContext(JspFactoryImpl.java:
154)
at
org.apache.jsp.core_loadtest_jsp._jspService(core_loadtest_jsp.java:33)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2
10)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.
java:684)
at
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatch
er.java:575)
at
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher
.java:498)
at
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:8
22)
at org.apache.jsp.digits_jsp._jspService(digits_jsp.java:2905)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2
10)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295

RE: Tomcat 4.1.24 Standalone max requests serviced java exception

2003-11-21 Thread Kilic, Hakan
Hi Yansheng,

That was a great link, thanks! I did happen to have an error page specified
for my application, and once I removed this, I found that another java
exception was being reported, one from my application itself, that was being
hidden by the illegalstateexception.

Thanks so much!

-Hakan Kilic

-Original Message-
From: Yansheng Lin [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 20, 2003 3:17 PM
To: 'Tomcat Users List'
Subject: RE: Tomcat 4.1.24 Standalone max requests serviced java
exception



Here is a good link explaining the error:

http://www2.real-time.com/rte-tomcat/2000/Jun/msg02488.html



-Original Message-
From: Yansheng Lin [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 20, 2003 1:12 PM
To: 'Tomcat Users List'
Subject: RE: Tomcat 4.1.24 Standalone max requests serviced java exception


I will give this a try:

I don't think this is related to the number of requests.  By default, JSP 
pages will try to create a session.  So if you call a new jsp page after 
the response has been sent committed, this is exactly what is supposed to 
happen. Are you trying to forward or redirect the reponse after it's being 
committed?

How do you test your application, btw?

-Yan

-Original Message-
From: Kilic, Hakan [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 19, 2003 7:47 AM
To: 'Tomcat Users List'
Subject: Tomcat 4.1.24 Standalone max requests serviced java exception


Hi all,

I'm running into this java exception only when increasing my traffic to my
Tomcat web server. I'm running Tomcat 4.1.24 Standalone, and my traffic is
about 100 concurrent connections when this happens. I'm just wondering if

a) This error is really related to reaching the max number of requests my
server can handle
b) How can I increase the number of requests my server can service, already
tinkered around with connections in the server.xml (it's a dual P3 1.4 GHz,
2G ram machine)
c) What's this java exception really mean.

2003-11-18 12:45:17 JspFactoryImpl: Exception initializing page context
java.lang.IllegalStateException: Cannot create a session after the response
has been committed
at
org.apache.coyote.tomcat4.CoyoteRequest.doGetSession(CoyoteRequest.java:1884
)
at
org.apache.coyote.tomcat4.CoyoteRequest.getSession(CoyoteRequest.java:1731)
at
org.apache.coyote.tomcat4.CoyoteRequestFacade.getSession(CoyoteRequestFacade
.java:365)
at
org.apache.coyote.tomcat4.CoyoteRequestFacade.getSession(CoyoteRequestFacade
.java:370)
at
javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWr
apper.java:268)
at
org.apache.jasper.runtime.PageContextImpl._initialize(PageContextImpl.java:1
38)
at
org.apache.jasper.runtime.PageContextImpl.initialize(PageContextImpl.java:11
4)
at
org.apache.jasper.runtime.JspFactoryImpl.internalGetPageContext(JspFactoryIm
pl.java:175)
at
org.apache.jasper.runtime.JspFactoryImpl.getPageContext(JspFactoryImpl.java:
154)
at
org.apache.jsp.core_loadtest_jsp._jspService(core_loadtest_jsp.java:33)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2
10)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.
java:684)
at
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatch
er.java:575)
at
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher
.java:498)
at
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:8
22)
at org.apache.jsp.digits_jsp._jspService(digits_jsp.java:2905)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2
10)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:247)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:193)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:256)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke

Tomcat 4.1.24 Standalone max requests serviced java exception

2003-11-19 Thread Kilic, Hakan
Hi all,

I'm running into this java exception only when increasing my traffic to my
Tomcat web server. I'm running Tomcat 4.1.24 Standalone, and my traffic is
about 100 concurrent connections when this happens. I'm just wondering if

a) This error is really related to reaching the max number of requests my
server can handle
b) How can I increase the number of requests my server can service, already
tinkered around with connections in the server.xml (it's a dual P3 1.4 GHz,
2G ram machine)
c) What's this java exception really mean.

2003-11-18 12:45:17 JspFactoryImpl: Exception initializing page context
java.lang.IllegalStateException: Cannot create a session after the response
has been committed
at
org.apache.coyote.tomcat4.CoyoteRequest.doGetSession(CoyoteRequest.java:1884
)
at
org.apache.coyote.tomcat4.CoyoteRequest.getSession(CoyoteRequest.java:1731)
at
org.apache.coyote.tomcat4.CoyoteRequestFacade.getSession(CoyoteRequestFacade
.java:365)
at
org.apache.coyote.tomcat4.CoyoteRequestFacade.getSession(CoyoteRequestFacade
.java:370)
at
javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWr
apper.java:268)
at
org.apache.jasper.runtime.PageContextImpl._initialize(PageContextImpl.java:1
38)
at
org.apache.jasper.runtime.PageContextImpl.initialize(PageContextImpl.java:11
4)
at
org.apache.jasper.runtime.JspFactoryImpl.internalGetPageContext(JspFactoryIm
pl.java:175)
at
org.apache.jasper.runtime.JspFactoryImpl.getPageContext(JspFactoryImpl.java:
154)
at
org.apache.jsp.core_loadtest_jsp._jspService(core_loadtest_jsp.java:33)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2
10)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.
java:684)
at
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatch
er.java:575)
at
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher
.java:498)
at
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:8
22)
at org.apache.jsp.digits_jsp._jspService(digits_jsp.java:2905)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2
10)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:247)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:193)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:256)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:191)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2416)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
java:171)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172
)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at

RE: Removing extra white spaces in source

2003-10-24 Thread Kilic, Hakan
I actually see this a lot, and the amount of 

out.write(\r\n);

varies a great deal depending on the servlet container. For example a jsp
that compiles fine with Tomcat failed to compile (at run time) using Resin.
This was only because Resin wrote out so many out.write(\r\n); that the
generated .class file was larger then the 64K (or is it 32K?) size limit for
a single method for the JVM. (The infamous unable to compile branch yadda
yadda error msg...)

Why does tomcat put in so many of these statements into the generated
servlet (.class file), html just ignores whitespace and it just increases
the size of the .class file. Or am I missing something?

-Hakan Kilic

-Original Message-
From: Justin Ruthenbeck [mailto:[EMAIL PROTECTED]
Sent: Friday, October 24, 2003 2:44 PM
To: Tomcat Users List
Subject: Re: Removing extra white spaces in source



I think I'm reading the original poster's message right in assuming 
he means white space in the generated html, but maybe I'm going 
off in a different direction...

At 11:24 AM 10/24/2003, you wrote:
Also, the title is about white space in source, but in the message 
he talks about removing white space from generated jsp and 
servlet??

Generated servlet is a .class file and I would be very reluctant to 
diddle with the tomcat generated .jsp files.  And I dont see the 
need to ever mess with those, so I don't think he really means 
generated files.

When precompiling JSP files, the generated servlet *source* files 
(error$jsp.java in Tomcat 4.0.3, for example) often have large 
blocks of code that look like:

   // HTML
   // begin[file=/x/y/header.jsp;from=(0,46);to=(1,0)]
   out.write(\r\n);
   // end

This seems to happen when using jsp:include statements.  In the 
file that the above example was taken from, there are 17 such 
blocks all in a row.

When compiled and run, this results in a lot of whitespace in the 
generated html which can sometimes screw up the display.  I've seen 
this before and have always been able to work around it, but it can 
be a problem.

There are several code beautifiers around if that is what he is 
really looking for.

This won't solve the problem.  One would need a way to remove the 
multitude of out.write(\r\n); statements in the generated jsps.

justin


Shapira, Yoav wrote:
Howdy,
It simple: what does he mean by extra white space?  White space 
at the
end of a line?  White space preceding text?  White space in the 
middle
of words?  This is a text-processing problem.  Depending on the
requirements, writing such a text processors can be trivial or 
highly
complex.
Yoav Shapira
Millennium ChemInformatics


-Original Message-
From: Oscar Carrillo [mailto:[EMAIL PROTECTED]
Sent: Friday, October 24, 2003 12:52 PM
To: Tomcat Users List
Subject: RE: Removing extra white spaces in source

Whatdoyoumean?

On Fri, 24 Oct 2003, Shapira, Yoav wrote:


Howdy,
That depends on the definition of extra ;)

Yoav Shapira
Millennium ChemInformatics



-Original Message-
From: Luiz Ricardo [mailto:[EMAIL PROTECTED]
Sent: Friday, October 24, 2003 1:51 PM
To: Tomcat-Users List
Subject: Removing extra white spaces in source

Hi everyone,

I would like to know if someone here knows some filter that removes
extra white spaces from content generated by servlet or jsp.

Luiz Ricardo



-

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




This e-mail, including any attachments, is a confidential business

communication, and may contain information that is confidential,
proprietary and/or privileged.  This e-mail is intended only for 
the
individual(s) to whom it is addressed, and may not be saved, 
copied,
printed, disclosed or used by anyone else.  If you are not the(an)
intended

recipient, please immediately delete this e-mail from your computer
system

and notify the sender.  Thank you.


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



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


This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, 
proprietary and/or privileged.  This e-mail is intended only for 
the individual(s) to whom it is addressed, and may not be saved, 
copied, printed, disclosed or used by anyone else.  If you are not 
the(an) intended recipient, please immediately delete this e-mail 
from your computer system and notify the sender.  Thank you.

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


-- 
***
* Rick Roberts 

[OT] RE: web.xml editor

2003-10-23 Thread Kilic, Hakan
A bit off topic, but where would you suggest getting a handle on how to
build Eclipse plug-ins? There's lots of great XML editors for Eclipse
(personally I use Netbeans but it's a much slower response time using
Swing/AWT), but what about JSP compiler plug-ins?

Thanks!

-Hakan Kilic

-Original Message-
From: Jeremy Whitlock [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 23, 2003 12:45 PM
To: 'Tomcat Users List'
Subject: RE: web.xml editor


Luiz,
Don't pay if you don't have to.  Eclipse has many XML Editors
but the best I've found is called BuddyXML.  If you go to:

http://eclipse-plugins.2y.net/eclipse/index.jsp

you can find many Eclipse Plugins.  Eclipse is awesome and can
be your universal editor for many languages.  It's even an IDE for many
languages as well.  Also, I have to second the idea for NetBeans.  It's
great as well although not as fast or modular as Eclipse.  Laters,
Jeremy

P.S. - If you are ONLY looking for an XML IDE/Editor, Cooktop is the
best free one I've found.  Get it here:  http://www.xmlcooktop.com/
(It's only for Windows though)

-Original Message-
From: Robert Hall [mailto:[EMAIL PROTECTED] 
Sent: Thursday, October 23, 2003 10:44 AM
To: Tomcat Users List
Subject: Re: web.xml editor

Luiz,

You should  try oXygen XML editor from http://www.oxygenxml.com.
It can run stand-alone or as an Eclipse plug-in.  (Eclipse is an IDE 
that IBM
open sourced; also worth a look).There is a 30 day trial version of 
oXygen
and if you decide to purchase it's reasonable (~ $45 US).

-Robert

Luiz Ricardo wrote:

Hi everyone,

I would like to know if someone here uses some free application to
edit web.xml files, likely this application was web-based.

I also would like to know if Tomcat Team intends to do something like
this.

Thanks in advance,

Luiz Ricardo


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


  



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



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

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



RE: Can JSP track users in a basic authentication protected realm ?

2003-09-23 Thread Kilic, Hakan
Your best bet when dealing with authentication and users not logging off is
to also include a session expiry for your page. This handles the case where
a user leaves without logging off.

-Hakan

-Original Message-
From: Jon Wingfield [mailto:[EMAIL PROTECTED]
Sent: Monday, September 22, 2003 6:25 AM
To: Tomcat Users List
Subject: Re: Can JSP track users in a basic authentication protected
realm ?


You could possibly track the referer header of the request. If the 
referer is a site outside your protection domain then re-authenticate.
This could be done in a filter: Check the header, log out the user, 
redirect to the requested page to trigger re-authentication.

This technique assumes the referer header has been set by the browser. 
As it's not a mandatory header you may not always get it:
http://www.w3.org/Protocols/rfc2616/rfc2616.txt
Specifically section 14.36 Referer

HTH,

Jon

David wrote:
 Actually I do not know how to do it. I know those internet banking sites
 does it. They have this option of Log out for their users. When users
 click on that log out option, they will in effect log out of the
 protected realm. Should they decide to return to the same site again (
 using the same instance of the IE) they will prompted for the password
 and ID again.
 
 Currently, with basic authentication ( implemented using HTTP SERVER)
 the server does not recognise if the user has moved onto another site
 outside the protected realm. If he decides to surf an area outside the
 protected realm, and decides to return to the protected realm, he will
 not be prompted for a password. 
 
 This problem arise when the computer being used to access my protected
 realm is a public computer. If that is the case, users who enter my
 protected realm and forgot to terminate that instance of the IE is going
 to allow subsequent users of that machine to access my site.
 
 My question is how can I implement such a way as mentioned above ?
 The log out button kind of effect.
 
 Many thanks.
 
 Regards
 David
 
 
 -Original Message-
 From: George Sexton [mailto:[EMAIL PROTECTED] 
 Sent: Sunday, September 21, 2003 12:47 AM
 To: 'Tomcat Users List'
 Subject: RE: Can JSP track users in a basic authentication protected
 realm ?
 
 Can you explain how Tomcat will be able to tell whether the user has
 navigated away and returned, versus just taken some period of time
 before getting the next page?
 
 -Original Message-
 From: David [mailto:[EMAIL PROTECTED] 
 Sent: Saturday, September 20, 2003 9:56 AM
 To: Tomcat User
 Subject: Can JSP track users in a basic authentication protected realm ?
 
 
 
 Hi guys,
  
 Does anyone know how I can implement the above mentioned?
 Once they exit the protected realm (i.e. the protected folder in my
 htdocs), when they re-enter the site again they will be asked for a
 password. I have a simple basic authentication system but it doesn't
 track the user when it leaves the protected realm. What I wanted to do
 was to get the server to re-authenticate the user everytime he leaves my
 realm and tries to re-enter again. 
  
  
 Some people suggested CGI, some suggest PHP..
  
 I would like to know if JSP can do the job. If yes, what level of
 competence do I know JSP ?
  




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

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



RE: Benefits of increasing bufferSize in server.xml

2003-09-18 Thread Kilic, Hakan
Thanks for your help!

-Hakan Kilic
[EMAIL PROTECTED]

+
Check out PDF Converter for Microsoft® Word which lets you open PDF files
right from within Microsoft Word, automatically converting them into
formatted Word documents you can edit.

PDF Converter is an inexpensive and simple way to transform PDF files into
workable documents in a fraction of the time it would normally take to
recreate your documents.

If you'd like to check it out, go to:

http://www.scansoft.com/pdfconverter/

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



Benefits of increasing bufferSize in server.xml

2003-09-17 Thread Kilic, Hakan
Hi all,

I've been tunning my Tomcat server and just wondering about the effects of
increasing the bufferSize in the server.xml. From the tomcat documentation
bufferSize is The size (in bytes) of the buffer to be provided for input
streams created by this connector. By default, buffers of 2048 bytes will be
provided. Does this only apply to input streams (requests)? What about
large files Tomcat has to serve up to request, how do you increase the
buffer size it uses in this case (responses)?

I'm basically looking for the Tomcat equivalent of SendBufferSize in Apache.


Thanks in advance,

-Hakan Kilic

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