RE: Problem building Tomcat connector

2013-09-19 Thread Casper Wandahl Schmidt
See inline.

De bedste hilsner/ Best regards


Casper Wandahl Schmidt | ExpandIT Mobile ApS
Udviklingskonsulent

c...@expandit.com | T: +45 70 26 86 19 | M: +45 50 44 46 33
www.expandit.com | Nyhedsbrev | Se katalog




-Original Message-
From: Christopher Schultz [mailto:ch...@christopherschultz.net] 
Sent: 18. september 2013 16:05
To: Tomcat Users List
Subject: Re: Problem building Tomcat connector

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Casper,

On 9/17/13 3:01 PM, Casper Wandahl Schmidt wrote:
 After being away from this list for some time I’m now back for help. I 
 recently upgraded my home server to Ubuntu 12.04.2 LTS with Apache 
 2.2.22. I’m now trying to build the tomcat connector to get tomcat 
 (not installed yet, but think I will go for newest Tomcat 8 when time 
 comes) and apache to communicate.

Should be no problem to get these set up.

 I have downloaded the source and unpacked it.

You are talking about the Tomcat Connector, mod_jk, right?

CWS: Yes, sorry, thought it was clear from the subject line :)

 I then do cd native/ and tried ./configure
 –with-apxs=/usr/bin/apxs2 but the command fails saying: “configure:
 error: C++ preprocessor ‘/lib/cpp’ fails sanity check”.
 
 
 Config.log has the following to say:
 
 [snip]
 
 gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)
 
 [snip]
 
 configure:5036: checking for g++
 
 configure:5065: result: no
 
 configure:5036: checking for c++
 
 configure:5065: result: no
 
 configure:5036: checking for gpp
 
 configure:5065: result: no
 
 configure:5036: checking for aCC
 
 configure:5065: result: no
 
 configure:5036: checking for CC
 
 configure:5065: result: no
 
 configure:5036: checking for cxx
 
 configure:5065: result: no
 
 configure:5036: checking for cc++
 
 configure:5065: result: no
 
 configure:5036: checking for cl
 
 configure:5065: result: no
 
 configure:5036: checking for FCC
 
 configure:5065: result: no
 
 configure:5036: checking for KCC
 
 configure:5065: result: no
 
 configure:5036: checking for RCC
 
 configure:5065: result: no
 
 configure:5036: checking for xlC_r
 
 configure:5065: result: no
 
 configure:5036: checking for xlC
 
 configure:5065: result: no
 
 configure:5078: checking for C++ compiler version
 
 configure:5081: g++ --version /dev/null 5


Boy, for knowing that g++ doesn't exist, configure sure seems to want to 
interrogate the hell out of it...

 configure:5666: error: C++ preprocessor /lib/cpp fails sanity check
 
 See `config.log' for more details.


Although it does not explicitly state it anywhere in the documentation, you'll 
need to have a C++ compiler installed.

You'll need to install the 'g++' package on Debian/Ubuntu in order to compile 
mod_jk.

I'm not sure why a c++ compiler is required. It does not appear to be a 
requirement for httpd. 

CWS: sudo apt-get install g++ did fix the problem and mod_jk.so is now 
compiled :)

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.14 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJSObL4AAoJEBzwKT+lPKRY58AQAJAFOrCalyibTfOnoAdEBRfZ
P6zpWShxA/TnsU31QB11K9dbsJ3i7Xv9yOOYCJryNOBP5fETEzdDUqnbc2kFeGNu
tZh5wNTLNMlWaXgnbOgYqjDmmz53XpQ2saIGBel8PnEhix5qsXWHr9HJSOs7jwJk
5yUSMRm8/3l92vW4bxFnVs0eperlfZFEeMAk8Yh2v9ciXmiHAz38iHqJZWpiBr4o
SV9iNKgOfZYkGtf2AYt7IR7XF52gR7goSf18tJy0e8imFJXTfGhcsiuu/I289ed+
5lu0CEaSLHPLDbKpmALNOVV2hWidVDmZ/0m8Zuv287Mdulkbp1u3G5INbdb4A/4I
v6aYIOJhw3ZY2HbeOM7ERRo8n0331RVOYKyOC+IycD6NE6MFC4MGb3t4uWFnQOdG
VOcPHbsayqu5Ph0RGkDeUsWTevWLUXAIkbeTIf/ymLhN1c6BraYHyDR3497Wa0uQ
guQS+9U2Bf1sGs3/0hqReyE6DS5KnrTWXhnuCFCDYL74CoyY60JLhnaitFfvGI+J
uBRKVj7wWQG1/fl/LZCClNkQ3o93isZe/yjYhWfcFlOZuHYix/PAjGRaerCPKvzf
LNzFQnW0Cw3jWvvKhLe0qOLeGHulLcZUrxMdyt2mUcqteM1D1ncqixESVyQYfmnN
COBqVzC3iigb6FJwnP+w
=gH3d
-END PGP SIGNATURE-

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



Tomcat7.0.42 shutdown problems

2013-09-19 Thread Beutel, Stephan
Hello,

I want to stop installed Windows service in command line using 'Tomcat7.exe 
stop SERVICENAME'.
With Tomcat 7.0.35 it works well. With 7.0.42 I always get an error code 6 and 
the service isn't stopped.

Here's the log output from commons-daemon.log:

[2013-09-19 01:32:40] [info] [ 3816] Commons Daemon procrun (1.0.15.0 64-bit) 
started
[2013-09-19 01:32:40] [info] [ 3816] Stopping service 'SERVICENAME' ...
[2013-09-19 01:32:44] [error] [ 3816] Failed to stop 'SERVICENAME' service
[2013-09-19 01:32:44] [error] [ 3816] The data area passed to a system call is 
too small.
[2013-09-19 01:32:44] [info] [ 3816] Stop service finished.
[2013-09-19 01:32:44] [error] [ 3816] Commons Daemon procrun failed with exit 
value: 6 (Failed to stop service)
[2013-09-19 01:32:44] [error] [ 3816] The data area passed to a system call is 
too small.

I have to stop the service because I do an automatic installation of my 
application with Jenkins and an ANT script.
The ANT script stops the service, downloads the artifacts from my Jenkins 
build, unpack and copy artifacts to the
Tomcat folder and then starts the service again. It would be very helpful if I 
can get this issue fixed.

Thanks for any answer.
Stephan


Re: 8.0.0 RC1: WebSocket ServerContainer servlet context attribute gets set too late.

2013-09-19 Thread Mark Thomas
On 16/09/2013 17:37, Nick Williams wrote:
 On Sep 16, 2013, at 11:21 AM, Mark Thomas wrote:

 It certainly looks at this point as if the order is anything you like.
 Personally, I'd prefer something rather more deterministic.
 
 Agreed. That's why I filed [1].

I've added a comment on some additional complications and a proposal.

 My understanding based on our previous conversations is that Tomcat
 *currently* orders SCIs according to the web-fragment ordering. Looking
 back on those conversations, what's not clear to me now is:
 
 1) How does Tomcat *currently* order the groups of SCIs? Container
 before application or application before container? I *think* the answer
 is always application before container.

It is.

 2) Does web-fragment ordering *currently* affect whether container SCIs
 come before application or vice versa? I *think* the answer is it does not.

It did. I'm not sure either after the recent(ish) refactoring.

 It would be great if any
 existing JCP members could bring [1] to their attention and maybe get
 some people together for a discussion.

Based on previous experience of how the Servlet EG works the only
opinion that matters is what the EG lead decides and until that decision
is in writing...

Tomcat doesn't have the information it needs to correctly order the SCIs
at the moment, regardless of what ordering scheme is eventually chosen.

On reflection, I can see the need to at least partially address this
issue prior to the EG making a final decision. Therefore I intend to do
the following:
1. Refactoring 8.0.x and 7.0.x to make the information available to
enable various ordering schemes to be implemented.
2. Ensure that application provided SCIs are still executed in web
fragment order.
(Up to this point this work should result in no functional changes
unless other refactorings have introduced unintended changes)
3. Change the current order to execute container provided SCIs first.

Implementing point 3 should address the immediate issue without
generating too much nugatory work if the EG opts for a completely
different scheme.

Mark

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



Re: Tomcat7.0.42 shutdown problems

2013-09-19 Thread Konstantin Kolinko
2013/9/19 Beutel, Stephan sbeu...@informatica.com:
 Hello,

 I want to stop installed Windows service in command line using 'Tomcat7.exe 
 stop SERVICENAME'.
 With Tomcat 7.0.35 it works well. With 7.0.42 I always get an error code 6 
 and the service isn't stopped.

 Here's the log output from commons-daemon.log:

 [2013-09-19 01:32:40] [info] [ 3816] Commons Daemon procrun (1.0.15.0 64-bit) 
 started
 [2013-09-19 01:32:40] [info] [ 3816] Stopping service 'SERVICENAME' ...
 [2013-09-19 01:32:44] [error] [ 3816] Failed to stop 'SERVICENAME' service
 [2013-09-19 01:32:44] [error] [ 3816] The data area passed to a system call 
 is too small.
 [2013-09-19 01:32:44] [info] [ 3816] Stop service finished.
 [2013-09-19 01:32:44] [error] [ 3816] Commons Daemon procrun failed with exit 
 value: 6 (Failed to stop service)
 [2013-09-19 01:32:44] [error] [ 3816] The data area passed to a system call 
 is too small.

 I have to stop the service because I do an automatic installation of my 
 application with Jenkins and an ANT script.
 The ANT script stops the service, downloads the artifacts from my Jenkins 
 build, unpack and copy artifacts to the
 Tomcat folder and then starts the service again. It would be very helpful if 
 I can get this issue fixed.


Tomcat7.exe and Tomcat7w.exe are just renamed prunsrv.exe and
prunmgr.exe from Apache Commons Daemon.

You should contact that project, see
http://commons.apache.org/proper/commons-daemon/
https://issues.apache.org/jira/browse/DAEMON-282

As your logs show, you are using version 1.0.15 of theirs. Whenever a
better version is released, Tomcat can be updated to pick it up.

What may be important is that both you and original reporter of issue
282 are using 64-bit version of service wrapper.

Note, that
1. You can use system command net stop servicename to stop a
service. I wonder whether that works for you.

2. Tomcat can be stopped by connecting to shutdown port at localhost
and typing shutdown command (configured on Server element in
server.xml) there.
That is what happens when you run catalina.bat stop or shutdown.bat.  See
http://tomcat.apache.org/tomcat-7.0-doc/config/server.html

Best regards,
Konstantin Kolinko

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



RE: RSocket Error

2013-09-19 Thread Martin Gainty
MG1)the problem calling executeMethod will need to try{..} catch for 
IOException and HttpException
/**
  308* Executes the given {@link HttpMethod HTTP method}.
  309*
  310* @param method the {@link HttpMethod HTTP method} to execute.
  311* @return the method's response code
  312*
  313* @throws IOException If an I/O (transport) error occurs. Some 
transport exceptions
  314* can be recovered from.  
  315* @throws HttpException  If a protocol exception occurs. Usually 
protocol exceptions 
  316*cannot be recovered from.
  317*/
  318   public int executeMethod(HttpMethod method)
  319   throws IOException, HttpException  {
  320   
  321   LOG.trace(enter HttpClient.executeMethod(HttpMethod));
  322   // execute this method and use its host configuration, if it 
has one
  323   return executeMethod(null, method, null);
  324   }

MG2)If you have a reliable HostConfiguration why not use that?
MG
/**
  352* Executes the given {@link HttpMethod HTTP method} using the 
given custom 
  353* {@link HostConfiguration host configuration} with the given 
custom 
  354* {@link HttpState HTTP state}.
  355*
  356* @param hostconfig The {@link HostConfiguration host 
configuration} to use.
  357* If codenull/code, the host configuration returned by {@link 
#getHostConfiguration} will be used.
  358* @param method the {@link HttpMethod HTTP method} to execute.
  359* @param state the {@link HttpState HTTP state} to use when 
executing the method.
  360* If codenull/code, the state returned by {@link #getState} 
will be used.
  361*
  362* @return the method's response code
  363*
  364* @throws IOException If an I/O (transport) error occurs. Some 
transport exceptions
  365* can be recovered from.
  366* @throws HttpException  If a protocol exception occurs. Usually 
protocol exceptions 
  367*cannot be recovered from.
  368* @since 2.0
  369*/
  370   public int executeMethod(HostConfiguration hostconfig, 
  371   final HttpMethod method, final HttpState state)
  372   throws IOException, HttpException  {The constructors are weak 
for HostConfiguration you will need to build empty HostConfiguration
first set the Hostname, port and protocol
setHost(final String host, int port, final Protocol protocol)then  set the 
ProxyHost and the proxyPort
setProxy(final String proxyHost, int proxyPort) 

http://www.docjar.com/html/api/org/apache/commons/httpclient/HostConfiguration.java.html

finally on multi-homed or clustered configurations set the InetAddress
/**
  449* Set the local address to be used when creating connections.
  450* If this is unset, the default address will be used.
  451* This is useful for specifying the interface to use on 
multi-homed or clustered systems.
  452* 
  453* @param localAddress the local address to use
  454*/
  455   
  456   public synchronized void setLocalAddress(InetAddress localAddress) 
most people use static route to identify a gateway for a particular IP 
configuration 
request the static route from your net-admin
http://www.nongnu.org/quagga/docs/docs-multi/Static-Route-Commands.html

it is also possible on linux to configure specific rules for multi-homed systems
details on which rule to use for multi-homed on linux the command on which ip 
rule you should also be obtained from net-admin  
ip rule 
listhttps://blogs.oracle.com/networking/entry/advance_routing_for_multi_homed

the rule will point you to the IP you should use in InetAddress

Martin 
__ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.


 From: divya.prak...@mahindracomviva.com
 To: users@tomcat.apache.org
 

Re: RSocket Error

2013-09-19 Thread Daniel Mikusa
On Sep 19, 2013, at 12:59 AM, Divya Prakash divya.prak...@mahindracomviva.com 
wrote:

 
 
 
 Hi Folks,
 
 
 
 We are getting below random error while sending request from one web 
 application to another.
 
 
 
 It is messing up the live application only for some of the requests.
 
 
 
 java.net.SocketException: Connection reset
 
at java.net.SocketInputStream.read(SocketInputStream.java:168)
 
at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
 
at java.io.BufferedInputStream.read(BufferedInputStream.java:237)
 
at 
 org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:78)
 
at 
 org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:106)
 
at 
 org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1116)
 
at 
 org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.readLine(MultiThreadedHttpConnectionManager.java:1413)
 
at 
 org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1973)
 
at 
 org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1735)
 
at 
 org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1098)
 
at 
 org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
 
at 
 org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
 
at 
 org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
 
at 
 org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
 
at 
 com.btsl.flares.apps.mmoney.communicator.HTTPCommunicator.sendHTTPMessage(HTTPCommunicator.java:240)
 
at 
 com.btsl.flares.apps.mmoney.acceptor.handler.OneShotRequestHandler.processResponse(OneShotRequestHandler.java:81)
 
at 
 com.btsl.flares.apps.mmoney.utils.MessageProcessor.run(MessageProcessor.java:96)
 
 
 Please suggest what could be possible reason and fixes for the above issue.

How is Tomcat involved here?  What version are you using, if you're using it?  
What do you see in the Tomcat logs, again if you're using it, when your client 
code get's the Connection Reset exception?

Dan  

 
 
 TXN = jdk1.6.0_33
 
 OS: Linux on Solaris
 
 
 
 Regards,
 
 Divya
 
 This e-mail and all material transmitted with it are for the use of the 
 intended recipient(s) ONLY and contains confidential and/or privileged 
 information. If you are not the intended recipient, please contact the sender 
 by reply e-mail and destroy all copies and the original message. Any 
 unauthorized review, use, disclosure, dissemination, forwarding, printing or 
 copying of this email or any action taken pursuant to the contents of the 
 present e-mail is strictly prohibited and is unlawful. The recipient 
 acknowledges that Comviva Technologies Limited or its management or 
 directors, are unable to exercise control or ensure the integrity over /of 
 the contents of the information contained in e-mail. Any views expressed 
 herein are those of the individual sender only and no binding nature of the 
 contents shall be implied or assumed unless the sender does so expressly with 
 due authority of Comviva Technologies Limited. E-mail and any contents 
 transmitted with it are prone to viruses and related defects despite all 
 efforts to avoid such by Comviva Technologies Limited.


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



MaxClients and maxThreads

2013-09-19 Thread mohan . radhakrishnan
Hi,
I am following the instructions in 
https://access.redhat.com/site/articles/15786 to tune MaxClients in 
httpd.conf and maxThreads in JBoss Tomcat. 

 The recommended value of maxThreads is 200 per CPU, so here we assume 
the server is a single core machine. If it had
  been quad core we could push that value to 800 or more depending on RAM 
and other machine specs. The total threads
  is an aggregate value. If Apache and JBOSS are on the same server, and 
that server has four cores, then you would halve
  the maxThreads and MaxClients to 400 each.

I have this question. Does this mean that maxThreads and MaxClients should 
both be equal to each other  ?

My configuration is this.
Machine 1 - JBoss and Apache(2 cores)
Machine 2 - JBoss(2 cores)

So even though Machine 2 can use about 400 threads(200 x 2 ) it is limited 
by MaxClients in Machine 1 which should be only 200. Is that correct ? It 
is a bottleneck.

Thanks,
Mohan


This e-Mail may contain proprietary and confidential information and is sent 
for the intended recipient(s) only.  If by an addressing or transmission error 
this mail has been misdirected to you, you are requested to delete this mail 
immediately. You are also hereby notified that any use, any form of 
reproduction, dissemination, copying, disclosure, modification, distribution 
and/or publication of this e-mail message, contents or its attachment other 
than by its intended recipient/s is strictly prohibited.

Visit us at http://www.polarisFT.com


Re: Tomcat classes from previous run remains

2013-09-19 Thread Daniel Mikusa
On Sep 19, 2013, at 1:53 AM, Saurabh Saraswat ssaras...@pivotalindia.com 
wrote:

 Dear All,
 
 I am running an j2ee application which uses spring, hibernate, jsf, etc.
 the application also uses ha-jdbc to make the databases highly available.
 when the application is deployed for the first time, the app runs smoothly,
 but when it is un-deployed and deployed back, tomcat gives the following
 error:
 
 The following web applications were stopped (reloaded, undeployed), but
 their classes from previous runs are still loaded in memory, thus causing a
 memory leak (use a profiler to confirm):
 
 I am wondering how to get rid of this problem.

I'd suggest you start by reading this.  It's a good introduction to the problem.

  
https://people.apache.org/~markt/presentations/2010-11-04-Memory-Leaks-60mins.pdf

Then get a Profiler and follow the steps on slide #11.  Once you figure out 
what is holding a reference to your application, you can determine where you go 
from there to fix it.  Sometimes it something you need to fix in your code, 
sometimes it's something in a third party library that needs fixed.

Further detail can be found on the FAQ here.

   https://wiki.apache.org/tomcat/MemoryLeakProtection
   https://wiki.apache.org/tomcat/OutOfMemory

 
 One Solution is restarting the server.

This is one possible solution, although it limits the functionality of Tomcat.

 Please let me know the solution with out restarting the server if any.

See above for the suggested solution.

Dan

 
 Thanking You!!
 
 
 *Best Regards,*
 
 *Saurabh Sarasvat*


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



Re: Problems with Clustering / Session Replication

2013-09-19 Thread Daniel Mikusa
On Sep 18, 2013, at 9:00 AM, Nicholas Violi nvi...@globalgiving.org wrote:

 Thanks Daniel.
 
 On Tue, Sep 17, 2013 at 5:30 PM, Daniel Mikusa dmik...@gopivotal.comwrote:
 
 Tried a quick two node setup on my Mac w/out HTTPD and it worked OK.  Go
 to one Tomcat instance's port in chrome, it increments the counter in my
 app.  Refresh a few times.  Open a second tab, go to the second Tomcat
 instance's port.  The counter picks up where it left off and continues
 incrementing.   Flipping back and forth between tabs / servers works fine.
 
 Here's the cluster config that I used in case it helps.
 
 Cluster channelSendOptions=8
 
 className=org.apache.catalina.ha.tcp.SimpleTcpCluster
Manager
 className=org.apache.catalina.ha.session.DeltaManager
 expireSessionsOnShutdown=false
 notifyListenersOnReplication=true/
Channel
 className=org.apache.catalina.tribes.group.GroupChannel
Membership address=228.0.0.4
 
 className=org.apache.catalina.tribes.membership.McastService
dropTime=3000
frequency=500
port=45564/
Receiver address=auto
  autoBind=100
 
 className=org.apache.catalina.tribes.transport.nio.NioReceiver
  maxThreads=6
  port=4000
  selectorTimeout=5000/
Sender
 className=org.apache.catalina.tribes.transport.ReplicationTransmitter
Transport
 className=org.apache.catalina.tribes.transport.nio.PooledParallelSender/
/Sender
Interceptor
 className=org.apache.catalina.tribes.group.interceptors.TcpFailureDetector/
Interceptor
 className=org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor/
/Channel
Valve
 className=org.apache.catalina.ha.tcp.ReplicationValve
   filter=/
Valve
 className=org.apache.catalina.ha.session.JvmRouteBinderValve/
ClusterListener
 className=org.apache.catalina.ha.session.JvmRouteSessionIDBinderListener/
ClusterListener
 className=org.apache.catalina.ha.session.ClusterSessionListener/
/Cluster
 
 
 Just tried this with the same results. My test that replication is behaving
 is accessing my webapp on the two ports and monitoring the session counter
 and list in the tomcat manager, and as I said before, I can only see the
 sessions created on the server attached to the manager instance. Is that a
 reasonable test? With the clustering config pretty well ruled out as the
 culprit, maybe my webapp is not dealing with sessions appropriately? Would
 you mind sending me your counter test app?

Here's what I've been using:


WEB-INF/web.xml:

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

distributable/

/web-app


index.jsp:

%
Integer count = (Integer) session.getAttribute(counter);
if (count == null) {
count = 0;
session.setAttribute(counter, 0);
} else {
session.setAttribute(counter, count + 1);
}
%
html
head
titleIndex/title
/head
body
h2Session [%= session.getId() %]/h2
pCurrent count is %= count %/p
/body
/html


It's crude, but effective for testing session replication.


 
 Beyond that, have you tried increasing the log levels?
 
 
 I found conflicting information about enabling logging. What I had
 previously was
 
 org.apache.catalina.tribes.level = FINE
 org.apache.catalina.tribes.MESSAGES = FINE
 
 in logging.properties, which was reporting the FINE log statements in my
 original post. I just added some more:
 
 org.apache.catalina.ha.level = FINE
 org.apache.catalina.ha.session.level = FINE
 org.apache.catalina.ha.session.DeltaManager.level = FINE
 org.apache.catalina.ha.tcp.level = FINE
 org.apache.catalina.ha.tcp.level = FINE
 org.apache.catalina.ha.tcp.ReplicationValve.level = FINE
 org.apache.catalina.ha.session.ClusterSessionListener.level = FINE
 org.apache.catalina.ha.session.JvmRouteSessionIDBinterListener.level = FINE
 
 And I still don't see any messages when interacting with the webapp in the
 browser. Are there any other classes I should be logging?

Use the information Mark sent.  That worked for me with one minor change.  I 
had to set this level to FINER.

  org.apache.catalina.tribes.MESSAGES.level = FINER

With this, I see messages like this in the logs:

19-Sep-2013 09:02:07.930 FINER [Tribes-Task-Receiver-3] 
org.apache.catalina.tribes.transport.nio.NioReplicationTask.drainChannel 
NioReplicationThread - Received msg:UniqueId{126, 49, 

Exception thrown while starting tomcat on Mac OS

2013-09-19 Thread Kalyan Vavilapalli
I am on a Mac version 10.8.4 using tomcat 6.0.37 and Oracle JDK7. Recently 
upgraded from JDK6 to JDK 7. When I try to start tomcat the exceptions below 
are thrown at the very end.

I searched all over the internet for solutions to this, but nothing seems to 
work. I tried adding these parameters to the start-up script like some 
suggested and that did not work either.
-Djava.net.preferIPv4Stack=true -Djava.net.preferIPv6Addresses=false

One thing to note, it does not fail every timeabout 60% of the time it 
fails to start correctly. Any pointers would be appreciated very much.

There is a thread about this on Stack Exchange with some information, but no 
answer :)
http://stackoverflow.com/questions/18883209/tomcat-startup-java-net-socketexception-invalid-argument-mac-os-x

SEVERE: StandardServer.await: accept:
java.net.SocketException: Invalid argument
  at java.net.PlainSocketImpl.socketAccept(Native Method)
  at 
java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:398)
  at java.net.ServerSocket.implAccept(ServerSocket.java:530)
  at java.net.ServerSocket.accept(ServerSocket.java:498)
  at org.apache.catalina.core.StandardServer.await(StandardServer.java:431)
  at org.apache.catalina.startup.Catalina.await(Catalina.java:676)
  at org.apache.catalina.startup.Catalina.start(Catalina.java:628)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
  at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:606)
  at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
  at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)

Sep 18, 2013 11:03:31 AM org.apache.coyote.http11.Http11Protocol pause
INFO: Pausing Coyote HTTP/1.1 on http-8080
Sep 18, 2013 11:04:48 AM org.apache.catalina.connector.Connector pause
SEVERE: Protocol handler pause failed
java.net.ConnectException: Operation timed out
  at java.net.PlainSocketImpl.socketConnect(Native Method)
  at 
java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
  at 
java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
  at 
java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
  at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
  at java.net.Socket.connect(Socket.java:579)
  at java.net.Socket.connect(Socket.java:528)
  at java.net.Socket.init(Socket.java:425)
  at java.net.Socket.init(Socket.java:241)
  at org.apache.jk.common.ChannelSocket.unLockSocket(ChannelSocket.java:492)
  at org.apache.jk.common.ChannelSocket.pause(ChannelSocket.java:288)
  at org.apache.jk.server.JkMain.pause(JkMain.java:739)
  at org.apache.jk.server.JkCoyoteHandler.pause(JkCoyoteHandler.java:153)
  at org.apache.catalina.connector.Connector.pause(Connector.java:1138)
  at org.apache.catalina.core.StandardService.stop(StandardService.java:578)
  at org.apache.catalina.core.StandardServer.stop(StandardServer.java:788)
  at org.apache.catalina.startup.Catalina.stop(Catalina.java:662)
  at org.apache.catalina.startup.Catalina.start(Catalina.java:629)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
  at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:606)
  at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
  at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)

Sep 18, 2013 11:04:49 AM org.apache.catalina.core.StandardService stop
INFO: Stopping service Catalina
09/18 11:04:49 Information [main] - Stopping Event Gateways.
09/18 11:04:54 Information [main] - ColdFusion stopped

Thanks
Kalyan


Re: Exception thrown while starting tomcat on Mac OS

2013-09-19 Thread Mark Thomas
On 19/09/2013 15:04, Kalyan Vavilapalli wrote:
 I am on a Mac version 10.8.4 using tomcat 6.0.37 and Oracle JDK7. Recently 
 upgraded from JDK6 to JDK 7. When I try to start tomcat the exceptions below 
 are thrown at the very end.
 
 I searched all over the internet for solutions to this, but nothing seems to 
 work. I tried adding these parameters to the start-up script like some 
 suggested and that did not work either.
 -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv6Addresses=false
 
 One thing to note, it does not fail every timeabout 60% of the time it 
 fails to start correctly. Any pointers would be appreciated very much.
 
 There is a thread about this on Stack Exchange with some information, but no 
 answer :)
 http://stackoverflow.com/questions/18883209/tomcat-startup-java-net-socketexception-invalid-argument-mac-os-x

Try following the links in that question to the one it duplicates where
you.ll find a lot more information including the answer.

Mark


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



Tomcat 7.0.42 startup failure: FindClass org/apache/catalina/startup/Boostrap failed

2013-09-19 Thread PELL Scott H
Background:  Switching from Adobe JRun4 for ColdFusion and Java to Tomcat 
7.0.42.  Have 10 years of experience with JRun4 as J2EE application server, so 
am familiar with some of the issues involved.

Initial Install:  Installed Tomcat 7.0.42 on Windows 2012 and created an 
instance following these instructions:  
http://www.ansoncheunghk.info/article/5-steps-install-multiple-apache-tomcat-instance-windows

Error logged with DEBUG level:

[2013-09-18 15:26:51] [debug] ( prunsrv.c:1679) [   48] Commons Daemon procrun 
log initialized
[2013-09-18 15:26:51] [info]  ( prunsrv.c:1683) [   48] Commons Daemon procrun 
(1.0.15.0 64-bit) started
[2013-09-18 15:26:51] [info]  ( prunsrv.c:1596) [   48] Running 'MCAD_DEV1' 
Service...
[2013-09-18 15:26:51] [debug] ( prunsrv.c:1374) [ 5632] Inside ServiceMain...
[2013-09-18 15:26:51] [debug] ( prunsrv.c:844 ) [ 5632] reportServiceStatusE: 
2, 0, 3000, 0
[2013-09-18 15:26:51] [info]  ( prunsrv.c:1127) [ 5632] Starting service...
[2013-09-18 15:26:51] [debug] ( javajni.c:233 ) [ 5632] loading jvm 
'C:\Java\bin\server\jvm.dll'
[2013-09-18 15:26:51] [debug] ( javajni.c:704 ) [ 3232] Jvm Option[0] 
-Dcatalina.home=C:\Apache3
[2013-09-18 15:26:51] [debug] ( javajni.c:704 ) [ 3232] Jvm Option[1] 
-Dcatalina.base=C:\Apache3
[2013-09-18 15:26:51] [debug] ( javajni.c:704 ) [ 3232] Jvm Option[2] 
-Djava.io.tmpdir=C:\Apache3\temp
[2013-09-18 15:26:51] [debug] ( javajni.c:704 ) [ 3232] Jvm Option[3] 
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
[2013-09-18 15:26:51] [debug] ( javajni.c:704 ) [ 3232] Jvm Option[4] 
-Djava.util.logging.config.file=C:\Apache3\conf\logging.properties
[2013-09-18 15:26:51] [debug] ( javajni.c:704 ) [ 3232] Jvm Option[5] 
-Djava.class.path=C:\Apache3\bin\bootstrap.jar;C:\Apache3\tomcat-juli.jar
[2013-09-18 15:26:51] [debug] ( javajni.c:704 ) [ 3232] Jvm Option[6] exit
[2013-09-18 15:26:51] [error] ( javajni.c:863 ) [ 3232] FindClass 
org/apache/catalina/startup/Boostrap failed
[2013-09-18 15:26:51] [debug] ( javajni.c:964 ) [ 3232] Java Worker thread 
finished org/apache/catalina/startup/Boostrap:main with status=3
[2013-09-18 15:26:51] [error] ( prunsrv.c:1183) [ 5632] Failed to start Java
[2013-09-18 15:26:51] [error] ( prunsrv.c:1536) [ 5632] ServiceStart returned 4
[2013-09-18 15:26:51] [debug] ( prunsrv.c:844 ) [ 5632] reportServiceStatusE: 
1, 1066, 0, 4
[2013-09-18 15:26:51] [info]  ( prunsrv.c:1598) [   48] Run service finished.
[2013-09-18 15:26:51] [info]  ( prunsrv.c:1764) [   48] Commons Daemon procrun 
finished

I cannot find any configuration errors within the server.xml and, of course, 
the error is regarding the Bootstrap.

Any ideas what would be causing the error?


Scott Pell
ODOT Information Services | Enterprise Technology - Server Application 
Infrastructure Team | Senior Web Systems Analyst
Office - 503-986-5373 | Cell - 503-931-1241



ARP Connector questions

2013-09-19 Thread Tomcat Random
Tomcat 7.0.42, RHEL6

I've installed the ARP connector and have my service.xml configured with
the only enabled connector being:

 !--APR connector native installed --
Connector port=8080 maxHttpHeaderSize=8192
 maxThreads=150
 enableLookups=false disableUploadTimeout=true
 acceptCount=100 scheme=http secure=false
 SSLEnabled=false/

1. I'm expecting about 2500 simultaneous visitors. Any thoughts on how much
I might want to bump up the maxThreads and acceptCount?

2. Does the ARP connector work within the Executor thread pools? I'm a
little unclear on this. Currently the Executor node is commented out. Do I
want a shared executor for the ARP connector?

Thanks in advance,
Alec


Re: APR Connector questions (was: ARP Connector questions)

2013-09-19 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Alec,

Changed subject: it's APR (Apache Portable Runtime), not ARP (which is
something different).

On 9/19/13 11:39 AM, Tomcat Random wrote:
 Tomcat 7.0.42, RHEL6
 
 I've installed the APR connector and have my service.xml configured
 with the only enabled connector being:
 
 !--APR connector native installed -- Connector port=8080
 maxHttpHeaderSize=8192 maxThreads=150 enableLookups=false
 disableUploadTimeout=true acceptCount=100 scheme=http
 secure=false SSLEnabled=false/
 
 1. I'm expecting about 2500 simultaneous visitors. Any thoughts on
 how much I might want to bump up the maxThreads and acceptCount?

The better question is how many simultaneous /requests/ you expect.
2500 users might not require 2500- simultaneous connections.

 2. Does the APR connector work within the Executor thread pools?
 I'm a little unclear on this. Currently the Executor node is
 commented out. Do I want a shared executor for the ARP connector?

Yes, you can use an executor. If you don't specify one, a Connector
will create a default Executor for itself. If you expect to have
multiple connectors and you want them all to share a pool of worker
threads, then you'll want to configure a single Executor and then
reference that from each of your Connectors.

Are you going to be using SSL? If not, you might have slightly better
luck with the NIO connector (APR/OpenSSL has a performance advantage
over JSSE), plus you won't have to build and babysit tcnative, etc.
Problems that occur at the NIO level will likely throw exceptions
while APR can bring-down the whole JVM. It's rare, but when it
happens, it's catastrophic.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.14 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJSOxwzAAoJEBzwKT+lPKRY2M8QAMqvN5KpOzmhBJbSlzQ770tr
xP8WiIrtloormFI9+XpT6ZJ2c1v5fx/MjlhSjhXKQd6M54pC9MKIXmM4zrpaOtPh
6amiRh7dNJXnYsUXKylw5O8lI4frsxbCnBS5wtXL1zywXL7uXbj37w4GbEzaYkql
5hL7z65/pBIhk9QTCfeUE7gvk1MQNMhkfDgGEHanWmwH3rCBucNjF7O8aUn8OlZy
3guTpvfo2TpPiSA6tpEgTliqR7ZTg19KN8flXtiN1+M/L+OGips1ihOPRYxj4Osc
A51pltqdEyv1cSR3oVyb4xYXCYHjO0kxoDNIpDr+HZp4Xw7bdb+VvXZamyffvOyP
dgs8zRRGsmKpVaPXnKcjdhNlbtCGKppQFuMeYxz975/dVxpHXcr3xmPKg33H31Jd
OnrYvyTjxeP6Y/cj1AYUZYwr+yzg3FBPv8S/O2POy1eZDTPVwr0uKfIlNYl6bzrr
PiEizoq/UYuIK+wst9NZsztAIf70VWmCbN1lW5oz090tXR0yU2xxdFhh3P7yUV/j
LxvQqGshX5uHW1sySGeznluof9t/RPd1938Sx0ML94EHmi+U7Mb+Y7u+jxy4skxT
m58Q3vxTYZrv78ayEfXP7KTdDXGItNwVwbILMpLopQ6oJe0N7ay8bbO5tj29/aR4
oOuFKKtVOXjWpZ+nC1Om
=AjzT
-END PGP SIGNATURE-

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



Re: Tomcat 7.0.42 startup failure: FindClass org/apache/catalina/startup/Boostrap failed

2013-09-19 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Scott,

On 9/19/13 11:03 AM, PELL Scott H wrote:
 Background:  Switching from Adobe JRun4 for ColdFusion and Java to
 Tomcat 7.0.42.  Have 10 years of experience with JRun4 as J2EE
 application server, so am familiar with some of the issues
 involved.
 
 Initial Install:  Installed Tomcat 7.0.42 on Windows 2012 and
 created an instance following these instructions:
 http://www.ansoncheunghk.info/article/5-steps-install-multiple-apache-tomcat-instance-windows

I
 
can simplify that installation process to 2 steps:

1. Download Tomcat from tomcat.apache.org
2. Launch the installer

Do you actually need multiple instances? The guide above has you
duplicate the Tomcat installation in its entirety and that is not
necessary at all: you can run multiple instances with a single
installation, but you do in fact need separate CATALINA_BASE
directories. (The term CATALINA_BASE is derived from the environment
variable that is consulted when locating instance-specific
configuration for multi-instance environment. CATALINA_HOME points to
the true Tomcat installation, where Tomcat's scripts, libraries, etc.
can be found.)

I would encourage you to look at the RUNNING.txt file that should have
come with your distribution of Tomcat, particularly the Advanced
Configuration - Multiple Tomcat Instances section. You should also
read the Apache Commons Daemon section because that section
describes (briefly, with documentation references) how Tomcat's
Windows services work.

Once you understand that, setting-up multiple instances as services
should make a whole lot more sense, and you'll be able to do it
without a guide of any kind.

 Error logged with DEBUG level:
 
 [2013-09-18 15:26:51] [debug] ( prunsrv.c:1679) [   48] Commons
 Daemon procrun log initialized [2013-09-18 15:26:51] [info]  (
 prunsrv.c:1683) [   48] Commons Daemon procrun (1.0.15.0 64-bit)
 started [2013-09-18 15:26:51] [info]  ( prunsrv.c:1596) [   48]
 Running 'MCAD_DEV1' Service... [2013-09-18 15:26:51] [debug] (
 prunsrv.c:1374) [ 5632] Inside ServiceMain... [2013-09-18 15:26:51]
 [debug] ( prunsrv.c:844 ) [ 5632] reportServiceStatusE: 2, 0, 3000,
 0 [2013-09-18 15:26:51] [info]  ( prunsrv.c:1127) [ 5632] Starting
 service... [2013-09-18 15:26:51] [debug] ( javajni.c:233 ) [ 5632]
 loading jvm 'C:\Java\bin\server\jvm.dll' [2013-09-18 15:26:51]
 [debug] ( javajni.c:704 ) [ 3232] Jvm Option[0]
 -Dcatalina.home=C:\Apache3 [2013-09-18 15:26:51] [debug] (
 javajni.c:704 ) [ 3232] Jvm Option[1] -Dcatalina.base=C:\Apache3 
 [2013-09-18 15:26:51] [debug] ( javajni.c:704 ) [ 3232] Jvm
 Option[2] -Djava.io.tmpdir=C:\Apache3\temp [2013-09-18 15:26:51]
 [debug] ( javajni.c:704 ) [ 3232] Jvm Option[3]
 -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager 
 [2013-09-18 15:26:51] [debug] ( javajni.c:704 ) [ 3232] Jvm
 Option[4]
 -Djava.util.logging.config.file=C:\Apache3\conf\logging.properties 
 [2013-09-18 15:26:51] [debug] ( javajni.c:704 ) [ 3232] Jvm
 Option[5]
 -Djava.class.path=C:\Apache3\bin\bootstrap.jar;C:\Apache3\tomcat-juli.jar

 
[2013-09-18 15:26:51] [debug] ( javajni.c:704 ) [ 3232] Jvm Option[6] exit
 [2013-09-18 15:26:51] [error] ( javajni.c:863 ) [ 3232] FindClass
 org/apache/catalina/startup/Boostrap failed [2013-09-18 15:26:51]
 [debug] ( javajni.c:964 ) [ 3232] Java Worker thread finished
 org/apache/catalina/startup/Boostrap:main with status=3 [2013-09-18
 15:26:51] [error] ( prunsrv.c:1183) [ 5632] Failed to start Java 
 [2013-09-18 15:26:51] [error] ( prunsrv.c:1536) [ 5632]
 ServiceStart returned 4 [2013-09-18 15:26:51] [debug] (
 prunsrv.c:844 ) [ 5632] reportServiceStatusE: 1, 1066, 0, 4 
 [2013-09-18 15:26:51] [info]  ( prunsrv.c:1598) [   48] Run service
 finished. [2013-09-18 15:26:51] [info]  ( prunsrv.c:1764) [   48]
 Commons Daemon procrun finished
 
 I cannot find any configuration errors within the server.xml and,
 of course, the error is regarding the Bootstrap.

What is in C:\Apache3? Is that a complete Tomcat installation, or is
that more of a CATALINA_BASE which just has configuration files and
your webapp(s)?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.14 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJSOxp6AAoJEBzwKT+lPKRY6/wP/0BAgDUjq6PpRC80EAHOMdDE
NXV21DQT8z9cuWezaLrxPM08Nr7j6a3zNllrW4hwzGJy2MT5His10YxKOe8O4fnG
65SMKap/NT6/d1f0xPu5eCQxC/L3B4AGXxnaKjBKFjOaHZKQxaWtd2RyStL1OCz9
0gs9Ed0XBu+pGABZ7PQHUfQOzDp7e2ISBwkn3BGcXQUclCCOjzJaiKbVOouhW+q/
y1o8veV6/bojm8/bB9NIrk9X6KD066wY5U2zSTpogfIOPobQJB3wh0swpDipSSMN
DXZ82IagvHAtrPAI3KDxFLl6R2inzYpy1uPY5ZSC5n7KaiFRKvNId+EjTnBaWxiU
ICPaGYPFUMmNQWuqKJTBANi0IDeFReFJb4VA35pvzkAO5iQCNxDs68ZWcGGS6d7d
DKWvZGfTgyJS2j4ix5ntv+DARoqz5gHSXsifx7E00l2LwimVcrq6iuf3EyxUV3Ho
R1pzD2zIq5AezOc4XwUmX7xLaM2SD7oobLum+vSRGUeyFJvePmqhxkpV1DwwPIv1
nhmfTmBAYzKe+YYTNittsaIF22I0jp7JCR0uMALrTR69I6L05viYdyjrrdEV0Hf1

mod_jk not changes IP of hostname when occurs changing of IP on DNS

2013-09-19 Thread Tiago Braga
In apache, the module mod_jk not changes IP of hostname when occurs
changing of IP on DNS.

Version of apache:
Server version: Apache/2.2.15 (Unix)
Server built:   Aug  2 2013 08:02:15

Version mod_jk: 1.2.37

Example:

workers.properties

worker.portalconsultoras_prd.type=ajp13
worker.portalconsultoras_prd.host=hostexample.com.br
worker.portalconsultoras_prd.port=8009

This configuration works fine.

But, when occurs change ip in the host name in DNS, the module md_jk starts
fail to connect. Follow below the log of mod_jk:

[Wed Sep 18 12:00:33 2013] [5315:140659824723936] [info]
jk_open_socket::jk_connect.c (627): connect to 107.xx.xx.220:8009 failed
(errno=115) [Wed Sep 18 12:00:33 2013] [5315:140659824723936] [info]
ajp_connect_to_endpoint::jk_ajp_common.c (995): Failed opening socket to
(107.xx.xxx.220:8009) (errno=115) [Wed Sep 18 12:00:33 2013]
[5315:140659824723936] [error] ajp_send_request::jk_ajp_common.c (1630):
(portalconsultoras_prd) connecting to backend failed. Tomcat is probably
not started or is listening on the wrong port (errno=115)

I would like a configuration of apache that avoid this problem.

Looking for the solutions in google, have turn on the HostnameLookups,
but is inefficient.

Thanks!

-- 
Atenciosamente,
Tiago Braga Machado


RE: Tomcat 7.0.42 startup failure: FindClass org/apache/catalina/startup/Boostrap failed

2013-09-19 Thread PELL Scott H
Chris,
Thanks for the quick reply.  Am uninstalling it all and starting over.  We have 
an extensive installation of ColdFusion 9 and Java running on JRun4 to provide 
line-of-business application isolation for security, etc.; it includes about 90 
instances as well as nearly 80 web sites.  As a result, I need to be able 
cluster multiple instances for session-replication and loading-balance; that 
allows me to stop/start instances for maintenance or troubleshooting without 
bringing business to a halt.  And to complicate it all, we are running a 
multi-tiered (ColdFusion/Java 'distributed mode') configuration with remote web 
server clusters accessing the ColdFusion/JRun clusters.  As you can see, I have 
a lot of details to deal with in the migration. :)

Will start over and see how it goes.  And yes, I have read the RUNNING.txt and 
still have had problems; hence, the uninstall and start over.

Thanks,
Scott

-Original Message-
From: Christopher Schultz [mailto:ch...@christopherschultz.net] 
Sent: Thursday, September 19, 2013 8:39 AM
To: Tomcat Users List
Subject: Re: Tomcat 7.0.42 startup failure: FindClass 
org/apache/catalina/startup/Boostrap failed

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Scott,

On 9/19/13 11:03 AM, PELL Scott H wrote:
 Background:  Switching from Adobe JRun4 for ColdFusion and Java to 
 Tomcat 7.0.42.  Have 10 years of experience with JRun4 as J2EE 
 application server, so am familiar with some of the issues involved.
 
 Initial Install:  Installed Tomcat 7.0.42 on Windows 2012 and created 
 an instance following these instructions:
 http://www.ansoncheunghk.info/article/5-steps-install-multiple-apache-
 tomcat-instance-windows

I
 
can simplify that installation process to 2 steps:

1. Download Tomcat from tomcat.apache.org 2. Launch the installer

Do you actually need multiple instances? The guide above has you duplicate the 
Tomcat installation in its entirety and that is not necessary at all: you can 
run multiple instances with a single installation, but you do in fact need 
separate CATALINA_BASE directories. (The term CATALINA_BASE is derived from the 
environment variable that is consulted when locating instance-specific 
configuration for multi-instance environment. CATALINA_HOME points to the true 
Tomcat installation, where Tomcat's scripts, libraries, etc.
can be found.)

I would encourage you to look at the RUNNING.txt file that should have come 
with your distribution of Tomcat, particularly the Advanced Configuration - 
Multiple Tomcat Instances section. You should also read the Apache Commons 
Daemon section because that section describes (briefly, with documentation 
references) how Tomcat's Windows services work.

Once you understand that, setting-up multiple instances as services should make 
a whole lot more sense, and you'll be able to do it without a guide of any kind.

 Error logged with DEBUG level:
 
 [2013-09-18 15:26:51] [debug] ( prunsrv.c:1679) [   48] Commons
 Daemon procrun log initialized [2013-09-18 15:26:51] [info]  (
 prunsrv.c:1683) [   48] Commons Daemon procrun (1.0.15.0 64-bit)
 started [2013-09-18 15:26:51] [info]  ( prunsrv.c:1596) [   48]
 Running 'MCAD_DEV1' Service... [2013-09-18 15:26:51] [debug] (
 prunsrv.c:1374) [ 5632] Inside ServiceMain... [2013-09-18 15:26:51] 
 [debug] ( prunsrv.c:844 ) [ 5632] reportServiceStatusE: 2, 0, 3000,
 0 [2013-09-18 15:26:51] [info]  ( prunsrv.c:1127) [ 5632] Starting 
 service... [2013-09-18 15:26:51] [debug] ( javajni.c:233 ) [ 5632] 
 loading jvm 'C:\Java\bin\server\jvm.dll' [2013-09-18 15:26:51] [debug] 
 ( javajni.c:704 ) [ 3232] Jvm Option[0]
 -Dcatalina.home=C:\Apache3 [2013-09-18 15:26:51] [debug] (
 javajni.c:704 ) [ 3232] Jvm Option[1] -Dcatalina.base=C:\Apache3
 [2013-09-18 15:26:51] [debug] ( javajni.c:704 ) [ 3232] Jvm Option[2] 
 -Djava.io.tmpdir=C:\Apache3\temp [2013-09-18 15:26:51] [debug] ( 
 javajni.c:704 ) [ 3232] Jvm Option[3] 
 -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
 [2013-09-18 15:26:51] [debug] ( javajni.c:704 ) [ 3232] Jvm Option[4] 
 -Djava.util.logging.config.file=C:\Apache3\conf\logging.properties
 [2013-09-18 15:26:51] [debug] ( javajni.c:704 ) [ 3232] Jvm Option[5] 
 -Djava.class.path=C:\Apache3\bin\bootstrap.jar;C:\Apache3\tomcat-juli.
 jar

 
[2013-09-18 15:26:51] [debug] ( javajni.c:704 ) [ 3232] Jvm Option[6] exit
 [2013-09-18 15:26:51] [error] ( javajni.c:863 ) [ 3232] FindClass 
 org/apache/catalina/startup/Boostrap failed [2013-09-18 15:26:51] 
 [debug] ( javajni.c:964 ) [ 3232] Java Worker thread finished 
 org/apache/catalina/startup/Boostrap:main with status=3 [2013-09-18 
 15:26:51] [error] ( prunsrv.c:1183) [ 5632] Failed to start Java
 [2013-09-18 15:26:51] [error] ( prunsrv.c:1536) [ 5632] ServiceStart 
 returned 4 [2013-09-18 15:26:51] [debug] (
 prunsrv.c:844 ) [ 5632] reportServiceStatusE: 1, 1066, 0, 4 
 [2013-09-18 15:26:51] [info]  ( prunsrv.c:1598) [   48] Run service
 finished. [2013-09-18 15:26:51] [info]  ( 

Re: Exception thrown while starting tomcat on Mac OS

2013-09-19 Thread Kalyan Vavilapalli
Mark,

I did follow all the links and did not find any answers. Is there a
specific link you are referring to that I am overlooking?

Appreciate you help.

Thanks
Kalyan

On 9/19/13 9:37 AM, Mark Thomas ma...@apache.org wrote:

On 19/09/2013 15:04, Kalyan Vavilapalli wrote:
 I am on a Mac version 10.8.4 using tomcat 6.0.37 and Oracle JDK7.
Recently upgraded from JDK6 to JDK 7. When I try to start tomcat the
exceptions below are thrown at the very end.
 
 I searched all over the internet for solutions to this, but nothing
seems to work. I tried adding these parameters to the start-up script
like some suggested and that did not work either.
 -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv6Addresses=false
 
 One thing to note, it does not fail every timeabout 60% of the time
it fails to start correctly. Any pointers would be appreciated very much.
 
 There is a thread about this on Stack Exchange with some information,
but no answer :)
 
http://stackoverflow.com/questions/18883209/tomcat-startup-java-net-socke
texception-invalid-argument-mac-os-x

Try following the links in that question to the one it duplicates where
you.ll find a lot more information including the answer.

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: Tomcat 7.0.42 startup failure: FindClass org/apache/catalina/startup/Boostrap failed

2013-09-19 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Scott,

On 9/19/13 12:25 PM, PELL Scott H wrote:
 Thanks for the quick reply.  Am uninstalling it all and starting 
 over.  We have an extensive installation of ColdFusion 9 and Java 
 running on JRun4 to provide line-of-business application isolation 
 for security, etc.; it includes about 90 instances as well as
 nearly 80 web sites.  As a result, I need to be able cluster
 multiple instances for session-replication and loading-balance;
 that allows me to stop/start instances for maintenance or
 troubleshooting without bringing business to a halt.  And to
 complicate it all, we are running a multi-tiered (ColdFusion/Java
 'distributed mode') configuration with remote web server clusters
 accessing the ColdFusion/JRun clusters.  As you can see, I have a
 lot of details to deal with in the migration. :)

No problem. It's nice to know there are some competent system
administrators out there who know how do a complicated deployment
properly :)

 Will start over and see how it goes.  And yes, I have read the 
 RUNNING.txt and still have had problems; hence, the uninstall and 
 start over.

Make sure you can get one Tomcat instance running as a service with
split home/base and then you can just duplicate everything each time.
Remember you'll obviously need separate CATALINA_BASE (for port
numbers) and Windows Service names for each instance.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.14 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJSOzP6AAoJEBzwKT+lPKRYvOAQAKa042pXOvsVz71qSglFbKFa
eZaKgywF8pU6idWY4pPRW136WtZgwQTwLGcZJisHeOTPjjSiPfXSWWL8GheRJPxh
2/XzfWYUQF/4DoWvDtmcOBSFOF3qfK2lq0J6O07ckGSZPj8dbF5jHCuzj33afK6R
QVxyRbfd60/OA3PYwYBPaIDHFmT+HBPBl+adoign3/rgy8h4MV14XjYRL1I7O+w7
5VB5rtAMDB0K4dElu0db3SB/8+By3g5NmHBVfp3jMi5YZsSzCfGQ0PZnZ2/4o+hc
NaXPfA5PpW4o/zWZj56CbYRS++kVSNVCkM9VSlgbQOTyKENJMwjn6QBHU18NHCR4
6/HpxqHcRlbZisN3ycR8ROjvNfumMPuWtT3hWstjcHExh0UHXlmfsujnjkXGZ/Rr
B6i/IlOXJCVb3Wyu+F3DkJDR/ddsoiUVttrBG4UxEsJY3LqxeNcKm4WB/lOdjk8w
RdbFfQD1QXTBFKHVVyVTvmfRea2hQmnVTx7iGC34pMWkkH244MsmMWGoCX9Xvva5
gz276quJFsVCG9EgT0c2sKwRKpP52LVuJ+rNdLck3I9dLdsQ7kPI9AsdBP6vyYcn
F5006Vv54D0C5X+ZEjY3OztHTAy5VG66FqFqlnb0puVTt+fgfBgUp/R8dKVveNEd
SyVzv6rfd518xW8xuAYC
=ch+5
-END PGP SIGNATURE-

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



Re: APR Connector questions

2013-09-19 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Alec,

Please keep discussions on the mailing lists so others can benefit
from them.

On 9/19/13 12:01 PM, Tomcat Random wrote:
 The answer for am I going to be using SSL is maybe. It's not
 mandatory, but would be nice for an admin area of the site. I
 already built the tcnative stuff and APR is working, but not under
 load.

Do you mean it's not working under load, or you haven't yet tried it
under load?

 I'm using APR because it was my understanding there was a big 
 performance increase when using Tomcat without a proxy/web server
 in front of it. I just have Tomcat with my IP tables redirecting
 80-8080.

APR and NIO performance are comparably to each other, SSL excepted. If
you are talking about using SSL only for admin access (which is
usually fairly limited in scope/traffic), then I wouldn't worry about
the performance difference.

One could argue that any site that requires login should be 100%
SSL-protected, but I know nothing about your requirements.

 2500 users might not require 2500- simultaneous connections.
 True, and it occurs to me, sort of noobishly, where would you look
 for reporting simultaneous connections?

You can use JMX to get lots of information about the connectors.
You'll have to probe periodically and build-up a trend graph to
understand your actual traffic.

http://wiki.apache.org/tomcat/FAQ/Monitoring

 And once you know that number, back to my original question, how
 many maxthreads/acceptCounts?

The acceptCount is just the TCP backlog. Setting this higher than the
default is only helpful if you have huge transaction volume bursts and
your transactions are fairly short. If you can't handle 200
transactions waiting in the TCP accept queue pretty quickly, it's not
going to help to raise that number to 1000. If you experience huge
bursts of traffic that your app can handle with a short delay -- AND
if you absolutely don't want to give any clients connection refused
errors -- then raising the acceptCount is appropriate. I haven't seen
a normal webapp that has ever required changing from the default,
but my experience may not match the type of business you are in.

As for maxThreads, that depends upon your load, the type of hardware
you have, the length of your transactions, and the CPU load you expect
will be required for your webapp. If your webapp is fairly CPU-bound
(which I've found to be fairly rare) and you have a limited number of
physical CPUs, raising the maxThreads limit buys you nothing: it may
be worse than lowering it because you just end up running many threads
at once and thrash the CPU.

If you have a primarily I/O-bound app (most that I've seen... e.g.
stuff that uses back-end databases for most requests) than raising the
maxThreads can serve more requests... but then remember that your
database must be able to handle the load as well. Having 1000 worker
threads with a DB connection pool of size=10 means lots of waiting
threads.

 Just how rare are the APR catastrophes?

I don't have much data on frequency of occurrences just what I can
see in BZ for the Tomcat Connectors project.

 Is it something a tomcat restart can fix?

You don't have a choice: the JVM goes down immediately and you *must*
restart Tomcat. That's what I meant by catastrophic.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.14 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJSOzZ/AAoJEBzwKT+lPKRYL+0QAKMQIlr2crCQ35nbop8BvSGl
GpxfNiVhmNdVLwzNIp68xoQQhpYHMcg/ukFLjwaGG6AORlxf39PLFizd0TMKJNtO
EK2ZCRq6X4WXIwTPIaCb0ovbVp3HxIXPs+VxPVaDcxiHSCQN0FoaQFgP35E91rDR
ymgATcj+XXbc8rH5DyRMSPExbzO/5SeBWM65uQLfa2iA/qLCFq8NsrZgvi6QxZjR
O9JX+hWogL1nTPmgyyyXqY1YtIzTpB7F35itCCcccAkbmt4YePb7joQ4pPPX2jvT
aAggfHg9YUWoUuRA4IwCRRBkZiWSc8vkQhwV6vBN7Bw7/pK7x0SmwsBtBeZFkYa2
kxP8BOAVbsZu7ahnqGVIY17ul8FF4lslfRWN2YY4qqNdShUXkcTMiOoQcCU8Y4FL
zPgmIlqUQ2KRP8F9+9/66RCMCv+RS4bxo6Aq+IeEoz0B7peWVLDMLORNc5D6Y2s8
P/0ImtczB/wvEPdKpRVqB2uuDJfOBUD0vFGv3/TH8WXHIJyIiwK+Up3vtFlAEJjm
DLgO7W18mmEum81hrfvt4JXFFCV9kqHhVpFHXXDcARL4qEwp4fI2DaEitj1e5fGk
FIIA/EIx3gU0vjy3yjqccO9WjvHkbotgrJuWgrdPz25VA5ceGqqUaSWxKP4mEooy
nZAhl1oF5Glv3rIyNkjN
=7erg
-END PGP SIGNATURE-

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



Re: Audit Exceptions on Apache

2013-09-19 Thread Michael-O

Am 2013-09-18 11:04, schrieb Joy Obba:

Hello Team,

Some security issues were raised by our audit team and these issues were
forwarded to secur...@apache.org.
We got a response from Mark Thomas from the Security team
Theses issues are listed below:

1. Banner Disclosure
  We observed that the GTApplication web server disclosed the Apache Coyote
version in its HTTP response. The extracted version is: Apache-Coyote/1.1
*Risk *
   This information might help an attacker gain a greater understanding of
the systems in use and potentially develop further attacks targeted at the
specific version of Apache.

***Response *

   Not a vulnerability in Apache Tomcat. Every currently supported version
  of Apache Tomcat includes that information in the header. All it tells
  an attacker is that you are running Apache Tomcat.

  If you really want to change it, a configuration option to do that is
  available on the connector.


I absolutely agree with Mark. Security by obscurity has never worked out 
and you should not rely on.


Michael


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



RE: APR Connector questions

2013-09-19 Thread Jeffrey Janner
 -Original Message-
 From: Christopher Schultz [mailto:ch...@christopherschultz.net]
 Sent: Thursday, September 19, 2013 12:38 PM
 To: Tomcat Users List
 Cc: Tomcat Random
 Subject: Re: APR Connector questions
 
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA256
 
 Alec,
 
 Please keep discussions on the mailing lists so others can benefit from
 them.
 
 On 9/19/13 12:01 PM, Tomcat Random wrote:
  The answer for am I going to be using SSL is maybe. It's not
  mandatory, but would be nice for an admin area of the site. I already
  built the tcnative stuff and APR is working, but not under load.
 
 Do you mean it's not working under load, or you haven't yet tried it
 under load?
 
  I'm using APR because it was my understanding there was a big
  performance increase when using Tomcat without a proxy/web server in
  front of it. I just have Tomcat with my IP tables redirecting
  80-8080.
 
 APR and NIO performance are comparably to each other, SSL excepted. If
 you are talking about using SSL only for admin access (which is
 usually fairly limited in scope/traffic), then I wouldn't worry about
 the performance difference.
 
 One could argue that any site that requires login should be 100% SSL-
 protected, but I know nothing about your requirements.
 

+1

  2500 users might not require 2500- simultaneous connections.
  True, and it occurs to me, sort of noobishly, where would you look
 for
  reporting simultaneous connections?
 
 You can use JMX to get lots of information about the connectors.
 You'll have to probe periodically and build-up a trend graph to
 understand your actual traffic.
 
 http://wiki.apache.org/tomcat/FAQ/Monitoring
 
  And once you know that number, back to my original question, how many
  maxthreads/acceptCounts?
 
 The acceptCount is just the TCP backlog. Setting this higher than the
 default is only helpful if you have huge transaction volume bursts and
 your transactions are fairly short. If you can't handle 200
 transactions waiting in the TCP accept queue pretty quickly, it's not
 going to help to raise that number to 1000. If you experience huge
 bursts of traffic that your app can handle with a short delay -- AND if
 you absolutely don't want to give any clients connection refused
 errors -- then raising the acceptCount is appropriate. I haven't seen a
 normal webapp that has ever required changing from the default, but
 my experience may not match the type of business you are in.
 
 As for maxThreads, that depends upon your load, the type of hardware
 you have, the length of your transactions, and the CPU load you expect
 will be required for your webapp. If your webapp is fairly CPU-bound
 (which I've found to be fairly rare) and you have a limited number of
 physical CPUs, raising the maxThreads limit buys you nothing: it may be
 worse than lowering it because you just end up running many threads at
 once and thrash the CPU.
 
 If you have a primarily I/O-bound app (most that I've seen... e.g.
 stuff that uses back-end databases for most requests) than raising the
 maxThreads can serve more requests... but then remember that your
 database must be able to handle the load as well. Having 1000 worker
 threads with a DB connection pool of size=10 means lots of waiting
 threads.
 
  Just how rare are the APR catastrophes?
 
 I don't have much data on frequency of occurrences just what I can
 see in BZ for the Tomcat Connectors project.
 

Let's just say that over the past 8 or so years, I've yet to have it happen to 
me, and I am supporting dozens of Tomcat instances across a half-dozen systems 
with each Tomcat having 5 or 6 hosts each. Then again, I'm running under 
Windows and the tcnative is built for me by the good guys on the Tomcat Dev 
Team.

  Is it something a tomcat restart can fix?
 
 You don't have a choice: the JVM goes down immediately and you *must*
 restart Tomcat. That's what I meant by catastrophic.
 

Yes, unfortunately, anything that causes a crash at the native code level is 
going to stop everything.
A restart may not fix the problem, but you can usually at least recover to a 
normal state for a time. At least until whatever specific circumstances that 
caused the crash occur again.

Jeff


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



Re: Using EL expressions in an ObjectFactory

2013-09-19 Thread Esmond Pitt

Mark

Can I direct your attention to java.beans.Statement and
java.beans.Expression. They already do all the matching you're talking
about.

EJP

Forward to the list as per Marks' request. 

-Original Message-
From: Mark Thomas [mailto:ma...@apache.org]
Sent: Tuesday, 17 September 2013 12:02 AM
To: Tomcat Users List
Subject: Re: Using EL expressions in an ObjectFactory

On 16/09/2013 14:43, Xavier Dury wrote:
 I built tomcat from trunk (rev 1523639) and I'm having the same issue I
had with glassfish EL implementation when using overloaded methods:
 
 javax.el.ELException: Cannot convert ./ of type class java.lang.String to
class java.net.URI
   at org.apache.el.lang.ELSupport.coerceToType(ELSupport.java:482)
   at
org.apache.el.ExpressionFactoryImpl.coerceToType(ExpressionFactoryImpl.java:
48)
   at javax.el.ELContext.convertToType(ELContext.java:473)
   at
org.apache.el.lang.EvaluationContext.convertToType(EvaluationContext.java:15
5)
   at javax.el.ELUtil.invokeConstructor(ELUtil.java:261)
   at
javax.el.StaticFieldELResolver.invoke(StaticFieldELResolver.java:203)
   at javax.el.CompositeELResolver.invoke(CompositeELResolver.java:256)
   at org.apache.el.parser.AstFunction.getValue(AstFunction.java:138)
   at
org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:188)
   at javax.el.ELProcessor.getValue(ELProcessor.java:129)
   at javax.el.ELProcessor.eval(ELProcessor.java:115)
   at
 org.apache.naming.factory.ExpressionFactoryTest.elImplementationShould
 Work(ExpressionFactoryTest.java:43)
 
 So I guess it's normal behaviour, isn't it?
 
 I don't think EL spec does mandate implementations to make their best
effort to find a suitable method when invoking overloaded methods.

My intention with the Tomcat EL implementation is to replicate, as far as
possible, the matching process that the Java compiler uses.

If you open a bug and include a test case along the lines of this one[1],
I'll take a look.

Mark

[1]
http://svn.apache.org/viewvc/tomcat/trunk/test/javax/el/TestUtil.java?view=a
nnotate



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