Different behavior between Tomcat service installation Tomcat console mode

2011-08-01 Thread Alexandre Terrasson
Hi guys,
here my problem :

I have a web application that use a Jdbc driver/connection to connect to a
proprietary application.
I did my developments and tests on a Tomcat 6.0.32 with scripts startup
(startup.bat) and all works fine. But when I tried to test the web app on
the production server where a Tomcat 6.0.32 is installed as a service, it
don't work 

I don't get a ClassNotFoundException, the class of the driver is well
configured, but I don't know, may be not really well loaded.

What intrigate me is why the two ways of using Tomcat has not the same
behavior ? And how to acquieve that the service mode having the same way of
working as the script ways (console mode) ?
I tend to say that could be a problem of classpath but don't really know ...

I'm working on Windows 7 x64 or Windows Server 2008 x64 with Apache Tomcat
x86 in Service mode or scripts mode (console mode). I have no classpath
environment variable, and use a Jdk 1.6.0_19.

Any help would be greatly appreciated.

Thanks :)

Alex.


Re: Different behavior between Tomcat service installation Tomcat console mode

2011-08-01 Thread Konstantin Kolinko
2011/8/1 Alexandre Terrasson alexandre.terras...@gmail.com:
 Hi guys,
 here my problem :

 I have a web application that use a Jdbc driver/connection to connect to a
 proprietary application.
 I did my developments and tests on a Tomcat 6.0.32 with scripts startup
 (startup.bat) and all works fine. But when I tried to test the web app on
 the production server where a Tomcat 6.0.32 is installed as a service, it
 don't work 

 I don't get a ClassNotFoundException, the class of the driver is well
 configured, but I don't know, may be not really well loaded.

 What intrigate me is why the two ways of using Tomcat has not the same
 behavior ? And how to acquieve that the service mode having the same way of
 working as the script ways (console mode) ?
 I tend to say that could be a problem of classpath but don't really know ...

 I'm working on Windows 7 x64 or Windows Server 2008 x64 with Apache Tomcat
 x86 in Service mode or scripts mode (console mode). I have no classpath
 environment variable, and use a Jdk 1.6.0_19.

 Any help would be greatly appreciated.

1. What exactly is in the logs?
2. Where is your driver JAR located?  Is is a thin driver (only a JAR)?
3. Note that the service is by default executed in a service account
with limited privileges. It is fine in most cases but sometimes you
may want to configure it to run as a specific user.
4. Firewalls.

5. You can use bat files from any zip distributive to start Tomcat in a console.

Best regards,
Konstantin Kolinko

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



Re: [Tomcat 6.0.29] Why do I have to configure the datasource in the context.xml of the server and in the context.xml of the application?

2011-08-01 Thread Ognjen Blagojevic

Hi AN,

On 30.7.2011 22:34, AN wrote:

(...) I'm using Liferay (the application is a portlet).


I believe that you cannot apply webapp configuration to portlets. It is 
probably better if you ask your question at Liferay mailing lists.


-Ognjen

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



Tomcat 7 and Java 7

2011-08-01 Thread Jarnagin.Andrew
I want to use Java 7 features in Servlets with Tomcat 7. I have tried
unsuccessfully to deploy Tomcat 7 with Java 7. I also tried compile
Tomcat 7 with Java 7 and failed as well. It is likely that I am doing
something wrong. I want to deploy in Windows XP. I haven't found any
news confirming that this is possible. I have noticed some entries of
startup speeds of Tomcat 7 under Java 7. Has anyone successfully
deployed Tomcat 7 under Java 7? If so is there something I am missing?

 

Thanks,

Andrew (Trey) Jarnagin | Enterprise Architect | SunTrust Banks |
678-429-2080 
  
  
  
LEGAL DISCLAIMER 
The information transmitted is intended solely for the individual or entity to 
which it is addressed and may contain confidential and/or privileged material. 
Any review, retransmission, dissemination or other use of or taking action in 
reliance upon this information by persons or entities other than the intended 
recipient is prohibited. If you have received this email in error please 
contact the sender and delete the material from any computer. 
  
SunTrust is a federally registered service mark of SunTrust Banks, Inc. Live 
Solid. Bank Solid. is a service mark of SunTrust Banks, Inc. 
[ST:XCL] 
 
 
 
 


Re: html meta http-equiv content-type not work ?

2011-08-01 Thread Marvin Addison
 I think you mean any attempt to WRITE The RESPONSE.

I took some time to verify the effect I described,
https://github.com/serac/charset-test.  Reading data from the request
body coerces the encoding as I claimed.  Simply swap the order of the
filter-mappings in web.xml and post some unicode data to see for
yourself.  If ConsumeRequestFilter appears before
CharacterEncodingFilter, the posted data will not be treated as UTF-8.

 Spring's filter only sets the /request/ encoding, not the response.

Looks like it sets response encoding when forceEncoding == true:

if (this.encoding != null  (this.forceEncoding ||
request.getCharacterEncoding() == null)) {
request.setCharacterEncoding(this.encoding);
if (this.forceEncoding) {
response.setCharacterEncoding(this.encoding);
}
}

(3.0.5 source)

M

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



Re: Tomcat 7 and Java 7

2011-08-01 Thread Mark Thomas
On 01/08/2011 15:25, Jarnagin.Andrew wrote:
 I want to use Java 7 features in Servlets with Tomcat 7. I have tried
 unsuccessfully to deploy Tomcat 7 with Java 7.

Unsuccessful how?

 I also tried compile Tomcat 7 with Java 7 and failed as well.

Failed how?

 It is likely that I am doing something wrong.

With the (lack of) information provided so far, agreed.

 I want to deploy in Windows XP. I haven't found any
 news confirming that this is possible. I have noticed some entries of
 startup speeds of Tomcat 7 under Java 7. Has anyone successfully
 deployed Tomcat 7 under Java 7?

Yes. On Windows XP.

 If so is there something I am missing?

It would appear so.

Mark

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



RE: Tomocat 6.0.20 Comet END Event *NOT RAISED* when connection is terminated

2011-08-01 Thread Sudeep Pradhan
Stale as in, It gives me response which was suppose to be given for the 
previous request (it gives me xml(previous) response instead of json(current)). 
I am not seeing this behavior for HTTP. It occurs only for HTTPS. 

*Though the problem of END event not being raise still happens for HTTP even 
with Tomcat 6.0.32.*

Is this a bug?

Thanks,
Sudeep

-Original Message-
From: Pid [mailto:p...@pidster.com] 
Sent: Saturday, July 30, 2011 2:00 PM
To: Tomcat Users List
Subject: Re: Tomocat 6.0.20 Comet END Event *NOT RAISED* when connection is 
terminated

On 29/07/2011 18:33, Sudeep Pradhan wrote:
 Pid,
 
 I tried Tomcat 6.0.32.. no luck yet. Even ERROR event is not raised.

Can you provide a simple example which exhibits this behaviour?

 Also, I am seeing something weird (may not be related to this problem, but 
 think its worth mentioning). I am seeing stale response on a new connection 
 from curl. I validated this by changing the Accept Header from 
 application/xml to application/json, I get 1 response in xml format and then 
 the connection hangs. Then I do a Ctrl-C and re-try with json. I get the json 
 response. Are the request response object not recycled properly? What can be 
 the possible reason for this?

What is stale?

Take a thread dump when it hangs to see what the app is doing.


p

 Thanks,
 Sudeep 
 
 
 -Original Message-
 From: Pid [mailto:p...@pidster.com] 
 Sent: Friday, July 29, 2011 12:32 AM
 To: Tomcat Users List
 Subject: Re: Tomocat 6.0.20 Comet END Event *NOT RAISED* when connection is 
 terminated
 
 On 28/07/2011 20:42, Sudeep Pradhan wrote:
 Hi,

 I have a CometProcessor Servlet which is used for streaming system events  
 to a http client. I have SSL enabled on the server. I use *curl* as the http 
 client. I get streaming events on the console. But when I do a Ctrl-C on the 
 console there no End event is raised and hence the connection is not cleaned 
 up (I have connection registry for keeping track of clients).  What can be 
 the explanation for this scenario?

 Thanks,
 Sudeep
 
 
 Are you able to upgrade to 6.0.32?  There have been many fixes to the
 NIO connector since 6.0.20 - not that this is necessarily your problem.
 
 Does the ERROR event fire when curl stops?
 
 
 p
 
 -
 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


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



Re: Tomcat 7 and Java 7

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

Andrew/Trey/Jarnagin,

On 8/1/2011 10:25 AM, Jarnagin.Andrew wrote:
 I want to use Java 7 features in Servlets with Tomcat 7. I have
 tried unsuccessfully to deploy Tomcat 7 with Java 7. I also tried
 compile Tomcat 7 with Java 7 and failed as well. It is likely that I
 am doing something wrong.

Okay, what are you trying and what output are you getting?

 I want to deploy in Windows XP. I haven't found any news confirming
 that this is possible.

Deploying under Windows XP is certainly possible. Installing multiple
side-by-side versions of Sun/Oracle Java is certainly possible as well.
I recommend installing Java 1.6.something and using that with Tomcat
until you are able to get things working with Java 1.7.something.

 I have noticed some entries of startup speeds of Tomcat 7 under Java
 7. Has anyone successfully deployed Tomcat 7 under Java 7? If so is
 there something I am missing?

See Konstantin's recent post with subject [WARNING] Index corruption
and crashes in Apache Lucene Core / Apache Solr with Java 7 indicating
that all is not well with Java 7... nothing specific has been found
(yet?) with Tomcat that suggests that it won't work with Java 7. If you
could provide more detail, it would certainly be helpful.

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

iEYEARECAAYFAk429Q4ACgkQ9CaO5/Lv0PB8NACfXNpnQ/p+h8yS8AgKJa2ySZX3
MWEAn0vxJwPpfHlFvNu7EzEeTy7sFRA8
=oEHx
-END PGP SIGNATURE-

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



HOW TO: re-deploy or undeploy a webapp when additional files are added after initial deployment

2011-08-01 Thread Bob DeRemer
I'm running Tomcat 6.0.32 on Windows Server 2008 R2.

I am running into a problem when managing our webapp via the Tomcat Manager 
App.  Specifically, if I add any files to our WEB-INF/extension directory in 
the exploded WAR directory after the initial deployment, an undeploy fails to 
completely remove our exploded webapp directory.  It removes everything that 
was in the WAR, but leaves the manually added files.  In addition, if we 
attempt to deploy a new WAR when this skeleton directory is left, the deploy 
says it's successful, but doesn't explode the new WAR.

If anyone has any suggestions on how we can add files into the exploded webapp 
structure and still perform undeploy/re-deploy of our webapp, I would greatly 
appreciate it.  Or, if there's a way to tell tomcat to completely remove the 
directory - regardless of additional files/directories, that would probably 
work, too.

The only other options I can think of would be installing these dynamic 
extensions outside the webapp, but that's not ideal since some of these 
extensions will be HTML/CSS content and we'd like to keep it all under the 
webapp root.

Thanks,

Bob DeRemer
Senior Director, Architecture and Development

http://www.thingworx.comhttp://www.thingworx.com/
Skype: bob.deremer
O: 717.505.7923
M: 717.881.3986



Re: HOW TO: re-deploy or undeploy a webapp when additional files are added after initial deployment

2011-08-01 Thread Chema
 If anyone has any suggestions on how we can add files into the exploded 
 webapp structure and still perform undeploy/re-deploy of our webapp, I would 
 greatly appreciate it.  Or, if there's a way to tell tomcat to completely 
 remove the directory - regardless of additional files/directories, that would 
 probably work, too.


Eclipse Hellios' plugins to deploy web applications work fine for me.
You can try Eclipse IDE for Java EE Developers.

When I change any file deployed , it's automatically republished. And
you can clean work folders from IDE.

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



RE: HOW TO: re-deploy or undeploy a webapp when additional files are added after initial deployment

2011-08-01 Thread Bob DeRemer
Thanks, but I need to do this in a production environment, where we're 
deploying/re-deploying a WAR and there is no eclipse IDE.  In addition, I am 
dynamically adding extensions to our webapp without having to restart our 
webapp, which is what republishing from Eclipse does.

-bob

-Original Message-
From: Chema [mailto:demablo...@gmail.com] 
Sent: Monday, August 01, 2011 3:02 PM
To: Tomcat Users List
Subject: Re: HOW TO: re-deploy or undeploy a webapp when additional files are 
added after initial deployment

 If anyone has any suggestions on how we can add files into the exploded 
 webapp structure and still perform undeploy/re-deploy of our webapp, I would 
 greatly appreciate it.  Or, if there's a way to tell tomcat to completely 
 remove the directory - regardless of additional files/directories, that would 
 probably work, too.


Eclipse Hellios' plugins to deploy web applications work fine for me.
You can try Eclipse IDE for Java EE Developers.

When I change any file deployed , it's automatically republished. And you can 
clean work folders from IDE.

-
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: re-deploy or undeploy a webapp when additional files are added after initial deployment

2011-08-01 Thread Mark Thomas
On 01/08/2011 20:32, Bob DeRemer wrote:
 Thanks, but I need to do this in a production environment, where 
 we're deploying/re-deploying a WAR and there is no eclipse IDE.  In 
 addition, I am dynamically adding extensions to our webapp without 
 having to restart our webapp, which is what republishing from
 Eclipse does.

Any messages in the logs? Tomcat 7 will report if it can't delete a
file. I don't recall if Tomcat 6 does.

If a file is under the docBase and is not deleted it is because
something (probably your app) still has the file open. You need to close
the files before you redeploy.

Mark

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



Re: HOW TO: re-deploy or undeploy a webapp when additional files are added after initial deployment

2011-08-01 Thread Chema
2011/8/1 Bob DeRemer bob.dere...@thingworx.com:
 Thanks, but I need to do this in a production environment, where we're 
 deploying/re-deploying a WAR and there is no eclipse IDE.  In addition, I am 
 dynamically adding extensions to our webapp without having to restart our 
 webapp, which is what republishing from Eclipse does.

OK.
I'm not expert and I cannot speak so much about this tool, but you
could have a look at LiveRebel

http://www.zeroturnaround.com/liverebel/

But it's not for free

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



Re: Tomcat 7: Why is JDK needed ?

2011-08-01 Thread Bobi St
Thanks to all for the replies.
So we dont need JDK_HOME, and the message

 Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
 At least one of these environment variable is needed to run this program
is obsolete.
Best regards,

From: Bobi St
Date: Thu, 21 Jul 2011 19:58:53

why is Why is JDK needed also for Tomcat 7 ? Does it use a compiler, or why not 
simply using for example jre6 ?!?
I have to install always extra JDK because of it ...

 Von: Justin Randall 
 21. Juli, 2011 21:01 Uhr

 It uses the Java compiler for activities such as compiling JSPs into 
Servlets into Java class files.

 All versions of Tomcat require the JDK.

 I see. This makes sense.
 P.s. On the other hand the ---or--- in the error message is 
misleading: neither JDK_HOME ---nor--- JRE_HOME is set...

 Von: Konstantin Kolinko 
 21. Juli, 2011 21:09 Uhr

 Wrong. All currently supported versions (5.5, 6.0, 
7.0)
 do not use JDK compiler by default even if it is 
available.
 See documentation for details.

 All of them can run with JRE.

 It is good to have JDK around because of additional 
utilities like jvisualvm etc.

 Bobi St
 22. Juli, 2011 13:15 Uhr

 So, I'm talking about Tomcat 7. According 
to some description, it   doesn't need JDK anymore. 
For this reason under Windows (7) I   didn't 
set it at the beginning (neither did I install it), so the  
 error came: no JDK nor JRE was set (although JRE was set). I tried 
 to set JDK_HOME to jre6 as well, but the same 
error message.

 Only after installing (the latest) JDK, 
and setting JDK_HOMEtowards it, I could 
start Tomcat with the startup.bat

 chris derham
 Freitag, 22. Juli, 2011 14:06 Uhr

 Windows 7
 Tomcat 7.0.19
 java -version
 java version 1.6.0_25
 Java(TM) SE Runtime Environment (build 1.6.0_25-b06)
 Java HotSpot(TM) 64-Bit Server VM (build 20.0-b11, mixed mode)

 Open command prompt, navigate to catalina_home\bin. If JAVA_HOME is not
 set, tomcat complains no JAVA_HOME. If set to a JRE, complains should 
 point
 to JDK. Output shown below

 D:\apps\tomcat\apache-tomcat-7.0.19\binset JAVA_HOME=

 D:\apps\tomcat\apache-tomcat-7.0.19\bincatalina.bat run
 Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
 At least one of these environment variable is needed to run this program

 D:\apps\tomcat\apache-tomcat-7.0.19\binset JAVA_HOME=C:\Program
 Files\Java\jre6


 D:\apps\tomcat\apache-tomcat-7.0.19\bincatalina.bat run
 The JAVA_HOME environment variable is not defined correctly
 This environment variable is needed to run this program
 NB: JAVA_HOME should point to a JDK not a JRE

 Mark Thomas
 22. Juli, 2011 14:13 Uhr
 That is wrong. JAVA_HOME can't point to a JRE. You should be using 
 JRE_HOME here.

 Ognjen Blagojevic
 22. Juli, 2011 14:16 Uhr

 C:\apps\apache-tomcat-7.0.11\binset JRE_HOME=
 C:\apps\apache-tomcat-7.0.11\binset JAVA_HOME=

 C:\apps\apache-tomcat-7.0.11\binstartup.bat
 Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
 At least one of these environment variable is needed to run this program

 C:\apps\apache-tomcat-7.0.11\binset JRE_HOME=C:\Program 
 Files\Java\jre6\

 C:\apps\apache-tomcat-7.0.11\binstartup.bat



Re: Tomcat 7: Why is JDK needed ?

2011-08-01 Thread Mark Thomas
On 01/08/2011 22:27, Bobi St wrote:
 Thanks to all for the replies.
 So we dont need JDK_HOME, and the message

Correct.

 Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
 At least one of these environment variable is needed to run this program
 is obsolete.

Wrong. The message is correct.

Mark

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



Re: Tomcat 7: Why is JDK needed ?

2011-08-01 Thread Bobi St
Hi,

--- Mark Thomas ma...@apache.org schrieb am Mo, 1.8.2011:

On 01/08/2011 22:27, Bobi St wrote:

 So we dont need JDK_HOME, and the message

Correct.

 Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
 At least one of these environment variable is needed to run this program
 is obsolete.

Wrong. The message is 
correct---Well, it is 
obsolete in a way, because setting JAVA_HOME to JRE gives the message : NB: 
JAVA_HOME should point to a JDK not a JRE. Why not only to set JRE_HOME ?!? 
Pointing at JDK from JAVA_HOME works however. ... Well, the messaging seems at 
least to me a little confusing.
===C:\apache-tomcat-7.0.8\binstartup
Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
At least one of these environment variable is needed to run this program
D:\apache-tomcat-7.0.8\binset JAVA_HOME=c:\Program Files\Java\jre6

D:\apache-tomcat-7.0.8\binstartup
The JAVA_HOME environment variable is not defined correctly
This environment variable is needed to run this program
NB: JAVA_HOME should point to a JDK not a JRE

RE: Tomcat 7: Why is JDK needed ?

2011-08-01 Thread Caldarale, Charles R
 From: Bobi St [mailto:temporaryb...@yahoo.de] 
 Subject: Re: Tomcat 7: Why is JDK needed ?

 it is obsolete in a way, because setting JAVA_HOME to JRE 
 gives the message : NB: JAVA_HOME should point to a JDK 
 not a JRE.

The message is correct as stated; when JAVA_HOME is used, it *must* point to a 
JDK.  If you want a specific JRE, you must set JRE_HOME, not JAVA_HOME.  If you 
set neither JAVA_HOME nor JRE_HOME, the startup scripts try to find a JVM, and 
set one of the variables for you.

 Why not only to set JRE_HOME ?!?

Sorry, I can't parse that question.

 Pointing at JDK from JAVA_HOME works however.

As it should.  Setting JRE_HOME to the location of a JRE also works.

 the messaging seems at least to me a little confusing.

Please explain why.  As far as I can see, you set JAVA_HOME to a JRE, which is 
invalid; once you've done that, nothing useful can result.

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



Re: APR connector pollTime defaults are strange in tomcat6/7

2011-08-01 Thread Darius D.

My goal with this thread was to rise awareness with APR connector poll time
defaults, as some users will not really bother investigating why their
servers have such high context switches / timer interrupts. There is no
problem here as Tomcat is working fine with defaults. 

There should be no harm by setting it to 100 microseconds, as NIO
connectors are using 1000ms as default selectorTimeout ( same epoll inside )
and working just fine.





Christopher Schultz-2 wrote:
 
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Darius,
 
 On 7/18/2011 2:23 PM, Darius D. wrote:
 Does Tomcat APR really needs pollTime set so low by default? I
 thought timeout is meant for some sort of book keeping, where is all
 connections in FD set are idle, no events come for timeout period -
 you force timeout and do bookkeeping - on a busy system you will get
 events anyway cause of socket traffic. Also connection timeout is 60s
 by default, so ending connection @ 2ms precision is not enhancing
 latency in any way.
 
 Seems like a reasonable question.
 
 P.S. There exists perfect workaround in latest Tomcat7, using 
 protocol=org.apache.coyote.http11.Http11NioProtocol and 
 protocol=org.apache.coyote.ajp.AjpNioProtocol for AJP will do away
 with all unneeded context switches.
 
 Yes, switching from APR connector to another one certainly does
 alleviate any issues you are experiencing by using the APR connector.
 This isn't really a workaround. :)
 
 On the other hand, a better workaround would be to set these values
 appropriately for your environment. What's stopping you from setting the
 pollTime to, as you suggest, 10 microseconds? That isn't really a
 workaround, either: it's proper configuration.
 
 It's probably worth discussing what the defaults should be, but there's
 a perfectly reasonable course of action for you at this point: change
 the configuration.
 
 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.10 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
 
 iEYEARECAAYFAk4tw8UACgkQ9CaO5/Lv0PDJ2ACeNAYeMDPWDw9jyjtXz2J82O9z
 5b0An0a1E4LPyrIVcREaBqt+deRvVsOa
 =bJY5
 -END PGP SIGNATURE-
 
 -
 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/APR-connector-pollTime-defaults-are-strange-in-tomcat6-7-tp32085364p32173790.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: Tomcat 7: Why is JDK needed ?

2011-08-01 Thread Bobi St


--- Caldarale, Charles R chuck.caldar...@unisys.com schrieb am Mo, 1.8.2011:

 it is obsolete in a way, because setting JAVA_HOME to JRE 
 gives the message : NB: JAVA_HOME should point to a JDK 
 not a JRE.

The message is correct as stated; when JAVA_HOME is used, it *must* point to a 
JDK.  If you want a specific JRE, you must set JRE_HOME, not JAVA_HOME.  If 
::: Well, if JDK is not needed anymore, why bother setting JAVA_HOME, why is it 
mentioned at all ?

 Why not only to set JRE_HOME ?!?

Sorry, I can't parse that question.
 
::: I meant, if JDK is not needed anymore, why at all mentioning JAVA_HOME ?
 
 the messaging seems at least to me a little confusing.

Please explain why.  As far as I can see, you set JAVA_HOME to a JRE, which is 
invalid; once you've done that, nothing useful can result.

 
::: Its all about JDK, if JDK is not needed anymore, why at all mentioning 
JAVA_HOME to JDK ?
 

Re: Tomcat 7: Why is JDK needed ?

2011-08-01 Thread David Kerber

On 8/1/2011 7:18 PM, Bobi St wrote:


--- Caldarale, Charles Rchuck.caldar...@unisys.com  schrieb am Mo, 1.8.2011:

it is obsolete in a way, because setting JAVA_HOME to JRE 
gives the message : NB: JAVA_HOME should point to a JDK

not a JRE.
The message is correct as stated; when JAVA_HOME is used, it *must* point to a JDK.  If you want a specific JRE, you must set JRE_HOME, not JAVA_HOME.  If 
::: Well, if JDK is not needed anymore, why bother setting JAVA_HOME, why is it mentioned at all ?



Why not only to set JRE_HOME ?!?

Sorry, I can't parse that question.
  
::: I meant, if JDK is not needed anymore, why at all mentioning JAVA_HOME ?



the messaging seems at least to me a little confusing.

Please explain why.  As far as I can see, you set JAVA_HOME to a JRE, which is 
invalid; once you've done that, nothing useful can result.

  
::: Its all about JDK, if JDK is not needed anymore, why at all mentioning JAVA_HOME to JDK ?


My guess would be backwards compatibility.  Also, there may be a reason 
that somebody might want to use a JDK instead of a JRE.




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



Re: Tomcat 7: Why is JDK needed ?

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

Bobi,

On 8/1/2011 7:18 PM, Bobi St wrote:
 The message is correct as stated; when JAVA_HOME is used, it
 *must* point to a JDK.  If you want a specific JRE, you must set
 JRE_HOME, not JAVA_HOME.
 
 Well, if JDK is not needed anymore, why bother setting JAVA_HOME, why
 is it mentioned at all ?

Because you have a choice: JRE or JDK. Some people have both. Some only
have one. Hence the choice.

 Why not only to set JRE_HOME ?!?
 
 Sorry, I can't parse that question.
 
 I meant, if JDK is not needed anymore, why at all mentioning
 JAVA_HOME ?

It is not /required/, but it is an option.

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

iEYEARECAAYFAk43Qv8ACgkQ9CaO5/Lv0PAasgCeO989JGDyrbPF50hYXh5pIj7Q
q0AAoKMvNVtbhZP+918xkDNTmIyUVzC2
=x3qN
-END PGP SIGNATURE-

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



Re: Tomocat 6.0.20 Comet END Event *NOT RAISED* when connection is terminated

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

Sudeep,

On 8/1/2011 2:47 PM, Sudeep Pradhan wrote:
 Stale as in, It gives me response which was suppose to be given for 
 the previous request (it gives me xml(previous) response instead of 
 json(current)).

That's not what you said before. Can you respond with LOTS more
information? Maybe a copy/paste of your terminal where you invoke curl
and kill the process.

 I am not seeing this behavior for HTTP. It occurs only for HTTPS.

Interesting.

 *Though the problem of END event not being raise still happens for 
 HTTP even with Tomcat 6.0.32.*

So, it happens for HTTP or HTTPS? Or both? Or only one under certain
circumstances? It's really hard to get a clear description, here.

 Is this a bug?

Dunno.

FWIW, I wouldn't expect to see curl receiving any responses from Tomcat
after you do a CTRL-C. That should send a SIGKILL to the process and
terminate it before it has a chance to tell the server it's
disconnecting. Tomcat may fire an END event that the client does not see.

You throw the term console around loosely... did you mean the
console where curl is running or the console where you are watching
some kind of log file on the server?

In neither circumstance would I expect you to see any evident of events:
if you're talking about killing the client, then the client does not see
any more events. If you are talking about killing the log file, then you
aren't looking at the log file anymore. *shrug*

- -chris

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

iEYEARECAAYFAk43SYQACgkQ9CaO5/Lv0PDBywCguWqxU8REeAWZ1nb3eoWpIn+k
dq8AoILHO7wqmmFgBULZHtf4Rjsak9Xd
=Fptp
-END PGP SIGNATURE-

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



RE: HOW TO: re-deploy or undeploy a webapp when additional files are added after initial deployment

2011-08-01 Thread Bob DeRemer
Hi Mark,

Actually, in the logs it does tell me that ExpandWar deleteDir failed.  This is 
because my extensions I have are actually JAR files that we're dynamically 
loaded so we don't have to restart the webapp.  I'm using the addUrl hack, but 
by casting the main webapp's Thread.currentThread().getContextClassLoader() to 
a URLClassLoader.  From a dynamic loading standpoint, it works great!  It 
allows extension classes in an extension JAR to derive from classes in our 
built-in product JAR(s) loaded by the same [I'm assuming] webapp classloader. 

The problem is, when I shutdown/undeploy the webapp, everything else gets 
deleted, but not the JAR(s) that are dynamically loaded.  Tomcat should not be 
holding on to these because I am NOT using the System class loader to load 
them.  Problem is, I'm not sure why these are not being unloaded.

Is there any way to force tomcat to release these?  I tried putting the 
antiJARLocking=true in the main Context.xml as well as a local context.xml in 
META-INF and neither of these worked.

Thanks in advance,
Bob

-Original Message-
From: Mark Thomas [mailto:ma...@apache.org] 
Sent: Monday, August 01, 2011 3:44 PM
To: Tomcat Users List
Subject: Re: HOW TO: re-deploy or undeploy a webapp when additional files are 
added after initial deployment

On 01/08/2011 20:32, Bob DeRemer wrote:
 Thanks, but I need to do this in a production environment, where we're 
 deploying/re-deploying a WAR and there is no eclipse IDE.  In 
 addition, I am dynamically adding extensions to our webapp without 
 having to restart our webapp, which is what republishing from Eclipse 
 does.

Any messages in the logs? Tomcat 7 will report if it can't delete a file. I 
don't recall if Tomcat 6 does.

If a file is under the docBase and is not deleted it is because something 
(probably your app) still has the file open. You need to close the files before 
you redeploy.

Mark

-
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: Problem with threads in stage Service (Tomcat 7.0.14)

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

Alejandro,

On 7/29/2011 11:55 AM, Alejandro Henao González wrote:
 public class HTMLEncoder { private static Map mapChar2HTMLEntity;
 
 private final static char [] characters = { 
 'á','ú','ó','é','í','ñ','Á','Ú','Ó','É','Í','°','ü' }; private final
 static String[] entities = { 
 aacute;,uacute;,oacute;,eacute;,iacute;,ntilde;,Aacute;,Uacute;,Oacute;,Eacute;,Iacute;,deg;,uuml;
  };
 
 public HTMLEncoder() { mapChar2HTMLEntity= new HashMap(); int
 longueur = characters.length;
 
 for (int i = 0; i  longueur; i++) mapChar2HTMLEntity.put(new
 Character(characters[i]), entities[i]); }

So you have Character - String (entity reference). Your Map is not
synchronized, but it doesn't have to be: you are only calling get() on
it so there shouldn't be any synchronization issues here.

 public String encode(String s) { int longueur = s.length(); final
 StringBuffer sb = new StringBuffer(longueur * 2);

Big buffer every time?

 char ch;
 
 for (int i =0; i  longueur ; ++i) { ch = s.charAt(i);
 
 if ((ch = 63  ch = 90) || (ch = 97  ch = 122)) sb.append(ch);
  else { String ss = (String)mapChar2HTMLEntity.get(new
 Character(ch));

New Character object every time? Mmm. You might want to choose a more
optimized storage system so you don't have to create a new object every
time.

 if(ss==null) sb.append(ch); else sb.append(ss); } } return
 sb.toString(); }

Aside from any other strange issues you are having, you might be wasting
a lot of time (and invoking a lot of GC) by creating a large
StringBuffer for every invocation. You might want some more complicated
logic to determine if you even need to create such a buffer.

Honestly, I don't see much wrong with this class. I don't see any use of
System.gc and I don't see any connection reset. Was there a post that I
missed?

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

iEYEARECAAYFAk43Tr4ACgkQ9CaO5/Lv0PBk4QCglB4MNYVbEvwsqZFwiOYupAUv
J84AnRAnw2o6PwTRiaNnNFc9iyNq0pUS
=UWQu
-END PGP SIGNATURE-

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



RE: HOW TO: re-deploy or undeploy a webapp when additional files are added after initial deployment

2011-08-01 Thread Bob DeRemer
Also - I just looked at my local tomcat 6.0.32 server.xml and it has 
JreMemoryLeakPreventionListener on the Server element.  The implicit disabling 
of URL caching this is supposed to do must not have an effect on this scenario.

As an aside, when I used antiJARLocking + antiResourceLocking on the server's 
context.xml, it appeared to work, but that has other documented side effects - 
such as creating a bunch of garbage in the tomcat/temp directory.   As a 
result, this really isn't a solution for us.

Any suggestions on how we can get these JAR(s) not to be locked - without using 
the context attributes?

Thanks,
bob

-Original Message-
From: Bob DeRemer [mailto:bob.dere...@thingworx.com] 
Sent: Monday, August 01, 2011 9:12 PM
To: Tomcat Users List
Subject: RE: HOW TO: re-deploy or undeploy a webapp when additional files are 
added after initial deployment

Hi Mark,

Actually, in the logs it does tell me that ExpandWar deleteDir failed.  This is 
because my extensions I have are actually JAR files that we're dynamically 
loaded so we don't have to restart the webapp.  I'm using the addUrl hack, but 
by casting the main webapp's Thread.currentThread().getContextClassLoader() to 
a URLClassLoader.  From a dynamic loading standpoint, it works great!  It 
allows extension classes in an extension JAR to derive from classes in our 
built-in product JAR(s) loaded by the same [I'm assuming] webapp classloader. 

The problem is, when I shutdown/undeploy the webapp, everything else gets 
deleted, but not the JAR(s) that are dynamically loaded.  Tomcat should not be 
holding on to these because I am NOT using the System class loader to load 
them.  Problem is, I'm not sure why these are not being unloaded.

Is there any way to force tomcat to release these?  I tried putting the 
antiJARLocking=true in the main Context.xml as well as a local context.xml in 
META-INF and neither of these worked.

Thanks in advance,
Bob

-Original Message-
From: Mark Thomas [mailto:ma...@apache.org]
Sent: Monday, August 01, 2011 3:44 PM
To: Tomcat Users List
Subject: Re: HOW TO: re-deploy or undeploy a webapp when additional files are 
added after initial deployment

On 01/08/2011 20:32, Bob DeRemer wrote:
 Thanks, but I need to do this in a production environment, where we're 
 deploying/re-deploying a WAR and there is no eclipse IDE.  In 
 addition, I am dynamically adding extensions to our webapp without 
 having to restart our webapp, which is what republishing from Eclipse 
 does.

Any messages in the logs? Tomcat 7 will report if it can't delete a file. I 
don't recall if Tomcat 6 does.

If a file is under the docBase and is not deleted it is because something 
(probably your app) still has the file open. You need to close the files before 
you redeploy.

Mark

-
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 behavior between Tomcat service installation Tomcat console mode

2011-08-01 Thread 刘铎
Are the two tomcat configurations the same? Check the
server.xml,web.xml,context.xml and other configuration files of the
tomcat.

2011/8/1 Alexandre Terrasson alexandre.terras...@gmail.com:
 Hi guys,
 here my problem :

 I have a web application that use a Jdbc driver/connection to connect to a
 proprietary application.
 I did my developments and tests on a Tomcat 6.0.32 with scripts startup
 (startup.bat) and all works fine. But when I tried to test the web app on
 the production server where a Tomcat 6.0.32 is installed as a service, it
 don't work 

 I don't get a ClassNotFoundException, the class of the driver is well
 configured, but I don't know, may be not really well loaded.

 What intrigate me is why the two ways of using Tomcat has not the same
 behavior ? And how to acquieve that the service mode having the same way of
 working as the script ways (console mode) ?
 I tend to say that could be a problem of classpath but don't really know ...

 I'm working on Windows 7 x64 or Windows Server 2008 x64 with Apache Tomcat
 x86 in Service mode or scripts mode (console mode). I have no classpath
 environment variable, and use a Jdk 1.6.0_19.

 Any help would be greatly appreciated.

 Thanks :)

 Alex.


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