Re: FW: tomcat hangs with error msg-All Threads are Busy.....
This most probably means there is deadlock somewhere in your webapplication, leading to HTTP threads not being released because they are stuck waiting for something before sending response to a user that dropped hours agos. To get clues on where your problem is when this happens, send signal SIGQUIT to tomcat process, it will force the sun JVM to dump all threads stacks. Regards, David Delbecq Ajit Narayanan wrote: hi, My tomcat 4.1.27 is running on sun Solaris 8 box but ocassionally it hangs out giving the error All threads are busy, waiting. Please increase maxThreads or check the servlet status75. I have tried increasing the no of threads but its not working I guess. The application code looks clean but can there be any compatibility issues (of tomcat and JDK) with the solaris POSIX thread libraries?? If there is any problem then what can be done to resolve this problem. One more thing restarting the tomcat manually resolves the problem. regards, Ajit. Tech Mahindra, formerly Mahindra-British Telecom. Disclaimer: The contents of this E-mail (including the contents of the enclosure(s) or attachment(s) if any) are privileged and confidential material of Tech Mahindra and should not be disclosed to, used by or copied in any manner by anyone other than the intended addressee(s). In case you are not the desired addressee, you should delete this message and/or re-direct it to the sender. The views expressed in this E-mail message (including the enclosure(s) or attachment(s) if any) are those of the individual sender, except where the sender expressly, and with authority, states them to be the views of Tech Mahindra. This e-mail message including attachment/(s), if any, is believed to be free of any virus. However, it is the responsibility of the recipient to ensure that it is virus free and Tech Mahindra is not responsible for any loss or damage arising in any way from its use. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: FW: tomcat hangs with error msg-All Threads are Busy.....
ok, i bet then you problem is in this :D: au.com.AdmTech.incontrol.secureproxy.SecureProxy.doGet(SecureProxy.java:298) - locked 0xf227ea88 (a au.com.alcatel.incontrol.secureproxy.SecureProxy) at au.com.AdMtech.incontrol.secureproxy.SecureProxy.doPost(SecureProxy.java:435 ) it uses a lock to a ressource or there is a synchronized method in the way. As such, until one process has finished, others can't start working. This is bad :) As a consequence, if one of clients is not responding but not sending data to the wire, it locks everything. In normal course of operation, you end up with a connection closed exception in socketinputstream.read() but it takes time to get them. and the delay is platform dependant. if client abruptly close, TCP/IP protocol has no information about this except for a very long delay. Maybe some protocol level tunings like keep alives might help :/ Anyway, this has nothing to do with GC :) Ajit Narayanan wrote: Thanx for ur interest Dav.I am fairly new to java and tomcat programming so I am bit low on debugging these. Yes,I do have some of the data from the dumps, I don't know whether these will be of any help or not but this what I have.This happened on live about 7 months ago and it has been reopened on cux demand ,a workaround has been patched where in the socket gets realesed after some 90- secs.The following dump has been taken before this workaround: Thread-540 daemon prio=5 tid=0x0048b9e0 nid=0x33a runnable [ee47f000..ee4819a8] at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.read(Unknown Source) at org.apache.coyote.http11.InternalInputBuffer.fill(InternalInputBuffer.java:7 77) at org.apache.coyote.http11.InternalInputBuffer$InputStreamInputBuffer.doRead(I nternalInputBuffer.java:807) at org.apache.coyote.http11.filters.IdentityInputFilter.doRead(IdentityInputFil ter.java:158) at org.apache.coyote.http11.InternalInputBuffer.doRead(InternalInputBuffer.java :742) at org.apache.coyote.Request.doRead(Request.java:431) at org.apache.coyote.tomcat4.CoyoteInputStream.readBytes(CoyoteInputStream.java :199) at org.apache.coyote.tomcat4.CoyoteInputStream.read(CoyoteInputStream.java:156) at org.apache.coyote.tomcat4.CoyoteRequest.readPostBody(CoyoteRequest.java:1983 ) at org.apache.coyote.tomcat4.CoyoteRequest.parseRequestParameters(CoyoteRequest .java:1965) at org.apache.coyote.tomcat4.CoyoteRequest.getParameter(CoyoteRequest.java:911) at org.apache.coyote.tomcat4.CoyoteRequestFacade.getParameter(CoyoteRequestFaca de.java:178) at au.com.AdmTech.incontrol.secureproxy.SecureProxy.doGet(SecureProxy.java:298) - locked 0xf227ea88 (a au.com.alcatel.incontrol.secureproxy.SecureProxy) at au.com.AdMtech.incontrol.secureproxy.SecureProxy.doPost(SecureProxy.java:435 ) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) And there are 71 threads waiting to lock 0xf227ea88: - waiting to lock 0xf227ea88 Apart from what you suggested can this be a problem of compatibility between tomcat-JDK and the POSIX lib of solaris? Or can it be that the gc is not able to execute as generally the load on this proxy is very high leading to such a problem. Thanks and regards, Ajit. -Original Message- From: David Delbecq [mailto:[EMAIL PROTECTED] Sent: Thursday, May 18, 2006 1:32 PM To: Tomcat Users List Subject: Re: FW: tomcat hangs with error msg-All Threads are Busy. This most probably means there is deadlock somewhere in your webapplication, leading to HTTP threads not being released because they are stuck waiting for something before sending response to a user that dropped hours agos. To get clues on where your problem is when this happens, send signal SIGQUIT to tomcat process, it will force the sun JVM to dump all threads stacks. Regards, David Delbecq Ajit Narayanan wrote: hi, My tomcat 4.1.27 is running on sun Solaris 8 box but ocassionally it hangs out giving the error All threads are busy, waiting. Please increase maxThreads or check the servlet status75. I have tried increasing the no of threads but its not working I guess. The application code looks clean but can there be any compatibility issues (of tomcat and JDK) with the solaris POSIX thread libraries?? If there is any problem then what can be done to resolve this problem. One more thing restarting the tomcat manually resolves the problem. regards, Ajit. == == Tech Mahindra, formerly Mahindra-British Telecom. Disclaimer: The contents of this E-mail (including the contents of the enclosure(s) or attachment(s) if any) are privileged and confidential material of Tech Mahindra
Re: FW: tomcat hangs with error msg-All Threads are Busy.....
I think you should not use synchronized sections / mutex to get informations from client. Common policy in using mutex is to keep them as little time as possible and do only the critical work inside the exclusive part.This is to prevent long waiting queues and ... things like that :) Ajit Narayanan wrote: You are right! The code does implement a mutex() part. But the problem lasted for 7 days untill the server was restarted manually. There were about 15 threads which were found to be in locked state.And for all these days tomcat was not accepting any requests. Do you think Dev that this could have happened under the conditions that you have mentioned . And the following message was found in the catalina.out log file: Dec 7, 2004 3:44:37 PM org.apache.tomcat.util.threads.ThreadPool logFull SEVERE: All threads are busy, waiting. Please increase maxThreads or check the servlet status75 75 -Original Message- From: David Delbecq [mailto:[EMAIL PROTECTED] Sent: Thursday, May 18, 2006 2:35 PM To: Tomcat Users List Subject: Re: FW: tomcat hangs with error msg-All Threads are Busy. ok, i bet then you problem is in this :D: au.com.AdmTech.incontrol.secureproxy.SecureProxy.doGet(SecureProxy.java:298) - locked 0xf227ea88 (a au.com.alcatel.incontrol.secureproxy.SecureProxy) at au.com.AdMtech.incontrol.secureproxy.SecureProxy.doPost(SecureProxy.java:435 ) it uses a lock to a ressource or there is a synchronized method in the way. As such, until one process has finished, others can't start working. This is bad :) As a consequence, if one of clients is not responding but not sending data to the wire, it locks everything. In normal course of operation, you end up with a connection closed exception in socketinputstream.read() but it takes time to get them. and the delay is platform dependant. if client abruptly close, TCP/IP protocol has no information about this except for a very long delay. Maybe some protocol level tunings like keep alives might help :/ Anyway, this has nothing to do with GC :) Ajit Narayanan wrote: Thanx for ur interest Dav.I am fairly new to java and tomcat programming so I am bit low on debugging these. Yes,I do have some of the data from the dumps, I don't know whether these will be of any help or not but this what I have.This happened on live about 7 months ago and it has been reopened on cux demand ,a workaround has been patched where in the socket gets realesed after some 90- secs.The following dump has been taken before this workaround: Thread-540 daemon prio=5 tid=0x0048b9e0 nid=0x33a runnable [ee47f000..ee4819a8] at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.read(Unknown Source) at org.apache.coyote.http11.InternalInputBuffer.fill(InternalInputBuffer. java:7 77) at org.apache.coyote.http11.InternalInputBuffer$InputStreamInputBuffer.do Read(I nternalInputBuffer.java:807) at org.apache.coyote.http11.filters.IdentityInputFilter.doRead(IdentityIn putFil ter.java:158) at org.apache.coyote.http11.InternalInputBuffer.doRead(InternalInputBuffe r.java :742) at org.apache.coyote.Request.doRead(Request.java:431) at org.apache.coyote.tomcat4.CoyoteInputStream.readBytes(CoyoteInputStrea m.java :199) at org.apache.coyote.tomcat4.CoyoteInputStream.read(CoyoteInputStream.java:156) at org.apache.coyote.tomcat4.CoyoteRequest.readPostBody(CoyoteRequest.jav a:1983 ) at org.apache.coyote.tomcat4.CoyoteRequest.parseRequestParameters(CoyoteR equest .java:1965) at org.apache.coyote.tomcat4.CoyoteRequest.getParameter(CoyoteRequest.java:911) at org.apache.coyote.tomcat4.CoyoteRequestFacade.getParameter(CoyoteReque stFaca de.java:178) at au.com.AdmTech.incontrol.secureproxy.SecureProxy.doGet(SecureProxy.java:298) - locked 0xf227ea88 (a au.com.alcatel.incontrol.secureproxy.SecureProxy) at au.com.AdMtech.incontrol.secureproxy.SecureProxy.doPost(SecureProxy.ja va:435 ) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) And there are 71 threads waiting to lock 0xf227ea88: - waiting to lock 0xf227ea88 Apart from what you suggested can this be a problem of compatibility between tomcat-JDK and the POSIX lib of solaris? Or can it be that the gc is not able to execute as generally the load on this proxy is very high leading to such a problem. Thanks and regards, Ajit. -Original Message- From: David Delbecq [mailto:[EMAIL PROTECTED] Sent: Thursday, May 18, 2006 1:32 PM To: Tomcat Users List Subject: Re: FW: tomcat hangs with error msg-All Threads are Busy. This most probably means there is deadlock somewhere in your webapplication, leading to HTTP threads not being released because they are stuck waiting for something
Re: Tomcat 5.0 : how to redirect a 401 error to a specific page
See section 10.4.2 of http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html You have to understand the page user see when he hit cancel has been send by tomcat before the user hit cancel. This is the page which is shown to user to indicate him he requires authentification. If you want to customize the layout of this page, use the error-page error-code location way, but do not, in you page send any redirect as it will break authentification mecanism (the browser won't get it's 401 header and thus won't show the http auth dialog to user). Francis Galiegue a écrit : Hello, Our webapp runs with Tomcat 5, Apache 2.0.46 from RHEL3, Tomcat 5.0.27 from JPackage, and communicate via mod_jk 1.2.6. Here's the problem we face: our webapp sends notifications by email, with a link to a JSP requiring a classical HTTP authentication dialog. This same page is used for the login form into the application, and its behaviour is controlled by the parameters passed to it. When the user DOES NOT submit any information (ie, it presses Cancel on the dialog box), Tomcat shows its 401 page. I've tried the following: * add an ErrorDocument directive to Apache config: no go; * add an error-page tag with error-code and location into the web-app section of WEB-INF/web.xml with the location pointing back to the same page, with no parameters: no go either... It's even worse in this case, since the Tomcat 401 page shows directly, the HTTP auth dialog doesn't even appear. I haven't tried _both_ at the same time, but I believe it wouldn't be the solution. As I'm not really fluent with Apache/Tomcat and webapps, I don't know where I should look at to solve the problem. Any hints would be more than welcome! Thanks for reading, and it'd be nice to reply-all, since the two CC are not on the list, -- Francis Galiegue, [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED] One2team - 12bis rue de la Pierre Levée, 75011 Paris - 0143381980 When it comes to performance, weight is everything - Tiff Needell - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Java process segfaulting and using 100% CPU
There are several ways to find out where tomcat is spending all it's cpu time 1) when it's a 100% CPU eating time issue a few stacktraces at a 10 or 20 seconds interval. then compare all those trace and try to find a stacktrace which is recurrent. This is clearly not easy and might require quite a few hours of analysis to point a list of reccurrent working area during the various dumps. If you have an endless loop of a very slow process, it should be present in a thread for all dumps. 2) check twice you don't have memory consumption problems. We noticed a few time here that tomcat behaving very slowly is a prefail warning of a memory outtage (The garbage collector becomes aggressive). So increase max memory and max permergensize. (You should get out of memory errors anyway in the end if this is the case 3) Use a profiling tool to get reports on CPU usage by various areas of code. When it comes to debugging CPU usage or memory leaks, profilers are very usefull. The drawback is you have to run your tomcat in a profiled environnment which will take note of execution time of all your method calls. If you can't reproduce your problem on a test server ,that mean you need to profile your production server, but profiling tomcat render it about 4 to 10 times slower, depending on the profiler, the memory on server, etc. 2 points in stack trace worth checking, i noticed 2 threads are not in sleep state and have a similar part in stack trace, check twice if there is no endless loop around at br.gov.mds.suasnob.data.pessoafisica.PessoaFisicaData.getPapelList( PessoaFisicaData.java:185) at br.gov.mds.suasnob.data.pessoafisica.PessoaFisicaData.getPapeis( PessoaFisicaData.java:160) partial traces: http-8080-Processor7 daemon prio=1 tid=0x08b6c9f8 nid=0x5048 runnable [0x6f627000..0x6f6296c0] at org.hibernate.event.def.AbstractVisitor.processValue( AbstractVisitor.java:102) at org.hibernate.event.def.AbstractVisitor.processValue( AbstractVisitor.java:64) at org.hibernate.event.def.AbstractVisitor.processEntityPropertyValues( AbstractVisitor.java:58) at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity (DefaultFlushEntityEventListener.java:198) at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities( AbstractFlushingEventListener.java:190) at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions (AbstractFlushingEventListener.java:70) at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush( DefaultAutoFlushEventListener.java:39) at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java :711) at org.hibernate.impl.SessionImpl.prepareQueries(SessionImpl.java:895) at org.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:885) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:834) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74) at br.gov.mds.suasnob.data.pessoafisica.PessoaFisicaData.getPapelList( PessoaFisicaData.java:185) at br.gov.mds.suasnob.data.pessoafisica.PessoaFisicaData.getPapeis( PessoaFisicaData.java:160) at org.hibernate.engine.ActionQueue.sortCollectionActions( ActionQueue.java:292) at org.hibernate.event.def.AbstractFlushingEventListener.flushCollections( AbstractFlushingEventListener.java:244) at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions (AbstractFlushingEventListener.java:71) at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush( DefaultAutoFlushEventListener.java:39) at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java :711) at org.hibernate.impl.SessionImpl.prepareQueries(SessionImpl.java:895) at org.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:885) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:834) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74) at br.gov.mds.suasnob.data.pessoafisica.PessoaFisicaData.getPapelList( PessoaFisicaData.java:185) at br.gov.mds.suasnob.data.pessoafisica.PessoaFisicaData.getPapeis( PessoaFisicaData.java:160) at sun.reflect.GeneratedMethodAccessor1697.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke( DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at ognl.OgnlRuntime.invokeMethod(OgnlRuntime.java:491) at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:785) at ognl.ObjectMethodAccessor.callMethod(ObjectMethodAccessor.java:61) .. Gustavo Noronha a écrit : Hey David! 2006/4/20, David Delbecq [EMAIL PROTECTED]: the kill -3 send a signal, that is you must send it to a process (in you case the java virtual machine). The sun java machine has the behaviour to dump a full stacktrace of all it's threads when it receive this. Of course you won't get the dump in the console where you ran kill it. it will probably be in catalina.out Sure; but do you
Re: Java process segfaulting and using 100% CPU
Leon Rosenberg a écrit : I don't know it depends on your implementation of hashCode() method. Are you using 1.5? static int hash(Object x) { int h = x.hashCode(); -- your programm is here h += ~(h 9); h ^= (h 14); h += (h 4); h ^= (h 10); return h; } I think chances are low that the you see threads in this method often. Would you mind checking the hashCode() method implementation of the objects you put in the map? Maybe someone programmed some kind of very-cool-hash-code-optimization and got an infinite loop. False :) Please note the thread dumps tells the Thread http-8080-Processor56 is in java.util.HashMap.hash(HashMap.java:264) not in something like com.company.veryCoolClass.hashCode(); as you said, the program is here : int h = x.hashCode() that mean it is either in the step of putting the value from registers to h , either in precall of x.hashCode(). In no way is it currently running x.hashCode() :) Please also note, chance to get Threads in there are not so low when you play a lots with Hashmap :) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat WIKI only in polish??? - http://wiki.apache.org/tomcat/
ROFLMAO!! MichalDziczkowski did the polish translation on 18 april, but it seems he did all his commits on wrong web page :D The english version is still accessible in the page history. http://wiki.apache.org/tomcat/FrontPage?action=recallrev=21 You probably must warn a wiki maintainer of this mistake so he can undo the changes :D Leon Rosenberg a écrit : No english version? regards Leon http://wiki.apache.org/tomcat/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Java process segfaulting and using 100% CPU
(a org.apache.catalina.core.StandardWrapper) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3823) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4087) - locked 0xac1876f0 (a org.apache.catalina.core.StandardContext) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759) - locked 0xab9a37d8 (a java.util.HashMap) 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:590) 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:1106) 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:1019) - locked 0xab99eb50 (a org.apache.catalina.core.StandardHost) at org.apache.catalina.core.StandardHost.start(StandardHost.java:718) - locked 0xab99eb50 (a org.apache.catalina.core.StandardHost) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1011) - locked 0xab986ce8 (a org.apache.catalina.core.StandardEngine) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:440) at org.apache.catalina.core.StandardService.start(StandardService.java:450) - locked 0xab986ce8 (a org.apache.catalina.core.StandardEngine) at org.apache.catalina.core.StandardServer.start(StandardServer.java:683) - locked 0xab99d7e0 (a [Lorg.apache.catalina.Service;) at org.apache.catalina.startup.Catalina.start(Catalina.java:537) 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:324) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409) VM Thread prio=1 tid=0x080a0970 nid=0x765d runnable jsut analyze where your thread are stuck in this. It takes time but can prove a usefull information. You can also send it to ml and hope someone will help you analyze :) regards David Delbecq - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: multiple tomcat on one server??
I confirm the link does not work here too 'host www.adcworks.com unknown' $ nslookup adcworks.com Server: 193.190.249.143 Address:193.190.249.143#53 ** server can't find adcworks.com: NXDOMAIN looking in whois database the reason it does not work is obvious, $whois adcworks.com (stripped most) Registrar of Record: TUCOWS, INC. Record last updated on 21-Dec-2005. Record expires on 18-Apr-2006. Record created on 18-Apr-2000. This domain name has expired yesterday. You might be using an old copy of dns entries, explaining why it still work for you :) Allistair Crossley a écrit : Hi, The link certainly works for me. Perhaps go into it from www.adcworks.com/blog A. -Original Message- From: Thomas Hack [mailto:[EMAIL PROTECTED] Sent: 19 April 2006 11:15 To: Tomcat Users List Subject: RE: multiple tomcat on one server?? Hi Allistair, thanks for your very quick response. The link you mailed does not work, please resend the correct link. Also: I do not use TC load balancing, but completley separate TC, which must run independant of eacch other on the same Linux server. Regards Thomas H. --- Ursprüngliche Nachricht --- Von: Allistair Crossley [EMAIL PROTECTED] An: Tomcat Users List users@tomcat.apache.org Betreff: RE: multiple tomcat on one server?? Datum: Wed, 19 Apr 2006 11:08:37 +0100 Hi, This question was asked (yesterday) by myself. Firstly, stop using JK2. Secondly, go read http://www.adcworks.com/blog/index.php/2005/08/03/load-balancing-with-tomcat-55-and-jk-12/ Which explains how I have 2 Tomcats up on 1 server. Cheers, Allistair. -Original Message- From: Thomas Hack [mailto:[EMAIL PROTECTED] Sent: 19 April 2006 11:06 To: users@tomcat.apache.org Subject: multiple tomcat on one server?? Hi, I would like to run different versions of Tomcat on the same server. Therefore I change ports for communication. First I change the port 8009 in workers2.properties: workers2.properties [channel.socket:localhost:8009] port=8009 host=127.0.0.1 # define the worker [ajp13:localhost:8009] channel=channel.socket:localhost:8009 group=lb Then I change the Connector port from 8080 to something else. But what about all the other ports in server.xml and server-minimal.xml? Which need to be changed in order to run and administer serveral Tomcat versions on the same machine? Server port=8005 shutdown=SHUTDOWN debug=0 Connector port=8080 maxThreads=150 minSpareThreads=25 maxSpareThreads=75 enableLookups=false redirectPort=8443 acceptCount=100 debug=0 connectionTimeout=2 disableUploadTimeout=true / Connector port=8443 maxThreads=150 minSpareThreads=25 maxSpareThreads=75 enableLookups=false disableUploadTimeout=true acceptCount=100 debug=0 scheme=https secure=true clientAuth=false sslProtocol=TLS / Connector port=8009 enableLookups=false redirectPort=8443 debug=0 protocol=AJP/1.3 / Connector port=8082 maxThreads=150 minSpareThreads=25 maxSpareThreads=75 enableLookups=false acceptCount=100 debug=0 connectionTimeout=2 proxyPort=80 disableUploadTimeout=true / Thanks regards Thomas H. -- Feel free - 10 GB Mailbox, 100 FreeSMS/Monat ... Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail -- GMX Produkte empfehlen und ganz einfach Geld verdienen! Satte Provisionen für GMX Partner: http://www.gmx.net/de/go/partner - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLUE --- QAS Ltd. Registered in England: No 2582055 Registered in Australia: No 082 851 474 --- /FONT FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLACK Disclaimer: The information contained within this e-mail is confidential and may be privileged. This email is intended solely for the named recipient only; if you are not authorised you must not disclose, copy, distribute, or retain this message or any part of it. If you have received this message in error please contact the sender at once so that we may take the appropriate action and avoid troubling you further. Any views expressed in this message are those of the individual sender. QAS Limited has the right lawfully to record, monitor and inspect messages between its employees and any third party. Your messages shall be subject to such lawful supervision as QAS Limited deems to be necessary in order to protect its information, its interests and its reputation. Whilst all efforts are made to safeguard Inbound and Outbound emails, QAS Limited cannot guarantee
Re: Java process segfaulting and using 100% CPU
Hi, or other processes may end up using 100% CPU as well and presenting the same behavior while on strace If you mean also non java processes have similar problems, randomly, i bet you may have either an OS issue (which affect all processes randomly) either an hardware issue (corrupting RAM segments?) If you want to discover where you tomcat is eating all it's CPU cycle, i recommend you issue a 'kill -3 java process id', this will dump in java stdout a list of current stacktrace, including native frames. You might get there hints on what is problematic (might simply be an HttpThread in a webapp endless loop) Regards Gustavo Noronha a écrit : Hello, I've searched a lot about this issue on the web, but did not find a solution. I have the following setup: Debian GNU/Linux 3.1 with official Tomcat5 package (5.0.30), java-package-built Sun JVM: # java -version java version 1.5.0_05 Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05) Java HotSpot(TM) Server VM (build 1.5.0_05-b05, mixed mode) Our main application uses Hibernate to persist objects and C3P0 to control the connection pool. Here's the configuration file: hibernate.connection.driver_class com.p6spy.engine.spy.P6SpyDriver hibernate.connection.url jdbc:oracle:thin:@dbhost:1521:sid hibernate.connection.username user hibernate.connection.password pass hibernate.transaction.factory_class = org.hibernate.transaction.JDBCTransactionFactory hibernate.use_outer_join true hibernate.show_sql false hibernate.c3p0.minPoolSize = 10 hibernate.c3p0.maxPoolSize = 200; hibernate.c3p0.min_size=10 hibernate.c3p0.max_size=200 hibernate.c3p0.timeout=5000 hibernate.c3p0.max_statements=0 hibernate.cglib.use_reflection_optimizer=true hibernate.dialect org.hibernate.dialect.OracleDialect I use the P6SpyDriver to be able to log the SQL queries that go through to the Oracle database, but I have the same problem with the OracleDriver as well. So here's the problem: After some time running one java process begins using 100% CPU; strace shows this: --- SIGSEGV (Segmentation fault) @ 0 (0) --- rt_sigreturn(0x55d32bda)= -442421359 futex(0x805c770, FUTEX_WAIT, 2, NULL) = -1 EAGAIN (Resource temporarily unavailable) futex(0x81ff918, FUTEX_REQUEUE, 1, 2147483647, 0x805c770) = 1 futex(0x805c770, FUTEX_WAKE, 1) = 1 futex(0x805c7f0, FUTEX_WAIT, 2, NULL) = 0 futex(0x805c7f0, FUTEX_WAKE, 1) = 0 --- SIGSEGV (Segmentation fault) @ 0 (0) --- rt_sigreturn(0x500ddbda)= -442421359 futex(0x805c770, FUTEX_WAIT, 2, NULL) = 0 futex(0x81ff918, FUTEX_REQUEUE, 1, 2147483647, 0x805c770) = 1 futex(0x805c770, FUTEX_WAKE, 1) = 1 futex(0x805c7f0, FUTEX_WAIT, 2, NULL) = 0 futex(0x805c7f0, FUTEX_WAKE, 1) = 0 This may stay like that for the whole day, tomcat being responsive, or other processes may end up using 100% CPU as well and presenting the same behavior while on strace. Eventually, tomcat may become unresponsive, but I could not estabilish a pattern. I found similar SIGSEGV/futex behavior on a non-100%-using process, too: send(23, \2c\0\0\6\0\0\0\0\0\21i\0\1\1\1\1\1\3^\0\2\200!\0\1\2\2\\1\1\r\0\0\0\0\4\177\377\377\377\0\0\0\0\0\0\0\0\0select papelpesso0_.ID_ENTIDADE_DIRIGENTE as ID1_, papelpesso0_.DT_INICIO_MANDATO as DT2_29_, papelpesso0_.DT_FIM_MANDATO as DT3_29_, papelpesso0_.DT_NOMEACAO_DIRIGENTE as DT4_29_, papelpesso0_.NU_REMESSA_SIAFI as NU5_29_, papelpesso0_.DT_ENVIO_CREDOR_SIAFI as DT6_29_, papelpesso0_.DT_RETORNO_CREDOR_SIAFI as DT7_29_, papelpesso0_.ST_RESPONSAVEL as ST8_29_, papelpesso0_.CO_ENTIDADE as CO9_29_, papelpesso0_.CO_DIRIGENTE as CO10_29_, papelpesso0_.CO_CARGO as CO11_29_ from RL_ENTIDADE_DIRIGENTE papelpesso0_ where papelpesso0_.CO_DIRIGENTE=28071\1\1\0\0\0\0\0\0\1\1\0\0\0\0\0, 611, 0) = 611 recv(23, \1\217\0\0\6\0\0\0, 8, 0)= 8 recv(23, \0\0\20\31\0279 \273t6X\203\0\0xj\4\22\27\0220\4\31\0\0\0\0\0\0\1\201\1\v7\2\0\t\0\1\26\0\0\0\0\0\0\0\0\4\1\4\4ID1_\0\0\f\0\0\0\1\1\0\0\0\0\0\0\0\1\7\1\7\7DT2_29_\0\0\f\0\0\0\1\1\0\0\0\0\0\0\0\1\7\1\7\7DT3_29_\0\0\f\0\0\0\1\1\0\0\0\0\0\0\0\1\7\1\7\7DT4_29_\0\0\1\200\0\0\1\5\0\0\0\0\1\37\1\1\5\1\7\1\7\7NU5_29_\0\0\f\0\0\0\1\1\0\0\0\0\0\0\0\1\7\1\7\7DT6_29_\0\0\f\0\0\0\1\1\0\0\0\0\0\0\0\1\7\1\7\7DT7_29_\0\0`\200\0\0\1\1\0\0\0\0\1\37\1\1\1\1\7\1\7\7ST8_29_\0\0\2\0\f\0\1\26\0\0\0\0\0\0\0\0\7\1\7\7CO9_29_\0\0\2\0\n\0\1\26\0\0\0\0\0\0\0\0\10\1\10\10CO10_29_\0\0\2\0\t\0\1\26\0\0\0\0\0\0\0\0\10\1\10\10CO11_29_\0\0\1\7\7xj\4\23\2!\17\10\1\5\3+\367Y\0\1\1\0\0\0\0\4\0\0\0\0\1\1\2\1\332\3\0\0\0\0\0\2\177|\1\1\0\2\317/\1\5\0\0\0\0\1\1, 391, 0) = 391 send(23, \0\21\0\0\6\0\0\0\0\0\3\5\0\1\1\1\n, 17, 0) = 17 recv(23, \0F\0\0\6\0\0\0, 8, 0) = 8 recv(23, \0\0\4\0\2\5{\0\0\1\1\0\3\0\1 \0\0\0\2\177|\1\1\0\2\317/\1\5\0\0\0\0\1\1\31ORA-01403: no data found\n, 62, 0) = 62 gettimeofday({1145421443, 130050}, NULL) = 0 gettimeofday({1145421443, 130213}, NULL) = 0 write(14, 1145421443130|17|37|statement|select papelpesso0_.ID_ENTIDADE_DIRIGENTE as ID1_,
Re: Post request to 'j_security_check' after tomcat restart or se ssio n timeout produces error 400
Hi, First, you must understand in form based login, access to the form should never be done directly, that's because the container can accept a form login only if before the user tried to access an area requiring authentification. In simple terms, you see the form because the container has decided it required your credentials, not because you just wanted to log in. Now in your case, after a session expire, when the user submit the form, tomcat just notice it gets an access to j_security_check while user session (which has been reset) show no track of a previous attempt to access a secure area needing authentification. The container then concludes naturally it is an attempt at accessing directly the j_security_check and just ignore the call, sending a 400. At this step, tomcat has not saved the user/pass. In your error handler you redirect to secure area. Then naturally, tomcat now trigger the code requesting credential and show again the login form. So there is no solution to solve your problem, except perhaps increasing session timeout to limit the number of 'show form - timeout - submit form' The case of tomcat shutting down my be due to error are persisting the sessions (See output at tomcat shutdown/startup and check for session persistence errors) regards, David Delbecq Amol Upadhye a écrit : Anybody know about the problem I have as described in below email? Thanks, Amol -Original Message- From: Amol Upadhye [mailto:[EMAIL PROTECTED] Sent: Thursday, April 13, 2006 2:25 PM To: users@tomcat.apache.org Subject: Post request to 'j_security_check' after tomcat restart or sessio n timeout produces error 400 Hi, I am using Tomcat 5.0.28 and Form based authentication. Here are steps to produce my problem, 1. Access secured page - tomcat forwards request to login page 2. Restart tomcat server or wait till session expires, keep login page as it is, do not close browser window. 3. After tomcat restarts, with same login page try to login In this case even if login information is correct tomcat throws error 400. This is because it looses the URL to which to forward to after authentication. What I want is to forward the request to the desired page (may be preconfigured). Is there a way to configure so that control is forwarded to the configured page in this case? Current I have Error 400 handler in which if requested URL is 'j_security_check' then I redirect to the desired page (secured page). But tomcat somehow doesn't keep authenticated principal and again presents login screen. Any help is very much appreciated. Thanks, Amol - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
changes in tomcat realms between 5.5.7 and 5.5.16?
Hello, I have a webapp here which comes with it's own realms. It's working prefectly in tomcat 5.5.7. I deployed this application and copied the realm files (common/lib/MyRealm-api.jar and server/lib/MyRealm-impl-1.0.jar) to a new tomcat installation. I the deployed to webapp and tried to access a secure area. To my surprise, it seems the user trying to access it is identified ok (according to my realm logs, everything is ok), but gets a refusal from tomcat. The exact same user and same .war (which includes a context in META-INF/) has no problems with tomcat 5.5.7 What change in realm / identification management in tomcat could cause this? Thanks for informations. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: webapp slow on first access every morning
Could it simply be your tomcat service is restarted let's say at midnight ? Edward Quick a écrit : Hi, We have a third party jsp/servlet application deployed on Tomcat 4.1.31 (Solaris 2.8). This works fine except for every morning, on the first access, it's very slow to load up. This is the context: Context path=/esav debug=9 reloadable=false docBase=/ov/apache/ovprd01/webapps/esav Logger className=org.apache.catalina.logger.FileLogger prefix=esav_log. suffix=.txt timestamp=true/ /Context And in web.xml, I have: servlet servlet-namejsp/servlet-name servlet-classorg.apache.jasper.servlet.JspServlet/servlet-class init-param param-namelogVerbosityLevel/param-name param-valueWARNING/param-value /init-param init-param param-namefork/param-name param-valuefalse/param-value /init-param init-param param-namedevelopment/param-name param-valuefalse/param-value /init-param load-on-startup3/load-on-startup /servlet So reloadable and development are both set to false. I can't really think of what else would cause this type of delay? Hope you can help! Thanks, Edward. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: webapp slow on first access every morning
And no mention about a webapp shutdown or other curiosities in catalina.out ? Edward Quick a écrit : Good idea, but no: ovapache 6305 6304 0 Apr 05 ?1:01 /usr/j2sdk1.4.2_06/bin/java -Xms128m -Xmx256m -Dapp=ovprd01 -Djava.endorsed.dir Could it simply be your tomcat service is restarted let's say at midnight ? Edward Quick a écrit : Hi, We have a third party jsp/servlet application deployed on Tomcat 4.1.31 (Solaris 2.8). This works fine except for every morning, on the first access, it's very slow to load up. This is the context: Context path=/esav debug=9 reloadable=false docBase=/ov/apache/ovprd01/webapps/esav Logger className=org.apache.catalina.logger.FileLogger prefix=esav_log. suffix=.txt timestamp=true/ /Context And in web.xml, I have: servlet servlet-namejsp/servlet-name servlet-classorg.apache.jasper.servlet.JspServlet/servlet-class init-param param-namelogVerbosityLevel/param-name param-valueWARNING/param-value /init-param init-param param-namefork/param-name param-valuefalse/param-value /init-param init-param param-namedevelopment/param-name param-valuefalse/param-value /init-param load-on-startup3/load-on-startup /servlet So reloadable and development are both set to false. I can't really think of what else would cause this type of delay? Hope you can help! Thanks, Edward. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
restricting webapp reloading on ressources changes
Hello, I have configured my developpment tomcat to automatically check for ressoures changes in the webapp folder, making it easier to update JSPs. The webapp is slow to load because of a few servelt i need along with those jsps. during development, i sometimes need to update the resource bundles for i18n. Those are located in WEB-INF/classes/path/bundle_language.properties As they are in WEB-INF/classes, tomcat things classes have changed and it need to reload the webapp, which take a bunch of time, each time i update an i18n. Is there a way to tell tomcat to not reload webapp on changes to WEB-INF/classes/**.properties ? Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Private variables in custom tags on Tomcat
Stephen Gray a écrit : Hello all, I've come across a problem with using private variables in custom tags with Tomcat. I have this tag class: public class TestTag extends TagSupport { private Date testDate = new Date(); public int doStartTag() throws JspException { pageContext.setAttribute(date, testDate); return Tag.EVAL_BODY_INCLUDE; } } accessed from a jsp via: t:Test${date}/Test You doing it wrong, the specs tell you that the tag will not be altered between begin of doStartTag() and exit doEndTag(), so you can not assume the state of local variables to stay constant or be reset after doEndTag() has been called. You don't even have guarantees the same tag instance won't be used in separate pages :) If you take a look at generated code from .jsp in catalina you will notice tomcat is doing tag pooling. I suggest you read details of doStartTag() and doEndTag() in javadoc: http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/jsp/tagext/Tag.html#doStartTag() http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/jsp/tagext/Tag.html#doEndTag() In short: The doStartTag method assumes that the properties pageContext and parent have been set. It also assumes that any properties exposed as attributes have been set too. When this method is invoked, the body has not yet been evaluated. That's all you can assume :) in you case, i suggest you do public int doStartTag() throws JspException { testDate = new Date(); There's also a tld file that defines the Test tag linked to the TestTag class with one variable (date). If I open my browser and go to the jsp it displays the current date/time. If I then open a browser on a different machine and go to the jsp it displays the same date/time, which means (I think) that Tomcat is creating one instance of my TestTag class in the application context and handing out references to it to all users. The problem with this is that private variables are usually used to store the value of tag attributes after they are set via setter methods. If 2 people access the tag at more or less the same time then there's a chance that one user's attributes will clobber the other's. no, there is no clash, as a tag won't be shared between doStartTag() and doEndTag() Can someone tell me whether I'm doing something wrong here - and if not perhaps Tomcat should be creating a separate instance of the tag class for each session? Tomcat uses pooling for performance reason. A set of instances is reused when it is safe to do so. Thanks, Steve - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] David Delbecq - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: New to Tomcat
root cause Error starting modern compiler org.apache.tools.ant.taskdefs.compilers.Javac13.execute() (/usr/lib/libant-1.6.2.jar.so) org.apache.tools.ant.taskdefs.Javac.compile() check that your JAVA_HOME points to a jdk, not a jre. It may be jasper compiler don't find a suitable java compiler. Btw, this is quite curious: /usr/lib/libjasper5-compiler-5.0.30.jar.so You should probably use the official tomcat release files available on apache.org to be sure it's not a distro related problem. Please also note 5.0.30 is a beta, latest 5.0.x tomcat stable version is 5.0.28 The .jar.so extension is . frightening :) Paul Stewart a écrit : Hi there... Running Fedora Core 4 and installed Tomcat via yum installs I'm trying to get Nutch search engine working and keep getting the following errors. I'm told by the nutch mailing list that this is a specific issue to Tomcat?? HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: Unable to compile class for JSP org.apache.jasper.compiler.DefaultErrorHandler.javacError(java.lang.Stri ng, java.lang.Exception) (/usr/lib/libjasper5-compiler-5.0.30.jar.so) org.apache.jasper.compiler.ErrorDispatcher.javacError(java.lang.String, java.lang.Exception) (/usr/lib/libjasper5-compiler-5.0.30.jar.so) org.apache.jasper.compiler.Compiler.generateClass(java.lang.String[]) (/usr/lib/libjasper5-compiler-5.0.30.jar.so) org.apache.jasper.compiler.Compiler.compile(boolean, boolean) (/usr/lib/libjasper5-compiler-5.0.30.jar.so) org.apache.jasper.compiler.Compiler.compile(boolean) (/usr/lib/libjasper5-compiler-5.0.30.jar.so) org.apache.jasper.compiler.Compiler.compile() (/usr/lib/libjasper5-compiler-5.0.30.jar.so) org.apache.jasper.JspCompilationContext.compile() (/usr/lib/libjasper5-compiler-5.0.30.jar.so) org.apache.jasper.servlet.JspServletWrapper.service(javax.servlet.http.H ttpServletRequest, javax.servlet.http.HttpServletResponse, boolean) (/usr/lib/libjasper5-compiler-5.0.30.jar.so) org.apache.jasper.servlet.JspServlet.serviceJspFile(javax.servlet.http.H ttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.String, java.lang.Throwable, boolean) (/usr/lib/libjasper5-compiler-5.0.30.jar.so) org.apache.jasper.servlet.JspServlet.service(javax.servlet.http.HttpServ letRequest, javax.servlet.http.HttpServletResponse) (/usr/lib/libjasper5-compiler-5.0.30.jar.so) javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse) (/usr/lib/libservletapi5-5.0.30.jar.so) org.apache.catalina.valves.ErrorReportValve.invoke(org.apache.catalina.R equest, org.apache.catalina.Response, org.apache.catalina.ValveContext) (/usr/lib/libcatalina-5.0.30.jar.so) org.apache.coyote.tomcat5.CoyoteAdapter.service(org.apache.coyote.Reques t, org.apache.coyote.Response) (/usr/lib/libcatalina-5.0.30.jar.so) org.apache.coyote.http11.Http11Processor.process(java.io.InputStream, java.io.OutputStream) (/usr/lib/libtomcat-http11-5.0.30.jar.so) org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processC onnection(org.apache.tomcat.util.net.TcpConnection, java.lang.Object[]) (/usr/lib/libtomcat-http11-5.0.30.jar.so) org.apache.tomcat.util.net.TcpWorkerThread.runIt(java.lang.Object[]) (/tmp/libtomcat-util-5.0.30.jar.so9a2vfs.so) org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run() (/tmp/libtomcat-util-5.0.30.jar.so9a2vfs.so) java.lang.Thread.run() (/usr/lib/libgcj.so.6.0.0) root cause Error starting modern compiler org.apache.tools.ant.taskdefs.compilers.Javac13.execute() (/usr/lib/libant-1.6.2.jar.so) org.apache.tools.ant.taskdefs.Javac.compile() (/usr/lib/libant-1.6.2.jar.so) org.apache.tools.ant.taskdefs.Javac.execute() (/usr/lib/libant-1.6.2.jar.so) org.apache.jasper.compiler.Compiler.generateClass(java.lang.String[]) (/usr/lib/libjasper5-compiler-5.0.30.jar.so) org.apache.jasper.compiler.Compiler.compile(boolean, boolean) (/usr/lib/libjasper5-compiler-5.0.30.jar.so) org.apache.jasper.compiler.Compiler.compile(boolean) (/usr/lib/libjasper5-compiler-5.0.30.jar.so) org.apache.jasper.compiler.Compiler.compile() (/usr/lib/libjasper5-compiler-5.0.30.jar.so) org.apache.jasper.JspCompilationContext.compile() (/usr/lib/libjasper5-compiler-5.0.30.jar.so) org.apache.jasper.servlet.JspServletWrapper.service(javax.servlet.http.H ttpServletRequest, javax.servlet.http.HttpServletResponse, boolean) (/usr/lib/libjasper5-compiler-5.0.30.jar.so) org.apache.jasper.servlet.JspServlet.serviceJspFile(javax.servlet.http.H ttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.String,
Re: Rephrased: Maximum number of simultaneous HTTP connections
Tp a écrit : Hi, we have to develop a high performance chat based only on HTML and HTTP only for a television company. The chat's output window requires one open HTTP connection per client, which means that you need at least 3000 simultaneous ie. open HTTP connections for 3000 chatters. To the former post people replied that HTTP in combination with the Servlet API is not made for this. The basic problem is that you a.) run out of connections and b.) out of threads after a while. The servlet API of Tomcat dedicates one Thread to each connection, which is particular bad. If you don't like it, complain to sun about their j2ee specs. In my point of view, this is really good as it guarantee context isolation of requests for application writer. And there seems to be no workaround, because the connection will close after the doGet() and doPost() method finishes (is that actually true?). So, the only way to keep 3000 simultaneous connections is to keep 3000 of those methods from returning, wehich means keeping 3000 threads busy. So I guess my question is: How many TCP connections can be created on a single machine using Java and then how many threads can be created so that application still responds? I assume that the machine runs on a Pentium 4 3.2 Ghz with 1 GB of RAM under linux and that all the file descriptor limits are set to the maximum. I think i already answered you in my previous mail. The answer is... depends! Can anybody give me some Hardware and Software recommendations on a Java Application sever, which can handle up to 3000 simultaneous HTTP connections and still respond? I know for example that BEA and JRun are very performant, but unfortuantely BEA is to expensive and then Macromedia only talks about the HTTP requests per second in their benchmarking tests, which is very different from what I'm asking. yours, Tim - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Rephrased: Maximum number of simultaneous HTTP connections
Here a diagram: Client sends GET - Server Server sends HEADERS (Content Encoding: Chunked) - Client Server sends chunks - Client Client displays them whenever they arrive. Just one point. If your 'client' is a classical browser it won't work like this out of the box, for the simple reason you have no guarantee the client will do any display before it receive /html There are provisition in http standard for a progressive display of a page. I can't remember like that the references in http 1.1 specs, just give it a look. It's based on a server pushing of page refreshes on a keep-alive connection. But it need special headers. I could just remember the HttpRespone Objects and use one thread, which gets, when new messages arrive in the queue. The thread then could println() them to all he HttpRespones. This would save me all the Threads. Hmm, sounds good, or have I missed somthing?! Yes, one thing, when doGet() returns, the container *could* close the connection. (This is tomcat internal dependent and should not be assumed as deterministic). As a side note, as stated by other people already, you should probably write your own standalone application if you intend to keep all connections alive for your chat. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: getsession if you know the id?
Pack you HttpSessions in WeakReference objects so they can be GCed (*not* SoftReferences as suggested because SoftReference are only GCed when outofmemory, while WeakReference are gced about as soon as the object is not reachable anymore by hardreference). http://java.sun.com/j2se/1.5.0/docs/api/java/lang/ref/WeakReference.html http://java.sun.com/j2se/1.4.2/docs/api/java/lang/ref/WeakReference.html John Powers a écrit : We were using a list of sessions to report who is logged in now. however our sessions don't look like they are being collected by the GC. We have a serious memory problem. I was thinking this list may be a problem so I was removing all the actual httpsessions from it and was going to just 'get' the session from the application at display time. I can record its ID.. but I can't see a way to get it based on that ID, or anything. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
accessing mehods of GenericPrincipal
Hello, LDAP Realms (and probably others) in tomcat uses GenericPrincipal as the Principal instance. This GenericPrincipal provides interresting methods like 'getPassword()' which is very usefull when your webapp has to forward the credential to a specific library before using it. Unfortunately, typecasting to GenericPrincipal like that String password = ((GenericPrincipal)principal).getPassword(); Does not work, as it seems the GenericPrincipal class is not exposed to webapp at runtime: Exception Class: class java.lang.NoClassDefFoundError Message: org/apache/catalina/realm/GenericPrincipal Is there a recommanded way to access this information (user suplied password) from the webapp? Or will i have to play with reflection api or beanutils to extract this property? Thanks for follow ups. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: error in tomcat
line 43 contains /servlet It corresponds to the following section: *servlet* *servlet-name*default*/servlet-name* *servlet-class* org.apache.catalina.servlets.DefaultServlet */servlet-class* *init-param* *param-name*debug*/param-name* *param-value*0*/param-value* */init-param* *init-param* *param-name*listings*/param-name* *param-value*true*/param-value* */init-param* *load-on-startup*1*/load-on-startup* */servlet* There is no other default section in the web.xml. The whole web.xml is as follow: *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** *display-name*Welcome to Tomcat*/display-name* *description* Welcome to Tomcat */description* /!-- JSPC servlet mappings start --/ *servlet* *servlet-name*default*/servlet-name* *servlet-class* org.apache.catalina.servlets.DefaultServlet */servlet-class* *init-param* *param-name*debug*/param-name* *param-value*0*/param-value* */init-param* *init-param* *param-name*listings*/param-name* *param-value*true*/param-value* */init-param* *load-on-startup*1*/load-on-startup* */servlet* *servlet* *servlet-name*org.apache.jsp.index_jsp*/servlet-name* *servlet-class*org.apache.jsp.index_jsp*/servlet-class* */servlet* *servlet-mapping* *servlet-name*default*/servlet-name* *url-pattern*/*/url-pattern* */servlet-mapping* *servlet-mapping* *servlet-name*org.apache.jsp.index_jsp*/servlet-name* *url-pattern*/index.jsp*/url-pattern* */servlet-mapping* /!-- JSPC servlet mappings end --/ */web-app* Any idea why this webapp fail? Regards? Alan Chaney a écrit : One place to start might be in your web.xml file. About half way down you have a message saying Mar 10, 2006 2:03:42 PM org.apache.catalina.startup.ContextConfig applicationWebConfig SEVERE: Parse error in application web.xml java.lang.IllegalArgumentException: addChild: Child name 'default' is not unique at o And at the end you have at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409) Mar 10, 2006 2:03:42 PM org.apache.catalina.startup.ContextConfig applicationWebConfig SEVERE: Occurred at line 43 column 15 Mar 10, 2006 2:03:42 PM org.apache.catalina.startup.ContextConfig start SEVERE: Marking this application unavailable due to previous error(s) Does 'line 43 column 15' refer to something relevant in web.xml? Regards Alan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: error in tomcat
Nope, downgrading to 2.3 servlet specs does not solve problem. foo shyn a écrit : Maybe u could try the this DOCTYPE tag instead !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; hope this helps F.S. - Original Message - From: David Delbecq [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Monday, March 13, 2006 4:48 PM Subject: Re: error in tomcat line 43 contains /servlet It corresponds to the following section: *servlet* *servlet-name*default*/servlet-name* *servlet-class* org.apache.catalina.servlets.DefaultServlet */servlet-class* *init-param* *param-name*debug*/param-name* *param-value*0*/param-value* */init-param* *init-param* *param-name*listings*/param-name* *param-value*true*/param-value* */init-param* *load-on-startup*1*/load-on-startup* */servlet* There is no other default section in the web.xml. The whole web.xml is as follow: *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** *display-name*Welcome to Tomcat*/display-name* *description* Welcome to Tomcat */description* /!-- JSPC servlet mappings start --/ *servlet* *servlet-name*default*/servlet-name* *servlet-class* org.apache.catalina.servlets.DefaultServlet */servlet-class* *init-param* *param-name*debug*/param-name* *param-value*0*/param-value* */init-param* *init-param* *param-name*listings*/param-name* *param-value*true*/param-value* */init-param* *load-on-startup*1*/load-on-startup* */servlet* *servlet* *servlet-name*org.apache.jsp.index_jsp*/servlet-name* *servlet-class*org.apache.jsp.index_jsp*/servlet-class* */servlet* *servlet-mapping* *servlet-name*default*/servlet-name* *url-pattern*/*/url-pattern* */servlet-mapping* *servlet-mapping* *servlet-name*org.apache.jsp.index_jsp*/servlet-name* *url-pattern*/index.jsp*/url-pattern* */servlet-mapping* /!-- JSPC servlet mappings end --/ */web-app* Any idea why this webapp fail? Regards? Alan Chaney a écrit : One place to start might be in your web.xml file. About half way down you have a message saying Mar 10, 2006 2:03:42 PM org.apache.catalina.startup.ContextConfig applicationWebConfig SEVERE: Parse error in application web.xml java.lang.IllegalArgumentException: addChild: Child name 'default' is not unique at o And at the end you have at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409) Mar 10, 2006 2:03:42 PM org.apache.catalina.startup.ContextConfig applicationWebConfig SEVERE: Occurred at line 43 column 15 Mar 10, 2006 2:03:42 PM org.apache.catalina.startup.ContextConfig start SEVERE: Marking this application unavailable due to previous error(s) Does 'line 43 column 15' refer to something relevant in web.xml? Regards Alan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: error in tomcat
Yes, renaming this does solve the problem, but i can't see in servlet specs where it's stated 'default' is not a valid logical name for a servlet. Vinu Varghese a écrit : Just change the 'default' to something else like default.test , and check whether the error repeats David Delbecq wrote: Nope, downgrading to 2.3 servlet specs does not solve problem. foo shyn a écrit : Maybe u could try the this DOCTYPE tag instead !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; hope this helps F.S. - Original Message - From: David Delbecq [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Monday, March 13, 2006 4:48 PM Subject: Re: error in tomcat line 43 contains /servlet It corresponds to the following section: *servlet* *servlet-name*default*/servlet-name* *servlet-class* org.apache.catalina.servlets.DefaultServlet */servlet-class* *init-param* *param-name*debug*/param-name* *param-value*0*/param-value* */init-param* *init-param* *param-name*listings*/param-name* *param-value*true*/param-value* */init-param* *load-on-startup*1*/load-on-startup* */servlet* There is no other default section in the web.xml. The whole web.xml is as follow: *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** *display-name*Welcome to Tomcat*/display-name* *description* Welcome to Tomcat */description* /!-- JSPC servlet mappings start --/ *servlet* *servlet-name*default*/servlet-name* *servlet-class* org.apache.catalina.servlets.DefaultServlet */servlet-class* *init-param* *param-name*debug*/param-name* *param-value*0*/param-value* */init-param* *init-param* *param-name*listings*/param-name* *param-value*true*/param-value* */init-param* *load-on-startup*1*/load-on-startup* */servlet* *servlet* *servlet-name*org.apache.jsp.index_jsp*/servlet-name* *servlet-class*org.apache.jsp.index_jsp*/servlet-class* */servlet* *servlet-mapping* *servlet-name*default*/servlet-name* *url-pattern*/*/url-pattern* */servlet-mapping* *servlet-mapping* *servlet-name*org.apache.jsp.index_jsp*/servlet-name* *url-pattern*/index.jsp*/url-pattern* */servlet-mapping* /!-- JSPC servlet mappings end --/ */web-app* Any idea why this webapp fail? Regards? Alan Chaney a écrit : One place to start might be in your web.xml file. About half way down you have a message saying Mar 10, 2006 2:03:42 PM org.apache.catalina.startup.ContextConfig applicationWebConfig SEVERE: Parse error in application web.xml java.lang.IllegalArgumentException: addChild: Child name 'default' is not unique at o And at the end you have at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409) Mar 10, 2006 2:03:42 PM org.apache.catalina.startup.ContextConfig applicationWebConfig SEVERE: Occurred at line 43 column 15 Mar 10, 2006 2:03:42 PM org.apache.catalina.startup.ContextConfig start SEVERE: Marking this application unavailable due to previous error(s) Does 'line 43 column 15' refer to something relevant in web.xml? Regards Alan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: error in tomcat
Content in webapp should take precedence on content of $CATALINA_HOME/conf/web.xml as stated in servlet specs about implicit mappings. At least that's how i understand the specs. The container is allowed to add it's own servlet and mapping but, except for implicit mappings defined in specs, they should not interfere with the webapp. Vinu Varghese a écrit : default is a valid servlet name, but it is already defined in $CATALINA_HOME/conf/web.xml. So we can't use that name in our web.xmls Just check the introduction section inside that file. :-) - Regards Vinu David Delbecq wrote: Yes, renaming this does solve the problem, but i can't see in servlet specs where it's stated 'default' is not a valid logical name for a servlet. Vinu Varghese a écrit : Just change the 'default' to something else like default.test , and check whether the error repeats David Delbecq wrote: Nope, downgrading to 2.3 servlet specs does not solve problem. foo shyn a écrit : Maybe u could try the this DOCTYPE tag instead !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; hope this helps F.S. - Original Message - From: David Delbecq [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Monday, March 13, 2006 4:48 PM Subject: Re: error in tomcat line 43 contains /servlet It corresponds to the following section: *servlet* *servlet-name*default*/servlet-name* *servlet-class* org.apache.catalina.servlets.DefaultServlet */servlet-class* *init-param* *param-name*debug*/param-name* *param-value*0*/param-value* */init-param* *init-param* *param-name*listings*/param-name* *param-value*true*/param-value* */init-param* *load-on-startup*1*/load-on-startup* */servlet* There is no other default section in the web.xml. The whole web.xml is as follow: *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** *display-name*Welcome to Tomcat*/display-name* *description* Welcome to Tomcat */description* /!-- JSPC servlet mappings start --/ *servlet* *servlet-name*default*/servlet-name* *servlet-class* org.apache.catalina.servlets.DefaultServlet */servlet-class* *init-param* *param-name*debug*/param-name* *param-value*0*/param-value* */init-param* *init-param* *param-name*listings*/param-name* *param-value*true*/param-value* */init-param* *load-on-startup*1*/load-on-startup* */servlet* *servlet* *servlet-name*org.apache.jsp.index_jsp*/servlet-name* *servlet-class*org.apache.jsp.index_jsp*/servlet-class* */servlet* *servlet-mapping* *servlet-name*default*/servlet-name* *url-pattern*/*/url-pattern* */servlet-mapping* *servlet-mapping* *servlet-name*org.apache.jsp.index_jsp*/servlet-name* *url-pattern*/index.jsp*/url-pattern* */servlet-mapping* /!-- JSPC servlet mappings end --/ */web-app* Any idea why this webapp fail? Regards? Alan Chaney a écrit : One place to start might be in your web.xml file. About half way down you have a message saying Mar 10, 2006 2:03:42 PM org.apache.catalina.startup.ContextConfig applicationWebConfig SEVERE: Parse error in application web.xml java.lang.IllegalArgumentException: addChild: Child name 'default' is not unique at o And at the end you have at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409) Mar 10, 2006 2:03:42 PM org.apache.catalina.startup.ContextConfig applicationWebConfig SEVERE: Occurred at line 43 column 15 Mar 10, 2006 2:03:42 PM org.apache.catalina.startup.ContextConfig start SEVERE: Marking this application unavailable due to previous error(s) Does 'line 43 column 15' refer to something relevant in web.xml? Regards Alan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED
Re: Fast response, using valves
Perhaps because, in the version without valve, you benchmarking tool use the expected behaviour of browsers when they have an active cache: request 'if-modified-since', to which tomcat will respond a 'not modified'. Rumata a écrit : Hello. I'm trying to make Tomcat server response to some kind of request as fast as possible. As far as I understood I can stop processing of request using a valve registered in the Engine pipeline. I wrote the following code: public class testValve extends org.apache.catalina.valves.ValveBase { public void invoke(Request request, Response response) throws IOException, ServletException { if (request.getRequestURI().equals(/testValve/hello_java)) { response.getOutputStream().print(htmlbodyHello All!brRumata/body/html); response.sendAcknowledgement(); response.finishResponse(); response.flushBuffer(); return; } getNext().invoke(request, response); } } and registered this valve in engine section. I also wrote a sample servlet with the same output. Now I'm trying to benchmark the whole thing and I get strange results: valve is slower than the servlet! Where I am mistaken? Thanks, Ilya. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: what is favicon.ico? what its significance?
It's image shown by browser next to site url and in title bar. Pusukuri, Kishore_Kumar a écrit : what is favicon.ico? what its significance? thanks, kishore - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Encoding and Operative System
When there is no clue on what the content encoding of a form is and no default value, most framework end-up using the platform default encoding (for debian system, it seems to be iso-8859-1). The problem is most browser do not send the content encoding along with the form, so the solution is generally to set the default encoding of your framework to UTF-8 (assuming the framework can do it). Another solution is to use a request filter that will do a 'request.setCharacterEncoding(UTF-8);' Morten Andersen a écrit : On my site the users edit pages using a multipart form. There are differences between the way the content is being decoded on the server depending on the OS. (My guess). The uploaded content is stored in XML files and must then later be displayed to the user. I have spent the weekend trying to get this to work on the Debian based production server. How does the OS effect the decoding / accepting of the submitted forms? I have the following servers: Tomcat 5.0.28 Development server: Windows Old server: FreeBSD New server: Debian (Can't accept UTF-8 form submits) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JNDIRealm why performing two queries against AD
Hi, I think users of this mailing list are more used to java stacktrace then ldap low level protocol :) the JNDIRealm is using the LDAP contextFactory in your case, i suggest you run tomcat in eclipse with breakpoints inside JNDIRealms, and do a step by step to locate which call you think is wrong with the realm, bu i suspect the context is simply getting informations about the user after the binding to get roles of user. Thomas Schwitter a écrit : Sorry I try it again with a better formatted mail. Hope for answers Hi there I authenticate my users against Active directory Windows 2003. This is the configuration: Realm name=TEST_Realm className=org.apache.catalina.realm.JNDIRealm debug=99 connectionName=CN=query,OU=Ressourcen,DC=xx,DC=xxx connectionPassword=xxx connectionURL=ldap://172.27.17.100:389; referrals=follow userBase=DC=xxx,DC=xxx userSubtree=true userSearch=sAMAccountName={0} userRoleName=memeberOf / It works. But when I take a look with Etherreal, I See the following: I would expect the communication to finish after frame 6. (After the bind with the User credentials) explain what happen in frame 7 to 10 ? Thx Frame 1 (113 bytes on wire, 113 bytes captured) Ethernet II, Src: 00:30:05:4e:31:1d, Dst: 00:03:47:9b:28:84 Internet Protocol, Src Addr: 172.27.20.69 (172.27.20.69), Dst Addr: 172.27.17.100 (172.27.17.100) Transmission Control Protocol, Src Port: 4400 (4400), Dst Port: ldap (389), Seq: 0, Ack: 0, Len: 59 Lightweight Directory Access Protocol, Bind Request Message Id: 5 Message Type: Bind Request (0x00) Message Length: 52 Response In: 2 Version: 3 DN: CN=query,OU=Ressourcen,DC=xxf,DC=xx Auth Type: Simple (0x00) Password: xxx Frame 2 (76 bytes on wire, 76 bytes captured) Ethernet II, Src: 00:03:47:9b:28:84, Dst: 00:30:05:4e:31:1d Internet Protocol, Src Addr: 172.27.17.100 (172.27.17.100), Dst Addr: 172.27.20.69 (172.27.20.69) Transmission Control Protocol, Src Port: ldap (389), Dst Port: 4400 (4400), Seq: 0, Ack: 59, Len: 22 Lightweight Directory Access Protocol, Bind Result Message Id: 5 Message Type: Bind Result (0x01) Message Length: 7 Response To: 1 Time: 0.001871000 seconds Result Code: Success (0x00) Matched DN: (null) Error Message: (null) Frame 3 (130 bytes on wire, 130 bytes captured) Ethernet II, Src: 00:30:05:4e:31:1d, Dst: 00:03:47:9b:28:84 Internet Protocol, Src Addr: 172.27.20.69 (172.27.20.69), Dst Addr: 172.27.17.100 (172.27.17.100) Transmission Control Protocol, Src Port: 4400 (4400), Dst Port: ldap (389), Seq: 59, Ack: 22, Len: 76 Lightweight Directory Access Protocol, Search Request Message Id: 6 Message Type: Search Request (0x03) Message Length: 69 Response In: 4 Base DN: DC=xx,DC=xx Scope: Subtree (0x02) Dereference: Always (0x03) Size Limit: 0 Time Limit: 0 Attributes Only: False Filter: (sAMAccountName=tschw) Attribute: memberOf Frame 4 (857 bytes on wire, 857 bytes captured) Ethernet II, Src: 00:03:47:9b:28:84, Dst: 00:30:05:4e:31:1d Internet Protocol, Src Addr: 172.27.17.100 (172.27.17.100), Dst Addr: 172.27.20.69 (172.27.20.69) Transmission Control Protocol, Src Port: ldap (389), Dst Port: 4400 (4400), Seq: 22, Ack: 135, Len: 803 Lightweight Directory Access Protocol, Search Entry Message Id: 6 Message Type: Search Entry (0x04) Message Length: 700 Response To: 3 Time: 0.001568000 seconds Distinguished Name: CN=xx,OU=User SHL,OU=xx,DC=xxDC=xx Attribute: memberOf Lightweight Directory Access Protocol, Search Result Reference Message Id: 6 Message Type: Search Result Reference (0x13) Message Length: 51 Response To: 3 Time: 0.001568000 seconds Reference URL: ldap://xx/CN=Configuration,DC=xx,DC=xx Lightweight Directory Access Protocol, Search Result Message Id: 6 Message Type: Search Result (0x05) Message Length: 7 Response To: 3 Time: 0.001568000 seconds Result Code: Success (0x00) Matched DN: (null) Error Message: (null) Frame 5 (138 bytes on wire, 138 bytes captured) Ethernet II, Src: 00:30:05:4e:31:1d, Dst: 00:03:47:9b:28:84 Internet Protocol, Src Addr: 172.27.20.69 (172.27.20.69), Dst Addr: 172.27.17.100 (172.27.17.100) Transmission Control Protocol, Src Port: 4400 (4400), Dst Port: ldap (389), eq: 135, Ack: 825, Len: 84 Lightweight Directory Access Protocol, Bind Request Message Id: 7 Message Type: Bind Request (0x00) Message Length: 77 Response In: 6 Version: 3 DN: CN=xx,OU=xx,OU=xxn,DC=xx,DC=xx Auth Type: Simple (0x00) Password: Frame 6 (76 bytes on wire, 76 bytes captured) Ethernet II, Src: 00:03:47:9b:28:84, Dst: 00:30:05:4e:31:1d Internet Protocol, Src Addr:
Re: how to get users from tomcat-users.xml
Configure memory-realm for you webapp (http://tomcat.apache.org/tomcat-5.5-doc/realm-howto.html#MemoryRealm) then configure authentification constraints in your web.xml. You have not need to access tomcat-users.xml if all you want to do is authentification. Srivani Ausula a écrit : Thank u very much for the reply. Before posting the query already I have surfed for relevant documentation, but I could not find any. Could u please point out me to some links where could I get help. Thanks. Srivani Ausula wrote: Hi, How can I get list of users from tomcat-users.xml? Is there any API provided for this purpose? Thanks in advance, A Srivani. You should use FORM based authentication and some web.xml entries for it. Read an appropriate text book or online documentation. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
error in tomcat
Hello, after a restart of tomcat we got this error. This is strange, we didn't have it before. Tomcat is configured with 2 virtual hosts, eahc has his own webapps directory. They share the root webapp (/), the manager (/manager) and the admin (/admin) For some unknown reasons, the root webapp in one of the vhosts has stopped working... This is the tomcat default root webapp (the one with nice tomcat logo) Can somebody gie any clues?? Here is logs: Mar 10, 2006 2:03:40 PM org.apache.catalina.core.StandardHost start INFO: XML validation disabled Mar 10, 2006 2:03:41 PM org.apache.tomcat.util.digester.Digester endElement SEVERE: End event threw exception java.lang.reflect.InvocationTargetException at sun.reflect.GeneratedMethodAccessor29.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.tomcat.util.IntrospectionUtils.callMethod1(IntrospectionUtils.java:890) at org.apache.tomcat.util.digester.SetNextRule.end(SetNextRule.java:192) at org.apache.tomcat.util.digester.Rule.end(Rule.java:228) at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1057) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1561) at org.apache.catalina.startup.ContextConfig.applicationWebConfig(ContextConfig.java:302) at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:959) at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:249) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4020) 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.deployDirectory(HostConfig.java:909) at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:872) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:474) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1106) 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:1019) at org.apache.catalina.core.StandardHost.start(StandardHost.java:718) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1011) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:440) at org.apache.catalina.core.StandardService.start(StandardService.java:450) at org.apache.catalina.core.StandardServer.start(StandardServer.java:683) at org.apache.catalina.startup.Catalina.start(Catalina.java:537) 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:324) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409) Caused by: java.lang.IllegalArgumentException: addChild: Child name 'default' is not unique at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:749) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739) at org.apache.catalina.core.StandardContext.addChild(StandardContext.java:1884) ... 43 more Mar 10, 2006 2:03:42 PM org.apache.catalina.startup.ContextConfig applicationWebConfig SEVERE: Parse error in application web.xml java.lang.IllegalArgumentException: addChild: Child name 'default' is not unique at org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:2719) at
Re: How can I set tomcat NOT Case Sensitive
Buddy wu a écrit : 2006/3/7, David Kerber [EMAIL PROTECTED]: Context caseSensitive=false thanks a lot. it worked. and I think someone discussed other problem of these question maybe right. but my goal is only to let tomcat's URL or URI (I don't kown which is wright, or all are write) case-insensitive. I don't care the case-sensitive feature in jsp or servlet file can work( maybe it MUST case-sensitive, because of java language, but I don't care about these. I just need URL is CASE-INSENSITIVE, And it will be ok to me) This only applies to ressource url, not servlet url, neither filters, nor security-constraint. and the security problem that someone has said, I think it may not be so important. If a hacker want to detect your site, I think he will test all posibles JSP Jsp jSP and others. That's not where security problem lies: Let's assume your public site is at http://yourserver/yourwebapp/index.jsp if casesensitiveness is deactivated and you are using a case sensitive filesystem (like the microsoft ones), accessing http://yourserver/yourwebapp/index.jsP will point to same filesystem ressouce, but with one exception, it will not be handled by jsp engine and requester will simply get the jsp source instead of generated html (a jsp source could contain potentially critical informations like database connection informations) More dangerous, suppose your application have an admin interface located at http://yourserver/yourwebapp/admin/ with a security-constraint in web.xml mapped to 'admin/*', any anonymous user can have his browser point at 'AdMiN/' and will have access to admin interface without authentification, bypassing securities! Of course it's not a problem if you don't have jsps, neither servlets, nor security constraints, that if you are serving static content. But then ,why using tomcat? but thanks again ,everyone Buddy wu wrote: 2006/3/7, Long [EMAIL PROTECTED]: Buddy wu wrote: I wan't to know there is any way to set tomcat NOT CASE SENSITIVE in URL I mean: when I write in browser's 'http://localhost/test.html' equals to 'http://localhost/TEST.htm'. Can I do it ? or just in WINDOWS can but Linux/unix can't? Right, url is case-insensitive under Windows because the file system But, the FACT is that under Windows the URL is CASW-SENSITIVE, not case-insecsitive , why? I've tried, under Windows, test.html and TEST.html is diffrent in tomcat server. Is there a parameter to set?? can't tell a difference between test.html and TEST.html. The difference is there under Linux/UNIX. Long - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How can I set tomcat NOT Case Sensitive
Hadraba Petr a écrit : Sorry, for my posting, but That's not where security problem lies: Let's assume your public site is at http://yourserver/yourwebapp/index.jsp if casesensitiveness is deactivated and you are using a case sensitive filesystem (like the microsoft ones), accessing NTFS, FAT -- mayby they are case sensitive, but the filesystem layer not. Try to create two files in one directory; one named a.txt and the second A.txt. The billboard ocures! On Unix systems is this possible -- Makefile is not makefile;-) Sorry for mistake, please read a case insensitive filesystem in my previous mail (2 letters were stuck in keyboard). - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [tomcat] : request.setCharacterEncoding (UTF-8) doesn't work ?
sol myr a écrit : Hi, I'm having a problem with HttpServletRequest.setCharacterEncoding(UTF-8). Basically, tomcat seems to ignore it completely, and assume latin1 encoding. request.setCharacterEncoding(UTF-8) must be called prior to any request.getParameter() call. If your code or any filter or any tomcat valve does a call to request.getParameter() or any other method that would trigger the decoding of parameter, the query is decoded with default character encoding (that is the one sent by browser or the one specified by tomcat connector or the platform default encoding, which ever is defined first). Here's the details: - I have an html form where user should type data in *Chinese*. - The browser (IE6) knows that the form data should be sent to the server, encoded as UTF-8 ( this encoding is mentioned in my content-type as well as in from accept-charset=UTF-8 ). That's the correct way. - I can actually see that the browser sends the data correctly (this is a GET, so I can see the encoding)... Does browser send a header with request encoding? - On the servlet size, I write: request.setCharacterEncoding(UTF-8); String p=request.getParameter(name); Unfortunatelly, this simply doesn't work. Tomcat reads the parameters as if they were latin1 ... I can extract them by forcefully converting back to utf-8, but it's ugly and not portable... I know you can configure tomcat's Connector to use utf-8, but I really don't want to do it ( client has a standard Tomcat installation, and I'm absolutely not allowed to touch it). Is there any reason why tomcat would ignore my request.setCharacterEncoding ? Am I doing something wrong, or is Tomcat just ignoring the j2ee spec in this point ? Thanks - Brings words and photos together (easily) with PhotoMail - it's free and works with Yahoo! Mail. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How can I set tomcat NOT Case Sensitive
Be careful, there are security issues with this (jsp code disclosure!)!! David Kerber a écrit : Context caseSensitive=false Buddy wu wrote: 2006/3/7, Long [EMAIL PROTECTED]: Buddy wu wrote: I wan't to know there is any way to set tomcat NOT CASE SENSITIVE in URL I mean: when I write in browser's 'http://localhost/test.html' equals to 'http://localhost/TEST.htm'. Can I do it ? or just in WINDOWS can but Linux/unix can't? Right, url is case-insensitive under Windows because the file system But, the FACT is that under Windows the URL is CASW-SENSITIVE, not case-insecsitive , why? I've tried, under Windows, test.html and TEST.html is diffrent in tomcat server. Is there a parameter to set?? can't tell a difference between test.html and TEST.html. The difference is there under Linux/UNIX. Long - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How can I set tomcat NOT Case Sensitive
I suspect a call to /something.JSP will not go thru the jsp engine. I can also guess that calls the security constraints applied on /servlet will not apply on /SERVLET David Kerber a écrit : I've seen that notice, but could you explain to me how that works? I don't see how this could cause any security issues, except for slightly reducing the number of attempts you would need in a brute-force hacking attempt. Dave David Delbecq wrote: Be careful, there are security issues with this (jsp code disclosure!)!! David Kerber a écrit : Context caseSensitive=false Buddy wu wrote: 2006/3/7, Long [EMAIL PROTECTED]: Buddy wu wrote: I wan't to know there is any way to set tomcat NOT CASE SENSITIVE in URL I mean: when I write in browser's 'http://localhost/test.html' equals to 'http://localhost/TEST.htm'. Can I do it ? or just in WINDOWS can but Linux/unix can't? Right, url is case-insensitive under Windows because the file system But, the FACT is that under Windows the URL is CASW-SENSITIVE, not case-insecsitive , why? I've tried, under Windows, test.html and TEST.html is diffrent in tomcat server. Is there a parameter to set?? can't tell a difference between test.html and TEST.html. The difference is there under Linux/UNIX. Long - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How can I set tomcat NOT Case Sensitive
Looking at code, it seems the casesensitive flag is used when a ressources is loaded from filesystem (amongst others). if casesensitive is true, the absolute filename of loaded ressource is compared to the requested ressource (in filedircontext). If casesensitive is removed, anything accepted by new file() is returned as is. I don't know if the casesensistive flag is used by anything else then file loading. David Kerber a écrit : If it works that way (and I haven't tried it), then I would say that the caseSensitive=false flag was not working as I would expect. I would expect that things defined for /MYNAME would work for /myname if caseSensitive was false. Can anybody tell me definitively how this security risk works? David Delbecq wrote: I suspect a call to /something.JSP will not go thru the jsp engine. I can also guess that calls the security constraints applied on /servlet will not apply on /SERVLET David Kerber a écrit : I've seen that notice, but could you explain to me how that works? I don't see how this could cause any security issues, except for slightly reducing the number of attempts you would need in a brute-force hacking attempt. Dave David Delbecq wrote: Be careful, there are security issues with this (jsp code disclosure!)!! David Kerber a écrit : Context caseSensitive=false Buddy wu wrote: 2006/3/7, Long [EMAIL PROTECTED]: Buddy wu wrote: I wan't to know there is any way to set tomcat NOT CASE SENSITIVE in URL I mean: when I write in browser's 'http://localhost/test.html' equals to 'http://localhost/TEST.htm'. Can I do it ? or just in WINDOWS can but Linux/unix can't? Right, url is case-insensitive under Windows because the file system But, the FACT is that under Windows the URL is CASW-SENSITIVE, not case-insecsitive , why? I've tried, under Windows, test.html and TEST.html is diffrent in tomcat server. Is there a parameter to set?? can't tell a difference between test.html and TEST.html. The difference is there under Linux/UNIX. Long - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How can I set tomcat NOT Case Sensitive
The compiler does exactly what his job is, compiling *.jsp, not *.Jsp not *.jSp or alike, following the specs. The casesensitive flag is there only to deactivate tomcat internal checks on case sensitive filesystems (where this check is just taking cpu time with no need). David Kerber a écrit : Ok, I see that, and it's kind of scary! That seems like a pretty poor design for the compiler not to handle that kind of change. Thanks for explaining... Dave Tim Lucia wrote: If you ask for /path/to/some.JSP, you will see the source code of the jsp, since the jsp compiler is mapped to *.jsp (and not *.JSP). Thus, someone can see the internal workings of your jsp and make 'better' hacking attempts. Is there something else about security you are concerned with? -Original Message- From: David Kerber [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 07, 2006 9:35 AM To: Tomcat Users List Subject: Re: How can I set tomcat NOT Case Sensitive Yes, that was me, and that's why I chimed in here. However, still nobody has explained in any detail how this is a security risk other than reducing the number of guesses you have to make to find static resources in a brute-force hacking attempt... Tim Lucia wrote: I am sure I have seen this before on this list, and the answer I remember is that the case sensitivity part is only for file names. Servlet mappings are case-sensitive regardless because the spec says so. Read this as well, although it says all case sensitivity checks will be disabled it doesn't define case sensitivity checks. http://tomcat.apache.org/tomcat-5.5-doc/config/context.html Read this too http://marc.theaimsgroup.com/?l=tomcat-userm=114002237714355w=2 (David Kerber started this one.) -Original Message- From: David Delbecq [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 07, 2006 9:04 AM To: Tomcat Users List Subject: Re: How can I set tomcat NOT Case Sensitive Looking at code, it seems the casesensitive flag is used when a ressources is loaded from filesystem (amongst others). if casesensitive is true, the absolute filename of loaded ressource is compared to the requested ressource (in filedircontext). If casesensitive is removed, anything accepted by new file() is returned as is. I don't know if the casesensistive flag is used by anything else then file loading. David Kerber a écrit : If it works that way (and I haven't tried it), then I would say that the caseSensitive=false flag was not working as I would expect. I would expect that things defined for /MYNAME would work for /myname if caseSensitive was false. Can anybody tell me definitively how this security risk works? David Delbecq wrote: I suspect a call to /something.JSP will not go thru the jsp engine. I can also guess that calls the security constraints applied on /servlet will not apply on /SERVLET David Kerber a écrit : I've seen that notice, but could you explain to me how that works? I don't see how this could cause any security issues, except for slightly reducing the number of attempts you would need in a brute-force hacking attempt. Dave David Delbecq wrote: Be careful, there are security issues with this (jsp code disclosure!)!! David Kerber a écrit : Context caseSensitive=false Buddy wu wrote: 2006/3/7, Long [EMAIL PROTECTED]: Buddy wu wrote: I wan't to know there is any way to set tomcat NOT CASE SENSITIVE in URL I mean: when I write in browser's 'http://localhost/test.html' equals to 'http://localhost/TEST.htm'. Can I do it ? or just in WINDOWS can but Linux/unix can't? Right, url is case-insensitive under Windows because the file system But, the FACT is that under Windows the URL is CASW-SENSITIVE, not case-insecsitive , why? I've tried, under Windows, test.html and TEST.html is diffrent in tomcat server. Is there a parameter to set?? can't tell a difference between test.html and TEST.html. The difference is there under Linux/UNIX. Long - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Can not look at the Tomcat server from another stations.
Hi, Check in server.xml if you have configured a RemoteAddrValve. This is this valve which could refuse remote connection based on ip. If there is no such valve configured, then tomcat should respond to your request, i suggest check firewalling configuration on server os. If there is such a valve then either remove it either configure it appropriately. regards, [EMAIL PROTECTED] a écrit : Hi all users. I have the next problem. I have installed and configured the Tomcat server, and have start it, so when I type the direction http://server:8080/ on the explorer, it shows me the initial page (index.jsp). When I try the same thing, where server is my IP address, from another station, I can not visualize this page, so I take the message that the page has not been found. I have been trying from other PCs, but always with the same result. How can I access to the this server from anywhere? I have to access the server in other way? Does anyone knows what I have to change to access the server? Any kind of help will be very appreciated. Thank you very much. Igor. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Quick question
Yes, use shared/lib, common/lib is for classes that need to be accessible by webapps and by catalina. see http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html for details David Kerber a écrit : I thought it was .../shared/lib... ? Alex Jalali wrote: You would have to add those to the ../WEB-INF/lib/ In this case for javax.mail.* you would need to downlaod the java mail API and put the mail.jar under that folder. Any package that you place in that folder will be added to your class path automaticly. (for that conetext) so there is no need to do anything else... If you have more then one context and need to have a package available for all of your webapps then you can place the .jar files in tomcat/common/lib/... Hi, apologies if this is an easy quesion but time is not on my side: 1. At my company we use Sun Application Server 8.1 for development and production. However, its not the lightest, fastest software in the world and I'm thinking about switching to Tomcat for development and later in the development cycle back to Sun. Is it possible? I tried to deploy my war but i got errors about missing classes. these classes are part of the EE Java. For example javax.mail.*. Is that the diffrence between Tomcat and Sun? Or is it an easy fix? I don't use any enterprise features like EJBs or JMS. Thanks R - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problems Starting Tomcat
Are you sure there are not other error message before? This error means you can't start the userdatabase realm because the realm doesn't find it's datasource (named 'UserDatabase') . Eaither you didn't configure the datasource your userdatabase realm has to use, either it is configured but not started (could it be during the move you 'lost' the database drivers and so the datasource can't start?) regards C Rose a écrit : Hi all I'm having problems starting Tomcat after my home account (in which Tomcat is installed) was moved from one server to another. The most visible thing that has changed is that my home directory now has a different path. Before the move, my installation of Tomcat worked fine. Now it won't start (not quite true, see below). I have searched for references to the old home directory path (only in files such as conf/Catalina/localhost/my-web-app.xml) and modified them accordingly, but this doesn't fix the problem. I have modified my JAVA_HOME and CATALINA_HOME environment variables to point to the correct directories. They are correctly reported when I run startup.sh and shutdown.sh. To be more precise, Tomcat does seem to start, but doesn't seem to respond to any HTTP requests. The error that is reported in the logs is given at the end of this email, but Google hasn't been able to help me shed any light on this. The error makes reference to 'UserDatabase', but I've never touched such a thing; grepping for it in the Tomcat directory shows that it's used all over the place, but nowhere that I've been playing. Suggestions are very welcome. Chris Error in the catalina.out log: SEVERE: Catalina.start: LifecycleException: No UserDatabase component found under key UserDatabase at org.apache.catalina.realm.UserDatabaseRealm.start(UserDatabaseRealm.java:259) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1075) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478) at org.apache.catalina.core.StandardService.start(StandardService.java:476) at org.apache.catalina.core.StandardServer.start(StandardServer.java:2298) at org.apache.catalina.startup.Catalina.start(Catalina.java:556) 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:324) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:284) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:422) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: WHY TOMCAT MEMORY FROM 1G TO 15M IN 10 MINUTES
JAVA_OPTS='-Xms256m -Xmx256m' -- your tomcat memory should never reach 1G with this parameter! the tomcat memory drops severly from 1G to 15M -- do you mean tomcat memory usage or tomcat free memory? jiang ying a écrit : Hi. When I run the TPCW bookstore application, I found the server behave erratic. Experiment enviroment: Hardware: a client PC, two server PCs. Each PC has two 1.59 GHz AMD Opteron, 2GB RAM, and a 30 GB disk. One server machine runs theWeb server and application server software, while the other contains the database. All the machines run 2.4 Linux Kernel and are connected through a LAN of 1000Mb/s. Web Server: Tomcat 5.5.12 Database: mysql 5.0.18 Client Workload Generator: the freely available Java TPC-W implementation developed by the PHARM research group at the University of Wisconsin-Madison http://www.ece.wisc.edu/~pharm/tpcw.shtml The file descriptor limit has been increased to 8192. The maxconnection of Tomcat is 1000. To solve the heap exception of Tomcat, JAVA_OPTS='-Xms256m -Xmx256m' is set. Q1: When I emulate 100 EBs ( the command line: java rbe.RBE -EB rbe.EBTPCW1Factory 400 -OUT run1.m -RU 100 -MI 600 -RD 100 -WWW http://tomcatserver:8080/ -CUST 288000 -DEBUG 2) , the tomcat memory drops severly from 1G to 15M. Could anyone kindly tell me why the tomcat cosumes so much memory? Thank you. yours cylinder _ 与联机的朋友进行交流,请使用 MSN Messenger: http://messenger.msn.com/cn - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat serving wrong content
Should not happen. Could you provide example jsp? M. Schot a écrit : Hi All, I have sent this question a few weeks ago, but got no replies. So lets try again. The problem is that when I request a JSP from Tomcat 5.0.28 which includes stylesheets and images, also served from the same instance, Tomcat sends the wrong content with the right URL. Let's say two images get requested because of img tags in the JSP page. image1.gif and image2.gif. It does not occur every time, but frequent that image1.gif contains exactly the same content as image2.gif but on the server the content is different. Can anybody help. If you need more information please let me know. Kind regards, Marcel Schot - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Multiple webapps using one war file
While it is possible to put some of the librarie out of .war, inside common, you must be aware of side effects. Libraries like struts are not designed to run multiple context within a given classloader (The servelt, for example, can only be instanciated once). I don't know for Hibernate and for etc :) Also, you could take a look at .ear if you need to play with a common part and multiple .war. But tomcat does not deploy .ear, you must use a full featured J2EE container for this. Mikolaj Rydzewski a écrit : Hello, I've got rather complex web application (struts, hibernate, etc) which runs on Tomcat. There is a need to deploy this webapp for various customers. The only difference between them is the database they connect to, well, almost the only one ;-) Is there any way to reuse one war file and map it to several contexts? I could give application's parameters (like jndi connection uri ) within context.xml descriptor. Every deploy takes several MB of memory, and it's a waste to have hibernate and required jars five times in memory. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: I got an error on import org.apache.xpath recompiling with Tomcat5 and JDK5
You are missing the xalan jars: http://www.ibiblio.org/maven/xalan/jars/ btw, you should not have your compilation depends on any tomcat lib, unless you are building specific tomcat extensions (like realms) Wentink, Marc a écrit : Dear Group, Which jars am I missing, and were can I find them when I got an error on import org.apache.xpath? I am trying to move from jdk1.4 and Tomcat4, to jdk5 and Tomcat5 I have installed Tomcat Core version: apache-tomcat-5.5.15.zip I have changed my CLASSPATH to: C:\Program Files\apache-tomcat-5.5.15\common\lib\servlet-api.jar; My common lib contains: C:\Program Files\apache-tomcat-5.5.15\common\libls commons-el.jar jasper-runtime.jar naming-factory.jar jasper-compiler-jdt.jar jsp-api.jar naming-resources.jar jasper-compiler.jar naming-factory-dbcp.jar servlet-api.jar Recompiling my java source containing a servlet gives me the following error: [javac] E:\cvs\projecten\java\pdfgen\src\net\antonius\pdfgen\Rule.java:3: package org.apache.xpath does not exist [javac] import org.apache.xpath.*; I did not have the error with Tomcat4, JDK1.4 and a classpath including servlet.jar from Tomcat4. Should I have installed another distribution of Tomcat5.5 ? One containing the jars I am missing? Kind Regards, and my appriciation in advance, Marc Wentink - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JAAS : HTTP 400 Invalid direct reference to form login ... (JAAS + Filter + j_security_check)
Login module should return false if not authenticated. If you need to store messages for the user, i'll suggest you pass them another way (like by using a ThreadLocal pattern) Vincent Delhommois a écrit : Hello, I implements a solution with JAAS and userfilter on Tomcat. the loginmodule return always 'true' eventhough the password is wrong. I do that to be able to return detail error messages to the login.jsp. (I use the role principal to display messages). The filter is used to dispatch to the application pages or back to the login.jsp page if the authentification failed. The error : Etat HTTP 400 - Référence directe à la form de connexion (form login page) invalide OR HTTP 400 : Invalid direct reference to form login ... is displayed when I first logon with a wrong password and then I relog with the correct password. It seems I didnot invalidate correctly the jaas or the session after the failure. Do you have any idea ? Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JAAS : HTTP 400 Invalid direct reference to form login ... (JAAS + Filter + j_security_check)
The most basic way i see is to have a class with 3 static methods and one static field:: setMessage(), getMessage(), clearMessage() private static ThreadLocal message = new ThreadLocal; ... message.set(theMessage); ... return (String)message.get(); your jaas would do a setMessage() and your error.jsp wouold do a getMessage() be carefull, this class must be visible to both you jaas and your webapp Vincent Delhommois a écrit : Thanks for the answer. You are right, I will check this solution with the ThreadLocal pattern (i don't know at all). I used the filter and the loginModule returns always 'true' beacuse it's not easy to pass some messages 'wrong password', 'validity perdio expired', etc... to the login.jsp in case of a wrong authentification. Thanks PS : Do you have any example of a solution with threadlocal ? Message du 23/02/06 à 10h19 De : David Delbecq A : Tomcat Users List Copie à : Objet : Re: JAAS : HTTP 400 Invalid direct reference to form login ... (JAAS + Filter + j_security_check) Login module should return false if not authenticated. If you need to store messages for the user, i'll suggest you pass them another way (like by using a ThreadLocal pattern) Vincent Delhommois a écrit : Hello, I implements a solution with JAAS and userfilter on Tomcat. the loginmodule return always 'true' eventhough the password is wrong. I do that to be able to return detail error messages to the login.jsp. (I use the role principal to display messages). The filter is used to dispatch to the application pages or back to the login.jsp page if the authentification failed. The error : Etat HTTP 400 - Référence directe à la form de connexion (form login page) invalide OR HTTP 400 : Invalid direct reference to form login ... is displayed when I first logon with a wrong password and then I relog with the correct password. It seems I didnot invalidate correctly the jaas or the session after the failure. Do you have any idea ? Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Changing content of response on canceled basic authentication
put your response.setHeader(WWW-Authenticate,Basic realm=\MySystem\); insode your error page instead of authentification servlet. (I guess sendError() clear all headers) Oliver Schoenwald a écrit : Hello fellow tomcat users, I'm running Tomcat 5.5.4 with Apache 2.0.54 and mod_jk. The system uses basic authentication to serve certain pages for authenticated users. One of my users said that if he enters my system and is being asked to authenticate via that popup-windows, he sometimes hits the cancel-button of that popup-window. After that he his shown a page that seems to be generated from tomcat: HTTP Status 401 - unauthorized *type* Status report *message* _unauthorized_ *description* _This request requires HTTP authentication (unauthorized)._ Apache Tomcat/5.5.7 The users said (and I concur) that this page is not only too technical, but it doesn't contain any informations for users that have forgotten their passwords or have to apply for their own account. Recently I tried out to set the error-page in web.xml for response-code 401 to show a certain page with infos about forgotten passwords and how to apply for a new account, but after I restarted the server noone was able to login any longer. Whenever someone tried to open one page that required authentication, the defined error-page for error 401 was shown and no authentication request was passed to the client. Here some internas about my application: My web application is handling authentication internally, meaning I don't use an authentication realm in web.xml. A central Controller-Servlet (the one and only servlet of the whole web application, viva MVC) decides when a certain request requires authentication. When the requires credentials are not already part of the request, the Controller-Servlet sends the following as response using the Servlet-API: response.setHeader(WWW-Authenticate,Basic realm=\MySystem\); response.sendError(401,unauthorized); Note: response is the HttpServletResponse-Object. When no error-page for error 401 is defined in web.xml that works properly. Here my questions: Can I configure tomcat properly without changing its code to send another authentication required-page instead of the defaut error-content? Thank you in advance, Oliver Schönwald Germany - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Use the tomcat authentification mecanisms in a webapp
Hello, I probably will have the following webapp structure to configure - webapp X manage authentification all by itself (using forms and so on) but provide a way to configure your own credential using a quite basic checkPassword(user,pass) interface. - Tomcat is able to authenticate all my users for now (connecting to a ldap-like JNDI structure) Is there a way from the webapp to call tomcat api and have it check a user/password according to configured realm? Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Use the tomcat authentification mecanisms in a webapp
Hello Poornachandran, as i said webapp X manage authentification all by itself (basically using it's own providers, so there is now security constraint and so on in the web.xml, webapp does not use container managed security, and i have no control over this, closed source webapp), but it provides an extension mecanism (implement a given interface). I'd like to implement a simple class that just do something like tomcatContainer.checkCredentials(user,userprovidedpass), which will check those credentials against configured realm. Or, if i have no other choice, will instanciate the realm, configure it and use it. (I just hope don't need to do that, this sound awfull). So, obviously, in webapp, a request.getUserPrincipal() will always return null. Poornachandran a écrit : Hi David, I am just wondering after your app authenticates, are you able to get not-null from request.getUserPrincipal(). I understand this is how the container understands that user is logged on or not. Poorna David Delbecq wrote: Hello, I probably will have the following webapp structure to configure - webapp X manage authentification all by itself (using forms and so on) but provide a way to configure your own credential using a quite basic checkPassword(user,pass) interface. - Tomcat is able to authenticate all my users for now (connecting to a ldap-like JNDI structure) Is there a way from the webapp to call tomcat api and have it check a user/password according to configured realm? Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: time/date stamp differences
You mean the .jsps do not get recompiled after redeploy? What procedure do you follow to rollback? Do you do a 'undeploy/redeploy process'? I think doing a undeploy should remove the associated work directory, where tomcat store all generated jsp source / jsp .class Hall, Scott a écrit : Hello Tomcat Users, We have currently begun the migration from 5.5.7 to 5.5.15 in my shop. All has been going smoothly except for one quirk that we don't seem to understand. I apologize if this has been covered in some form, but I've spent a good portion of the past two days looking for an answer and haven't see any mention. The problem is that the way times/dates of exploded WAR files are handled between 5.5.7 and 5.5.15. If I take two similarly configured Tomcat installations, one 5.5.7 and one 5.5.15 and deploy identical WAR files to it, I get two diffent results. In the 5.5.7 installation all the files exploded from the WAR in the webapps directory have the time/date stamp of when it was exploded. In the 5.5.15 installation, all the files exploded in the webapps directory have the original time date stamps contained inside the WAR. In a perfect world this wouldn't be much of a problem, but it does present an issue in our shop where it is not uncommon to have to 'roll-back' to a previous version of a WAR. Under 5.5.7 this is not a problem since the redeployed old file has a newer time/date stamp, but under 5.5.15 it's a little trickier since it won't recompile files with older time stamps. This probably wouldn't be a problem if Tomcat would recompile files with ANY timestamp change to them as opposed to the method in which it currently works. Has anyone else noticed this issue? What am I doing wrong? Thanks very much in advance, Scott Hall The content of this e-mail message and any attachments are confidential and may be legally privileged, intended solely for the addressee. If you are not the intended recipient, be advised that any use, dissemination, distribution, or copying of this e-mail is strictly prohibited. If you receive this message in error, please notify the sender immediately by reply email and destroy the message and its attachments. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Where does Tomcat expect me to put my class file, or jar file?
Once again, you must map you servlet in your web.xml Marc Wentink a écrit : Where does Tomcat expect me to put my class file, or jar file? Is it sufficient to put the servlet class in WEB-INF classes or must you install a war file? I actually tried to put HelloIZ.class in a what seemed to me a logical place: C:\Program Files\Apache Group\Tomcat 4.1\webapps\HelloIZExample\WEB-INF\classes But the servlet won't start up, though it gives another error, or message. It shows a html page containing: Directory Listing For / Filename Size Last Modified Apache Tomcat/4/1/31 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Where does Tomcat expect me to put my class file, or jar file?
Marc Wentink a écrit : Ok, it seems to work putting the class in C:\Program Files\Apache Group\Tomcat 4.1\shared The servlet now starts up. \shared is, after reading the docs the general place for classes used by all apps. I won't recommand putting classes in /share unless really needed (shared libs poses problems when different web applications requires different version of a shared library and according to tomcat4 classloader how-to the instance are already shared, so you can get side effects from one webapp to the other). If you servlet works when the class is in /shared then it should work exactly the same if class is in WEB-INF/lib of your webapp It got me further, sorry to bother you guys so much, this it the idea of my managers: I should turn a java program into a servlet and run it in Tomcat. The idea is this repeatedly called java program would work more efficiently as a servlet in Tomcat. The java program stops and starts the Virtual Machine all the time, a servlet in Tomcat should not. The Java program is written with JDK 1.42 hence I believe I should use Tomcat 4.1 Tomcat 5.5 works also on jdk 1.4 (just add the compatibility package as stated in doc) Keep in mind j2ee application have strongly different design then J2se applications! Has big priority since the performance of our Intranet site is so low it going to all kinds of political high ohmens here. So I am under pressure to do this fast, and try to read the docs real quickly, but I do not always succeed. So my apoligies. But any help appreciated. Mmm your intraner is instanciating java application which return html results? Clearly the job of a servlet ;) But if you comme from j2se environment, you might need to grab a few courses on web-tiers, jsp and so on before messing around! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: auth-constraint in web.xml in tomcat 5.5.15
I was hoping to get something else. Sure our sysadmin will enjoy to put 600 usernames in one line of /etc/groups (assuming HP-UX and NFS allows it)... Mark Thomas a écrit : David Delbecq wrote: *outch* This mean i will have to change my web.xml with future tomcat version. How do I allow access to a ressource to all authenticated users now? Create a global role. Assign all users to that role. Use the global role rather than *. Mark - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to install a simple servlet in Tomcat?
You must put the class in a .jar itself located in the WEB-INF/lib folder of a .war or you must put the class in WEB-INF/classes of a .war You must also setup your servlet un WEB-INF/web.xml Then you must deploy you .war in tomcat (the easiest way is to use the manager: http://tomcat.apache.org/tomcat-5.5-doc/manager-howto.html) If you don't know what web.xml and what a .war are, i suggest you take a look at http://java.sun.com/j2ee/tutorial/1_3-fcs/index.html section about web technology. Regards Marc Wentink a écrit : My excuses for such a simple question, but the archives are not = searchable and the documentation not very clear. Or may-be I am just a = terrible newbee. Say I have a class file that contains a servlet, should not I do = something so that tomcat becomes the container of this servlet, and a = client browser could call the servlet? I expected to find some install = class file that contains the servlet so Tomcat becomes it container = option somewhere in the management part of Tomcat, but I am lost. These are my files: HelloIZ.java: import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class HelloIZ extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse = response) throws IOException, ServletException { response.setContentType(text/html); PrintWriter out =3D response.getWriter(); out.println(html); out.println(head); out.println(titleHallo IntraZis!/title); out.println(/head); out.println(body); out.println(h1Hallo IntraZis!/h1); out.println(/body); out.println(/html); } } I have got the class file after setting my classpath to servlet.jar and = using javac. And I thought I had to make some html to call the servlet: StartServlet.html html head titleHello Hospital!/title /head body a href=3D./HelloIZExamplego/a /body=09 /html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: password protection
Zohar Amir a écrit : Hello, I'm using tomcat 5.5.15 on Win XP. I have a servlet that is deployed on a certain context. I would like anyone trying to use that servlet use a username-password. how do I do this? set a security-constrain in WEB-INF/web.xml What if I need to protect a jsp that is part of the servlet? You mean to prevent direct loading of a jsp included by your servlet? Same thing, add a security-constraint to the url of your jsp. Thanks, Zohar. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: password protection
http://www.onjava.com/pub/a/onjava/2001/07/24/tomcat.html http://www.cafesoft.com/products/cams/tomcat-security.html for other ones, use favorite search engine. Zohar Amir a écrit : Thanks, Where can I find info on how exactly to do this? maybe an example...? - Original Message - From: David Delbecq [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Wednesday, February 15, 2006 2:52 PM Subject: Re: password protection Zohar Amir a écrit : Hello, I'm using tomcat 5.5.15 on Win XP. I have a servlet that is deployed on a certain context. I would like anyone trying to use that servlet use a username-password. how do I do this? set a security-constrain in WEB-INF/web.xml What if I need to protect a jsp that is part of the servlet? You mean to prevent direct loading of a jsp included by your servlet? Same thing, add a security-constraint to the url of your jsp. Thanks, Zohar. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: password protection
Zohar Amir a écrit : Thank you again, I've set a security-constraint on the context (in the web.xml), and it works OK now. What I'd like to know is: 1. Can I do it anywhere else other than the web.xml, so that the deployer can control this and not the developer? No, but on some webapplication container there is the possibility to map from application roles to real roles (eg, the 'admin' role of app XYZ is in fact the role PublicationManager). But am not sure tomcat handles this. 2. Can I set it for a group of contexts, so that they will all be able to use request.getPricipal() and have the user name that logged in? When authenticated, request.getPrincipal() returns the authenticated principal - Original Message - From: David Delbecq [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Wednesday, February 15, 2006 3:05 PM Subject: Re: password protection http://www.onjava.com/pub/a/onjava/2001/07/24/tomcat.html http://www.cafesoft.com/products/cams/tomcat-security.html for other ones, use favorite search engine. Zohar Amir a écrit : Thanks, Where can I find info on how exactly to do this? maybe an example...? - Original Message - From: David Delbecq [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Wednesday, February 15, 2006 2:52 PM Subject: Re: password protection Zohar Amir a écrit : Hello, I'm using tomcat 5.5.15 on Win XP. I have a servlet that is deployed on a certain context. I would like anyone trying to use that servlet use a username-password. how do I do this? set a security-constrain in WEB-INF/web.xml What if I need to protect a jsp that is part of the servlet? You mean to prevent direct loading of a jsp included by your servlet? Same thing, add a security-constraint to the url of your jsp. Thanks, Zohar. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: webapp under different URLs with different JSP but same java classes
Duplicate your classes, one copy in each webapp Lothar Krenzien a écrit : Hi, I'm not sure whether it is possible or not: I have a webapp which I want to access under different URL's with different JSP's but the same java classes. I know that I can define the context URL in the context.xml But how to define which jsp's to use ? Example : Context path=/a docBase=/myapp /Context Context path=/b docBase=/myapp /Context In myapp I may have a folder jsp_a and jsp_b. Path 'a' should use JSPs from jsp_a and path 'b' should JSPs from jsp_b. Of course I can set up two different webapps. But the java classes and so the the content of the WEB-INF/classes directory will be identically for both webapps. I'm using Tomcat 5.5 under Windows 2003. Thanks, Lothar __ Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Help me
your commons-fileupload.jar should go in your webapp's WEB-INF/lib directory Mir Kasim Ali a écrit : The problem was for package called org.apache.common.fileupload but when I put the jar file for above package in the C:\Program Files\Apache Software Foundation\Tomcat 5.5\common\lib directory still it causes differnet error.The error now is... root cause javax.servlet.ServletException: org/apache/commons/io/output/DeferredFileOutputStream org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:858) org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791) org.apache.jsp.ProcessFileUpload_jsp._jspService(org.apache.jsp.ProcessFileUpload_jsp:93) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: auth-constraint in web.xml in tomcat 5.5.15
*outch* This mean i will have to change my web.xml with future tomcat version. How do I allow access to a ressource to all authenticated users now? Mark Thomas a écrit : Oliver Kohll wrote: Hi, I have security for a web application managed by a DataSource database realm. Using tomcat 5.5.14 this works fine but in 5.5.15 there seems to be a problem. The problem seems to be the role-name*/role-name line. If I put a specific role in, users in that role can log in but the * wildcard doesn't work. A 403 HTTP rejection is issued if the user inputs a correct username and password (if they put in the wrong username/ password, it prompts again as expected). As users themselves can add roles to the database, I don't know what the roles may be so I have to use the wildcard. The special role * means all roles specified in web.xml. It does not mean all roles specified in the realm nor does it mean all authenticated users. The fix for 15570 was to correctly handle *. It used to be interpreted as all authenticated users. It is now correctly interpreted as all roles defined in web.xml. Mark - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Two DNS Entries Two Sites?
If it's 2 names, one IP, one server, you can simply have tomcat do virtual hosting. We did it here like that: Create 2 host Give each host a list of alias corresponding to the server the will act on Give each host a different Application Base (like webapps-hostX and webapps-hostY) this will prevent webapplication in one host to be visible in the other host Ensure the manager webapp is present in both Apllication Base (unless you don't need the manager webapp of course) Optionnally define a default host in Catalina engine properties. That's all, tomcat will redirect http requests to the correct virtual host. Scott Purcell a écrit : Hello, Running Tomcat 5.5 @ home and running a website which has a DNS entry in it. I made the site the default webapp, and configured it in the server.xml. A week ago, I created another context (in the server.xml) for a dev-site, of my live site, and I am using that for QA. I want to run a second real-web site off this box, and same Tomcat. It has its own DNS entry, and want to know if this is doable? If so, what should I read about as far as configuration. I had read about the Engine, Server, Context but have not really seen how to put two site DNS entries in. Thanks, Scott - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat and client certificates
Markus a écrit : Ok, when I set clientAuth to want the Exception getting SSL Cert goes away. (Wtf is this documented?). Yes it is documented: http://tomcat.apache.org/tomcat-5.5-doc/ssl-howto.html Section 'Edit the Tomcat Configuration File' But I still get the 403 - Access denied error. This mean client didn't send a certificate or certificate was not recognized Here is how I added the users certificate to my realm: web.xml: security-constraint web-resource-collection url-pattern/html/*/url-pattern http-methodPOST/http-method http-methodGET/http-method /web-resource-collection auth-constraint role-namemyrole/role-name /auth-constraint user-data-constraint/ /security-constraint login-config auth-methodCLIENT-CERT/auth-method /login-config security-role role-namemyrole/role-name /security-role tomcat-users.xml: tomcat-users role rolename=myrole/ user username=EMAILADDRESS=mark... , CN=markus, OU=..., O=... , L=, ST=... C=... password= roles=myrole/ /tomcat-users As username I used exactly the cert.getSubjectDN().getName() String from the client certificate. Is this ok? Did you escape the quote character of subject line using quot; ? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem in j_security_check
This mean you tried to access login form directly. This is not allowed in j2ee specifications. Access to login form should only be triggered by server on demand. You can't force a login. To access login page, simply put a link to saraf/index.html (simple example) Prashant Saraf a écrit : i have a problem in Tomcat jsp when i use j_security_check it gives me following error. The request sent by the client was syntactically incorrect (Invalid direct reference to form login page why this so my web.xml ?xml version=3D 1.0 encoding=3DISO-8859-1? web-app xmlns=3Dhttp://java.sun.com/xml/ns/j2ee xmlns:xsi=3Dhttp://www.w3.org/2001/XMLSchema-instance xsi:schemaLocation=3Dhttp://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd version=3D 2.4 description My first jsp example /description display-nameWork on Jsp/display-name security-constraint display-nameTestApp Security Constraint/display-name web-resource-collection web-resource-nameProtected Area/web-resource-name !-- Define the context-relative URL(s) to be protected -- !-- If you list http methods, only those methods are protecte= d -- http-methodDELETE/http-method http-methodGET/http-method http-methodPOST/http-method http-methodPUT/http-method url-pattern/saraf/*/url-pattern /web-resource-collection auth-constraint !-- Anyone with one of the listed roles may access this area -- role-name*/role-name /auth-constraint /security-constraint !-- Default login configuration uses form-based authentication -- login-config auth-methodFORM/auth-method realm-nameForm-Based Authentication/realm-name form-login-config form-login-page/login.jsp/form-login-page form-error-page/error.jsp/form-error-page /form-login-config /login-config !-- Security roles referenced by this web application -- /web-app -- Cup of Java + Suger of XML = Secure WebApp - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem in j_security_check
Once again, login form can only be accessed on demand by server. This mean access to you login.jsp will only occur as a result of a jsp forward internal to server at the first time you enter a secure area. You can't either access j_security_check either login.jsp directly. The required data in server would not be setup and you'll only trigger an exception. Prashant Saraf a écrit : i created a link which connect to login.jsp then also it not works:( On 2/3/06, David Delbecq [EMAIL PROTECTED] wrote: This mean you tried to access login form directly. This is not allowed in j2ee specifications. Access to login form should only be triggered by server on demand. You can't force a login. To access login page, simply put a link to saraf/index.html (simple example) Prashant Saraf a écrit : i have a problem in Tomcat jsp when i use j_security_check it gives me following error. The request sent by the client was syntactically incorrect (Invalid direct reference to form login page why this so my web.xml ?xml version=3D 1.0 encoding=3DISO-8859-1? web-app xmlns=3Dhttp://java.sun.com/xml/ns/j2ee xmlns:xsi=3Dhttp://www.w3.org/2001/XMLSchema-instance xsi:schemaLocation=3Dhttp://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd version=3D 2.4 description My first jsp example /description display-nameWork on Jsp/display-name security-constraint display-nameTestApp Security Constraint/display-name web-resource-collection web-resource-nameProtected Area/web-resource-name !-- Define the context-relative URL(s) to be protected -- !-- If you list http methods, only those methods are protecte= d -- http-methodDELETE/http-method http-methodGET/http-method http-methodPOST/http-method http-methodPUT/http-method url-pattern/saraf/*/url-pattern /web-resource-collection auth-constraint !-- Anyone with one of the listed roles may access this area -- role-name*/role-name /auth-constraint /security-constraint !-- Default login configuration uses form-based authentication -- login-config auth-methodFORM/auth-method realm-nameForm-Based Authentication/realm-name form-login-config form-login-page/login.jsp/form-login-page form-error-page/error.jsp/form-error-page /form-login-config /login-config !-- Security roles referenced by this web application -- /web-app -- Cup of Java + Suger of XML = Secure WebApp - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Cup of Java + Suger of XML = Secure WebApp - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem in j_security_check
form method=POST action='%= response.encodeURL(j_security_check) %' -- that's the error put this instead form method=POST action='j_security_check' Prashant Saraf a écrit : as i am new i refer tomcat 's jsp-example my structure of webapp webapps-| | saraf | index.html(which link to login.jsp) | protected | login.jsp,error.jsp,index.jsp. my login.jsp html head titleLogin Page for Examples/title body bgcolor=white form method=POST action='%= response.encodeURL(j_security_check) %' table border=0 cellspacing=5 tr th align=rightUsername:/th td align=leftinput type=text name=j_username/td /tr tr th align=rightPassword:/th td align=leftinput type=password name=j_password/td /tr tr td align=rightinput type=submit value=Log In/td td align=leftinput type=reset/td /tr /table /form /body /html - error.jsp -- html head titleError Page For Examples/title /head body bgcolor=white Invalid username and/or password, please try a href='%= response.encodeURL(login.jsp) %'again/a. /body /html -- index.jsp % if (request.getParameter(logoff) != null) { session.invalidate(); response.sendRedirect(index.jsp); return; } % html head titleProtected Page for Examples/title /head body bgcolor=white You are logged in as remote user b%= request.getRemoteUser() %/b in session b%= session.getId() %/bbrbr br If you have configured this app for form-based authentication, you can log off by clicking a href='%= response.encodeURL(index.jsp?logoff=true) %'here/a. This should cause you to be returned to the logon page after the redirect that is performed. /body /html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem in j_security_check
Everything that correspond to the security-constraint on your web.xml is 'protected' and need authentification. When you are authenticated, field request.getRemoteUser() is not null anymore. Be carefull, url-pattern/saraf/*/url-pattern in security constraint mean the secure area is http://server/saraf/saraf/* If your secure area is http://server/saraf/protected/* then the url pattern is /protected/* Prashant Saraf a écrit : i think problem should be web.xml but still it gives following problem 1)You are logged in as remote user *null* in session * 2AD5AC97008551CE1EDD510E06AE6E1F *WHICH SHOULD NOT* * 2)how should tomcat know that protected is protected - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: percent sign in URI
Hello abdurrahman, Your url is incorrect, replace it with http://localhost:8080/aSite/aPage?query=hi%25everybody According to rfc 1738, 2.2. URL Character Encoding Issues Octets must be encoded ..., if the use of the corresponding character is unsafe, ... The character % is unsafe because it is used for encodings of other characters. Thus, only alphanumerics, the special characters $-_.+!*'(),, and reserved characters used for their reserved purposes may be used unencoded within a URL. There is no details in RFC on how to handle badly shaped urls (like % not followed by 2 hex digits) and thus your urls should not rely upon this. Regards. abdurrahman sahin a écrit : I realized apache2 web server properyl handles % sign in URIs, i need = exact functionality on tomcat 5 too. When I try to pass a parameter containing % sign, the parameter value on = the server seems null. like http://localhost:8080/aSite/aPage?query=hi%everybody Tomcat 5 cannot handle that, Is there a way to do it with tomcat 5. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: percent sign in URI
How does your customer system handle this? http://localhost:8080/aSite/aPage?query=I%fear%dead%results badly, obviously :) Possible solutions: 1) You can still try in servlet 'aPage' to grab the request using request.getQueryString() which should returns you query=hi%everybody 2) You can write a servlet filter for /* which will create a new HttpServletRequest Object with parameters you parse in your way from the getQueryString() above 3) You can open tomcat source, patch the url decoder, and use it What ever solution is choosen, customer will be bound to a side effect of error handling in server. abdurrahman sahin a écrit : hi David; I am aware of the case. As I stated before Apache2 server properly handles that problem and I need that functionality because our customer's system built on it. -Original Message- From: David Delbecq [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 01, 2006 11:58 AM To: Tomcat Users List Subject: Re: percent sign in URI Hello abdurrahman, Your url is incorrect, replace it with http://localhost:8080/aSite/aPage?query=hi%25everybody According to rfc 1738, 2.2. URL Character Encoding Issues Octets must be encoded ..., if the use of the corresponding character is unsafe, ... The character % is unsafe because it is used for encodings of other characters. Thus, only alphanumerics, the special characters $-_.+!*'(),, and reserved characters used for their reserved purposes may be used unencoded within a URL. There is no details in RFC on how to handle badly shaped urls (like % not followed by 2 hex digits) and thus your urls should not rely upon this. Regards. abdurrahman sahin a écrit : I realized apache2 web server properyl handles % sign in URIs, i need = exact functionality on tomcat 5 too. When I try to pass a parameter containing % sign, the parameter value on = the server seems null. like http://localhost:8080/aSite/aPage?query=hi%everybody Tomcat 5 cannot handle that, Is there a way to do it with tomcat 5. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat and client certificates
Hi Yes, it is possible. From connector configuration doc: clientAuth: Set this value to true if you want Tomcat to require all SSL clients to present a client Certificate in order to use this socket. Set this value to want if you want Tomcat to request a client Certificate, but not fail if one isn't presented. So in your configuration, change clientAuth=false to clientAuth=want and connector will accept connection be there a certificate or not. But don't forget login-config auth-methodCLIENT-CERT/auth-method /login-config means access to /html/* will be refused to users not presenting a certificate. (They can still access other webapps in tomcat if those have a login-config not based on certificate and they can also browse in ssl the non restricted area of client-cert based webapp) for sensitive areas, you might also be interrested in adding, in particular for basic authentification based webapps ... user-data-constraint transport-guaranteeCONFIDENTIAL/transport-guarantee /user-data-constraint /security-constraint Le Mercredi 01 Février 2006 17:55, Markus a écrit : Creating client certs is no problem, I already had client authentication working on the Connector-Level. Nick: In other words: it is NOT possible in tomcat to have a webapp with BOTH, a private part with ssl AND client authentication and a public part with ssl but WITHOUT client authentication? That would be sad. Markus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- David Delbecq Royal Meteorological Institute of Belgium - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
non US-ASCII query parameters
Hello i experienced a problem using tomcat-5.5.7 It does not understand non us-ascii query parameter. It seems it does decode all %XX as an index in US-ASCII table. How can i change it? I want tomcat to decode it as either ISO-8859-1 either UTF-8 (any of those are ok, but obviously us-assci is not because of accentuated characters in request). Thanks for help. -- David Delbecq Royal Meteorological Institute of Belgium - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: non US-ASCII query parameters
Le Lundi 30 Janvier 2006 12:54, Tim Lucia a écrit : Are you using the request dumper valve? This will cause decoding problems, as describe here: http://tomcat.apache.org/tomcat-5.5-doc/config/valve.html The Request Dumper Valve is a useful tool in debugging interactions with a client application (or browser) that is sending HTTP requests to your Tomcat-based server. When configured, it causes details about each request processed by its associated Engine, Host, or Context to be logged to the Logger that corresponds to that container. WARNING: Using this valve has side-effects. The output from this valve includes any parameters included with the request. The parameters will be decoded using the default platform encoding. Any subsequent calls to request.setCharacterEncoding() within the web application will have no effect. Tim No, am not. Also, i set the URI Encoding to utf-8 in connector but with no success. Strangely, setting URI Encoding works on linux developper station but not on production environment. Both are using the same .jsp. However we have 2 access_log valves running on production, which we don't have in test environment. But as those two valves are not supposed to decode the parameter, it shouldn't influence decoding process (they only check headers) -Original Message- From: David Delbecq [mailto:[EMAIL PROTECTED] Sent: Monday, January 30, 2006 6:19 AM To: Tomcat Users List Subject: non US-ASCII query parameters Hello i experienced a problem using tomcat-5.5.7 It does not understand non us-ascii query parameter. It seems it does decode all %XX as an index in US-ASCII table. How can i change it? I want tomcat to decode it as either ISO-8859-1 either UTF-8 (any of those are ok, but obviously us-assci is not because of accentuated characters in request). Thanks for help. -- David Delbecq Royal Meteorological Institute of Belgium - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: non US-ASCII query parameters
Ok, found out. Tomcat needed a restart after changing the value of URI Encoding in connector. Le Lundi 30 Janvier 2006 13:09, David Delbecq a écrit : Le Lundi 30 Janvier 2006 12:54, Tim Lucia a écrit : Are you using the request dumper valve? This will cause decoding problems, as describe here: http://tomcat.apache.org/tomcat-5.5-doc/config/valve.html The Request Dumper Valve is a useful tool in debugging interactions with a client application (or browser) that is sending HTTP requests to your Tomcat-based server. When configured, it causes details about each request processed by its associated Engine, Host, or Context to be logged to the Logger that corresponds to that container. WARNING: Using this valve has side-effects. The output from this valve includes any parameters included with the request. The parameters will be decoded using the default platform encoding. Any subsequent calls to request.setCharacterEncoding() within the web application will have no effect. Tim No, am not. Also, i set the URI Encoding to utf-8 in connector but with no success. Strangely, setting URI Encoding works on linux developper station but not on production environment. Both are using the same .jsp. However we have 2 access_log valves running on production, which we don't have in test environment. But as those two valves are not supposed to decode the parameter, it shouldn't influence decoding process (they only check headers) -Original Message- From: David Delbecq [mailto:[EMAIL PROTECTED] Sent: Monday, January 30, 2006 6:19 AM To: Tomcat Users List Subject: non US-ASCII query parameters Hello i experienced a problem using tomcat-5.5.7 It does not understand non us-ascii query parameter. It seems it does decode all %XX as an index in US-ASCII table. How can i change it? I want tomcat to decode it as either ISO-8859-1 either UTF-8 (any of those are ok, but obviously us-assci is not because of accentuated characters in request). Thanks for help. -- David Delbecq Royal Meteorological Institute of Belgium - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Need tomcat build for Fedora 3 on x86
Le Lundi 30 Janvier 2006 16:05, [EMAIL PROTECTED] a écrit : Hi Tomcat List Subscribers, I need to install a recent Tomcat on a Fedora 3 Linux server as a Heartbeat application. I didn't manage the vanilla Tomcat installation (should you be interested to know why read below) download http://apache.be.proserve.nl/tomcat/tomcat-5/v5.5.15/bin/apache-tomcat-5.5.15.tar.gz or go to tomcat website: download 5.x, Binary distribution, core (you might also be interested in the 'administration web application' which is a webapplication to manager tomcat configuration tar -xvzf apache-tomcat-5.5.15.tar.gz cd to tomcat dir set JDK_HOME env variable to where you installed sun jdk (1.5 recommanded) run bin/startup.sh that's all, tomcat is running with output in logs/catalina.out -- David Delbecq Royal Meteorological Institute of Belgium - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to capture printf() stdout to stdout_nnn.log?
running startup.bat myfile.log Le Jeudi 19 Janvier 2006 18:25, Joe Siebenmann a écrit : Hi All, My System.out.println() gets logged to Tomcat's log file fine. I want to be able to capture the printf()s in the DLL of my JNI to the same, or another, log file. If I start Tomcat from the command line using 'startup.bat' the printf()s show-up on the console output. My question is how can I get this to get logged to a log file when I run Tomcat normally? I start the Apache Tomcat Service. I'd rather not have to go through all that using log4j stuff unless it's really needed. Can't it be done with the normal Commons Logging, or what's built-into Tomcat? I've found bits and pieces on how to do this, but nothing that's clear. I'm using Tomcat-5.5.9 with Java 1.5, on Windows XP. Thanks, Joe Siebenmann __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- David Delbecq Royal Meteorological Institute of Belgium - Pingouins dans les champs, hiver méchant - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Oracle 8i JDBC Driver for jdk1.5?
Did you try using the 1.4 version on 1.5 jvm? Le Vendredi 20 Janvier 2006 11:23, gupta vidhi a écrit : hello, i got the following info. from oracle.com : - Setting Up Your Environment --- On Windows platforms: - Add [ORACLE_HOME]\jdbc\lib\classes12.jar to your CLASSPATH if you use JDK 1.2 or 1.3. - Add [ORACLE_HOME]\jdbc\lib\ojdbc14.jar to your CLASSPATH if you use JDK 1.4. - Add [ORACLE_HOME]\jdbc\lib\orai18n.jar to your CLASSPATH if you use any NLS features. - Add [ORACLE_HOME]\bin to your PATH if you are using the JDBC OCI driver but i'm not getting the info. regarding Oracle 8i JDBC Driver for jdk1.5. Kindly help. Thanks Regards, Vidhi - What are the most popular cars? Find out at Yahoo! Autos -- David Delbecq Royal Meteorological Institute of Belgium - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Oracle 8i JDBC Driver for jdk1.5?
I don't think oracle has 1.5 specific drivers. ojdbc14 should suit well on 1.5 jvm Le Vendredi 20 Janvier 2006 12:52, gupta vidhi a écrit : i'm using jdk1.5.0.02, Tomcat 4.1.31 JDBC 8.1.7.0.0 on WIN 2000 Oracle 8i. David Delbecq [EMAIL PROTECTED] wrote: Did you try using the 1.4 version on 1.5 jvm? Le Vendredi 20 Janvier 2006 11:23, gupta vidhi a écrit : hello, i got the following info. from oracle.com : - Setting Up Your Environment --- On Windows platforms: - Add [ORACLE_HOME]\jdbc\lib\classes12.jar to your CLASSPATH if you use JDK 1.2 or 1.3. - Add [ORACLE_HOME]\jdbc\lib\ojdbc14.jar to your CLASSPATH if you use JDK 1.4. - Add [ORACLE_HOME]\jdbc\lib\orai18n.jar to your CLASSPATH if you use any NLS features. - Add [ORACLE_HOME]\bin to your PATH if you are using the JDBC OCI driver but i'm not getting the info. regarding Oracle 8i JDBC Driver for jdk1.5. Kindly help. Thanks Regards, Vidhi - What are the most popular cars? Find out at Yahoo! Autos -- David Delbecq Royal Meteorological Institute of Belgium - Pingouins dans les champs, hiver méchant - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Why WEB-INF folder has to be in capital letters
Yes Le Vendredi 20 Janvier 2006 14:36, Dhaval Patel a écrit : Hello all Tomcat Guys, This is just curiousity. Why WEB-INF folder has to be in capital letters? Is it becuase of J2EE specification? Regards, D __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- David Delbecq Royal Meteorological Institute of Belgium - Pingouins dans les champs, hiver méchant - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: unpack war
Try either of those: - docBase=Upload-C.war manually extract the .war to Upload-C/ Le Mardi 17 Janvier 2006 12:56, [EMAIL PROTECTED] a écrit : hi, I'm using tomcat-4.1.29 on windows 2000 I'm trying to change the server.xml to add logging for a context. when i add a logger to the context, the war file for the context is not getting extracted. if i remove this context tag from server.xml the war gets extracted successfully so there's no problem in the war file. The host tag is as following: Host name=localhost debug=0 appBase=webapps unpackWARs=true autoDeploy=true The context tag in server.xml is as following : Context path=/Upload-C docBase=Upload-C debug=0 privileged=true Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_upload-c_log. suffix=.txt timestamp=true/ /Context so what's going wrong here. regards, Mahesh Bhandare - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- David Delbecq Royal Meteorological Institute of Belgium - Pingouins dans les champs, hiver méchant - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: forwarding JDOM-Objects
Your class in not available for your servlet. Check in you war that com/softwareag/tamino/db/api/accessor/TInsertException is either in WEB-INF/classes, either in a .jar in WEB-INF/lib Le Vendredi 13 Janvier 2006 15:44, Christian Stalp a écrit : So I wrote this servlet, it gets a JDOM-object from another servlet and returns with a another attribute. Document mydoc = (Document) this.getServletContext().getAttribute(jdom_object); TXMLObject tobj = TXMLObject.newInstance ( mydoc); ServletContext sercon = this.getServletContext(); String giveback = Tamino_returnvalue; try { TConnection connection = TConnectionFactory.getInstance().newConnection( http://localhost/tamino/chris; ); TXMLObjectAccessor xmlObjectAccessor = connection.newXMLObjectAccessor( TAccessLocation.newInstance( test1 ), TJDOMObjectModel.getInstance() ); TResponse myret = xmlObjectAccessor.insert( tobj ); connection.close(); sercon.setAttribute( giveback , myret ); } catch ( TConnectionException te ) { te.getCause(); } catch ( TInsertException ie ) { ie.toString(); }; But something doesn't fit. Because I got this dump: javax.servlet.ServletException: Error instantiating servlet class DatenbankEingabe org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744) org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) java.lang.Thread.run(Unknown Source) *root cause* java.lang.NoClassDefFoundError: com/softwareag/tamino/db/api/accessor/TInsertException java.lang.Class.getDeclaredConstructors0(Native Method) java.lang.Class.privateGetDeclaredConstructors(Unknown Source) java.lang.Class.getConstructor0(Unknown Source) java.lang.Class.newInstance0(Unknown Source) java.lang.Class.newInstance(Unknown Source) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744) org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) Is this caused by the single thread? I wortk with Eclipse, and this has no problem finding a class. Hmmm but maybe tomcat. Anyway I send this mail away. Gruss Christian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- David Delbecq Royal Meteorological Institute of Belgium - Pingouins dans les champs, hiver méchant - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Migration
Hi Abh, Out of curiosity i took a look a at tomcat generated jsp class. (tomcat: 5.5.7) import directive found in .java file generated from .jsp: import javax.servlet.*; import javax.servlet.http.*; import javax.servlet.jsp.*; No import directive were present in original .jsp and, as you see, there is no java.io.* class imported by tomcat. All IOException which may occur during processing are managed with their full package: public void _jspService(HttpServletRequest request, HttpServletResponse response) throws java.io.IOException, ServletException { Could you send us a demo .jsp that used to work with tomcat but not websphere, and specify tomcat version used. Le Vendredi 6 Janvier 2006 10:51, Abh N a écrit : Hi, We are migrating our applications from Tomcat to Websphere server. We are getting some issues (in Websphere )with code which used to work fine in Tomcat. Server is not recognizing IOException in jsp code. I am now putting import java.io.* to resolve this. Am not able to understand how it used to work in Tomcat env without error. Can anybody give some pointers regarding this. Thanks Send instant messages to your online friends http://in.messenger.yahoo.com -- David Delbecq Royal Meteorological Institute of Belgium - Pingouins dans les champs, hiver méchant - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Configuration Question
Le Mercredi 4 Janvier 2006 15:10, Scott Purcell a écrit : I am running Tomcat 5.5x on a Win2000 box. I purchased a DNS name, and I have that configurated in the server.xml. So when a user hits my site like so: http://www.xxx.com it calls the site and all is good. But here is my problem. On some search engines for whatever reason, the url shows this: http://xxx.com leaving out the www. It still brings open the site, but there is a problem. My site runs all https, and when I registered my ssl certificate, it is under the http://www.xxx.com. And when the user hits the site without the 'www' it brings up a invalid certificate. It shows the lock, but it says it is not certified by verisign. Any ideas why this is occuring, and any ideas to redirect the bad url to the good one? Adult sites run on tomcat now? :p It is possible the search bots were misled by some header found in your response. Is you tomcat service configured for www.xxx.com host or simply for anyhost (in which case it might add a content-location of xxx.com in response as it is tomcat's computer hostname). Go to http://www.xxx.com/admin/, fill in username/password of admin and modify the default host to respond only to alias www.xxx.com Of course, requests in the form http(s)://xxx.com will not be responded anymore. You could also, on a temporary basis, put a second Host entry for alias xxx.com which will send a 'moved permanently' response. Many thanks, - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- David Delbecq Royal Meteorological Institute of Belgium - Pingouins dans les champs, hiver méchant - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Many questions are left unanswered.
100% mails would get don't know answer then, because at there is always someone who don't know. Commonly on mailing lists, if nobody answer, then nobody has knowledege and/or time to answer your question. Regards, Le Vendredi 16 Décembre 2005 12:48, Prathibha, Bharathi a écrit : Hi Mark, Many questions in this forum are left unanswered . It would be nice if I , atleast, get a don't know answer to some of my mails! Thanks Regards, Prathibha. -- David Delbecq Royal Meteorological Institute of Belgium - Pingouins dans les champs, hiver méchant - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Please Help Me
Hi, You need to provide additionnal informations: - what command did you use (according to your error message you are trying to stop a non running tomcat, it obviously fails) - provide a complete message log (from start of script to quit error) - what is your config (which port does tomcat listen or tries to listen, did you get any bind exceptions when you started?) Le Vendredi 2 Décembre 2005 10:09, Teh Noranis Mohd Aris a écrit : Dear All, I've installed tomcat version 4.1.31 and tried to start tomcat but the Tomcat window displays error messages: Catalina.stop: java.net.ConnectException: Connection refused: connect java.net.ConnectException . . . How can I fix this problem? Please help me. Thank you. __ Start your day with Yahoo! - Make it your home page! http://www.yahoo.com/r/hs - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- David Delbecq Royal Meteorological Institute of Belgium - Pingouins dans les champs, hiver méchant - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Deploying Servlet Project from Windows to Fedora
Hi, The main difference between windows and linux for you is at the filesystem level i think. Check twice the configuration of your servlets in web.xml and the files in your war for uppercase/lower case mistakes. I may be you renamed at some point myServlet.java to MyServlet.java but never cleared the .class so you end up with a myServlet.class in your war, which is extracted by tomcat (tomcat always extract .war, it does not access it directly) as myServlet.class and when it later tries to load the class MyServlet using file MyServlet.class, it's not a problem in windows (myServlet.class is opened and contains the MyServlet class) but it is on linux (Myservlet.class is not the same as myServlet.class). The uppercase/lowercase problem might also be in having a directory named WEB-INF/CLASSES or web-inf/classes instead of WEB-INF/classes This is just a suggestion, but it may be the most obvious problem. Also, the error messages from tomcat might be usefull to find the problem :p regards Le Jeudi 1 Décembre 2005 15:47, Aydın Toprak a écrit : Hii, I have developed web based project that covers many servlets and uses Postgresql dataBase, on ;Windows platform... But I want to deploy the software to the Linux (Fedora Core 4 64) .. However I havent been able to deploy the compleate project correctly under the linux enviroment.. Tomcat cant find my servlets and so do nothing... Should I modify the web.xml file of my own .. or do something different ? .. I am looking for some clear descriptions or an accurate documentation to do it... thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- David Delbecq Royal Meteorological Institute of Belgium - Pingouins dans les champs, hiver méchant - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to share resources across two applications
Hi, maybe the problem is not were we thought it was. If you get a NullPointerException a (1) (i mean not somewhere deeper inside 1 but exactly at 1), that can only mean getServletContext() returned false. This may be the case if servelt was not properly initialized. Check your init(ServletConfig config) method of your servlet and check twice it calls it's ancestor's method (super.init(config)) because it's the ancestor which will set the servlet context. Nihita Goel a écrit : Hi, I have two applications running on the tomcat application server. w1 - with context path /w1app and w2 with context path /w2app I wish to provide links in w1 displaying pages of w2. I have used this code in my HttpServlet class of w1 if /// some condition Servlet Context othercontext = getServletContext().getContext(/w2app); (1) RequestDispatcher rd = othercontext.getRequestDispatcher(url); (2) rd.forward (request,response) (3) However - the it gives a NullPointerException at 1. I have been trying hard but without success.. Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat User Permession
Question is not clear, but i'll try to reply. All action attempted by any code inside the jvm running tomcat (that is operations done by JSP, servlet, realms, tomcat itself and any other java classes you may add to webapp) are done on behalf of the user which started tomcat. So if you start tomcat by hand like this: [EMAIL PROTECTED]:~/tomcat/jakarta-tomcat-5.5.7$ bin/startup.sh All action will be done on behalf of user 'delbd' If you start tomcat in a startup script, change recommend you set the user to a user named, for example, 'tomcat' which has write access limited to the tomcat directory. Keep in mind, if you want your tomcat to listen on port 80 (this port is reserved for root in linux as it is a so called low port), you will then need to run tomcat as root, which is clearly NOT recommanded! (prefer to run an apache http server on port 80 and prowy the tomcat server using mod_jk) Last but not least, If your tomcat webapp is to serve only html files, it more performant to stick with apache http server! Regard, David Delbecq Mohammad Tag EL-Deen a écrit : I'm using mandrake 10.1 as a server, and jakarta-tomcat-5.0.27. My intranet running on tomcat should be updated and should use the mandrake linux users permission for the folders while browsing. If the intranet is pure html can this happened also? -- Respectfully, Mohammad TAg EL-Deen 012 68 10 68 9 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Unsubscribe DON'T WORK!
That's fun, you can post to the mailing list, but your messages for unsuscribing are considered spams :) [EMAIL PROTECTED]: host asf.osuosl.org[140.211.166.49] said: 552 spam score (7.0) exceeded threshold [EMAIL PROTECTED] a écrit : Hi team of Tomcat Users List! All email that you have for unsubscribe DON'T WORK! I send more then 20 times for the 2 emails that you gave and they DON'T WORK! Always get the Undelivered Mail Returned to Sender! Do you have any ideia of what is going on? Best Regards António - Mensagem Reenviada de [EMAIL PROTECTED] - Data: Wed, 19 Oct 2005 22:53:08 +0100 (WEST) De: Mail Delivery System [EMAIL PROTECTED] Responder para: Mail Delivery System [EMAIL PROTECTED] Assunto: Undelivered Mail Returned to Sender Para: [EMAIL PROTECTED] This is the Postfix program at host galadriel.portugalmail.pt. I'm sorry to have to inform you that the message returned below could not be delivered to one or more destinations. For further assistance, please send mail to postmaster If you do so, please include this problem report. You can delete your own text from the message returned below. The Postfix program [EMAIL PROTECTED]: host asf.osuosl.org[140.211.166.49] said: 552 spam score (7.0) exceeded threshold - Finalizar mensagem reenviada - Reporting-MTA: dns; galadriel.portugalmail.pt Arrival-Date: Wed, 19 Oct 2005 22:52:44 +0100 (WEST) Final-Recipient: rfc822; [EMAIL PROTECTED] Action: failed Status: 5.0.0 Diagnostic-Code: X-Postfix; host asf.osuosl.org[140.211.166.49] said: 552 spam score (7.0) exceeded threshold Expéditeur: [EMAIL PROTECTED] Date: Wed, 19 Oct 2005 22:52:44 +0100 Destinataire: [EMAIL PROTECTED] Destinataire: [EMAIL PROTECTED] Received: by galadriel.portugalmail.pt (Postfix, from userid 30) id B7D287C80F; Wed, 19 Oct 2005 22:52:44 +0100 (WEST) Received: from 213-58-9-102.acesso.portugalmail.pt (213-58-9-102.acesso.portugalmail.pt [213.58.9.102]) by gold.portugalmail.pt (IMP) with HTTP for [EMAIL PROTECTED]@localhost; Wed, 19 Oct 2005 22:52:44 +0100 ID du Message: [EMAIL PROTECTED] Version de MIME: 1.0 Content-Type: text/plain Content-Disposition: inline Agent utilisateur: Internet Messaging Program (IMP) 4.0-cvs Content-Transfer-Encoding: 7bit Received: by galadriel.portugalmail.pt (Postfix, from userid 30) id B7D287C80F; Wed, 19 Oct 2005 22:52:44 +0100 (WEST) Received: from 213-58-9-102.acesso.portugalmail.pt (213-58-9-102.acesso.portugalmail.pt [213.58.9.102]) by gold.portugalmail.pt (IMP) with HTTP for [EMAIL PROTECTED]@localhost; Wed, 19 Oct 2005 22:52:44 +0100 Message-ID: [EMAIL PROTECTED] Date: Wed, 19 Oct 2005 22:52:44 +0100 From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] MIME-Version: 1.0 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Internet Messaging Program (IMP) 4.0-cvs - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: WAR versions
manifest as name of .war is used by tomcat during deployement to name the webapp :) Zohar Amir a écrit : Hello, I was wondering what is the best way to indicate a war file's version. Should the file's name indicate it (e.g., bla_1.3.2.war), and/or should the manifest in META-INF include an entry for it? Thanks, Zohar. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: classloader during tomcat startup
Well, i saw the ServletContextListener thingies. Here is what i read about it, not quite the same, in servlet 2.4 specifications: SRV.10.3.2Deployment Declarations Listener classes are declared in the Web application deployment descriptor using the listener element. They are listed by class name in the order in which they are to be invoked. SRV.10.3.3Listener Registration The Web container creates an instance of each listener class and registers it for event notifications prior to the processing of the first request by the application. The Web container registers the listener instances according to the interfaces they implement and the order in which they appear in the deployment descriptor. During Web application execution, listeners are invoked in the order of their registration. It is also stated there: SRV.14.2.12ServletContextListener public interface ServletContextListener extends java.util.EventListener All Superinterfaces: java.util.EventListener Implementations of this interface receive notifications about changes to the serv- let context of the web application they are part of. To receive notification events, the implementation class must be configured in the deployment descriptor for the web application. Since: v 2.3 See Also: ServletContextEvent So, i agree you can create a ServletContextListener, but you must anyway declare them in the web.xml. The container is not supposed to scan the .jar and WEB-INF/classes for them, mainly because to know if a Class implement an interface, you need to get the Class objet and so you run the static code of the class. Last but not least, using a Servlet has the additional advantage it can be easily configured if needed without ressorting to an additionnal config file in the classpath. Robert Graf-Waczenski a écrit : Using the load-on-startup mechanism was the way to go with older servlet APIs. Nowadays, with servlet API 2.4, having a class implement the ServletContextListener interface is better in my eyes. Here you go: public class MyInitClass implements ServletContextListener { static { // do your static stuff during class loading } public void contextInitialized(ServletContextEvent event) { // do your init stuff } public void contextDestroyed(ServletContextEvent event) { // do your destroy stuff // e.g. cleanup static buffers etc. } } Tomcat automatically finds implementors of the ServletContextListener interface and calls their interface methods to notify them of their own context startup and their own context shutdown. So if you have several contexts and for each of them several such listener classes, tomcat calls the listener methods of the correct (i.e. those belonging to the context) classes when the context is started or shut down. Your web.xml can remain unchanged for this. Robert -Original Message- From: David Delbecq [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 19, 2005 9:51 AM To: Tomcat Users List Subject: Re: classloader during tomcat startup Creating an initialisation servlet for your webapp would be a good way. Create a servlet and map it in web.xml adding a load-on-startup element with a non zero value. In the servlet init you can then setup all classes you need. For classloading hierarchy in tomcat, take a look at http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html Santosh Asbe a écrit : Hi, further to our discussion, can i specifically load a class during startup? Is i possible in tomcat? Where is the clasloader hierachy and details placed?? Santosh On 10/18/05, David Delbecq [EMAIL PROTECTED] wrote: I don't know from the details of tomcat implementation, but i'll response using common sense and from my experience. Tomcat loads all .jar descriptor at webapp startup so it know which .jar contains which class. But it does not load the .class binary content; Each time a class is required, a Class is request to classloader by jvm. If this is first time classloader has to return the Class, it initialize it. So static block is run at first time class is requested. This is common sense as it prevents initialising classes you never use in your library. David Delbecq Santosh Asbe a écrit : Hi all, I have couple of questions regarding tomcat startup 1)when the tomcat is started , does it load all the jar file from its lib and create a object of all the classes? 2) if there is a static block in one of the classes , when will it execute..during startup or when first call is made Santosh - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED
Re: classloader during tomcat startup
Robert Graf-Waczenski a écrit : SRV.14.2.12ServletContextListener public interface ServletContextListener extends java.util.EventListener All Superinterfaces: java.util.EventListener Implementations of this interface receive notifications about changes to the serv- let context of the web application they are part of. To receive notification events, the implementation class must be configured in the deployment descriptor for the web application. Since: v 2.3 See Also: ServletContextEvent Correct. My mistake. And my own listener classes are indeed registered in my web.xml(s) since the beginning, forgot this ;-) So my point of not having to configure it in web.xml is moot. Last but not least, using a Servlet has the additional advantage it can be easily configured if needed without ressorting to an additionnal config file in the classpath. I don't see what you are trying to say here. What additional config file in the classpath are you talking about? (I'm not trying to offend you, i'm only asking for clarification.) Just pointing out if he needs some configuration parameters for his static block, he can use the param sections of the servlet config. If you use the listener class and need some configuration, you need to somehow read it from a file as there is not equivalent section. My main problem with the servlet approach is that a servlet has a doGet() method and is therefore supposed to serve web requests, which is not needed in an init class. (Agreed, this is not a major problem, but i like to keep things as small and simple as possible, and a class that *can* serve web requests should also actually be used for this purpose.) Agree on that point, though i most of the time simply don't care :) Robert Robert Graf-Waczenski a écrit : Using the load-on-startup mechanism was the way to go with older servlet APIs. Nowadays, with servlet API 2.4, having a class implement the ServletContextListener interface is better in my eyes. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Global Sessions
It would be a nightmare ;) Sessions are used to store objects, lots of libs does store in session various datas. All objects loaded are linked to their Classloader. So if you store a org.mycompany.MyData object under key SOME_KEY in session within webapp1 and you do this in webapp2: if (session.getAttribute(SOME_KEY) instanceof org.mycompany.MyData){ // We will never get in this block because // object was created in webapp1 and we are conparing // object class to the class MyData loaded from webapp2 // unless MyData is in common/lib } If you just want to prevent user from loggin in again, use the single sign-on valve. http://tomcat.apache.org/tomcat-5.5-doc/config/host.html#Single%20Sign%20On Eoghan Shields a écrit : Hi, Is it possible to have a single session which can be used over multiple applications on a single server, the basic problem is there is multiple webapps running on the same server but when a user logs into one, it would be nice to share all their session data so that they could switch between applications to avoid them having to log in again. I have been looking at the documentation and stuff but so far have come up blank, was hoping might be able to steer me in the right direction. Thanks in advance, Eoghan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: classloader during tomcat startup
I don't know from the details of tomcat implementation, but i'll response using common sense and from my experience. Tomcat loads all .jar descriptor at webapp startup so it know which .jar contains which class. But it does not load the .class binary content; Each time a class is required, a Class is request to classloader by jvm. If this is first time classloader has to return the Class, it initialize it. So static block is run at first time class is requested. This is common sense as it prevents initialising classes you never use in your library. David Delbecq Santosh Asbe a écrit : Hi all, I have couple of questions regarding tomcat startup 1)when the tomcat is started , does it load all the jar file from its lib and create a object of all the classes? 2) if there is a static block in one of the classes , when will it execute..during startup or when first call is made Santosh - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Multi-part response
Hi Alex, You should take a look at http protocol ftp://ftp.isi.edu/in-notes/rfc2616.txt And point out what part of the specs you need to manage. As far as i know, there is no way in the http protocol to embed binary content straight into the stream, and certainly not in the middle of the html response. If you could point to existing tool/site using the technics you want to apply to struts would be helpfull to respond you. ALEX HYDE a écrit : Hi David, I guess I meant that I wanted to write part of a page, and then write the image straight othe stream, then some more of the page, and then another image direct to the stream, and then I am not sure of the syntax? --- David Delbecq [EMAIL PROTECTED] wrote: Well am not sure of what you mean, and am not sure browser accept multi-part response that way, but i dont know http protocol enough. Could you provide an example http response you would like to get?? Anyway, struts in itself is not extensible that way. ALEX HYDE a écrit : Cheers. I think I wanted to know how and if there was a good way of incororating mulitpart response into a framewrok like struts? Let's say I have a page with a number of src tags embeded in it, and I don't want the browser to have to pull in each image individually, how could I write them all out to a single response and still stay within a tidy framework like Struts? --- David Delbecq [EMAIL PROTECTED] wrote: If you want to alter the response of a servlet (like struts servlet), a ServletFilter is a good choice. ALEX HYDE a écrit : Hi All, This is probably not strictly a Tomcat question so apologies. If I am using Struts, how can I filter the output so that I convert it into a multipart response? Using a filter probably! But I'm not sure how. For example, how could I send all my embedded images and the response in one mulit-part response? Thanks alot Alex ___ Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ___ How much free photo storage do you get? Store your holiday snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ___ To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Character Encoding -ISo-8859-1 Vs UTF-8 Vs GBK
UTF-8 (8-bit Unicode Transformation Format) is a lossless, variable-length character encoding for Unicode created by Ken Thompson and Rob Pike. It uses groups of bytes to represent the Unicode standard for the alphabets of many of the world's languages. UTF-8 is especially useful for transmission over 8-bit Electronic Mail systems. http://en.wikipedia.org/wiki/UTF-8 In computing, Unicode provides an international standard which has the goal of providing the means to encode the text of every document people want to store on computers. This includes all scripts in active use today, many scripts known only by scholars, and symbols which do not strictly represent scripts, like mathematical, linguistic and APL symbols. http://en.wikipedia.org/wiki/Unicode [EMAIL PROTECTED] a écrit : Hi, In Europe we have lots of languages. I don't think it's true that UTF-8 can handle ALL european character very well.There is a list in the net (I don't know here) with the other ISO encoding for other languages. AF Citando David Delbecq [EMAIL PROTECTED]: Hi, UTF-8 can handle european and chinese character very well. If you can't read using utf-8 any of those this simply mean you text file is not saved in utf-8. [EMAIL PROTECTED] a écrit : Hi, I am trying to read the universal charater form a text file to my java application that stores them in database. When I use encoding type GBK i can read all special charater in chinease, when i use encoding ISO-8859-1 i can read latin but not chinease , but whn i use encoding as UTF-8 i think i ma supposed to read both chinease and latin correctly but i am not able to read any of them. Can any one give me the pointers for solution , Further the beta- is converted to ss in latin-1 thanks in advance Birendar S Waldiya Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Debugging Tomcat hangs
One stupid suggestion is to run the tomcat inside an environment like eclipse with an eclipse plugin like sysdeo. Then stress the webapplication. When, it 'hangs' issue a 'pause' inside the tomcat jvm, and explore the various threads. Search for 2 kinds of locks: - non returning http-thread leading in emptying the http response thread pool, this thread is use to process the request, so if i put while(1) Thread.sleep(20); inside a servlet i can easily run out of Threads. - non returning connections to connection pool. This one is more tricky, i'll notice lots of threads in object.wait() having a stack comming from commons dbcp. you can try to activate automatic returning of inactive (more than 5 minutes?) connection to the connection pool in tomcat configuration, but this doens really solve problem, it just help prevent final deadlock. David Boyer a écrit : We're running Tomcat 5.0.28 with JDK 1.4.2_8 hosting a single commercial web application on our web server which uses MySQL 4.0.26 running on another server. Both servers are Windows 2003 Enterprise, 2x3.0GHz XEON, 4GB RAM. Our Tomcat instance is dedicated to the commercial web app, and the MySQL instance is hosting only that app's database. The web application is hanging every few days, and neither we nor the vendor can figure out why. Restarting Tomcat is the only way to fix it. We've tried all of the current stable versions of both MySQL and Tomcat, as well as JDK 5 (with Tomcat 5.5.x). The problem happens under each of them. I'm highly confident the problem is with the commercial web app; we have other web applications running under other Tomcat instances on the same server going against a variety of MySQL and MSSQL databases on our database server, and none of them have any problems. If I generate a dump of the JVM using Ctrl-Break while running Tomcat as a console app, what's the best resource for interpreting this? I suspect the problem is a thread deadlock, or something similar. Any other suggestions are appreciated. Thanks! David Boyer - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]