Re: - Error -404 resources not found

2007-08-18 Thread Rashmi Rubdi
On 8/18/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 But still when I open my browser and type http://localhost:8080/   I get HTTP 
 Status 404 - / The requested resource (/) is not available.

What happens if you place an index.jsp file (with some contents ) in
C:\TomCat\webapps\ROOT\ ?

If the directory listing is set to false, and if there is no index.jsp
file under the web application's root folder then you'll see a 404
HTTP status.

So, if you place a small index.jsp under your webapplication's root
folder then you should be able to see the index.jsp's content --- if
all other settings are correct.

Or, set directory listing to true in Tomcat's web.xml .


 I'm a little stumped because I have done every possible thing that TomCat has 
 given in the troubleshooting section of their documentation and also I have 
 uninstalled JDK and TomCat on a couple of machines but still the same 
 response. So it must be something I'm doing wrong, but I have no idea what it 
 is. I have tried numerous of combinations and even tried fresh machines.

 Any Thoughts would be appreciated


-Rashmi

-
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: org.apache.tomcat.dbcp.dbcp.SQLNestedException : Cannot get a connection, pool error Timeout waiting for idle object

2007-08-12 Thread Rashmi Rubdi
Are you closing the ResultSet, Statement and Connection in a finally
block immediately after they're used?

-Rashmi

On 8/12/07, fusion35 [EMAIL PROTECTED] wrote:

 context.xml :
 ?xml version=1.0 encoding=UTF-8?
 !-- The contents of this file will be loaded for each web application --
 Context path=/PAF reloadable=true crossContext=true
   Resource auth=Container defaultAutoCommit=false
 driverClassName=com.mysql.jdbc.Driver maxActive=0 maxWait=1000
 name=jdbc/PAFDB password=root timeBetweenEvictionRunsMillis=6
 type=javax.sql.DataSource url=jdbc:mysql://localhost:3306/pafdb
 username=root/
 /Context


 The log of error is as under :

 org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot get a connection,
 pool error Timeout waiting for idle object
 at
 org.apache.tomcat.dbcp.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:104)
 at
 org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at bsh.Reflect.invokeMethod(Unknown Source)
 at bsh.Reflect.invokeObjectMethod(Unknown Source)
 at bsh.Name.invokeMethod(Unknown Source)
 at bsh.BSHMethodInvocation.eval(Unknown Source)
 at bsh.BSHPrimaryExpression.eval(Unknown Source)
 at bsh.BSHPrimaryExpression.eval(Unknown Source)
 at bsh.BSHAssignment.eval(Unknown Source)
 at bsh.BSHBlock.evalBlock(Unknown Source)
 at bsh.BSHBlock.eval(Unknown Source)
 at bsh.BSHBlock.eval(Unknown Source)
 at bsh.BSHTryStatement.eval(Unknown Source)
 at bsh.BSHBlock.evalBlock(Unknown Source)
 at bsh.BSHBlock.eval(Unknown Source)
 at bsh.BshMethod.invokeImpl(Unknown Source)
 at bsh.BshMethod.invoke(Unknown Source)
 at bsh.BshMethod.invoke(Unknown Source)
 at bsh.Name.invokeLocalMethod(Unknown Source)
 at bsh.Name.invokeMethod(Unknown Source)
 at bsh.BSHMethodInvocation.eval(Unknown Source)
 at bsh.BSHPrimaryExpression.eval(Unknown Source)
 at bsh.BSHPrimaryExpression.eval(Unknown Source)
 at bsh.Interpreter.eval(Unknown Source)
 at bsh.Interpreter.eval(Unknown Source)
 at 
 org.zkoss.zk.scripting.bsh.BSHInterpreter.exec(BSHInterpreter.java:80)
 at
 org.zkoss.zk.scripting.util.GenericInterpreter.interpret(GenericInterpreter.java:283)
 at org.zkoss.zk.ui.impl.PageImpl.interpret(PageImpl.java:727)
 at 
 org.zkoss.zk.ui.impl.EventProcessor.process0(EventProcessor.java:170)
 at 
 org.zkoss.zk.ui.impl.EventProcessor.process(EventProcessor.java:138)
 at
 org.zkoss.zk.ui.impl.EventProcessingThreadImpl.process0(EventProcessingThreadImpl.java:452)
 at
 org.zkoss.zk.ui.impl.EventProcessingThreadImpl.run(EventProcessingThreadImpl.java:370)
 Caused by: java.util.NoSuchElementException: Timeout waiting for idle object
 at
 org.apache.tomcat.dbcp.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:825)
 at
 org.apache.tomcat.dbcp.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:96)
 ... 35 more
 Data Source : [EMAIL PROTECTED]
 Conn before : null
 org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot get a connection,
 pool error Timeout waiting for idle object
 at
 org.apache.tomcat.dbcp.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:104)
 at
 org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at bsh.Reflect.invokeMethod(Unknown Source)
 at bsh.Reflect.invokeObjectMethod(Unknown Source)
 at bsh.Name.invokeMethod(Unknown Source)
 at bsh.BSHMethodInvocation.eval(Unknown Source)
 at bsh.BSHPrimaryExpression.eval(Unknown Source)
 at bsh.BSHPrimaryExpression.eval(Unknown Source)
 at bsh.BSHAssignment.eval(Unknown Source)
 at bsh.BSHBlock.evalBlock(Unknown Source)
 at bsh.BSHBlock.eval(Unknown Source)
 at bsh.BSHBlock.eval(Unknown Source)
 at bsh.BSHTryStatement.eval(Unknown Source)
 at bsh.BSHBlock.evalBlock(Unknown Source)
 at bsh.BSHBlock.eval(Unknown Source)
 at bsh.BshMethod.invokeImpl(Unknown Source)
 at bsh.BshMethod.invoke(Unknown Source)
 at bsh.BshMethod.invoke(Unknown Source)
 at bsh.Name.invokeLocalMethod(Unknown Source)
 at bsh.Name.invokeMethod(Unknown Source)
 at 

Re: naming trouble

2007-06-24 Thread Rashmi Rubdi

On 6/22/07, Lorenzo Cerini [EMAIL PROTECTED] wrote:

but my tomcat mismatch the classes, i mean if i recompile the
Connessione_dyn
belonging to app2 and restart tomcat, even my app1 try to use the app2's
Connessione_dyn
instead of its own one, thus leading to an error since the pooled
connection used by app2
is not 'registered' in the app1 context. I have used the same
configuration for a long period on
tomcat 5.0.28 with no problems.


I think this most likely caused by cross-context conflict.

Have you tried explicitly setting crossContext=false in your
application's context?

Try naming the classes and their packages in the two separate apps
such that their names are different.

Do you have an option to use multiple virtual hosts instead of
multiple contexts?

I was able to deal with cross context class conflicts by deploying
each app on it's own virtual host rather than multiple contexts within
the same virtual host.



Maybe can help my java version is:

 # /tomcat/java/bin/java -version
java version 1.6.0_01
Java(TM) SE Runtime Environment (build 1.6.0_01-b06)
Java HotSpot(TM) 64-Bit Server VM (build 1.6.0_01-b06, mixed mode)

Thanks in advance
L.Cerini



-Rashmi

-
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: How to write this elegantly in JSP/EL

2007-06-22 Thread Rashmi Rubdi

On 6/22/07, Nikola Milutinovic [EMAIL PROTECTED] wrote:

Hi all.

This is not really TC related, but more JSP and EL question, but I thought I'd 
ask.


I ask JSP, EL and JSTL questions here

http://jakarta.apache.org/taglibs/

or

http://forum.java.sun.com/forum.jspa?forumID=45

-
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: 30 Mb of common jars in each of 5 war files, should i consolidate?

2007-06-08 Thread Rashmi Rubdi

On 6/7/07, rhodebump [EMAIL PROTECTED] wrote:


I have 5 war files, each containing the springframework, hibernate jars,
tapestry jars, lots of jars so that each war file is 30 megs.

I wonder, from a performance/memory perspective would it be better to move
these common library jars into the /tomcat/common/lib directory,


Are the 5 projects tightly related? If they are then it would be a
good idea to keep all JAR files in a common location.

The JAR files don't have to be /tomcat/common/lib , they can be
anywhere else -- as long as your ant build script has the path of the
dependency JAR files.

I would keep all dependency JAR files in any common folder outside Tomcat.


or should I
keep them in their individual war file structures?


If the projects are not closely related and each of them evolve in
their own direction then keeping the JAR files in individual WARs
would be beneficial in terms of ease of maintainence.


I understand how moving the stuff into /common/lib means everything uses the
save version, but what is best for performance?

Thanks!



I don't think the performance (speed of applications) would change,
depending on which option you choose. I haven't tested this though, so
can't tell for sure.

The 2nd option requires more disk space of course.

-Rashmi

-
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 keepalive mysql connection.

2007-06-07 Thread Rashmi Rubdi

On 6/6/07, Jacob Rhoden [EMAIL PROTECTED] wrote:

Hi,

Under tomcat 5.5, I would prevent the database connections from timing
out by having a Cron job that accesses the website every 10 minute.
(Because I couldn't work out a better way).


How are you connecting to the database? If you are not using
connection pooling, then you're missing out on performance also, it is
highly configurable
http://jakarta.apache.org/commons/dbcp/configuration.html

If you get an exception, you could try re-connecting in the catch
statement of that exception.


This no longer works under
tomcat 6. Are there any better ways than I am not aware of.? I don't
think increasing the timeout length in Mysql is a much better solution.

Best Regards,
Jacob



Rashmi

-
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 URL decoding different from Java's URLDecoder?

2007-06-06 Thread Rashmi Rubdi

Shankar, Chris,

With reference to your previous posts


(From section 3.7.1 of the HTTP/1.1 spec).


I tried a small example by not forcing the request's content type,
and was able to see the Big5 characters without any problems even
when the Request's characterEncoding was null. The code below demonstrates this.



So Tomcat is running with -Dfile.charset=Big5 (so that's the java
default charset), and just does a 'request.getParameter(foo)'. And the
value for foo in the body of the POST is %AEx, which (again) we didn't
encode - it's IE that's doing this when you type in a Big5 char into a
text field in a form (I guess it's internally treating the raw bytes as
ISO8859-1).


%AEx , could be a URL Encoded Hex representation of the specific
Big5 character (not sure about it though, because decoding it doesn't
give a Big5 character but instead gives garbage characters)

Here's the example I tried, that shows the Big5 character correctly
when transmitted over HTTP GET , notice the characters in the URL
encoded parameter.

-
index.jsp
-

%@ page pageEncoding=Big5 contentType=text/html; charset=Big5 %

html

head

   meta http-equiv=Content-Type content=text/html; charset=Big5 /

/head

body

%
//String paramEncoding = application.getInitParameter(PARAMETER_ENCODING);
//request.setCharacterEncoding(paramEncoding);
%

Request Character Encoding =
%=request.getCharacterEncoding()%



br/br/

Response Character Encoding =
%=response.getCharacterEncoding()%


br/br/

form action=test.jsp method=GET
   input type=text name=textField value=造字/
   input type=submit name=submit value=submit/
/form

/body

/html


--
test.jsp
--

%@ page import=java.net.URLDecoder %
%@ page import=java.net.URLEncoder %
%@ page pageEncoding=Big5 contentType=text/html; charset=Big5 %

html

head

   meta http-equiv=Content-Type content=text/html; charset=Big5 /

/head

body

%
//String paramEncoding = application.getInitParameter(PARAMETER_ENCODING);
//request.setCharacterEncoding(paramEncoding);
%

Request Character Encoding =
%=request.getCharacterEncoding()%

br/br/

Response Character Encoding =
%=response.getCharacterEncoding()%


br/br/
Text Filed Contents =
%=request.getParameter(textField)%

br/br/

URL Encode:

%=URLEncoder.encode(造字, Big5)%

br/br/

URL Decode:
%=URLDecoder.decode(%B3y%A6r, Big5)%

The above shows garbage characters.

/body

/html

---
web.xml
---

   context-param
   param-namePARAMETER_ENCODING/param-name
   param-valueBig5/param-value
   /context-param

---
Tomcat 6.x server.xml


   Connector port=9090 protocol=HTTP/1.1
  maxThreads=150 connectionTimeout=2
  redirectPort=8443
   URIEncoding=Big5/

-Rashmi

-
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 URL decoding different from Java's URLDecoder?

2007-06-05 Thread Rashmi Rubdi

On 6/5/07, Shankar Unni [EMAIL PROTECTED] wrote:

(the page was already set to character
encoding Big5), the encoded value sent in the URL was rather screwy:

The original character is (Big5) 0xAE 0x78.

The URL sent by IE said %AEx. (!!)


Did you also configure the web.xml properly ?

It should have

context-param
param-namePARAMETER_ENCODING/param-name
param-valueBig5/param-value
/context-param

Are you setting the request parameter correctly before reading the parameter?

String paramEncoding = application.getInitParameter(PARAMETER_ENCODING);
request.setCharacterEncoding(paramEncoding);




Now Java's URLDecoder.decode(s, Big5) doesn't like the above encoding:
it insists that both characters be encoded, or neither - it ends up
decoding this into ?x.

However, Tomcat actually returns the correct single chinese character
from request.getParameter(userid).

Is it doing the URL decoding in a different way than Java's built-in URL
decoder?



-Rashmi

-
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 500 when using custom error pages in Tomcat 6.0

2007-06-05 Thread Rashmi Rubdi

On 6/5/07, Roger Roger [EMAIL PROTECTED] wrote:

Hi there,

Recently we upgraded to Tomcat 6.0. Suddenly the custom errorpages don't
work anymore.


It works, when I try the example you've shown in your first post.

A few things you may want to check:

1) errorPage=error.jsp   , is error.jsp relative to test.jsp ?

Since the above is a ~page relative~ path, both test.jsp and error.jsp
should be in the same folder , otherwis error.jsp will not be found.

A better approach would be to make errorPage a ~context~ relative path
, something like errorPage=/errors/error.jsp  , this way error.jsp
will be visible to any page in your app when you use that path.

2) Is the web.xml configured correctly, is the path of error.jsp in
web.xml correct? Again, it should be context relative.



-Rashmi

-
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: I would like a new session each time I start my application

2007-06-02 Thread Rashmi Rubdi

On 6/1/07, Bachler, Elisabeth (Elisabeth) [EMAIL PROTECTED] wrote:

Hi,
I have an application that works under tomcat.
Each time I run my application I have the same sessionID. Is there a way


I guess you mean each time you (re)start Tomcat when you say Each
time I run my application...

You might be seeing the same sessionID because the session persistence.


to generate a differente sessionID each time I start my application?


Try disabling the session persistence in your app's Context.

Context docBase=... 

Manager className=org.apache.catalina.session.PersistentManager
saveOnRestart=false/

/Context



Thanks


I don't know if the above will work in all versions of Tomcat, but it
should work on Tomcat 5.5.x or higher. Next time please mention the
version of Tomcat and other relevant details.

-Rashmi

-
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 6 manager application bug

2007-06-02 Thread Rashmi Rubdi

On 6/2/07, Jacob Rhoden [EMAIL PROTECTED] wrote:

I finally upgraded everything to java 6/tomcat 6. Its all nice! There
does seem to be a bug in the manager app. The application list comes out
formatted strangely.


I use Java 6 and Tomcat 6 , the application list looks fine to me in
the manager app.


(See attached picture if it works). I think it


Attachments are automatically filtered. You could upload it somewhere
and post the link to it.


might be a bug.

-j


Rashmi

-
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 session varibale

2007-06-02 Thread Rashmi Rubdi

On 6/2/07, ibozo [EMAIL PROTECTED] wrote:


Thanks again..
Here is my first code that takes two varibles from client to log in, as
email adress and password. And puts the email adress into a session variable
as:


With reference to the code in the previous post, it could be made a
lot simpler and easier if you follow the MVC design pattern.

Once you make it simpler you can easily see how to get the session in
a servlet and how to set and get values to it.

1) Write the HTML in a JSP instead of a Servlet

2) Use the Servlet as a medium between the front end (JSP) and the
back end (Java classes and JDBC)

3) Define the Servlet mapping in web.xml

4) Submit the form from the JSP to the Servlet (URL pattern from web.xml)

Take a look at this clickable diagram.

http://java.sun.com/blueprints/corej2eepatterns/Patterns/index.html

-Rashmi

-
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 session varibale

2007-06-01 Thread Rashmi Rubdi

On 6/1/07, ibozo [EMAIL PROTECTED] wrote:


Hello all,
   I have created a file of servlet pages that publish those pages in Tomcat
6. I have a log in page, programmed by servlet and also another page that
activates the application acording to the given parameters by serching
webserver. I should use the taken variable on the log in page in another
servlet page. I tried to create a session variable and use it inside the
other web servlet.


I guess you are trying to access a value stored in the HttpSession in
one Servlet inside another Servlet.

This is very simple ...

in the first Servlet , you are doing

HttpSession session = request.getSession();
session.setAttribute(MyAttribute, MyValue);

in the  second Servlet you would write


HttpSession session = request.getSession();
session.getAttribute(MyAttribute);


However I am unable to suceed... Can you help me as soon


It works because the HttpRequest object is available to all Servlet's
inside their doPost and doGet methods.


as possible..
Best,
ilker


I recommend you read about Servlets, it's all covered in the basics.

-Rashmi

-
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: About deploying

2007-06-01 Thread Rashmi Rubdi

On 6/1/07, Trond Kristiansen [EMAIL PROTECTED] wrote:

Hello!

This is my first post so I hope it ended up at the right place.

I have only used tomcat on my laptop Integrated in my Netbeans IDE, but now
I've got my fist web host and they use a shared tomcat 4.1 I think.

They have given my i WEB-INF folder with subfolder, jsp, classes and lib.

In my netbeans project folder I'm used to one of theese folders in every
project file. Is it the same on a shared tomcat server or do I have to put
all my servlets etc in this one folder even if its severall diffrent
projects.


I don't have experience with shared Tomcat, but there are a few other
Tomcat reasonable cost , and even free hosting providers who don't put
such restrictions, they allow you to have your own Tomcat instance.

Lookup this up on your fav search engine.


Trond Kristiansen


-Rashmi

-
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: How to load a static class on Tomcat startup

2007-06-01 Thread Rashmi Rubdi

On 6/1/07, Caldarale, Charles R [EMAIL PROTECTED] wrote:

 From: Andrea Sacco [mailto:[EMAIL PROTECTED]
 Subject: How to load a static class on Tomcat startup

 I want to know how I can configure Tomcat to load my
 Singleton class on his startup routine?



Make the Singleton class implement ServletContextListener ,
and register the Singleton class as a listener in web.xml

The syntax for registering the listener in web.xml is specific to
the version of Tomcat ( Servlet Specification ) you are using.



Sounds like you need a Listener:
http://tomcat.apache.org/tomcat-6.0-doc/config/engine.html#Lifecycle%20L
isteners
http://tomcat.apache.org/tomcat-5.5-doc/config/engine.html#Lifecycle%20L
isteners

 - Chuck



-Rashmi

-
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 does not start

2007-05-31 Thread Rashmi Rubdi

I had problems with Windows Service Installer too, I'm not sure if it
was my mistake.

I don't remember if I forgot to stop and start Tomcat properly, or if
the JAVA_HOME was set correctly.

So, to solve the problem I uninstalled Tomcat , and got the ZIP
archive. With the ZIP archive there haven't been any problems on
Windows XP, JDK 1.5 and 1.6.x

Just unzip it to a directory that doesn't contain spaces , and set
JAVA_HOME or JRE_HOME , CATALINA_HOME system environment variables.

Hope this helps.

-Rashmi


On 5/30/07, Len Popp [EMAIL PROTECTED] wrote:

Sounds like it might be this problem:
http://issues.apache.org/bugzilla/show_bug.cgi?id=41538
There are a couple of workarounds suggested there.
--
Len


-
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: Jasper compiler crashes

2007-05-29 Thread Rashmi Rubdi

On 5/29/07, Berglas, Anthony [EMAIL PROTECTED] wrote:

Thanks for that, but I don't see how it will help.   If you look below
it is the jasper2 that is causing me grief, which is essentially the
same as yours.

How long does it take to precompile the JSPs.  Is it several JSPs per
second or several seconds per JSP?  My JSPs take over 20 seconds to
compile interactively, which would make precompiling all of them
infeasible except for a nightly build.


Pre-compiling JSPs does take a while because, first JSPs are converted
to .java files , then the .java files are compiled to .class files,
and then the web.xml is modified.

Most people reserve pre-compiling JSPs to just before the app is ready
for deployment into production environment. Pre-compiling for
development, staging and other environments would take too much time
and effort unnecessarily.


I'm surprised that your script needs those package rename hacks.  Feels
like precompiling into Tomcat's work area should be built in,
bin/precompileJsps.bat|.sh.

Thanks,

Anthony



Regards
Rashmi

-
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: Web application receives request parameters sent to another application on Tomcat 6

2007-05-28 Thread Rashmi Rubdi

On 5/28/07, Dejan Krsmanovic [EMAIL PROTECTED] wrote:

We have two applications running on the same Tomcat instance. These two
applications are used by completely different people and one of them has
much higher traffic than another one.
Recently we have upgraded to Tomcat 6.10 and start experiencing strange
behavior. After a lot of debugging, we have noticed that the first
application sometimes receives request parameters sent to second
application. Parameters are mixed-up, that is, request.getParameterMap()
returns parameters from both applications. This is not happening all the
time (probably because one of these applications is used rarely), but we
had this situation several times a day.
After some time we have decided to return back to Tomcat 5.5.x and the
problems stopped.

What can be reason for such problems? Is it possible that Tomcat re-uses
some objects internally without clearing them up?


It is hard to tell what could be the problem without knowing full
details of how the 2 projects Host, Context etc are configured.

Are they at the ROOT context, or other Context?

Are they on a virtual host or all of them on localhost?

Is crossContext set to true or false?

relevant sections of server.xml , Context xml files will be useful.



Regards,
Dejan


-Regards
Rashmi

-
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: Excluding JSP compiler from Tomcat

2007-05-28 Thread Rashmi Rubdi

On 5/28/07, lightbulb432 [EMAIL PROTECTED] wrote:


Thanks for your response. For the first of the two options you presented,
what exactly happens during the web.xml autogeneration? Will it simply
change only the servlet elements but leave everything else as is in my
current web.xml, including servlet-mapping? Is there anything else it
changes?


It depends on how you set up your Ant build to use Jasper.

In any case, the original web.xml gets modified , the original
mappings etc will be retained, the new JSP class mappings will be
~appended~ , so you won't lose anything that was already there.

If you don't want your original web.xml to be modified, using Ant you
can make an intermediate copy of your project, and run Jasper on that
intermediate copy, this way the web.xml of the source files will not
change - which is ideal for development environment settings.

Try it on a separate, small project to see how it works and what works for you.


The less it changes, the more my development (pre-deployment) would be as
close to production as possible, I'm guessing...

Thanks.


-Regards
Rashmi

-
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: subdomain name redirect to different context path

2007-05-27 Thread Rashmi Rubdi

On 5/26/07, Caldarale, Charles R [EMAIL PROTECTED] wrote:

 From: Rashmi Rubdi [mailto:[EMAIL PROTECTED]
 Subject: Re: subdomain name redirect to different context path

 I think he wants to redirect or forward all requests from
 'forums.mysite.com' to 'www.mysite.com:8080/forums'

 in that case wouldn't he be setting up a Filter that redirects or
 forwards a request from forums.mysite.com to
 www.mysite.com:8080/forums ?

The filter is likely not necessary, if Pid's instructions are followed.
What is absolutely required is a DNS registration for forums.mysite.com,
otherwise no one will be able to reach the site.  Once that's in place
along with a connector configured for port 80 rather than 8080,
deploying the forums webapp as ROOT is all that's required - no
programming necessary.


Thanks for your reply.


From the original post , it is not known whether 'forums.mysite.com'

exists or not.

It appeared as though it exists, and is already reachable.


 - Chuck




-Rashmi

-
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: Upgrading to Tomcat 6 problems

2007-05-26 Thread Rashmi Rubdi

On 5/25/07, Joe [EMAIL PROTECTED] wrote:

Hello, I just upgraded to Tomcat 6.0.13 from 5.5.9 (no particular reason for 
the upgrade,
just keeping up to date).  I am running Java 1.6.  However, instantly I'm having 
trouble that  I cannot resolve regardless of endless hours of searching for and 
trying to apply answers  to previous similar problems.  After starting Tomcat, I 
get the following errors within the
log file for every web application:



I've upgraded from 5.5.x to 6.0.x with no problems at all, and I use JSTL also.

I recommend getting a ~fresh~ install of Tomcat 6.0.13 .

Then simply configure your webapps with their respective Context xml files

Tomcat 6.0.13 supports Servlet 2.5 specification and JSP 2.1 specification.

The EL requires your web.xml to be conformant to either Servlet 2.5 or
Servlet 2.4 specifications.

So in your web app's WEB-INF/web.xml  , make sure you have define
web-app exactly as:

one of the two:

?xml version=1.0?
web-app xmlns=http://java.sun.com/xml/ns/javaee;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xsi:schemaLocation=http://java.sun.com/xml/ns/javaee web-app_2_5.xsd
version=2.5

!-- define other elements in correct order, as expected by the schema --

/web-app


OR

?xml version=1.0 encoding=UTF-8?
web-app version=2.4
xmlns=http://java.sun.com/xml/ns/j2ee;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;

!-- define other elements in correct order, as expected by the schema --

/web-app


If you're using JSTL 1.1 or higher there's no need to explicitly
define the TLDs within web.xml , as they're already defined in JSTL's
jar file. You just need the correct jstl and standard jar files.

In your JSPs make sure the taglib URIs are correct, (refer to the JSTL
Taglib API for your version of JSTL)

-Regards
Rashmi

-
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: subdomain name redirect to different context path

2007-05-26 Thread Rashmi Rubdi

On 5/26/07, Ran [EMAIL PROTECTED] wrote:

Hi all,
I would like to point 'forums.mysite.com' to 'www.mysite.com:8080/forums'
How could I do that with tomcat conf ? or I need to match the requested url
in a redirect servlet ? or is it even a DNS zone file question ?


You could write a redirect javax.servlet.Filter


Thanks,
ran



Regards
Rashmi

-
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: subdomain name redirect to different context path

2007-05-26 Thread Rashmi Rubdi

On 5/26/07, Pid [EMAIL PROTECTED] wrote:

Rashmi Rubdi wrote:
 On 5/26/07, Ran [EMAIL PROTECTED] wrote:
 Hi all,
 I would like to point 'forums.mysite.com' to 'www.mysite.com:8080/forums'
 How could I do that with tomcat conf ? or I need to match the
 requested url
 in a redirect servlet ? or is it even a DNS zone file question ?

 You could write a redirect javax.servlet.Filter

 Thanks,
 ran


forums.mysite.com = forums.mysite.com:80

Configure an HTTP connector to listen on 80, (rather than 8080),
then configure a virtualhost for 'forums.mysite.com', all of which is
assuming you've got a DNS record for this subdomain that points to your
server.

You then need to deploy the 'forums' web application as the ROOT*
context to make it work without a subdirectory.


I think he wants to redirect or forward all requests from

'forums.mysite.com' to 'www.mysite.com:8080/forums'

in that case wouldn't he be setting up a Filter that redirects or
forwards a request from forums.mysite.com to
www.mysite.com:8080/forums ?



* Case is important, lookup the docs.


p




 Regards
 Rashmi


-
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: How-to make default Running status = false

2007-05-25 Thread Rashmi Rubdi

On 5/25/07, Mark H. Wood [EMAIL PROTECTED] wrote:

 Say your apps are named app1, app2, app3 etc and if you access them as

 http://localhost:8080/app1  http://localhost:8080/app2
 http://localhost:8080/app3 , then

 you would define the Context for each app under

 Tomcat's /conf/Catalina/localhost/  as app1.xml , app2.xml and app3.xml

 Now if you want Tomcat to only load app1 , you just disable the other
 XML files by renaming them as in app2.xml_disable app3.xml_something

In that case, you have to either ensure that your webapp.s do not
contain META-INF/context.xml or that the Host has deployXML='false'.
Otherwise the webapp itself will supply a Context.

Tomcat will generate a Context on its own in some circumstances which
I've not yet completely worked out from the documentation.  How did
you disable this?


In the development environment settings, I don't usually add a
context.xml file under META-INF.

I normally create a ContextName.xml file under each Host Name folder.

So with the above setting, I can visibly see in Tomcat's start-up
console that it has loaded only those webapps that have a .xml file,
and doesn't load those that don't.

I also keep my projects ~outside~ Tomcat's webapps folder and I only
specify the project's root folder in the docBase attribute of Context.
The appBase attribute is something like webapps/ContextName , and path
is empty. This way, upgrading Tomcat becomes easier and simpler.

I haven't really experienced Tomcat generating a Context (either in
server.xml or a Context xml file under Host Name )

May be it generates one under META-INF/context.xml , but may be empty as in
Context path=
/Context




--
Mark H. Wood, Lead System Programmer   [EMAIL PROTECTED]
Typically when a software vendor says that a product is intuitive he
means the exact opposite.



Regards
Rashmi

-
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: Excluding JSP compiler from Tomcat

2007-05-25 Thread Rashmi Rubdi

On 5/25/07, lightbulb432 [EMAIL PROTECTED] wrote:


The JSP spec says that if you precompile JSPs you can reduce the JSP
container footprint by excluding the JSP compiler. How can this be done in
Tomcat?


I know of 2 ways to pre-compile JSPs

1) http://tomcat.apache.org/tomcat-4.1-doc/jasper-howto.html

   If you're using Ant , than you can add the above jasper task to
your build process.
The process first converts all JSPs to .java files, and then all .java
files are compiled to .class files , during this process the web.xml
is also auto-modified and there's an entry for every JSP page in your
app.

Pre-compiling with jasper is very slow (expected behavior) , so it is
recommended that the pre-compile should be done just before deploying
the app to production , there's no need to pre-compile while
developing/ testing JSPs.

2) Use JSP Unit testing tools like HttpUnit or Apache Cactus, as the
tools test each JSP page they acces the JSP pages for the ~first time~
, this essentially compiles all JSP pages , then move the war file to
production.

Many recommend the 2nd option as it makes your pre-compiled code
portable aross containers.


Thanks.


Regards
Rashmi

-
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: How-to make default Running status = false

2007-05-24 Thread Rashmi Rubdi

On 5/23/07, Roger Tismeer [EMAIL PROTECTED] wrote:

It takes about 4 minutes or so to (re)start Tomcat  granted I have
30 webapps loaded, but isn't there a switch somewhere that I can toggle
to not auto-start any non-Tomcat webapps?


I was in a similar situation as you've mentioned above.

I find that keeping the Context descriptor outside server.xml makes it
a lot easier to switch between applications.

Say your apps are named app1, app2, app3 etc and if you access them as

http://localhost:8080/app1  http://localhost:8080/app2
http://localhost:8080/app3 , then

you would define the Context for each app under

Tomcat's /conf/Catalina/localhost/  as app1.xml , app2.xml and app3.xml

Now if you want Tomcat to only load app1 , you just disable the other
XML files by renaming them as in app2.xml_disable app3.xml_something

The above setting will make only app1 visible to Tomcat, when you want
to switch, just rename the Context file back to .xml

Alternatively , if you want all apps to be accessible at the root
context, you just set up virtual hosts, in this case each context
would be called ROOT.xml under it's own host, just disable the
ROOT.xml files of those apps you don't want to load.



This way I can simply Start
the few apps I need via the Manager and as I need more or less, I can do
so.


However, it is not possible to use the Manager app to toggle the
Context XML files' extension, you'd be toggling the extension
manually.

It's a simple way to switch off apps, or switch between apps whenever you want.



Thanks,

Roger Tismeer


-Regards
Rashmi

-
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 admin,Manager app setup

2007-05-23 Thread Rashmi Rubdi

Thanks Chuck and Venkat,

I wasn't aware it wasn't compatible, and there wasn't a way to know
unless I tried it.

But next time, this question arises, I'll remember.

It would be helpful to see something about the Admin app on this page:
http://tomcat.apache.org/download-60.cgi

for example:

Admin App 6.0.x (Under Development)

so people looking for it would know that it isn't available yet,
unless they're supposed to be looking in the mail archives.

-Regards
Rashmi

On 5/23/07, Venkat Venkataramanan [EMAIL PROTECTED] wrote:

Rashmi:

I posted a similar message and I was told then that the Admin application
v5.5 is not compatible with Tomcat v6.0.x


-
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 admin,Manager app setup

2007-05-22 Thread Rashmi Rubdi

On 5/22/07, Raja [EMAIL PROTECTED] wrote:

 Hi ,

We are trying to setup multiple instanace of tomcat running on the same
server. we can able to do it successfully.
We need to  run the Manager,Admin applications also on  each instance.

Version Details : Tomcat 6.0.10
JDK Version :  1.5.09

1 .From the docs, i understand that, by default there is no ADMIN
application enabled in the tomcat. So anyone in the group guide me setup
this application and let me know where can i download the application as
well.


There doesn't seem to be a download link for the Admin App for Tomcat
6.0.x at http://tomcat.apache.org/download-60.cgi

However, there is one for Tomcat 5.5.x here:
http://tomcat.apache.org/download-55.cgi#5.5.23

I haven't tried the 5.5.x Admin app on Tomcat 6.0.x , but it probably
(just a guess) might be compatible.


2. I have copied Manager application to the individual instacne of the
tomcat webapps folder. But i am getting 404 error while accessing that
applcation.


What link did you use to access the Manager app?

With the default install and default config of Tomcat 6.0.x , I'm able
to access the manager app at: http://localhost:8080/manager/html  ,
after defining a user and a role for that user in tomcat-users.xml

Look for tomcat-users.xml under apache-tomcat-6.0.x\conf\ folder and
add something like:

?xml version='1.0' encoding='utf-8'?
tomcat-users
 role rolename=manager/
 role rolename=admin/
 user username=somuser password=secret roles=admin,manager/
/tomcat-users


Your help on this will be really helpful to us. Thanks in advance.


With Regards,

Alagar Raja R



-Regards
Rashmi

-
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-Question: Inefficient searching for jsp-files?

2007-05-21 Thread Rashmi Rubdi

On 5/21/07, Thomas Hoffmann (Speed4Trade)
[EMAIL PROTECTED] wrote:

Hello,
i am using Tomcat 5.5.23. When i request a simple jsp-file
my file-monitor shows me, that tomcat is searching from root.
This is a problem for website with a lot of traffic.
A screenshot is attached to this mail.


All attachments are filtered out automatically.

Please post the URL of the screen shot and/or other relevant
information such as log file contents etc.



The Context-Entry looks like
Context docBase=D:\inetpub\wwwroot\tyres4trade path= privileged=true
 workdir= reloadable=fals /

Thanks for suggestions,
Thomas


-Regards
Rashmi

-
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: Configure php 5.2.2. on tomcat 6.0

2007-05-21 Thread Rashmi Rubdi

On 5/21/07, Pierluigi Fabbris [EMAIL PROTECTED] wrote:

Hi
I use saxon b, java and php how can I configure the last one? In Tomcat 5
and php 5.0 is possible. Is possible in Tomcat 6 and php 5.2.2, too?


As far as I know, Tomcat does not directly support PHP.

Try

http://httpd.apache.org/

http://httpd.apache.org/lists.html#http-users


Hoping in a reply.
Sincerally yours,
Fabbris Pierluigi


-Regards
Rashmi

-
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: Configure php 5.2.2. on tomcat 6.0

2007-05-21 Thread Rashmi Rubdi

Sorry p I didn't see your reply before hitting the Send button.

-Rashmi

On 5/21/07, Pid [EMAIL PROTECTED] wrote:

Pierluigi Fabbris wrote:
 Hi
 I use saxon b, java and php how can I configure the last one? In Tomcat 5
 and php 5.0 is possible. Is possible in Tomcat 6 and php 5.2.2, too?
 Hoping in a reply.
 Sincerally yours,
 Fabbris Pierluigi

If you want to use PHP I'd recommend using the Apache HTTPD server,
rather than Tomcat.  Which probably isn't what you want to hear but it
is good advice.

p


-
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: transaction manager cannot load in Tomcat 6

2007-05-21 Thread Rashmi Rubdi

On 5/21/07, tmo256 [EMAIL PROTECTED] wrote:


Thanks so much for trying to help, though. Any further suggestions would be
welcome.


Sorry I couldn't be of help here, the only other thing I can think of
is that the CLASSPATH may be partially correct or incorrect.

It is better to not set the systemwide classpath. It is sufficient to
set the JAVA_HOME and CATALINA_BASE or CATALINA_HOME in the system
environment variables, then Tomcat detects the other JAR files.

I don't know if you already consulted this list:
http://www.objectweb.org/wws/lists/projects/jotm , I'm just posting
the link in case you didn't.


Thanks,
Teresa


-Regards
Rashmi

-
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 using Tomcat 6.x under windows 64-bit

2007-05-20 Thread Rashmi Rubdi

On 5/20/07, Lluis Gifre [EMAIL PROTECTED] wrote:




Hi,

I'm trying to install Tomcat 6.x in a Windows XP x64 system.

I need to know if there is any problem with the 64-bit systems and tomcat...


The only problem I've faced is with the Windows Installer (I don't
remember exactly what the problem was - the mistake could be that I
mis configured Tomcat) , but I un-installed Windows Installed Tomcat ,
and downloaded the zip version and unzipped it to a folder that
doesn't contain white spaces.

In your case you would set environment variables JRE_HOME to the root
folder of your JRE's and CATALINA_HOME to the root folder of Tomcat.

With the above configuration I haven't had any problems with Tomcat on
Windows XP.

 I have the 64-bit version of JRE version 1.6.0 and the jvm.dll file version

is: 6.0.10.6.

The problem is that when i start the service it doesn't start. I attach the
log-files generated by tomcat.


Attachments are filtered out, please paste the relevant contents of
the log file.


Please give me an answer.

Thanks in advance,

Lluis



-Regards
Rashmi

-
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: Prevent unwanted requests

2007-05-19 Thread Rashmi Rubdi

I agree, there's no need to place .java files, the .class files under
/WEB-INF/ are sufficient.

Unless you're writing an Applet, which has to exist outside /WEB-INF/
, all other classes are protected from browser/ client access when
they're under /WEB-INF/

-Rashmi

On 5/19/07, Pid [EMAIL PROTECTED] wrote:

This is less programmatical than pragmatical but you could try not
putting your .java files on the web server...

:oP



-
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: javax.servlet.ServletException: Java heap space

2007-05-19 Thread Rashmi Rubdi

On 5/18/07, Aurélien Allienne [EMAIL PROTECTED] wrote:

Hi,

I have this error : javax.servlet.ServletException: Java heap space

But I can find how I can change this in catalina.sh.

Can you have the solution?


Here are some memory configuration information:
http://tomcat.apache.org/faq/memory.html

The solution may not depend on the version of Tomcat, JDK etc you're
using, but it helps for us to know just in case it does.



Cordially

Aurelien Allienne



-Regards
Rashmi

-
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: javax.servlet.ServletException: Java heap space

2007-05-19 Thread Rashmi Rubdi

On 5/19/07, Aurélien Allienne [EMAIL PROTECTED] wrote:

Thank, but tomcat use 64Mb by default. I can do change this parameter?



Example:

JAVA_OPTS=-server -Xms128m -Xmx384m

catalina.sh (Unix/Linux)

or

catalina.bat (MS Windows)

Additional documents:

http://www.google.com/search?sitesearch=tomcat.apache.orgq=JAVA_OPTSSearch=Search+Site

-Rashmi

-
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: Missing ETag in 304 Header

2007-05-19 Thread Rashmi Rubdi

On 5/16/07, Joe Mun [EMAIL PROTECTED] wrote:

Hi guys... so according to the HTTP 1.1 spec (
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html), 304 Not Modified
responses must include the ETag in the header.


Well, according to RFC 2616's section 10.3.5 on  304 Not Modified

- ETag and/or Content-Location, if the header would have been sent
   in a 200 response to the same request   , but the header is
sent in a 304 response.

That's why there's no ETag


I am serving a static text file, and the header only returns:

HTTP/1.x 304 Not Modified
Server: Apache-Coyote/1.1
Date: Wed, etc...


A 304 however returns If-None-Match which includes entity-tag , which
is the same as ETag for the requested resource.

RFC2616
14.26 If-None-Match
If-None-Match = If-None-Match : ( * | 1#entity-tag )


Status=Not Modified - 304
If-None-Match=  W/13035-1163859776458



Status=OK - 200
Etag=W/13035-1163859776458




Is there a reason that the Etag is not being included?


Because it is not supposed to be included --- see above.


Is there a way to
configure Tomcat to include this? My company is working with a caching
solution provider, and they are complaining about the missing ETag.


The caching provider should be looking for Http Status code.

If they status code is 200 , then they should look for Etag header, if
the status code is 304 then they should look for If-None-Match header.



thanks.



-Rashmi

-
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: Missing ETag in 304 Header

2007-05-19 Thread Rashmi Rubdi

I might be wrong but I have a few doubts

On 5/19/07, Len Popp [EMAIL PROTECTED] wrote:

I think you've got that wrong.

1. Spec says:
The response MUST include the following header fields: ... - ETag
and/or Content-Location, if the header would have been sent in a 200
response to the same request


By *same request* , I think you are saying that the request was sent
from the same browser instance.

So on first load of the static resource
http://localhost:8080/tomcat.gif , the Http Status is 200

On second load (when browser is refreshed), but the static resource is
now cached and so  the Http Status is 304.

But HTTP is stateless, how will the server know about the *same request* ?

Please correct me if I'm wrong, but it is my understanding that when
the browser is refreshed , a new request is sent hence, it is not the
*same request* .



2. ETag header *was* sent in a 200 response to the same request. (See
the header logs I posted earlier.)

3. Therefore, the 304 response must include the ETag.
(I'm pretty sure that's right, it seems straightforward to me.)
--
Len


-Regards
Rashmi

-
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: Missing ETag in 304 Header

2007-05-19 Thread Rashmi Rubdi

On 5/19/07, Rashmi Rubdi [EMAIL PROTECTED] wrote:

 1. Spec says:
 The response MUST include the following header fields: ... - ETag
 and/or Content-Location, if the header would have been sent in a 200
 response to the same request


Just to test this, I created a JSP and put a jsp:froward tag inside
the JSP, that *forwards* the
*same request* to the static resource.

In this case I got back an ETag, because the request to the JSP
returns a 200 status code, and on JSP forward the same 200 status code
is maintained.

But as mentioned in my previous post, I think the browser refresh
generates a new request, so the server would not know whether the
static resource was requested from the same request or a new request.

So then, the fact that the ETag doesn't appear is correct behavior IMHO.

-Rashmi.

-
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: Missing ETag in 304 Header

2007-05-19 Thread Rashmi Rubdi

On 5/19/07, Christopher Schultz [EMAIL PROTECTED] wrote:

Rashmi,

Rashmi Rubdi wrote:
 1. Spec says:
 The response MUST include the following header fields: ... - ETag
 and/or Content-Location, if the header would have been sent in a 200
 response to the same request

 By *same request* , I think you are saying that the request was sent
 from the same browser instance.

I think it means for any two requests that are indistinguishable from
each other. In this case, I totally agree with Len.


Thank you both for clarifying, I understand what you're saying.

I don't mean to go off-track but, since If-None-Match header is being
returned for Http Status 304 , I thought it might be a good idea to
look at it's definition too.

http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.26

The above definition mentions ETag , and the condition when it should
be returned in the response header, but it seems a little unclear to
me, because the sentence starts with Instead... , it doesn't fully
explain the context.

If any of the entity tags match the entity tag of the entity that
would have been returned in the response to a similar GET request
(without the If-None-Match header) on that resource, or if * is
given and any current entity exists for that resource, then the server
MUST NOT perform the requested method, unless required to do so
because the resource's modification date fails to match that supplied
in an If-Modified-Since header field in the request.

Instead, if the request method was GET or HEAD, the server SHOULD
respond with a 304 (Not Modified) response, including the cache-
related header fields (particularly ETag) of one of the entities that
matched. For all other request methods, the server MUST respond with a
status of 412 (Precondition Failed).

And the definition of ETag :
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.19

mentions entity-tag , which is also the value of a few other caching tags:

If-Match
If-None-Match
Vary

The value of the above tags returns the same checksum for the static
resource as the ETag does.

I think ETag's value will only change if the static file's modified
date changes according to it's definition here:
http://en.wikipedia.org/wiki/HTTP_ETag

So why have 2 headers with the same checksum for the same static
resource when one would suffice? Unless the checksum is going to be
different... which I doubt because it is calculate based on the i-node
number , last modified time and size (in Apache though, not sure how
Tomcat calculates it.).


Len, I recommend you cross-post this (if you haven't already) to the
tomcat-dev mailing list to see what they have to say.

- -chris



-Regards
Rashmi

-
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: Missing ETag in 304 Header

2007-05-19 Thread Rashmi Rubdi

On 5/19/07, Christopher Schultz [EMAIL PROTECTED] wrote:

Rashmi,

Rashmi Rubdi wrote:
 Thank you both for clarifying, I understand what you're saying.

[snip]

 And the definition of ETag :
 http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.19

 mentions entity-tag , which is also the value of a few other caching tags:

 If-Match
 If-None-Match
 Vary

Just because each of these headers has an entity-tag as its value does
not mean that the server can just pick one and shove an Etag-appropriate
value into the header. The entity-tag is just a data type. It's like
saying the 'Date' header returns a date and the 'Last-Modified-Date'
header also returns a date, therefore you can use the headers
interchangeably.


Got it.

I just wasn't sure if they could be used interchangeably or not, may be not.


 The value of the above tags returns the same checksum for the static
 resource as the ETag does.

Really? That doesn't sound right. The Vary header does not contain any
checksum of any kind. (At least not in the HTTP 1.1 spec).


I got confused about the Vary header because over here:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.19  it says:
The headers used with entity tags are described in sections 14.24,
14.26 and 14.44.   where 14.44 points to the Vary header. So you're
right the Vary header does not contain a checksum of any kind.

But as mentioned previously If-Match and If-None-Match do contain the
checksum that represents entity-tag.


 I think ETag's value will only change if the static file's modified
 date changes according to it's definition here:
 http://en.wikipedia.org/wiki/HTTP_ETag

 So why have 2 headers with the same checksum for the same static
 resource when one would suffice? Unless the checksum is going to be
 different... which I doubt because it is calculate based on the i-node
 number , last modified time and size (in Apache though, not sure how
 Tomcat calculates it.).

I'm not really sure what you're talking about, here. It seems clear that
the Etag ought to be sent with a 304 response if that same request would
have returned an Etag with a 200 response instead.


As you mentioned it may be a good idea to check with the Dev list or
may be we could file a bug.



The fact that the
Etag shouldn't change isn't the issue... it's the fact that it should be
sent in the response regardless of 2xx or 3xx response.


Got it.


- -chris


-Regards
Rashmi

-
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: transaction manager cannot load in Tomcat 6

2007-05-19 Thread Rashmi Rubdi

On 5/17/07, Molina, Teresa [EMAIL PROTECTED] wrote:

I've been trying to use Tomcat 6 (with Java 6) on FC6, but I cannot seem
to get the third-party transaction manager integrated as in previous
versions. I have configured everything just as in Tomcat 5.5, but there
seems to be a change in the classloading structure, which simply
prevents the classes from loading.

Originally, I had the all the necessary Objectweb (JOTM is my
transaction manager) in a directory outside of the CATALINA_BASE but had
appended them to the beginning of the classpath in setclasspath.sh,
which is how it currently works. With the failure to initialize, I moved
all needed jars into CATALINA_BASE/bin, after first trying
CATALINA_BASE/lib.


I don't know anything about Objectweb or JOTM transaction manager, but
just trying to point a few corrections with the configuration.

I think you should keep the JAR files in the lib folder and not the bin folder.

I did configure MySQL JDBC Datasource (for connection pooling)
successfully, so I have some basic idea about it how it is supposed to
be configured for Oracle and MySQL.


My suspicion is that there's a class that is needed
by the Objectweb DataSourceFactory that was previously included but is
no longer found, due to a change in the classloading architecture; but,
that's almost purely theoretical.

This is the error from catalina.out:

WARNING: Failed to register in JMX: javax.naming.NamingException: Could
not create resource factory instance [Root exception is
java.lang.NoClassDefFoundError: Could not initialize class
org.objectweb.jndi.DataSourceFactory]


I would try to connect directly without using JNDI first, to make sure
a direct connection works.


This is what's configured as a global resource in server.xml:
Resource name=AdminCop
min=1
max=1
auth=Container
type=javax.sql.DataSource
factory=org.objectweb.jndi.DataSourceFactory
   driverClassName=oracle.jdbc.driver.OracleDriver
username=xxx
password=xxx
url=jdbc:oracle:thin:@localhost::XXX /



Where have you placed the above Resource / tag ?

It should be placed either inside your applications Context node
(please note that it is possible that your Context node could be
defined outside server.xml, in that case you would place it where ever
the Context node is defined --- may be in server.xml or may be
outside)

, or in GlobalNamingResources node.

I'm not sure if you can use min and max attributes above. I couldn't
find any attributes with those names here:
http://jakarta.apache.org/commons/dbcp/configuration.html


I have, of course, read the appropriate JNDI How-To, but, as I say, I
have configured all resources, properties, paths, etc, exactly the same
as in Tomcat 5.5 with no luck. Any help would be greatly appreciated.

Thanks!

-- Teresa



Regards
Rashmi

-
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: transaction manager cannot load in Tomcat 6

2007-05-19 Thread Rashmi Rubdi

On 5/19/07, Rashmi Rubdi [EMAIL PROTECTED] wrote:

 This is what's configured as a global resource in server.xml:
 Resource name=AdminCop
 min=1
 max=1
 auth=Container
 type=javax.sql.DataSource
 factory=org.objectweb.jndi.DataSourceFactory
driverClassName=oracle.jdbc.driver.OracleDriver
 username=xxx
 password=xxx
 url=jdbc:oracle:thin:@localhost::XXX /



In addition to the configuration checks I've mentioned in my previous
post, also check that you've configured the web.xml correctly.

Here's my configuration for reference, it works with Tomcat 6.0.10 and
Oracle 10g

---
web.xml
---
resource-ref
descriptionOracle Datasource example/description
res-ref-namejdbc/myoracle/res-ref-name
res-typejavax.sql.DataSource/res-type
res-authContainer/res-auth
/resource-ref

---
Context xml  or server.xml Context tag
---

Context path= docBase=... reloadable=true debug=true

Resource name=jdbc/myoracle auth=Container 
type=javax.sql.DataSource
maxActive=20 maxIdle=10  maxWait=-1
username=x password=x 
driverClassName=oracle.jdbc.OracleDriver
url=jdbc:oracle:thin:@Venus:1521:XE/

/Context

--
Place ojdbc14_g.jar under
\apache-tomcat-6.0.10\lib\  folder

-Regards
Rashmi

-
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: Missing ETag in 304 Header

2007-05-17 Thread Rashmi Rubdi

On 5/16/07, Joe Mun [EMAIL PROTECTED] wrote:

Hi guys... so according to the HTTP 1.1 spec (
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html), 304 Not Modified
responses must include the ETag in the header.  However, Tomcat doesn't seem
to be adding it...

I am serving a static text file, and the header only returns:

HTTP/1.x 304 Not Modified
Server: Apache-Coyote/1.1
Date: Wed, etc...


I examined the header returned by Tomcat 6.0.10 with Firefox's
TamperData extension and also by uncommenting Tomcat's
RequestDumperValve.

You are right that the ETag header doesn't appear.

However, I saw another cache related header if-none-match , which
also shows a checksum in the same format as ETag , perhaps you may
find that header useful.

May 17, 2007 9:01:46 PM org.apache.catalina.valves.RequestDumperValve invoke
INFO: header=if-none-match=W/6958-1163795820656

I don't really know what causes the ETag to appear, I would expect it
to appear by default without any configuration similar to many other
HTTP Caching Headers.

I did notice the ETag for static files on one website that is hosted
on Apache httpd + Tomcat.


Is there a reason that the Etag is not being included?  Is there a way to
configure Tomcat to include this? My company is working with a caching
solution provider, and they are complaining about the missing ETag.

thanks.



Regards
Rashmi

-
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: I've been trying to unsubscribe from this list for years.

2007-05-17 Thread Rashmi Rubdi

When you send an email to [EMAIL PROTECTED] add the word
Unsubscribe to the email's subject and body, that worked for me when I
was trying to switch my e-mails.

I think it sends you an additional e-mail to confirm unsubscription,
reply to that one as well.

Then you should receive a final email with something like good bye
in the subject.

-Rashmi

On 5/17/07, Keith Adams [EMAIL PROTECTED] wrote:

No matter how many times I send a blank email to: [EMAIL PROTECTED], like the 
one I sent at 11.19 Eastern this morning, nothing happens. I use a rule to 
delete them permanently when I'm in Outlook, but when I use my company's web 
outlook, it can only move them to the deleted-items folder, which rapidly fills 
up, making it very hard for me to find things in there if I need to.

Please help. Thanks,

Keith


-
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: Tomcat 6 trimDirectiveWhitespaces

2007-05-14 Thread Rashmi Rubdi

You're welcome.

It may be a good idea to file a bug, because Tomcat 6.0.10 supports
JSP 2.1 and trimDirectiveWhitespaces is a new feature in JSP 2.1 , it
is supposed to work.

I've personally tried Ant's RegEx to compress the white spaces in
HTML, JS and other files, I've also heard that it is pointless to
compress white spaces because files sent by the server are gzip
compressed anyway --- which takes care of the white spaces, and then
they are uncompressed on the browser --- which makes the white spaces
appear again.

There are some things you should watch out when white space
compressing with Ant's RegEx. It puts everything in one single line.
So if you've used open comments such as // in either JSP or
JavaScript, the code after // will be commented out.

Similarly if you omit the closing semicolon in JavaScript, and
everything falls on one line, the Javascript wont work as expected.

The solutions are not to use open style comments // and to close all
Javascript statements with  a semi colon.

Anyway, your situation may be different but I just thought I'll let you know.

-Regards
Rashmi

On 5/14/07, Milanez, Marcus [EMAIL PROTECTED] wrote:

Thanks for your attention!   I'll try RegEX!



-
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: Run Xalan on Tomcat

2007-05-14 Thread Rashmi Rubdi

On 5/14/07, Christopher Schultz [EMAIL PROTECTED] wrote:

Rashmi Rubdi wrote:
 One way to use Xalan is with JSTL XML tags inside a JSP.

A much better way is to use Cocoon (http://cocoon.apache.org).


I've not tried Cocoon yet, so I really cant compare JSTL XML tags with
Cocoon but I know that with JSTL XML tags you only need 3 lines of
code to transform an XML with an XSLT file, and show the output on a
JSP --- and it requires Xalan JAR files.

3 lines are

1) Import XML

2) Import XSLT

3) x:transform xml with xslt

Well other than the above, it is also possible transform within a JSP
with x:parse tag.

In addition to Cocoon, JSTL XML tags, I think there are other
frameworks also available by Apache , each framework serves it's own
purpose.


- -chris


-Regards
Rashmi

-
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: Oracle JDBC connection Tomcat 5.5

2007-05-13 Thread Rashmi Rubdi

On 5/12/07, Zdeněk Vráblík [EMAIL PROTECTED] wrote:

Hi Rashmi,

thans for reply.

Configuration that is described in link you sent me works fine.
Problem is when I change
the datasource factory to Oracle datasource factory. Than is not
possible to find this datasource through JNDI lookup and this
connection disappear from admin console.
I think that ojdbc14.jar is newer version of oracle drivers  and it


You are right, sorry you don't need classes12.jar in this case please
ignore my previous post.

I also happen to have oracle 10g, in order to answer your question, I
was trying to see if I could set up a connection pool and then try to
get OracleConnection instead of SQL Connection, I tried for almost 1/2
a day so far, to get things set up but got an error
java.sql.SQLException: No more data to read from socket that is
taking too long to figure out, even after searching for answers on the
Internet. I have other things to do :-) so I will give up on this for
now.

Anyway, there's some more instructions here :
http://www.oracle.com/technology/sample_code/tech/java/oc4j/htdocs/jdbc_in_j2ee/jdbc_in_j2ee.html

the above instructions are written for Oracle9iAS Container and not
Tomcat, however they demonstrate how to obtain OracleConnection 
may be you'll find some useful information there unless someone on
this list has a solution.

You may also want to check with Oracle's Technology Forums.


works fine with standard datasource factory
org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory and
javax.sql.DataSource. It stops work when I use oracle datasource
factory
 factory=oracle.jdbc.pool.OracleDataSourceFactory and datasource type
type=oracle.jdbc.pool.OracleDataSource.

What I need is any solution how get OracleConnection instead of
Connection to use.
Do I miss any parameter in resource configuration?
Resource name=sisPool
   auth=Container
   type=oracle.jdbc.pool.OracleDataSource
   factory=oracle.jdbc.pool.OracleDataSourceFactory
   username=USER_51319
   password=USER_51319
   driverClassName=oracle.jdbc.OracleDriver
   url=jdbc:oracle:thin:@192.168.100.119:1521:orcl
   maxActive=20 maxIdle=10 maxwait=-1/

Thanks.
Zdenek



-Regards
Rashmi


Re: Run Xalan on Tomcat

2007-05-13 Thread Rashmi Rubdi

On 5/13/07, domenico di leo [EMAIL PROTECTED] wrote:

Hi

How can I run Xalan on Tomcat?


Configure it as you would configure other plug-ins. That is, place
xalan.jar (and dependent JAR files such as serializer.jar) either in

1) your projects /WEB-INF/lib folder  or in Tomcat's shared folder
(your choice).


I use Tomcat 5.5.23 and I'm newbie


How do you plan to use Xalan on Tomcat?

One way to use Xalan is with JSTL XML tags inside a JSP.


many thanks



-Regards
Rashmi

-
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: Oracle JDBC connection Tomcat 5.5

2007-05-12 Thread Rashmi Rubdi

On 5/11/07, Zdeněk Vráblík [EMAIL PROTECTED] wrote:

Hi all,

I am configuring jdbc datasources on Tomcat 5.5.23.

I followed this document to configure orcle database with Tomcat
http://www.microdeveloper.com/html/JNDI_Orcl_Tomcat1p.html


Sorry I didn't go through the instructions in the above link , I would
follow the instructions for Oracle 10g here:
http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html
look for the title: Oracle 8i, 9i  10g



I am not able to see datasource in web admin.
datasource configuration:

Resource name=sisPool
  auth=Container
  type=oracle.jdbc.pool.OracleDataSource
  factory=oracle.jdbc.pool.OracleDataSourceFactory
  username=USER_51319
  password=USER_51319
  driverClassName=oracle.jdbc.OracleDriver
  url=jdbc:oracle:thin:@192.168.100.119:1521:orcl
  maxActive=20 maxIdle=10 maxwait=-1/

Everything works fine with this configuration:
Resource name=sisPool
  auth=Container
  type=javax.sql.DataSource
  factory=org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory
  username=USER_51319
  password=USER_51319
  driverClassName=oracle.jdbc.driver.OracleDriver  or
driverClassName=oracle.jdbc.driver.OracleDriver
  url=jdbc:oracle:thin:@192.168.100.119:1521:orcl
  maxActive=20 maxIdle=10 maxwait=-1/

I need get OracleConnection instead of Connection.


I think you also need classes12.jar



There is not any error or exception in log files.
I have ojdbc14.jar in common/lib directory.
I am able to use even Oracle JGeometry objects with common Connection,
but I need OracleConnection.

My configuration:
Windows XP,
JDK  5_09
Tomcat 5.5.23
Oracle 10G 10.2.0.1

Do you have any idea, what I am doing wrong?


Most likely you need Oracle's classes12.jar


How could I get any error or exception? Logs in tomcat/logs dirrectory
are correct. I have there only info outputs from my test application.

Thanks.

Regards,
Zdenek Vrablik



Regards
Rashmi


Re: Tomcat 6 trimDirectiveWhitespaces

2007-05-11 Thread Rashmi Rubdi

On 5/11/07, Milanez, Marcus [EMAIL PROTECTED] wrote:


Hi,

Do I need something else besides declaring %@ page
trimDirectiveWhitespaces=false % to have my page's white spaces
trimmed? This directive doesn't seem to work at all...


You are right it doesn't seem to work on Tomcat 6.0.10, well I think
you don't need anything else , just setting
trimDirectiveWhitespaces=true is supposed to work but it didn't
either.

Well the trimDirectiveWhitespaces doesn't remove all white spaces in a
HTML page, it is only supposed to remove the blank lines left behind
by JSP directives (as described here
http://java.sun.com/developer/technicalArticles/J2EE/jsp_21/ ) when
the HTML is rendered.

If you want to trim all white spaces one option is Ant RegEx (see
bottom: http://ant.apache.org/manual/OptionalTasks/replaceregexp.html)


Thanks in advance,

Marcus


Regards
Rashmi

-
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 6.0.9 not recognizing deletion of Applet class

2007-05-10 Thread Rashmi Rubdi

On 5/10/07, Daniel Gresh [EMAIL PROTECTED] wrote:


Here is the JSP page code, if it helps:


The problem may be because you're using applet tag within XHTML strict.

The applet tag is not supported in XHTML 1.1 (and was depricated in
HTML 4.01), you are encouraged to upgrade to the object tag or to an
even better jsp:plugin
http://java.sun.com/products/jsp/syntax/2.0/syntaxref2023.html#1004158
tag.

Although, upgrading may or may not solve your particular problem, at
least it offers the satisfaction that the code is valid, so that the
browser can process it correctly.

Also check if the applet is being cached somewhere, try deleting the
browsers cache. That may help in solving the problem.

I don't think this problem has anything to do with Tomcat,  for
further help this forum
http://forum.java.sun.com/forum.jspa?forumID=421


!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;
html
titleNVAC Polling Controller/title
body
applet code=applet.NVACApplet width=200 height=100
Your browser does not support the applet tag.
/applet
%
//Service.init();
%
%
//out.print(Service.showString());
%
/body
/html

Thanks,
Dan



Regards
Rashmi

-
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: Exception processing Global JNDI Resources - on FC6Tomcat5.5.17

2007-05-10 Thread Rashmi Rubdi

On 5/10/07, Tim Alberts [EMAIL PROTECTED] wrote:

I'm running FC6 with Tomcat 5.5.17 (standard rpm packages from the FC6
distribution).


The default rpm packages seem to have some problem, they seem to
depend on each other and often stall Linux.

It's best to install Linux Fedora minus the RPMs , and get whatever
software you need straight from the source.

-
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: How to configure Tomcat response timeout?

2007-05-09 Thread Rashmi Rubdi

On 5/9/07, Rashmi Rubdi [EMAIL PROTECTED] wrote:

I agree, from my experience IE times out when the connection is taking
too long to send a response back, I haven't experienced a timeout with
FF.

You may want to consider a paging algorithm, if your data set is too
large, it is not good practice to return all the data in one shot.


Sorry, in my previous post I meant *store* all the data in one shot,
but in any case, paging is a good practice whether you're storing or
returning.

Also consider a batch update instead of sequential update along with
prepared statements instead of statements, and other
optimization/memory management techniques.



-Regards
Rashmi


-
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: nullpointerexception with standard manager

2007-05-09 Thread Rashmi Rubdi

On 5/9/07, mélanie langlois [EMAIL PROTECTED] wrote:


Hi,
Thank you for your explanation.

Actually, we don't need this feature in our application, so i want to
disable the persistence of session.


To disable the persistence of session add this

Manager className=org.apache.catalina.session.PersistentManager
saveOnRestart=false/

between the opening and closing Context tag


However, we are running tomcat 5.0.28
and for several reasons, we don't want to upgrade for now. Is it possible to
disable this in 5.0.28 ?


It may be possible, but I can't say for sure because I haven't tested
it on 5.0.28 - doesn't hurt to test it.


I saw only explanation for doing this on tomcat

5.5.x by modifying context.xml ..

Thanks,

Mélanie



-Rashmi

-
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: jsp:include no longer working in 5.5.23

2007-05-07 Thread Rashmi Rubdi

On 5/7/07, Scott Dunbar [EMAIL PROTECTED] wrote:

I've been using the same code for years since the Tomcat 3.x days and an
upgrade to 5.5.23 has now broken my site.


I would safely assume there have been significant changes between 3.x
and 5.5.23, if I were you I would start fresh, also the instructions
for 5.5.23 are different compared to older versions.

Tomcat 3.x follows JSP 1.1 syntax

Tomcat 5.5.x follows JSP 2.0 syntax


If I do a:

jsp:include page=/some/path/to/some.html /



In the above page URL, what is some? Is it a folder under the root
context or is /some/ the context itself?

Knowing the absolute path of some.html would help in knowing whether
it's under a root context or not.


I get:

The requested resource (/some/path/to/some.html) is not available.  It
is available and this particular file hasn't been modified for a very
long time.  If I change it to:

jsp:include page=../some/path/to/some.html /

which is where it is physically, I get


Most likely the path is incorrect, knowing the absolute path helps, in
diagnosing the problem



Stacktrace:

org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:467)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:389)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

*root cause*

java.lang.NullPointerException

org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:965)
org.apache.jsp.index_jsp._jspService(index_jsp.java:42)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


Any thoughts?



-
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: Tomcat5 on Mac OS X, problem with book or installation?

2007-05-05 Thread Rashmi Rubdi

On 5/5/07, Kevin O'Mara [EMAIL PROTECTED] wrote:

I am using tomcat5 5.5.20, Revision 3, java/tomcat5 from MacPorts.

I am following the instructions for the Addison Wesley book: Servlets
and JavaServer Pages: The J2EE Web Tier from the first chapter.

The first chapter may be found here: http://www.jspbook.com/jspbook-01.pdf


Sorry, I didn't refer to the book, but just wanted to let you know
that the instructions for different versions of Tomcat can differ
across versions.

If the book is providing instructions for a much older version of
Tomcat, and if you are using a much later version of Tomcat the
instructions can be significantly different from my experience with
any software.


I am on the part where the author is creating the jspbook directory and
is placing a web.xml file in the $CATALINA_HOME/webapps/jspbook/WEB-INF


So far the above configuration looks correct to me.


directory, and a jspbook.xml file in the $CATALINA_HOME/webapps In Tomcat 5.5.x


jspbook.xml should not be placed under $CATALINA_HOME/webapps


directory.  I cannot get the webapps/jspbook directory to be recognized
by my Tomcat setup no matter what I do, after following these steps and
continuous restarting of the server. I am assuming that it is ok to
forgo the editing of the server.xml file like the book says.

This is the error I receive after retrieving http://localhost:8080 -


  HTTP Status 404 - /jspbook/



*type* Status report

*message* _/jspbook/_

*description* _The requested resource (/jspbook/) is not available._


In your case, it appears that the folder under $CATALINA_HOME/webapps/jspbook/
is empty and the directory listing is set to false.

It helps to set directory listing to true, because if you place a JSP
file other than
index.jsp under $CATALINA_HOME/webapps/jspbook/ directory , or if the
directory is empty you will get the HTTP Status 404 - /jspbook/

In order to set the directory listing to true follow these simple steps

1) Open the web.xml file under $CATALINA_HOME/conf/ directory

2) Look for :

   init-param
   param-namelistings/param-name
   param-valuefalse/param-value
   /init-param

change that to

   init-param
   param-namelistings/param-name
   param-valuetrue/param-value
   /init-param





  Apache Tomcat/5.5.20


Please help.  Thanks in advance.



Once you set the directory listing to true, you should be able to see
the directory under

http://localhost:8080/jspbook/ which is currently empty.

Place some dummy JSP file under webapps/jspbook , either call it
index.jsp or anything else .jsp and you should be able to see its
contents from the browser by invoking
http://localhost:8080/jspbook/

-Regards
Rashmi

-
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: Cannot stop/start application using manager

2007-05-05 Thread Rashmi Rubdi

On 5/6/07, Jerome Benezech [EMAIL PROTECTED] wrote:

Hi All,

I have an application (cocoon) running under Tomcat
5.5 on the server of my hosting provider.


Hi Jerome,

Did you also check with the hosting provider?



I can't see any error in catalina logs. So am kind of
stuck at that point.


There are 4 different dated log files

1) localhost
2) host-manager
3) manager
4) admin

please check all log files for possible error details (full stack
trace would be useful).


I'd have 2 questions:
- how can I get this message when stopping the app ?


I don't know, may be if an attempt was made to start Tomcat when it
was already running.


The manager is obviously started as I'm using it to
call the stop of my app. By the way, the list command
returns
/cybercity:stopped:0:cybercity
/manager:running:0:/usr/local/jakarta/jakarta-tomcat-5.5.9/server/webapps/manager
/:running:0:

- how can I restart my application at that point ? I
don't have the control over tomcat so cannot
stop/start the server.


May be the host provider can help.



Any help/ideas would be greatly appreciated

Thanks
Jerome


-Regards
Rashmi

-
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 deployment question

2007-05-04 Thread Rashmi Rubdi

Hi Lakshmi,

I just wanted to let you know that in the most recent post on this
thread, your problem was solved (even though I didn't give a complete
answer) but after my post Chuck made some very good points which I
didn't mention in my post. I hope you took a note of them.

Especially this one:


Remove the existing webapps/ROOT to avoid conflict.



On 5/4/07, Lakshmi Venkataraman [EMAIL PROTECTED] wrote:

P.s: The documentation is not very clear on these points.   I hope some
expert out there will update
Tomcat FAQ.


In most software development the docs take a little while, but in
terms of functionality much has been achieved in the recent versions.

Once the concepts are clear, it is easier to find your way around. But
it's useful to keep in mind that the docs can be a little outdated
when it comes to any software.

-Regards
Rashmi

-
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: starting Tomcat from Java

2007-05-04 Thread Rashmi Rubdi

On 5/4/07, Paul Singleton [EMAIL PROTECTED] wrote:

I (sometimes) want to start Tomcat (5.5 onwards) from
Java, but I am not embedding: I just need to get the
same effect as running bin/startup.bat but getting
Tomcat to run in an existing JVM (so I can debug some
other stuff).

I am considering translating startup.bat into Java:
has this already been done?  I really want a solution


I'm not sure if this answers your question exactly, but there are a few
solutions proposed here:
http://ptrthomas.wordpress.com/2006/03/25/how-to-start-and-stop-tomcat-from-ant/


which continues to behave like startup.bat regardless
of changes to the environment, Tomcat, server.xml etc.
(I won't always be there to sort things out)

Paul Singleton



-Regards
Rashmi

-
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: How to access application in the root?

2007-05-03 Thread Rashmi Rubdi

Hi Ashok,

On 5/3/07, Ashok Sahu [EMAIL PROTECTED] wrote:

Hi All,
I am migrating my J2EE application from JRun to Tomcat 5.0.28. I
deployed successfully the 'myAppname.war' file in Tomcat. Now here is my
problem:

In the JRun, we were calling the jsp or servlet without giving the
application name in the URL. Same thing I need to do in the tomcat otherwise
it will requires lots of code changes. In the code it is written like for
example:

td align=left background=/images/modulebgimage_smaller.gif
img src=/images/moduleimage_smaller.gif
/td
td vAlign=top align=right halign=right
background=/images/modulebgimage_smaller.gif


 Hence I want to access the application by using

http://localhost:8080/servletname instead of


Here it helps to know some of the basics of Tomcat. You're looking to
deploy the application at the root Context, and the root Context is
the first slash after
the URL , for example http://localhost:8080/   thats the root Context.


http://localhost:8080/myAppname/servletname


In the above case , myAppname is the Context. The default behavior
I've seen is that when one places a someApp.war under the webapps
folder someApp automatically becomes the context.


I am not much familiar with tomcat. Please let me know how to achieve it.


There are different configurations possible, the list of
configurations I'm writing here is just to give a hint and may not be
complete and may be partially correct but it gives the desired
behavior.

1) One configuration is back up the default ROOT folder that ships
with Tomcat and then rename myAppname.war to ROOT.war , then you can
access the app at http://localhost:8080/ --- the root Context.

2) Another configuration is: In development environment , remove the
myAppname.war and delete the myAppname folder from the webapps folder
--- assuming you backed this up somewhere. Also delete ROOT.war and
ROOT folder under webapps folder.

Then simply create a ROOT.xml (Context file) under Tomcat's
/conf/Catalina/localhost/ folder , define the Context node in this
ROOT.xml ,

for example:
Context docBase=C:/dev/projects/myAppProject /

With the above configuration also you can access your application at
http://localhost:8080/

3) Other configurations are also possible, but the above are what I
know as of now.



Thanks in advance
Ashok



-Regards
Rashmi

-
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: War with timestamp not using META-INF/context.xml path

2007-05-03 Thread Rashmi Rubdi

On 5/3/07, Garner, Shawn [EMAIL PROTECTED] wrote:

We don't use a deployment script.
Not sure if we could, it's all secured and isolated.



Without the timestamp and the environment in the war name somebody could
deploy a war to the wrong environment or an old war.



Sounds to me like if it is easy enough to use the filename that you
could use the path attribute in META-INF/context.xml just as easy.


As Chuck mentioned, this is not possible.

If you consider using an Ant Build Script or Maven or other (your
choice), then you could auto deploy remotely to any location with just
the WAR file name minus the timestamp as Chuck mentioned.

However, build scripts are out of the scope of this list, but each
build tool has their own mailing list - I know Ant has one, probably
Maven and others have their own.


Shawn


-Regards
Rashmi

-
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: shutdown restart

2007-05-02 Thread Rashmi Rubdi

Also, if the OS is Unix/Linux based, you most likely should grant
execute permissions for startup.sh and shutdown.sh  - before trying to
execute them the first time.

-Regards
Rashmi

-
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: shutdown restart

2007-05-02 Thread Rashmi Rubdi

You probably might have locate the files, but just in case not the
startup.sh and shutdown.sh shell script files are under Tomcat's bin
folder.

-Regards
Rashmi

On 5/2/07, William Biggs [EMAIL PROTECTED] wrote:

I runing linux where is the file at ?


-
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: Log files always locked

2007-05-02 Thread Rashmi Rubdi

I'm able to open Tomcat log files with Notepad, while Tomcat is running.

I guess the lock happens when Tomcat is writing to the log file, and
the file is being opened simultaneously. I think you're using the
Windows Installer and I've installed mine from the zip file. I don't
know if it makes a difference in case of locking log files.

Also there are few tail -f utilities for Windows that simulate the
Unix tail -f command, helpful to view recent changes to the log file
or see it running. I don't know if Textpad does that, you my have to
scroll to the bottom to see changes.

Regards
Rashmi

On 5/2/07, Johnny Kewl [EMAIL PROTECTED] wrote:

Thanks... does the trick.
But still wondering why the file handles are left open... I would think its
not good practice.


- Original Message -
From: Venkat Venkataramanan [EMAIL PROTECTED]
To: 'Tomcat Users List' users@tomcat.apache.org
Sent: Wednesday, May 02, 2007 8:45 PM
Subject: RE: Log files always locked


 Johnny:

 I use Textpad to open the log file; if the log file is updated, it will
 automatically update the screen. Try that.

 -Original Message-
 From: Johnny Kewl [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, May 02, 2007 2:34 PM
 To: Tomcat Users List
 Subject: Log files always locked

 Just something that bugs me.
 On windows if you try open a tomcat log file... which are typically
 associated with something like notepad, you get In Use By Another
 Program.
 Why does Tomcat lock the file handle indefinitely?
 It maybe good programming practice but windows utilities generally dont
 give
 one the option of will open as read only... its always a mission just to
 read a log file.


-
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: How to share static content across multiple tomcat webapps

2007-05-01 Thread Rashmi Rubdi

Hi Martin,

On 5/1/07, Martin Jones [EMAIL PROTECTED] wrote:

Thanks for the reply.

After mulling this over, I've thought of another way to do it
(apologies if I'm not using the correct terminology here).  Have the
static content in a single directory on my development machine, then
use my Ant build script to have the contents included in the .war
file.  Then, when I make any changes to the static content, I just
have to rebuild and redeploy .war files for each webapp I'm running.
There would be multiple copies of sidebar.html and images, etc. on the
server, but that wouldn't matter as I would never edit them directly.

This seems like a good compromise - any thoughts?


It depends, if you have 10 different websites, then it would create 10
different copies. It may or may not become a maintenance nightmare in
the future.

I think this thread
http://www.theserverside.com/news/thread.tss?thread_id=27172 has a few
good suggestions.

1) one poster (post #6 from the top) suggested creating a separate
webapplication (Context) to hold only the common static resources
(html, images etc) and set crossContext=true only for that static
application.

2) some have suggested creating a Filter for this, I don't know about
Filters yet but it seems like a possible solution.




Thanks,

Martin



-Regards
Rashmi

-
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: Redirecting URL request to Tomcat to folder containing Cruise Control

2007-05-01 Thread Rashmi Rubdi

Hi Robert,

On 4/30/07, Robert Segal [EMAIL PROTECTED] wrote:

I have Cruise Control setup to run my machine and am able to access it
through Tomcat using...

 http://localhost:8080/cruisecontrol/

I would like to be able to access this same URL using the format...

 http://localhost:8080/standard/


This is known as URL Rewriting and can be accomplished with a Filter.

Searching on the keywords URL Rewrite Filter will show a few
pre-written packages or you could write your own Filter.


Is this possible under Tomcat?  And if so how might I go about doing
something like this?  Any help is greatly appreciated.



Robert Segal


Hope this helps.
-Regards
Rashmi

-
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: Redirecting URL request to Tomcat to folder containing Cruise Control

2007-05-01 Thread Rashmi Rubdi

However, from the subject of your e-mail it appears that you want to
do a Redirect from http://localhost:8080/standard/  to
http://localhost:8080/cruisecontrol/
which is easy to accomplish.

within a JSP Scriptlet:
%response.sendRedirect(/cruisecontrol/); %

with JSP/JSTL
c:redirect tag

within a Servlet:
response.sendRedirect(/cruisecontrol/);

The above redirects with HTTP 302

I guess thats what you're looking for.

Regards
-Rashmi

-
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: JAR file not finding external properties files

2007-05-01 Thread Rashmi Rubdi

Hi Mike,

On 5/1/07, Mike Peremsky [EMAIL PROTECTED] wrote:

  What do I need to do to get the class in the jar file to find the properties 
files external to it?


To access a properties file that is external to the JAR file , add the
full path of the Properties file's folder to the CLASSPATH.

If you add the path of the Properties file to the CLASSPATH, there's
no need to place the properties file under /WEB-INF/classes/ folder ,
it can be located anywhere you want.

After setting the CLASSPATH, the properties file can be accessed
simply by specifying its name.

For example:

If the mypropertiesfile.properties is placed under
C:/dev/mypropertiesfile.properties

set CLASSPATH=%CLASSPATH%;C:/dev/

public class TestPropertiesFile {
   public static void main(String[] args) {
   ResourceBundle props = ResourceBundle.getBundle(mypropertiesfile);
   //String planet = (String) props.getObject(planet);
   //System.out.println(Planet:  + planet);
   }
}




  TIA

  - Mike


-Regards
Rashmi

-
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: Apache Windows Installer doesn't work

2007-05-01 Thread Rashmi Rubdi

Hi Fabio,

On 5/1/07, Fabio Daitx [EMAIL PROTECTED] wrote:

I am trying to install apache-tomcat-5.5.23.exe or
apache-tomcat-6.0.10.exe and it just blocks in the installation step:


In case you already know there's also a ZIP installation available.

With the ZIP installer, there's no possibility of freezing, because
you would simply
unzip it to a particular directory, then set JAVA_HOME and CATALINA_HOME
system environment variables.


Using Jvm: C:\Arquivos de
programas\Java\jre1.6.0_01\bin\client\jvm.dll
What can I do?



-Regards
Rashmi

-
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: JAR file not finding external properties files

2007-05-01 Thread Rashmi Rubdi

Hi David,

On 5/1/07, David Smith [EMAIL PROTECTED] wrote:

Mike, I see your issue is solved.  For the sake of the archives I feel
the need to respond to the suggestion of modifying the classpath.

Please DO NOT modify the classpath.  Best practice is to work with the
existing classloader structure and put files in the proper places.


Thats a good point, but some people have specific need to keep
properties file in a
separate location, in this case they have no other choice.

But Mike's case is different, he didn't have this restriction, so I
agree with you where it can be avoided, it is best to keep the
properties file in the classes folder

- CLASSPATH issues are one of those that take almost a day or two to track down.


Modifying the class path environment variable is just asking for huge
problems.  You do it and then forget or the next developer/sysadmin in
line doesn't know it and all sorts of quirky problems show up.

--David


-Regards
Rashmi

-
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: Manager vs host-manager

2007-05-01 Thread Rashmi Rubdi

On 5/1/07, gb1071nx [EMAIL PROTECTED] wrote:

I've found in the $CATALINA_HOME/server/webapps directory these two
apps:

manager (know what this is)
host-manager  (don't know what this is)


After some searching in Tomcat's docs, I couldn't find documentation
on Host Manager, but here are a few things I know that you may find
useful:

host-manager allows one to manage virtual hosts.

The web.xml for the host-manager webapp has some useful information,
for example
with the /html URL pattern one can access the application at
http://localhost:8080/host-manager/html

And to login, the default role is admin , so any users defined in
tomcat-users.xml with the role of admin can login to the host-manager
app.

... \apache-tomcat-5.5.12\server\webapps\host-manager\WEB-INF\web.xml


I've searched the contents of
http://tomcat.apache.org/tomcat-5.5-doc/manager-howto.html

but can't find a reference to the TC 5.5 deployed app host-manager.


Can someone shed some light?



Hope this helps.

-Regards
Rashmi

-
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: JAR file not finding external properties files

2007-05-01 Thread Rashmi Rubdi

On 5/1/07, David Smith [EMAIL PROTECTED] wrote:

I agree there may be an exceptionally rare occasion where modifying
classpath might be necessary.  But such advice should be reserved for
expert use only and only if they fully understand the consequences.


Yup, had I known earlier when Mike made his initial 2 posts that he
had the flexibility to put the properties file in the classes folder I
would have suggested the classes folder as well.

But I was thinking there may be a restriction, also I came across a
number of threads at Sun forums that suggested the use of CLASSPATH ,
so that's where I picked up the solution from.

Now that you've made a good point on the best approach, next time this
question arises I will know better :-)



--David


-Regards
Rashmi

-
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: shutdown restart

2007-05-01 Thread Rashmi Rubdi

Depends on your Operating System and how you installed it on that OS.

Windows ZIP --- startup.bat and shutdown.bat
Unix/Linux--- startup.sh and shutdown.sh

Windows Service Installer  I don't know , I guess from
Administrative Console --- Services
or simply right click on the icon that appears on the bottom right task bar.

-Rashmi


On 5/1/07, William Biggs [EMAIL PROTECTED] wrote:

I'm a newbie. After I upload my war file how do I shutdown and restart
tomcat 5.5 ?



-
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: Context started twice

2007-04-30 Thread Rashmi Rubdi

On 4/30/07, sc [EMAIL PROTECTED] wrote:


As you suggested, I started from scratch. I downloaded tomcat 6 from
apache.org. changed $catalina_home to point to the new directory. Under
$catalina_home/webapps, I created a new folder, which only has one servlet
TestServlet



Do a global search on your projects and also on C: or Home drive to
see if this line of code is defined in an additional Servlet that is
visible to the current installation of Tomcat:

log.info(TestServlet init);

I know you mentioned that there's only one Servlet under webapps, but
just in case...

I also see super.init(config); but that shouldn't cause the
TestServlet's init method to be called twice.



public class TestServlet extends HttpServlet
{
private Log log = LogFactory.getLog(this.getClass().getName());

//public void init() throws ServletException
public void init(ServletConfig config) throws ServletException
{
super.init(config);
log.info(TestServlet init);

}

public void destroy()
{
log.info(TestServlet destroy);
}
}


My web.xml as following:
?xml version=1.0 encoding=ISO-8859-1?

web-app xmlns=http://java.sun.com/xml/ns/j2ee;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd;
version=2.5


display-nameHello, World Application/display-name
description
This is a simple web application with a source code organization
based on the recommendations of the Application Developer's Guide.
/description


servlet
servlet-nametest/servlet-name
servlet-classcom.trip.view.TestServlet/servlet-class
 load-on-startup1/load-on-startup
/servlet

servlet-mapping
servlet-nametest/servlet-name
url-pattern/test/url-pattern
/servlet-mapping

/web-app

I didn't do any changes to the new installation of tomcat. Then I started
tomcat and shutdown it.
The log showed the following entries:
2007-04-30 12:35:27,968 [main] INFO  com.cutetrip.view.TestServlet -
TestServlet init
2007-04-30 12:35:27,968 [main] INFO  com.cutetrip.view.TestServlet -
TestServlet init
2007-04-30 12:35:40,046 [main] INFO  com.cutetrip.view.TestServlet -
TestServlet destroy
2007-04-30 12:35:40,046 [main] INFO  com.cutetrip.view.TestServlet -
TestServlet destroy

Since I just downloaded Tomcat, it is likely the double init is caused by my
application or local environment setting. Anywhere I should look at? I am
very puzzled.
Thanks.


I will try to replicate this.

Regards
-Rashmi

-
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: Context started twice

2007-04-30 Thread Rashmi Rubdi

I tested your code, the init is called exactly once, when Tomcat starts.

Try one of these:

1) Change
   log.info(TestServlet init);
   log.info(TestServlet destroy);

   to something else like

   log.info(TestServlet init ## );
   log.info(TestServlet destroy ##);

   Re-compile, re-start TC if necessary and
   check if you see 2 different outputs on the console.


2) If you see the same output twice, that is if you see

   log.info(TestServlet init ## );
   log.info(TestServlet init ## );

   log.info(TestServlet destroy ##);
   log.info(TestServlet destroy ##);

   then check web.xml if the same Servlet is defined twice under
different names.

3) Globally search for TestServlet init and see if it appears in
more than one Servlet that may be visible to the current installation
of Tomcat.

-Regards
Rashmi

On 4/30/07, Rashmi Rubdi [EMAIL PROTECTED] wrote:

On 4/30/07, sc [EMAIL PROTECTED] wrote:

 As you suggested, I started from scratch. I downloaded tomcat 6 from
 apache.org. changed $catalina_home to point to the new directory. Under
 $catalina_home/webapps, I created a new folder, which only has one servlet
 TestServlet


Do a global search on your projects and also on C: or Home drive to
see if this line of code is defined in an additional Servlet that is
visible to the current installation of Tomcat:

log.info(TestServlet init);

I know you mentioned that there's only one Servlet under webapps, but
just in case...

I also see super.init(config); but that shouldn't cause the
TestServlet's init method to be called twice.


 public class TestServlet extends HttpServlet
 {
 private Log log = LogFactory.getLog(this.getClass().getName());

 //public void init() throws ServletException
 public void init(ServletConfig config) throws ServletException
 {
 super.init(config);
 log.info(TestServlet init);

 }

 public void destroy()
 {
 log.info(TestServlet destroy);
 }
 }


 My web.xml as following:
 ?xml version=1.0 encoding=ISO-8859-1?

 web-app xmlns=http://java.sun.com/xml/ns/j2ee;
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee
 http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd;
 version=2.5


 display-nameHello, World Application/display-name
 description
 This is a simple web application with a source code organization
 based on the recommendations of the Application Developer's Guide.
 /description


 servlet
 servlet-nametest/servlet-name
 servlet-classcom.trip.view.TestServlet/servlet-class
  load-on-startup1/load-on-startup
 /servlet

 servlet-mapping
 servlet-nametest/servlet-name
 url-pattern/test/url-pattern
 /servlet-mapping

 /web-app

 I didn't do any changes to the new installation of tomcat. Then I started
 tomcat and shutdown it.
 The log showed the following entries:
 2007-04-30 12:35:27,968 [main] INFO  com.cutetrip.view.TestServlet -
 TestServlet init
 2007-04-30 12:35:27,968 [main] INFO  com.cutetrip.view.TestServlet -
 TestServlet init
 2007-04-30 12:35:40,046 [main] INFO  com.cutetrip.view.TestServlet -
 TestServlet destroy
 2007-04-30 12:35:40,046 [main] INFO  com.cutetrip.view.TestServlet -
 TestServlet destroy

 Since I just downloaded Tomcat, it is likely the double init is caused by my
 application or local environment setting. Anywhere I should look at? I am
 very puzzled.
 Thanks.

I will try to replicate this.

Regards
-Rashmi



-
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: How to share static content across multiple tomcat webapps

2007-04-30 Thread Rashmi Rubdi

Hi Martin,

On 4/30/07, Martin Jones [EMAIL PROTECTED] wrote:

Hi,

This seems like an obvious question but I'd appreciate any answers. I
have several webapps running under tomcat that need to be able to
include the same sidebar in their .jps.  if the sidebar is within the
context, this works fine:

%@ include file=sidebar.html %

However this requires me to keep a copy of sidebar.html (and all the
images) in each .war.  I'd rather keep a single copy of sidebar.html.
If I make a new context static in tomcat and place the sidebar +
images there, I can access it fine in my browser with the url:

http://localhost:8080/static/sidebar.html

but the naive change to the jsp:

%@ include file=../static/sidebar.html %


The include directive is out of the question because according to it's syntax
http://java.sun.com/products/jsp/syntax/2.0/syntaxref209.html#1003408
it only accepts URLs that are relative to the web application (a.k.a Context).



fails with the path specifies a resource outside the web
application.  Using jstl and import:

c:import url=../static/sidebar.html/


JSTL's c:import tag has an attribute called context,
http://java.sun.com/products/jsp/jstl/1.1/docs/tlddocs/c/import.html
which allows one to access resources from other contexts (a.k.a web
applications) , however in order to function properly the crossContext
attribute of the web application's Context node must be enabled (set
to true).


From my experience setting crossContext to true has caused other

conflicts when 2 resources (Java Classes) have the same name in 2
different web applications that have crossContext enabled  it
could be that there was something wrong in my configuration. But, I'm
just letting you know about it.



leads to:

javax.servlet.jsp.JspTagException: /../static/sidebar.html

However, if I use the absolute path:

c:import url=http://localhost:8080/static/sidebar.html/

the page is fine, but because the paths to the images are copied
directly from sidebar.html and included in the .jsp they are
incorrect.


In this case you would also need to change the URLs of the images to
be the absolute URL.



It seems to me that what I'm trying to accomplish is a fairly common
thing; I'd appreciate any pointers.


Normally it is considered bad practice to hardcode the entire URL, you
may want to store the domain etc in a constant and prefix it to the
rest of the URL.

Also, there might be better ways to accomplish this.

I don't know much about JNDI but it comes to mind, is it possible to
store images as a global JNDI resource.


Thanks,

Martin



-Regards
Rashmi

-
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 time out

2007-04-30 Thread Rashmi Rubdi

On 4/30/07, Tomcat [EMAIL PROTECTED] wrote:

Hello

Does application WEB-INF/web.xml override default conf/web.xml setting?
specifically session time out , but want to know if other setting is
overriden.


Specifically the session time out in /WEB-INF/web.xml overrides /conf/web.xml
Don't know about other parameters, but they can be easily tested.
The Servlet 2.4 specification shows all web.xml nodes on page 136.


and can we disable this through server.xml ?


So far there doesn't seem to be a setting in server.xml to disable
this, so I guess not.




Thanks
Adam




-Rashmi

-
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: Server redirected too many times (20)

2007-04-30 Thread Rashmi Rubdi

Hi John,

On 4/30/07, John Pedersen [EMAIL PROTECTED] wrote:

Hi,

I can't understand why Tomcat gives me this error message when I try
to reload my app:

Server redirected too many  times (20)

Is my app getting too big ( 400 files) ?


The conversation on this
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4458085 bug should
help.



It seems to happen more and more often. Usually a server restart fixes
it. Sometimes I have to restart my machine.

At the moment, I have to reload, I get the error message, I stop and
start Tomcat, and then I can see whatever changes I have made. It's a
bit tedious though. And oddly, once my app is running, no problems.

Any suggestions?


There might be an infinite redirect in your application that is
raising this error.

Can you find the location of this error, the full stack trace in the
log files may offer some clues.


Thanks,

John

Tomcat 6.10
windows 2000
Java 1.6


-Regards
Rashmi

-
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 timeout

2007-04-30 Thread Rashmi Rubdi

On 4/30/07, orn amental [EMAIL PROTECTED] wrote:

How do I limit the amount of messages I receive?


Please create a new thread instead of hijacking this one


I'd like to be able to turn on and off the reception of messages of the
mailing list without having to unsubscribe. Unfortunately the mailing list
FAQ email is empty.
Thanks a lot :)



-
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: Access logging, multiple web applications, single virtual host

2007-04-30 Thread Rashmi Rubdi

Hi Monica,

We are unable to see your message, instead we see a set of pipes |

It could be that your e-mail client is using Rich Text , please change
it to Plain Text and try again.

-Regards
Rashmi

On 4/27/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

   |
   |
   |
 Hello everyone,   |
   |
   |
 I am attempting to create access logs on a per web application basis, |
 using a single virtual host in my server.xml file. Here is what I have so|
 far:  |
   |
   |
  Host name=www.example.com autoDeploy=false  |
 deployOnStartup=false deployXML=false


-
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: setup

2007-04-30 Thread Rashmi Rubdi

Hi William,

On 4/30/07, William Biggs [EMAIL PROTECTED] wrote:

I just installed tomat 5.5 on my Fedora http://www.fedoraproject.org/ 5
box it is up and running . I would like to know how to add a user for the
admin page ?


Under  Tomcat's folder /conf/tomcat-users.xml is where the users are
defined. The file already contains entries that show examples of
syntax.


and aloso I would like to know where the webapps/ROOT/index.jsp
is ?



By default, it is under Tomcat's webapps/ROOT/ folder , in my instance
of Tomcat 5.5.x

Other possible location would be defined in the docBase of ROOT.xml
file , which may be located at Tomcat's conf/Catalina/[Host]/ROOT.xml

-Regards
Rashmi

-
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: Context started twice

2007-04-30 Thread Rashmi Rubdi

On 4/30/07, sc [EMAIL PROTECTED] wrote:


All my mistake. I apologize for my stupidity. It turns out it wasn't invoked
twice. It just prints twice. I had the following in log4j.properties.

log4j.rootLogger=ERROR, TRIP
log4j.logger.org.hibernate=WARN, TRIP
log4j.logger.net.sf.hibernate=INFO, TRIP
log4j.logger.com.cutetrip=DEBUG, TRIP


I would never have guessed that :-) , thanks for sharing your solution.


I commented out log4j.rootLogger and it prints only one init now.
Thanks for your help. This is my first time using nabble.com and surprised
to see how prompt I can get response. Thanks again.



-Cheers
Rashmi

-
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: setup

2007-04-30 Thread Rashmi Rubdi

Hi Chuck,

On 5/1/07, Caldarale, Charles R [EMAIL PROTECTED] wrote:

 From: Rashmi Rubdi [mailto:[EMAIL PROTECTED]
 Subject: Re: setup

  and aloso I would like to know where the webapps/ROOT/index.jsp
  is ?
 

 By default, it is under Tomcat's webapps/ROOT/ folder , in my instance
 of Tomcat 5.5.x

Well, not really.  The source to index.jsp is there, but the .jsp is
precompiled and the resulting class (what's really executed to generate
the default Tomcat home page) is in
webapps/ROOT/WEB-INF/lib/catalina-root.jar.  If you actually want to use
index.jsp, you must get rid of the jar and remove the servlet mapping in
webapps/ROOT/WEB-INF/web.xml.


You are right. I just looked at what appeared on the surface.

You've made a very good observation.


Note that in 6.0, index.jsp (and the jar)
is replaced by an index.html file.

 Other possible location would be defined in the docBase of ROOT.xml
 file , which may be located at Tomcat's conf/Catalina/[Host]/ROOT.xml

There is no conf/Catalina/[host]/ROOT.xml in a standard Tomcat download.

 - Chuck



-Regards
Rashmi

-
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: Context started twice

2007-04-29 Thread Rashmi Rubdi

On 4/29/07, sc [EMAIL PROTECTED] wrote:


There was a thread on this
http://www.nabble.com/Context-starts-twice-t1351694.html;. But my
configuration is a bit different.

this is my configuration:

server.xml doesn't have context definition.


Seems to me that the Context is defined in 2 places First:

context.xml is empty except this line
WatchedResourceWEB-INF/web.xml/WatchedResource



Second (modified) :


under $CATALINA_HOME/Catalina/localhost, I defined a context xml file,
trip.xml

?xml version='1.0' encoding='utf-8'?
Context docBase=d:/dev/trip/main/build path=
Resource name=jdbc/trip auth=Container
..
/Context



I would suggest moving
WatchedResourceWEB-INF/web.xml/WatchedResource also inside
trip.xml

And change the /META-INF/context.xml entry to Context/




In my web.xml, I have the following entry,

servlet
servlet-namedummy/servlet-name
servlet-classcom.trip.view.DummyServlet/servlet-class
 load-on-startup1/load-on-startup
/servlet

When DummyServlet starts, it init twice. Any help is appreciated.
--
View this message in context: 
http://www.nabble.com/Context-started-twice-tf3664516.html#a10239122
Sent from the Tomcat - User mailing list archive at Nabble.com.


-Rashmi

-
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: Context started twice

2007-04-29 Thread Rashmi Rubdi

Please ignore my previous post.

Sorry, when you mentioned context.xml I was thinking of the one
located under the project's META-INF folder.

Chuck is right, there's no need to move the contents of the
conf/context.xml file anywhere.

Whenever configuration gets messed up (happens very rarely), I
normally start with a fresh install of the zip version of Tomcat after
backing up the existing version. This process normally fixes my
problems quickly with little effort.

-Regards
Rashmi

On 4/29/07, sc [EMAIL PROTECTED] wrote:


I tried as you suggested. But didn't work. I have cleaned up tomcat
deployment directories and currently the configuration is very simple.

Under $CATALINA_HOME/webapps, there is only one directory ROOT.
Under $CATALINA_HOME/Catalina, there is  only one directory localhost,
which in turn only contains 1 file trip.xml

  ?xml version='1.0' encoding='utf-8'?
Context docBase=d:/dev/trip/main/build
   Resource name=jdbc/trip auth=Container
   type=javax.sql.DataSource
   username=sa
   password=x
   driverClassName=com.microsoft.jdbc.sqlserver.SQLServerDriver
   url=jdbc:microsoft:sqlserver://localhost:1433;databaseName=trip
   maxActive=8
   maxIdle=4/

   WatchedResourceWEB-INF/web.xml/WatchedResource
!-- Note: as suggested, I have moved the above entry from context.xml over
here. --
 Logger className=org.apache.catalina.logger.FileLogger
prefix=local_cutetrip. suffix=.log
 timestamp=true/

/Context

$CATALINA_HOME/conf/server.xml is as following:

Server port=8005 shutdown=SHUTDOWN

 Listener className=org.apache.catalina.core.AprLifecycleListener /
 Listener className=org.apache.catalina.mbeans.ServerLifecycleListener
/
 Listener
className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener /
 Listener
className=org.apache.catalina.storeconfig.StoreConfigLifecycleListener/

 GlobalNamingResources

   Environment name=simpleValue type=java.lang.Integer value=30/

   Resource name=UserDatabase auth=Container
 type=org.apache.catalina.UserDatabase
  description=User database that can be updated and saved
  factory=org.apache.catalina.users.MemoryUserDatabaseFactory
 pathname=conf/tomcat-users.xml /

 /GlobalNamingResources

 Service name=Catalina

   Connector port=8080 maxHttpHeaderSize=8192
  maxThreads=150 minSpareThreads=25 maxSpareThreads=75
  enableLookups=false redirectPort=8443 acceptCount=100
  connectionTimeout=2 disableUploadTimeout=true /

   Connector port=8009
  enableLookups=false redirectPort=8443 protocol=AJP/1.3
/

   Engine name=Catalina defaultHost=localhost

 Realm className=org.apache.catalina.realm.UserDatabaseRealm
resourceName=UserDatabase/


 Host name=localhost appBase=webapps
  unpackWARs=true autoDeploy=true
  xmlValidation=false xmlNamespaceAware=false

 /Host

   /Engine

 /Service

/Server

$CATALINA_HOME/conf/context.xml is:
Context
/Context




-
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: Keep session alive

2007-04-28 Thread Rashmi Rubdi

On 4/28/07, lightbulb432 [EMAIL PROTECTED] wrote:


Is it possible for a Tomcat session keep the session alive for a certain
period of time (say, 2 hours),


The session timeout interval is adjustable, see session-config under
conf/web.xml

Max inactive interval can also be specified in HttpSession object,
with setMaxInactiveInterval(int interval)

Additionally HttpSessionListener captures the event when the session
is about to be
invalidated -- according to JavaEE 5 API.


but remove all objects within it after a
default period of time (like half an hour)? This way the user doesn't have
to re-login as per your usual session timeout but their session state
doesn't eat up Tomcat memory.


I would consider setting a Cookie instead of storing login info in
HttpSession in this case.

One drawback with sessions is that, a session will not work if the web
page gets cached by the browser. So, in order to keep the session
alive, it is also important to prevent the caching of a page.

-Regards
Rashmi

-
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: Keep session alive

2007-04-28 Thread Rashmi Rubdi

On 4/28/07, lightbulb432 [EMAIL PROTECTED] wrote:


What would the cookie store?


A Cookie stores name, value pairs just like the Session. So you can
store anything in a Cookie.

But I think it may be a security concern to store the password in a Cookie.


Username and password, just username, or
something else? How can this be done in such a way as to prevent the user
from changing the value within the cookie?


The above can be tested --- clear all cookies in the browser, refer to
the Cookie in the JavaEE API -- set a cookie (name, value pair), see
if the browser's cookie that was just set could be tampered somehow.


Could you elaborate on what you meant by sessions not working when the
browser caches a page? If a user submits a form in a cached page, wouldn't
they still be directed to their same session on the server? (Whether the
session ID is stored in URL, cookie, or hidden form field.)


If the session id is stored in the URL, cookie or hidden field it may
be possible to access the session, if the page is cached by the
browser but I haven't tested it.


From my experience with sessions , the functionality implemented with

sessions stops working as soon as the page is cached by the browser.



Thanks.



-Regards
Rashmi

-
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: unexpected session behavior in Tomcat 5.x

2007-04-28 Thread Rashmi Rubdi

On 4/28/07, David [EMAIL PROTECTED] wrote:

I'm hoping someone can shed light on some session anomalies I'm seeing with
Tomcat 5.0.2.8 and Tomcat 5.5.23.

I have a web application containing FacesServlet (
javax.faces.webapp.FacesServlet) as well as some additional servlets that
also make use of the Faces Context.

The normal flow is:



1)   call into the FacesServlet for some work,

2)   invoke another servlet, ServletA, via doPost.  Within doPost images
are generated dynamically and the bytes are stored within a session.

3)   The response returns 1 or more URLs each of which will call back
ServletA via doGet to have the image data retrieved from the session and
streamed back to the client.  These URLs are created using the encodeURL
method on the response to attach the session id.



In one case step 1) does not require any session information to be created.
So when step 2) occurs a new session is created, and in step 3) within doGet
this session is correctly retrieved and things work beautifully.



However in another use case step 1) requires some information to be stored
in the session, so Session 1 is created.  When step 2) occurs, another
session, Session 2 is created.  The fact that Session 1 is not reused is the
first surprise.  When encodeURL is used in step 2), Session2's id is encoded
into the response URLs.  However in step 3), when the servlet's doGet is
called back, the session that is returned is Session 1 which of course does
not have the image bytes.  Of note, in step 3) the HttpServletRequest object
reports that the session is coming from a cookie, not the URL.


It could be possible that you configured Tomcat 5.0.2.8 and Tomcat
5.5.23 instances differently.

If you set the cookies attribute for your web application's Context to
true then the JSESIONID is stored in the browser as a cookie.

If cookies is set to false then jsessionid appears in the rewritten URL.

Reference: http://tomcat.apache.org/tomcat-5.5-doc/config/context.html



Any thoughts on what might be going on here?  My first thought is that this
is a bug in Tomcat. Guidance on how to further debug this issue, or come up
with a work-around is greatly appreciated.

David



-Regards
Rashmi

-
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: unexpected session behavior in Tomcat 5.x

2007-04-28 Thread Rashmi Rubdi

On 4/28/07, David [EMAIL PROTECTED] wrote:

Rashmi,

Thanks for your initial response.  I guess I wasn't clear on a few things.
The behavior I'm seeing is the same in both Tomcat 5.0 and 5.5, and they are
both configured the same -- using default behavior for cookies.


Sorry for repeating this, but just to be clear, in the above
statement, default behavior means that cookies=true.

This means that in the browser when cookies are enabled, JSESSION id
will be written to a cookie.


I should elaborate further and mention that the urlEncode method causes url
rewriting to occur.  So a cookie does not appear in my client browser
(verified with a cookie viewer for IE).  Despite this apparent lack of
client side cookie, when doGet is invoked in step 3) Tomcat exposes a cookie
object with the session id of Session1 off of the HttpServletRequest object


What happens if you set cookies=false ?


and has stripped off the Session 2 session id on the encoded URL from step
2).

David



-Regards
Rashmi

-
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: how to reload WEB-INF dir?

2007-04-28 Thread Rashmi Rubdi

On 4/28/07, Josh Joy [EMAIL PROTECTED] wrote:

Thanks for the info.

For my application, I am using Tapestry which uses
html templates which
I was having trouble to be reloaded by tomcat.


I don't know Tapestry, but when I write a normal JSP or HTML file, all
I have to do is press the browsers Refresh button, and I see the
latest changes I've made.


What I ended up doing was to write an ant hotdeploy
script to copy the
files to my tomcat installation then have ant invoke
the reload
command on tomcat.


Also, I keep my projects outside Tomcat's/ webapps folder and simply
configure the docBase attribute of the Context node to point my
project's folder and Tomcat finds it, when the {ApplicationName}.xml
or ROOT.xml containing the Context node is placed under
/conf/Catalina/[Host]/ folder.

The above set-up saves a lot of development effort and time because,
all that is required to see changes in JSP/Html is a browser refresh.


Thanks,
Josh


-Regards
Rashmi

-
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: unexpected session behavior in Tomcat 5.x

2007-04-28 Thread Rashmi Rubdi

On 4/28/07, David [EMAIL PROTECTED] wrote:

I've tried forcing the url rewriting behavior by deploying the following
snippet in a context.xml file in my webapp's META-INF directory.

Context path=/mywebapp debug=10 cookies=false

!-- Default set of monitored resources --
WatchedResourceWEB-INF/web.xml/WatchedResource

!-- Uncomment this to disable session persistence across Tomcat
restarts --
!--
Manager pathname= /
--

/Context

This provides a work-around under Tomcat 5.5, but does not change the
behavior seen under Tomcat 5.0.  And of course, Tomcat 5.0 is the version we
ship our product with. :)  I've also tried taking the snippet and adding it
to Tomcat 5.0's server.xml file, but that also does not force url rewriting.

So there seem to be two issues.  First, when url encoding produces cookies,
why does the request to the servlet in step 2) not transmit the cookie and
reuse the same original session, but it is sent and reused in step 3)?


I didn't see the behavior you're describing above when I conducted a small test.

What I see is that the exact same JSESSIONID is being passed between 3
different servlets, when URL Rewriting is used and cookies=false is
used. Also with this setting a cookie is not being written to the
browser at all.

Even when URL Rewriting is not used or when cookies=true , there is
exactly one JSESSIONID cookie in the browser.

I suspect that there might be something in the custom written code
that is probably invalidating the existing session, or removing the
attribute from the session or the session is timing out and a new one
is being created or the page is getting cached by the browser and
hence invalidating the session.

In my test case I set cookies=false in the definition of my
project's Context XML file and then I wrote the following 3 servlets:

--
FirstSessionServlet.java
--
package test84;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;

public class FirstSessionServlet extends HttpServlet {

   public void doPost(HttpServletRequest request, HttpServletResponse
response) throws IOException {
   processRequest(request,response);
   }

   public void doGet(HttpServletRequest request, HttpServletResponse
response) throws IOException {
   processRequest(request,response);
   }

   private void processRequest(HttpServletRequest request,
HttpServletResponse response) throws IOException {

   //Create a new session if it doesn't exist.
   HttpSession session = request.getSession(true);

   session.setAttribute(city,New York);

   String rewrittenUrl =
response.encodeRedirectURL(/SecondSessionServlet);
   System.out.println(FirstSesionServlet --- Rewritten URL:  +
rewrittenUrl);
   response.sendRedirect(rewrittenUrl);

   }
}

-
SecondSessionServlet.java
-
package test84;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpSession;
import java.io.IOException;

public class SecondSessionServlet extends HttpServlet {

   public void doPost(HttpServletRequest request, HttpServletResponse
response) throws IOException {
   processRequest(request, response);
   }

   public void doGet(HttpServletRequest request, HttpServletResponse
response) throws IOException {
   processRequest(request, response);
   }

   private void processRequest(HttpServletRequest request,
HttpServletResponse response) throws IOException {

   //Get existing session, don't create a new one
   HttpSession session = request.getSession(false);
   System.out.println(SecondSessionServlet Is session new?  +
session.isNew());

   String city = (String)session.getAttribute(city);
   System.out.println(Get session attribute city:  + city);

   String rewrittenUrl =
response.encodeRedirectURL(/ThirdSessionServlet);
   System.out.println(SecondSessionServlet --- Rewritten URL: 
+ rewrittenUrl);
   response.sendRedirect(rewrittenUrl);
   }
}

---
ThirdSessionServlet.java
---
package test84;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpSession;

public class ThirdSessionServlet extends HttpServlet {

   public void 

Re: unexpected session behavior in Tomcat 5.x

2007-04-28 Thread Rashmi Rubdi

The above test was conducted on the Tomcat version I have which is not 5.0.

If you check your code throughly and the problem still occurs in 5.0,
you may want to file a bug --- only if you're sure it's a bug ---
otherwise it will not be resolved , if it's not a bug :-)

-Regards
Rashmi

-
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 compression

2007-04-27 Thread Rashmi Rubdi

On 4/27/07, Rajiv M [EMAIL PROTECTED] wrote:

Is there a testcase/sample app where I can see the difference of
enabling/disabling HTTP compression.


DIY :-)

-Rashmi

-
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: Defining data-sources in tomcat

2007-04-27 Thread Rashmi Rubdi

On 4/27/07, albrecht andrzejewski [EMAIL PROTECTED] wrote:


 3) In my servlet init(), I lookup the data-source. Each lookup essentially
 instantiates an instance of the data-source. So a connection pool gets
 instantiated in each servlet's init.

 Now it doesn't make sense to create a new connection pool in each servlet.
 So I'd like to create a single connection pool that will be used by all
 servlets. I've been looking thru the tomcat docs, to see where I could
 create this central resource for my webapp. The only option I've seen so far
 is to create my own life-cycle listener for my webapp. That way I can create
 a connection pool on start-up. I was wondering if there was a better way to
 do this ?

It's actually your container which create the connection pool and not
your servlet. What you do when you are looking up is just finding a
reference to the pre-existing datasource. So don't worry


Hi Ali,

Thank you for the above post, I agree with it.

Normally one has to write the following lines to get the database
connection from the connection pool:

Context initContext = new InitialContext(); //(1)
Context envContext  = 
(Context)initContext.lookup(java:/comp/env); //(2)
DataSource ds = (DataSource)envContext.lookup(jdbc/TestDB); //(3)
conn = ds.getConnection(); //(4)

I think most people try to initialize the DataSource object in the
above code, when Tomcat starts up and they only wan to get the ds
object in a DAO class before creating a new connection from the
connection pool.

I think Srinivas wants to create the ds object when Tomcat starts up
and re-use the ds object in the DAO class instead of re-creating it
each time he needs it inside a DAO.


and please do
not write your own lifecycle :-)

Regards, Ali.


-Regards
Rashmi

-
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: how to reload WEB-INF dir?

2007-04-27 Thread Rashmi Rubdi

On 4/27/07, Josh Joy [EMAIL PROTECTED] wrote:

Hi,

There is a reloadable attribute that I can set to true


Yes there is, see
http://tomcat.apache.org/tomcat-6.0-doc/config/context.html


to reload if it
detects a change in |/WEB-INF/classes/| and
|/WEB-INF/lib.
My question is, how can I reload if I make a change to
files in /WEB-INF
directory?

Thanks,
Josh


-Rashmi

-
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: Defining data-sources in tomcat

2007-04-27 Thread Rashmi Rubdi

On 4/27/07, Srinivas V. [EMAIL PROTECTED] wrote:

Hello all

I have a question about defining data-sources in tomcat. I have a webapp in
which my servlets need to talk to a DB. This is my current setup:

1) I define data-sources (c3p0 connection pools) using the Resource tag in
my META-INF/context.xml.
2) The web.xml has references these data-sources via resource-env-ref tags
3) In my servlet init(), I lookup the data-source. Each lookup essentially
instantiates an instance of the data-source. So a connection pool gets
instantiated in each servlet's init.

Now it doesn't make sense to create a new connection pool in each servlet.
So I'd like to create a single connection pool that will be used by all
servlets. I've been looking thru the tomcat docs, to see where I could
create this central resource for my webapp. The only option I've seen so far
is to create my own life-cycle listener for my webapp. That way I can create
a connection pool on start-up.


I've seen people using ServletContextListener instead of
LifeCycleListener. That way you don't have to write your own listener.

contextInitialized() method is invoked when Tomcat starts or re-loads.

Reference: 
http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletContextListener.html

You may already know that the listener must be registered in web.xml
under a listener tag.


I was wondering if there was a better way to
do this ?

   Thanks

  Srinivas



-Regards
Rashmi

-
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: how to reload WEB-INF dir?

2007-04-27 Thread Rashmi Rubdi

On 4/27/07, Josh Joy [EMAIL PROTECTED] wrote:

Hi Rashmi,

I'm confused...so in tomcat 6.0 it reloads if it
detects a change at the
root /WEB-INF rather than solely /WEB-INF/classes or
/WEB-INF/lib ?


Hi Josh,

reloadable is an attributed on the Context node of your web application.

The basic concept is that each web application corresponds to one
Context and is located under a Host.

So for your application there has to be a corresponding Context node
either in server.xml or as {ApplicaitonName}.xml file under
TomcatFolder/conf/[Engine]/[Host]/

Please locate the Context of your application (depending on where you
configured it), and add the attribute reloadable=true to it.
Re-start Tomcat just one time, after that whenever you re-compile your
classes or make changes to the JAR files under /WEB-INF/ , Tomcat will
automatically re-load.

It would be helpful to know which version of Tomcat you're using as
some attributes are not supported in certain older versions of Tomcat.
But for the sake of reference I assumed the latest version.

Hope this helps.

-Rashmi

-
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: Defining data-sources in tomcat

2007-04-27 Thread Rashmi Rubdi

On 4/27/07, Srinivas V. [EMAIL PROTECTED] wrote:

Thanks for all the responses on this. The basic doubt I had was whether the
JNDI lookup would create a new data-source on each lookup or just return the
previously created one. A number of you had said that the latter was true.
The reason I wasn't sure about that was because I'm creating C3P0
ComboPooledDataSource objects using the BeanFactory factory. And the docs
here state that each lookup creates a new bean, which in my case is a new
data-source:
http://tomcat.apache.org/tomcat-5.5-doc/jndi-resources-howto.html#Generic%20
JavaBean%20Resources

I decided to test this by adding some logging in the various servlet init()
methods to dump the C3P0 object returned from the lookup. The log output
suggests that the same object is being returned back i.e. only one
ComboPoolDataSource object is being used by both servlets. This is good for
me. But it doesn't explain the discrepancy with the docs.


Hi Srinivas,

I don't see any discrepancy based on David's point in the above post:
MyBean bean = (MyBean) envCtx.lookup(bean/MyBeanFactory);  , doesn't
create a new
bean.


FYI: I refer to this doc:
http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html
specifically for JDBC Connection pooling , instead of the above link
you referenced as it closely concerns with JDBC and not general JNDI.
But both documents are good.



   Srinivas


-Regards
Rashmi

-
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: Defining data-sources in tomcat

2007-04-27 Thread Rashmi Rubdi

On 4/27/07, David Smith [EMAIL PROTECTED] wrote:

But the code you posted does not create a new DataSource object.  It
just gets a reference to an existing one stored in JNDI.  Nothing new
about the DataSource object.  Note the lack of a new operator.


Good post, thank you for pointing this.

The only new operator concerning the snippet that obtains a ds object
I see in my code is:
Context initContext = new InitialContext(); //(1)

Just to clarify, the consensus from this thread is that there's no
need to create a DataSource object when Tomcat starts up.

Regards
-Rashmi

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



  1   2   3   4   >