Tomcat 6.0.18 error 405

2009-01-23 Thread bigtoto

hi,
when i'm trying to visualize a wsdl file through the URL
http://localhost:8080/activation-service/activationService.wsdl 
i have the error 405.
PS: my application is webservice developped using spring2.5
-- 
View this message in context: 
http://www.nabble.com/Tomcat-6.0.18-error-405-tp21620289p21620289.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



How to prevent direct ip address

2009-01-23 Thread Jaakko Taipale
I have specified domain eg. www.myapp.com and I have tomcat running my
machine that have IP address 123.123.123.123. Now I can access to my app
with two address:
 
http://www.myapp.com/myapp or
http://123.123.123.123/myapp
 
How can I prevent tomcat to response when somebody is trying to access with
direct ip?
 
--
Jaakko


RE: PostgreSQL vs MySQL with Tomcat

2009-01-23 Thread Peter Crowther
 From: Jonathan Mast [mailto:jhmast.develo...@gmail.com]
 Sure we can argue about which DBMS has the fastest JOINs but
 nonetheless it
 remains that JOIN queries will always be computationally
 expensive compared to single table queries.

Depends what you do with the results of those single table queries :-).  I saw 
one application (mid-1990s) that used SELECT * FROM table to bring two 10M row 
tables into memory, then did O(n^2) comparisons between the keys to obtain data 
from both.  When asked, the developer said he didn't understand joins in the 
database so did it the easy way.

I'd hope developers are aware of computational complexity, load on different 
components, and the reponse time and throughput constraints on the application, 
and that they code appropriately rather than following dogma of the form X 
will always be expensive compared to Y.  I've been surprised (rather too many 
times) when the will always be has turned out to be false.

- Peter

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: PostgreSQL vs MySQL with Tomcat

2009-01-23 Thread Chris Wareham

Jonathan Mast wrote:

Perhaps the discussion should move back towards how Tomcat interacts with
databases.



It would be more on topic, but a well architected web application will
have a data access layer that is not dependent on the Servlet API, both
for testability and reusability. While a data source may be configured
in Tomcat, the correct use of dependency injection would mean that the
data access layer shouldn't be concerned where the data source comes
from. To reiterate, database interaction is an architectural issue, not
a web container one.


This thread seems to be damning MySQL for not having super advanced
features, some of which should perhaps not even be in the purview of the
database layer, but more appropriately belong at the application layer (ie.
Tomcat).



No, many people damn MySQL for it's lack of standards conformance and
idiosyncracies that make it harder to maintain data integrity. I am
particularly wary of MySQL because of the way missing features have been
disingenuously described as unnecessary, and broken features as the
MySQL developers knowing better than everyone else.


For example, I rewrote a report generator for my company.  The existing
generator, a PHP + MySQL setup, was insanely slow and difficult to maintain
being that it consisted of 1 php page containing hundreds of lines of code.
I rewrote it in jsp + POJO and the new version runs much faster, because it
doesn't have a single query with a JOIN clause in it.  The old generator had
super complex queries that took forever to run and placed an enormous amount
of load on the database server.  I achieved that same result of a JOIN by
pushing that functionality up to the Java layer.

Sure we can argue about which DBMS has the fastest JOINs but nonetheless it
remains that JOIN queries will always be computationally expensive compared
to single table queries.

Well thats my 2 cents :)



By it's very definition (see Codd or Date), an RDBMS should be capable
of performing joins with good performance. MySQL often struggles to do
so thanks to the poor optimiser, so you had to implement what should be
core functionality of an RDBMS in your application layer. Great. Did you
try explaining those queries to find out if reordering the joins would
give the performance you were looking for? Or is MySQL the only database
you are familiar with? This is the problem with much of the LAMP crowd -
they've never tried anything else, so when they hit this kind of problem
they assume it's a limitation of the kind of tools they are using, not
of the specific tools themselves.

Chris
--

Chris Wareham
Senior Software Engineer
Visit London Ltd
6th floor,
2 More London Riverside, London SE1 2RR

Tel:  +44 (0)20 7234 5848
Fax: +44 (0)20 7234 5753


www.visitlondon.com





  
  
'Visit London Limited' is registered in England under No.761149;

Registered Office: Visit London, 2 More London Riverside, London SE1 2RR.


Visit London is the official visitor organisation for London. Visit London is 
partly funded by Partnership, the Mayor's London Development Agency and London 
Councils.
The information contained in this e-mail is confidential and intended for the 
named recipient(s) only.  If you have received it in error, please notify the 
sender immediately and then delete the message.  If you are not the intended 
recipient, you must not use, disclose, copy or distribute this email. The views 
expressed in this e-mail are those of the individual and not of Visit London. 
We reserve the right to read and monitor any email or attachment entering or 
leaving our systems without prior notice.

 Please don't print this e-mail unless you really need to.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: PostgreSQL vs MySQL with Tomcat

2009-01-23 Thread Peter Stavrinides
when they hit this kind of problem
they assume it's a limitation of the kind of tools they are using
Exactly, mostly its a suboptimal implementation of these technologies

Our core business is reporting with complex risk modeling, we do intensive risk 
calculations on raw data using complex joins on millions of rows of data using 
page long SQL queries at time, and they do just fine on Postgres (milliseconds 
to a few seconds at worst). Occasionally we use some C functions when speed is 
an issue, but SQL joins are *hardley a bottleneck.

Peter  

- Original Message -
From: Chris Wareham cware...@visitlondon.com
To: Tomcat Users List users@tomcat.apache.org
Sent: Friday, 23 January, 2009 12:45:58 GMT +02:00 Athens, Beirut, Bucharest, 
Istanbul
Subject: Re: PostgreSQL vs MySQL with Tomcat

Jonathan Mast wrote:
 Perhaps the discussion should move back towards how Tomcat interacts with
 databases.
 

It would be more on topic, but a well architected web application will
have a data access layer that is not dependent on the Servlet API, both
for testability and reusability. While a data source may be configured
in Tomcat, the correct use of dependency injection would mean that the
data access layer shouldn't be concerned where the data source comes
from. To reiterate, database interaction is an architectural issue, not
a web container one.

 This thread seems to be damning MySQL for not having super advanced
 features, some of which should perhaps not even be in the purview of the
 database layer, but more appropriately belong at the application layer (ie.
 Tomcat).
 

No, many people damn MySQL for it's lack of standards conformance and
idiosyncracies that make it harder to maintain data integrity. I am
particularly wary of MySQL because of the way missing features have been
disingenuously described as unnecessary, and broken features as the
MySQL developers knowing better than everyone else.

 For example, I rewrote a report generator for my company.  The existing
 generator, a PHP + MySQL setup, was insanely slow and difficult to maintain
 being that it consisted of 1 php page containing hundreds of lines of code.
 I rewrote it in jsp + POJO and the new version runs much faster, because it
 doesn't have a single query with a JOIN clause in it.  The old generator had
 super complex queries that took forever to run and placed an enormous amount
 of load on the database server.  I achieved that same result of a JOIN by
 pushing that functionality up to the Java layer.
 
 Sure we can argue about which DBMS has the fastest JOINs but nonetheless it
 remains that JOIN queries will always be computationally expensive compared
 to single table queries.
 
 Well thats my 2 cents :)
 

By it's very definition (see Codd or Date), an RDBMS should be capable
of performing joins with good performance. MySQL often struggles to do
so thanks to the poor optimiser, so you had to implement what should be
core functionality of an RDBMS in your application layer. Great. Did you
try explaining those queries to find out if reordering the joins would
give the performance you were looking for? Or is MySQL the only database
you are familiar with? This is the problem with much of the LAMP crowd -
they've never tried anything else, so when they hit this kind of problem
they assume it's a limitation of the kind of tools they are using, not
of the specific tools themselves.

Chris
--
 
Chris Wareham
Senior Software Engineer
Visit London Ltd
6th floor,
2 More London Riverside, London SE1 2RR
 
Tel:  +44 (0)20 7234 5848
Fax: +44 (0)20 7234 5753

 
www.visitlondon.com





   
   
'Visit London Limited' is registered in England under No.761149;
Registered Office: Visit London, 2 More London Riverside, London SE1 2RR.
 

Visit London is the official visitor organisation for London. Visit London is 
partly funded by Partnership, the Mayor's London Development Agency and London 
Councils.
The information contained in this e-mail is confidential and intended for the 
named recipient(s) only.  If you have received it in error, please notify the 
sender immediately and then delete the message.  If you are not the intended 
recipient, you must not use, disclose, copy or distribute this email. The views 
expressed in this e-mail are those of the individual and not of Visit London. 
We reserve the right to read and monitor any email or attachment entering or 
leaving our systems without prior notice.
 
  Please don't print this e-mail unless you really need to.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: How to prevent direct ip address

2009-01-23 Thread Kees de Kooter
You could create two virtual hosts, one 'default' that displays some
error page and one for your domain that displays the app.

Kees

On Fri, Jan 23, 2009 at 10:52, Jaakko Taipale
jaakko.taip...@dbmanager.fi wrote:
 I have specified domain eg. www.myapp.com and I have tomcat running my
 machine that have IP address 123.123.123.123. Now I can access to my app
 with two address:

 http://www.myapp.com/myapp or
 http://123.123.123.123/myapp

 How can I prevent tomcat to response when somebody is trying to access with
 direct ip?

 --
 Jaakko


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: PostgreSQL vs MySQL with Tomcat

2009-01-23 Thread Leon Rosenberg
On Fri, Jan 23, 2009 at 11:45 AM, Chris Wareham
cware...@visitlondon.com wrote:

 By it's very definition (see Codd or Date), an RDBMS should be capable
 of performing joins with good performance. MySQL often struggles to do
 so thanks to the poor optimiser, so you had to implement what should be
 core functionality of an RDBMS in your application layer.

Sorry, but by the very definition JOINs are slow, and no database in
the world will ever be able to make them fast :-)
Avoiding JOINs is often a good architectural advice (taking in account
a previous post of the contrary).

For example if you need all orders by user with name Chris, you will
ALWAYS be faster if you first retrieve the userid, and than the orders
of the userid.

No query optimizer in the world can perform better than the develop,
simply because it lacks the knowledge a good developer should have
about the semantic of his application.

my 2 cent as an addition to Jonathan's 2, make it 4 against the joins :-)

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: PostgreSQL vs MySQL with Tomcat

2009-01-23 Thread Jim Cox
On Fri, Jan 23, 2009 at 6:23 AM, Leon Rosenberg 
rosenberg.l...@googlemail.com wrote:

 On Fri, Jan 23, 2009 at 11:45 AM, Chris Wareham
 cware...@visitlondon.com wrote:

  By it's very definition (see Codd or Date), an RDBMS should be capable
  of performing joins with good performance. MySQL often struggles to do
  so thanks to the poor optimiser, so you had to implement what should be
  core functionality of an RDBMS in your application layer.

 Sorry, but by the very definition JOINs are slow, and no database in
 the world will ever be able to make them fast :-)
 Avoiding JOINs is often a good architectural advice (taking in account
 a previous post of the contrary).

 For example if you need all orders by user with name Chris, you will
 ALWAYS be faster if you first retrieve the userid, and than the orders
 of the userid.

 No query optimizer in the world can perform better than the develop,
 simply because it lacks the knowledge a good developer should have
 about the semantic of his application.

 my 2 cent as an addition to Jonathan's 2, make it 4 against the joins :-)


I'm hoping this is an attempt at sarcasm or humor (or even trolling), but
part of me fears that it isn't...


Re: PostgreSQL vs MySQL with Tomcat

2009-01-23 Thread Chris Wareham

Leon Rosenberg wrote:

On Fri, Jan 23, 2009 at 11:45 AM, Chris Wareham
cware...@visitlondon.com wrote:


By it's very definition (see Codd or Date), an RDBMS should be capable
of performing joins with good performance. MySQL often struggles to do
so thanks to the poor optimiser, so you had to implement what should be
core functionality of an RDBMS in your application layer.


Sorry, but by the very definition JOINs are slow, and no database in
the world will ever be able to make them fast :-)
Avoiding JOINs is often a good architectural advice (taking in account
a previous post of the contrary).

For example if you need all orders by user with name Chris, you will
ALWAYS be faster if you first retrieve the userid, and than the orders
of the userid.



So you perform two queries from the application layer? You are basically
doing a join by hand - the cost of those two round trips to the database
will lose to a single query with a join, unless you've not setup
adequate indexes and your tables have a huge number of rows in them.


No query optimizer in the world can perform better than the develop,
simply because it lacks the knowledge a good developer should have
about the semantic of his application.



Yes, and occasionally I can produce better assembler code than my C
compiler. However, in your case you're ignoring the fact that any RDBMS
worth its salt is going to have cached a lot of data in memory, in a way
that is likely to be as fast to access if not faster than the same data
cached and accessed at the application layer.

In the system I currently work on, there was a gem of a code comment by
a previous developer that said something like perform these queries
separately as the database cannot optimise them. Normalising the tables
meant the database could. If your joins are costing you so much
performance, then I'd humbly suggest your database design is screwed.


my 2 cent as an addition to Jonathan's 2, make it 4 against the joins :-)



Sadly your four cents aren't even legal tender here ;-)

Chris
--

Chris Wareham
Senior Software Engineer
Visit London Ltd
6th floor,
2 More London Riverside, London SE1 2RR

Tel:  +44 (0)20 7234 5848
Fax: +44 (0)20 7234 5753


www.visitlondon.com





  
  
'Visit London Limited' is registered in England under No.761149;

Registered Office: Visit London, 2 More London Riverside, London SE1 2RR.


Visit London is the official visitor organisation for London. Visit London is 
partly funded by Partnership, the Mayor's London Development Agency and London 
Councils.
The information contained in this e-mail is confidential and intended for the 
named recipient(s) only.  If you have received it in error, please notify the 
sender immediately and then delete the message.  If you are not the intended 
recipient, you must not use, disclose, copy or distribute this email. The views 
expressed in this e-mail are those of the individual and not of Visit London. 
We reserve the right to read and monitor any email or attachment entering or 
leaving our systems without prior notice.

 Please don't print this e-mail unless you really need to.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



403 on https connection but not http

2009-01-23 Thread Emsley, I (Iain)
Hi, 

 

I'm trying to get https:// working on an application running on Tomcat
5.5.23 on Windows Server 2003. When I ran the application on port 8080,
it logged me in fine using our login filters, however when I moved to
https://, the application returns 403 without any messages being written
to stdout or logging messages that I've put in the filters to try and
debug them if needs be. 

 

I've set up the connector in server.xml like:

Connector port=8443 maxHttpHeaderSize=8192

   maxThreads=500 minSpareThreads=25
maxSpareThreads=75

   enableLookups=false disableUploadTimeout=true

   acceptCount=100 scheme=https secure=true

   clientAuth=false sslProtocol=TLS  proxyPort=443

   proxyName=localhost


   keystoreFile=/file/path/

 

I've set security-constraints in the web.xml file  like so:

security-constraint

web-resource-collection

  web-resource-nameApplication/web-resource-name

  descriptionApplication user/description

  url-pattern/*/url-pattern

/web-resource-collection

auth-constraint

  role-name*/role-name

/auth-constraint

user-data-constraint

  descriptionno description/description

  transport-guaranteeCONFIDENTIAL/transport-guarantee

/user-data-constraint

  /security-constraint

 

I've defined the roles as well for this application but  still no joy. 

 

Like the Yale CAS filter project, my filters read roles from the
application's web.xml file. Would https:// prevent this?

 

Thanks in advance for any pointers and advice. 

 

Iain

 

 


-- 
Scanned by iCritical.



RE: PostgreSQL vs MySQL with Tomcat

2009-01-23 Thread Peter Crowther
Leon, it's rare for me to disagree with you, but...

 From: Leon Rosenberg [mailto:rosenberg.l...@googlemail.com]
 For example if you need all orders by user with name Chris, you will
 ALWAYS be faster if you first retrieve the userid, and than the orders
 of the userid.

... I disagree and can produce at least one counterexample.

Performing two queries from the application layer requires two parses, two 
optimise steps, at least two more context switches on a single-core machine, 
two sets of serialisation of query and results, potentially more network 
traffic and latency... all extra cycles and resource utilisation that are 
avoided if the combined query is sent to the DBMS and executed there.  Against 
those, you have to balance more complex parse and optimise times for the single 
query, plus the extra time to locate the data (which may or may not be in cache 
at the server).

Back in 1992, I had exactly this situation on a Sybase 4.2 server on a 
SPARCstation 1 running SunOS.  I profiled both implementations, and the single 
query case came back about 30% faster (I was only concerned about wallclock 
time so didn't check memory or CPU).  That was with Sybase's relatively 
primitive optimiser.  With a good query optimiser plus query plan caching and 
data caching, a modern SQL Server can do better and can find the savings in 
more cases.

I suggest losing the dogma and profiling it with *your* data in *your* 
environment :-).  You might be surprised.

- Peter

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: PostgreSQL vs MySQL with Tomcat

2009-01-23 Thread Leon Rosenberg
On Fri, Jan 23, 2009 at 12:36 PM, Chris Wareham
cware...@visitlondon.com wrote:
 Leon Rosenberg wrote:

 On Fri, Jan 23, 2009 at 11:45 AM, Chris Wareham
 cware...@visitlondon.com wrote:

 By it's very definition (see Codd or Date), an RDBMS should be capable
 of performing joins with good performance. MySQL often struggles to do
 so thanks to the poor optimiser, so you had to implement what should be
 core functionality of an RDBMS in your application layer.

 Sorry, but by the very definition JOINs are slow, and no database in
 the world will ever be able to make them fast :-)
 Avoiding JOINs is often a good architectural advice (taking in account
 a previous post of the contrary).

 For example if you need all orders by user with name Chris, you will
 ALWAYS be faster if you first retrieve the userid, and than the orders
 of the userid.


 So you perform two queries from the application layer? You are basically
 doing a join by hand - the cost of those two round trips to the database
 will lose to a single query with a join, unless you've not setup
 adequate indexes and your tables have a huge number of rows in them.

two round trips to the database yes, in theory.
The other side of the medal is that i can separate both data entities
in different services (where they belong to),
i can even hold them in different type of media, i can cache username
to userid extremely efficient, which the db never could,
and I don't depend on how this db implementation is tuned, and not bound to it.


 No query optimizer in the world can perform better than the develop,
 simply because it lacks the knowledge a good developer should have
 about the semantic of his application.


 Yes, and occasionally I can produce better assembler code than my C
 compiler. However, in your case you're ignoring the fact that any RDBMS
 worth its salt is going to have cached a lot of data in memory, in a way
 that is likely to be as fast to access if not faster than the same data
 cached and accessed at the application layer.

i highly doubt is, cause a local access to memory in the vm is
1.000.000 faster than an access over the net, even in the GBit
network.



 In the system I currently work on, there was a gem of a code comment by
 a previous developer that said something like perform these queries
 separately as the database cannot optimise them. Normalising the tables
 meant the database could. If your joins are costing you so much
 performance, then I'd humbly suggest your database design is screwed.

 my 2 cent as an addition to Jonathan's 2, make it 4 against the joins :-)


 Sadly your four cents aren't even legal tender here ;-)


My 4 cent may be placed in the wrong place, but basically, from 10
years online portals building (and i mean high-performance, 24/7, with
millions of users) if your design relies on a join in the database in
the production system, you've done something wrong.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



How to enforece status like manager authentication for my web app?

2009-01-23 Thread kaprasi

Hi,

I have written a simple web-app and I have deployed it in tomcat-6.0.18.
I want to ensure that a particular jsp file can't be accessed directly.
As in, in the tomcat page (http://localhost:8080/) on the left side there is
a link titled Status.
Clicking on which brings up a log-in dialog.
I want the same thing to happen if someone tries to access test.jsp
directly.

I added the following role to tomcat-users.xml :

role rolename=manager/
user username=tomcat password=s3cret roles=manager/

I also added auth-constraint to my web.xml but still it is possible to
access the jsp directly by this url :
http://localhost:8080/myApp/jsp/test.jsp where as I expect the jsp page to
come up only when following url is keyed in :
http://localhost:8080/myApp/first

What should I do in order to force user to go through the
user-authentication?

Thanks in advance.

The war contents are like this :

META-INF/
META-INF/MANIFEST.MF
WEB-INF/
WEB-INF/web.xml
WEB-INF/lib/
WEB-INF/lib/servlet-api.jar
WEB-INF/classes/
WEB-INF/classes/com/
WEB-INF/classes/com/myComp/
WEB-INF/classes/com/myComp/MyServlet.class
jsp/
jsp/myfile.jsp
jsp/some.jsp
jsp/test.jsp
jsp/welcome.jsp

And the web.xml looks like this : 

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

web-app
 display-nameJ2EE Examples Application/display-name
  !-- Standard Action Servlet Configuration (with debugging) --
  servlet
servlet-nameMyServlet/servlet-name
servlet-classcom.myComp.MyServlet/servlet-class
  /servlet

  !-- Standard Action Servlet Mapping --
  servlet-mapping
servlet-nameMyServlet/servlet-name
url-pattern/first/url-pattern
  /servlet-mapping

  security-constraint

web-resource-collection
url-pattern/jsp/test.jsp/url-pattern
/web-resource-collection

auth-constraint
role-namemanager/role-name
/auth-constraint

  /security-constraint

   security-role
description
   The role that is required to log in to the Manager Application
/description
role-namemanager/role-name
   /security-role

/web-app
-- 
View this message in context: 
http://www.nabble.com/How-to-enforece-status-like-manager-authentication-for-my-web-app--tp21623099p21623099.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: PostgreSQL vs MySQL with Tomcat

2009-01-23 Thread Chris Wareham

Leon Rosenberg wrote:

On Fri, Jan 23, 2009 at 12:36 PM, Chris Wareham
cware...@visitlondon.com wrote:



So you perform two queries from the application layer? You are basically
doing a join by hand - the cost of those two round trips to the database
will lose to a single query with a join, unless you've not setup
adequate indexes and your tables have a huge number of rows in them.


two round trips to the database yes, in theory.
The other side of the medal is that i can separate both data entities
in different services (where they belong to),
i can even hold them in different type of media, i can cache username
to userid extremely efficient, which the db never could,
and I don't depend on how this db implementation is tuned, and not bound to it.



Reread my last message, and take a look at the internals of any half
decent RDBMS. Frequently accessed data will get cached in memory, and
the cost of many joins will be less than the cost of a hash table lookup
in Java. Not that caching at the application layer is relevant, because
you were talking about performing two queries in the place of one with a
join.


No query optimizer in the world can perform better than the develop,
simply because it lacks the knowledge a good developer should have
about the semantic of his application.


Yes, and occasionally I can produce better assembler code than my C
compiler. However, in your case you're ignoring the fact that any RDBMS
worth its salt is going to have cached a lot of data in memory, in a way
that is likely to be as fast to access if not faster than the same data
cached and accessed at the application layer.


i highly doubt is, cause a local access to memory in the vm is
1.000.000 faster than an access over the net, even in the GBit
network.



As pointed out above, memory access at the application layer is
irrelevant to a discussion where you had posited that two database
queries were less costly than one with a join.




In the system I currently work on, there was a gem of a code comment by
a previous developer that said something like perform these queries
separately as the database cannot optimise them. Normalising the tables
meant the database could. If your joins are costing you so much
performance, then I'd humbly suggest your database design is screwed.


my 2 cent as an addition to Jonathan's 2, make it 4 against the joins :-)


Sadly your four cents aren't even legal tender here ;-)



My 4 cent may be placed in the wrong place, but basically, from 10
years online portals building (and i mean high-performance, 24/7, with
millions of users) if your design relies on a join in the database in
the production system, you've done something wrong.



If we're into pointless dick swinging, then on the criteria you've just
described I win.

Chris
--

Chris Wareham
Senior Software Engineer
Visit London Ltd
6th floor,
2 More London Riverside, London SE1 2RR

Tel:  +44 (0)20 7234 5848
Fax: +44 (0)20 7234 5753


www.visitlondon.com





  
  
'Visit London Limited' is registered in England under No.761149;

Registered Office: Visit London, 2 More London Riverside, London SE1 2RR.


Visit London is the official visitor organisation for London. Visit London is 
partly funded by Partnership, the Mayor's London Development Agency and London 
Councils.
The information contained in this e-mail is confidential and intended for the 
named recipient(s) only.  If you have received it in error, please notify the 
sender immediately and then delete the message.  If you are not the intended 
recipient, you must not use, disclose, copy or distribute this email. The views 
expressed in this e-mail are those of the individual and not of Visit London. 
We reserve the right to read and monitor any email or attachment entering or 
leaving our systems without prior notice.

 Please don't print this e-mail unless you really need to.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: How to prevent direct ip address

2009-01-23 Thread Markus Schönhaber
Jaakko Taipale:

 I have specified domain eg. www.myapp.com and I have tomcat running my
 machine that have IP address 123.123.123.123. Now I can access to my app
 with two address:
  
 http://www.myapp.com/myapp or
 http://123.123.123.123/myapp
  
 How can I prevent tomcat to response when somebody is trying to access with
 direct ip?

If your Tomcat listens on 123.123.123.123 then you can't prevent it from
responding.
What you can do is create an additional Host with it's name attribute
set to 123.123.123.123 and make sure that myapp isn't deployed to this
Host's appBase. Then someone accessing
http://123.123.123.123/myapp
would only get an error message. Or you could deploy a webapp there
which does nothing else than redirect the client to
http://www.myapp.com/myapp

Alternatively, configuring a RemoteHostValve might work too.

Regards
  mks

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: How to enforece status like manager authentication for my web app?

2009-01-23 Thread Pid
kaprasi wrote:
 Hi,
 
 I have written a simple web-app and I have deployed it in tomcat-6.0.18.
 I want to ensure that a particular jsp file can't be accessed directly.
 As in, in the tomcat page (http://localhost:8080/) on the left side there is
 a link titled Status.
 Clicking on which brings up a log-in dialog.
 I want the same thing to happen if someone tries to access test.jsp
 directly.
 
 I added the following role to tomcat-users.xml :
 
 role rolename=manager/
 user username=tomcat password=s3cret roles=manager/
 
 I also added auth-constraint to my web.xml but still it is possible to
 access the jsp directly by this url :
 http://localhost:8080/myApp/jsp/test.jsp where as I expect the jsp page to
 come up only when following url is keyed in :
 http://localhost:8080/myApp/first
 
 What should I do in order to force user to go through the
 user-authentication?

you need to define a login-config config section too.
google for some examples on how to do this.

 Thanks in advance.
 
 The war contents are like this :
 
 META-INF/
 META-INF/MANIFEST.MF
 WEB-INF/
 WEB-INF/web.xml
 WEB-INF/lib/
 WEB-INF/lib/servlet-api.jar

remove the above line, it is not necessary and will likely cause your
app to demonstrate unpredictable behaviour.

p


 WEB-INF/classes/
 WEB-INF/classes/com/
 WEB-INF/classes/com/myComp/
 WEB-INF/classes/com/myComp/MyServlet.class
 jsp/
 jsp/myfile.jsp
 jsp/some.jsp
 jsp/test.jsp
 jsp/welcome.jsp
 
 And the web.xml looks like this : 
 
 ?xml version=1.0 encoding=iso-8859-1?
   !DOCTYPE web-app PUBLIC
 -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN
 http://java.sun.com/dtd/web-app_2_3.dtd;
 
 web-app
  display-nameJ2EE Examples Application/display-name
   !-- Standard Action Servlet Configuration (with debugging) --
   servlet
 servlet-nameMyServlet/servlet-name
 servlet-classcom.myComp.MyServlet/servlet-class
   /servlet
 
   !-- Standard Action Servlet Mapping --
   servlet-mapping
 servlet-nameMyServlet/servlet-name
 url-pattern/first/url-pattern
   /servlet-mapping
 
   security-constraint
 
 web-resource-collection
 url-pattern/jsp/test.jsp/url-pattern
 /web-resource-collection
 
 auth-constraint
 role-namemanager/role-name
 /auth-constraint
 
   /security-constraint
 
security-role
 description
The role that is required to log in to the Manager Application
 /description
 role-namemanager/role-name
/security-role
 
 /web-app


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: GenericType error?

2009-01-23 Thread Jonathan Mast
You were right, the copy of blah.jsp on production server had been corrupted
by SVN (there was a conflict when I checked blah out).  It wasn't a Tomcat
issue at all.

I only thing is that the corruption (actually SVN's DIFF notation) was
nowhere near line 28, it was further down in the file. Perhaps Tomcat could
have been helpful in indicating this.

Thanks


On Thu, Jan 22, 2009 at 5:05 PM, Caldarale, Charles R 
chuck.caldar...@unisys.com wrote:

  From: Jonathan Mast [mailto:jhmast.develo...@gmail.com]
  Subject: Re: GenericType error?

  Well I do need to get my wisdom teeth removed ;)

 I did that 35 years ago; nothing to look forward to, other than to get it
 over with.

  I don't see how this is relevant though.

 It was relevant (before you provided additional information), since some
 language constructs are only available in 1.5 or 1.6 JREs.

  The fact that it works on an exact clone of the
  production box seems to me to point to corruption
  in the Tomcat distribution

 Which says the clone isn't quite exact.  Are you by any chance
 accidentally using gcj on the failing system?

  (temp/ or work/ dirs maybe?).

 You can always clean out those directories completely and see if it has an
 effect.

  This project works on my Windows machine ( I
  run it inside of Netbeans).

 What happens if you run Tomcat directly on the Windows box, not from
 NetBeans?

  Btw, other aspects of the project are working correctly,
  just blah.jsp seems to be the problem.

 Can you post at least the part of blah.jsp around line 28, if not all of
 it?

 What happens if you try to pre-compile blah.jsp?

 http://tomcat.apache.org/tomcat-5.5-doc/jasper-howto.html#Web%20Application%20Compilation

  - Chuck


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

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




Re: PostgreSQL vs MySQL with Tomcat

2009-01-23 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Chris,

Chris Wareham wrote:
 I am particularly wary of MySQL because of the way missing features
 have been disingenuously described as unnecessary, and broken
 features as the MySQL developers knowing better than everyone else.

Not to pick a fight, here, but I presume you are talking about your
previous comment about foreign key constraints. The old documentation
suggesting that developers were responsible for referential integrity
wasn't, I think, meant to suggest that this was a cosmic truth. Instead,
I think it was meant to indicate that, when using MySQL, it was simply
the only way developers could operate.

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkl53TEACgkQ9CaO5/Lv0PDU8wCfbq5mb2c5CvVWDCnMmRISlFb+
fNwAoLc5yKt9MG1jRZjf6x2+9DD1/jXF
=k4CY
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Random Connection Closed Exceptions - Question to the code example

2009-01-23 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Stefan,

Stefan Riegel wrote:
 - Request 1 running in Thread 1 gets a db connection.
 - Request 1 closes the db connection.
 - The JVM switches the running thread to Thread 2
 - Request 2 running in Thread 2 gets a db connection (the same db
 connection just closed by Request 1).

This shouldn't happen with a good connection pool; calling
Connection.close() in thread 1 returns the connection to the pool where
it's state is reset and it is now fresh. This means that it is
available to other threads and its association with the previous thread
is severed.

A decent connection pool will hand-out Connection objects that wrap the
underlying JDBC Connection object. Calling Connection.close() should
null-out the underlying connection so that calling Connection.close()
multiple times does nothing (as another poster pointed out: it's defined
as a no-op).

There should be no race conditions here with a decent DBCP.

On the other hand, the last thing you should do with a JDBC connection
is close it. Why are you continuing to operate on a closed connection?
If it's sloppy JDBC programming, then clean up your code. It will be
easier to read and therefore more maintainable. The fact that it will
work better with a poorly-written DBCP is just a bonus.

Like Chuck, I'm confused about your confusion.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkl53+oACgkQ9CaO5/Lv0PACbgCfaCBvAGn0bZ3KCz10ca1XI0QS
468An1L0Vy4ouqTEVoaL2/qfftpA7row
=DAfH
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



[Travel Assistance] Applications for ApacheCon EU 2009 - Now Open

2009-01-23 Thread Mladen Turk



The Travel Assistance Committee is now accepting applications for those
wanting to attend ApacheCon EU 2009 between the 23rd and 27th March 2009
in Amsterdam.

The Travel Assistance Committee is looking for people who would like to
be able to attend ApacheCon EU 2009 who need some financial support in
order to get there. There are very few places available and the criteria
is high, that aside applications are open to all open source developers
who feel that their attendance would benefit themselves, their
project(s), the ASF or open source in general.

Financial assistance is available for travel, accommodation and entrance
fees either in full or in part, depending on circumstances. It is
intended that all our ApacheCon events are covered, so it may be prudent
for those in the United States or Asia to wait until an event closer to
them comes up - you are all welcome to apply for ApacheCon EU of course,
but there must be compelling reasons for you to attend an event further
away that your home location for your application to be considered above
those closer to the event location.

More information can be found on the main Apache website at
http://www.apache.org/travel/index.html - where you will also find a
link to the online application form.

Time is very tight for this event, so applications are open now and will
end on the 4th February 2009 - to give enough time for travel
arrangements to be made.

Good luck to all those that apply.


Regards,
The Travel Assistance Committee



--
^(TM)


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: PostgreSQL vs MySQL with Tomcat

2009-01-23 Thread Leon Rosenberg
On Fri, Jan 23, 2009 at 12:59 PM, Chris Wareham
cware...@visitlondon.com wrote:

 Reread my last message, and take a look at the internals of any half
 decent RDBMS. Frequently accessed data will get cached in memory, and
 the cost of many joins will be less than the cost of a hash table lookup
 in Java. Not that caching at the application layer is relevant, because
 you were talking about performing two queries in the place of one with a
 join.


It is relevant, because by executing the 'queries' in application
layer, you are able to execute them on different way and cache.
Preventing the DB from being the bottleneck is relevant.
Alas the cost of a hashmap lookup in java is hard to beat :-)
Especially if to beat it you have to go over net.

 No query optimizer in the world can perform better than the develop,
 simply because it lacks the knowledge a good developer should have
 about the semantic of his application.

 Yes, and occasionally I can produce better assembler code than my C
 compiler. However, in your case you're ignoring the fact that any RDBMS
 worth its salt is going to have cached a lot of data in memory, in a way
 that is likely to be as fast to access if not faster than the same data
 cached and accessed at the application layer.

 i highly doubt is, cause a local access to memory in the vm is
 1.000.000 faster than an access over the net, even in the GBit
 network.


 As pointed out above, memory access at the application layer is
 irrelevant to a discussion where you had posited that two database
 queries were less costly than one with a join.

Again, not if by splitting them i'm creating the possibility to substitute them.

Leon

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Java Crash

2009-01-23 Thread Stephen Caine

All,

Whenever I attempt to access a charting jsp, I get an invalid memory  
access error and the JVM just crashes.  Here are the relevant portions  
of the java crash log.  Any thoughts would be appreciated.  Is this an  
Apple Java issue??


Stephen Caine
CommonGround Softworks, Inc.

___

Process: java [67620]
Path:
/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home/bin/java
Identifier:  java
Version: ??? (???)
Code Type:   X86-64 (Native)
Parent Process:  launchd [1]

Date/Time:   2009-01-21 14:53:08.281 -0500
OS Version:  Mac OS X Server 10.5.5 (9F33)
Report Version:  6

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0001b6f272f8
Crashed Thread:  28

Application Specific Information:

Java information:
Exception type: Bus Error (0xa) at pc=0x0001010a633d

Java VM: Java HotSpot(TM) 64-Bit Server VM (1.6.0_07-b06-57 mixed mode
macosx-amd64)

Heap
PSYoungGen  total 690496K, used 680383K [0x00018a56,  
0x0001b500, 0x0001b500)
eden space 684160K, 98% used  
[0x00018a56,0x0001b37a0de0,0x0001b418)
from space 6336K, 99% used  
[0x0001b418,0x0001b47aeeb0,0x0001b47b)
to   space 8384K, 0% used  
[0x0001b47d,0x0001b47d,0x0001b500)
PSOldGentotal 1398144K, used 1296068K [0x00013500,  
0x00018a56, 0x00018a56)
object space 1398144K, 92% used  
[0x00013500,0x0001841b11d0,0x00018a56)
PSPermGen   total 437248K, used 431571K [0x00010500,  
0x00011fb0, 0x00013500)
object space 437248K, 98% used  
[0x00010500,0x00011f574c70,0x00011fb0)


Virtual Machine Arguments:
JVM Args: -Xserver -Xms2048m -Xmx2048m -XX:+MaxFDLimit - 
XX:MaxPermSize=768m

-XX:+UseParallelGC -Djava.awt.headless=true
-Djava.endorsed.dirs=/Applications/Qilan 3/Tomcat_Qilan//common/endorsed
-Dcatalina.base=/Applications/Qilan 3/Tomcat_Qilan/
-Dcatalina.home=/Applications/Qilan 3/Tomcat_Qilan/
-Djava.io.tmpdir=/Applications/Qilan 3/Tomcat_Qilan//temp
Java Command: org.apache.catalina.startup.Bootstrap start
Launcher Type: SUN_STANDARD
Physical Memory: Page Size = 4k, Total = 2048M, Free = 1811M

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: PostgreSQL vs MySQL with Tomcat

2009-01-23 Thread Chris Wareham

Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Chris,

Chris Wareham wrote:

I am particularly wary of MySQL because of the way missing features
have been disingenuously described as unnecessary, and broken
features as the MySQL developers knowing better than everyone else.


Not to pick a fight, here, but I presume you are talking about your
previous comment about foreign key constraints. The old documentation
suggesting that developers were responsible for referential integrity
wasn't, I think, meant to suggest that this was a cosmic truth. Instead,
I think it was meant to indicate that, when using MySQL, it was simply
the only way developers could operate.

- -chris



No, the MySQL developers claimed they had better paradigms. For
instance, they first claimed transactions weren't necessary, eventually
they said they would come up with something called atomic operations,
but still advocated table locks instead. If you were performing inserts,
updates or deletes across a number of tables, then the first thing you
had to do was lock them *all* at the table level. To state the obvious,
locking at the table level means concurrent write access is going to be
very slow.

On foreign keys and referential integrity in general, the manual had
this to say:

FOREIGN KEY is sometimes used as a constraint check, but this check is
unnecessary in practice if rows are inserted into the tables in the
right order.

Part of a database engine's job is to ensure data integrity - it
shouldn't rely on the application coder getting things perfectly right
every time, because they wont. Without referential integrity, failures
on the part of the coder to do the right thing are going to be hard to
catch. Without transactions, it becomes even harder to catch and to
recover from.

MySQL is optimised for read access, features to enforce data integrity
or optimise write access have always been low on the priority list. For
proof, read the MySQL manual's section on Missing Features.

Chris
--

Chris Wareham
Senior Software Engineer
Visit London Ltd
6th floor,
2 More London Riverside, London SE1 2RR

Tel:  +44 (0)20 7234 5848
Fax: +44 (0)20 7234 5753


www.visitlondon.com





  
  
'Visit London Limited' is registered in England under No.761149;

Registered Office: Visit London, 2 More London Riverside, London SE1 2RR.


Visit London is the official visitor organisation for London. Visit London is 
partly funded by Partnership, the Mayor's London Development Agency and London 
Councils.
The information contained in this e-mail is confidential and intended for the 
named recipient(s) only.  If you have received it in error, please notify the 
sender immediately and then delete the message.  If you are not the intended 
recipient, you must not use, disclose, copy or distribute this email. The views 
expressed in this e-mail are those of the individual and not of Visit London. 
We reserve the right to read and monitor any email or attachment entering or 
leaving our systems without prior notice.

 Please don't print this e-mail unless you really need to.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: PostgreSQL vs MySQL with Tomcat

2009-01-23 Thread Chris Wareham

Leon Rosenberg wrote:

On Fri, Jan 23, 2009 at 12:59 PM, Chris Wareham
cware...@visitlondon.com wrote:

Reread my last message, and take a look at the internals of any half
decent RDBMS. Frequently accessed data will get cached in memory, and
the cost of many joins will be less than the cost of a hash table lookup
in Java. Not that caching at the application layer is relevant, because
you were talking about performing two queries in the place of one with a
join.



It is relevant, because by executing the 'queries' in application
layer, you are able to execute them on different way and cache.
Preventing the DB from being the bottleneck is relevant.
Alas the cost of a hashmap lookup in java is hard to beat :-)
Especially if to beat it you have to go over net.



Sigh. That's irrelevant - you claimed two separate queries were faster
than one with a join. By the way, if it's not static data your caching,
how's your messaging system? Without one how are you going to maintain
the integrity of your caches? Even with one, can you tolerate a race
condition between the data being modified in the database and the
notifications causing all your caches to be updated? Is this all worth
the pain to avoid a join? (Maybe, but that doesn't make it a hard and
fast rule as you seem to think that joins are bad, man).


No query optimizer in the world can perform better than the develop,
simply because it lacks the knowledge a good developer should have
about the semantic of his application.


Yes, and occasionally I can produce better assembler code than my C
compiler. However, in your case you're ignoring the fact that any RDBMS
worth its salt is going to have cached a lot of data in memory, in a way
that is likely to be as fast to access if not faster than the same data
cached and accessed at the application layer.

i highly doubt is, cause a local access to memory in the vm is
1.000.000 faster than an access over the net, even in the GBit
network.


As pointed out above, memory access at the application layer is
irrelevant to a discussion where you had posited that two database
queries were less costly than one with a join.


Again, not if by splitting them i'm creating the possibility to substitute them.

Leon



This has been a fun way to liven up a Friday, but I'm bailing at this
point - and I just hope I don't end up working on anything you've ever
written as I fear it would be rewrite time.

Chris
--

Chris Wareham
Senior Software Engineer
Visit London Ltd
6th floor,
2 More London Riverside, London SE1 2RR

Tel:  +44 (0)20 7234 5848
Fax: +44 (0)20 7234 5753


www.visitlondon.com





  
  
'Visit London Limited' is registered in England under No.761149;

Registered Office: Visit London, 2 More London Riverside, London SE1 2RR.


Visit London is the official visitor organisation for London. Visit London is 
partly funded by Partnership, the Mayor's London Development Agency and London 
Councils.
The information contained in this e-mail is confidential and intended for the 
named recipient(s) only.  If you have received it in error, please notify the 
sender immediately and then delete the message.  If you are not the intended 
recipient, you must not use, disclose, copy or distribute this email. The views 
expressed in this e-mail are those of the individual and not of Visit London. 
We reserve the right to read and monitor any email or attachment entering or 
leaving our systems without prior notice.

 Please don't print this e-mail unless you really need to.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



different jsessionid for different webapps

2009-01-23 Thread Stefano Nichele

Hi All,
I have a strange (for me?) requirement for my application.
Basically I have webapp A deployed in Tomcat A and webpp B deployed in 
Tomcat B. webappA is the main webapplication that provides the main 
web page to the the browser. That page contains an IFrame that points to 
webappB.


Is there a way to have/use different JSESSIONID for the webapps ? I know 
the browser handles the cookies per hostname, is there a way to handle 
cookies per path (webapp) ?


Thank in advance
ste

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: PostgreSQL vs MySQL with Tomcat

2009-01-23 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Chris,

Chris Wareham wrote:
 By the way, if it's not static data your caching,
 how's your messaging system? Without one how are you going to maintain
 the integrity of your caches? Even with one, can you tolerate a race
 condition between the data being modified in the database and the
 notifications causing all your caches to be updated?

Er... write-through cache? Presumably, Leon is talking about a one-box
wonder.

Before everyone starts yelling about how stupid everyone else's ideas
are, maybe we should just let this one go in the interests of civility.

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkl6A+UACgkQ9CaO5/Lv0PCWdACdH0d9og7mrxwSzfZyn5hmzzo+
9AsAoKmNOfAlMiX6jkRcbUof72goMM9T
=nOJX
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: encodeRedirectURL URL rewrite not working

2009-01-23 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Greg,

Greg Burrow wrote:
 I have two web applications in different context, one servlet will forward
 the request to a servlet in the other application using encodeRedirectURL
 and sendRedirect.

NB that's a redirect, not a forward.

 The receiving servlet creates a new session and session
 attributes are lost.

Are the two servlets in the same web application?

 GET /App1/RedirectServlet HTTP/1.1

[snip]

 GET /App2/LaunchServlet HTTP/1.1

Nope, they aren't. You didn't provide path details on the cookies in
question. I suspect the first is tied to /App1 and the second to /App2.
You need to use single-sign-in if you want sessions to be available
across webapps.

 The same behavior occurs in Firefox and IE.  Cookies are enabled in both
 browsers and crossContext=true in context.xml.  Is this a bug in Tomcat or
 a problem with my method of redirect?

Neither. It's a misunderstanding of the separation of sessions between
webapps. Tomcat supports single-sign-in (SSI) which you can read about here:

http://tomcat.apache.org/tomcat-5.5-doc/config/valve.html#Single%20Sign%20On%20Valve

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkl6BToACgkQ9CaO5/Lv0PAO+ACZAYPf2r+6NWsMMSo9c0RzYGld
XXQAoK4g9Pea/Ajysg5D7AYdfUSTB4Rk
=SrHN
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: different jsessionid for different webapps

2009-01-23 Thread Pid
Stefano Nichele wrote:
 Hi All,
 I have a strange (for me?) requirement for my application.
 Basically I have webapp A deployed in Tomcat A and webpp B deployed in
 Tomcat B. webappA is the main webapplication that provides the main
 web page to the the browser. That page contains an IFrame that points to
 webappB.
 
 Is there a way to have/use different JSESSIONID for the webapps ? I know
 the browser handles the cookies per hostname, is there a way to handle
 cookies per path (webapp) ?

If you've actually deployed two separate webapps then the session ids
ought to be different.  Session data is not portable between separate
webapps.

p


 Thank in advance
 ste
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Regarding SVN

2009-01-23 Thread Sneha Manohar
Hello ,
 
I wish to install SVN on my laptop .  Do I need to install SVN server  
client both ? . I have windows vista operating system which version do I need 
to install ?
 
sneha


  Add more friends to your messenger and enjoy! Go to 
http://messenger.yahoo.com/invite/

Re: run tomcat as tomcat user

2009-01-23 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Rusty,

Rusty Wright wrote:
 It's set up so that tomcat runs as the user tomcat.  In order to do that
 you'll need to tweak the ownership of the files in the tomcat
 directory.

I would recommend that, instead of modifying the ownership of the Tomcat
installation directory, you instead use CATALINA_BASE set to somewhere
that has appropriate permissions for the user in question. Something
like /home/tomcat.

This also allows you to upgrade Tomcat much more easily just by
adjusting the path to startup.bat and bouncing Tomcat.

If the OP is using this script as part of the system startup (that is,
it is running as root), then you'll need to adjust the startup command
to be:

su - tomcat -c /path/to/tomcat/bin/startup.sh

This will switch to the tomcat user before launching Tomcat.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkl6EF8ACgkQ9CaO5/Lv0PDolACgwG/Rx+cpzb8GuX4BOzjEhakU
Yq8An05jNk9mz17qCMpo44i1NfrIUDX2
=1D1X
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Java Crash

2009-01-23 Thread Jonathan Mast
that is almost certainly an Apple Java issue.  If by charting, you mean
graphics, then even more so.  The Java2D api on Mac still has bugs that will
crash.

But you can't be certain unless you test ur webapp on a windows machine.

On Fri, Jan 23, 2009 at 11:03 AM, Stephen Caine step...@commongrnd.comwrote:

 All,

 Whenever I attempt to access a charting jsp, I get an invalid memory access
 error and the JVM just crashes.  Here are the relevant portions of the java
 crash log.  Any thoughts would be appreciated.  Is this an Apple Java
 issue??

 Stephen Caine
 CommonGround Softworks, Inc.

 ___

 Process: java [67620]
 Path:
 /System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home/bin/java
 Identifier:  java
 Version: ??? (???)
 Code Type:   X86-64 (Native)
 Parent Process:  launchd [1]

 Date/Time:   2009-01-21 14:53:08.281 -0500
 OS Version:  Mac OS X Server 10.5.5 (9F33)
 Report Version:  6

 Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
 Exception Codes: KERN_INVALID_ADDRESS at 0x0001b6f272f8
 Crashed Thread:  28

 Application Specific Information:

 Java information:
 Exception type: Bus Error (0xa) at pc=0x0001010a633d

 Java VM: Java HotSpot(TM) 64-Bit Server VM (1.6.0_07-b06-57 mixed mode
 macosx-amd64)

 Heap
 PSYoungGen  total 690496K, used 680383K [0x00018a56,
 0x0001b500, 0x0001b500)
 eden space 684160K, 98% used
 [0x00018a56,0x0001b37a0de0,0x0001b418)
 from space 6336K, 99% used
 [0x0001b418,0x0001b47aeeb0,0x0001b47b)
 to   space 8384K, 0% used
 [0x0001b47d,0x0001b47d,0x0001b500)
 PSOldGentotal 1398144K, used 1296068K [0x00013500,
 0x00018a56, 0x00018a56)
 object space 1398144K, 92% used
 [0x00013500,0x0001841b11d0,0x00018a56)
 PSPermGen   total 437248K, used 431571K [0x00010500,
 0x00011fb0, 0x00013500)
 object space 437248K, 98% used
 [0x00010500,0x00011f574c70,0x00011fb0)

 Virtual Machine Arguments:
 JVM Args: -Xserver -Xms2048m -Xmx2048m -XX:+MaxFDLimit -XX:MaxPermSize=768m
 -XX:+UseParallelGC -Djava.awt.headless=true
 -Djava.endorsed.dirs=/Applications/Qilan 3/Tomcat_Qilan//common/endorsed
 -Dcatalina.base=/Applications/Qilan 3/Tomcat_Qilan/
 -Dcatalina.home=/Applications/Qilan 3/Tomcat_Qilan/
 -Djava.io.tmpdir=/Applications/Qilan 3/Tomcat_Qilan//temp
 Java Command: org.apache.catalina.startup.Bootstrap start
 Launcher Type: SUN_STANDARD
 Physical Memory: Page Size = 4k, Total = 2048M, Free = 1811M

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




Re: Java Crash

2009-01-23 Thread Stephen Caine

Jonathan,

that is almost certainly an Apple Java issue.  If by charting, you  
mean graphics, then even more so.  The Java2D api on Mac still has  
bugs that will crash.


I am sorry that I did not specify the charting jsp.  We are using the  
ones provided by CEWolf (based on JFreeChart).


Stephen Caine

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Java Crash

2009-01-23 Thread Caldarale, Charles R
 From: Jonathan Mast [mailto:jhmast.develo...@gmail.com]
 Subject: Re: Java Crash

 that is almost certainly an Apple Java issue.

Note also the excessive heap size vs installed RAM.  This is guaranteed to 
induce serious paging, and I don't know if the MAC OS is robust enough to deal 
with a lot of page thrashing.  Given that the webapp runs correctly for some 
time before the JVM crashes, I would certainly try reducing the heap size to 
eliminate paging mismanagement as the potential cause.

 - Chuck


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

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: run tomcat as tomcat user

2009-01-23 Thread Rusty Wright

Thanks, I like that suggestion.

So, to use your method, using the su below, would I do

 export CATALINA_BASE=/home/tomcat
 su - tomcat -c /path/to/tomcat/bin/startup.sh

Do I need to copy anything from the original tomcat directory to /home/tomcat, 
or do I need to make any directories in it?  Or is it simply a replacement for 
the tomcat/webapps directory?


Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Rusty,

Rusty Wright wrote:

It's set up so that tomcat runs as the user tomcat.  In order to do that
you'll need to tweak the ownership of the files in the tomcat
directory.


I would recommend that, instead of modifying the ownership of the Tomcat
installation directory, you instead use CATALINA_BASE set to somewhere
that has appropriate permissions for the user in question. Something
like /home/tomcat.

This also allows you to upgrade Tomcat much more easily just by
adjusting the path to startup.bat and bouncing Tomcat.

If the OP is using this script as part of the system startup (that is,
it is running as root), then you'll need to adjust the startup command
to be:

su - tomcat -c /path/to/tomcat/bin/startup.sh

This will switch to the tomcat user before launching Tomcat.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkl6EF8ACgkQ9CaO5/Lv0PDolACgwG/Rx+cpzb8GuX4BOzjEhakU
Yq8An05jNk9mz17qCMpo44i1NfrIUDX2
=1D1X
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: TCP connections and HTTP sessions

2009-01-23 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1



tovaldez wrote:
 Hi,
 monitoring our webapp while running load testing, I noticed that the
 number of the effective users browsing the site is more than the number
 of opened sockets in ESTABLISHED state (while under a 240 Virtual Users
 load, I see only 180 ESTABLISHED connections, or 2000VU vs 450 opened
 sockets).
 
 At first I think this is due to some TCP socket reuse optimization by
 the JVM or the OS. Could someone confirm this idea or give me another
 interpretation of this behaviour?

Er... effective users ~= sessions, right? Not all users are actively
making requests all the time so... the number of effective users is
pretty much always higher than the number of in-use TCP sockets.

Am I missing something?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkl6FMgACgkQ9CaO5/Lv0PCUrwCeL3S8qxDmNopgc3wyI7M/K1xX
b4sAn303xF+m40AbJDY2r/Hu2jlcwtqS
=Jv22
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: GenericType error?

2009-01-23 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Jonathan,

Jonathan Mast wrote:
 I only thing is that the corruption (actually SVN's DIFF notation) was
 nowhere near line 28, it was further down in the file. Perhaps Tomcat could
 have been helpful in indicating this.

You'd be surprised at what can pass for legal source code. It's always
hard for a compiler to give you a really good error message for
completely nonsensical code.

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkl6Fa4ACgkQ9CaO5/Lv0PDZUQCfR1faahoQbOaYaCVlzPRg8k8T
BC0AoLC4BDlCMJMW0mVgxw1NH1Zqq9Hs
=fkAm
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Configuring SSL for Tomcat 6

2009-01-23 Thread Inya-Agha, Wynne
The problem with the SSL is that the Tomcat server is not using the
certificate.  When it starts, depending on the exact options chosen in
the server.xml file for the port 8443 listener section, it does one of
the following:

It will either fail to start listening on port 8443 at all, or

It will listen on port 8443, but not encrypt communications.  (It's not
using the certificate.)

From what I can tell with keytool, the certificate appears to be fine.
I don't understand how Tomcat knows which key in the keystore to use, or
how it knows the keystore password.  (I don't think it does.)  It's even
generating an error in one of its log files that says it's having
trouble opening the keystore, which I believe is because it does not
have the password, but when I enter that information with the options
needed for specifying the keystore password in the server.xml file, that
port 8443 listener does not start at all.  It's as if I have the wrong
syntax.  The documentation I'm using is just whatever I can find on the
Internet

Any suggestions you can offer would be appreciated.

Wynne F. Inya-Agha | TriMont Real Estate Advisors 
3424 Peachtree Rd. Suite 2200
Atlanta, GA 30326
Direct (404) 954-5288
Fax (404) 230-6682
winya-a...@trimontrea.com



Re: 403 on https connection but not http

2009-01-23 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Iain,

Emsley, I (Iain) wrote:
 I'm trying to get https:// working on an application running on Tomcat
 5.5.23 on Windows Server 2003. When I ran the application on port 8080,
 it logged me in fine using our login filters, however when I moved to
 https://, the application returns 403 without any messages being written
 to stdout or logging messages that I've put in the filters to try and
 debug them if needs be. 

Hmm. Your configuration looks okay. Can you do an HTTP capture of the
conversation between the client and the server? Do you ever get a login
screen, or are you refused immediately upon the first request?

Do your filters redirect (as opposed to forwarding) the user to the
login screen? If so, are your login pages protected by yoru
security-constraints? I wonder if you may have set up auth semantics
like this:

1. All pages require a valid login
2. Login page is /login.jsp
3. Per rule #1, /login.jsp requires a login

?

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkl6F38ACgkQ9CaO5/Lv0PDcMACeISFOCEHd/PZ3bmx2+0f8V//o
f10An1bZE2vXccP/sanipzyexBtScl7i
=jNjP
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Question abut CometProcessor EventSubType.TIMEOUT semantics

2009-01-23 Thread David Boreham


I'm re-writing an application to use the CometProcessor interface.
Generally things are working but despite several late evenings
single-stepping through the connector code, I'm still unclear
on one issue and would appreciate some education:

In my debugging I'm using NIO (production deployment is
intended to use Linux and APR but for now my question pertains to
my experiences with NIO on the Windows desktop).

My application receives a BEGIN event and stores the
event object, response and so on for later use to respond
to the client, much like the example code.
Until that time, which may be many minutes in
the future, it sends nothing back to the client.

I see EventSubType.TIMEOUT events delivered during the
time after BEGIN event, one TIMEOUT ever soTimeout
interval. This matches the documentation's description of
timeout semantics. However, I have observed empirically
that if an attempt is made to send data back to the client
(via Response.outputStream.write/flush), no data is actually
sent on the wire IF the write is done AFTER one of these
timeout events has arrived. That is, if I change the timeout
such that it is longer than the time at which the application
responds to the client, the client receives the data. If I make
the timeout shorted, the client does not receive the data.
There is no exception thrown, and in fact I've single stepped
into the NIO code all the way to the socket write and flush
calls. Everything looks ok, but no data makes it to the wire
(confirmed in a packet trace).

So, I'm wondering: is this expected behavior ? If so
then the documentation is incorrect. Also, if this is
the intended behavior it would appear to make it hard
to build a working application for APR because the
timeout can't be set after connection establishment
(the same timeout, it appears applies to all socket reads,
and hence setting it to a very long time will cause thread pool 
starvation trouble with

new connections that stall with the client never sending any data).

Any thoughts on this are most welcome.






-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: different jsessionid for different webapps

2009-01-23 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Pid,

Pid wrote:
 Stefano Nichele wrote:
 Hi All,
 I have a strange (for me?) requirement for my application.
 Basically I have webapp A deployed in Tomcat A and webpp B deployed in
 Tomcat B. webappA is the main webapplication that provides the main
 web page to the the browser. That page contains an IFrame that points to
 webappB.

 Is there a way to have/use different JSESSIONID for the webapps ? I know
 the browser handles the cookies per hostname, is there a way to handle
 cookies per path (webapp) ?
 
 If you've actually deployed two separate webapps then the session ids
 ought to be different.  Session data is not portable between separate
 webapps.

The only exception would be for applications deployed inside one
another's URI spaces. We used to have a situation where we had a ROOT
webapp and another one deployed onto /foo (the original application has
been deployed to ROOT, and we had to keep it there while deploying
another one, too... it was silly and it's since been corrected).

At any rate, we had weird problems with dual cookies being sent. The
sessions wouldn't overlap, of course, but we had weirdness with the
session being lost sometimes. It was combined with a third application
that didn't use sessions at all and forwarded the requested session id
behind the scenes back to the main application, and we could never tell
which session id to use (because clients don't sent the Path along
with the JSESSIONID cookie).

Bottom line: beware deploying applications inside one another's URI spaces.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkl6GRwACgkQ9CaO5/Lv0PDBtgCaA8fNcBF3XAV9sThnhJN7pOml
d90An1LWimWvYNleDg6ng0vYyLN5ollR
=cHaH
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Java Crash

2009-01-23 Thread Ken Bowen
Just a datapoint:  I have a webapp which does basic graph construction  
using JFreeChart which has been running in development mode on a Mac  
OS X 10.5.6 under both Tomcat 5.5.26 and 6.0.18 for many months, and  
has never produced such a crash.


On Jan 23, 2009, at 1:56 PM, Stephen Caine wrote:


Jonathan,

that is almost certainly an Apple Java issue.  If by charting, you  
mean graphics, then even more so.  The Java2D api on Mac still has  
bugs that will crash.


I am sorry that I did not specify the charting jsp.  We are using  
the ones provided by CEWolf (based on JFreeChart).


Stephen Caine

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: PostgreSQL vs MySQL with Tomcat

2009-01-23 Thread Jonathan Mast
Perhaps I should explain more about how my rewrite sans JOINs works:

The reports read from a log table with this schema:
PK | ref_PK1 | ref_PK2 | ref_PK3 | start_time | stop_time

Where ref_PK# is the primary key of another table.  These 3 other tables are
very shallow (row count  100).  The log table is very deep (row count 
100,000).

The web app, when started, reads the 3 shallow tables into memory (3 hash
maps).

(And btw:  the database code is NOT intertwined with the Serlvet code, thank
you very much :)

To run a report: the user enters the start and stop times, along with some
other options.  The report sends the options to db accessor class which runs
a query that only references the log table.  The results (an array of Log
objects) are rendered as an HTML table (it also does Excel).  The ref_PK#
values are matched against their respective hashmaps to produce human
readable data.

This approach proved much faster than using the JOINs.  I'm not saying that
there is no place for using JOINs, just that you need to think about where
to place the processing load.  Our database is very busy with writes, all of
which have priority over reads, hence the desire to move as much load off of
it as possible.

Furthermore, the data in 3 shallow tables doesn't change once inserted.  But
in other projects where I employ caching, the caches Timeout after certain
periods of time.  Also these other caches load incremently (as needed)
instead of preloading, which is what the report app does.

Finally, I am very busy with other responisibilites at my job, and do not
have time to dig into heiroglyphics of database optimization which is very
vender specific and as such further binds your organization to that vendor.

thanks

On Fri, Jan 23, 2009 at 12:52 PM, Christopher Schultz 
ch...@christopherschultz.net wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Chris,

 Chris Wareham wrote:
  By the way, if it's not static data your caching,
  how's your messaging system? Without one how are you going to maintain
  the integrity of your caches? Even with one, can you tolerate a race
  condition between the data being modified in the database and the
  notifications causing all your caches to be updated?

 Er... write-through cache? Presumably, Leon is talking about a one-box
 wonder.

 Before everyone starts yelling about how stupid everyone else's ideas
 are, maybe we should just let this one go in the interests of civility.

 - -chris

 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.9 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

 iEYEARECAAYFAkl6A+UACgkQ9CaO5/Lv0PCWdACdH0d9og7mrxwSzfZyn5hmzzo+
 9AsAoKmNOfAlMiX6jkRcbUof72goMM9T
 =nOJX
 -END PGP SIGNATURE-

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




RE: Configuring SSL for Tomcat 6

2009-01-23 Thread Caldarale, Charles R
 From: Inya-Agha, Wynne [mailto:winya-a...@trimontrea.com]
 Subject: Configuring SSL for Tomcat 6

 The documentation I'm using is just whatever I can
 find on the Internet

Why don't you use the documentation on the Tomcat web site?
http://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html

Note that the configuration is different if you're using APR - which you didn't 
bother to tell us.
http://tomcat.apache.org/tomcat-6.0-doc/apr.html

Nor did you tell us the platform, JVM version, or specific Tomcat level.  Also, 
you should post your actual Connector element, rather than vaguely describing 
it; obfuscate the password, if needed.  Posting the actual log entries wouldn't 
hurt either.

 - Chuck


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

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: run tomcat as tomcat user

2009-01-23 Thread Rusty Wright

To answer my own question; I did some google searching and figured out that you 
need to copy the tomcat conf directory to ~tomcat and also create the 
directories ~/tomcat/logs, ~/tomcat/temp, and ~/tomcat/work; all owned by 
tomcat.  Then copy over the webapps directory, or make a new one in ~tomcat and 
copy over the wars.

So my ~tomcat looks like the following:

r...@test1:/home/tomcat# ls -l
total 20
drwxr-xr-x 2 tomcat tomcat 4096 2009-01-23 11:41 conf/
drwxr-xr-x 2 tomcat tomcat 4096 2009-01-23 11:41 logs/
drwxr-xr-x 2 tomcat tomcat 4096 2009-01-23 11:42 temp/
drwxrwxr-x 8 rusty  tomcat 4096 2009-01-23 11:42 webapps/
drwxr-xr-x 3 tomcat tomcat 4096 2009-01-23 11:41 work/

r...@wss-test1:/home/tomcat# ls -l conf
total 92
-rw-r--r-- 1 tomcat tomcat  8690 2008-07-21 17:01 catalina.policy
-rw-r--r-- 1 tomcat tomcat  3665 2008-07-21 17:01 catalina.properties
-rw-r--r-- 1 tomcat tomcat  1395 2008-11-19 14:22 context.xml
-rw-r--r-- 1 tomcat tomcat  3664 2008-07-21 17:01 logging.properties
-rw-r--r-- 1 tomcat tomcat  6460 2008-07-21 17:01 server.xml
-rw-r--r-- 1 tomcat tomcat   165 2009-01-23 11:41 tomcat-users.xml
-rw-r--r-- 1 tomcat tomcat 50105 2008-11-19 14:23 web.xml

I love shell script hacks so my /etc/init.d/tomcat script has the following in 
the upper part where it's setting variables:

TOMCAT_HOME=`grep ^tomcat /etc/passwd | sed -e 's/.*:.*:.*:.*:.*:\(.*\):.*/\1/'`

export CATALINA_BASE=${TOMCAT_HOME}

Perhaps instead of .* I could have used [^:]* 



Rusty Wright wrote:

Thanks, I like that suggestion.

So, to use your method, using the su below, would I do

 export CATALINA_BASE=/home/tomcat
 su - tomcat -c /path/to/tomcat/bin/startup.sh

Do I need to copy anything from the original tomcat directory to 
/home/tomcat, or do I need to make any directories in it?  Or is it 
simply a replacement for the tomcat/webapps directory?



Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Rusty,

Rusty Wright wrote:

It's set up so that tomcat runs as the user tomcat.  In order to do that
you'll need to tweak the ownership of the files in the tomcat
directory.


I would recommend that, instead of modifying the ownership of the Tomcat
installation directory, you instead use CATALINA_BASE set to somewhere
that has appropriate permissions for the user in question. Something
like /home/tomcat.

This also allows you to upgrade Tomcat much more easily just by
adjusting the path to startup.bat and bouncing Tomcat.

If the OP is using this script as part of the system startup (that is,
it is running as root), then you'll need to adjust the startup command
to be:

su - tomcat -c /path/to/tomcat/bin/startup.sh

This will switch to the tomcat user before launching Tomcat.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkl6EF8ACgkQ9CaO5/Lv0PDolACgwG/Rx+cpzb8GuX4BOzjEhakU
Yq8An05jNk9mz17qCMpo44i1NfrIUDX2
=1D1X
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: run tomcat as tomcat user

2009-01-23 Thread Caldarale, Charles R
 From: Rusty Wright [mailto:rusty.wri...@gmail.com]
 Subject: Re: run tomcat as tomcat user

 To answer my own question; I did some google searching and
 figured out that you need to copy the tomcat conf directory
 to ~tomcat and also create the directories ~/tomcat/logs,
 ~/tomcat/temp, and ~/tomcat/work; all owned by tomcat.

Or you could have read RUNNING.txt from the Tomcat installation directory, 
where all this is documented.

 - Chuck


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

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Facing “Javax.servlet.servletException: c annot connect to windows server”. error

2009-01-23 Thread Kees Jan Koster

Dear prakash.s,

  I had visited the link suggested by you, please let me know  
how to

change the java property -Djava.awt.headless=true

  Is it just enough to type the command prompt?


For tomcat, you can either edit catalina.sh and add it after the Java  
command, for example.


Google for tomcat JAVA_OPTS.
--
Kees Jan

http://java-monitor.com/forum/
kjkos...@kjkoster.org
06-51838192

Human beings make life so interesting. Do you know that in a universe  
so full of wonders,
they have managed to invent boredom. Quite astonishing... -- Terry  
Pratchett



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Java Crash

2009-01-23 Thread Stephen Caine

Ken,

This is very helpful.  It strongly suggests the issue is memory  
management, not JFreeChart.


Thanks,

Stephen

On Jan 23, 2009, at 2:28 PM, Ken Bowen wrote:

Just a datapoint:  I have a webapp which does basic graph  
construction using JFreeChart which has been running in development  
mode on a Mac OS X 10.5.6 under both Tomcat 5.5.26 and 6.0.18 for  
many months, and has never produced such a crash.


On Jan 23, 2009, at 1:56 PM, Stephen Caine wrote:


Jonathan,

that is almost certainly an Apple Java issue.  If by charting, you  
mean graphics, then even more so.  The Java2D api on Mac still has  
bugs that will crash.


I am sorry that I did not specify the charting jsp.  We are using  
the ones provided by CEWolf (based on JFreeChart).


Stephen Caine

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: different jsessionid for different webapps

2009-01-23 Thread tovaldez
Actually, you should have the path set in the cookie, too.
Verify looking at your browser cookies.

Be sure not to have something like:
emptySessionPath=true
in the connector definition in server.xml
(usually we have to set it to true because when not set or set to false we have 
errors due to security checks made by DWR on crossdomain scripting)



On Friday 23 January 2009 18:35:11 Stefano Nichele wrote:
 Hi All,
 I have a strange (for me?) requirement for my application.
 Basically I have webapp A deployed in Tomcat A and webpp B deployed in 
 Tomcat B. webappA is the main webapplication that provides the main 
 web page to the the browser. That page contains an IFrame that points to 
 webappB.
 
 Is there a way to have/use different JSESSIONID for the webapps ? I know 
 the browser handles the cookies per hostname, is there a way to handle 
 cookies per path (webapp) ?
 
 Thank in advance
 ste
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 




Re: TCP connections and HTTP sessions

2009-01-23 Thread tovaldez
On Friday 23 January 2009 20:04:40 Christopher Schultz wrote:
 
 tovaldez wrote:
  Hi,
  monitoring our webapp while running load testing, I noticed that the
  number of the effective users browsing the site is more than the number
  of opened sockets in ESTABLISHED state (while under a 240 Virtual Users
  load, I see only 180 ESTABLISHED connections, or 2000VU vs 450 opened
  sockets).
 
  At first I think this is due to some TCP socket reuse optimization by
  the JVM or the OS. Could someone confirm this idea or give me another
  interpretation of this behaviour?
 
 Er... effective users ~= sessions, right? Not all users are actively
 making requests all the time so... the number of effective users is
 pretty much always higher than the number of in-use TCP sockets.
 
 Am I missing something?
 
 -chris
 

Actually HTTP sessions  effective users, since each user has a 10 minutes 
simulated navigation but the HTTP session is lasting a lot more (I think 1 hour 
by default in tomcat).
What I thought was that using HTTP 1.1, I would have only 1 phisical connection 
to the server for each user... This seems not to be, as if the same physical 
connection is used contemporarily by more clients.
I am asking if it could be a poor testing design or if we are wrong in our 
consideration...


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 



Re: PostgreSQL vs MySQL with Tomcat

2009-01-23 Thread Terence M. Bandoian
As a general rule, it's been my experience with MySQL that well-designed
queries on properly indexed tables yield good performance.  There are,
of course, exceptions to the rule where performance may be improved by
moving a portion of a query into the application and times when the
execution of a query may need to be coerced.

The biggest risk I've seen in not using foreign key constraints is the
potential for orphans.  Programmatically, inserts are about the same
but, without cascading deletes, additional programming is required to
remove related records which may lead to errors.  However, orphans are
easily detected with a simple query and, with good programming practice
and testing procedures, just as easily prevented.

Once upon a time, CPU cycles, memory and disk space mattered.

-Terence M. Bandoian


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Regarding SVN

2009-01-23 Thread Rusty Wright

Try here:

http://subversion.tigris.org/
http://subversion.tigris.org/mailing-lists.html


Sneha Manohar wrote:

Hello ,
 
I wish to install SVN on my laptop .  Do I need to install SVN server  client both ? . I have windows vista operating system which version do I need to install ?
 
sneha



  Add more friends to your messenger and enjoy! Go to 
http://messenger.yahoo.com/invite/


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org