Re: Effect of Heap Size on Performance?
On Wed, Mar 11, 2009 at 1:56 AM, Caldarale, Charles R chuck.caldar...@unisys.com wrote: It's impossible to prevent at least some objects from eventually migrating to the OldGen, since anything that persists long enough will end up there after some number of minor GCs. But by choosing a large enough heap size (and evtl. according strategy) it is possible to optimize the usage of the eden aka young space and to reduce the amount of minor collections, hence reducing the chances for unnecessary migration into old space. However, in a webapp, anything you create during the processing of a request should remain in the eden and 'die young' (unless you put it in a session or a cache explicitely). JMX gives you the access to MemoryPool usage statistics and you can actually monitor all of heap-spaces separately. Moskito btw, gathers this info and presents it via its web ui: http://moskito.anotheria.net/moskitodemo/mui/mskShowProducersByCategory?pCategory=memory We use this info to create graphs of free memory in relevant spaces (the tenured/old space, depending on the collector is the most easiest to monitor, and most relevant to performance) and optimize the settings unless the memory usage graphs are looking well (not hectic, well formed sawtooth). With the graph you would also detect a memory leak much faster, even if the heap size would be too large. regards Leon - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Starting Tomcat6 via command line/Removing registry keys
From: Cornelius Herzog (CH Software) [mailto:c.her...@chsoftware.net] Now I want to control Tomcat via an external script and so I need it to start via command line to adapt the parameters. If you install Tomcat via the zip (not the exe), you get some scripts to control its startup and shutdown via the command line. tomcat6.exe is not used, and neither is the registry. Try downloading the zip, unzipping it, looking for the .bat files in the root of the unzipped content and moving them across to your current install. For some reason the scripts are not included in the setup version that installs the service. Several of us on this list are puzzled about why they are not included. - Peter - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Lazy Virtual Hosting?
Caldarale, Charles R wrote: From: Gregor Schneider [mailto:rc4...@googlemail.com] Subject: Re: Lazy Virtual Hosting? However, since I'll have to use Authentication (see my other post), thus needing SSL, I guess I have to setup a HTTP-Connector for each of them. Depends on how much separation you want. If you're using a self-signed certificate, then the same one should suffice for all of your sites. If you want real certificates, then you'll need a separate Connector for each site, assigned to the IP address for that site. Clients won't be able to login with an IP address, but that's probably not a big deal. If you really want to have a separate Connector for each site with no potential for cross-talk, you'll actually need a separate Service element for each. Alternatively, a Valve at the Engine level would probably suffice to prevent mixing of IP addresses and site names. The simplest way to achieve this would be to use an Alias element under each Host element that specifies the IP address for that host. Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: request.getRemoteAddr() vs. request.getHeader(REMOTE_ADDR)
On 10.03.2009 23:10, André Warnier wrote: Rainer Jung wrote: [...] 2) getRemoteAddr() gives you the address of the system, which opened the connection. In case of an AJP connector, this is not true, because AJP is meant to be used for reverse proxies. So here you get the address of the system which opened the connection to the web server, forwarded via AJP to Tomcat. Rainer, how does that combine with the mod_jk ForwardLocalAddress directive ? And, by the way, which local address are we talking about ? (I mean,if the front-end Apache server has several IP adresses, which one would it pass on to Tomcat ?) Ah, actually forgot about that one. We then forward a local_ip field of httpd as the client address. From the code of httpd it seems, that it is the address, to which the connection came in. I'll double check and add that feature to the new jk documentation page about proxies. Thanks for asking, Rainer - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Https forwarding problem
Thanks for your reply Chris. At first i did try to limit using address attribute, but later i removed it. The config snippets i have shown are complete. You are right, the exception is coming from the web service call. My concern is that because i have this security-constraint which makes any url pattern CONFIDENTIAL, that it's causing the web service call to be redirected as well. And its very frustrating why the following config is NOT working (where i specify that urls starting with axis2 should be ignored), and ws calls STILL get redirected: security-constraint web-resource-collection url-pattern/axis2/*/url-pattern url-pattern/axis2/rest/*/url-pattern /web-resource-collection user-data-constraint transport-guaranteeNONE/transport-guarantee /user-data-constraint /security-constraint Any ideas? Thanks. -h On Tue, Mar 10, 2009 at 9:07 PM, Christopher Schultz ch...@christopherschultz.net wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hisham, On 3/6/2009 6:21 AM, Hisham wrote: url-pattern/*/url-pattern transport-guaranteeCONFIDENTIAL/transport-guarantee Good. Connector port=80 redirectPort=443 / Connector port=443 scheme=https secure=true clientAuth=false sslProtocol=TLS keystoreFile=conf/keystore.jks keystorePass=xyz maxPostSize=15728640 / Good. I have created the certificates, etc. and it works fine and if i type http://localhost I am redirected to https://localhost and the login page is shown. Good. But, during login, I am making a web service call. These web services are deployed on the same Tomcat and are accessed via http://localhost/axis2/rest... When i try to login I am getting an exception: java.net.ConnectException: Connection refused at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333) Presumably this happens to the web service call, not to your application, right? Your stack trace didn't include enough to show where your code comes in. Connection Refused indicates that you can't reach the correct service. Since you're connecting to localhost you're unlikely to be having firewall issues (though such access /could/ be blocked). My guess is that you've bound your Connector to a specific IP address using the address attribute. Did you post your entire server.xml file, or just the relevant parts? You might want to re-post with all the details. So i figured that the web service call is also being accessed via SSL and that is not supported by the caller. Anyway to get around this I have tried a NUMBER of things: 1. I added a second security-constraint in web.xml with url pattern as /axis2/* which has transport-guarantee as NONE. 2. I added a 2nd service to my server.xml that has the web services deployed on a different port. 3. And a whole lot of other things that were useless :( Is it even possible to do this, going from https - http (they are 2 separate applications mind you)? Does anyone have any suggestions on how to fix this? This is driving me nuts! Thanks! If you get the same error (connection refused) no matter what you try, then my conclusion is that you'd bound your Connector to specific address. That means that you can't make a connection to localhost:80 because nobody is listening. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkm2iTEACgkQ9CaO5/Lv0PCEewCfSTEb3+L3jl1tpa/2o5VGIvhl kzUAn1NK66mvK1uhyqXpUv4qsPj/Kv1z =FTFh -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat Clustering trouble when starting up under high load
Hi Rainer, thanks for your response. I tried the config you suggested. It suppose the way of configuring those parameters is as you said, but skipping manager. from the begining, as when I tried as you said, I got this in the catalina. log: 10-mar-2009 15:58:19 org.apache.tomcat.util.digester.SetPropertiesRule begin ADVERTENCIA: [SetPropertiesRule]{Server/Service/Engine/Cluster/Manager} Setting property 'manager.sendAllSessions' to 'false' did not find a matching property. 10-mar-2009 15:58:19 org.apache.tomcat.util.digester.SetPropertiesRule begin ADVERTENCIA: [SetPropertiesRule]{Server/Service/Engine/Cluster/Manager} Setting property 'manager.sendAllSessionsSize' to '200' did not find a matching property. 10-mar-2009 15:58:19 org.apache.tomcat.util.digester.SetPropertiesRule begin ADVERTENCIA: [SetPropertiesRule]{Server/Service/Engine/Cluster/Manager} Setting property 'manager.sendAllSessionsWaitTime' to '0' did not find a matching property. 10-mar-2009 15:58:19 org.apache.tomcat.util.digester.SetPropertiesRule begin Maybe without the manager prefix? sendAllSessions=false, sendAllSessionSize=200 and sendAllSessionsWaitTime=? Filip, we consider taking thead dumps, but we are using jdk 1.5 under windows. I heard it is not supported in Windows until jdk 1.6. Is it true? Best regards Mikel 2009/3/9 Rainer Jung rainer.j...@kippdata.de On 09.03.2009 09:24, Mikel Ibiricu wrote: So, It works OK but when starting up one of the nodes with over 500 sessions alive in the other, it doesn't replicate anything. We assume that it would not be able to replicate everything... but why it does either replicate everything or nothing? If it's not able replicate all the sessions, we would assume it, but we would like to replicate at least something... Maybe some trouble with the config we are trying? We tried to limit the keepAliveCount of the senders, without improvement with this. Reading the DeltaManager code, I have seen the sendAlllSessions parameter. According to in-line javadoc and the implementation, /** * handle receive that other node want all sessions ( restart ) * a) send all sessions with one message * b) send session at blocks * After sending send state is complete transfered * @param msg * @param sender * @throws IOException */ protected void handleGET_ALL_SESSIONS(SessionMessage msg, Member sender) throws IOException { [...] if (isSendAllSessions()) { sendSessions(sender, currentSessions, findSessionTimestamp); } else { // send session at blocks int len = currentSessions.length getSendAllSessionsSize() ? currentSessions.length : getSendAllSessionsSize(); Session[] sendSessions = new Session[len]; for (int i = 0; i currentSessions.length; i += getSendAllSessionsSize()) { len = i + getSendAllSessionsSize() currentSessions.length ? currentSessions.length - i : getSendAllSessionsSize(); System.arraycopy(currentSessions, i, sendSessions, 0, len); sendSessions(sender, sendSessions,findSessionTimestamp); if (getSendAllSessionsWaitTime() 0) { try { Thread.sleep(getSendAllSessionsWaitTime()); } catch (Exception sleep) { } }//end if }//for }//end if SessionMessage newmsg = new SessionMessageImpl(name,SessionMessage.EVT_ALL_SESSION_TRANSFERCOMPLETE, null,SESSION-STATE-TRANSFERED, SESSION-STATE-TRANSFERED+ getName()); newmsg.setTimestamp(findSessionTimestamp); if (log.isDebugEnabled()) log.debug(sm.getString(deltaManager.createMessage.allSessionTransfered,getName())); counterSend_EVT_ALL_SESSION_TRANSFERCOMPLETE++; cluster.send(newmsg, sender); } it may cover our expectatives, so I tried to include sendAllSessions=false in the cluster manager configuration Manager className=org.apache.catalina.ha.session.DeltaManager name=clusterPruebas6 stateTransferTimeout=180 expireSessionsOnShutdown=false notifyListenersOnReplication=false sendAllSessions=false/ But it seems like this parameter is not configurable from the server.xml file. So, what can I do to force that if it's not posible to replicate all the sessions, at least replicate something in the startup? If you want to test with sendAllSessions set to false, then add manager.sendAllSessions=false to the Manager element of the cluster configuration. You might then also want to configure: manager.sendAllSessionsSize: the number of session which will be serialized and send in one chunk (default if sendAllSessions=false: 1000) manager.sendAllSessionsWaitTime: the time in milliseconds between sending out consecutive session chunks
hanging threads on Tomcat
Hi all, on one of our websites we have a problem with threads keep hanging in Tomcat. We first noticed this 1.5 week ago and tried several things to find a solution. At that moment we were using java 1.4 and Tomcat 5.0. The symptoms were there after three hours of operation, about 250 threads were hanging within tomcat, and they seemed to be waiting for something. After a week we realised we needed more information whihc we couldn't get from the current setup, we upgraded the three production application servers to be Java 1.5 and Tomcat 5.5.25. All three servers still have the same problem, although the problem now has an interval of appr. 6 hours instead of three. During the hanging of the threads we made 8 threaddumps. But i am unsure of how to read the thread dumps. A small overview of the state of the threads: - 309 threads overall - Threads waiting for monitors: 57 - Threads sleeping on monitors: 191 - Threads locking monitors: 225 - Monitors: 225 - Monitors without locking threads: 3 Can somebody please help me figuring out what the cause is, or how to find the cause of the problem? Best regards, Patrick - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Tomcat for Dummies
Hi. As part of the beginners rubrique, I have a question which will undoubtedly show the depth of my lack of knowledge of things Java and Tomcat. But maybe there will be a sympathetic soul here. Since I am still missing much of the underlying knowledge, I would beg that whoever answers does not get too classy on me. The question is at the level of generalities, not classloaders or GC strategies level. My question concerns the starting and stopping of web applications under Tomcat, and what these terms really mean in that context. If I look at the Tomcat Manager application, and its capabilities of starting ans stopping applications, I get approximately the following mental picture : - we have a JVM. That is the real process that is running, at the OS level. That process can be killed, or decide to stop running, at which point we don't have a JVM process anymore, and thus no Tomcat and no webapps at all. That's kind of drastic and definitive. - inside the JVM, we have a Tomcat. Basically, that is only code which the JVM is running (a bit like a Perl interpreter process runs the list of Perl opcodes it has compiled a perl script into). Tomcat can somehow decide that it is tired of living, and tell the JVM to stop running it. At which point we have no webapps and no Tomcat anymore, and consequently (I presume, but this is already a bit less clear), no JVM anymore either, because not having anything to do anymore, it would also exit. Or ? - then inside Tomcat, we have webapps. It's already getting more mysterious there for me, but I resolve this intellectually by imagining that a webapp is just a subroutine which Tomcat runs from time to time, in response to a HTTP request for example. So a webapp in fact is Tomcat, in the sense that when it runs it does so as an integral part of the Tomcat process. So much so that if a webapp were to execute a system.exit(), it would take the whole Tomcat (and JVM) with it. Yes ? So now, when the Tomcat Manager application decides to stop a web application, what it really does is just to prevent any further calls to this web application in the future, by removing some entry in a table of runnable webapps. In other words, it does not really stop or kill any currently running instance of that webapp (those are allowed to finish what they are doing and return() to Tomcat main code), but it makes it so that any further call to /mywebapp will be met by a what ? response. Is this a correct interpretation ? Now comes the basic question : can a webapp stop itself, without taking the whole Tomcat and JVM with it ? In other words, in response to something (a variable being a certain value, or the interception of some event or whatever), can my webapp decide to stop doing what it is currently doing, clean up after itself, and then do something to prevent itself ever being called again in the future of this Tomcat instance ? (or say at least until some external intervention activates it again). My next question in this rubrique will be about what individual webapps really share at the deep-down level, considering that they are all in the end issued from the same JVM process. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Effect of Heap Size on Performance?
Washburn, Brian J [IT] wrote: Also if the application is a web app with any kind of response time requirements I would strongly suggest that you use [set of four options] My suggestion is to first get a feel for the current gc behaviour with jstat on the server: jstat -gc -t -h25 $pid 5000 Then look at the document describing garbage collection on Sun 1.6 JVMs: http://java.sun.com/javase/technologies/hotspot/gc/gc_tuning_6.html The solution to better GC behaviour may be as simple as choosing the right collector, as explained in the section Selecting a Collector. Regards, Oliver Schoett - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat for Dummies
André Warnier wrote: - we have a JVM. That is the real process that is running, at the OS level. That process can be killed, or decide to stop running, at which point we don't have a JVM process anymore, and thus no Tomcat and no webapps at all. That's kind of drastic and definitive. Yes. - inside the JVM, we have a Tomcat. Basically, that is only code which the JVM is running (a bit like a Perl interpreter process runs the list of Perl opcodes it has compiled a perl script into). Tomcat can somehow decide that it is tired of living, and tell the JVM to stop running it. At which point we have no webapps and no Tomcat anymore, and consequently (I presume, but this is already a bit less clear), no JVM anymore either, because not having anything to do anymore, it would also exit. Or ? When Tomcat stops, it stops the JVM. - then inside Tomcat, we have webapps. It's already getting more mysterious there for me, but I resolve this intellectually by imagining that a webapp is just a subroutine which Tomcat runs from time to time, in response to a HTTP request for example. So a webapp in fact is Tomcat, in the sense that when it runs it does so as an integral part of the Tomcat process. So much so that if a webapp were to execute a system.exit(), it would take the whole Tomcat (and JVM) with it. Yes ? Correct. Unless you use a security manager which would stop the webapp calling system.exit() So now, when the Tomcat Manager application decides to stop a web application, what it really does is just to prevent any further calls to this web application in the future, by removing some entry in a table of runnable webapps. In other words, it does not really stop or kill any currently running instance of that webapp (those are allowed to finish what they are doing and return() to Tomcat main code), but it makes it so that any further call to /mywebapp will be met by a what ? response. It depends :). Normally a 404 (not found) will be sent. Is this a correct interpretation ? Almost. New requests are rejected. Tomcat gives current requests a 'reasonable' period to stop processing. I forget what this is but it is of the order of tens of seconds. Now comes the basic question : can a webapp stop itself, without taking the whole Tomcat and JVM with it ? In other words, in response to something (a variable being a certain value, or the interception of some event or whatever), can my webapp decide to stop doing what it is currently doing, clean up after itself, and then do something to prevent itself ever being called again in the future of this Tomcat instance ? (or say at least until some external intervention activates it again). Yes. It should be able to ask the manager to stop it or undeploy it. Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: hanging threads on Tomcat
Patrick Plaatje wrote: Hi all, on one of our websites we have a problem with threads keep hanging in Tomcat. We first noticed this 1.5 week ago and tried several things to find a solution. At that moment we were using java 1.4 and Tomcat 5.0. The symptoms were there after three hours of operation, about 250 threads were hanging within tomcat, and they seemed to be waiting for something. After a week we realised we needed more information whihc we couldn't get from the current setup, we upgraded the three production application servers to be Java 1.5 and Tomcat 5.5.25. All three servers still have the same problem, although the problem now has an interval of appr. 6 hours instead of three. During the hanging of the threads we made 8 threaddumps. But i am unsure of how to read the thread dumps. A small overview of the state of the threads: - 309 threads overall - Threads waiting for monitors: 57 - Threads sleeping on monitors: 191 - Threads locking monitors: 225 - Monitors: 225 - Monitors without locking threads: 3 Can somebody please help me figuring out what the cause is, or how to find the cause of the problem? You'll need to provide the thread dumps. Rather than all 8, just two ~15s apart should suffice. Mark Best regards, Patrick - 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 for Dummies
Mark Thomas wrote: André Warnier wrote: Now comes the basic question : can a webapp stop itself, without taking the whole Tomcat and JVM with it ? In other words, in response to something (a variable being a certain value, or the interception of some event or whatever), can my webapp decide to stop doing what it is currently doing, clean up after itself, and then do something to prevent itself ever being called again in the future of this Tomcat instance ? (or say at least until some external intervention activates it again). Yes. It should be able to ask the manager to stop it or undeploy it. If I am not abusing, how does it do that, schematically ? I presume it has a more direct way than to itself isue a HTTP request to the Manager webapp with the appropriate parameters ? And if it asks to undeploy itself, is it not like pulling the carpet from under its own feet ? I mean, this webapp is running, and even after asking the Manager to undeploy itself (meaning its whole shebang of classes and libs will be erased from the disk), it should be able to still stop itself cleanly. What if that requires a class that would have to be loaded from its own WEB-INF/classes dir, which may not be there anymore ? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
unkown protocol httpg - using apache-tomcat-6.0.18
HI , I am using apache-tomcat-6.0.18 , I want to access a SRM(storage resource manager) service endpoint which uses httpg protocol eg: service endpoint - httpg://srmserver.host:8444/ , by deploying a web service application using apache-tomcat server when a client tries to invoke the service , it is giving error as Exception java.net.MalformedURLException: unknown protocol: httpg After searching in the google , I tried adding the following in the apache server.xml file 1) Connector className=org.apache.catalina.connector.http.HttpConnector port=8444 minProcessors=5 maxProcessors=75 enableLookups=true authenticate=true acceptCount=10 debug=1 scheme=httpg secure=true Factory className=org.globus.tomcat.catalina.net.GSIServerSocketFactory cacertdir=/etc/grid-security/certificates proxy=/etc/grid-security/hostproxy.pem gridMap=/etc/grid-security/grid-mapfile debug=3/ /Connector Valve className=org.globus.tomcat.coyote.valves.HTTPSValve55 / 2) In tomcat_dir/bin/catalina.sh file CLASSPATH=$CLASSPATH:$CATALINA_HOME/bin/bootstrap.jar CLASSPATH=$CLASSPATH:$CATALINA_HOME/common/lib/cog-jglobus.jar:$CATALINA_HOME/common/lib/log4j-1.2.8.jar:$CATALINA_HOME/common/lib/ogsa.jar CLASSPATH=$CLASSPATH:$CATALINA_HOME/common/lib/xercesImpl.jar:$CATALINA_HOME/common/endorsed/xmlsec.jar:$CATALINA_HOME/common/lib/xalan.jar CLASSPATH=$CLASSPATH:$CATALINA_HOME/common/lib/puretls.jar:$CATALINA_HOME/common/lib/jce-jdk13-120.jar CLASSPATH=$CLASSPATH:$CATALINA_HOME/common/lib/cryptix32.jar:$CATALINA_HOME/common/lib/cryptix-asn1.jar CLASSPATH=$CLASSPATH:$CATALINA_HOME/common/lib/cryptix.jar:$CATALINA_HOME/common/lib/saag.jar:$CATALINA_HOME/common/lib/wsdl4j.jar CLASSPATH=$CLASSPATH:$CATALINA_HOME/common/lib/Berkeley.StorageResourceManager-client-api.jar CLASSPATH=$CLASSPATH:$CATALINA_HOME/common/lib/Berkeley.StorageResourceManager-client-stub.jar CLASSPATH=$CLASSPATH:$CATALINA_HOME/common/lib/Berkeley.StorageResourceManager-client-samples.jar CLASSPATH=$CLASSPATH:$CATALINA_HOME/common/lib/cryptix.jar:$CATALINA_HOME/common/lib/axis.jar:$CATALINA_HOME/common/lib/cog-axis.jar CLASSPATH=$CLASSPATH:$CATALINA_HOME/common/lib/commons-discovery.jar:$CATALINA_HOME/common/lib/commons-logging.jar:$CATALINA_HOME/common/lib/jaxrpc.jar 3) In tomcat_dir/bin/setclasspath.sh file appended the line : CLASSPATH=$CLASSPATH:$CATALINA_HOME/common/lib/cog-url.jar 4) Even I have copied all the globus-4.0.7 lib jar files to tomcat_dir/common/lib directory also I was not clear about this configuration with tomcat ( I am new to tomcat server usage ), what are the changes to be done on the server and client side of the deployed service , Please help me to configure the tomcat server to support httpg protocol ? Thanks Regards, shashidhar
Re: hanging threads on Tomcat
Thanks for the swift replies, i have two dump, appr a few seconds apart uploaded to: http://www.ipros.nl/uploads/catalina_stripped_1.out http://www.ipros.nl/uploads/catalina_stripped_2.out Thanx, Patrick Mark Thomas schreef: Patrick Plaatje wrote: Hi all, on one of our websites we have a problem with threads keep hanging in Tomcat. We first noticed this 1.5 week ago and tried several things to find a solution. At that moment we were using java 1.4 and Tomcat 5.0. The symptoms were there after three hours of operation, about 250 threads were hanging within tomcat, and they seemed to be waiting for something. After a week we realised we needed more information whihc we couldn't get from the current setup, we upgraded the three production application servers to be Java 1.5 and Tomcat 5.5.25. All three servers still have the same problem, although the problem now has an interval of appr. 6 hours instead of three. During the hanging of the threads we made 8 threaddumps. But i am unsure of how to read the thread dumps. A small overview of the state of the threads: - 309 threads overall - Threads waiting for monitors: 57 - Threads sleeping on monitors: 191 - Threads locking monitors: 225 - Monitors: 225 - Monitors without locking threads: 3 Can somebody please help me figuring out what the cause is, or how to find the cause of the problem? You'll need to provide the thread dumps. Rather than all 8, just two ~15s apart should suffice. Mark Best regards, Patrick - 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: unkown protocol httpg - using apache-tomcat-6.0.18
From: shashidhar velagandula I am using apache-tomcat-6.0.18 , I want to access a SRM(storage resource manager) service endpoint which uses httpg protocol eg: service endpoint - httpg://srmserver.host:8444/ , by deploying a web service application using apache-tomcat server when a client tries to invoke the service , it is giving error as Exception java.net.MalformedURLException: unknown protocol: httpg That's not surprising - most browsers don't understand httpg:... as a prefix. Just to check, which of the following do you want to do? 1) Client (browser?) uses http to access a web application running inside Tomcat. Web application redirects client to a httpg: resource. Browser uses httpg to access that resource. 2) Client (browser?) uses http to access a web application running inside Tomcat. Web application accesses the httpg: resource internally, forms a response to the browser, and replies to the browser using http. 3) Client (browser?) uses httpg to access a web application running inside Tomcat. 4) Something else - in which case please tell us what! 1 and 2 require no changes to Tomcat's configuration files. 3 does, but Tomcat doesn't support a httpg connector so you'd have to write your own. 1 and 3 require the client to understand httpg, which browsers don't. I *think* you're trying to do 2, in which case you need to write/buy the appropriate web application to deploy, and make sure its configuration files are set up so that it knows to contact httpg://srmserver.host:8444/ to reach the SRM endpoint. If you're writing it, http://www.mail-archive.com/users@tomcat.apache.org/msg34996.html may be relevant - the webapp will have to be quite careful in how it registers the protocol handler. If you're trying to do something else, post more details to the list and we may be able to help! - Peter - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Fwd: Cookie not being set
My apologies for re-submitting this but I'm getting a little desperate here. If no one here can assist can anyone suggest where else I could go for help? -- Forwarded message -- From: Michael Farah andromedamob...@gmail.com Date: Mon, Mar 9, 2009 at 7:58 AM Subject: Cookie not being set To: users@tomcat.apache.org Hi all I’m running two web apps off a single instance of Tomcat 6.0.1.8 on a CentOS 64 bit OS. Tomcat is fronted with Apache 2.2 and I’m using mod_proxy_http. Both applications are wap sites. I’ve been trying to implement an analytics solution provided by Admob. The solution uses a pixel image in conjunction with a cookie to provide detailed user info. Similar to Google analytics but without the Javascript. Admob provides the code in multiple formats including Java. The problem is that the cookie is not being set. I have been back and forth with Admob and they are adamant that the problem lies in our enviroment. Below is my Virtual Host config; VirtualHost 211.111.111.111:80 ServerName sitea.com ServerAlias www.sitea.com DocumentRoot /home/sitea ProxyPass / http://tomcatserver.com:8080/sitea/ ProxyPassReverse / http://tomcatserver.com:8080/sitea/ ProxyPassReverseCookieDomain tomcatserver.com site.com /VirtualHost The Admob code is a JSP file named AdMob.jsp that is imported into each page of our webapp via this code snippet jsp:include page=/AdMob.jsp/ The AdMob.jsp file is pretty big so I won’t pase it all here except for two snippets which I feel are most relevant. The first is this one; admobRequiredParams.put(COOKIE_DOMAIN, sitea.com); // If your mobile site uses multiple subdomains, replace null with your root domain (e.g. example.com) to make the AdMob cookie visible across subdomains. The second is the code that sets the cookie; private String admobGetCookieValue(HttpServletRequest request, HttpServletResponse response, PageContext pageContext, String cookieDomain) { try { Cookie cookies[] = request.getCookies(); if (cookies != null) { for (int i = 0; i cookies.length; i++) { if (cookies[i].getName().equals(admobuu)) return cookies[i].getValue(); } } // Set a cookie if one has not already been set if (pageContext.getAttribute(admobCookie) == null) { String value = UUID.randomUUID().toString().replace(-,); Cookie c = new Cookie(admobuu, value); c.setMaxAge(60*60*24*365*20); c.setPath(/); if (cookieDomain != null) { if (cookieDomain.charAt(0) != '.') cookieDomain = . + cookieDomain; c.setDomain(cookieDomain); } response.addCookie(c); pageContext.setAttribute(admobCookie, value); } return (String)pageContext.getAttribute(admobCookie); } catch (Exception e) { return ; } } When accessing sitea.com via Firefox with Live HTTP headers, it’s clear that the cookie is not being set as it doesn’t come shop up. However there is another cookie being set which I don’t recognise; Cookie: an=Af4ab27e8d16fb4ac50f73d03fe54c132 Can anyone please assist in explaining why this AdMob cookie is not being set? Thanks in advance Michael - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Fwd: Cookie not being set
There was a typo in the code below which has now been corrected -- Forwarded message -- From: Michael Farah andromedamob...@gmail.com Date: Mon, Mar 9, 2009 at 7:58 AM Subject: Cookie not being set To: users@tomcat.apache.org Hi all I’m running two web apps off a single instance of Tomcat 6.0.1.8 on a CentOS 64 bit OS. Tomcat is fronted with Apache 2.2 and I’m using mod_proxy_http. Both applications are wap sites. I’ve been trying to implement an analytics solution provided by Admob. The solution uses a pixel image in conjunction with a cookie to provide detailed user info. Similar to Google analytics but without the Javascript. Admob provides the code in multiple formats including Java. The problem is that the cookie is not being set. I have been back and forth with Admob and they are adamant that the problem lies in our enviroment. Below is my Virtual Host config; VirtualHost 211.111.111.111:80 ServerName sitea.com ServerAlias www.sitea.com DocumentRoot /home/sitea ProxyPass / http://tomcatserver.com:8080/sitea/ ProxyPassReverse / http://tomcatserver.com:8080/sitea/ ProxyPassReverseCookieDomain tomcatserver.com sitea.com /VirtualHost The Admob code is a JSP file named AdMob.jsp that is imported into each page of our webapp via this code snippet jsp:include page=/AdMob.jsp/ The AdMob.jsp file is pretty big so I won’t pase it all here except for two snippets which I feel are most relevant. The first is this one; admobRequiredParams.put(COOKIE_DOMAIN, sitea.com); // If your mobile site uses multiple subdomains, replace null with your root domain (e.g. example.com) to make the AdMob cookie visible across subdomains. The second is the code that sets the cookie; private String admobGetCookieValue(HttpServletRequest request, HttpServletResponse response, PageContext pageContext, String cookieDomain) { try { Cookie cookies[] = request.getCookies(); if (cookies != null) { for (int i = 0; i cookies.length; i++) { if (cookies[i].getName().equals(admobuu)) return cookies[i].getValue(); } } // Set a cookie if one has not already been set if (pageContext.getAttribute(admobCookie) == null) { String value = UUID.randomUUID().toString().replace(-,); Cookie c = new Cookie(admobuu, value); c.setMaxAge(60*60*24*365*20); c.setPath(/); if (cookieDomain != null) { if (cookieDomain.charAt(0) != '.') cookieDomain = . + cookieDomain; c.setDomain(cookieDomain); } response.addCookie(c); pageContext.setAttribute(admobCookie, value); } return (String)pageContext.getAttribute(admobCookie); } catch (Exception e) { return ; } } When accessing sitea.com via Firefox with Live HTTP headers, it’s clear that the cookie is not being set as it doesn’t come shop up. However there is another cookie being set which I don’t recognise; Cookie: an=Af4ab27e8d16fb4ac50f73d03fe54c132 Can anyone please assist in explaining why this AdMob cookie is not being set? Thanks in advance Michael - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Cookie not being set
From: Michael Farah andromedamob...@gmail.com The Admob code is a JSP file named AdMob.jsp that is imported into each page of our webapp via this code snippet jsp:include page=/AdMob.jsp/ [...] response.addCookie(c); Just a thought... where's your include? In order to add the cookie (which must go in the header), I think no bytes of response must have been sent yet - is the include far enough up the file that this is the case? Or someone more experienced will tell me this isn't a problem with servlets :-). - Peter - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Effect of Heap Size on Performance?
Chris, We have 100+ application servers in a loadbalancing (application based, not tomcat) setup. If servers are removed from the load balancing pool the others need to be able to pick up the load. So the number of concurrent users is highly dynamic. You can imagine the problem if we keep the heapsize to a minimum on every server. I'm talking about a fixed size here ofcourse. I also don't think the relationship between number of objects and young gc duration is a linear one. Increasing the young generation leads to longer gc's. Increasing young to 682M on a 4G heap from its default size increased gc time approx. 3-4 x (47ms average to 154ms average on one server), but it also decreased the number of gc's performed by 15-20x. So eventually, a larger heapsize saved cycles, and subsequently increased throughput. At least for us. I think it also gives short-lived objects (for example short sessions) a longer time to 'die out', so they won't be moved to tenure because survivor space is increased and gc frequency is decreased (can anyone confirm this?). Christopher Schultz wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Taylan, On 3/5/2009 5:11 AM, Taylan Develioglu wrote: I always hold this as a ground rule: Increase heapsize as much as possible as long as: My rule has always been to run with the smallest heap you can get away with. We ran our main production app in 64MB of heap (the default for our platform) for 4 years before we got our first OOME. Now we run it with a 192MB heap. A smaller heap means that you'll catch even small memory leaks faster. At least, that's my position. Surprisingly, Chuck hasn't responded (he usually has something to say about GC/heap myths), but I suspect he'd say something like heap size itself has little effect on the GC's performance... it's really the number of objects that affect the performance. Granted, a larger heap invites more objects into it, but generational garbage collection is decent enough that the generations rarely grow to such a size that the app stalls while the GC runs. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkm2fBAACgkQ9CaO5/Lv0PCPngCfRfClYEVoDAI57VBbqoBUaAC8 RDAAn0fztUgMY0d0K0FAdV0uxYzSjDxN =EbMZ -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Cookie not being set
Hi Peter The include is actually in the body of the document, right at the bottom! The thing is the code creates a pixel image and so i wanted to put this in an area which would not impact the rest of the page. So should the include be in the head? Do you think this could be the cause? Regards Michael On Wed, Mar 11, 2009 at 1:44 PM, Peter Crowther peter.crowt...@melandra.com wrote: From: Michael Farah andromedamob...@gmail.com The Admob code is a JSP file named AdMob.jsp that is imported into each page of our webapp via this code snippet jsp:include page=/AdMob.jsp/ [...] response.addCookie(c); Just a thought... where's your include? In order to add the cookie (which must go in the header), I think no bytes of response must have been sent yet - is the include far enough up the file that this is the case? Or someone more experienced will tell me this isn't a problem with servlets :-). - Peter - 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: Cookie not being set
Cookies are sent in the header and tomcat does not wait for the entire body of the response before starting to send. It just waits for a buffer to fill up and sends as soon as that occurs. You should be setting the cookie asap or at least before the first block of response goes out on the wire. --David Andromeda Mobile wrote: Hi Peter The include is actually in the body of the document, right at the bottom! The thing is the code creates a pixel image and so i wanted to put this in an area which would not impact the rest of the page. So should the include be in the head? Do you think this could be the cause? Regards Michael On Wed, Mar 11, 2009 at 1:44 PM, Peter Crowther peter.crowt...@melandra.com wrote: From: Michael Farah andromedamob...@gmail.com The Admob code is a JSP file named AdMob.jsp that is imported into each page of our webapp via this code snippet jsp:include page=/AdMob.jsp/ [...] response.addCookie(c); Just a thought... where's your include? In order to add the cookie (which must go in the header), I think no bytes of response must have been sent yet - is the include far enough up the file that this is the case? Or someone more experienced will tell me this isn't a problem with servlets :-). - Peter - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Tomcat 6.x Proxy Authentication
Hello, We have a Tomcat Application, which has to communicate through a Proxy Server with authentication. Should be the authentication done in the Java Class or it is possible to configure Tomcat for Proxy Authentication? Alex smime.p7s Description: S/MIME cryptographic signature
Problems with LoadBalancing
Hello everybody, I have following architecture : 2 Server with Apache and Tomcat Versions : APACHE - httpd -v Server version: Apache/2.0.52 Server built: May 24 2006 11:45:06 TOMCAT - ./version.sh Using JRE_HOME: /opt/jdk1.5.0_10 Server version: Apache Tomcat/5.5.20 Server built: Sep 12 2006 10:09:20 Server number: 5.5.20.0 OS Name:Linux OS Version: 2.6.9-55.0.2.ELsmp Architecture: i386 JVM Version:1.5.0_10-b03 JVM Vendor: Sun Microsystems Inc. I am doing load balancing between both with JK, with an scenario of 50 reques per session (aprox), and 500 reqxseg ( aprox ). The thing is the following, when I shutdown the passive server, I have a download of my reqxseg, and the requests that where managed by the passive server get stucked for long time, like 5 min. New request afther shutting donw the passive server are well processed. But the thing is if there is a way to reduce this time that requests are stucked. This is my worker : # izonetv LoadBalancer Definition worker.izonetv.balance_workers=izonetv-mifeas01_data,izonetv-mifeas02_data worker.izonetv.method=Session worker.izonetv.retries=1 worker.izonetv.sticky_session=True #worker.izonetv.sticky_session_force=1 worker.izonetv.type=lb # izonetv-mifeas01_data Node Definition worker.izonetv-mifeas01_data.connect_timeout=1 worker.izonetv-mifeas01_data.fail_on_status=404 worker.izonetv-mifeas01_data.host=mifeas01_data worker.izonetv-mifeas01_data.lbfactor=1 worker.izonetv-mifeas01_data.port=8009 worker.izonetv-mifeas01_data.reply_timeout=3 worker.izonetv-mifeas01_data.type=ajp13 # izonetv-mifeas02_data Node Definition worker.izonetv-mifeas02_data.connect_timeout=1 worker.izonetv-mifeas02_data.fail_on_status=404 worker.izonetv-mifeas02_data.host=mifeas02_data worker.izonetv-mifeas02_data.lbfactor=1 worker.izonetv-mifeas02_data.port=8009 worker.izonetv-mifeas02_data.reply_timeout=3 worker.izonetv-mifeas02_data.type=ajp13 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Regarding Tomcat 5.5 clustering
Hi Everyone, Now i am trying to creating the clustering in tomcat5.5.17. I have downloaded tomcat 5.5.17.In server.xml i made some changes.Herewith I have uploaded the server.xml.Then I have downloaded another tomcat 5.5.17.In that server.xml i made some changes.I have uploaded that server.xml also.i started my first tomcat instance.after that i started my second one that time i am getting the replication member added message in tomcat one.If i close the second one that time i am getting replication member disappeared.How should i check my application is working with cluster is fine or not.and if i put my application in one tomcat instance of webapps folder or both?thanks in advance. Regards, P.Parthasarathi http://www.nabble.com/file/p22454690/server.xml server.xml http://www.nabble.com/file/p22454690/server.xml server.xml -- View this message in context: http://www.nabble.com/Regarding-Tomcat-5.5-clustering-tp22454690p22454690.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: Cookie not being set
I tried moving the include to the head of my document but this does not appear to have made any difference. Must it be in the head or should it be even above this? On Wed, Mar 11, 2009 at 2:16 PM, David Smith d...@cornell.edu wrote: Cookies are sent in the header and tomcat does not wait for the entire body of the response before starting to send. It just waits for a buffer to fill up and sends as soon as that occurs. You should be setting the cookie asap or at least before the first block of response goes out on the wire. --David Andromeda Mobile wrote: Hi Peter The include is actually in the body of the document, right at the bottom! The thing is the code creates a pixel image and so i wanted to put this in an area which would not impact the rest of the page. So should the include be in the head? Do you think this could be the cause? Regards Michael On Wed, Mar 11, 2009 at 1:44 PM, Peter Crowther peter.crowt...@melandra.com wrote: From: Michael Farah andromedamob...@gmail.com The Admob code is a JSP file named AdMob.jsp that is imported into each page of our webapp via this code snippet jsp:include page=/AdMob.jsp/ [...] response.addCookie(c); Just a thought... where's your include? In order to add the cookie (which must go in the header), I think no bytes of response must have been sent yet - is the include far enough up the file that this is the case? Or someone more experienced will tell me this isn't a problem with servlets :-). - Peter - 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: Cookie not being set
From: Andromeda Mobile [mailto:andromedamob...@gmail.com] I tried moving the include to the head of my document but this does not appear to have made any difference. Must it be in the head or should it be even above this? Ideally it would be wherever AdMob's documentation says it should appear, as I would assume they have at least tested their JSP implementation in the popular servlet containers. Where does it suggest? Assuming the JSP emits the HTML markup for an image at whatever point it is included, the earliest realistic point to include it would be after the body tag. - Peter - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Cookie not being set
Peter Crowther wrote: From: Andromeda Mobile [mailto:andromedamob...@gmail.com] I tried moving the include to the head of my document but this does not appear to have made any difference. Must it be in the head or should it be even above this? Ideally it would be wherever AdMob's documentation says it should appear, as I would assume they have at least tested their JSP implementation in the popular servlet containers. Where does it suggest? Assuming the JSP emits the HTML markup for an image at whatever point it is included, the earliest realistic point to include it would be after the body tag. This is a bit of a shot from the hip, but I think that if you are trying to set this cookie header too late in the cycle, you may get some error message in the logs like response already committed. It's probably worth checking anyway. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Need Hellp With Tomcat 6 / Apache 2.2 Cluster Problem
Ok ... I feel like a moron but I cannot figure out how to use disablereuse option. When I google for examples on disablereuse, what I find is that in my httpd.conf file I need to add the line JkOptions +DisableReuse. However, reading the information here (http://httpd.apache.org/docs/2.2/mod/mod_proxy.html) it looks like I need to add disablereuse=On to the end of the line BalancerMember http://192.168.1.101:8080 loadfactor=1. I am extremely new at this Tomcat clustering process, so any leniency and help will be very much appreciated. Thanks Have a great day. From: Filip Hanik - Dev Lists [devli...@hanik.com] Sent: Tuesday, March 10, 2009 1:22 PM To: Tomcat Users List Subject: Re: Need Hellp With Tomcat 6 / Apache 2.2 Cluster Problem Alston, Brian (US SSA) wrote: Filip Thank you for your help. I made the changes like you suggested: changed stickysession-jsessionid to stickysession=JSESSIONID|jsessionid I already had stickysession=jsessionid (it was a typo here in my post) but I added the pipe and uppercase JSESSIONID my server.xml already had the line you suggested. If I use disablereuse=On won't I then have problems with my cookies and sessions? disable reuse will not affect your cookies or sessions Filip Again, thank you very much for your help. From: Filip Hanik - Dev Lists [devli...@hanik.com] Sent: Tuesday, March 10, 2009 12:42 PM To: Tomcat Users List Subject: Re: Need Hellp With Tomcat 6 / Apache 2.2 Cluster Problem hi Brian, your stickysession attribute is wrong, it should look like |stickysession=JSESSIONID|jsessionid then you must set jvmRoute in server.xml (Engine name=xxx jvmRoute=tc1) the jvmRoute has to be unique across the tc nodes. stickyness will only apply to request that have sessions remove smax/max, better to use the defaults I would also set the property disablereuse to On if it is supported in your httpd version, right now it may try to use a connection that is dead, and it seems its not trying another node, there may be some other attributes that can help with that too documentation is here http://httpd.apache.org/docs/2.2/mod/mod_proxy.html Filip |Alston, Brian (US SSA) wrote: Like the example in the book, I created a file called proxy-balancer.conf and put it in the conf.d directory. Here is what the file looks like (I retyped it so there may be mistakes): IfModule !proxy_module LoadModule proxy_module modules/mod_proxy.so /IfModule # IfModule !proxy_ajp_module # LoadModule proxy_ajp_module modules/mod_proxy_ajp.so # /IfModule IfModule !proxy_http_module LoadModule proxy_http_module modules/mod_proxy_http.so /IfModule IfModule !proxy_balancer_module LoadModule proxy_balancer_module modules/mod_proxy_balancer.so /IfModule IfModule !status_module LoadModule status_module modules/mod_status.so /IfModule IfModule !proxy_balancer_module ProxyRequests Off Proxy balancer://tccluster BalancerMember http://192.168.1.101:8080 loadfactor=1 max=150 smax=145 BalancerMember http://192.168.1.102:8080 loadfactor=1 max=150 smax=145 BalancerMember http://192.168.1.103:8080 loadfactor=1 max=150 smax=145 Order Deny,Allow Allow from all /Proxy Location /balancer-manager SetHandler balancer-manager Order Deny,Allow Allow from all /Location Location /my-webapp ProxyPass balancer://tccluster/my-webapp stickysession-jsessionid ProxyPassReverse balancer://tccluster/my-webapp Order Deny,Allow Allow from all /Location Location /examples ProxyPass balancer://tccluster/examples stickysession-jsessionid ProxyPassReverse balancer://tccluster/examples Order Deny,Allow Allow from all /Location /IfModule From: Filip Hanik - Dev Lists [devli...@hanik.com] Sent: Tuesday, March 10, 2009 11:29 AM To: Tomcat Users List Subject: Re: Need Hellp With Tomcat 6 / Apache 2.2 Cluster Problem what does the cluster section of your httpd look like? Alston, Brian (US SSA) wrote: I have one Apache http server version 2.2.3 (on Red Hat Enterprise Linux 5) and three Tomcat 6 version 6.0.18 servers (on Windows Server 2003) running in my cluster. Everything appears to be working well. It looks like it is using RoundRobin because every time I refresh the page it goes from web001 - web002 - web003 - web001 - etc. I used some of the examples that are provided with Tomcat in the examples directory - specifically the Sessions servlet and it looks like my sessions are staying the same and holding information. My issue is this. When I stop one of the Tomcat servers (let's say web002), I will sometimes get the following error message when I refresh the page: - - - - - - - - - - Proxy Error The proxy server received an invalid response from an upstream server. The proxy server could not handle the request GET
RE: Effect of Heap Size on Performance?
From: Taylan Develioglu [mailto:tdevelio...@ebuddy.com] Subject: Re: Effect of Heap Size on Performance? I think it also gives short-lived objects (for example short sessions) a longer time to 'die out', so they won't be moved to tenure because survivor space is increased and gc frequency is decreased (can anyone confirm this?). That is the expected effect of having a larger young generation and consequent larger eden and survivor spaces. However, there is a cost of deferring the migration of long-lived objects to tenured: they must be copied from one survivor space to the other on each minor GC, whereas once in tenured, they do not move until a full GC occurs (and perhaps not even then). It's often cheaper to throw hardware at a performance problem than to do the painstaking analysis of GC behavior and gain the few percentage points of improvement that will bring. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: hanging threads on Tomcat
From: Patrick Plaatje [mailto:patr...@ipros.nl] Subject: hanging threads on Tomcat - 309 threads overall - Threads waiting for monitors: 57 - Threads sleeping on monitors: 191 - Threads locking monitors: 225 - Monitors: 225 - Monitors without locking threads: 3 Haven't looked at your thread dumps yet, but you might try using JConsole; it has an interesting looking Detect Deadlocks button on the Threads tab that may show you something useful. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Tomcat for Dummies
From: André Warnier [mailto:a...@ice-sa.com] Subject: Re: Tomcat for Dummies If I am not abusing, how does it do that, schematically ? I presume it has a more direct way than to itself isue a HTTP request to the Manager webapp with the appropriate parameters ? No, the HTTP request would be the simplest approach. There's likely a JMX call that could be done, but it would be more work. Certainly there are internal APIs that could be used, but those are subject to change at any time, and are normally not available to regular webapps. And if it asks to undeploy itself, is it not like pulling the carpet from under its own feet ? I mean, this webapp is running, and even after asking the Manager to undeploy itself (meaning its whole shebang of classes and libs will be erased from the disk), it should be able to still stop itself cleanly. That should be handled by a ServletContextListener declared in WEB-INF/web.xml, which will be invoked before the deletion of the webapp's files. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: hanging threads on Tomcat
From: Patrick Plaatje [mailto:patr...@ipros.nl] Subject: Re: hanging threads on Tomcat Thanks for the swift replies, i have two dump, appr a few seconds apart uploaded to: You appear to be out of database connections. This is almost always caused by webapp code not disposing of result sets, statements, and connections properly, leading to exhaustion of the pool. The proper technique is to insure that every place that obtains a connection also has a finally block that will close all the resources associated with the connection, including the connection itself. This is a common discussion topic, so you can search the archives for examples. Also look at the Tomcat doc for recommended practice and how to detect (and work around) lost connections: http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: hanging threads on Tomcat
Patrick Plaatje wrote: Thanks for the swift replies, i have two dump, appr a few seconds apart uploaded to: http://www.ipros.nl/uploads/catalina_stripped_1.out http://www.ipros.nl/uploads/catalina_stripped_2.out Many threads appear to be waiting on the same instance of org.apache.tomcat.dbcp.pool.impl.GenericObjectPool in org.apache.tomcat.dbcp.dbcp.PoolingDataSource.getConnection, while I can see only 4 threads actually doing database work. Is it possible that you have configured too few database connections? (If the current limit is 4, try 20.) A second point of contention looks like at neo.util.Mutex.aquire(Mutex.java:77) at neo.xredsys.presentation.ArticlePresentationManager.getArticle(ArticlePresentationManager.java:200) at neo.xredsys.presentation.ArticlePresentationManager.getArticle(ArticlePresentationManager.java:169) at neo.xredsys.presentation.ArticlePresentationManager.getArticle(ArticlePresentationManager.java:149) But this may be a property of the software you use and harder to change. Regards, Oliver Schoett - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: [OT] Tomcat for Dummies
Caldarale, Charles R wrote: [...] That should be handled by a ServletContextListener declared in WEB-INF/web.xml, which will be invoked before the deletion of the webapp's files. At the risk of sounding heretical and tasteless on this forum, I must admit that this whole Java and Tomcat thing sometimes sounds to me like a giant job-preservation scheme. Which in the current circumstances may be a socially worthwhile thing to be... ;-) - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat for Dummies
Caldarale, Charles R wrote: From: André Warnier [mailto:a...@ice-sa.com] Subject: Re: Tomcat for Dummies If I am not abusing, how does it do that, schematically ? I presume it has a more direct way than to itself isue a HTTP request to the Manager webapp with the appropriate parameters ? No, the HTTP request would be the simplest approach. There's likely a JMX call that could be done, but it would be more work. Certainly there are internal APIs that could be used, but those are subject to change at any time, and are normally not available to regular webapps. And if it asks to undeploy itself, is it not like pulling the carpet from under its own feet ? I mean, this webapp is running, and even after asking the Manager to undeploy itself (meaning its whole shebang of classes and libs will be erased from the disk), it should be able to still stop itself cleanly. That should be handled by a ServletContextListener declared in WEB-INF/web.xml, which will be invoked before the deletion of the webapp's files. More seriously thus, there seems to be a problem with this logic : Suppose we have a case where 5 instances of this webapp are currently running, and one of them issues a request to the Manager, to undeploy itself. The Manager would then oblige, and start undeploying the webapp. The ServletContextListener in each of the running webapp instances would be called, before the Manager does anything drastic. Presumably then each ServletContextListener instance would have to take some action to force the corresponding webapp instance to stop and cleanup its act, and also presumably the Manager would wait for each of these instances to return some form of OK, before it proceeds with erasing the webapps files. But is that really what happens ? I feel somewhat uncomfortable with the above scheme, more out of a gut feeling than anything else. Am I wrong ? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Tomcat for Dummies
From: André Warnier [mailto:a...@ice-sa.com] Caldarale, Charles R wrote: That should be handled by a ServletContextListener declared in WEB-INF/web.xml, which will be invoked before the deletion of the webapp's files. More seriously thus, there seems to be a problem with this logic : Suppose we have a case where 5 instances of this webapp are currently running You can't have 5 instances of one webapp, to my knowledge. You have one. But I may not have seen some of the odder deployment scenarios. and one of them issues a request to the Manager, to undeploy itself. The Manager would then oblige, and start undeploying the webapp. The ServletContextListener in each (i.e. the only one) of the running webapp instances would be called, before the Manager does anything drastic. Presumably then each ServletContextListener instance would have to take some action to force the corresponding webapp instance to stop and cleanup its act, and also presumably the Manager would wait for each of these instances to return some form of OK, before it proceeds with erasing the webapps files. The file erase would not happen until the listener had returned. To my knowledge, that's the only guarantee you get with such a listener. - Peter - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat for Dummies
Let's be frugal and use just 2 instances of a webapp. How do you run 2 instances of a webapp? You must deploy them. How do you do that? You drop a war file for each into webapps. Whoa! Did you drop 2 copies of myapp.war into webapps? You can't do that. If they are both named myapp.war, when you drop in the 2nd one, it overwrites the first. Ok. So you name them myapp1.war and myapp2.war, and drop them both in webapps. Cool. In one sense they both look like the same webapp, but they are different entities from Tomcat's point of view. So if you use the manager to stop myapp1, nothing will happens to myapp2 -- it is totally physically distinct from myapp1. Ergo Watson, we've solved the morning star/evening star paradox. --Ken On Mar 11, 2009, at 10:39 AM, André Warnier wrote: Caldarale, Charles R wrote: From: André Warnier [mailto:a...@ice-sa.com] Subject: Re: Tomcat for Dummies If I am not abusing, how does it do that, schematically ? I presume it has a more direct way than to itself isue a HTTP request to the Manager webapp with the appropriate parameters ? No, the HTTP request would be the simplest approach. There's likely a JMX call that could be done, but it would be more work. Certainly there are internal APIs that could be used, but those are subject to change at any time, and are normally not available to regular webapps. And if it asks to undeploy itself, is it not like pulling the carpet from under its own feet ? I mean, this webapp is running, and even after asking the Manager to undeploy itself (meaning its whole shebang of classes and libs will be erased from the disk), it should be able to still stop itself cleanly. That should be handled by a ServletContextListener declared in WEB- INF/web.xml, which will be invoked before the deletion of the webapp's files. More seriously thus, there seems to be a problem with this logic : Suppose we have a case where 5 instances of this webapp are currently running, and one of them issues a request to the Manager, to undeploy itself. The Manager would then oblige, and start undeploying the webapp. The ServletContextListener in each of the running webapp instances would be called, before the Manager does anything drastic. Presumably then each ServletContextListener instance would have to take some action to force the corresponding webapp instance to stop and cleanup its act, and also presumably the Manager would wait for each of these instances to return some form of OK, before it proceeds with erasing the webapps files. But is that really what happens ? I feel somewhat uncomfortable with the above scheme, more out of a gut feeling than anything else. Am I wrong ? - 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 Clustering trouble when starting up under high load
hi Mikel, when setting a property on the Manager you omit the manager. prefix, just as you stated. To do thread dumps with JDK 1.5 under windows, you can use the tanuki service wrapper http://people.apache.org/~fhanik/wrapper.html The tomcat team might have added that feature to the Tomcat wrapper too, you'd have to check Filip Mikel Ibiricu wrote: Hi Rainer, thanks for your response. I tried the config you suggested. It suppose the way of configuring those parameters is as you said, but skipping manager. from the begining, as when I tried as you said, I got this in the catalina. log: 10-mar-2009 15:58:19 org.apache.tomcat.util.digester.SetPropertiesRule begin ADVERTENCIA: [SetPropertiesRule]{Server/Service/Engine/Cluster/Manager} Setting property 'manager.sendAllSessions' to 'false' did not find a matching property. 10-mar-2009 15:58:19 org.apache.tomcat.util.digester.SetPropertiesRule begin ADVERTENCIA: [SetPropertiesRule]{Server/Service/Engine/Cluster/Manager} Setting property 'manager.sendAllSessionsSize' to '200' did not find a matching property. 10-mar-2009 15:58:19 org.apache.tomcat.util.digester.SetPropertiesRule begin ADVERTENCIA: [SetPropertiesRule]{Server/Service/Engine/Cluster/Manager} Setting property 'manager.sendAllSessionsWaitTime' to '0' did not find a matching property. 10-mar-2009 15:58:19 org.apache.tomcat.util.digester.SetPropertiesRule begin Maybe without the manager prefix? sendAllSessions=false, sendAllSessionSize=200 and sendAllSessionsWaitTime=? Filip, we consider taking thead dumps, but we are using jdk 1.5 under windows. I heard it is not supported in Windows until jdk 1.6. Is it true? Best regards Mikel 2009/3/9 Rainer Jung rainer.j...@kippdata.de On 09.03.2009 09:24, Mikel Ibiricu wrote: So, It works OK but when starting up one of the nodes with over 500 sessions alive in the other, it doesn't replicate anything. We assume that it would not be able to replicate everything... but why it does either replicate everything or nothing? If it's not able replicate all the sessions, we would assume it, but we would like to replicate at least something... Maybe some trouble with the config we are trying? We tried to limit the keepAliveCount of the senders, without improvement with this. Reading the DeltaManager code, I have seen the sendAlllSessions parameter. According to in-line javadoc and the implementation, /** * handle receive that other node want all sessions ( restart ) * a) send all sessions with one message * b) send session at blocks * After sending send state is complete transfered * @param msg * @param sender * @throws IOException */ protected void handleGET_ALL_SESSIONS(SessionMessage msg, Member sender) throws IOException { [...] if (isSendAllSessions()) { sendSessions(sender, currentSessions, findSessionTimestamp); } else { // send session at blocks int len = currentSessions.length getSendAllSessionsSize() ? currentSessions.length : getSendAllSessionsSize(); Session[] sendSessions = new Session[len]; for (int i = 0; i currentSessions.length; i += getSendAllSessionsSize()) { len = i + getSendAllSessionsSize() currentSessions.length ? currentSessions.length - i : getSendAllSessionsSize(); System.arraycopy(currentSessions, i, sendSessions, 0, len); sendSessions(sender, sendSessions,findSessionTimestamp); if (getSendAllSessionsWaitTime() 0) { try { Thread.sleep(getSendAllSessionsWaitTime()); } catch (Exception sleep) { } }//end if }//for }//end if SessionMessage newmsg = new SessionMessageImpl(name,SessionMessage.EVT_ALL_SESSION_TRANSFERCOMPLETE, null,SESSION-STATE-TRANSFERED, SESSION-STATE-TRANSFERED+ getName()); newmsg.setTimestamp(findSessionTimestamp); if (log.isDebugEnabled()) log.debug(sm.getString(deltaManager.createMessage.allSessionTransfered,getName())); counterSend_EVT_ALL_SESSION_TRANSFERCOMPLETE++; cluster.send(newmsg, sender); } it may cover our expectatives, so I tried to include sendAllSessions=false in the cluster manager configuration Manager className=org.apache.catalina.ha.session.DeltaManager name=clusterPruebas6 stateTransferTimeout=180 expireSessionsOnShutdown=false notifyListenersOnReplication=false sendAllSessions=false/ But it seems like this parameter is not configurable from the server.xml file. So, what can I do to force that if it's not posible to replicate all the sessions, at least replicate something in the startup? If you want to test with sendAllSessions set to false, then add manager.sendAllSessions=false to the Manager element of the
Re: Need Hellp With Tomcat 6 / Apache 2.2 Cluster Problem
hi Brian, this is not really tomcat clustering, but more httpd load balancing. Disable reuse is available on two modules, mod_jk and mod_proxy, that is why you get hits for mod_jk as well when you google. syntax is case sensitive, and yes, you would add it to the end of the BalancerMember Filip Alston, Brian (US SSA) wrote: Ok ... I feel like a moron but I cannot figure out how to use disablereuse option. When I google for examples on disablereuse, what I find is that in my httpd.conf file I need to add the line JkOptions +DisableReuse. However, reading the information here (http://httpd.apache.org/docs/2.2/mod/mod_proxy.html) it looks like I need to add disablereuse=On to the end of the line BalancerMember http://192.168.1.101:8080 loadfactor=1. I am extremely new at this Tomcat clustering process, so any leniency and help will be very much appreciated. Thanks Have a great day. From: Filip Hanik - Dev Lists [devli...@hanik.com] Sent: Tuesday, March 10, 2009 1:22 PM To: Tomcat Users List Subject: Re: Need Hellp With Tomcat 6 / Apache 2.2 Cluster Problem Alston, Brian (US SSA) wrote: Filip Thank you for your help. I made the changes like you suggested: changed stickysession-jsessionid to stickysession=JSESSIONID|jsessionid I already had stickysession=jsessionid (it was a typo here in my post) but I added the pipe and uppercase JSESSIONID my server.xml already had the line you suggested. If I use disablereuse=On won't I then have problems with my cookies and sessions? disable reuse will not affect your cookies or sessions Filip Again, thank you very much for your help. From: Filip Hanik - Dev Lists [devli...@hanik.com] Sent: Tuesday, March 10, 2009 12:42 PM To: Tomcat Users List Subject: Re: Need Hellp With Tomcat 6 / Apache 2.2 Cluster Problem hi Brian, your stickysession attribute is wrong, it should look like |stickysession=JSESSIONID|jsessionid then you must set jvmRoute in server.xml (Engine name=xxx jvmRoute=tc1) the jvmRoute has to be unique across the tc nodes. stickyness will only apply to request that have sessions remove smax/max, better to use the defaults I would also set the property disablereuse to On if it is supported in your httpd version, right now it may try to use a connection that is dead, and it seems its not trying another node, there may be some other attributes that can help with that too documentation is here http://httpd.apache.org/docs/2.2/mod/mod_proxy.html Filip |Alston, Brian (US SSA) wrote: Like the example in the book, I created a file called proxy-balancer.conf and put it in the conf.d directory. Here is what the file looks like (I retyped it so there may be mistakes): IfModule !proxy_module LoadModule proxy_module modules/mod_proxy.so /IfModule # IfModule !proxy_ajp_module # LoadModule proxy_ajp_module modules/mod_proxy_ajp.so # /IfModule IfModule !proxy_http_module LoadModule proxy_http_module modules/mod_proxy_http.so /IfModule IfModule !proxy_balancer_module LoadModule proxy_balancer_module modules/mod_proxy_balancer.so /IfModule IfModule !status_module LoadModule status_module modules/mod_status.so /IfModule IfModule !proxy_balancer_module ProxyRequests Off Proxy balancer://tccluster BalancerMember http://192.168.1.101:8080 loadfactor=1 max=150 smax=145 BalancerMember http://192.168.1.102:8080 loadfactor=1 max=150 smax=145 BalancerMember http://192.168.1.103:8080 loadfactor=1 max=150 smax=145 Order Deny,Allow Allow from all /Proxy Location /balancer-manager SetHandler balancer-manager Order Deny,Allow Allow from all /Location Location /my-webapp ProxyPass balancer://tccluster/my-webapp stickysession-jsessionid ProxyPassReverse balancer://tccluster/my-webapp Order Deny,Allow Allow from all /Location Location /examples ProxyPass balancer://tccluster/examples stickysession-jsessionid ProxyPassReverse balancer://tccluster/examples Order Deny,Allow Allow from all /Location /IfModule From: Filip Hanik - Dev Lists [devli...@hanik.com] Sent: Tuesday, March 10, 2009 11:29 AM To: Tomcat Users List Subject: Re: Need Hellp With Tomcat 6 / Apache 2.2 Cluster Problem what does the cluster section of your httpd look like? Alston, Brian (US SSA) wrote: I have one Apache http server version 2.2.3 (on Red Hat Enterprise Linux 5) and three Tomcat 6 version 6.0.18 servers (on Windows Server 2003) running in my cluster. Everything appears to be working well. It looks like it is using RoundRobin because every time I refresh the page it goes from web001 - web002 - web003 - web001 - etc. I used some of the examples that are provided with Tomcat in the examples directory - specifically the Sessions servlet and it looks like my sessions are staying the same and holding information. My issue is this. When I stop one of the Tomcat servers (let's
Re: Regarding Tomcat 5.5 clustering
to test failover setup a simple load balancer, like 'pen' or more advanced like the apache web server 'httpd' and hit the load balancer with requests Filip welcome.partha wrote: Hi Everyone, Now i am trying to creating the clustering in tomcat5.5.17. I have downloaded tomcat 5.5.17.In server.xml i made some changes.Herewith I have uploaded the server.xml.Then I have downloaded another tomcat 5.5.17.In that server.xml i made some changes.I have uploaded that server.xml also.i started my first tomcat instance.after that i started my second one that time i am getting the replication member added message in tomcat one.If i close the second one that time i am getting replication member disappeared.How should i check my application is working with cluster is fine or not.and if i put my application in one tomcat instance of webapps folder or both?thanks in advance. Regards, P.Parthasarathi http://www.nabble.com/file/p22454690/server.xml server.xml http://www.nabble.com/file/p22454690/server.xml server.xml - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Need Hellp With Tomcat 6 / Apache 2.2 Cluster Problem
Filip I was under the assumption, from my reading, that load balancing was a component of clustering. At least that's how the O'Reilly book makes me feel. I added the option to the end of the line and it now looks like this: BalancerMember http://192.168.1.101:8080 loadfactor=1 disablereuse=On BalancerMember http://192.168.1.102:8080 loadfactor=1 disablereuse=On BalancerMember http://192.168.1.103:8080 loadfactor=1 disablereuse=On I restarted Apache and got the following error: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Starting httpd: Syntax error on line 25 of /etc/httpd/conf.d/proxy-balancer.conf: BalancerMember unknown Worker parameter - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Thank you From: Filip Hanik - Dev Lists [devli...@hanik.com] Sent: Wednesday, March 11, 2009 11:10 AM To: Tomcat Users List Subject: Re: Need Hellp With Tomcat 6 / Apache 2.2 Cluster Problem hi Brian, this is not really tomcat clustering, but more httpd load balancing. Disable reuse is available on two modules, mod_jk and mod_proxy, that is why you get hits for mod_jk as well when you google. syntax is case sensitive, and yes, you would add it to the end of the BalancerMember Filip Alston, Brian (US SSA) wrote: Ok ... I feel like a moron but I cannot figure out how to use disablereuse option. When I google for examples on disablereuse, what I find is that in my httpd.conf file I need to add the line JkOptions +DisableReuse. However, reading the information here (http://httpd.apache.org/docs/2.2/mod/mod_proxy.html) it looks like I need to add disablereuse=On to the end of the line BalancerMember http://192.168.1.101:8080 loadfactor=1. I am extremely new at this Tomcat clustering process, so any leniency and help will be very much appreciated. Thanks Have a great day. From: Filip Hanik - Dev Lists [devli...@hanik.com] Sent: Tuesday, March 10, 2009 1:22 PM To: Tomcat Users List Subject: Re: Need Hellp With Tomcat 6 / Apache 2.2 Cluster Problem Alston, Brian (US SSA) wrote: Filip Thank you for your help. I made the changes like you suggested: changed stickysession-jsessionid to stickysession=JSESSIONID|jsessionid I already had stickysession=jsessionid (it was a typo here in my post) but I added the pipe and uppercase JSESSIONID my server.xml already had the line you suggested. If I use disablereuse=On won't I then have problems with my cookies and sessions? disable reuse will not affect your cookies or sessions Filip Again, thank you very much for your help. From: Filip Hanik - Dev Lists [devli...@hanik.com] Sent: Tuesday, March 10, 2009 12:42 PM To: Tomcat Users List Subject: Re: Need Hellp With Tomcat 6 / Apache 2.2 Cluster Problem hi Brian, your stickysession attribute is wrong, it should look like |stickysession=JSESSIONID|jsessionid then you must set jvmRoute in server.xml (Engine name=xxx jvmRoute=tc1) the jvmRoute has to be unique across the tc nodes. stickyness will only apply to request that have sessions remove smax/max, better to use the defaults I would also set the property disablereuse to On if it is supported in your httpd version, right now it may try to use a connection that is dead, and it seems its not trying another node, there may be some other attributes that can help with that too documentation is here http://httpd.apache.org/docs/2.2/mod/mod_proxy.html Filip |Alston, Brian (US SSA) wrote: Like the example in the book, I created a file called proxy-balancer.conf and put it in the conf.d directory. Here is what the file looks like (I retyped it so there may be mistakes): IfModule !proxy_module LoadModule proxy_module modules/mod_proxy.so /IfModule # IfModule !proxy_ajp_module # LoadModule proxy_ajp_module modules/mod_proxy_ajp.so # /IfModule IfModule !proxy_http_module LoadModule proxy_http_module modules/mod_proxy_http.so /IfModule IfModule !proxy_balancer_module LoadModule proxy_balancer_module modules/mod_proxy_balancer.so /IfModule IfModule !status_module LoadModule status_module modules/mod_status.so /IfModule IfModule !proxy_balancer_module ProxyRequests Off Proxy balancer://tccluster BalancerMember http://192.168.1.101:8080 loadfactor=1 max=150 smax=145 BalancerMember http://192.168.1.102:8080 loadfactor=1 max=150 smax=145 BalancerMember http://192.168.1.103:8080 loadfactor=1 max=150 smax=145 Order Deny,Allow Allow from all /Proxy Location /balancer-manager SetHandler balancer-manager Order Deny,Allow Allow from all /Location Location /my-webapp ProxyPass balancer://tccluster/my-webapp stickysession-jsessionid ProxyPassReverse balancer://tccluster/my-webapp Order Deny,Allow Allow from all /Location Location
Re: Problems with LoadBalancing
On 11.03.2009 14:03, Toni Menendez Lopez wrote: Hello everybody, I have following architecture : 2 Server with Apache and Tomcat Versions : APACHE - httpd -v Server version: Apache/2.0.52 Server built: May 24 2006 11:45:06 TOMCAT - ./version.sh Using JRE_HOME: /opt/jdk1.5.0_10 Server version: Apache Tomcat/5.5.20 Server built: Sep 12 2006 10:09:20 Server number: 5.5.20.0 OS Name:Linux OS Version: 2.6.9-55.0.2.ELsmp Architecture: i386 JVM Version:1.5.0_10-b03 JVM Vendor: Sun Microsystems Inc. What's your mod_jk version? I am doing load balancing between both with JK, with an scenario of 50 reques per session (aprox), and 500 reqxseg ( aprox ). What is reqxseg? The thing is the following, when I shutdown the passive server, I have a What is a passive server? I thought you do load balancing? What do you mean by shutdown? download of my reqxseg, and the requests that where managed by the passive server get stucked for long time, like 5 min. New request afther shutting donw the passive server are well processed. But the thing is if there is a way to reduce this time that requests are stucked. The answer depends on your answer to my above questions. This is my worker : # izonetv LoadBalancer Definition worker.izonetv.balance_workers=izonetv-mifeas01_data,izonetv-mifeas02_data worker.izonetv.method=Session worker.izonetv.retries=1 worker.izonetv.sticky_session=True #worker.izonetv.sticky_session_force=1 worker.izonetv.type=lb # izonetv-mifeas01_data Node Definition worker.izonetv-mifeas01_data.connect_timeout=1 worker.izonetv-mifeas01_data.fail_on_status=404 You don't want to fail on 404. worker.izonetv-mifeas01_data.host=mifeas01_data worker.izonetv-mifeas01_data.lbfactor=1 worker.izonetv-mifeas01_data.port=8009 worker.izonetv-mifeas01_data.reply_timeout=3 worker.izonetv-mifeas01_data.type=ajp13 # izonetv-mifeas02_data Node Definition worker.izonetv-mifeas02_data.connect_timeout=1 worker.izonetv-mifeas02_data.fail_on_status=404 You don't want to fail on 404. worker.izonetv-mifeas02_data.host=mifeas02_data worker.izonetv-mifeas02_data.lbfactor=1 worker.izonetv-mifeas02_data.port=8009 worker.izonetv-mifeas02_data.reply_timeout=3 worker.izonetv-mifeas02_data.type=ajp13 Regards, Rainer - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Need Hellp With Tomcat 6 / Apache 2.2 Cluster Problem
On 11.03.2009 16:28, Alston, Brian (US SSA) wrote: Filip I was under the assumption, from my reading, that load balancing was a component of clustering. At least that's how the O'Reilly book makes me feel. I added the option to the end of the line and it now looks like this: BalancerMember http://192.168.1.101:8080 loadfactor=1 disablereuse=On BalancerMember http://192.168.1.102:8080 loadfactor=1 disablereuse=On BalancerMember http://192.168.1.103:8080 loadfactor=1 disablereuse=On I restarted Apache and got the following error: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Starting httpd: Syntax error on line 25 of /etc/httpd/conf.d/proxy-balancer.conf: BalancerMember unknown Worker parameter - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Attribute disablereuse has been added in httpd 2.2.9. When using mod_proxy_balancer or mod_proxy_ajp you should use the most recent version of httpd (at the moment 2.2.11), because those modules are still developing faster than most other, older modules. Regards, Rainer - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Problems with LoadBalancing
2009/3/11 Rainer Jung rainer.j...@kippdata.de On 11.03.2009 14:03, Toni Menendez Lopez wrote: Hello everybody, I have following architecture : 2 Server with Apache and Tomcat Versions : APACHE - httpd -v Server version: Apache/2.0.52 Server built: May 24 2006 11:45:06 TOMCAT - ./version.sh Using JRE_HOME: /opt/jdk1.5.0_10 Server version: Apache Tomcat/5.5.20 Server built: Sep 12 2006 10:09:20 Server number: 5.5.20.0 OS Name:Linux OS Version: 2.6.9-55.0.2.ELsmp Architecture: i386 JVM Version:1.5.0_10-b03 JVM Vendor: Sun Microsystems Inc. What's your mod_jk version? --JK Version:mod_jk/1.2.23 I am doing load balancing between both with JK, with an scenario of 50 reques per session (aprox), and 500 reqxseg ( aprox ). What is reqxseg? -- HTTP request per second. The thing is the following, when I shutdown the passive server, I have a What is a passive server? I thought you do load balancing? What do you mean by shutdown? -- I have a red hat cluster in both servers which give to me an Virtual IP for both servers, this virtual IP is of one of the servers and is the entrace point for my architecture, so the requests are received only with one apache, which delivers the request to the tomcats of both servers. -- The passive servers in the one which does not have the IP, si the apache of this servers is just not receiving requests. -- Shutting down, is just swtch off the server ( just simulating a crash of the server). download of my reqxseg, and the requests that where managed by the passive server get stucked for long time, like 5 min. New request afther shutting donw the passive server are well processed. But the thing is if there is a way to reduce this time that requests are stucked. The answer depends on your answer to my above questions. This is my worker : # izonetv LoadBalancer Definition worker.izonetv.balance_workers=izonetv-mifeas01_data,izonetv-mifeas02_data worker.izonetv.method=Session worker.izonetv.retries=1 worker.izonetv.sticky_session=True #worker.izonetv.sticky_session_force=1 worker.izonetv.type=lb # izonetv-mifeas01_data Node Definition worker.izonetv-mifeas01_data.connect_timeout=1 worker.izonetv-mifeas01_data.fail_on_status=404 You don't want to fail on 404. -- Sorry what does mean this parameter ? I just copy from another configuration. worker.izonetv-mifeas01_data.host=mifeas01_data worker.izonetv-mifeas01_data.lbfactor=1 worker.izonetv-mifeas01_data.port=8009 worker.izonetv-mifeas01_data.reply_timeout=3 worker.izonetv-mifeas01_data.type=ajp13 # izonetv-mifeas02_data Node Definition worker.izonetv-mifeas02_data.connect_timeout=1 worker.izonetv-mifeas02_data.fail_on_status=404 You don't want to fail on 404. worker.izonetv-mifeas02_data.host=mifeas02_data worker.izonetv-mifeas02_data.lbfactor=1 worker.izonetv-mifeas02_data.port=8009 worker.izonetv-mifeas02_data.reply_timeout=3 worker.izonetv-mifeas02_data.type=ajp13 Regards, Rainer - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat for Dummies
Ken Bowen wrote: Let's be frugal and use just 2 instances of a webapp. How do you run 2 instances of a webapp? You must deploy them. How do you do that? You drop a war file for each into webapps. .. etc.. (sound of me being whacked ..) Sorry, I expressed myself badly I guess. I meant : - there is only one webapp defined, say /mywebapp - but there are currently 5 HTTP requests to /mywebapp being processed My understanding is that there are thus 5 Threads currently running mywebapp. That's what I was calling instances, and I apologise if that is the wrong terminology. Now, one of these instances, for some reason of it's own, has just sent a request to the Manager webapp asking to be undeployed. Now, how many of these ServletContextListener things are in existence, and how many are being called to say that something is going on ? Does my question/remark/puzzlement make sense in that context ? Remember I'm not really a Java guy, so my understanding of these things tends to be somewhat nebulous.. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Not able to shutdown tomcat
Thank you for help this link was really helpful --- On Tue, 3/10/09, Caldarale, Charles R chuck.caldar...@unisys.com wrote: From: Caldarale, Charles R chuck.caldar...@unisys.com Subject: RE: Not able to shutdown tomcat To: Tomcat Users List users@tomcat.apache.org Date: Tuesday, March 10, 2009, 6:02 PM From: Aleksandr Elbakyan [mailto:ramal...@yahoo.com] Subject: Not able to shutdown tomcat So I need somehow shut down thread pool manually from some other tomcat shutdown listener thread. You need to implement a ServletContextListener that will terminate your threads when the associated webapp is being stopped. See section 10 of the servlet spec: http://jcp.org/aboutJava/communityprocess/mrel/jsr154/index2.html - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Tomcat for Dummies
From: André Warnier [mailto:a...@ice-sa.com] Now, how many of these ServletContextListener things are in existence, Exactly as many as you have defined in web.xml. Probably one, as you probably wouldn't want to define more than that - I'm not even sure whether the spec allows it. and how many are being called to say that something is going on ? Each listener you have defined will be called exactly once. - Peter - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Tomcat for Dummies
From: André Warnier [mailto:a...@ice-sa.com] Subject: Re: Tomcat for Dummies Now, how many of these ServletContextListener things are in existence, and how many are being called to say that something is going on ? Read the servlet spec (section 10). The number in existence is the number you specify (usually just one, but there's no limit), and all that are specified will be called once each. As Mark previously stated, the call(s) will be made after a reasonable waiting period to allow active requests to finish processing. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Tomcat 6 and Apache Derby
I'm having some trouble getting Apache Derby embedded inside Tomcat 6 so I can access a database threw my webapp. I am receiving the following error in the catalina.out log file: /Class Not Found: java.lang.ClassNotFoundException: jdbc:derby/. This is generated in the log when the webapp is accessed. I have set the classpath locally with derbys setEmbeddedCP command. I am thinking I also have to specify the classpath in Tomcat too. Is this done by modifying the server.xml globally or the web.xml for each webapp? When I look online for help, most of what I'm finding says all you have to do is copy the derby.jar to $CATALINA_HOME/lib and tomcat will automatically load any jar files it finds, is that true? Any help or feedback on this will be much appreciated, thank you. Software running on server - RHEL4u3 - Java6u7 - Tomcat6.0 - Derby 10.4.2.0 Directory structure - /usr/apache-tomcat-6.0.18 (CATALINA_HOME) - /usr/apache-tomcat-6.0.18/lib/derby.jar (copied in from DERBY_HOME/lib, figuring tomcat would automatically load it on startup for each webapp) - /usr/java/jdk1.6.0_07 (JAVA_HOME) - /usr/db-derby-10.4.2.0-bin (DERBY_HOME) Robert
Re: Tomcat URL Rewrite. Help with configuration.
Dear awarnier. Ok, Now I found such WEB-INF directory (in my app it's C:\ibi\WebFOCUS76\webapps\webfocus76\WEB-INF), and followed the installation and configuration steps. 1) copied urlrewrite.xml into such WEB-INF 2) edited web.xml with the below lines: filter filter-nameUrlRewriteFilter/filter-name filter-classorg.tuckey.web.filters.urlrewrite.UrlRewriteFilter/filter-class /filter filter-mapping filter-nameUrlRewriteFilter/filter-name url-pattern/*/url-pattern /filter-mapping 3) edited urlrewrite with my own rewriting config: rule from/car/from to type=redirect/ibi_apps/WFServlet?IBIF_ex=carinst/to /rule 4) copied urlrewrite-2.6.0.jar into WEB-INF/lib directory 5) restarted Tomcat Though redirection didn't work, but furthermore when I try to see http://localhost:8080/rewrite-status, I get the below error: Estado HTTP 404 - /rewrite-status type Informe de estado mensaje /rewrite-status descripción El recurso requerido (/rewrite-status) no está disponible. Apache Tomcat/5.5.25 Already looked into urlrewrite.xml and such rule is there: rule note The rule means that requests to /test/status/ will be redirected to /rewrite-status the url will be rewritten. /note from/test/status//from to type=redirect%{context-path}/rewrite-status/to /rule WHAT AM I DOING WRONG??? APPRECIATTE YOUR HELP ON THIS. Rodrigo. awarnier wrote: Rodro wrote: Dear Tomcat Users. I'm trying to do a URL masking on Tomcat 5.5.25. What I specifically want to do is: I execute (call) an app with the following URL: http://localhost:8080/ibi_apps/WFServlet?IBIF_ex=carinst Now, I need to mask the URL to get the same result calling the app as: http://localhost:8080/car i.e. mask /ibi_apps/WFServlet?IBIF_ex=carinst as /car. I found a Solution with URLREWRITE on http://tuckey.org/urlrewrite/manual/2.6 Under Install I see on STEP 1:“Download the zip (or tar.gz) and extract it into your context'sdirectory ie, so that urlrewrite.xml goes into the WEB-INF directory”. However, looking into my file directory I found 6 WEB-INF directories: C:\Archivos de programa\Apache Software Foundation\Tomcat 5.5\webapps\ROOT C:\Archivos de programa\Apache Software Foundation\Tomcat 5.5\webapps\tomcat-docs C:\Archivos de programa\Apache Software Foundation\Tomcat 5.5\server\webapps\admin C:\Archivos de programa\Apache Software Foundation\Tomcat 5.5\server\webapps\host-manager C:\Archivos de programa\Apache Software Foundation\Tomcat 5.5\server\webapps\manager C:\Archivos de programa\Apache Software Foundation\Tomcat 5.5\webapps\tomcat-docs\appdev\sample\web In which one should I extract the zip file into? Thanks and best regards. Rodrigo Allende. Rodrigo, somewhere above there, you mention your original URL http://localhost:8080/ibi_apps/WFServlet?IBIF_ex=carinst So, apart from all the webapp/* directories which you are mentioning just above here, you must have a /ibi_apps/WEB-INF directory somewhere, no ? If you do, then that's the one in which you should unpack that zip. And if you don't, then there is something that you are not telling us.. - 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://www.nabble.com/Tomcat-URL-Rewrite.-Help-with-configuration.-tp22446210p22461196.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 6 and Apache Derby
From: Robert K. Vanderhoek [mailto:rob...@nhdeeds.com] Subject: Tomcat 6 and Apache Derby /Class Not Found: java.lang.ClassNotFoundException: jdbc:derby/. Looks like either your code to create a DB connection is incorrect, or your Resource config is bad. I have set the classpath locally with derbys setEmbeddedCP command. A Bad Idea. I am thinking I also have to specify the classpath in Tomcat too. A Really Bad Idea. Sounds like you need to read the documentation: http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat URL Rewrite. Help with configuration.
Rodrigo, What is the error message in English? And i think this one is just an example config file coming with urlrewriter. If you do not need it, you can just delete it. rule note The rule means that requests to /test/status/ will be redirected to /rewrite-status the url will be rewritten. /note from/test/status//from to type=redirect%{context-path}/rewrite-status/to /rule -Ben On Wed, Mar 11, 2009 at 2:09 PM, Rodro rodrigo_alle...@ibi.com wrote: Dear awarnier. Ok, Now I found such WEB-INF directory (in my app it's C:\ibi\WebFOCUS76\webapps\webfocus76\WEB-INF), and followed the installation and configuration steps. 1) copied urlrewrite.xml into such WEB-INF 2) edited web.xml with the below lines: filter filter-nameUrlRewriteFilter/filter-name filter-classorg.tuckey.web.filters.urlrewrite.UrlRewriteFilter/filter-class /filter filter-mapping filter-nameUrlRewriteFilter/filter-name url-pattern/*/url-pattern /filter-mapping 3) edited urlrewrite with my own rewriting config: rule from/car/from to type=redirect/ibi_apps/WFServlet?IBIF_ex=carinst/to /rule 4) copied urlrewrite-2.6.0.jar into WEB-INF/lib directory 5) restarted Tomcat Though redirection didn't work, but furthermore when I try to see http://localhost:8080/rewrite-status, I get the below error: Estado HTTP 404 - /rewrite-status type Informe de estado mensaje /rewrite-status descripción El recurso requerido (/rewrite-status) no está disponible. Apache Tomcat/5.5.25 Already looked into urlrewrite.xml and such rule is there: rule note The rule means that requests to /test/status/ will be redirected to /rewrite-status the url will be rewritten. /note from/test/status//from to type=redirect%{context-path}/rewrite-status/to /rule WHAT AM I DOING WRONG??? APPRECIATTE YOUR HELP ON THIS. Rodrigo. awarnier wrote: Rodro wrote: Dear Tomcat Users. I'm trying to do a URL masking on Tomcat 5.5.25. What I specifically want to do is: I execute (call) an app with the following URL: http://localhost:8080/ibi_apps/WFServlet?IBIF_ex=carinst Now, I need to mask the URL to get the same result calling the app as: http://localhost:8080/car i.e. mask /ibi_apps/WFServlet?IBIF_ex=carinst as /car. I found a Solution with URLREWRITE on http://tuckey.org/urlrewrite/manual/2.6 Under Install I see on STEP 1:“Download the zip (or tar.gz) and extract it into your context'sdirectory ie, so that urlrewrite.xml goes into the WEB-INF directory”. However, looking into my file directory I found 6 WEB-INF directories: C:\Archivos de programa\Apache Software Foundation\Tomcat 5.5\webapps\ROOT C:\Archivos de programa\Apache Software Foundation\Tomcat 5.5\webapps\tomcat-docs C:\Archivos de programa\Apache Software Foundation\Tomcat 5.5\server\webapps\admin C:\Archivos de programa\Apache Software Foundation\Tomcat 5.5\server\webapps\host-manager C:\Archivos de programa\Apache Software Foundation\Tomcat 5.5\server\webapps\manager C:\Archivos de programa\Apache Software Foundation\Tomcat 5.5\webapps\tomcat-docs\appdev\sample\web In which one should I extract the zip file into? Thanks and best regards. Rodrigo Allende. Rodrigo, somewhere above there, you mention your original URL http://localhost:8080/ibi_apps/WFServlet?IBIF_ex=carinst So, apart from all the webapp/* directories which you are mentioning just above here, you must have a /ibi_apps/WEB-INF directory somewhere, no ? If you do, then that's the one in which you should unpack that zip. And if you don't, then there is something that you are not telling us.. - 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://www.nabble.com/Tomcat-URL-Rewrite.-Help-with-configuration.-tp22446210p22461196.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 URL Rewrite. Help with configuration.
From: Rodro [mailto:rodrigo_alle...@ibi.com] Subject: Re: Tomcat URL Rewrite. Help with configuration. Though redirection didn't work, but furthermore when I try to see http://localhost:8080/rewrite-status, I get the below error: Estado HTTP 404 - /rewrite-status That would be expected, since you don't appear to have a webapp named rewrite-status. You likely do not have your webapp deployed properly. If you want your webapp to be the default one, it must be named ROOT (case sensitive, even on Windows). Post your server.xml and the META-INF/context.xml file from your webapp (if it exists). - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat URL Rewrite. Help with configuration.
According to the documentation, such context should give you a wellcome page to the urlrewriting service, but yes I don't need it indeed. The error message in English is: HTTP Status 404 - /rewrite-status type Status report message /rewrite-status description The requested resource (/rewrite-status) is not available. Apache Tomcat/5.5.25 Ben Hu wrote: Rodrigo, What is the error message in English? And i think this one is just an example config file coming with urlrewriter. If you do not need it, you can just delete it. rule note The rule means that requests to /test/status/ will be redirected to /rewrite-status the url will be rewritten. /note from/test/status//from to type=redirect%{context-path}/rewrite-status/to /rule -Ben On Wed, Mar 11, 2009 at 2:09 PM, Rodro rodrigo_alle...@ibi.com wrote: Dear awarnier. Ok, Now I found such WEB-INF directory (in my app it's C:\ibi\WebFOCUS76\webapps\webfocus76\WEB-INF), and followed the installation and configuration steps. 1) copied urlrewrite.xml into such WEB-INF 2) edited web.xml with the below lines: filter filter-nameUrlRewriteFilter/filter-name filter-classorg.tuckey.web.filters.urlrewrite.UrlRewriteFilter/filter-class /filter filter-mapping filter-nameUrlRewriteFilter/filter-name url-pattern/*/url-pattern /filter-mapping 3) edited urlrewrite with my own rewriting config: rule from/car/from to type=redirect/ibi_apps/WFServlet?IBIF_ex=carinst/to /rule 4) copied urlrewrite-2.6.0.jar into WEB-INF/lib directory 5) restarted Tomcat Though redirection didn't work, but furthermore when I try to see http://localhost:8080/rewrite-status, I get the below error: Estado HTTP 404 - /rewrite-status type Informe de estado mensaje /rewrite-status descripción El recurso requerido (/rewrite-status) no está disponible. Apache Tomcat/5.5.25 Already looked into urlrewrite.xml and such rule is there: rule note The rule means that requests to /test/status/ will be redirected to /rewrite-status the url will be rewritten. /note from/test/status//from to type=redirect%{context-path}/rewrite-status/to /rule WHAT AM I DOING WRONG??? APPRECIATTE YOUR HELP ON THIS. Rodrigo. awarnier wrote: Rodro wrote: Dear Tomcat Users. I'm trying to do a URL masking on Tomcat 5.5.25. What I specifically want to do is: I execute (call) an app with the following URL: http://localhost:8080/ibi_apps/WFServlet?IBIF_ex=carinst Now, I need to mask the URL to get the same result calling the app as: http://localhost:8080/car i.e. mask /ibi_apps/WFServlet?IBIF_ex=carinst as /car. I found a Solution with URLREWRITE on http://tuckey.org/urlrewrite/manual/2.6 Under Install I see on STEP 1:“Download the zip (or tar.gz) and extract it into your context'sdirectory ie, so that urlrewrite.xml goes into the WEB-INF directory”. However, looking into my file directory I found 6 WEB-INF directories: C:\Archivos de programa\Apache Software Foundation\Tomcat 5.5\webapps\ROOT C:\Archivos de programa\Apache Software Foundation\Tomcat 5.5\webapps\tomcat-docs C:\Archivos de programa\Apache Software Foundation\Tomcat 5.5\server\webapps\admin C:\Archivos de programa\Apache Software Foundation\Tomcat 5.5\server\webapps\host-manager C:\Archivos de programa\Apache Software Foundation\Tomcat 5.5\server\webapps\manager C:\Archivos de programa\Apache Software Foundation\Tomcat 5.5\webapps\tomcat-docs\appdev\sample\web In which one should I extract the zip file into? Thanks and best regards. Rodrigo Allende. Rodrigo, somewhere above there, you mention your original URL http://localhost:8080/ibi_apps/WFServlet?IBIF_ex=carinst So, apart from all the webapp/* directories which you are mentioning just above here, you must have a /ibi_apps/WEB-INF directory somewhere, no ? If you do, then that's the one in which you should unpack that zip. And if you don't, then there is something that you are not telling us.. - 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://www.nabble.com/Tomcat-URL-Rewrite.-Help-with-configuration.-tp22446210p22461196.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To
Re: Apache/mod_jk serves random files from tomcat
Rainer Jung-3 wrote: did you find out in the meantime, whether you were using the tcnative (aka APR) connector? I was certainly using libtcnative, and removed it at the start of the month. I haven't seen enough to definitively say that it solved the problem, but my experience thus far is certainly consistent with such a hypothesis. Cheers! Luke -- View this message in context: http://www.nabble.com/Apache-mod_jk-serves-random-files-from-tomcat-tp18385568p22462521.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: Tuning worker MPM
hmm, np.. thanks On Tue, Mar 10, 2009 at 10:17 PM, Caldarale, Charles R chuck.caldar...@unisys.com wrote: From: kulbir Saini [mailto:kulbir.sai...@gmail.com] Subject: Re: Tuning worker MPM Firstly, let me convey my sorry been using this e-mail thread, i tried to put on httpd list but i think thread is breaking there. Apology not accepted. Please do not post httpd-specific questions to the Tomcat list. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: className [mx4j.adaptor.http.HttpAdaptor] does not exist
That is how I do. 1. startup.sh: adding the modification of CATALINA_OPTS CATALINA_OPTS=-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=6969 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false 2. server.xml: adding the modification of Connector port=8009 ... Connector port=8009 handler.list=mx mx.enabled=true mx.httpHost=myhost.com mx.httpPort=6969 protocol=AJP/1.3/ Without adding the tomcat compat library (jmx.jar) and mx4j-tools.jar, I have the problem-loading page. Adding the libraries to the common/lib also gives the problem-loading page. Adding the libraries to the lib: - Accessing to http://myhost.com:6969 with the local browser gives the MX4J-Agent View (JMX Management console), but access to the ip address of myhost.com like http://10.10.10.10:6969 gives the problem-loading page. However, even in the case of having the MX4J-Agent View, a remote machine running jConsole is unable to connect to the agent. I am expecting to see a blank page when I access http://myhost.com:6969, and I am able to connect to the agent with jConsole. Here is what I see from the log file: Mar 11, 2009 3:28:57 PM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on http-8080 Mar 11, 2009 3:28:57 PM org.apache.jk.common.JkMX classExists INFO: className [mx4j.adaptor.http.HttpAdaptor] does not exist Mar 11, 2009 3:28:57 PM org.apache.jk.common.JkMX loadAdapter INFO: Started MX4J console on host myhost.com at port 6969 HttpAdaptor version 3.0.2 started on port 6969 log4j:WARN No appenders could be found for logger (org.apache.log4j.jmx.HierarchyDynamicMBean). log4j:WARN Please initialize the log4j system properly. Mar 11, 2009 3:28:57 PM org.apache.jk.common.JkMX init INFO: Registering the JMX hierarchy for Log4J Mar 11, 2009 3:28:57 PM org.apache.jk.common.ChannelSocket init INFO: JK: ajp13 listening on /0.0.0.0:8009 Mar 11, 2009 3:28:57 PM org.apache.jk.server.JkMain start INFO: Jk running ID=0 time=0/167 config=null Mar 11, 2009 3:28:57 PM org.apache.catalina.startup.Catalina start INFO: Server startup in 1520 ms What could be wrong? Stanley -Original Message- From: Kees Jan Koster [mailto:kjkos...@gmail.com] Sent: Tuesday, March 10, 2009 3:51 PM To: Tomcat Users List Subject: Re: className [mx4j.adaptor.http.HttpAdaptor] does not exist Dear Stanley, I try to setup the JMX in Tomcat 6.0. Here is a discussion on how to enable JConsole and JMX for various application servers. http://java-monitor.com/forum/showthread.php?t=1 I downloaded the latest version of mx4j and placed in the tomcat/lib folder. Java 5 and 6 already have JMX built in, so there is no need for installing any JMX libraries. I encounter the error of [mx4j.adaptor.http.HttpAdaptor] does not exist. I went through the jar files of mx4j. I did see mx4j.tools.adaptor.http.HttpAdaptor, but not mx4j.adaptor.http.HttpAdaptor. Could you elaborate what you want to see with JMX? -- Kees Jan http://java-monitor.com/forum/ kjkos...@kjkoster.org 06-51838192 The secret of success lies in the stability of the goal. -- Benjamin Disraeli - 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 for Dummies
.. etc.. (sound of me being whacked ..) no, nono domestic violence here :-) It's often hard enough to understand face to face, much less across 5000+ miles. I think the following is a fair description Chuck others should nail me if it's not. A webapp can be made up of one or more servlets, some of them explicitly defined (in web.xml) and some implicit, such as the servlets generated from jsp pages. At it's simplest, for each fresh incoming request to the webapp, Tomcat determines the correct corresponding servlet in the webapp, and then causes a (new or recycled) thread to begin running that servlet with the incoming request data (doGet or doPost, etc.). Since multiple independent users might issue near simultaneous requests, we can see that there might be numerous threads running for the webapp, all started by Tomcat. (Also, each thread could easily generate other child threads to run, so the park can get quite full of picnickers.) As Chuck pointed out, each webapp can have zero or more ServletContextListeners defined for it. These are specified in the app's web.xml like this (for example): listener listener-classcom.myapp.listener.MyAppListener/listener-class /listener Then inside MyAppListener.java, one must have definitions of the following two Java methods: public void contextInitialized(ServletContextEvent servletContextEvent) {} public void contextDestroyed(ServletContextEvent servletContextEvent) {...} The bodies of these methods can contain any (Java) code you like. Tomcat guarantees that it will invoke contextInitialized as soon as possible as it sets up the machinery for your webapp (either when Tomcat itself has just started up) or when you have freshly deployed or started the webapp. And Tomcat guarantees that as soon as possible after learning that it must shut down the webapp, it will invoke contextDestroyed. There's no restriction on the number of such listeners which can be specified for a webapp; you could have MyAppListener1, MyAppListener2, etc. Let's be frugal again and assume that there is just one listener (MyAppListener). Then the contextInitialized method will be invoked once when the webapp is started, and the contextDestroyed method will be invoked only once when Tomcat needs to shut the webapp down. As Mark pointed out, after Tomcat is told (say by the Manager) to shutdown the webapp, Tomcat waits a certain interval (maybe 10 seconds) for currently running threads for the webapp to complete processing. But after that interval, it invokes contextDestroyed / just once/ no matter how many threads are still running for the webapp. Presumably, if the webapp expects there to be such long- running (possibly independent) threads still alive, the job (among others?) of contextDestroyed would be to bring those threads to a graceful halt. I believe (but do not know -- Chuck, Mark??) that Tomcat essentially creates a (new or recycled) thread in which to run contextDestroyed . Cheers, Ken On Mar 11, 2009, at 1:13 PM, André Warnier wrote: Ken Bowen wrote: Let's be frugal and use just 2 instances of a webapp. How do you run 2 instances of a webapp? You must deploy them. How do you do that? You drop a war file for each into webapps. .. etc.. (sound of me being whacked ..) Sorry, I expressed myself badly I guess. I meant : - there is only one webapp defined, say /mywebapp - but there are currently 5 HTTP requests to /mywebapp being processed My understanding is that there are thus 5 Threads currently running mywebapp. That's what I was calling instances, and I apologise if that is the wrong terminology. Now, one of these instances, for some reason of it's own, has just sent a request to the Manager webapp asking to be undeployed. Now, how many of these ServletContextListener things are in existence, and how many are being called to say that something is going on ? Does my question/remark/puzzlement make sense in that context ? Remember I'm not really a Java guy, so my understanding of these things tends to be somewhat nebulous.. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Tomcat for Dummies
From: Ken Bowen [mailto:kbo...@als.com] Subject: Re: Tomcat for Dummies Also, each thread could easily generate other child threads to run Only if the webapp chooses to do so; that's not something Tomcat does. But after that interval, it invokes contextDestroyed /just once/ That's once for each registered listener. I believe (but do not know -- Chuck, Mark??) that Tomcat essentially creates a (new or recycled) thread in which to run contextDestroyed. I think so, but I'll have to dig around to make sure. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: tomcat w/apr data lost in http post request?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Oliver, On 3/10/2009 2:41 PM, Oliver Schoett wrote: As far as I know, splitting header and body of POST requests into separate TCP packets is a peculiarity of IE browsers. This observation was made using normal HTML forms, but it may well apply to AJAX POST requests as well. Can MSIE even control which data goes in which packet? That would seem to be part of the TCP/IP stack, buried in the OS, and affecting both MSIE and any other browser on the same system. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkm4HokACgkQ9CaO5/Lv0PCo0gCggkn30PTZ2bXnD6FREdtP3dlL OVIAoKRgkwtd+XM9XPe4dZ5Gr+KP32Vt =W0L0 -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Https forwarding problem
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hisham, On 3/11/2009 5:52 AM, Hisham wrote: My concern is that because i have this security-constraint which makes any url pattern CONFIDENTIAL, that it's causing the web service call to be redirected as well. And its very frustrating why the following config is NOT working (where i specify that urls starting with axis2 should be ignored), and ws calls STILL get redirected: security-constraint web-resource-collection url-pattern/axis2/*/url-pattern url-pattern/axis2/rest/*/url-pattern /web-resource-collection user-data-constraint transport-guaranteeNONE/transport-guarantee That's odd. How do you know it's being redirected? Are you using a packet capture utility? I would definitely use one of you aren't already. Are you sure the web.xml that is deployed is the one you are editing? Sounds like a stupid question, but sometimes one forgets to actually do a redeploy after a change is made. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkm4IWgACgkQ9CaO5/Lv0PCf1QCgpvXosC2TxoTMRN8ZD6kfY5FT j6wAoKpuv1oY5jmAw7y9Q6B+/kNdmTiQ =7c4V -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: request.getRemoteAddr() vs. request.getHeader(REMOTE_ADDR)
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Rainer, On 3/10/2009 12:19 PM, Rainer Jung wrote: 1) There is no standard http header named REMOTE_ADDR. Not even within Tomcat. So whatever you get out of this header depends completely on whoever set it for you. It might not exist or contain garbage. Sure there is. It's been there forever: http://hoohoo.ncsa.uiuc.edu/cgi/env.html http://www.ietf.org/rfc/rfc3875 2) getRemoteAddr() gives you the address of the system, which opened the connection. In case of an AJP connector, this is not true, because AJP is meant to be used for reverse proxies. So here you get the address of the system which opened the connection to the web server, forwarded via AJP to Tomcat. [snip] 4) Usually Reverse Proxies set a non-standard header X-Forwarded-For. E.g. mod_proxy does. Be warned though, that cascading Reverse Proxies will most likely add to the header, so it can contain multiple addresses, usually comma-separated. Does mod_jk set any of these headers? X-Forwarded-For X-Forwarded-Host X-Forwarded-Server Thanks, - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkm4JD0ACgkQ9CaO5/Lv0PAvCACgqKdhdh88VaP7LG297RFuOv/m 5hgAoImJMS41Ms0mA7+8gXuHaMujAv13 =FNum -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: request.getRemoteAddr() vs. request.getHeader(REMOTE_ADDR)
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 All, On 3/11/2009 4:51 PM, Christopher Schultz wrote: Rainer, On 3/10/2009 12:19 PM, Rainer Jung wrote: 1) There is no standard http header named REMOTE_ADDR. Not even within Tomcat. So whatever you get out of this header depends completely on whoever set it for you. It might not exist or contain garbage. Sure there is. It's been there forever: http://hoohoo.ncsa.uiuc.edu/cgi/env.html http://www.ietf.org/rfc/rfc3875 Sorry about that; I was thinking CGI /environment variables/, not /HTTP headers/. Given the difference, I would say that these two calls are /rarely/ guaranteed to return the same value: request.getRemoteAddr() request.getHeader(REMOTE_ADDR) ...because, as Rainer points out, there is no standard REMOTE_ADDR header. Sorry for polluting the list. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkm4JRkACgkQ9CaO5/Lv0PAHBACgsiu23cahM3UAKxWdmIiJCO2Z YakAmwdS49qsYc48Fgay+AhF/RtNKK15 =Ak46 -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: request.getRemoteAddr() vs. request.getHeader(REMOTE_ADDR)
On 11.03.2009 21:51, Christopher Schultz wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 2) getRemoteAddr() gives you the address of the system, which opened the connection. In case of an AJP connector, this is not true, because AJP is meant to be used for reverse proxies. So here you get the address of the system which opened the connection to the web server, forwarded via AJP to Tomcat. [snip] 4) Usually Reverse Proxies set a non-standard header X-Forwarded-For. E.g. mod_proxy does. Be warned though, that cascading Reverse Proxies will most likely add to the header, so it can contain multiple addresses, usually comma-separated. Does mod_jk set any of these headers? X-Forwarded-For X-Forwarded-Host X-Forwarded-Server No, because it tries to act transparent by default, so it passes the original client/server situation to Tomcat and Tomcat patches it's client and server data inside the AJP connector in order to present the webapp the situation like it was at the web server. But you can use mod_headers to additionally set those headers, if you like to, and mod_jk will forward them. As described on the new shiny proxy documentation page http://tomcat.apache.org/dev/dist/tomcat-connectors/jk/docs/jk-1.2.28-dev/generic_howto/proxy.html those headers in a mod_jk setting relate to: X-Forwarded-For: getRemoteAddr() X-Forwarded-Host: getServerName() X-Forwarded-Server: getLocalName() at least when there is only one reverse proxy involved, so no concatenation of data in X-Forwarded-*. Regards, Rainer - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: tomcat w/apr data lost in http post request?
From: Christopher Schultz [mailto:ch...@christopherschultz.net] Subject: Re: tomcat w/apr data lost in http post request? Can MSIE even control which data goes in which packet? TCP/IP APIs on most platforms allow the Nagle algorithm to be disabled, which will cause data to be sent out on each call. Most TCP/IP stacks also set the push flag on the last packet of a sequence to force the peer stack to deliver the data to the receiver without delay. Tthat's probably all that IE is doing (but I don't know the MS APIs). - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: request.getRemoteAddr() vs. request.getHeader(REMOTE_ADDR)
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Rainer, On 3/11/2009 5:06 PM, Rainer Jung wrote: No, because [mod_jk] tries to act transparent by default, so it passes the original client/server situation to Tomcat and Tomcat patches it's client and server data inside the AJP connector in order to present the webapp the situation like it was at the web server. So, the REMOTE_ADDR environment variable is passed-through as... what? If mod_jk tries to appear invisible, then the value of the REMOTE_ADDR environment variable should be that of the original client (or, at least, the original client as far as httpd is concerned). Your previous message seems to say that mod_jk will provide the IP address of the server running httpd as the REMOTE_ADDR when seen by Tomcat. So, which is it? Thanks, - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkm4K4kACgkQ9CaO5/Lv0PCnjACcDRKlhhkFNd9uZedoUOeaOZKx 4q4AnAwkwnpP5MHEGwpLoQb62aN+PEGy =FoLB -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Apache/mod_jk serves random files from tomcat
On 11.03.2009 20:19, LukeK wrote: Rainer Jung-3 wrote: did you find out in the meantime, whether you were using the tcnative (aka APR) connector? I was certainly using libtcnative, and removed it at the start of the month. I haven't seen enough to definitively say that it solved the problem, but my experience thus far is certainly consistent with such a hypothesis. Thanks very much for the feedback. Considering the severity of the problem, if you could give us another update at a time you think is appropriate (depending on how often the problem happened before). Would you please be so kind to also tell us, which tcnative version you were using? Thanks again, Rainer - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: java.lang.NullPointerException loading resource from classpath
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Tim, On 3/7/2009 9:53 PM, Timothy Washington wrote: 'MyClass.class.getResourceAsStream(myresource.xml)' You might have better luck using ServletContext.getResourceAsStream, if you have access to the ServletContext. Check out the javadoc for this method for more information. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkm4LKcACgkQ9CaO5/Lv0PAG1wCgk3Zkmt6yLQA8qf5UctxRIRS0 rU4An3HIX/Ggox41DqktOFvRjWBrOFtZ =o8q1 -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: download a file inside WEB-INF use its URL on server
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Pierre, On 3/8/2009 1:05 PM, Pierre Goupil wrote: Unfortunately it won't work as you will be unable to provide a valid URL for anything inside WEB-INF. But maybe you can tell us why point 2 (use a resource stream) doesn't suit you so that we can explore this way or another? One way to get a valid URL for something inside WEB-INF is to do this: ServletContext application = ...; URL resource = application.getResource(/WEB-INF/xsds/my.xsd); Then you can use the URL to fetch the content or whatever else you want to do. Of course, you have to have access to the ServletContext. Hmm... this question seems a lot like another one I saw today... - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkm4LYQACgkQ9CaO5/Lv0PDzygCcCMhNCUbFOIsXn8eTwJA9gsy3 hH0AoLU17zaOQW136yHC+G7JA3YaOyTv =z85Y -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Resource with custom factory
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Derek, On 3/8/2009 4:31 PM, Derek Potts wrote: JPA allows you to create and configure an EntityManagerFactory, then store it in a Java Naming and Directory Interface (JNDI) tree for later retrieval and use. I would like to do something like this: Context initCtx = new InitialContext(); Context envCtx = (Context) initCtx.lookup(java:comp/env); EntityManagerFactory emf = (EntityManagerFactory) envCtx.lookup(emf); Sounds reasonable. I started off by reading http://tomcat.apache.org/tomcat-5.5-doc/jndi-resources-howto.html. That's a good place to start. Pay special attention to this section: http://tomcat.apache.org/tomcat-5.5-doc/jndi-resources-howto.html#Adding%20Custom%20Resource%20Factories Unfortunately, I still receive the same NamingException, thrown by ResourceEnvFactory. I was hoping to at least get an exception from my custom factory. The fact that tomcat is still calling the ResourceEnvFactory is why I thought that my question is for the Tomcat mailing list and not the OpenJPA list. Yeah, this is almost definintely a Tomcat question, not an OpenJPA question (unless you want to ask if someone has ever done what you are trying to do using Tomcat over on the other list... it couldn't hurt). EMFFactory is a class I wrote that implements javax.naming.spi.ObjectFactory, which is then placed in my WEB-INF/classes path. I think here's where you made your mistake. I would have expected Tomcat to give you a NoClassDefFoundError or something similar because, according to the documentation, your class should go here: When you are through, place the factory class (and the corresponding bean class) unpacked under $CATALINA_HOME/common/classes, or in a JAR file inside $CATALINA_HOME/common/lib. In this way, the required class files are visible to both Catalina internal resources and your web application. Try moving your factory to Tomcat's common/lib directory to see if that helps. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkm4MdMACgkQ9CaO5/Lv0PCvbACgoAkiCP9YGdEXw+wlpR0Txeh2 6eUAnjBJylrqjBFk+Lu8NNkr+5jIzUsr =7LLI -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: [OT] Re: Default Tomcat Page w/o Redirect
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ken, On 3/9/2009 4:03 PM, Ken Bowen wrote: I agree with everything in both posts, but I just don't see what the /location/ of the jsp files (inside/outside WEB-INF) has to do with it. It's just an access thing, really: no remote client can request that a JSP be run without it's handling servlet running first. Just because you shouldn't poke a fire doesn't mean you won't. It's not about revealing code (which is another matter altogether), it's about controlling access to the execution of your JSPs. If your JSPs are within WEB-INF, no client can access them directly for any reason. That forces the developers to code their application in such a way as to support that setup. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkm4M1UACgkQ9CaO5/Lv0PA2KgCfdGBUAmy8yI8waI6cbeziHE7I Fn0AoIuKuK4GtTgtTh5RaCKTtVGpRde7 =TmDB -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: [OT] Re: Default Tomcat Page w/o Redirect
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Gregor, On 3/9/2009 3:58 PM, Gregor Schneider wrote: On Mon, Mar 9, 2009 at 8:23 PM, Len Popp len.p...@gmail.com wrote: What I mean is, clients *never* access a .jsp file by URL, e.g. http://www.example.com/app/foo.jsp;. This is definately wrong. No, he's telling you about /his/ webapp, not making a general statement. He puts his JSPs beneath WEB-INF so they cannot be accessed directly. In his application, no JSP is ever accessed directly -- it must first go through a servlet. I've googled for this issue, and what I find, is, that some frameworks recommend putting JSPs into WEB-INF/jsp. However, I also found the statement that not all Servlet-Containers are supporting it. I can't believe a servlet container wouldn't support this. Perhaps you are thinking it means more than it does. - From SRV.12.2 of the servlet spec: The security model applies to the static content part of the web application and to servlets and filters within the application that are requested by the client. The security model does not apply when a servlet uses the RequestDispatcher to invoke a static resource or servlet using a forward or an include. so, if you use a RequestDispatcher to forward to or include another resource, that resource is allowed to break the normal rules for client access. For instance, you can forward to (or include) files under WEB-INF. Now I'm wondering (Mr. Servlet-Spec Chuck, you comment on that one): Aw you can read the spec just as well as Chuck can! Is this directory-structure really part of the specs? It is not prohibited by the spec, so there's no reason why it should be prohibited by a (compliant) servlet container. How does Tomcat find a JSP within WEB-INF/jsp? Do I have to specify it in the deployment-descriptor? There's no magic, here: when you request a RequestDispatcher, you specify the path to the resource you want to target. If you put /WEB-INF at the beginning of the path, you are targeting something beneath the WEB-INF directory. Tomcat will never respond to a client request for a JSP (like /foo.jsp) by looking under WEB-INF for foo.jsp and executing it. It /must/ go through a controller servlet specifically designed to do this type of thing. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkm4N5EACgkQ9CaO5/Lv0PDvggCfVciWoMv14kZi1Q6pRdyBunvb k8AAniU18dUTOYvvN7baNDsMYyncyt1m =54r2 -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Too many threads
Hi Christopher. On Tue, Mar 10, 2009 at 11:04:43AM -0400, Christopher Schultz wrote: I would like to know if they are useful and if not how to lessen their number. You should do a thread dump (send a SIG 3 to your process and watch stdout) Thank you, that has made much clearer. JVM-created threads (you can't eliminate these): main - runs the main program Reference Handler - GC thread Finalizer - GC thread Low Memory Detector - GC thread CompilerThread0 - JIT thread Signal Dispatcher - Handles signals Tomcat-created threads: ContainerBackgroundProcessor[StandardEngine[Catalina]] TP-Monitor - monitors the request handler thread pool TP-Processor[n] - these are the request handlers. You have configured your TC instance to have between 2 and 10 of them. I wouldn't be surprised to find that you have 5 TP-Processor threads. I have 12. My thread dump contained 5 JVM threads + 14 Tomcat threads + 1 MySQL thread = 20 threads. You have 27, and you didn't tell us a thing about what your application does. Default Tomcat home page and Server-status/Tomcat Manager applications :) Connector address=123.123.123.123 port=50002 protocol=HTTP/1.1 connectionTimeout=2 maxThreads=10 minSpareThreads=2 maxSpareThreads=5 / This is the only information you gave us that could help determine what those threads are. If you take a thread dump and re-post, we might be able to help. Full thread dump Java HotSpot(TM) 64-Bit Server VM (10.0-b22 mixed mode): http-123.123.123.123-50002-Acceptor-0 daemon prio=10 tid=0x2aaac4a5e000 nid=0x348b runnable [0x4143c000..0x00 004143cd90] java.lang.Thread.State: RUNNABLE ... [full dump in attach] $ grep -c tid catalina.out 19 According to the written above everything is clear in the dump. Thank you so much for your help. But i've got one question left, can I set idle timeout for the thread TP-Processor, after which they will die? -- BRGDS. Alexey Vlasov. Full thread dump Java HotSpot(TM) 64-Bit Server VM (10.0-b22 mixed mode): http-123.123.123.123-50002-Acceptor-0 daemon prio=10 tid=0x2aaac4a5e000 nid=0x348b runnable [0x4143c000..0x00 004143cd90] java.lang.Thread.State: RUNNABLE at java.net.PlainSocketImpl.socketAccept(Native Method) at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:384) - locked 0x2aaac0a902e8 (a java.net.SocksSocketImpl) at java.net.ServerSocket.implAccept(ServerSocket.java:453) at java.net.ServerSocket.accept(ServerSocket.java:421) at org.apache.tomcat.util.net.DefaultServerSocketFactory.acceptSocket(Unknown Source) at org.apache.tomcat.util.net.JIoEndpoint$Acceptor.run(Unknown Source) at java.lang.Thread.run(Thread.java:619) ContainerBackgroundProcessor[StandardEngine[Catalina]] daemon prio=10 tid=0x2aaac4a5d800 nid=0x348a waiting on condition [0x4133b000..0x4133bd10] java.lang.Thread.State: TIMED_WAITING (sleeping) at java.lang.Thread.sleep(Native Method) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(Unknown Source) at java.lang.Thread.run(Thread.java:619) Low Memory Detector daemon prio=10 tid=0x2aaac8023400 nid=0x3455 runnable [0x..0x] java.lang.Thread.State: RUNNABLE CompilerThread1 daemon prio=10 tid=0x2aaac8020800 nid=0x3454 waiting on condition [0x..0x410373e0] java.lang.Thread.State: RUNNABLE CompilerThread0 daemon prio=10 tid=0x2aaac801f000 nid=0x3453 waiting on condition [0x..0x40f36360] java.lang.Thread.State: RUNNABLE Signal Dispatcher daemon prio=10 tid=0x2aaac801dc00 nid=0x3452 waiting on condition [0x..0x] java.lang.Thread.State: RUNNABLE Finalizer daemon prio=10 tid=0x2aaac42bac00 nid=0x344d in Object.wait() [0x40d35000..0x40d35c10] java.lang.Thread.State: WAITING (on object monitor) at java.lang.Object.wait(Native Method) - waiting on 0x2aaac08e0be0 (a java.lang.ref.ReferenceQueue$Lock) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:116) - locked 0x2aaac08e0be0 (a java.lang.ref.ReferenceQueue$Lock) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:132) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159) Reference Handler daemon prio=10 tid=0x2aaac42b9800 nid=0x344c in Object.wait() [0x40c34000..0x40c34d90] java.lang.Thread.State: WAITING (on object monitor) at java.lang.Object.wait(Native Method) - waiting on 0x2aaac08e01b0 (a java.lang.ref.Reference$Lock) at java.lang.Object.wait(Object.java:485) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116) - locked 0x2aaac08e01b0 (a
Re: Tomcat URL masking question...
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Rodro, On 3/10/2009 7:54 PM, Rodro wrote: Dear Chuck. I tried to implement #2 as you suggested, using urlrewrite as in http://tuckey.org/urlrewrite/manual/2.6 Under Install I see on STEP 1:“Download the zip (or tar.gz) and extract it into your context'sdirectory ie, so that urlrewrite.xml goes into the WEB-INF directory”. However, looking into my file directory I found 6 WEB-INF directories: C:\Archivos de programa\Apache Software Foundation\Tomcat 5.5\webapps ROOT tomcat-docs admin host-manager manager In which one should I extract the zip file into? You don't seem to have your own application deployed. Where do you have your own application deployed? From your previous post, it would seem that it should be under webapps/ibi_apps, but it's not shown here. You have two options for deployment of the urlrewrite library: 1. Under the ROOT webapp. Here, you'd map URLs of the form: /car(.*)? -/ibi_apps\1 2. Under a new webapp deployed to /car. Here, you'd use: (.*)? - /ibi_apps\1 So it depends on how you choose to do your deployment. Did you want to just make short URLs available to users, or do you actually want all your URLs to look like /car and not change to anything else in the URL bar of the client's browser? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkm4OMwACgkQ9CaO5/Lv0PAb5gCgvrrG4juKjMkEzq616ZgHP5vr ICAAnRstEVN8QPTII7Zzt0j1V5PNpnWW =d781 -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Too many threads
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Alexey, On 3/11/2009 6:16 PM, Alexey Vlasov wrote: On Tue, Mar 10, 2009 at 11:04:43AM -0400, Christopher Schultz wrote: My thread dump contained 5 JVM threads + 14 Tomcat threads + 1 MySQL thread = 20 threads. You have 27, and you didn't tell us a thing about what your application does. Default Tomcat home page and Server-status/Tomcat Manager applications :) Gotcha. Connector address=123.123.123.123 port=50002 protocol=HTTP/1.1 connectionTimeout=2 maxThreads=10 minSpareThreads=2 maxSpareThreads=5 / This is the only information you gave us that could help determine what those threads are. If you take a thread dump and re-post, we might be able to help. Full thread dump Java HotSpot(TM) 64-Bit Server VM (10.0-b22 mixed mode): http-123.123.123.123-50002-Acceptor-0 daemon prio=10 tid=0x2aaac4a5e000 nid=0x348b runnable [0x4143c000..0x00 004143cd90] It looks like the verbosity of Thread names have been increased from TC 5.5 to TC 6.0. I like this, because you can tell which Connector created the thread. According to the written above everything is clear in the dump. Thank you so much for your help. No problem. Often, newcomers to both Java and webapps in general can be shocked to see how many threads are running. How many processors to you have on this box? Looks like 8: GC task thread#0 (ParallelGC) GC task thread#1 (ParallelGC) GC task thread#2 (ParallelGC) GC task thread#3 (ParallelGC) GC task thread#4 (ParallelGC) GC task thread#5 (ParallelGC) GC task thread#6 (ParallelGC) GC task thread#7 (ParallelGC) But i've got one question left, can I set idle timeout for the thread TP-Processor, after which they will die? I think you have to use an Executor for that. See http://tomcat.apache.org/tomcat-6.0-doc/config/executor.html for details. You should be able to use maxIdleTime to configure that. Just remember to connect your Connector to your Executor by using the executor attribute of the Connector, and remove all the thread-configuration attributes from your Connector, too. Good luck, - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkm4OkQACgkQ9CaO5/Lv0PBWJwCgjGMWzQ926Bt+cnKqG3rN7AUJ kOMAn3jAu3YSRmL9N/4U6A+qtaApDsEd =wHCS -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Syntex error in http with 'Include conf/mod_jk.conf'
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Harcharan, On 3/8/2009 11:57 PM, Harcharan Singh wrote: I got the 'syntex error' and 'file not find error' when i use the include directive for mod_jk in httpd.conf file. I have created 'mod_jk.conf' in the 'conf' directory of Apache installation. Do you think it would have been a good idea to include the relevant sections of httpd.conf and mod_jk.conf when asking about such a configuration? I think it would definitely improve your chances of a helpful response. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkm4OxEACgkQ9CaO5/Lv0PC8YQCdHyrW+GUP4kW6YFwKT/AU6nkQ jjMAnjDuoa2smCu/2b8N6Ob6hMQ/obtO =imkK -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Fwd: Cookie not being set
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Michael, On 3/11/2009 7:37 AM, Andromeda Mobile wrote: jsp:include page=/AdMob.jsp/ [snip] Cookie c = new Cookie(admobuu, value); c.setMaxAge(60*60*24*365*20); c.setPath(/); if (cookieDomain != null) { if (cookieDomain.charAt(0) != '.') cookieDomain = . + cookieDomain; c.setDomain(cookieDomain); } response.addCookie(c); I'm not sure how anal retentive Tomcat is about adhering to the servlet spec (these days it's getting a little closer to implementing exactly what the spec lays out), but this could be a problem: - From SRV.8.3: [The target servlet of the include method] cannot set headers or call any method that affects the headers of the response, with the exception of the HttpServletRequest.getSession() and HttpServletRequest.getSession(boolean) methods. Any attempt to set the headers must be ignored, and any call to HttpServletRequest.getSession() or HttpServletRequest.getSession(boolean) that would require adding a Cookie response header must throw an IllegalStateException if the response has been committed. So, that basically says that includes can't set cookies. Peter and Andre' have good suggestions about response already committed problems that you should check for in your log files. If that's what happening, then the headers are being sent before your AdMob include is being processed, and the headers actually /cannot/ be modified, whatever Tomcat's adherence to the spec turns out to be. Try using: %...@include file=/AdMob.jsp % %...@include does a text-inclusion into your JSP /before/ it is compiled. The included text is therefore considered part of the main JSP and there's no involvement of the RequestDispatcher. When you use jsp:include, you are making a sub-request to another resource in the webapp and are subject to the rules stated above. Try switching include mechanisms and see if that helps. Good luck, - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkm4PtkACgkQ9CaO5/Lv0PDZ0QCgjT0bgvA9QW1AmNqr0JrNKaj4 4cQAoLuWs7HfJ0oLoVvp1GVz99VbND3g =Y9fu -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: request.getRemoteAddr() vs. request.getHeader(REMOTE_ADDR)
On 11.03.2009 22:22, Christopher Schultz wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Rainer, On 3/11/2009 5:06 PM, Rainer Jung wrote: No, because [mod_jk] tries to act transparent by default, so it passes the original client/server situation to Tomcat and Tomcat patches it's client and server data inside the AJP connector in order to present the webapp the situation like it was at the web server. So, the REMOTE_ADDR environment variable is passed-through as... what? If mod_jk tries to appear invisible, then the value of the REMOTE_ADDR environment variable should be that of the original client (or, at least, the original client as far as httpd is concerned). See below. Your previous message seems to say that mod_jk will provide the IP address of the server running httpd as the REMOTE_ADDR when seen by Tomcat. I can't read that out of my previous message. Could you please cite the statement where I wrote that. So, which is it? I was not talking about CGI environment variables. mod_jk will not pass any environment variables, because they don't exist. If you use the CGI servlet of Tomcat, then Tomcat will set an environment variable REMOTE_ADDR to the value of request.getRemoteAddr(). And as I said getRemoteAddr() will be the address of the web server client, unless you played with configuration. Caution: there is yet another possible set of data, namely request attributes. Those are neither headers nor CGI env vars. Just so that there is still another reason for confusion. Regards, Rainer - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: request.getRemoteAddr() vs. request.getHeader(REMOTE_ADDR)
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Rainer, On 3/11/2009 6:45 PM, Rainer Jung wrote: On 11.03.2009 22:22, Christopher Schultz wrote: Your previous message seems to say that mod_jk will provide the IP address of the server running httpd as the REMOTE_ADDR when seen by Tomcat. I can't read that out of my previous message. Could you please cite the statement where I wrote that. Apologies. Re-reading your message it's clear you said that AJP would deliver the address of the system which opened the connection to the web server. Thanks for clearing that (me) up. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkm4QJsACgkQ9CaO5/Lv0PA84gCgiGbkv59r5QaE2ByrnkPBm7Vt M5QAoLuBKsAg0YFpdE1aASpiPnp5IPkd =wTG1 -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: request.getRemoteAddr() vs. request.getHeader(REMOTE_ADDR)
On 11.03.2009 23:52, Christopher Schultz wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Rainer, On 3/11/2009 6:45 PM, Rainer Jung wrote: On 11.03.2009 22:22, Christopher Schultz wrote: Your previous message seems to say that mod_jk will provide the IP address of the server running httpd as the REMOTE_ADDR when seen by Tomcat. I can't read that out of my previous message. Could you please cite the statement where I wrote that. Apologies. Re-reading your message it's clear you said that AJP would deliver the address of the system which opened the connection to the web server. Thanks for clearing that (me) up. No problem! And any improvement suggestions for the docs page I advertised are welcome! http://tomcat.apache.org/dev/dist/tomcat-connectors/jk/docs/jk-1.2.28-dev/generic_howto/proxy.html Regards, Rainer - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Problem starting Tomcat in Netbeans
Hi, I'm having problems to start Tomcat in Netbeans. It was working for a long time until suddenly it stopped. I added a new servlet to the web.xml file and after that it broke, even after I removed the new servlet didn't work again. I validated web.xml and got no errors, but when I validated context.xml I got the following: cvc-elt.1: Cannot find the declaration of element 'Context'. [2] The context.xml first lines are: ?xml version=1.0 encoding=UTF-8? Context crossContext=true debug=5 docBase=qualitau path=/qualitau reloadable=true Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_my_log. suffix=.txt timestamp=true/ I'm using Bundled Tomcat 5.5.17 with NetBeans 5.5.1 The web.xml file is too big to post it here, but I can do it if needed. Here is the error from the log: Mar 11, 2009 3:54:58 PM org.apache.tomcat.util.digester.Digester endElement SEVERE: End event threw exception java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.tomcat.util.IntrospectionUtils.callMethod1(IntrospectionUtils.java:898) at org.apache.catalina.startup.SetNextNamingRule.end(SetNextNamingRule.java:97) at org.apache.tomcat.util.digester.Rule.end(Rule.java:228) at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1057) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:601) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1772) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2923) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:645) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:508) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522) at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1561) at org.apache.catalina.startup.ContextConfig.processContextConfig(ContextConfig.java:781) at org.apache.catalina.startup.ContextConfig.contextConfig(ContextConfig.java:721) at org.apache.catalina.startup.ContextConfig.init(ContextConfig.java:977) at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:278) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.core.StandardContext.init(StandardContext.java:5130) at org.apache.catalina.core.StandardContext.start(StandardContext.java:3945) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524) at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:608) at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:535) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:470) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1122) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1021) at org.apache.catalina.core.StandardHost.start(StandardHost.java:718) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442) at org.apache.catalina.core.StandardService.start(StandardService.java:450) at org.apache.catalina.core.StandardServer.start(StandardServer.java:709) at org.apache.catalina.startup.Catalina.start(Catalina.java:551) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
RE: Problem starting Tomcat in Netbeans
From: Carlos Botto [mailto:carl...@qualitau.com] Subject: Problem starting Tomcat in Netbeans when I validated context.xml I got the following: cvc-elt.1: Cannot find the declaration of element 'Context'. [2] Since there is no DTD to validate against, that's not surprising. Context crossContext=true debug=5 docBase=qualitau path=/qualitau reloadable=true Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_my_log. suffix=.txt timestamp=true/ Tomcat has supported a Logger element in quite some time, so that should come out. Also, the path attribute is illegal when the Context element is in your webapp's META-INF/context.xml file (which is where it should be). Mar 11, 2009 3:54:58 PM org.apache.catalina.startup.ContextConfig processContextConfig SEVERE: Parse error in default web.xml Note that the above refers to the *default* web.xml, not the one in your webapp's WEB-INF directory. What did you break in Tomcat's conf/web.xml file? Mar 11, 2009 3:54:58 PM org.apache.catalina.startup.ContextConfig processContextConfig SEVERE: Occurred at line 18 column 20 That should give you a pretty good idea of where to look. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Problem starting Tomcat in Netbeans
Chuck, Thanks for your answer. I generated the DTD and fixed the config.xml problem. But the other problem is still there. I didn't touch conf/web.xml, but I checked it out anyway and didn't find a problem (should be at line 18 column 20). Here are the first 24 lines from conf/web.xml: ?xml version=1.0 encoding=UTF-8? web-app xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd; version=2.4 descriptionQualiTau Intranet/description display-nameQualiTau Intranet/display-name listener listener-classcom.qualitau.startup.JDBCStartup/listener-class /listener !-- Basic permissions to access any page on the site -- security-constraint web-resource-collection web-resource-nameQualiTau Web Applications/web-resource-name url-pattern/*/url-pattern /web-resource-collection auth-constraint role-nameportal/role-name /auth-constraint user-data-constraint transport-guaranteeCONFIDENTIAL/transport-guarantee /user-data-constraint /security-constraint Thanks again Carlos Caldarale, Charles R wrote: From: Carlos Botto [mailto:carl...@qualitau.com] Subject: Problem starting Tomcat in Netbeans when I validated context.xml I got the following: cvc-elt.1: Cannot find the declaration of element 'Context'. [2] Since there is no DTD to validate against, that's not surprising. Context crossContext=true debug=5 docBase=qualitau path=/qualitau reloadable=true Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_my_log. suffix=.txt timestamp=true/ Tomcat has supported a Logger element in quite some time, so that should come out. Also, the path attribute is illegal when the Context element is in your webapp's META-INF/context.xml file (which is where it should be). Mar 11, 2009 3:54:58 PM org.apache.catalina.startup.ContextConfig processContextConfig SEVERE: Parse error in default web.xml Note that the above refers to the *default* web.xml, not the one in your webapp's WEB-INF directory. What did you break in Tomcat's conf/web.xml file? Mar 11, 2009 3:54:58 PM org.apache.catalina.startup.ContextConfig processContextConfig SEVERE: Occurred at line 18 column 20 That should give you a pretty good idea of where to look. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Problem starting Tomcat in Netbeans
Chuck, Sorry by mistake I copied the WEB-INF/web.xml. The conf/web.xml is the following: ?xml version=1.0 encoding=UTF-8? web-app version=2.4 xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd; !-- Introduction == -- !-- This document defines default values for *all* web applications -- !-- loaded into this instance of Tomcat. As each application is -- !-- deployed, this file is processed, followed by the-- !-- /WEB-INF/web.xml deployment descriptor from your own -- !-- applications.-- !-- -- !-- WARNING: Do not configure application-specific resources here! -- !-- They should go in the /WEB-INF/web.xml file in your application. -- !-- == Built In Servlet Definitions -- !-- The default servlet for all web applications, that serves static -- !-- resources. It processes all requests that are not mapped to other -- !-- servlets with servlet mappings (defined either here or in your own -- !-- web.xml file. This servlet supports the following initialization-- !-- parameters (default values are in square brackets): -- !-- -- !-- debug Debugging detail level for messages logged -- !-- by this servlet. [0] -- !-- -- !-- fileEncodingEncoding to be used to read static resources -- !-- [platform default] -- !-- -- !-- input Input buffer size (in bytes) when reading -- !-- resources to be served. [2048]-- !-- -- !-- listingsShould directory listings be produced if there -- !-- is no welcome file in this directory? [false] -- !-- WARNING: Listings for directories with many-- !-- entries can be slow and may consume-- !-- significant proportions of server resources. -- !-- -- !-- output Output buffer size (in bytes) when writing -- !-- resources to be served. [2048]-- !-- -- !-- readonlyIs this context read only, so HTTP -- !-- commands like PUT and DELETE are -- !-- rejected? [true] -- !-- -- !-- readmeFile File name to display with the directory-- !-- contents. [null] -- !-- -- !-- sendfileSizeIf the connector used supports sendfile, this -- !-- represents the minimal file size in KB for -- !-- which sendfile will be used. Use a negative-- !-- value to always disable sendfile. [48]-- !-- -- !-- For directory listing customization. Checks localXsltFile, then -- !-- globalXsltFile, then defaults to original behavior. -- !-- -- !-- localXsltFile Make directory listings an XML doc and -- !-- pass the result to this style sheet residing -- !-- in that directory. This overrides -- !-- globalXsltFile[null] -- !-- -- !-- globalXsltFile Site wide configuration version of -- !-- localXsltFile This argument is expected-- !-- to be a physical file. [null] -- !-- -- !-- -- !--filter
Remote JMX enabling in start scripts
Hi, I needed to do this for some testing I'm involved in. Thought it might be useful for others also. I made the changes in the scripts on trunk and tested the build and server. [1] Index: catalina.sh === --- catalina.sh (revision 752728) +++ catalina.sh (working copy) @@ -60,6 +60,12 @@ # -agentlib:jdwp=transport=$JPDA_TRANSPORT, # address=$JPDA_ADDRESS,server=y,suspend= $JPDA_SUSPEND # +# JMXREMOTE_OPTS (Optional) Java runtime options used when jmxremote start +# command is executed. This command turns on remote jmx +# access. For JVM defaults, uncomment only the com.sun. +# management.jmxremote. The other jmxremote properties enable +# finer control and security See: http:// java.sun.com/j2se/1.5.0/docs/guide/management/agent.html. +# # JSSE_HOME (Optional) May point at your Java Secure Sockets Extension # (JSSE) installation, whose JAR files will be added to the # system class path used to start Tomcat. @@ -234,6 +240,19 @@ shift fi +if [ $1 = jmxremote ]; then + echo Remote JMX enabled + JMXREMOTE_OPTS=-Dcom.sun.management.jmxremote + JMXREMOTE_OPTS=${JMXREMOTE_OPTS} - Dcom.sun.management.jmxremote.port=10005 + echo WARNING - Remote JMX is not securely configured +# JMXREMOTE_OPTS=${JMXREMOTE_OPTS} - Dcom.sun.management.jmxremote.access.file=access-file-path +# JMXREMOTE_OPTS=${JMXREMOTE_OPTS} - Dcom.sun.management.jmxremote.password.file=password-file-path + JMXREMOTE_OPTS=${JMXREMOTE_OPTS} - Dcom.sun.management.jmxremote.ssl=false + JMXREMOTE_OPTS=${JMXREMOTE_OPTS} - Dcom.sun.management.jmxremote.authenticate=false + JAVA_OPTS=${JAVA_OPTS} ${JMXREMOTE_OPTS} + shift +fi + if [ $1 = debug ] ; then if $os400; then echo Debug command not available on OS400 [2] Index: startup.sh === --- startup.sh (revision 752728) +++ startup.sh (working copy) @@ -61,4 +61,7 @@ fi fi +# Uncomment to enable remote jmx +#exec $PRGDIR/$EXECUTABLE jmxremote start $@ + exec $PRGDIR/$EXECUTABLE start $@ cheers, -- dave David Knox Information System Architect +1 303-748-8906 http://pragmaticis.blogspot.com - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Sound
Hello, This should really be pretty simple. I'm trying to serve up an mp3 file without any action mapping. But upon trying to access the file I'm getting a 404. What's more interesting is that after directory listing is enabled, the mp3 file is excluded from the listing. This is on a pretty vanilla 6.0.18 out of the box on Windows. Thanks, Gabor