Problems with connections pool in Tomcat 6.0.18 6.0.20 + MySQL 5.1 + mysql-connector 5.1.x

2011-01-26 Thread Ramon Garcia Alarcon
Hi all,

I have a problem with:
Tomcat 6.0.x + MySQL 5.1 + mysql-connector.5.1.x
And I test with Ubuntu 10.04, Windows 2003 and Mac OSX 10.6.6

I configured the connection in tomcat like this:



In MySql I have good configured the wait_timeout and the interactive_timeout
in 28800.

The problem is that the pool never removes the connection and when the mysql
closes it, I got this exception:
java.sql.SQLException: Already closed

Some idea?

These configuration was worked properly in MySQL 4.1 and Tomcat 5.5..

Thanks!

Ramon Garcia


Re: mod_jk load balancing problem

2011-01-26 Thread Shoaib M. Chaudhary
Hello,

The problem I detected is that client has to send three requests for home
page as it contains frames. How can I force mod_jk to send all requests to
one server.

I come to this result while I shutdown one server called tomcat3 and restart
a tomcat on that machine (tomcat3) with no application. Frames showed error
404 that should be there as there were no page on that machine (tomcat3). I
concluded that all request is not been treated by one server.

Can someone help me out.

Regards
*Muhammad Shoaib*




On Thu, Jan 27, 2011 at 09:08, Shoaib M. Chaudhary  wrote:

> The problem is following,
>
> When I use mod_jk with the following code for one worker it works fine but
> when I try to connect with two tomcat servers that are not on the same
> machine on which I have apache. Interestingly when I use one worker as
> localhost it works fine again.
>
> There is no error but the page loads again and again. following is my
> worker.properties file.
>
> worker.list=loadbalancer
>
> worker.tomcat2.port=8009
> worker.tomcat2.host=172.16.10.21
> worker.tomcat2.type=ajp13
> worker.tomcat2.lbfactor=1
> worker.tomcat1.socket_timeout=1000
>
>
> worker.tomcat3.port=8009
> worker.tomcat3.host=172.16.10.22
> worker.tomcat3.type=ajp13
> worker.tomcat3.lbfactor=1
> worker.tomcat1.socket_timeout=1000
>
>
> worker.loadbalancer.type=lb
> worker.loadbalancer.balanced_workers=tomcat2, tomcat3
>
> Intrestingly when I use worker.loadbalancer.balanced_workers=tomcat2 it
> works fine even if I replace tomcat2 with tomcat 3 as well. The page keep
> refreshing it self for some time and suddenly it finished refreshing and I
> can see the original page as well.
>
> Regards
> *Muhammad Shoaib*
>
> Software Engineer
> National University of Computer and Emerging Sciences
> A. K. Brohi Road (Near Police Line) H11/4 Islamabad
>
> Semantic Web Consultant / Knowledge Engineer
> Allainet Cooperation Private Limited
> I8/3 Islamabad Pakistan
>
> T +92-(51)-111-128-128 Ext 344 | M +92-334-5577712
> muhammad.sho...@live.com
>
>
>
>
> On Wed, Jan 26, 2011 at 03:18, Michael Ludwig  wrote:
>
> > Shoaib M. Chaudhary schrieb am 26.01.2011 um 15:48 (+0500):
> >
> > > I am trying to use mod_jk with tomcat 5.5.3x. When I use mode_jk with
> > > one worker it works fine
> >
> > Okay.
> >
> > > but when I use loadbalancer with two different tomcats the server
> > > doesn't response
> >
> > No response at all? Or some error status?
> >
> > > but always try to refresh the page.
> >
> > It's not clear to me what you're doing nor what's happening.
> >
> > What about providing a more precise description of your setup (like
> > config) and observations?
> >
> > --
> > Michael Ludwig
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> > For additional commands, e-mail: users-h...@tomcat.apache.org
> >
> >
>


Re: mod_jk load balancing problem

2011-01-26 Thread Shoaib M. Chaudhary
The problem is following,

When I use mod_jk with the following code for one worker it works fine but
when I try to connect with two tomcat servers that are not on the same
machine on which I have apache. Interestingly when I use one worker as
localhost it works fine again.

There is no error but the page loads again and again. following is my
worker.properties file.

worker.list=loadbalancer

worker.tomcat2.port=8009
worker.tomcat2.host=172.16.10.21
worker.tomcat2.type=ajp13
worker.tomcat2.lbfactor=1
worker.tomcat1.socket_timeout=1000


worker.tomcat3.port=8009
worker.tomcat3.host=172.16.10.22
worker.tomcat3.type=ajp13
worker.tomcat3.lbfactor=1
worker.tomcat1.socket_timeout=1000


worker.loadbalancer.type=lb
worker.loadbalancer.balanced_workers=tomcat2, tomcat3

Intrestingly when I use worker.loadbalancer.balanced_workers=tomcat2 it
works fine even if I replace tomcat2 with tomcat 3 as well. The page keep
refreshing it self for some time and suddenly it finished refreshing and I
can see the original page as well.

Regards
*Muhammad Shoaib*

Software Engineer
National University of Computer and Emerging Sciences
A. K. Brohi Road (Near Police Line) H11/4 Islamabad

Semantic Web Consultant / Knowledge Engineer
Allainet Cooperation Private Limited
I8/3 Islamabad Pakistan

T +92-(51)-111-128-128 Ext 344 | M +92-334-5577712
muhammad.sho...@live.com




On Wed, Jan 26, 2011 at 03:18, Michael Ludwig  wrote:

> Shoaib M. Chaudhary schrieb am 26.01.2011 um 15:48 (+0500):
>
> > I am trying to use mod_jk with tomcat 5.5.3x. When I use mode_jk with
> > one worker it works fine
>
> Okay.
>
> > but when I use loadbalancer with two different tomcats the server
> > doesn't response
>
> No response at all? Or some error status?
>
> > but always try to refresh the page.
>
> It's not clear to me what you're doing nor what's happening.
>
> What about providing a more precise description of your setup (like
> config) and observations?
>
> --
> Michael Ludwig
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: ServletWebRequest.getServletPath() returns strange values on uris with german umlauts

2011-01-26 Thread Konstantin Kolinko
2011/1/27 asbachb :
> Like mentioned in the CharacterEncoding FAQs I already setup URIEncoding and
> useBodyEncodingForURI attribute in my server.xml configuration.

URIEncoding and useBodyEncodingForURI  are alternatives. Do not use
both at the same time.  My understanding of /docs/config/http.html is
that useBodyEncodingForURI overrides URIEncoding. So, what is your
"body encoding" in this case?


> wicket-umlauts-1.0-SNAPSHOT.war

Where is its source code?

> META-INF/context.xml
> 

Do not use "path" in context.xml that is inside the webapp. That
attribute is ignored there.


Best regards,
Konstantin Kolinko

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



ServletWebRequest.getServletPath() returns strange values on uris with german umlauts

2011-01-26 Thread asbachb

Hello,

Environment: Tomcat 7.0.6 - Java 1.6_22 - Ubuntu 10.10

I got some problems with a wicket application which decodes parameters into
path of the uri. When calling getServletPath() on that uris, containig
umlauts the method will return some wrong encoded path.
In my sample application the method returns "/page/param/välue-xxx" but I
would expect "/page/param/välue-xxx".

Like mentioned in the CharacterEncoding FAQs I already setup URIEncoding and
useBodyEncodingForURI attribute in my server.xml configuration.

Feel free to have a look at my sample application attached.

http://old.nabble.com/file/p30770590/wicket-umlauts-1.0-SNAPSHOT.war
wicket-umlauts-1.0-SNAPSHOT.war 

I tested the same Application also in the bundled netbeans version 6.0.29
and latest GlassFish version which worked without problems.

Any ideas how to solve that issue?

Kind Regards,
Benjamin
-- 
View this message in context: 
http://old.nabble.com/ServletWebRequest.getServletPath%28%29-returns-strange-values-on-uris-with-german-umlauts-tp30770590p30770590.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: java.net.URLEncoder.encode quotes wrong under (my) Tomcat environment

2011-01-26 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Jo,

On 1/26/2011 5:25 PM, Joachim Seibert wrote:
> actually I have the problem, that the static encode method from
> java.net.URLEncoder encodes under the command line different as the
> tomcat environment on my machine (my workmate with exactly the same
> setup - see below - doesn't have this problem).

Sounds like a problem with your Java kit: Tomcat has nothing to do with
java.net.URLEncoder.

Are you /absolutely sure/ you are running the same code?

> The char "@" is not quoted to "%40" while running under tomcat (servlet).
> 
> Any idea which java System environment variable could affect this
> behavior? And which role tomcat plays with this error?

I don't believe there are any environment variables that affect the
operation of URLEncoder.encode. Tomcat does not intercept anything like
this.

> Example.
> Under the command line:
> System.out.println(URLEncoder.encode("an@", "UTF-8")); => an%40
> 
> Under Tomcat (in a servlet):
> System.out.println(URLEncoder.encode("an@", "UTF-8")); => an@

What do your "import" statements look like?

> My system:
> java version "1.6.0_22"
> Java(TM) SE Runtime Environment (build 1.6.0_22-b04-307-10M3261)
> Java HotSpot(TM) 64-Bit Server VM (build 17.1-b03-307, mixed mode)
> 
> Tomcat version: 6.0.20

No matter what else: upgrade. Your version of Tomcat is quite old.

> Mac Os X 10.6.6

...and your workmate's setup?

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

iEYEARECAAYFAk1AsNQACgkQ9CaO5/Lv0PBACgCfVoM4jMu7dQgra4P2bD+f4WDc
BB8AoIuFAa4FOABVBPxQeKv1Z3TO0A8n
=YukP
-END PGP SIGNATURE-

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



Re: Tomcat reuses threads and connection instances

2011-01-26 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Blake,

On 1/26/2011 4:05 PM, Blake McBride wrote:
> The first time a particular web service is called tomcat starts a thread to
> run it on and creates an instance of the class that implements the web
> service.  All fine.  However, if after the first call to the web service
> completes another call to the same web service occurs, tomcat reuses the
> same thread and the same instance.  Of course this gives me old values for
> thread local storage and instance variables for that web service.

Oh noes!!!111!!!ELEVEN

Seriously, this is how the server world works.

> This is highly unexpected.

Perhaps by you, but this behavior is entirely intentional.

> Is there a way to configure tomcat to have it give me a new instance of the
> web service class each time?

That depends: when you say "web service", what do you mean? Are you
using a library like Apache Axis or do you have a (relatively) simple
servlet handling the requests?

The rules of thumb are:

1. Don't use ThreadLocal unless you
  a) Know what you're doing
  b) Clean up after yourself
 and
  c) Know what you're doing

2. Don't use any class members that aren't expected to be used for all
   requests for all time. Basically, that means don't use them. Instead,
   use locals in your service() (or doGet/doPost/whatever) method
   and/or use request attributes to store your data.

> In terms of the repeated thread use and thread local storage I have, for the
> time being, started manually resetting the thread local storage.  Is there a
> conventional solution to this problem?

Your thread should reset ThreadLocals when you're done using the thread:
at the end of the request. Don't forget to handle error conditions and
clean up in finally blocks.

Why are you using ThreadLocals in the first place? The only legitimate
uses I've seen for them are performance optimizations where the
ThreadLocal actually /should/ outlive the request and weird stuff like
passing data to Log4j loggers through lazy API (non-)usage. I'm not
convinced ThreadLocals are a good idea at all.

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

iEUEARECAAYFAk1AsB4ACgkQ9CaO5/Lv0PB0KgCgq/oBUPbokm0RxU2TJUUbTc5o
P14AmNWkViWqWDzayx274G/ghV0oStw=
=xJXy
-END PGP SIGNATURE-

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



Re: Tomcat Form Authentication that requires no password for third party SSO

2011-01-26 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Beau,

On 1/26/2011 1:10 PM, beau.hutche...@thomsonreuters.com wrote:
> I am trying to integrate my application with an SSO partner application.

What Tomcat version? I ask because Tomcat 7 includes the Servlet 3.0
programmatic login API.

> After successfully logging into the partner app, I will be redirected
> and only provided a username to log into my tomcat Form Authentication
> app. I am using a DataSourceRealm to check for both Users and User
> Roles.

DataSourceRealm requires both username and password. I think JAASRealm
might be able to help you. Also, one of the list contributors (Pid) is
working on a realm to help with OpenSSO or something like that: he may
have some ideas about how to set things up.

> Are there any suggestions as to how I can still authenticate() through
> the tomcat container without providing a password?

Out of the box, I don't believe Tomcat can do this.

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

iEYEARECAAYFAk1ArocACgkQ9CaO5/Lv0PBVWwCgwvN2jma89OEB0QLPo+rAAnOX
luAAoI/QXqxD1ZX3DhevcyxCyJDL+eCc
=QXO9
-END PGP SIGNATURE-

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



Re: java-process blocks cpu core to 100%

2011-01-26 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Chris,

On 1/26/2011 12:05 PM, Christoph Balthaus wrote:
> Connected by eclipse I discovered the following:
> when I suspend thread by thread, the load dropped when I suspend *
> "Daemon Thread [Attach handler] (Suspended)".*
> 
> 
> ... [Remote Java Application]
> IBM J9 VM[localhost:1]
> Thread [main] (Suspended)
> Daemon Thread [Signal Dispatcher] (Suspended)
>* Daemon Thread [Attach handler] (Suspended)*
> AttachHandler.
> setlastException(Exception) line: 449
> AttachHandler.run() line: 165

Can you run jstack against this process instead of Eclipse's tool? Paste
the entire trace unless it contains some sensitive information.

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

iEYEARECAAYFAk1ArVkACgkQ9CaO5/Lv0PBY9QCdH1DoF2KTSQUN0dDZa5cJEK52
TC0AnjH1bsH8fa1n3bJeLeKLJ+km2cCA
=wEUc
-END PGP SIGNATURE-

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



Re: 400 error when a request does not map to a context

2011-01-26 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Konstantin,

On 1/26/2011 10:55 AM, Konstantin Kolinko wrote:
> 2011/1/25 Christopher Schultz :
>> Should I expect that a request that doesn't map to a running context
>> should return a 400 error? I would have expected a 404 Not Found.
>>
>> Tomcat 6.0.29 and Tomcat 7.0.6 both behave this way.
>>
>> With no ROOT context deployed, make a request to something that doesn't
>> map to a deployed webapp, like "/nocontext" or even "/" and you'll get a
>> 400 Bad Request.
> 
> It is a known issue, but I think that it is only of concern when the
> ROOT webapp is temporarily unavailable, e.g. being redeployed.
> In normal operation people do not see it.

My webapps are deployed into separate containers and so I usually don't
have a ROOT webapp deployed at all. Things usually go through mod_jk so
I don't see this kind of thing often but I was surprised to see a 400
response... at first I thought ff had gone braindead. :)

> Do you want to propose a patch? To return 404 instead of 400 when
> request cannot be matched.

That would be my proposal.

> 1) I think that it is somewhere around the Mapper class
> 2) I think that it is not possible to return well known green "page
> 404" html page (as valve is not available), but at least we can give
> blank response with correct HTTP result code (like Http11Processor and
> others do).

We have default error pages for things like 404, right? Why not use
those? Is it because without a context, the valve that usually handles
that stuff isn't available? Perhaps a valve chain could be built for
contextless requests or something like that. I'm sure that'll ruffle a
few feathers around here :)

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

iEYEARECAAYFAk1ArLcACgkQ9CaO5/Lv0PBDuACgvZ/IrwM9RLaIjaTdXDjqKDxP
oIsAnReNCVk+jLW7h360KlkM89bDF56b
=icka
-END PGP SIGNATURE-

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



Did the performance metrics from the Oct meetup ever get posted to the wiki?

2011-01-26 Thread Jason Pringle

I can't find a link, and don't seem to find an email posting in the archives...

We're looking exactly at this topic and any additional info would be great to 
have.

Also, I know the tests were driven on 6.0.20; would there be an expectation of 
a significant delta on 7.0.x?

We are planning to run our own suite of tests, but any inputs are extremely 
helpful :)

---
Jason Pringle

This message and the information contained herein is proprietary and 
confidential and subject to the Amdocs policy statement,
you may review at http://www.amdocs.com/email_disclaimer.asp

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



java.net.URLEncoder.encode quotes wrong under (my) Tomcat environment

2011-01-26 Thread Joachim Seibert
Hi there,

actually I have the problem, that the static encode method from 
java.net.URLEncoder encodes under the command line different as the tomcat 
environment on my machine (my workmate with exactly the same setup - see below 
- doesn't have this problem).

The char "@" is not quoted to "%40" while running under tomcat (servlet).

Any idea which java System environment variable could affect this behavior? And 
which role tomcat plays with this error?

Example.
Under the command line:
System.out.println(URLEncoder.encode("an@", "UTF-8")); => an%40

Under Tomcat (in a servlet):
System.out.println(URLEncoder.encode("an@", "UTF-8")); => an@

My system:
java version "1.6.0_22"
Java(TM) SE Runtime Environment (build 1.6.0_22-b04-307-10M3261)
Java HotSpot(TM) 64-Bit Server VM (build 17.1-b03-307, mixed mode)

Tomcat version: 6.0.20

Mac Os X 10.6.6

Thanks a lot for your help.
Yours 
Jo Seibert
www.twitter.com/jseibert




smime.p7s
Description: S/MIME cryptographic signature


Tomcat reuses threads and connection instances

2011-01-26 Thread Blake McBride
Greetings,

I have a web service app that runs under tomcat.  I just noticed the
following unexpected behavior.

The first time a particular web service is called tomcat starts a thread to
run it on and creates an instance of the class that implements the web
service.  All fine.  However, if after the first call to the web service
completes another call to the same web service occurs, tomcat reuses the
same thread and the same instance.  Of course this gives me old values for
thread local storage and instance variables for that web service.  This is
highly unexpected.

Is there a way to configure tomcat to have it give me a new instance of the
web service class each time?

In terms of the repeated thread use and thread local storage I have, for the
time being, started manually resetting the thread local storage.  Is there a
conventional solution to this problem?

Thanks.

Blake McBride


Re: Cannot get manager/html access

2011-01-26 Thread André Warnier

Dave Carlson wrote:

Thanks. I can't believe that I missed those


Don't feel too bad. The average is about two per month here.
You may be the first this year though.

I rather like these comment signs.  They provide me with easy kudos, to be able to help on 
this list at my own level of expertise.





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



Re: Cannot get manager/html access

2011-01-26 Thread Dave Carlson

Thanks. I can't believe that I missed those


On Wed, Jan 26, 2011 at 12:26 PM, André Warnier wrote:


Hi.

Just make absolutely sure that you have not, for instance, forgotten 
to remove the XML comment signs around the section below.


Dave Carlson wrote:


I am using tomcat 6.0.30 and cannot get the authentication correct 
using tomcat-users.xml. Here is my tomcat-users:


   ??


-
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: Cannot get manager/html access

2011-01-26 Thread André Warnier

Hi.

Just make absolutely sure that you have not, for instance, forgotten to remove the XML 
comment signs around the section below.


Dave Carlson wrote:


I am using tomcat 6.0.30 and cannot get the authentication correct using 
tomcat-users.xml. Here is my tomcat-users:


   ??


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



Tomcat Form Authentication that requires no password for third party SSO

2011-01-26 Thread beau.hutcheson

Hello:
I am trying to integrate my application with an SSO partner application.

After successfully logging into the partner app, I will be redirected
and only provided a username to log into my tomcat Form Authentication
app. I am using a DataSourceRealm to check for both Users and User
Roles.

Are there any suggestions as to how I can still authenticate() through
the tomcat container without providing a password?

Thanks for your attention,

Beau

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



Cannot get manager/html access

2011-01-26 Thread Dave Carlson


I am using tomcat 6.0.30 and cannot get the authentication correct using 
tomcat-users.xml. Here is my tomcat-users:

  
  
  
  
  
  
  
  

My server.xml has this in it:
 


  

I have tried not using the manager role also. No matter what I do i get 
the 401 page like this:


You are not authorized to view this page. If you have not changed any 
configuration files, please examine the file conf/tomcat-users.xml in 
your installation. That file must contain the credentials to let you use 
this webapp.


For example, to add the manager-gui role to a user named tomcat with a 
password of s3cret, add the following to the config file listed above.





Note that for Tomcat 6.0.30 onwards, the roles required to use the 
manager application were changed from the single manager role to the 
following four roles. You will need to assign the role(s) required for 
the functionality you wish to access.


* manager-gui - allows access to the HTML GUI and the status pages
* manager-script - allows access to the text interface and the 
status pages

* manager-jmx - allows access to the JMX proxy and the status pages
* manager-status - allows access to the status pages only

The HTML interface is protected against CSRF but the text and JMX 
interfaces are not. To maintain the CSRF protection:


* The deprecated manager role should not be assigned to any user.
* Users with the manager-gui role should not be granted either the 
manager-script or manager-jmx roles.
* If the text or jmx interfaces are accessed through a browser 
(e.g. for testing since these interfaces are intended for tools not 
humans) then the browser must be closed afterwards to terminate the 
session.


For more information - please see the Manager App HOW-TO.


Any information on how to set this up would be appreciated.

Thanks


Re: Tomcat Adapter for Eclipse 3.5 Galileo?

2011-01-26 Thread VincentBlouin

Hi, I had the same problem, then in Eclipse I went to help >> install new
software >> choose eclipse web tool platform repository -
http://download.eclipse.org/eclipse/updates/3.5 from the dropdown menu >>
then I checked "Project Provided Components" and installed it. After that I
saw the tomcat servers at the server runtime menu that is : ( window >>
preferences >> server >> runtime environment >> Add) 


Michael Ludwig-4 wrote:
> 
> I seem to remember that Eclipse 3.4 (Ganymede) with WTP (Web Tools
> Platform) had configurations for Tomcat 5.5 and 6.0 in the Servers
> view that I just had to hook up with my local Tomcat installation
> in order to get things working.
> 
> Now I downloaded Eclipse 3.5 (Galileo), and there are no configurations
> whatsoever in the Servers view. On clicking "Download additional server
> adapters" from the New Server dialog, I'm presented with a list of
> adapters including Geronimo, Glassfish, Jetty, and others, but Tomcat
> is missing.
> 
> Did some googling and FAQ reading, but to no avail.
> 
> Does anyone know what steps I have to undertake in oder to get the
> Tomcat adapter working within Eclipse 3.5 Galileo?
> 
> Michael Ludwig
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Tomcat-Adapter-for-Eclipse-3.5-Galileo--tp24497869p30765871.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



java-process blocks cpu core to 100%

2011-01-26 Thread Christoph Balthaus
Hello!

We are running
tomcat6 - Apache Servlet/JSP Engine, RI for Servlet 2.5/JSP 2.1 API
6.0.18-20.3.1
on Suse Linux Enterprise 11
JVM is java-1_6_0-ibm - Java(TM) 6 Runtime Environment  1.6.0_sr7.0-1.6.21
cpu is a quad core cpu with ht (xeon 5500)

The problem is that directly after startup, the java process blocks 1 core
to 100% (seen by 'top').
There are no additional webapps deployed, not even the manager application.

I'm using apache2 2.2.10-2.24.5 with mod_proxy and mod_proxy_ajp, not sure
if I'm also using APR.

Connected by eclipse I discovered the following:
when I suspend thread by thread, the load dropped when I suspend *
"Daemon Thread [Attach handler] (Suspended)".*


... [Remote Java Application]
IBM J9 VM[localhost:1]
Thread [main] (Suspended)
Daemon Thread [Signal Dispatcher] (Suspended)
   * Daemon Thread [Attach handler] (Suspended)*
AttachHandler.
setlastException(Exception) line: 449
AttachHandler.run() line: 165
Daemon Thread
[ContainerBackgroundProcessor[StandardEngine[Catalina]]] (Suspended)
Daemon Thread [TP-Processor1] (Suspended)
Daemon Thread [TP-Processor2] (Suspended)
Daemon Thread [TP-Processor3] (Suspended)
Daemon Thread [TP-Processor4] (Suspended)
Daemon Thread [TP-Monitor] (Suspended)
Daemon Thread [TP-Processor1] (Suspended)
Daemon Thread [TP-Processor2] (Suspended)
Daemon Thread [TP-Processor3] (Suspended)
Daemon Thread [TP-Processor4] (Suspended)
Daemon Thread [TP-Monitor] (Suspended)


The in the context of that thread I discovered that there occured an
exception:

Context @AttachHandler.setlastException(Exception) line: 449

thisAttachHandler  (id=1972)
lastExceptionIOException  (id=1803)
causeIOException  (id=1803)
causeIOException  (id=1803)
detailMessage"wait error on semaphore _notifier status = -151"
(id=1870)
stackTracenull
walkback (id=1876)
detailMessage"wait error on semaphore _notifier status = -151"
(id=1870)
stackTracenull
walkback (id=1876)



What can I do?

Your help is appreciated ;)

greetings,
Chris


Re: [OT] 400 error when a request does not map to a context

2011-01-26 Thread Konstantin Kolinko
2011/1/26 André Warnier :
> By the way, having had my curiosity triggered by what Chris was reporting, I
> scanned the Servlet Spec 3.0 for mentions of the "ROOT" (default) context,
> and could not really find much of relevance.
> Namely, it does not mention that one is required.  Is it ?
> And it also does not mention webapps/ROOT as being a default context, or
> even as corresponding necessarily to the "top of the URL space".
> So, my question is : is "webapps/ROOT" purely a Tomcat thing, or did I miss
> something in the Servlet Spec ?
>

It is just the context that is mapped to path "". Naming it "ROOT" is
a Tomcat convention.

Technically, you can put  element into server.xml and use any
name there.

Best regards,
Konstantin Kolinko

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



Re: [OT] 400 error when a request does not map to a context

2011-01-26 Thread André Warnier

Konstantin Kolinko wrote:

2011/1/25 Christopher Schultz :

Should I expect that a request that doesn't map to a running context
should return a 400 error? I would have expected a 404 Not Found.

Tomcat 6.0.29 and Tomcat 7.0.6 both behave this way.

With no ROOT context deployed, make a request to something that doesn't
map to a deployed webapp, like "/nocontext" or even "/" and you'll get a
400 Bad Request.


It is a known issue, but I think that it is only of concern when the
ROOT webapp is temporarily unavailable, e.g. being redeployed.
In normal operation people do not see it.

Do you want to propose a patch? To return 404 instead of 400 when
request cannot be matched.

1) I think that it is somewhere around the Mapper class
2) I think that it is not possible to return well known green "page
404" html page (as valve is not available), but at least we can give
blank response with correct HTTP result code (like Http11Processor and
others do).


HTTP Spec says 400 means "The request could not be understood by the
server due to malformed syntax" but the request is perfectly valid.




By the way, having had my curiosity triggered by what Chris was reporting, I scanned the 
Servlet Spec 3.0 for mentions of the "ROOT" (default) context, and could not really find 
much of relevance.

Namely, it does not mention that one is required.  Is it ?
And it also does not mention webapps/ROOT as being a default context, or even as 
corresponding necessarily to the "top of the URL space".
So, my question is : is "webapps/ROOT" purely a Tomcat thing, or did I miss something in 
the Servlet Spec ?




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



Re: 400 error when a request does not map to a context

2011-01-26 Thread Konstantin Kolinko
2011/1/25 Christopher Schultz :
> Should I expect that a request that doesn't map to a running context
> should return a 400 error? I would have expected a 404 Not Found.
>
> Tomcat 6.0.29 and Tomcat 7.0.6 both behave this way.
>
> With no ROOT context deployed, make a request to something that doesn't
> map to a deployed webapp, like "/nocontext" or even "/" and you'll get a
> 400 Bad Request.

It is a known issue, but I think that it is only of concern when the
ROOT webapp is temporarily unavailable, e.g. being redeployed.
In normal operation people do not see it.

Do you want to propose a patch? To return 404 instead of 400 when
request cannot be matched.

1) I think that it is somewhere around the Mapper class
2) I think that it is not possible to return well known green "page
404" html page (as valve is not available), but at least we can give
blank response with correct HTTP result code (like Http11Processor and
others do).

> HTTP Spec says 400 means "The request could not be understood by the
> server due to malformed syntax" but the request is perfectly valid.

Best regards,
Konstantin Kolinko

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



Re: Problem with overriding parameters via context.xml

2011-01-26 Thread chris derham
Chuck,

Thanks for your quick response. I have tried placing the context.xml file in
the location you suggested and no change.

I didn't mention in m original post, but our context.xml also contains
resource definitions to connect to the database/smtp server. These settings
are being picked up fine - its just the parameters that seem to have changed
behaviour moving from 6.0.29 to 6.0.30

Thanks

Chris

On Wed, Jan 26, 2011 at 1:02 PM, Caldarale, Charles R <
chuck.caldar...@unisys.com> wrote:

> > From: cjder...@gmail.com [mailto:cjder...@gmail.com] On Behalf Of chris
> derham
> > Subject: Problem with overriding parameters via context.xml
>
> > So I create a context.xml file in catalina_base\conf\context.xml
> > containing the following
>
> That could be a problem.  The context.xml file in the conf directory is the
> global one, containing the default settings for _all_ webapps.  It would be
> better (perhaps required) to place the specific attributes in the 
> element for the webapp of interest, either in the webapp's
> META-INF/context.xml file, or in conf/Catalina/[host]/[appName].xml.
>
>  - 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: Problem with overriding parameters via context.xml

2011-01-26 Thread Caldarale, Charles R
> From: cjder...@gmail.com [mailto:cjder...@gmail.com] On Behalf Of chris derham
> Subject: Problem with overriding parameters via context.xml

> So I create a context.xml file in catalina_base\conf\context.xml
> containing the following

That could be a problem.  The context.xml file in the conf directory is the 
global one, containing the default settings for _all_ webapps.  It would be 
better (perhaps required) to place the specific attributes in the  
element for the webapp of interest, either in the webapp's META-INF/context.xml 
file, or in conf/Catalina/[host]/[appName].xml.  

 - 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



Problem with overriding parameters via context.xml

2011-01-26 Thread chris derham
All,

I appear to have an issue with tomcat 6.0.30 not allowed web.xml parameters
to be over-ridden via context.xml file entries. This works fine in tomcat
6.0.29.

I have a parameter defined in web.xml, like this


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";
 version="2.4">


log4jConfigLocation
WEB-INF/classes/log4j.dev.xml


Then in context.xml I wish to override this parameter in different
deployment environments. So I create a context.xml file in
catalina_base\conf\context.xml containing the following






I then have a jsp file that contains the following

<%@ page contentType="text/html; charset=UTF-8" %>


log4jConfigLocation is : ${initParam.log4jConfigLocation}



Using 6.0.29 the jsp shows the value present in the context.xml file, e.g.
expected behaviour. In 6.0.30 the value from the web.xml file is shown, e.g.
the required override hasn't happened.

I have read the release notes, and can't see anything that jumps out to me
saying that this behaviour has changed. Is this a defect in tomcat, or a
desired change or behaviour? If the latter, can anyone provide any pointers
as to how I can achieve my stated goal? My only current work around is to
revert to 6.0.29

Thanks

Chris


RE: 400 error when a request does not map to a context

2011-01-26 Thread Caldarale, Charles R
> From: Pid [mailto:p...@pidster.com] 
> Subject: Re: 400 error when a request does not map to a context

> There was a list discussion about this recently, which I thought 
> led to a BZ, but I can't see it now.

You might be thinking of this one:
http://issues.apache.org/bugzilla/show_bug.cgi?id=49536

Symptoms were slightly different, and it was for Tomcat 7 only.

 - 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: mail.jar, activation.jar and classloading

2011-01-26 Thread Konstantin Kolinko
2011/1/26 Michael Ludwig :
> What is special about mail.jar (and activation.jar) that requires
> putting them into the common.loader?
>
> Quote from the Tomcat docs:
>
>  Unpackage the distribution(s) and place mail.jar (and activation.jar
>  if required) into $CATALINA_HOME/lib so the JAR(s) is(are) available
>  to Tomcat during the initialization of the mail Session Resource.
>
> http://tomcat.apache.org/tomcat-6.0-doc/jndi-resources-howto.html
>
> This question is spawned by a recent thread on the Ant mailing list,
> where the same question was raised in the context of classloading
> issues, but not answered.
>

It just says that you need to get those jars by yourself.

I have not verified the following, but I suspect that it is because of
their license.

> Mail task with mail.jar & activation.jar out of lib folder
> http://ant.markmail.org/thread/ojjm7g5otejua33i
>

Best regards,
Konstantin Kolinko

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



Re: mail.jar, activation.jar and classloading

2011-01-26 Thread Mikolaj Rydzewski


On Wed, 26 Jan 2011 12:24:58 +0100, Michael Ludwig  
wrote:

Mikolaj Rydzewski schrieb am 26.01.2011 um 12:07 (+0100):


On Wed, 26 Jan 2011 11:52:04 +0100, Michael Ludwig 
wrote:
>What is special about mail.jar (and activation.jar) that requires
>putting them into the common.loader?

Any objects you want have access to via JNDI, have to be accessible
by tomcat in order to create them. That means they should be located
in common classloader.


Thanks. So nothing intrinsically special about mail.jar itself?


Nothing I'm aware of.
You can place it in WEB-INF/lib but you won't be able to retrieve mail 
session from JNDI.


--
Mikolaj Rydzewski 

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



Re: mail.jar, activation.jar and classloading

2011-01-26 Thread Michael Ludwig
Mikolaj Rydzewski schrieb am 26.01.2011 um 12:07 (+0100):
> 
> On Wed, 26 Jan 2011 11:52:04 +0100, Michael Ludwig 
> wrote:
> >What is special about mail.jar (and activation.jar) that requires
> >putting them into the common.loader?
> 
> Any objects you want have access to via JNDI, have to be accessible
> by tomcat in order to create them. That means they should be located
> in common classloader.

Thanks. So nothing intrinsically special about mail.jar itself?

-- 
Michael Ludwig

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



Re: mail.jar, activation.jar and classloading

2011-01-26 Thread Michael Ludwig
Ronald Klop schrieb am 26.01.2011 um 12:08 (+0100):
> For the record: JAF (activation.jar) is already in Java 6 (and that
> sucks :-)).

It might (I don't know).

Mail.jar, however, isn't in Java 6 SE. And from the discussion on the
Ant list it appeared that there was something special about this jar
that requires special classloader treatment.

> >Mail task with mail.jar & activation.jar out of lib folder
> >http://ant.markmail.org/thread/ojjm7g5otejua33i

-- 
Michael Ludwig

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



Re: mod_jk load balancing problem

2011-01-26 Thread Michael Ludwig
Shoaib M. Chaudhary schrieb am 26.01.2011 um 15:48 (+0500):

> I am trying to use mod_jk with tomcat 5.5.3x. When I use mode_jk with
> one worker it works fine

Okay.

> but when I use loadbalancer with two different tomcats the server
> doesn't response

No response at all? Or some error status?

> but always try to refresh the page.

It's not clear to me what you're doing nor what's happening.

What about providing a more precise description of your setup (like
config) and observations?

-- 
Michael Ludwig

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



Re: mail.jar, activation.jar and classloading

2011-01-26 Thread Ronald Klop

For the record: JAF (activation.jar) is already in Java 6 (and that sucks :-)).


Op woensdag, 26 januari 2011 11:52 schreef Michael Ludwig :


 
What is special about mail.jar (and activation.jar) that requires

putting them into the common.loader?

Quote from the Tomcat docs:

  Unpackage the distribution(s) and place mail.jar (and activation.jar
  if required) into $CATALINA_HOME/lib so the JAR(s) is(are) available
  to Tomcat during the initialization of the mail Session Resource.

http://tomcat.apache.org/tomcat-6.0-doc/jndi-resources-howto.html

This question is spawned by a recent thread on the Ant mailing list,
where the same question was raised in the context of classloading
issues, but not answered.

Mail task with mail.jar & activation.jar out of lib folder
http://ant.markmail.org/thread/ojjm7g5otejua33i

Thanks.
--
Michael Ludwig

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

 






Re: mail.jar, activation.jar and classloading

2011-01-26 Thread Mikolaj Rydzewski


On Wed, 26 Jan 2011 11:52:04 +0100, Michael Ludwig  
wrote:

What is special about mail.jar (and activation.jar) that requires
putting them into the common.loader?


Any objects you want have access to via JNDI, have to be accessible by 
tomcat in order to create them. That means they should be located in 
common classloader.


--
Mikolaj Rydzewski 

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



mail.jar, activation.jar and classloading

2011-01-26 Thread Michael Ludwig
What is special about mail.jar (and activation.jar) that requires
putting them into the common.loader?

Quote from the Tomcat docs:

  Unpackage the distribution(s) and place mail.jar (and activation.jar
  if required) into $CATALINA_HOME/lib so the JAR(s) is(are) available
  to Tomcat during the initialization of the mail Session Resource.

http://tomcat.apache.org/tomcat-6.0-doc/jndi-resources-howto.html

This question is spawned by a recent thread on the Ant mailing list,
where the same question was raised in the context of classloading
issues, but not answered.

Mail task with mail.jar & activation.jar out of lib folder
http://ant.markmail.org/thread/ojjm7g5otejua33i

Thanks.
-- 
Michael Ludwig

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



mod_jk load balancing problem

2011-01-26 Thread Shoaib M. Chaudhary
Hello,

I am trying to use mod_jk with tomcat 5.5.3x. When I use mode_jk with one
worker it works fine but when I use loadbalancer with two different tomcats
the server doesn't response but always try to refresh the page. Can any one
help me out please.

Regards *
Shoaib
*