RE: Avoiding same server to server HTTP calls to generate HTML pages via JSPs

2008-01-03 Thread gb1071nx

> Both incorporate the output of jsps and servlets in 
> the current request's output. 

Which is not what the OP wanted.  They wanted to :

> > essentially slap that [the response] into a MimeBodyPart for sending

> > text/html email messages.
> >

I've done something very similar - use an HTTP connection to 'scrape' a
page, and then include that output as the contents of a rich email.
The only thing I've done to make it easier is bundle up that
functionality in my own Util class that has a "scrape" method that takes
the current request, an URL and returns a String. 
 
I use it when I want to scrape JSPs for their content. 

In some cases, I have a few simpler "pages" that are actually velocity
templates. Velocity can be used outside the context of a HTTP
request/response cycle, so if you're able to re-do your JSP pages as
velocity templates (or similar technology) then it could be your best
bet.  http://velocity.apache.org 



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



Re: session id cookies

2008-01-03 Thread Bill Barker

"Paul Singleton" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> If I set
>
>
>
> will Tomcat ignore any JSESSIONID cookie which
> accompanies a request?  Should it?
>

With any of the released versions, it won't ignore the cookie if the browser 
sends one.  There is a patch in the SVN that causes at least TC 6 to ignore 
the cookie, but it seems to be buggy.  More info at 
http://issues.apache.org/bugzilla/show_bug.cgi?id=43839.

As to "should", IMHO the cookies="false" should be more of a hint (like in 
the released versions of Tomcat), but I'm in the minority here.


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




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



RE: Avoiding same server to server HTTP calls to generate HTML pages via JSPs

2008-01-03 Thread Gennady Shumakher
Supposing both dispatcher and jsp are located on the same server you could
consider using RequestDispatcher interface which is part of servlet API,
specifically include method. Take a look:
http://tomcat.apache.org/tomcat-5.5-doc/servletapi/javax/servlet/RequestDisp
atcher.html

Gennady

-Original Message-
From: Adam Gordon [mailto:[EMAIL PROTECTED] 
Sent: Friday, January 04, 2008 01:13
To: Tomcat Users List
Subject: Avoiding same server to server HTTP calls to generate HTML pages
via JSPs

Any one know if there exists a JSP writer engine in the Tomcat API that 
allows for the generation of HTML pages via JSP code but without having 
to make server to server HTTP calls?

Right now we basically have a URL dispatcher that when a specific 
request comes in, we make another request to retrieve the contents of a 
URI (a JSP page to generate HTML) via a server-to-server HTTP call and 
then essentially slap that into a MimeBodyPart for sending text/html 
email messages.

It would be nice (and make for much easier unit testing) if we could do 
this purely in Java land without having to make a server-to-server HTTP 
call behind the scenes.  Any one know a way or if this functionality 
even exists?

Thanks,

--adam

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


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



Re: Avoiding same server to server HTTP calls to generate HTML pages via JSPs

2008-01-03 Thread David Smith

There are two easy methods that should work:

1. The  tag of the standard tag library -- see 
http://jakarta.apache.org/taglibs/doc/standard-doc/intro.html


2. RequestDispatcher from the servlet spec which can not only forward, 
but also perform includes


Both incorporate the output of jsps and servlets in the current 
request's output.  My personal preference is the  tag as 
it's clean, easy, and can work across contexts on the same tomcat server 
with hardly any coding on your part.


--David

Adam Gordon wrote:
Any one know if there exists a JSP writer engine in the Tomcat API 
that allows for the generation of HTML pages via JSP code but without 
having to make server to server HTTP calls?


Right now we basically have a URL dispatcher that when a specific 
request comes in, we make another request to retrieve the contents of 
a URI (a JSP page to generate HTML) via a server-to-server HTTP call 
and then essentially slap that into a MimeBodyPart for sending 
text/html email messages.


It would be nice (and make for much easier unit testing) if we could 
do this purely in Java land without having to make a server-to-server 
HTTP call behind the scenes.  Any one know a way or if this 
functionality even exists?


Thanks,

--adam

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




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



Avoiding same server to server HTTP calls to generate HTML pages via JSPs

2008-01-03 Thread Adam Gordon
Any one know if there exists a JSP writer engine in the Tomcat API that 
allows for the generation of HTML pages via JSP code but without having 
to make server to server HTTP calls?


Right now we basically have a URL dispatcher that when a specific 
request comes in, we make another request to retrieve the contents of a 
URI (a JSP page to generate HTML) via a server-to-server HTTP call and 
then essentially slap that into a MimeBodyPart for sending text/html 
email messages.


It would be nice (and make for much easier unit testing) if we could do 
this purely in Java land without having to make a server-to-server HTTP 
call behind the scenes.  Any one know a way or if this functionality 
even exists?


Thanks,

--adam

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



RE: HTTP Status 500 while trying to use a DTO to send data from a Servlet to a JSP

2008-01-03 Thread Caldarale, Charles R
> From: Albretch Mueller [mailto:[EMAIL PROTECTED] 
> Subject: HTTP Status 500 while trying to use a DTO to send 
> data from a Servlet to a JSP
> 
>  This is where I have both the servlet and the DTO
> ~
>  . . .\webapps08\serv2jspTest\WEB-INF\classes>dir *.* /B
> ~
> UpFlInfoK.class
> UpFlInfoK.java
> UploadServlet10.class
> UploadServlet10.java

Quoting from section 11.2 of the JSP spec:

"As of JSP 2.0, it is illegal to refer to any classes from the unnamed
(a.k.a. default) package."

 - Chuck


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

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



HTTP Status 500 while trying to use a DTO to send data from a Servlet to a JSP

2008-01-03 Thread Albretch Mueller
~
 I am using TC 4.1.36 and I have a simple Data Transfer Object that I
create in a front controller servlet and use to build a JSP view
~
 This is where I have both the servlet and the DTO
~
 . . .\webapps08\serv2jspTest\WEB-INF\classes>dir *.* /B
~
UpFlInfoK.class
UpFlInfoK.java
UploadServlet10.class
UploadServlet10.java
~
 and this is where I have the jsp pages
~
 . . .\webapps08\serv2jspTest>dir *.* /B
serv2jspTest.jsp
~
 and this is my jsp page
~
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
http://www.w3.org/TR/html4/loose.dtd";>

<%@ page import="java.util.*" %>
<%@ page import="java.text.*" %>



// __ global data set in jspInit() which runs once
<%!
 private final String aDtFrmt = "-MM-dd_HHmmss"; // @! it should
be read in as input parameter
 private SimpleDateFormat SDtF = null;
 public void jspInit(){ SDtF =  new SimpleDateFormat(aDtFrmt); }
%>

// __ request scoped data runs every time jsp is accessed
<%
 UpFlInfoK UpFlInf = request.getAttribute("UpFlInf");
 String aLModDt = SDtF.format(new Date(UpFlInf.lL2LModDt));
// __
 String aPg = "There already exist a file on the server, uploaded ";
 aPg += aLModDt;
 aPg += "by user id: ";
 aPg += UpFlInf.aUsrID;
 aPg += " that is exactly the same as the one you tried to
upload.Information about current file on server: File
Length: ";
 aPg += UpFlInf.lFlL2;
 aPg += " (bytes) MD5Sum: ";
 aPg += UpFlInf.aFlMD5Sum;
 aPg += "Do you want to try again?";
%>


 
  
  Same File
 
 
  <%=aPg%>
 

~
 then I am going:
~
 request.setAttribute("UpFlInf", UpFlInf);
 request.getRequestDispatcher(aDispatchPg).forward(request, response);
~
 but I can't make the jsp page import the class, even though I thought
you should keep all classes in /WEB-INF/classes
~
 Where do you put classes so that servlets and JSPs can import and use them?
~
 This is the error I am getting:
~
HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented
it from fulfilling this request.

exception

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

An error occurred at line: 6 in the jsp file: /same_file.jsp

Generated servlet error:
Project base dir set to: C:\cmllpz\prjx\java\GWB\tc\tc-4.1.36
Detected Java version: 1.6 in: C:\WApps\java\jdk1.6.0_02\jre
Detected OS: Windows XP
[antlib:org.apache.tools.ant] Could not load definitions from resource
org/apache/tools/ant/antlib.xml. It could not be found.
[javac] same_file_jsp.java added as same_file_jsp.class is outdated.
[javac] Compiling 1 source file
[javac] Using modern compiler
dropping C:\cmllpz\prjx\java\GWB\tc\bin\bootstrap.jar from path as it
doesn't exist
[javac] Compilation arguments:
[javac] '-classpath'
[javac] 
'C:\WApps\java\jdk1.6.0_02\lib\tools.jar;C:\cmllpz\prjx\java\GWB\webappsDir_tc-4.1.36\webapps08\fileupload\WEB-INF\classes;C:\cmllpz\prjx\java\GWB\webappsDir_tc-4.1.36\webapps08\fileupload\WEB-INF\lib\commons-fileupload-1.2.jar;C:\cmllpz\prjx\java\GWB\webappsDir_tc-4.1.36\webapps08\fileupload\WEB-INF\lib\commons-io-1.3.2.jar;C:\cmllpz\prjx\java\GWB\tc\tc-4.1.36\shared\classes;C:\cmllpz\prjx\java\GWB\tc\tc-4.1.36\common\classes;C:\cmllpz\prjx\java\GWB\tc\tc-4.1.36\common\endorsed\xercesImpl.jar;C:\cmllpz\prjx\java\GWB\tc\tc-4.1.36\common\endorsed\xml-apis.jar;C:\cmllpz\prjx\java\GWB\tc\tc-4.1.36\common\lib\activation.jar;C:\cmllpz\prjx\java\GWB\tc\tc-4.1.36\common\lib\ant-launcher.jar;C:\cmllpz\prjx\java\GWB\tc\tc-4.1.36\common\lib\ant.jar;C:\cmllpz\prjx\java\GWB\tc\tc-4.1.36\common\lib\commons-collections-3.2.jar;C:\cmllpz\prjx\java\GWB\tc\tc-4.1.36\common\lib\commons-dbcp-1.2.1.jar;C:\cmllpz\prjx\java\GWB\tc\tc-4.1.36\common\lib\commons-logging-api-1.1.jar;C:\cmllpz\prjx\java\GWB\tc\tc-4.1.36\common\lib\commons-pool-1.3.jar;C:\cmllpz\prjx\java\GWB\tc\tc-4.1.36\common\lib\jasper-compiler.jar;C:\cmllpz\prjx\java\GWB\tc\tc-4.1.36\common\lib\jasper-runtime.jar;C:\cmllpz\prjx\java\GWB\tc\tc-4.1.36\common\lib\jdbc2_0-stdext.jar;C:\cmllpz\prjx\java\GWB\tc\tc-4.1.36\common\lib\jndi.jar;C:\cmllpz\prjx\java\GWB\tc\tc-4.1.36\common\lib\jta.jar;C:\cmllpz\prjx\java\GWB\tc\tc-4.1.36\common\lib\mail.jar;C:\cmllpz\prjx\java\GWB\tc\tc-4.1.36\common\lib\naming-common.jar;C:\cmllpz\prjx\java\GWB\tc\tc-4.1.36\common\lib\naming-factory.jar;C:\cmllpz\prjx\java\GWB\tc\tc-4.1.36\common\lib\naming-resources.jar;C:\cmllpz\prjx\java\GWB\tc\tc-4.1.36\common\lib\postgresql-8.2-506.jdbc4.jar;C:\cmllpz\prjx\java\GWB\tc\tc-4.1.36\common\lib\servlet.jar;C:\cmllpz\prjx\java\GWB\tc\tc-4.1.36\bin\bootstrap.jar'
[javac] '-sourcepath'
[javac] 'C:\cmllpz\prjx\java\GWB\work'
[javac] '-encoding'
[javac] 'UTF8'
[javac] '-g'
[javac]
[javac] The ' characters around the executable and arguments are
[javac] not part of the command.
[javac] File to be compiled:
[javac] C:\cmllpz\prjx\java\GWB\work\same_file_jsp.java

C:\cmllpz\prjx\java\GWB\work\same_file_jsp.java:49: canno

Re: FW: Reading servlet server connector configuration

2008-01-03 Thread Mark Thomas
Asaf Lahav wrote:
> Hi guys,
> 
> I didn't get any feedback on this so I'm resending to make sure it got to
> the mailing list.

It arrived the first time.

You might want to read this:
http://wiki.apache.org/tomcat/FAQ/Tomcat_User

Mark


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



Re: Servlet Filter Not Intercepting?

2008-01-03 Thread Len Popp
How does it redirect to the filter? That doesn't make sense - after
your servlet throws an exception it can't do a redirect.

Filters are always called *before* the servlet or JSP. The servlet is
only called if all the filters before it call doFilter to pass the
request on. When your servlet runs, either your filter was already
invoked (and is still on the call stack) or the filter is not invoked
at all. I don't see any other possibilities.

When your servlet throws the exception, do you get a stack trace in
Tomcat's log file? Does it show both the servlet and the filter?
-- 
Len

On Jan 3, 2008 2:27 PM, Jay Liu <[EMAIL PROTECTED]> wrote:
> Hi,
>
> 
> Checkout
> /Checkout
> 
>
> That's the only mapping I have for it. I will try the url pattern.
>
>
> The checkout servlet gets invoked, (I see a null pointer thrown from it)
> then it gets redirected to the filter.
>
> I saw an example somewhere that had the mappings altered. That's all.
>
> Thanks again,
> Jay
> -Original Message-
> From: Milanez, Marcus [mailto:[EMAIL PROTECTED]
> Sent: Thursday, January 03, 2008 6:30 AM
> To: Tomcat Users List; [EMAIL PROTECTED]
> Subject: RES: Servlet Filter Not Intercepting?
>
>
> Hi Jay,
>
> Your configuration seems to be fine.. Is your Checkout servlet ever invoked,
> cause you haven't posted your servlet-mapping tags. Have you tried mapping
> your filter using url-patterns, instead of servlet-name ? And only one more
> question, what do you mean by 'turn off invonking the resource' ?
>
> Yours,
>
> Marcus Milanez
>
>
> -Mensagem original-
> De: Jay Liu [mailto:[EMAIL PROTECTED]
> Enviada em: quinta-feira, 3 de janeiro de 2008 01:49
> Para: 'Tomcat Users List'
> Assunto: RE: Servlet Filter Not Intercepting?
>
> Thanks Marcus.
>
> Here's my filter setup. I just created it fresh in netbeans so I'd be
> surprised if there is a problem.
>
> I woke up this morning, realizing I forgot to turn off invoking the
> resource. Would that matter?
>
> 
> UserFilter
> store.filters.UserFilter
> 
> 
> UserFilter
> Checkout
> 
> 
> Checkout
>
> com.inifim.commerce.store.servlets.transactions.Checkout vlet-class>
> 
>
> I only have one filter right now.
>
> Thanks again,
> Jay
>
> -Original Message-
> From: Milanez, Marcus [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, January 02, 2008 5:21 AM
> To: Tomcat Users List; [EMAIL PROTECTED]
> Subject: RES: Servlet Filter Not Intercepting?
>
> Hi,
>
> Yes, filters atre supposed to intercept a requets just before it is
> accessed. Could you please post your filter config written in your web.xml
> file?
>
> Yours,
>
> Marcus Milanez
> http://sumatrablog.wordpress.com
>
> -Mensagem original-
> De: Jay Liu [mailto:[EMAIL PROTECTED]
> Enviada em: terça-feira, 1 de janeiro de 2008 18:36
> Para: users@tomcat.apache.org
> Assunto: Servlet Filter Not Intercepting?
>
> Hi all,
>
>
>
> I'm having a problem with filters. I setup filter to block access to a
> resource unless the user is authenticated.
>
>
>
> I've noticed that the resource is accessed then the filter kicks in and then
> loads.
>
>
>
> I thought filters were supposed to intercept the request before the resource
> is accessed?
>
>
>
> Is there something wrong with my xml configuration?
>
>
>
> Thanks,
>
> Jay
>
>
> -
> To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
> e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> -
> To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
> e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> -
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> -
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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



RE: Servlet Filter Not Intercepting?

2008-01-03 Thread Jay Liu
Hi,


Checkout
/Checkout


That's the only mapping I have for it. I will try the url pattern.


The checkout servlet gets invoked, (I see a null pointer thrown from it)
then it gets redirected to the filter. 

I saw an example somewhere that had the mappings altered. That's all.

Thanks again,
Jay
-Original Message-
From: Milanez, Marcus [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 03, 2008 6:30 AM
To: Tomcat Users List; [EMAIL PROTECTED]
Subject: RES: Servlet Filter Not Intercepting?

Hi Jay,

Your configuration seems to be fine.. Is your Checkout servlet ever invoked,
cause you haven't posted your servlet-mapping tags. Have you tried mapping
your filter using url-patterns, instead of servlet-name ? And only one more
question, what do you mean by 'turn off invonking the resource' ?

Yours,

Marcus Milanez


-Mensagem original-
De: Jay Liu [mailto:[EMAIL PROTECTED] 
Enviada em: quinta-feira, 3 de janeiro de 2008 01:49
Para: 'Tomcat Users List'
Assunto: RE: Servlet Filter Not Intercepting?

Thanks Marcus.

Here's my filter setup. I just created it fresh in netbeans so I'd be
surprised if there is a problem.

I woke up this morning, realizing I forgot to turn off invoking the
resource. Would that matter?


UserFilter
store.filters.UserFilter


UserFilter
Checkout


Checkout
 
com.inifim.commerce.store.servlets.transactions.Checkout


I only have one filter right now.

Thanks again,
Jay

-Original Message-
From: Milanez, Marcus [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 02, 2008 5:21 AM
To: Tomcat Users List; [EMAIL PROTECTED]
Subject: RES: Servlet Filter Not Intercepting?

Hi,

Yes, filters atre supposed to intercept a requets just before it is
accessed. Could you please post your filter config written in your web.xml
file?

Yours,

Marcus Milanez
http://sumatrablog.wordpress.com

-Mensagem original-
De: Jay Liu [mailto:[EMAIL PROTECTED]
Enviada em: terça-feira, 1 de janeiro de 2008 18:36
Para: users@tomcat.apache.org
Assunto: Servlet Filter Not Intercepting?

Hi all,

 

I'm having a problem with filters. I setup filter to block access to a
resource unless the user is authenticated.

 

I've noticed that the resource is accessed then the filter kicks in and then
loads.

 

I thought filters were supposed to intercept the request before the resource
is accessed?

 

Is there something wrong with my xml configuration?

 

Thanks,

Jay


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


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


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


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



Re: other ways to change the Connector element in server.xml?

2008-01-03 Thread Tim Funk

Doh ... sorry for being late to the game ...

Here's a small article that discusses this too ...

http://www.jroller.com/funkman/entry/let_properties_do_the_talking

-Tim

Anna Nhan wrote:

Thanks Rainer and Chuck for your responses.

How does Tomcat know to associate org.myorg.myapp.node1.http.port to the
Connector port?

Anna

On Jan 3, 2008 12:46 PM, Rainer Jung <[EMAIL PROTECTED]> wrote:


Like Chuck said:

you can freely choose names and values you like. Choose your names
carefully to prevent collisions with properties used by other
components, e.g. you can start the name with your internet domain name
or similar.

Example

Property -Dorg.myorg.myapp.node1.http.port=8001

in server.xml:


Rainer,

I've been searching the web for documented system properties to use to

set

up Catalina, but I am confused.

How do I know which system properties to use? And where can I find

proper

documentation for it?
Will setting these Catalina options be reflected in the server.xml?




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



Re: other ways to change the Connector element in server.xml?

2008-01-03 Thread Anna Nhan
oo, I have to manually edit the server.xml file. I see.

Thanks Rainer and Chuck.

Anna

On Jan 3, 2008 1:05 PM, Caldarale, Charles R <[EMAIL PROTECTED]>
wrote:

> > From: Anna Nhan [mailto:[EMAIL PROTECTED]
> > Subject: Re: other ways to change the Connector element in server.xml?
> >
> > How does Tomcat know to associate
> > org.myorg.myapp.node1.http.port to the
> > Connector port?
>
> Because you tell it to, as in Rainer's example:
>
> > 
>  - Chuck
>
>
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
> MATERIAL and is thus for use only by the intended recipient. If you
> received this in error, please contact the sender and delete the e-mail
> and its attachments from all computers.
>
> -
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


RE: other ways to change the Connector element in server.xml?

2008-01-03 Thread Caldarale, Charles R
> From: Anna Nhan [mailto:[EMAIL PROTECTED] 
> Subject: Re: other ways to change the Connector element in server.xml?
> 
> How does Tomcat know to associate 
> org.myorg.myapp.node1.http.port to the
> Connector port?

Because you tell it to, as in Rainer's example: 

> 

Re: other ways to change the Connector element in server.xml?

2008-01-03 Thread Anna Nhan
Thanks Rainer and Chuck for your responses.

How does Tomcat know to associate org.myorg.myapp.node1.http.port to the
Connector port?

Anna

On Jan 3, 2008 12:46 PM, Rainer Jung <[EMAIL PROTECTED]> wrote:

> Like Chuck said:
>
> you can freely choose names and values you like. Choose your names
> carefully to prevent collisions with properties used by other
> components, e.g. you can start the name with your internet domain name
> or similar.
>
> Example
>
> Property -Dorg.myorg.myapp.node1.http.port=8001
>
> in server.xml:
>
> 
> Regards,
>
> Rainer
>
> Anna Nhan schrieb:
> > Rainer,
> >
> > I've been searching the web for documented system properties to use to
> set
> > up Catalina, but I am confused.
> >
> > How do I know which system properties to use? And where can I find
> proper
> > documentation for it?
> > Will setting these Catalina options be reflected in the server.xml?
> >
> > Thanks,
> > Anna
> >
> >
> >>> Hi Anna,
> >>>
> >>> Anna Nhan schrieb:
>  Hi,
> 
>  Is there a way to change the Connector element in server.xml without
>  manually editing the file?  Could we, for example, change the
>  CATALINA_OPTS line using a script or C code to choose whether to use
>  HTTP or HTTPS,  the file path to the keystore and keystore password,
>  and whether or not the server should require client authentication?
> >>> Starting with TC 5.0 you can use system properties in server.xml,
> which
> >>> you can set during startup as commandline arguments
> >>> (-Dname.of.the.property=value).
> >>>
> >>> You refer to a system property in server.xml with ${
> name.of.the.property
> >> }.
> >>> If you don't like a very long command line, you can also set system
> >>> properties by adding them to catalina.properties (e.g. the startup
> >>> script could concatenate a master catalina.properties with additional
> >>> lines coming out of the script).
> >>>
> >>> Those ideas don't really help for passwords though (i.e. they don't
> get
> >>> more secret by this).
> >>>
>  Thanks,
>  Anna
> >>> Regards,
> >>>
> >>> Rainer
>
> -
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: other ways to change the Connector element in server.xml?

2008-01-03 Thread Rainer Jung
Like Chuck said:

you can freely choose names and values you like. Choose your names
carefully to prevent collisions with properties used by other
components, e.g. you can start the name with your internet domain name
or similar.

Example

Property -Dorg.myorg.myapp.node1.http.port=8001

in server.xml:

 Rainer,
> 
> I've been searching the web for documented system properties to use to set
> up Catalina, but I am confused.
> 
> How do I know which system properties to use? And where can I find proper
> documentation for it?
> Will setting these Catalina options be reflected in the server.xml?
> 
> Thanks,
> Anna
> 
> 
>>> Hi Anna,
>>>
>>> Anna Nhan schrieb:
 Hi,

 Is there a way to change the Connector element in server.xml without
 manually editing the file?  Could we, for example, change the
 CATALINA_OPTS line using a script or C code to choose whether to use
 HTTP or HTTPS,  the file path to the keystore and keystore password,
 and whether or not the server should require client authentication?
>>> Starting with TC 5.0 you can use system properties in server.xml, which
>>> you can set during startup as commandline arguments
>>> (-Dname.of.the.property=value).
>>>
>>> You refer to a system property in server.xml with ${name.of.the.property
>> }.
>>> If you don't like a very long command line, you can also set system
>>> properties by adding them to catalina.properties (e.g. the startup
>>> script could concatenate a master catalina.properties with additional
>>> lines coming out of the script).
>>>
>>> Those ideas don't really help for passwords though (i.e. they don't get
>>> more secret by this).
>>>
 Thanks,
 Anna
>>> Regards,
>>>
>>> Rainer

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



Re: JK connector causes Tomcat to utilize 50% CPU

2008-01-03 Thread Rainer Jung
Are you using the tcnative.dll?
If so, do you know, which version?
There was a bug in tcnative that resulted in the same symptom.
You might want to remove tcnative.dll temporarily to check, if this
fixes the problem, and then might want to check with a recent tcnative.

Regards,

Rainer

Smith, Michael schrieb:
> Greetings,
> 
> I am trying to set up an Apache 2.2.4 server with Tomcat 5.5.25 and JK
> connector 1.2.26 on a Windows XP PC.  This is a test configuration for a
> map server running both ESRI's ArcIMS and the open-source MapServer
> (MS4W distribution, which is a prepackaged Apache 2.2.4, PHP 5, and some
> other map-serving-specific open-source software).
> 
> Everything seems to work right, but the first time I access any
> application via Tomcat, the CPU goes to 50% and stays there (tomcat5.exe
> is the process).  I have a dual-cpu (dual cores, so 4 cores total) Dell
> box running Windows XP Professional SP2.
> 
> I followed the install steps for JK connector and am using the minimal
> (default) parameters in my mod_jk.conf file, and the simple application
> I'm loading is the 'Hello World' example (under servlets-examples
> distributed with Tomcat).
> 
> 1) copy the mod_jk.so file into apache/modules folder
> 
> 2) create a mod_jk.conf file in tomcat/conf folder:
> 
> JkWorkersFile "C:\ms4w\Apache\conf\workers.properties" 
> JkLogFile "C:\Tomcat5525\logs\mod_jk.log" 
> 
> JkLogLevel all 
> 
>  
> ServerName dep-eia1pcgis1
> 
> JkMount /servlets-examples ajp13
> JkMount /servlets-examples/* ajp13 
> 
> 
> 
> 3) create a workers.properties file in apache/conf folder (initially I
> tried this with these parameters, but then for testing them commented
> them all out, no difference):
> 
> #---LOAD BALANCER
> #worker.loadbalancer.type=lb 
> #worker.loadbalancer.balance_workers=ajp13 
> 
> #You should configure your environment slash...ps=\on NT and / on UNIX 
> #and may be different elsewhere. 
> # 
> ps=\ 
> 
> 
> 
> #---DEFAULT worker list-- 
> #The worker that your plugins should create and work with 
> # 
> #worker.list=ajp13 
> 
> 
> #DEFAULT ajp13 WORKER DEFINITION- 
> # 
> #Defining a worker named ajp13 and of type ajp13 
> #Note that the name and the type do not have to match. 
> # 
> #worker.ajp13.port=8009
> #worker.ajp13.host=dep-eia1pcgis1
> #worker.ajp13.connection_pool_size=10
> #worker.ajp13.connection_pool_timeout=600
> #worker.ajp13.socket_keepalive=False
> 
> # 
> #*End worker.properties*
> 
> 4) configure httpd.conf to use JK:
> 
> LoadModule jk_module modules/mod_jk.so(in the LoadModule section)
> 
> Include "c:/tomcat5525/conf/mod_jk.conf"  (down at the bottom)
> 
> 5) restart Apache and Tomcat.  At first the CPU is at 0%, after the
> first loading of "Hello World" it goes to 50% and stays there.
> 
> 
> ***
> Michael Smith
> Maine DEP/OIT 

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



JK connector causes Tomcat to utilize 50% CPU

2008-01-03 Thread Smith, Michael
Greetings,

I am trying to set up an Apache 2.2.4 server with Tomcat 5.5.25 and JK
connector 1.2.26 on a Windows XP PC.  This is a test configuration for a
map server running both ESRI's ArcIMS and the open-source MapServer
(MS4W distribution, which is a prepackaged Apache 2.2.4, PHP 5, and some
other map-serving-specific open-source software).

Everything seems to work right, but the first time I access any
application via Tomcat, the CPU goes to 50% and stays there (tomcat5.exe
is the process).  I have a dual-cpu (dual cores, so 4 cores total) Dell
box running Windows XP Professional SP2.

I followed the install steps for JK connector and am using the minimal
(default) parameters in my mod_jk.conf file, and the simple application
I'm loading is the 'Hello World' example (under servlets-examples
distributed with Tomcat).

1) copy the mod_jk.so file into apache/modules folder

2) create a mod_jk.conf file in tomcat/conf folder:

JkWorkersFile "C:\ms4w\Apache\conf\workers.properties" 
JkLogFile "C:\Tomcat5525\logs\mod_jk.log" 

JkLogLevel all 

 
ServerName dep-eia1pcgis1

JkMount /servlets-examples ajp13
JkMount /servlets-examples/* ajp13 



3) create a workers.properties file in apache/conf folder (initially I
tried this with these parameters, but then for testing them commented
them all out, no difference):

#---LOAD BALANCER
#worker.loadbalancer.type=lb 
#worker.loadbalancer.balance_workers=ajp13 

#You should configure your environment slash...ps=\on NT and / on UNIX 
#and may be different elsewhere. 
# 
ps=\ 



#---DEFAULT worker list-- 
#The worker that your plugins should create and work with 
# 
#worker.list=ajp13 


#DEFAULT ajp13 WORKER DEFINITION- 
# 
#Defining a worker named ajp13 and of type ajp13 
#Note that the name and the type do not have to match. 
# 
#worker.ajp13.port=8009
#worker.ajp13.host=dep-eia1pcgis1
#worker.ajp13.connection_pool_size=10
#worker.ajp13.connection_pool_timeout=600
#worker.ajp13.socket_keepalive=False

# 
#*End worker.properties*

4) configure httpd.conf to use JK:

LoadModule jk_module modules/mod_jk.so(in the LoadModule section)

Include "c:/tomcat5525/conf/mod_jk.conf"  (down at the bottom)

5) restart Apache and Tomcat.  At first the CPU is at 0%, after the
first loading of "Hello World" it goes to 50% and stays there.


***
Michael Smith
Maine DEP/OIT 

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



next version release dates

2008-01-03 Thread Paulakos, Lewis
is there any page to see what the status of versions and bug fixes are
slated for future versions?
any pages would be helpful.
 
other notes of interest:
is there a timeline for the tomcat 6.0.x release dates?
I see chat on the users list for version 6.0.16 for fixes. any timeline?
the wiki page states version 6.2.x is TBD is there anywhere to see the
status/release dates for future versions besides the wiki?
thanks,
tony
 


RE: Re: other ways to change the Connector element in server.xml?

2008-01-03 Thread Caldarale, Charles R
> From: Anna Nhan [mailto:[EMAIL PROTECTED] 
> Subject: Re: Re: other ways to change the Connector element 
> in server.xml?
> 
> How do I know which system properties to use?

The *names* of the system properties are whatever you choose.  The
*values* of the system properties are simply substituted for the name
references when server.xml is parsed and must therefore conform to the
Tomcat configuration doc.

> And where can I find proper documentation for it?

The fact that property substitution can be used in server.xml doesn't
seem to be officially documented yet, although it's probably buried in
the change log.

> Will setting these Catalina options be reflected in the server.xml?

Yes, that's the whole point.

 - Chuck


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

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



Re: Re: other ways to change the Connector element in server.xml?

2008-01-03 Thread Anna Nhan
Rainer,

I've been searching the web for documented system properties to use to set
up Catalina, but I am confused.

How do I know which system properties to use? And where can I find proper
documentation for it?
Will setting these Catalina options be reflected in the server.xml?

Thanks,
Anna


> >
> >Hi Anna,
> >
> >Anna Nhan schrieb:
> > > Hi,
> > >
> > > Is there a way to change the Connector element in server.xml without
> > > manually editing the file?  Could we, for example, change the
> > > CATALINA_OPTS line using a script or C code to choose whether to use
> > > HTTP or HTTPS,  the file path to the keystore and keystore password,
> > > and whether or not the server should require client authentication?
> >
> >Starting with TC 5.0 you can use system properties in server.xml, which
> >you can set during startup as commandline arguments
> >(-Dname.of.the.property=value).
> >
> >You refer to a system property in server.xml with ${name.of.the.property
> }.
> >
> >If you don't like a very long command line, you can also set system
> >properties by adding them to catalina.properties (e.g. the startup
> >script could concatenate a master catalina.properties with additional
> >lines coming out of the script).
> >
> >Those ideas don't really help for passwords though (i.e. they don't get
> >more secret by this).
> >
> > > Thanks,
> > > Anna
> >
> >Regards,
> >
> >Rainer
> >
> >-
> >To start a new topic, e-mail: users@tomcat.apache.org
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
>
>


SSL enabling Tomcat app

2008-01-03 Thread Roger Holtom
Hi,

I have an Apache server running (2.0.52) that I recently SSL enabled.  Test 
pages work great with SSL or non-SSL.  We are running a Tomcat app called CAS, 
for Central Authentication Server.  It runs fine over a non-SSL port.  Now I 
need to have the Tomcat app secured.  I'd prefer to have Apache do the 
encryption/decryption, since it is already configured to do so, and just pass 
the requests to/from the Tomcat app so I don't have to configure SSL on Tomcat. 
 I'm experimenting with mod_jk to see if that will do what I want, but I'm not 
having any luck.  Tomcat us 6,0.13 and Java is jre1.6.0_01. Ideally, the Tomcat 
app would run on 443.  Thanks for any help or links to procedures for doing 
this!


Roger Holtom
Systems Administrator
University of Montana
Tel: 406-243-2486
Fax: 406-243-4500
email: [EMAIL PROTECTED]


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



Re: need help with Tomcat-generated redirects

2008-01-03 Thread Julian Dunn
>>> On Wed, Jan 2, 2008 at  9:10 PM, "Bill Barker" <[EMAIL PROTECTED]> wrote: 

> "Rainer Jung" <[EMAIL PROTECTED]> wrote in message 
> news:[EMAIL PROTECTED]
>> Hi Julian,
>>
>> Julian Dunn schrieb:
 How do you connect Apache to Tomcat? If you are using mod_jk, the
 module gets the port it sends to Tomcat via ap_get_server_port(),
 which in turn depends on UseCanonicalName. If this is set to On,
 the port is also determined from the port in ServerName.
>>>
>>> I'm using mod_jk 1.2.6 and Apache 2.0.59. UseCanonicalName is already
>>> on in the Apache server, and the ServerName is set to www.site.com:80
>>> in the VirtualHost. I also tried to set ServerName globally and that
>>> didn't make a difference.
>>>
>>> This allows mod_rewrite to send the correct port # in rewrites, but
>>> Tomcat doesn't seem to pick this up for some reason.
>>>
>>> By the way, don't laugh, but this is a legacy Tomcat 3.3.1a
>>> application so I need something for that version of Tomcat.
>>
>> I'm not laughing (at least I try to). Since I'm relatively sure about
>> the jk feature: what about updating to a recent jk version. 1.2.6 is
>> ..., we are at 1.2.26.
>>
> 
> Assuming that you are using the AJP13Interceptor, then updating the mod_jk 
> version should be enough.  The problem is that mod_jk 1.2.6 doesn't respect 
> the UseCanonicalName directive and sends the actual port that Apache is 
> listening on.
> 
> If you are using the CoyoteConnector (which was released as an addon to 
> 3.3.1a), then I think that the proxyPort directive will work.  This 
> connector also ships with 3.3.2, which is a fairly painless upgrade (as 
> opposed to 5.5.x or 6.0.x).

Ok, thanks for your advice, Bill - I'll see what we can do about building a 
more recent mod_jk to prop this environment up for now. We are using AJP/1.3 so 
I think that should be fairly safe.

- Julian

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



RE: NamingException

2008-01-03 Thread Caldarale, Charles R
> From: AbelMacAdam [mailto:[EMAIL PROTECTED] 
> Subject: Re: NamingException
> 
> The context file contained the following entry:
> 

More problems due to using old doc: the path and docBase attributes are
not allowed when using a META-INF/context.xml file.  They will probably
be ignored, but don't risk it.
http://tomcat.apache.org/tomcat-6.0-doc/config/context.html

 - Chuck


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

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



Re: NamingException

2008-01-03 Thread AbelMacAdam

I'm using Tomcat 6.0. I found the solution by the way. I executed the
following steps:
1. I created a DataSource (I hope I have the language correct): In META-INF
I added a context.xml, as adding this DataSource to
%TOMCAT_HOME%/conf/server.xml is not the way to go (Changes in the code
would lead to having to restart Tomcat). The context file contained the
following entry:




2. I copied a mysql-connector-java-5.1.5-bin.jar to my %TOMCAT_HOME%/lib 
3. I copied commons-dbcp-1.2.2.jar en commons-pool-1.3.jar files to the same
directory (ad I think more applications would benefit from these "Common"
files I preferred to have them in %TOMCAT_HOME%/lib, instead of the apps
lib.)

So the ResourceParams is now indeed part of the Resource element. 

Don't you love learning how it should work from an "old" book. But that is
the risk I run when I buy myself a book and next install software that is
new compared to the the book. I just saw a new version covering Struts 2.0
will come out in March this year. Hopefully I will be knowledgeable enough
at that time not needing that book to learn about 2.0 (only to reference
it).


David Smith-2 wrote:
> 
> ResourceParams doesn't exist in tomcat 5.5, 6.0.  All those parameters 
> became attributes of the  element.  What version of 
> tomcat are you using Abel?
> 
> --David
> 
> Mariano wrote:
> 
>>First of all if you are working with tomcat 5.5 you have to put your jdbc
>>library file in TOMCAT_HOME/common/lib but if you are using Tomcat 6.0 you
>>have to put files in TOMCAT_HOME/lib.
>>
>>I think that ResourceParams is nested to Resource and you have it out of
>>Resource.
>>
>>You must follow guidelines in
>>http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html
>>to create DBCP.
>>
>>I hope this help you.
>>
>>Mariano
>>
>>-Mensaje original-
>>De: AbelMacAdam [mailto:[EMAIL PROTECTED]
>>Enviado el: miercoles, 02 de enero de 2008 14:05
>>Para: users@tomcat.apache.org
>>Asunto: NamingException
>>
>>
>>
>>I have a piece of code that should get me a dataSource (from an example
I'm
>>playing with from a Struts book):
>>[code]
>>try {
>>  logger.info("DAOBase.getConnection: == InitialContext ==");
>>  context = new InitialContext();
>>  logger.info("DAOBase.getConnection: == context.lookup  ==");
>>  dataSource = (DataSource)
>>context.lookup("java:/comp/env/jdbc/myDataSource");
>>}
>>catch (NamingException e) {
>>  logger.info("DAOBase.getConnection: == NamingException ==",
>>e.fillInStackTrace());
>>  throw new DAOException();
>>}
>>[/code]
>>
>>This is a piece of my logging:
>>[logging]
>>13:04:33,449 INFO  app15a.action.CreateCustomerAction - AMc: ++
>>getConnection 
>>13:04:33,449 INFO  app15a.action.CreateCustomerAction -
>>DAOBase.getConnection: == InitialContext ==
>>13:04:33,449 INFO  app15a.action.CreateCustomerAction -
>>DAOBase.getConnection: == context.lookup  ==
>>13:04:33,449 INFO  app15a.action.CreateCustomerAction -
>>DAOBase.getConnection: == NamingException ==
>>javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
>>  at app15a.dao.DAOBase.getConnection(DAOBase.java:34)
>>  at
>>app15a.dao.CustomerDAOMySQLImpl.createCustomer(CustomerDAOMySQLImpl.java:44)
>>  at
app15a.action.CreateCustomerAction.execute(CreateCustomerAction.java:44)
>>  at
>>org.apache.struts.action.RequestProcessor.processActionPerform(RequestProces
>>sor.java:421)
>>  at
>>org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
>>  at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
>>  at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
>>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
>>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>>  at
>>org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
>>FilterChain.java:290)
>>  at
>>org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
>>ain.java:206)
>>  at
>>org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
>>va:233)
>>  at
>>org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
>>va:175)
>>  at
>>org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128
>>)
>>  at
>>org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102
>>)
>>  at
>>org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
>>:109)
>>  at
>>org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
>>  at
>>org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:
>>852)
>>  at
>>org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(H
>>ttp11AprProtocol.java:584)
>>  at
org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:150

RE: [tomcat5.5] ClassCastException atorg.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:396)

2008-01-03 Thread Caldarale, Charles R
> From: totalrecall [mailto:[EMAIL PROTECTED] 
> Subject: [tomcat5.5] ClassCastException 
> atorg.apache.juli.ClassLoaderLogManager.readConfiguration(Clas
> sLoaderLogManager.java:396)
> 
> Unfortunately I could not find the source code on 
> ClassLoaderLogManager

Where did you look?  It's in the 5.5 source download at:
  connectors/juli/src/java/org/apache/juli

A simple find (or Windows search) easily locates it.

 - Chuck


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

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



RE: [tomcat 5.5] logger configuration in context.xml

2008-01-03 Thread Caldarale, Charles R
> From: totalrecall [mailto:[EMAIL PROTECTED] 
> Subject: [tomcat 5.5] logger configuration in context.xml
> 
> Is there a new syntax for the Logger tag?

There is no  tag in 5.5.  RTFM:
http://tomcat.apache.org/tomcat-5.5-doc/logging.html

 - Chuck


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

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



Re: Error while trying to parse a JSP from a bean

2008-01-03 Thread David Smith
myapp/index.jsp is throwing a NPE and returns a 500 error, causing the 
problem you see in application.jsp.  You should look at why 
myapp/index.jsp is throwing a NPE (NullPointerException).


--David

Pedro Santa wrote:


Hi all!

I'm getting an error while trying to parse a JSP from a bean. Here's the deal.

My site has 2 frames. On the first is the web page. The second one, I
want it to parse the contents of the first frame, in order to strip
some elements from the source code - but for testing purposes I now
only want to echo the entire source on the second frame.

To do this I've got a bean named Reader.java (package "reader") that
has a property 'url' to store the filename of the page I want to parse
and methods to set the url and to get the source of the url in a
String. Here's the code for the getSource method:

   public String getSource() {
   String result = "";
   try {
   URL urlobj = new URL("http://localhost:8080/myappfolder"; + url);
   System.out.println("## URL: " + urlobj.toString());
   BufferedReader in = new BufferedReader(new
InputStreamReader(urlobj.openStream()));

   String inputLine;

   while ((inputLine = in.readLine()) != null) {
   result += inputLine + "\n";
   }
   in.close();
   } catch (IOException ex) {
   System.out.println("### ERROR!");
   Logger.getLogger(Reader.class.getName()).log(Level.SEVERE,
null, ex);
   }
   return result;
   }


I use the Reader.java bean on the HTTP, session and when a page loads
updates the 'url' property of the bean.

The second frame is an application.jsp that reloads every 5 seconds,
and outputs the String from the Reader.java getSource method.

I pasted the all my jsp's on the
\webapps\ROOT\myappfolder - as well as the context.xml
and web.xml files generated by Netbeans 6, the entire contents of
'web' folder. Pasted also all my classes on
\webapps\ROOT\myappfolder\WEB-INF\classes and
\webapps\ROOT\WEB-INF\classes.

When I try and fire up the page, the second frame displays nothing and
I get this error on Tomcat console: http://rafb.net/p/5auMCE76.html

I've tested the code with simple html files and it worked fine. I
tested the code with a jsp file without dynamic code (only HTML) it
worked fine either. And finally testes the code with the default jsp
for tomcat (http://localhost:8080/index.jsp) that has dynamic code in
it and it worked flawless as well.

I think I'm not doing something here, can anybody give me some advice
on how to put this thing to work?

I send also some useful information.

The application.jsp:

<[EMAIL PROTECTED] import="reader.*" %>

   
   
   <%
   HttpSession s = request.getSession();
   Reader reader = (Reader) s.getAttribute("reader");
   %>
   JSP Page
   
   
   <%
   out.print(reader.getSource());
   %>
   


I'm using Windows XP Professional SP2, Jakarta Apache Tomcat 5.5.9
(downloaded from here
http://archive.apache.org/dist/jakarta/tomcat-5/v5.5.9/bin/jakarta-tomcat-5.5.9.exe)
and NetBeans IDE 6.0 Beta 2 (Build 200710212201).

All the other JSP features work fine.

:)

Thanks in advance.

Cheers.

Pedro Machado Santa

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

 




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



Error while trying to parse a JSP from a bean

2008-01-03 Thread Pedro Santa
Hi all!

I'm getting an error while trying to parse a JSP from a bean. Here's the deal.

My site has 2 frames. On the first is the web page. The second one, I
want it to parse the contents of the first frame, in order to strip
some elements from the source code - but for testing purposes I now
only want to echo the entire source on the second frame.

To do this I've got a bean named Reader.java (package "reader") that
has a property 'url' to store the filename of the page I want to parse
and methods to set the url and to get the source of the url in a
String. Here's the code for the getSource method:

public String getSource() {
String result = "";
try {
URL urlobj = new URL("http://localhost:8080/myappfolder"; + url);
System.out.println("## URL: " + urlobj.toString());
BufferedReader in = new BufferedReader(new
InputStreamReader(urlobj.openStream()));

String inputLine;

while ((inputLine = in.readLine()) != null) {
result += inputLine + "\n";
}
in.close();
} catch (IOException ex) {
System.out.println("### ERROR!");
Logger.getLogger(Reader.class.getName()).log(Level.SEVERE,
null, ex);
}
return result;
}


I use the Reader.java bean on the HTTP, session and when a page loads
updates the 'url' property of the bean.

The second frame is an application.jsp that reloads every 5 seconds,
and outputs the String from the Reader.java getSource method.

I pasted the all my jsp's on the
\webapps\ROOT\myappfolder - as well as the context.xml
and web.xml files generated by Netbeans 6, the entire contents of
'web' folder. Pasted also all my classes on
\webapps\ROOT\myappfolder\WEB-INF\classes and
\webapps\ROOT\WEB-INF\classes.

When I try and fire up the page, the second frame displays nothing and
I get this error on Tomcat console: http://rafb.net/p/5auMCE76.html

I've tested the code with simple html files and it worked fine. I
tested the code with a jsp file without dynamic code (only HTML) it
worked fine either. And finally testes the code with the default jsp
for tomcat (http://localhost:8080/index.jsp) that has dynamic code in
it and it worked flawless as well.

I think I'm not doing something here, can anybody give me some advice
on how to put this thing to work?

I send also some useful information.

The application.jsp:

<[EMAIL PROTECTED] import="reader.*" %>



<%
HttpSession s = request.getSession();
Reader reader = (Reader) s.getAttribute("reader");
%>
JSP Page


<%
out.print(reader.getSource());
%>



I'm using Windows XP Professional SP2, Jakarta Apache Tomcat 5.5.9
(downloaded from here
http://archive.apache.org/dist/jakarta/tomcat-5/v5.5.9/bin/jakarta-tomcat-5.5.9.exe)
and NetBeans IDE 6.0 Beta 2 (Build 200710212201).

All the other JSP features work fine.

:)

Thanks in advance.

Cheers.

Pedro Machado Santa

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



session id cookies

2008-01-03 Thread Paul Singleton

If I set

   

will Tomcat ignore any JSESSIONID cookie which
accompanies a request?  Should it?

Paul Singleton

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



Re: Comment on Printing a document @ Apache Tomcat 6.0

2008-01-03 Thread David Smith
I just looked at that using WinXP/IE 7 and it's fine.  Do you have the 
"Shrink to Fit" option set?  The behavior you are seeing is what I would 
expect out of IE 6 -- a browser without the "Shrink to Fit" option.


--David

AbelMacAdam wrote:


Hi,

Just a note that I could not print the following document:
http://tomcat.apache.org/tomcat-6.0-doc/printer/jndi-datasource-examples-howto.html
The right side of the page was cut of at the right margin of the page. So
IMHO the page was to wide for me.

Abel

Note on environment:
Windows XP
Mozilla SeaMonkey
Microsoft Internet Explorer 7.0
 




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



Re: Event Log Error

2008-01-03 Thread Rainer Jung
It looks like you are using mod_jk2. JK2 has been deprecated long ago.
It will be hard to get any support for it now. Please switch to JK,
which is still actively developed and nearly all features of JK2 have
been backported.

Regards,

Rainer

Kandala Satish schrieb:
> Hi,
> 
>  
> 
> I am receiving the following error in the Event log every minute; this
> is affecting the performance of the application.
> 
>  
> 
> The description for Event ID ( 2 ) in Source ( Apache Jakarta Connector2
> ) cannot be found. The local computer may not have the necessary
> registry information or message DLL files to display messages from a
> remote computer. You may be able to use the /AUXSOURCE= flag to retrieve
> this description; see Help and Support for details. The following
> information is part of the event:  [jk_worker_ajp13.c (546)]:
> ajp13.service() ajpGetReply recoverable error 3
> 
>  
> 
>  
> 
> Please can anyone help with the resolution of this?
> 
>  
> 
>  
> 
>  
> 
> Regards,
> 
> Satish
> 
>  
> 
> Satish Kandala
> 
> Application Services
> Fujitsu
> Zensar Technologies Ltd
> Plot No.4, Kharadi Knowledge Park, MIDC, Kharadi, Off Nagar Road, Pune,
> Maharashtra, India 411 014
> Tel: +91 (0) 20 6607 4571 or Internally 7464 0608
> E-mail: [EMAIL PROTECTED]
> Web: http://uk.fujitsu.com   

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



Comment on Printing a document @ Apache Tomcat 6.0

2008-01-03 Thread AbelMacAdam

Hi,

Just a note that I could not print the following document:
http://tomcat.apache.org/tomcat-6.0-doc/printer/jndi-datasource-examples-howto.html
The right side of the page was cut of at the right margin of the page. So
IMHO the page was to wide for me.

Abel

Note on environment:
Windows XP
Mozilla SeaMonkey
Microsoft Internet Explorer 7.0
-- 
View this message in context: 
http://www.nabble.com/Comment-on-Printing-a-document-%40-Apache-Tomcat-6.0-tp14595627p14595627.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



RES: Servlet Filter Not Intercepting?

2008-01-03 Thread Milanez, Marcus
Hi Jay,

Your configuration seems to be fine.. Is your Checkout servlet ever invoked, 
cause you haven't posted your servlet-mapping tags. Have you tried mapping your 
filter using url-patterns, instead of servlet-name ? And only one more 
question, what do you mean by 'turn off invonking the resource' ?

Yours,

Marcus Milanez


-Mensagem original-
De: Jay Liu [mailto:[EMAIL PROTECTED] 
Enviada em: quinta-feira, 3 de janeiro de 2008 01:49
Para: 'Tomcat Users List'
Assunto: RE: Servlet Filter Not Intercepting?

Thanks Marcus.

Here's my filter setup. I just created it fresh in netbeans so I'd be surprised 
if there is a problem.

I woke up this morning, realizing I forgot to turn off invoking the resource. 
Would that matter?


UserFilter
store.filters.UserFilter


UserFilter
Checkout


Checkout
  
com.inifim.commerce.store.servlets.transactions.Checkout


I only have one filter right now.

Thanks again,
Jay

-Original Message-
From: Milanez, Marcus [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 02, 2008 5:21 AM
To: Tomcat Users List; [EMAIL PROTECTED]
Subject: RES: Servlet Filter Not Intercepting?

Hi,

Yes, filters atre supposed to intercept a requets just before it is accessed. 
Could you please post your filter config written in your web.xml file?

Yours,

Marcus Milanez
http://sumatrablog.wordpress.com

-Mensagem original-
De: Jay Liu [mailto:[EMAIL PROTECTED]
Enviada em: terça-feira, 1 de janeiro de 2008 18:36
Para: users@tomcat.apache.org
Assunto: Servlet Filter Not Intercepting?

Hi all,

 

I'm having a problem with filters. I setup filter to block access to a resource 
unless the user is authenticated.

 

I've noticed that the resource is accessed then the filter kicks in and then 
loads.

 

I thought filters were supposed to intercept the request before the resource is 
accessed?

 

Is there something wrong with my xml configuration?

 

Thanks,

Jay


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


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


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



FW: Reading servlet server connector configuration

2008-01-03 Thread Asaf Lahav
Hi guys,

I didn't get any feedback on this so I'm resending to make sure it got to
the mailing list.

 

Thanks in advance,

Asaf

 

  _  

From: Asaf Lahav [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 01, 2008 4:44 PM
To: 'users@tomcat.apache.org'
Subject: Reading servlet server connector configuration

 

Ladies and Gentlemen,

How can I read a server's connector configuration from within a servlet's
init function?

I would like to get a handle to configuration of connectors defined on a
server that contains my servlet. And it has to be done when the servlet is
initialized.

 

Thanks in advance,

Asaf

 

 

 



Re: Tomcat 6's nio protocol is slower than the regular HTTP/1.1protocol

2008-01-03 Thread David Cassidy
Did anyone do the comparison between ajp13 and http for the protocol ?

I'd like to understand what the test cases were that were used for the
test. 
ie if the application takes a second to make the resulting html
if it takes 2 seconds to make the html how does that affect the
performance ?

D

On Wed, 2008-01-02 at 17:02 +0100, Rainer Jung wrote:
> Caldarale, Charles R schrieb:
> >> Does the new io really slower then the regular protocol?
> > 
> > Yes; read this:
> > http://marc.info/?l=tomcat-user&m=119635696312254&w=2
> > 
> >  - Chuck
> 
> and: speed != performance
> 
> As an approximation:
> 
> Throughput * AvgResponseTime = Parallelity
> 
> Naively speed is the same as average response time. In most cases its
> better to think of performance as high throughput with acceptable
> response time.
> 
> The formula shows you, that a solution, that is able to handle a very
> high parallelity could have a better performance (=throughput), than
> another one, even if the average response time might be worse.
> 
> The NIO connector should be good in allowing a higher parallelism and
> thus achieve good throughput, even if the response times are worse than
> with the traditional connector.
> 
> How important this is depends on the application scenario.
> 
> Its never enough to only think about speed or only think about
> throughput when talking about high load. You need to define your minimal
> requirements for both of them and then search for the corresponding
> solution.
> 
> Regards,
> 
> Rainer
> 
> -
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


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



RE: clarification of server.xml settings for AJP 1.3 Thread Limit

2008-01-03 Thread David Cassidy
Mohan,

You can use apache to serve all the static objects without the requests
going anywhere near jboss / tomcat.

Have a *careful* look at the JkMount command and look carefully at your
url-patterns that your application uses.

D

On Wed, 2008-01-02 at 11:12 -0800, Mohan2005 wrote:
> thank you. we will look into this.
> 
> Caldarale, Charles R wrote:
> > 
> >> From: Mohan2005 [mailto:[EMAIL PROTECTED] 
> >> Subject: Re: clarification of server.xml settings for AJP 1.3 
> >> Thread Limit
> > 
> >> on jboss side server.xml file, we wish to increase the 
> >> maximum THREAD count for the AJP 1.3 connector port 8009;
> >> Which parameter is used to do this ?
> > 
> > What do the docs say?
> > http://tomcat.apache.org/tomcat-6.0-doc/config/ajp.html
> > 
> >> Earlier we used the Apache front end to render all static 
> >> pages such as image files, php files etc...
> >>
> >> Now we cannot do that,  AS FAR AS WE KNOW, as j2ee does 
> >> not allow it.
> > 
> > Where in the J2EE specs did you find that restriction?
> > 
> >  - Chuck
> > 
> > 
> > THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
> > MATERIAL and is thus for use only by the intended recipient. If you
> > received this in error, please contact the sender and delete the e-mail
> > and its attachments from all computers.
> > 
> > -
> > To start a new topic, e-mail: users@tomcat.apache.org
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> > 
> > 
> 


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



RE: Problem getting GlobalNamingResources DataSource DBCP from Custom JAAS

2008-01-03 Thread Mariano
Thanks for the reply Mark but I think that the problem is from getting JNDI
objects out of context, like my case is. Remember I need it to implement a
custom JAAS and the same implementation works perfectly on tomcat 5.5.25,
but not on tomcat 6.0.14.

I searched in bug database and nothing found.

I will try to open a new bug in tomcat bug database.

Regards,

Mariano

-Mensaje original-
De: Mark Thomas [mailto:[EMAIL PROTECTED]
Enviado el: miércoles, 02 de enero de 2008 20:52
Para: Tomcat Users List
Asunto: Re: Problem getting GlobalNamingResources DataSource DBCP from
Custom JAAS


Mariano wrote:
> Please any idea ?.

Try looking at how the DataSourceRealm does it.

http://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk/java/org/apache/catalin
a/realm/DataSourceRealm.java

Mark


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


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