Re: JDBCRealm and Oracle Not working
Chad Perry wrote: Ok, you need to put the classes12_01.jar file in the ~/common/lib dir also. On install, the classes12_01.jar is in the ~/lib, which is NOT enough to get the JDBCRealm working with Oracle. WHY you need that jar in both places: ~/lib and ~/common/lib is still a mystery/issue! Could anyone shed some like on this issue? I am reporting (hope I got it right) what I learned form earlier threads: lib is for jar that you want tomcat to load common/lib is for jars that you want tomcat AND your app to load WEB-INF/lib is for jars that you want your app to load PS: Here is a interesting discussion on this issue: http://groups.google.com/groups?q=Tomcat+Realm+4hl=enlr=ie=UTF8oe=UTF8selm=5Rzc8.12%24U83.40693%40mencken.net.nih.govrnum=3 Thanks! -CP [EMAIL PROTECTED] 05/20/02 07:22AM By default the drvier (classes12_01.jar) is placed in Apache Tomcat 4.0\lib. I can connect to Oracle just fine in a JSP or servlet! It is the JDBCRealm functionality that is broken. :-( -Late From: Umberto Nicoletti [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Subject: Re: JDBCRealm and Oracle Not working Date: Mon, 20 May 2002 09:40:53 +0200 MIME-Version: 1.0 Received: from [192.18.49.131] by hotmail.com (3.2) with ESMTP id MHotMailBEB1F421001340043721C0123183E4A90; Mon, 20 May 2002 00:43:34 -0700 Received: (qmail 5127 invoked by uid 97); 20 May 2002 07:43:22 - Received: (qmail 5115 invoked by uid 98); 20 May 2002 07:43:22 - From tomcat-user-return-20073-chadhperry Mon, 20 May 2002 00:45:26 -0700 Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm Precedence: bulk List-Unsubscribe: mailto:[EMAIL PROTECTED] List-Subscribe: mailto:[EMAIL PROTECTED] List-Help: mailto:[EMAIL PROTECTED] List-Post: mailto:[EMAIL PROTECTED] List-Id: Tomcat Users List tomcat-user.jakarta.apache.org Delivered-To: mailing list [EMAIL PROTECTED] X-Antivirus: nagoya (v4198 created Apr 24 2002) Message-ID: [EMAIL PROTECTED] X-Mailer: Mozilla 4.74 [en] (WinNT; U) X-Accept-Language: en References: [EMAIL PROTECTED] X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hi, You must put the jdbc driver in a place where tomcat can find it. As of my experience a suitable place is TOMCAT_HOME/lib or common/lib (or something like that). Regards, umberto Chad Perry wrote: Trying to get Oracle 8i to work with with the JDBCRealm: Tomcat 4.0.4b3 JDK 1.4.0 OS Win2000 Server I guess tomcat-JDBCRealm doesn't work with Oracle? It would be AWESOME if I could get this to work! Could somebody verify that I'm not dorking out? Thanks!! Here is my Realm element: Realm className=org.apache.catalina.realm.JDBCRealm debug=99 driverName=oracle.jdbc.driver.OracleDriver connectionURL=jdbc:oracle:thin:@192.168.0.10:1521:TestDB connectionName=X connectionPassword=X userTable=GOLDEN.APP_USER userNameCol=USER_NAME userCredCol=PASSWORD_TXT userRoleTable=GOLDEN.APP_ROLE roleNameCol=ROLE_NAME/ EXCEPTION BELOW - Occurs on Start up: Starting service Tomcat-Standalone Apache Tomcat/4.0.4-b3 Starting service Tomcat-Apache Apache Tomcat/4.0.4-b3 Catalina.start: LifecycleException: Exception opening database connection: java.sql.SQLException: oracle.jdbc.driver.OracleDriver LifecycleException: Exception opening database connection: java.sql.SQLException: oracle.jdbc.driv er.OracleDriver at org.apache.catalina.realm.JDBCRealm.start(JDBCRealm.java:615) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1108) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:343) at org.apache.catalina.core.StandardService.start(StandardService.java:388) at org.apache.catalina.core.StandardServer.start(StandardServer.java:506) at org.apache.catalina.startup.Catalina.start(Catalina.java:781) at org.apache.catalina.startup.Catalina.execute(Catalina.java:681) at org.apache.catalina.startup.Catalina.process(Catalina.java:179) 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.main(Bootstrap.java:243) - Root Cause - java.sql.SQLException: oracle.jdbc.driver.OracleDriver at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:538) at org.apache.catalina.realm.JDBCRealm.start(JDBCRealm.java:613) at
POSTing to Tomcat 4.0.x
Hi people. I asked similar question ,but since there was no reply I'm gonna try again - Has anyone successufuly executed POST to Tomcat 4.0.x from some java app using URLConnection class ? I would really like to see this piece of code, since I used some code that I found on the web and it worked with Tomcat3.2.x, but not with 4.0.x version of Tomcat Thanx, Vjeran -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Can anyone give me an idea of the maximum hit rate for Tomcat on a PC
With simple JSP, a few hundreds per second on RH7.0, single PII400, tomcat 3.x, Apache 1.3.9, 128M RAM. Please test and advise your finding on 1GHz CPU -Original Message- From: Simon Crase [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 21, 2002 1:50 PM To: 'Tomcat Users List' Subject: Can anyone give me an idea of the maximum hit rate for Tomcat on a PC I'm trying to get a feel for the maximum number of pages I can expect Tomcat to serve per second on a reasonable PC - say 1G RAM and a 1 processor speed around 1GHz. I know the correct answer is it depends, but I'd appreciate any feedback on whether I should be looking at tens of hits, hundreds or whatever for a best case - very simple pages without any database access, as it will be a few days before I get to make any measurements. Regards, Simon Simon A. Crase Invetech Pty Ltd Private Bag 44 495 Blackburn Road Mount Waverley Vic 3149 Phone: 61 3 9211 7933 Mobile: 0408 579 006 Fax:61 3 9211 7702 (facsimile) e-mail: [EMAIL PROTECTED] ___ IMPORTANT - This email and any attachments may be confidential. Any retransmissions, dissemination or other use of these materials by persons or entities other than the intended recipient is prohibited. If received in error, please contact us and delete all copies. Before opening or using attachments, check them for viruses and defects. Our liability is limited to resupplying any affected attachments. [Any representations or opinions expressed in this e.mail are those of the individual sender, and not necessarily those of Vision Systems Limited]. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Is it possible to restart NT-based Tomcat 4.0 remotely?
This is more a Windows question than a Tomcat question... Anyway, if you have access to standard MS rpc ports then you can use server manager/sc/perl/vbscript to start and stop services. Of course you must install tomcat as a service. hope it helps, umberto Maya Vayner wrote: Hi guys, I am trying to figure out ways to restart Tomcat 4.0 which is running on NT, and to ahich I don't have access locally. Only over the Internet. I've found such things as Manager application and org.apache.catalina.core.StandardServer which allows to run SHUTDOWN command through TCP/IP8005 port, but there is no way to start Tomcat, after it has been shutdown that way. Anybody uses Manager or found a better way to reload an application? Or just restart the whole Tomcat server? Any ideas? Thank you very much. Maya Vayner __ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Umberto Nicoletti - [EMAIL PROTECTED] | [EMAIL PROTECTED] Tel. 049-8239380 (assistenza) We'll try to make different mistakes this time. - Larry Wall -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
jndi resources in tomcat 4
Hi, I am having great trouble getting tomcat to give me a mysql Datasource. When I switch on debugging, I can see that the resource seems to be created in the tomcat context from the monitor file catalina.out: XmlMapper: new null org.apache.catalina.deploy.ContextResource resource-ref ContextResource[name=null,scope=Shareable] XmlMapper: org.apache.catalina.deploy.ContextResource.setName( jdbc/rmtDb) XmlMapper: org.apache.catalina.deploy.ContextResource.setType( javax.sql.DataSource) XmlMapper: org.apache.catalina.deploy.ContextResource.setAuth( Container) XmlMapper: Calling org.apache.catalina.core.StandardContext.addResource ContextResource[name=jdbc/rmtDb, type=javax.sql.DataSource, auth=Container, scope=Shareable] XmlMapper: pop resource-ref org.apache.catalina.deploy.ContextResource: ContextResource[name=jdbc/rmtDb, type=javax.sql.DataSource, auth=Container, scope=Shareable] but when accessed by a servlet, tomcat is giving me a DataSource with a null value. mm.mysql-2.0.13-bin.jar has been installed in the common/lib directory. I am using tomcat 4.0.3 on HPux 11.00 with jdk1.4. here are the relevent sections from the configuration files that I am using: server.xml Context path=/rmt docBase=rmt debug=9 reloadable=true cookies=true Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_rmt_log. suffix=.txt timestamp=true/ Resource name = jdbc/rmtDb auth=Container type=javax.sql.DataSource/ ResourceParams name = jdbc/rmtDb parameternameuser/namevaluemysql/value/parameter parameternamepassword/namevaluemysql/value/parameter parameternamedriverClassName/namevalueorg.gjt.mm.mysql.Driver/value /parameter parameternamedriverName/namevaluejdbc:mysql://gwl:3306/rmt/value/ parameter /ResourceParams /Context and web.xml resource-ref res-ref-namejdbc/rmtDb/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref I have tried to follow the jndi how-to without success. I'm sure that I am missing out something really fundermental. Has anyone got any ideas to help me out? thanks Marc -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
running JSP witth JavaBeans
Thanks to everybody who answered about my problem, I can´t run JSP with file.class. I ´ve done all you told me but that doesn´t work for me. I know nothing about Tomcat 4.0.3 .Could be possible that is neccesarry something about files .xml because I notice that some folders has this type of files? thanks again. Juanjo
RE: Mod WEB_APP
Hello, my problem is that I have no compiler license for CC on Solaris 8, and have no compiled version of the GCC compiler either. Hence, I cannot compile the MOD_WEBAPP... :( Does anyone here have an already compiled version of MOD_WEBAPP for Solaris 8? Can someone send it to me? Please Thanks in Advance Rui -Original Message- From: Adrian [mailto:[EMAIL PROTECTED]] Sent: segunda-feira, 20 de Maio de 2002 22:12 To: Tomcat Users List Subject: Re: Mod WEB_APP You should check : http://www.pubbitch.org/jboss.html - Original Message - From: Rui Oliveira [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, May 20, 2002 11:30 AM Subject: Mod WEB_APP Hello, Does anyone here has the mod_webapp compiled for Solaris 8, using the GCC? Can someone help me out? Regards Rui Oliveira -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Tomcat 3.3.1 and additionalJars
From: Larry Isaacs [EMAIL PROTECTED] After adding the jdom.jar and making the server.xml changes you describe, I find that I can compile and display the following JSP page: Hrmm, ok well I am going to rip everything off the system and try again. Perhaps something has been convoluted to the point that it just is not working anymore. From a clean install, all I should have to do is put my context classes in place, add the additionalJars attribute, place the jdom.jar, and start it up, right? If I am missing anything, please let me know. Hopefully this time it will work. :) Thanks, Mario- -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Limiting Amount of Memory Tomcat use
Platform: Linux, Tomcat 3.3.1 Hi people, I am writing a JSP web services on an embedded system running Linux without swap space. Everytime I access a new JSP page, the amount of memory Tomcat uses increase. I think Tomcat is caching the new JSP page for faster access. Am I right? Is there a way to limit the maximum amount of memory that Tomcat will use? Can I configure Tomcat to cache only the last 5 JSP pages? Thanks In Advance. Raymond Pau -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Tomcat 3.3.1 and additionalJars
The symptom you describe is easily achievable. The main point is that additionalJars adds jars to multiple webapps the same as if you copied jdom.jar to each WEB-INF/lib. You could try putting jdom.jar in your test webapp's WEB-INF/lib, remove the additionalJars, and see if the error still occurs. I would not be surprised if it did. If a servlet depends on another class that in turn depends on jdom.jar classes, and that class lives below the webapp classloader, then you might see the symptom you describe. The class in the lower classloader can't see the classes in the webapp classloader unless special programming is implemented to make it possible, such as using the thread context classloader. Cheers, Larry -Original Message- From: Mario Felarca [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 21, 2002 4:58 AM To: [EMAIL PROTECTED] Subject: RE: Tomcat 3.3.1 and additionalJars From: Larry Isaacs [EMAIL PROTECTED] After adding the jdom.jar and making the server.xml changes you describe, I find that I can compile and display the following JSP page: Hrmm, ok well I am going to rip everything off the system and try again. Perhaps something has been convoluted to the point that it just is not working anymore. From a clean install, all I should have to do is put my context classes in place, add the additionalJars attribute, place the jdom.jar, and start it up, right? If I am missing anything, please let me know. Hopefully this time it will work. :) Thanks, Mario- -- To unsubscribe, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Tomcat on Windows2000 as a service
Dear all I installed tomcat v4 on windows 2000 server from its zip file , and i started it by the startup command in the bin directory. how i enable this installation to be a service ? thanks in advance waiting your reply
problem running apache and tomcat on seperate machines
Hi I am having problem running apache and tomcat on seperate machines. I am able to do it on the one machine but when I take out localhost and specify my machine IP address where it should find tomcat I get an Internal Server 500 error message. In my workers.properties file I have specified worker.AJP13.host= 192.168.1.1 This is where I have tomcat running It works fine if I run it as localhost with tomcat running on my local machine. Any suggestions from anyone? My current setup is Apache 1.3.20 on Redhat Linux 7.2 and Tomcat 4.0.3 on windows 95 with mod_jk connectors. Thanxs -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Apache 2 + mod_webapp WORKING!
Hi all. I just thought to share my experience with the list (instead of just whining). Finally got it to work. This is the lucky combo: Tru64 UNIX 4.0D/F GCC 3.0 Apache 2.0.36 (this was the real fix) mod_webapp from Tomcat 4.0.2 The only thing not working is WebAppInfo, but that is not critical. Nix.
Ant Error: Could not create datatype of type: path due to java.lang.NoSuchMethodException
Hi, I have written a class that uses the API of ant-1.4.1 that I start from tomcat-4.0.3. Actualy it works pretty good but when I have a path... instruction in the build file I get an exception like below: Could not create datatype of type: path due to java.lang.NoSuchMethodException When I start ant from a console I don't get this problem. How can I fix the problem? Here is my build file: project name=MyProject default=dist basedir=. path id=project.class.path/ !-- set global properties for this build -- property name=src value=./ target name=dist echo message=${CB_PROJ_ID}/ echo message=${CB_PROJECT_NAME}/ echo message=${CB_SRCDIR}/ !-- delete file=${CB_SRCDIR}/se/java/utils/CVSData.java/ -- sql driver=${CB_JDBC_DRIVER} url=${CB_JDBC_URL} userid=${CB_JDBC_USER} password=${CB_JDBC_PASSWORD} transaction src=x.sql / transaction select * from files /transaction /sql /target /project BUILD FAILED /home/zk/tmp/ant/build.xml:3: Could not create datatype of type: path due to java.lang.NoSuchMethodE xception: init at org.apache.tools.ant.Project.createDataType(Project.java:552) at org.apache.tools.ant.ProjectHelper$DataTypeHand ler.init(ProjectHelper.java:608) at org.apache.tools.ant.ProjectHelper$TargetHandler.startElement(ProjectHelper.java:430) at org.xml.sax.helpers.XMLReaderAdapter.startElement(XMLReaderAdapter.java:329) at org.apache.crimson.parser.Parser 2.maybeElement(Parser2.java(Compiled Code)) at org.apache.crimson.parser.Parser2.content(Parser2.java(Compiled Code)) at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java(Compiled Code)) at org.apache.crimson.parser.Parser2 .content(Parser2.java(Compiled Code)) at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java(Compiled Code)) at org.apache.crimson.parser.Pars er2.parseInternal(Parser2.java:500) at org.apache.crimson.parser.Parser2.parse(Parser2.java:305) at org.apache.crimson.parser.XMLReaderImpl.parse(XMLRe aderImpl.java:433) at org.xml.sax.helpers.XMLReaderAdapter.parse(XMLReaderAdapter.java:223) at javax.xml.parsers.SAXParser.parse(SAXPa rser.java:326) at org.apache.tools.ant.ProjectHelper.parse(ProjectHelper.java:117) at org.apache.tools.ant.ProjectHelper.configure Project(ProjectHelper.java:85) at cv.servlet.build.AntProject.init(AntProject.java:243) at cv.servlet.build.RunBuild.process(RunBuild.java:92) a t cv.servlet.build.RunBuild.exec(RunBuild.java:72) at cv.servlet.build.RunBuild.doGet(RunBuild.java:31) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServl et.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java(Compiled Code)) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.Containe rBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java(Compiled Code)) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java(Compiled Code)) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.Containe rBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java(Compiled Code)) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java(Compiled Code)) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java(Compiled Code)) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java(Compiled Code)) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.Containe rBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java(Compiled Code)) at
RE: Tomcat on Windows2000 as a service
-Original Message- From: Mohammed Omar [mailto:[EMAIL PROTECTED]] Sent: 21 May 2002 12:19 To: [EMAIL PROTECTED] Subject: Tomcat on Windows2000 as a service Dear all I installed tomcat v4 on windows 2000 server from its zip file , and i started it by the startup command in the bin directory. how i enable this installation to be a service ? thanks in advance waiting your reply Mohammed This worked for me, YMMV: %CATALINA_HOME%\bin\tomcat.exe -install ApacheTomcat %JAVA_HOME%\jre\bin\classic\jvm.dll -Djava.class.path=%CATALINA_HOME%\bin\bootstrap.jar;%JAVA_HOME%\lib\tools.j ar -Dcatalina.home=%CATALINA_HOME% -Xrs -start org.apache.catalina.startup.Bootstrap -params start -stop org.apache.catalina.startup.Bootstrap -params stop -out %CATALINA_HOME%\logs\stderr.log You need to enter this all as one line. You may also need to change the \classic\jvm.dll to \hotspot\jvm.dll - check the mailing list archive for the exact details. HTH John -- John Niven Please reply through mailing list -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Connection Pool Configuration
Hi, I have the same problem. Want connection pool to work on Tomcat and Websphere without to rewrite code. IBM send us instructions to set up the server and a piece of code that looks like this: ... java.util.Properties parms = new java.util.Properties(); parms.setProperty(javax.naming.Context.INITIAL_CONTEXT_FACTORY, com.ibm.websphere.naming.WsnInitialContextFactory); javax.naming.Context ctx = new javax.naming.InitialContext(parms); javax.sql.DataSource ds = (javax.sql.DataSource)ctx.lookup(jdbc/db2proddb02DS); java.sql.Connection c = ds.getConnection(user,pass); ... It works on Websphere, but as you can see, initial conext is provided by Websphere code, and I won't use that in Tomcat (in fact I think this is EJB code, and Tomcat does not support it; I can't use it even if I want to). So I'm trying an alternate path: ... javax.naming.Context ctx = new javax.naming.InitialContext(); javax.sql.DataSource ds = (javax.sql.DataSource)ctx.lookup(java:comp/env/jdbc/db2proddb02DS); java.sql.Connection c = ds.getConnection(user,pass); ... And on /conf/server.xml !-- MyApp Context -- Context path=/myapp docBase=myapp debug=0 reloadable=true crossContext=true !-- Pool de Conexao DB2 -- Resource name=jdbc/db2proddb02DS auth=SERVLET type=javax.sql.DataSource/ ResourceParams name=jdbc/db2proddb02DS parameternameuser/namevalue/value/parameter parameternamepassword/namevalue/value/parameter parameternamedriverClassName/name valueCOM.ibm.db2.jdbc.DB2ConnectionPoolDataSource/value/parameter parameternamedriverName/name valuejdbc:db2:database/value/parameter /ResourceParams /Context I'm still getting a Null Pointer error, but I think that when I got it to work, I might use the very same configuration (and code) on both servers, since COM.ibm.db2.jdbc.DB2ConnectionPoolDataSource it's not Websphere code. Hope it helps. And note that I may be wrong :) Perhaps one of the fine people in this list may correct me. Fabio. D Watson wrote: I am testing under Tomcat but I will be deploying the project to WebSphere (as per the client's request). I would like to be able to have the project work under any application server, so I do not want to rely on a 3rd party product for pooling but rather use a built in solution (if available). In doing this I also hope to keep any application server specific coding/configuration to a minimum. -- Fabio Mengue - Centro de Computacao - Unicamp [EMAIL PROTECTED] [EMAIL PROTECTED] Quem se mata de trabalhar merece mesmo morrer. - Millor -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
tomcat-apache
Is anybody could have the kindness to tell me which version of tomcat, tomcat-connector and apache (httpd and 2.0.36 is preferred) may I use to make they work together. Please, help me, I will be soon deseperated. I tried apache 2.0.36, tomcat-4.0.3 and connectors 4.0.2-01 and 4.0.4-b3. So I tried to use mod_jk.so. Everything about compilation for source build was OK. When I try the tomcat server stnadalone, it works when I try to access trought apache always get this error message message : Error message: handler jakarta-servlet not found for: examples If you think this is a server error, please contact the webmaster Error 500 localhost Tue May 21 14:09:55 2002 Apache/2.0.36 (Unix) Thnak you all for any suggestion. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Conncurency issue with tomcat???
Hi Remy,Peter After some research I found out that there were no more concurrent session problems and the same request processed twice problem when I changed my simulator(test program) to use HttpClient API. There could be the a bug in implementaion of java.net.HttpUrlConenction. I tried HttpUrlConnection with the Coyote connector and I got the concurrent session problem and the same request being processed twice problem. When I used the API from HttpClient for connection I go no concurrent issues and the test run realibaly with 90 concurrent users. Thanx for ur valuable comment on this subject... Raj -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Very strange session problem on localhost only
Hello, We have recently noticed a very strange error when running tomcat 3.2.4 on localhost. If a button in the application pops up a new window, then the user closes that window to return to the original screen, the session times out. This does not happen when using tomcat connected to apache on our production machine, or even if we access tomcat standalone from another computer on the network. Only happens on localhost. Does anyone know why? Brandon -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Mod WEB_APP
You can get Solaris Freeware (gcc, tar for untarring long paths on Solaris etc.) packages at: http://sunfreeware.com. This should get you started. It's a helpful and good site. Lloyd -Original Message- From: Rui Oliveira [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 21, 2002 4:56 AM To: 'Tomcat Users List' Subject: RE: Mod WEB_APP Hello, my problem is that I have no compiler license for CC on Solaris 8, and have no compiled version of the GCC compiler either. Hence, I cannot compile the MOD_WEBAPP... :( Does anyone here have an already compiled version of MOD_WEBAPP for Solaris 8? Can someone send it to me? Please Thanks in Advance Rui -Original Message- From: Adrian [mailto:[EMAIL PROTECTED]] Sent: segunda-feira, 20 de Maio de 2002 22:12 To: Tomcat Users List Subject: Re: Mod WEB_APP You should check : http://www.pubbitch.org/jboss.html - Original Message - From: Rui Oliveira [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, May 20, 2002 11:30 AM Subject: Mod WEB_APP Hello, Does anyone here has the mod_webapp compiled for Solaris 8, using the GCC? Can someone help me out? Regards Rui Oliveira -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Is it possible to restart NT-based Tomcat 4.0 remotely?
Hi Umberto, if you run Tomcat as a service, try using the freely downloadable PSTools from http://www.sysinternals.com/ntw2k/freeware/pstools.shtml which contain the commandline utility psservice which lets you remotely control NT-Services. You might also be able to run the startup and shutdown Batch files remotely with the psexec utitlity (also included in the PSTools download) (Haven't tried it with Tomcat specifically I must admit) Joerg -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Internal JVM ZipClose exception (TC 4.0.1)
Hi, In the past weeks, we've gotten a couple of internal JVM exceptions running tomcat 4.0.1. The relevant part of catalina.out is attached, as well as the JVM-generated error file. As far as we can tell, this happens randomly. Any insight or information would be appreciated, as well as tips on further debugging this issue. We're going to turn the server on with some debug things enabled in server.xml, hopefully that will shed some light... Stack traces attached. Thanks in advance, Yoav Shapira ChemInformatics This buffer is for notes you don't want to save, and for Lisp evaluation. If you want to create a file, visit that file with C-x C-f, then enter the text in that file's own buffer. An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 10 occurred at PC=0xff02dd54 Function name=ZIP_Close Library=/dvl/info/prj/infra/j2sdk1_3_1_01/jre/lib/sparc/libzip.so Current Java thread: at java.util.zip.ZipFile.getEntry(Native Method) at java.util.zip.ZipFile.getEntry(ZipFile.java:143) at java.util.jar.JarFile.getEntry(JarFile.java:181) at java.util.jar.JarFile.getJarEntry(JarFile.java:168) at org.apache.catalina.loader.WebappClassLoader.findResourceInternal(WebappClassLoader.java:1635) at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1473) at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:852) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1273) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1156) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:801) at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:615) at org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:396) at org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:180) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:201) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1011) at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1106) at java.lang.Thread.run(Thread.java:484) Dynamic libraries: 0x1 /dvl/info/prj/infra/j2sdk1_3_1_01/bin/../bin/sparc/native_threads/java 0xff35 /usr/lib/libthread.so.1 0xff39 /usr/lib/libdl.so.1 0xff20 /usr/lib/libc.so.1 0xff33 /usr/platform/SUNW,Ultra-4/lib/libc_psr.so.1 0xfe48
RE: Calendar in XML/java script
Hi Paul That would be great can u please send me the code and how tos Thanks a lot uma -Original Message- From: Paul Kofon [mailto:[EMAIL PROTECTED]] Sent: Monday, May 20, 2002 9:45 AM To: [EMAIL PROTECTED] Subject: Re: Calendar in XML/java script Hi, I've done one using one JSP page with a bean, one Servlet and some JavaScript/DHTML. If you want it, let me know and I'll send it to you, with the source code and necessary how-tos. Cheers, Paul From: Uma Munugala [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: '[EMAIL PROTECTED]' [EMAIL PROTECTED] Subject: Calendar in XML/java script Date: Mon, 20 May 2002 13:22:12 -0400 Hi All I want a help. Iam using Apache, tomcat 4.0.3 and struts on windows NT In my project i need to display a calendar and user can select any date and i need to display that on my web page. Is there any software already existing for this in XML/Java script. If so please any body point to that. Any help is very much appreciated. Thanks Uma -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ Join the world's largest e-mail service with MSN Hotmail. http://www.hotmail.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
auto-prepend (include) file
Is it possible to have a config in web.xml (or anywhere for that matter) to have a file (a JSP file) included in all the JSPs? .:| Christian J. Dechery .:| FINEP - Depto. de Sistemas .:| [EMAIL PROTECTED] .:| (21) 2555-0332
RE: just one edit.
I don't know if you can set some property in web.xml or system.xml of tomcat to only allow only one user to access a web-app or some other kind of resource at a time. I shouldn't think there were as this is contactory to what people want a webserver to do. But you could modify your webapp or bean or whatever to not let more than one user edit some data at the time using context variables. When some administrator enters the restricted code part (eg the part that modifies data) a context variable (for instance called busy) is set, and when he leaves the code part, or logs out or whatever, this context variable is deleted. When the second administrator tries to access the restricted code, he will check to see if the busy-variable is set and if it is is rejected. Else he can enter. However. You should read about concurrency problems first. (For instance in a good book about Operating Systems) as this kind of monitoring has many problems attached to it, and making a fail safe system like this is hard at the best.. Øyvind Øyvind Vestavik Øvre Møllenberggt 44b 7014 Trondheim [EMAIL PROTECTED] 41422911 On Mon, 20 May 2002, Emilio Miranda wrote: yes, there is a jsp. I have a form. It is an web application (Servlets, JSP , etc )to manage users but it could have two or more administrators so, my trouble is when two want to modify the data of one user at the same time- For example in other applications I saw message like sorry this resource is used by other user or something like that. Thanks a lot. -Mensaje original- De: Øyvind Vestavik [mailto:[EMAIL PROTECTED]] Enviado el: lunes, 20 de mayo de 2002 14:45 Para: Tomcat Users List Asunto: RE: just one edit. Just to clear things up a bit: What kind of web resource are we talking about?? Is java in the background?? Øyvind Øyvind Vestavik Øvre Møllenberggt 44b 7014 Trondheim [EMAIL PROTECTED] 41422911 On Mon, 20 May 2002, Emilio Miranda wrote: Hi, really apreciate your help. but What I mean is a case in web. It is: administrator A login to a site and modify data of some user at the same time administrator B are modifying the data of the same user. I would like some message for administrator A, something like a sorry you cant change these data right now . So I want to know if Tomcat could help me in some way Thanks a lot! -Mensaje original- De: Mike Jackson [mailto:[EMAIL PROTECTED]] Enviado el: lunes, 20 de mayo de 2002 13:32 Para: Tomcat Users List Asunto: RE: just one edit. You'll probably want to synchronize on a static object I think. Something like this: public class WhatEver { protected static Object lock = new Object(); public void doStuff() { sychronized( lock ) { // do protected stuff here } } } --mikej -=- mike jackson [EMAIL PROTECTED] -Original Message- From: Emilio Miranda [mailto:[EMAIL PROTECTED]] Sent: Monday, May 20, 2002 11:15 AM To: Tomcat Users List Subject: just one edit. Hello, I am sorry if that is an offtopic. How can I be sure that only one user is changing some data at the time? could Tomcat help me on that? I mean , supouse that one user change a name an another try to change at the same time. Thanks a lot! -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: unable to serve static pages through apache web server (Tomcat 4.0 - Apache using AJP connector)
Hi, Looks like I found out the solution myself :). To serve static pages via apache instead of tomcat, all I have to do is set the attribute forwardAll=false for ApacheConfig listener in server.xml. Listener className=org.apache.ajp.tomcat4.config.ApacheConfig forwardAll=false/ Since the flag is set to true by default and my server.xml configuration did not include this attribute, all the pages(static as well as dynamic) were served by tomcat in the tomcat-apache service mode. thanks Paresh Deshpande ( Hey Scott, once again thanks for your workaround suggestion. ) -Original Message- From: Paresh Deshpande [mailto:[EMAIL PROTECTED]] Sent: Monday, May 20, 2002 08:47 PM To: [EMAIL PROTECTED] Subject: unable to serve static pages through apache web server (Tomcat 4.0 - Apache using AJP connector) Hello, I have installed Apache web server (Apache/1.3.24 (Win32) mod_jk/1.1.0) with Tomcat as servlet engine (Apache Tomcat/4.0.3) to serve my application. I am using AJP connector to integrate tomcat with apache installation. Now regarding my problem, all my requests for static content (gifs, html files) as well as for servlets in webapp folder end up getting served by tomcat (i.e. when I type url http://localhost:8090/app1/test.html , where localhost:8090 stands for apache web server and app1 for the webapp folder for app1, I see test.html which is served by tomcat). Is it possible for apache web server to load static pages and for tomcat to serve only the servlets? Reason I want to load static pages via apache is that tomcat is case sensitive even for the static pages. If I type http://localhost:8090/app1/test.HTml , I get page not found error (and the error is served by tomcat). And in earlier versions of apache/tomcat setup, the static pages were served by apache instead of tomcat. Question is how can the page now be loaded via apache web server? Is there a way of configuring apache to serve static pages even in app1 folder / application? Or do I need to make any correction to my configuration? regards Paresh Plaese find attached : 1 server.xml 2 httpd.conf 3 auto generated mod_jk.conf server.xml configuration is as follows: Server port=8005 shutdown=SHUTDOWN debug=0 Service name=Tomcat-Apache Connector className=org.apache.ajp.tomcat4.Ajp13Connector port=8009 minProcessors=5 maxProcessors=75 acceptCount=10 debug=0/ Engine className=org.apache.catalina.core.StandardEngine name=localhost appBase=c:/program files/APPBASE/ debug=4 Host name=localhost debug=4 appBase=c:/program files/APPBASE/ unpackWARs=false Listener className=org.apache.ajp.tomcat4.config.ApacheConfig / Context path=/app1 docBase=c:/program files/APPBASE/app1 debug=4 reloadable=true/ /Host Realm className=org.apache.catalina.realm.MemoryRealm / /Engine /Service /Server *** AJP Connector related data in httpd.conf configuration is as follows : ## ## ServerName localhost ## ## ## ## ## Port 8090 ## ## ## Alias /app1 c:/program files/APPBASE/app1/ AliasMatch ^/[Aa][Pp][Pp][1]/(.*) c:/program files/APPBASE/app1/ ## AJP CONFIGURATION END LoadModule jk_module libexec/mod_jk.dll # Configure mod_jk JkWorkersFile C:/Program Files/Apache Tomcat 4.0/conf/jk/workers.properties JkLogFile C:/Program Files/Apache Tomcat 4.0/logs/mod_jk.log JkLogLevel debug JkMount /servlet/* ajp13 JkMount /app1/servlet/com.trivium.cis.* ajp13 Include C:/Program Files/Apache Tomcat 4.0/conf/auto/mod_jk.conf ## AJP CONFIGURATION END Here is auto generated mod_jk.conf file : * VirtualHost localhost ServerName localhost JkMount /app1 ajp13 JkMount /app1/* ajp13 /VirtualHost ** -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
FW: Anti-Alias Font Images on the Fly?
Hi, You can generate your image on an AWT graphics surface on the server, and use standard AWT drawing techniques, or Java2D, to make more complex images. You then need to serialise your image to a binary stream to send to the client. This can cause problems if your server doesn't have a graphical environment. Even though you can create graphics without popping up windows on the server, some graphics methods require that the host (the server) has a GUI: not generally a problem with Windows, but on a Linux/UNIX server, you need an X-Server or an emulation of an X-Server ... unless you're using JDK1.4, which provides headless mode (to create server-side graphics without an X-Server). To send your nice anti-aliased text images to the client, you need to set the appropriate content type (such as image/png) and use an output stream for the servlet response. To encode your images to the output stream, you can install the JAI (Java Advanced Imaging) API from Sun along with your JDK, which provides these methods, or if you're using JDK1.4, you could try the Image I/O API (included as standard) ; I haven't tried the latter, but it should work. Finally, creating such images demands a lot of resources (relatively speaking). You're best to try and cache the images to disk whenever you create them, and only replace them if the text to display changes. For subsequent requests, just copy the cached image to the output stream (by reading from an InputStream that points to the file in the cache). I've no example code unfortunately, but it is reasonably straightforward. -Chris - Original Message - From: Marc Elliott [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Friday, May 03, 2002 6:36 PM Subject: Anti-Alias Font Images on the Fly? Hello folks, Do any of you know of a JSP/javabean/apache solution to generating nice anti-alias type image on the fly. I'm just sick to death of continually cutting and re-cutting images because 1 -- a designer won't work with HTML type faces and 2 -- the the textual content keeps changing I also have an application for building web sites in which I'd like to offer the option of changing the pretty graphic type to the user. Any thoughts? Thanks! Marc -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Internal JVM ZipClose exception (TC 4.0.1)
Yoav, Signal 10 is a bus error on the solaris box. Basically this a is an internal data communication error in the machine. I think these errors can be software related, as well as hardware related. First off, make sure you've got all the latest patches for your operating system. After that, check there are no loose cables in the disk system inside the box. Have you added any new disks recently? After that, I'm afraid you'll need help from a Sun expert. Hope this helps, Andy -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED]] Sent: 21 May 2002 14:20 To: [EMAIL PROTECTED] Subject: Internal JVM ZipClose exception (TC 4.0.1) Hi, In the past weeks, we've gotten a couple of internal JVM exceptions running tomcat 4.0.1. The relevant part of catalina.out is attached, as well as the JVM-generated error file. As far as we can tell, this happens randomly. Any insight or information would be appreciated, as well as tips on further debugging this issue. We're going to turn the server on with some debug things enabled in server.xml, hopefully that will shed some light... Stack traces attached. Thanks in advance, Yoav Shapira ChemInformatics -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
tomcat setup problem
Hello everyone, I am trying to setup Tomcat 4.0.3 on my computer. I've already setup Apache and J2SDK1.4.0 and thats running fine. I am following the exact steps mentioned in tomcat installation guide but when I run %CATALINA_HOME%\bin\startup command it generates following error. cannot find file -Djava.endorsed.dirs=(one of its components). Make sure the path and file name are correct and that all required libraries are available. Can anyone help me out with this. I am using windows 2000 on my computer. Thanks in advance. Irfan -- === Another FREE service from Jayde Online http://www.jayde.com Private, Web-based email accounts at http://www.jaydemail.com Powered by Outblaze -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: POSTing to Tomcat 4.0.x
yes I have gotten it to work. Just write a normal servlet that handles Post requests. Client code: URL servlet = new URL(servletURL); URLConnection urlConn = servlet.openConnection(); urlConn.setDoInput(true); urlConn.setDoOutput(true); urlConn.setUseCaches(false); you should be able to handle it from there. send data and then read response HTH Todd -Original Message- From: Vjeran Marcinko [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 21, 2002 12:50 AM To: [EMAIL PROTECTED] Subject: POSTing to Tomcat 4.0.x Hi people. I asked similar question ,but since there was no reply I'm gonna try again - Has anyone successufuly executed POST to Tomcat 4.0.x from some java app using URLConnection class ? I would really like to see this piece of code, since I used some code that I found on the web and it worked with Tomcat3.2.x, but not with 4.0.x version of Tomcat Thanx, Vjeran -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Help with streaming mp3
I have a very strange problem that I hope someone can help with. I have a servlet that streams (using ServletOutputStream) various web and media files (mp3, mpegs, etc..). The media files are not in the web dir. This servlet is designed to restrict access to the media files. For most files this works, but for mp3s, it is not working properly. It's stream most mp3 fine, but about 20% of the time, it will have a 50 sec delay. There should be no delay (I'm on the same network). Other files types (asf, mwf, mpegs, etc..) seem to work fine. Below is the servlet code. I'm at a loss. Please help. :) Oh, a few notes. 1) I'm using JBoss-2.4.4 with embeded Tomcat. 2) This code work when I were using weblogic and seem to appear when we ported to jboss. 3) we are using media player to play the media files. -chris === public void service(HttpServletRequest request, HttpServletResponse response) { code here to check if the user has permission to get hiddne media file and get the files path.. if (!physicalFile.exists()) { element_error(Error: Cannot find physical file for requested element.,response); return; } fileSize = physicalFile.length(); mimeType = MimeType.getMimeType(physicalFile.getPath()); if (mimeType.equals(application/octet-stream)) { response.setHeader(Content-Disposition, filename= + physicalFile.getName()); } FileInputStream in = null; BufferedInputStream input = null; ServletOutputStream output = null; try { in = new FileInputStream(physicalFile.getPath()); input = new BufferedInputStream(in, BUFFER_SIZE); output = response.getOutputStream(); } catch (Exception e) { element_error(Error getting streams,response); element_error(e.toString(),response); return; } //response.setHeader(X-Testing, this is a test change); response.setHeader(Keep-Alive, timeout=10, max=20); response.setHeader(Connection, Close); response.setHeader(Accept-Ranges,bytes); response.setHeader(Content-Length,String.valueOf(physicalFile.length())); response.setHeader(Content-Type, mimeType); System.out.println(sending file: + physicalFile.getPath()); System.out.println(file type: + mimeType); try { while ((bytesRead = input.read(buffer)) != -1) { readCount++; System.out.println(before write:); output.write(buffer, 0, bytesRead); System.out.println(after write:); System.out.println(readCount); System.out.println(bytesRead); } } catch (Exception e) { //e.printStackTrace(new PrintWriter(System.out)); System.out.println(caught exception during write: + e.toString()); System.out.println(reads= + readCount + bytesRead= + readCount * BUFFER_SIZE); System.out.println(mimeType= + mimeType + file= + physicalFile.getPath()); return; } //input.close(); //in.close(); try { output.flush(); output.close(); System.out.println(ending..); //response.flushBuffer(); } catch (IOException e) { System.out.println(error closing input stream - + e.toString()); } } -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: JDBCRealm and Oracle Not working
Thanks for the reply. NOTE: You would think that the JDBCRealm would only need the Oracle driver in the ~/lib dir? Also, I would wish the Java Exception would be something like a DRIVER NOT FOUND EXCEPTION instead of an incorrect exception that makes you think it is something else... In fact I'm a little confused that the stack trace would include: java.sql.SQLException: oracle.jdbc.driver.OracleDriver (See below) This makes me think it is indeed some kind of CLASS LOADING issue? Because if the driver was indeed in the wrong place how could the stack trace find the java.sql.SQLException: oracle.jdbc.driver.OracleDriver Exception? h When I get time I'm going to get into the code on this one -CP [EMAIL PROTECTED] 05/21/02 12:29AM Chad Perry wrote: Ok, you need to put the classes12_01.jar file in the ~/common/lib dir also. On install, the classes12_01.jar is in the ~/lib, which is NOT enough to get the JDBCRealm working with Oracle. WHY you need that jar in both places: ~/lib and ~/common/lib is still a mystery/issue! Could anyone shed some like on this issue? I am reporting (hope I got it right) what I learned form earlier threads: lib is for jar that you want tomcat to load common/lib is for jars that you want tomcat AND your app to load WEB-INF/lib is for jars that you want your app to load PS: Here is a interesting discussion on this issue: http://groups.google.com/groups?q=Tomcat+Realm+4hl=enlr=ie=UTF8oe=UTF8selm=5Rzc8.12%24U83.40693%40mencken.net.nih.govrnum=3 Thanks! -CP [EMAIL PROTECTED] 05/20/02 07:22AM By default the drvier (classes12_01.jar) is placed in Apache Tomcat 4.0\lib. I can connect to Oracle just fine in a JSP or servlet! It is the JDBCRealm functionality that is broken. :-( -Late From: Umberto Nicoletti [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Subject: Re: JDBCRealm and Oracle Not working Date: Mon, 20 May 2002 09:40:53 +0200 MIME-Version: 1.0 Received: from [192.18.49.131] by hotmail.com (3.2) with ESMTP id MHotMailBEB1F421001340043721C0123183E4A90; Mon, 20 May 2002 00:43:34 -0700 Received: (qmail 5127 invoked by uid 97); 20 May 2002 07:43:22 - Received: (qmail 5115 invoked by uid 98); 20 May 2002 07:43:22 - From tomcat-user-return-20073-chadhperry Mon, 20 May 2002 00:45:26 -0700 Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm Precedence: bulk List-Unsubscribe: mailto:[EMAIL PROTECTED] List-Subscribe: mailto:[EMAIL PROTECTED] List-Help: mailto:[EMAIL PROTECTED] List-Post: mailto:[EMAIL PROTECTED] List-Id: Tomcat Users List tomcat-user.jakarta.apache.org Delivered-To: mailing list [EMAIL PROTECTED] X-Antivirus: nagoya (v4198 created Apr 24 2002) Message-ID: [EMAIL PROTECTED] X-Mailer: Mozilla 4.74 [en] (WinNT; U) X-Accept-Language: en References: [EMAIL PROTECTED] X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hi, You must put the jdbc driver in a place where tomcat can find it. As of my experience a suitable place is TOMCAT_HOME/lib or common/lib (or something like that). Regards, umberto Chad Perry wrote: Trying to get Oracle 8i to work with with the JDBCRealm: Tomcat 4.0.4b3 JDK 1.4.0 OS Win2000 Server I guess tomcat-JDBCRealm doesn't work with Oracle? It would be AWESOME if I could get this to work! Could somebody verify that I'm not dorking out? Thanks!! Here is my Realm element: Realm className=org.apache.catalina.realm.JDBCRealm debug=99 driverName=oracle.jdbc.driver.OracleDriver connectionURL=jdbc:oracle:thin:@192.168.0.10:1521:TestDB connectionName=X connectionPassword=X userTable=GOLDEN.APP_USER userNameCol=USER_NAME userCredCol=PASSWORD_TXT userRoleTable=GOLDEN.APP_ROLE roleNameCol=ROLE_NAME/ EXCEPTION BELOW - Occurs on Start up: Starting service Tomcat-Standalone Apache Tomcat/4.0.4-b3 Starting service Tomcat-Apache Apache Tomcat/4.0.4-b3 Catalina.start: LifecycleException: Exception opening database connection: java.sql.SQLException: oracle.jdbc.driver.OracleDriver LifecycleException: Exception opening database connection: java.sql.SQLException: oracle.jdbc.driv er.OracleDriver at org.apache.catalina.realm.JDBCRealm.start(JDBCRealm.java:615) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1108) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:343) at org.apache.catalina.core.StandardService.start(StandardService.java:388) at org.apache.catalina.core.StandardServer.start(StandardServer.java:506) at org.apache.catalina.startup.Catalina.start(Catalina.java:781) at org.apache.catalina.startup.Catalina.execute(Catalina.java:681) at
RE: tomcat setup problem
Is there any sample for connecting Tomcat with Apache via TCP/IP with the Apache API? Thanks, Pablo -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: just one edit.
Are you talking about persistent data? I.e. Are you talking about database concurrency? -Original Message- From: Emilio Miranda [mailto:[EMAIL PROTECTED]] Sent: Tuesday, 21 May 2002 5:39 AM To: Tomcat Users List Subject: RE: just one edit. Hi, really apreciate your help. but What I mean is a case in web. It is: administrator A login to a site and modify data of some user at the same time administrator B are modifying the data of the same user. I would like some message for administrator A, something like a sorry you cant change these data right now . So I want to know if Tomcat could help me in some way Thanks a lot! -Mensaje original- De: Mike Jackson [mailto:[EMAIL PROTECTED]] Enviado el: lunes, 20 de mayo de 2002 13:32 Para: Tomcat Users List Asunto: RE: just one edit. You'll probably want to synchronize on a static object I think. Something like this: public class WhatEver { protected static Object lock = new Object(); public void doStuff() { sychronized( lock ) { // do protected stuff here } } } --mikej -=- mike jackson [EMAIL PROTECTED] -Original Message- From: Emilio Miranda [mailto:[EMAIL PROTECTED]] Sent: Monday, May 20, 2002 11:15 AM To: Tomcat Users List Subject: just one edit. Hello, I am sorry if that is an offtopic. How can I be sure that only one user is changing some data at the time? could Tomcat help me on that? I mean , supouse that one user change a name an another try to change at the same time. Thanks a lot! -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Tomcat 4 problem?--Graphics randomly fail to load
Hi everyone, I've encountered a bizarre problem with Tomcat 4 stand-alone, regarding the loading of graphics. Some of the graphics for my site wil load, while others will not, as if they weren't located on the server. After thorough experimentation with what's NOT happening, I'm forced to believe that it's the server that's causing the problem. I searched the tomcat list archives and couldn't find a similar report, so I'm hoping that someone out there has experienced this anomaly. Your feedback is much appreciated. Just to clarify what is NOT happening: 1. The graphics (.gif format) are properly located on the server, in valid file formats, with correct permissions. 2. When forcing the server to load a graphic, either by selecting Show Picture from the browser's context menu or accessing a single graphic through a URL request, the graphic loads correctly every time. 3. This symptom may occur even on tiled images, such as body background graphics. Some of the tiles draw, while others do not. This symptom is present on IE5 and Netscape 6.2, tested on Win2k and MacOS X. 4. The problem occurs randomly; it does not seem to be predictable/reproduceable. A graphic will load correctly in one instance and fail to load in another. _ scott judd programmer the american education corporation
RE: just one edit.
oh no , The idea of Øyvind Vestavik is what I am talking about, In fact I try something like that, but the problems that he mentioned are reals. Well, I really apreciate your help of all of you, if I find something I will share the solution :) thanks a lot! -Mensaje original- De: Amit Kelkar [mailto:[EMAIL PROTECTED]] Enviado el: martes, 21 de mayo de 2002 11:32 Para: Tomcat Users List Asunto: RE: just one edit. Are you talking about persistent data? I.e. Are you talking about database concurrency? -Original Message- From: Emilio Miranda [mailto:[EMAIL PROTECTED]] Sent: Tuesday, 21 May 2002 5:39 AM To: Tomcat Users List Subject: RE: just one edit. Hi, really apreciate your help. but What I mean is a case in web. It is: administrator A login to a site and modify data of some user at the same time administrator B are modifying the data of the same user. I would like some message for administrator A, something like a sorry you cant change these data right now . So I want to know if Tomcat could help me in some way Thanks a lot! -Mensaje original- De: Mike Jackson [mailto:[EMAIL PROTECTED]] Enviado el: lunes, 20 de mayo de 2002 13:32 Para: Tomcat Users List Asunto: RE: just one edit. You'll probably want to synchronize on a static object I think. Something like this: public class WhatEver { protected static Object lock = new Object(); public void doStuff() { sychronized( lock ) { // do protected stuff here } } } --mikej -=- mike jackson [EMAIL PROTECTED] -Original Message- From: Emilio Miranda [mailto:[EMAIL PROTECTED]] Sent: Monday, May 20, 2002 11:15 AM To: Tomcat Users List Subject: just one edit. Hello, I am sorry if that is an offtopic. How can I be sure that only one user is changing some data at the time? could Tomcat help me on that? I mean , supouse that one user change a name an another try to change at the same time. Thanks a lot! -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Tomcat 4 problem?--Graphics randomly fail to load
Howdy, What happens if you tell the browser to not cache images at all, i.e. always go back to the server? Yoav Shapira ChemInformatics -Original Message- From: Scott Judd [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 21, 2002 12:38 PM To: [EMAIL PROTECTED] Subject: Tomcat 4 problem?--Graphics randomly fail to load Hi everyone, I've encountered a bizarre problem with Tomcat 4 stand-alone, regarding the loading of graphics. Some of the graphics for my site wil load, while others will not, as if they weren't located on the server. After thorough experimentation with what's NOT happening, I'm forced to believe that it's the server that's causing the problem. I searched the tomcat list archives and couldn't find a similar report, so I'm hoping that someone out there has experienced this anomaly. Your feedback is much appreciated. Just to clarify what is NOT happening: 1. The graphics (.gif format) are properly located on the server, in valid file formats, with correct permissions. 2. When forcing the server to load a graphic, either by selecting Show Picture from the browser's context menu or accessing a single graphic through a URL request, the graphic loads correctly every time. 3. This symptom may occur even on tiled images, such as body background graphics. Some of the tiles draw, while others do not. This symptom is present on IE5 and Netscape 6.2, tested on Win2k and MacOS X. 4. The problem occurs randomly; it does not seem to be predictable/reproduceable. A graphic will load correctly in one instance and fail to load in another. _ scott judd programmer the american education corporation -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Tomcat 4 problem?--Graphics randomly fail to load
Scott, If your server is running on Windows, I believe this is a common connector issue. It certainly happens to me with mod_webapp. It doesn't happen on the production Linux server though, so it's not an issue for me. Andy -Original Message- From: Scott Judd [mailto:[EMAIL PROTECTED]] Sent: 21 May 2002 17:38 To: [EMAIL PROTECTED] Subject: Tomcat 4 problem?--Graphics randomly fail to load Hi everyone, I've encountered a bizarre problem with Tomcat 4 stand-alone, regarding the loading of graphics. Some of the graphics for my site wil load, while others will not, as if they weren't located on the server. After thorough experimentation with what's NOT happening, I'm forced to believe that it's the server that's causing the problem. I searched the tomcat list archives and couldn't find a similar report, so I'm hoping that someone out there has experienced this anomaly. Your feedback is much appreciated. Just to clarify what is NOT happening: 1. The graphics (.gif format) are properly located on the server, in valid file formats, with correct permissions. 2. When forcing the server to load a graphic, either by selecting Show Picture from the browser's context menu or accessing a single graphic through a URL request, the graphic loads correctly every time. 3. This symptom may occur even on tiled images, such as body background graphics. Some of the tiles draw, while others do not. This symptom is present on IE5 and Netscape 6.2, tested on Win2k and MacOS X. 4. The problem occurs randomly; it does not seem to be predictable/reproduceable. A graphic will load correctly in one instance and fail to load in another. _ scott judd programmer the american education corporation -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
reloadable=true just not working. Any ideas gentlefolk?
Below is a snippet from my conf/server.xml file. From all the docs I've read, and the examples, this should work. However the tomcat class loader does not recognize newly compiled class files and still uses the cached versions. Can anyone spot a problem with the xml below? It parses upon startup. But to get the newly compiled classes cached I have to restart the server. and whether thru cmd line or manager web app, this is not want I want to do during development. TIA Ray Context path=/BugTracker docBase=/app/tomcat/jakarta-tomcat/dist/webapps/BugTracker/ debug=0 reloadable=true / ps above is the full path to the webapp, however I have tried the relative as well. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Tomcat stops accepting connections with 218 java processes running
Hi guys, I have a nagging problem. I am running Tomcat 3.3 with Apache 1.3 on Redhat 7.2, kernel 2.4.17, Sun's Java 1.3.1 The problem I am having is that sometimes Tomcat refuses to spawn new java thread. If I look at the processes there would be exactly 218 java processes/threads running. Looks like this is the maximum number of processes Tomcat and/or java can spawn. Restarting Tomcat helps - until next time. I suspect that some .jsp and/or servlets do not properly quit/close/free resources and Tomcat still thinks they are running and cannot clear those threads up. Workaround, I thought, would be to bump up maximum number of Tomcat threads. I do restart Tomcat every night after logrotate, so I thought if I set maxThreads to something bigger than default (200, according to Tomcat docs), it would be enough to keep me running. Here is a snippet from my server.xml: Ajp12Connector port=8007 ajpidFile=/usr/local/tomcat/conf/ajp12.id address=127.0.0.1 maxThreads=1 tomcatAuthentication=false / Ajp13Connector port=8009 address=127.0.0.1 maxSpareThreads=10 maxThreads=400 tomcatAuthentication=false / Setting maxThreads for Ajp13 connector to 400 did not change anything. Still, every once in a while I will have 218 java threads an Tomcat will stop taking new connections. I have a couple of questions regarding this stuff: 1. How do I increase the number of Tomcat threads? Where does number 218 come from? 2. Is there any way to tell what each java thread running? This way I could tell programmers what ties Tomcat up so they can fix the code - I am not much of a programmer :-(. Am I looking in the correct direction at all? Could it be something completely different?
Re: Tomcat 4 problem?--Graphics randomly fail to load
My files set the NO-CACHE meta tag, and my browser prefs are configured to always request new information (i.e., no caching of files). The problem is still present. scott From: Shapira, Yoav [EMAIL PROTECTED] What happens if you tell the browser to not cache images at all, i.e. always go back to the server? -Original Message- From: Scott Judd [mailto:[EMAIL PROTECTED]] Hi everyone, I've encountered a bizarre problem with Tomcat 4 stand-alone, regarding the loading of graphics. Some of the graphics for my site wil load, while others will not, as if they weren't located on the server. After thorough experimentation with what's NOT happening, I'm forced to believe that it's the server that's causing the problem. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Syntax for turning off caching in Tomcat 4.0.3?
Hi, The Tomcat 4.0 documentation describes a parameter to turn off caching using the Resources component. The documentation appears at: http://jakarta.apache.org/tomcat/tomcat-4.0-doc/config/resources.html However, we haven't been able to find an XML clause to add to server.xml that succeeds in turning off caching. For example, shouldn't this work? Context path= docBase=ROOT debug=0 Resources cached=false/ /Context Also, is there an easy way to dump the state of a Tomcat server so we can see if caching is currently on or off? Thanks for any help, Eric Bier PARC Incorporated -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Tomcat 4 problem?--Graphics randomly fail to load
We have seen the same problem on windows too. It happens randomly. I think it is a problem with the HTTP connector. -prabhakar I've encountered a bizarre problem with Tomcat 4 stand-alone, regarding the loading of graphics. Some of the graphics for my site wil load, while others will not, as if they weren't located on the server. After thorough experimentation with what's NOT happening, I'm forced to believe that it's the server that's causing the problem. I searched the tomcat list archives and couldn't find a similar report, so I'm hoping that someone out there has experienced this anomaly. Your feedback is much appreciated. Just to clarify what is NOT happening: 1. The graphics (.gif format) are properly located on the server, in valid file formats, with correct permissions. 2. When forcing the server to load a graphic, either by selecting Show Picture from the browser's context menu or accessing a single graphic through a URL request, the graphic loads correctly every time. 3. This symptom may occur even on tiled images, such as body background graphics. Some of the tiles draw, while others do not. This symptom is present on IE5 and Netscape 6.2, tested on Win2k and MacOS X. 4. The problem occurs randomly; it does not seem to be predictable/reproduceable. A graphic will load correctly in one instance and fail to load in another. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Tomcat 4 problem?--Graphics randomly fail to load
Hi Andy, Thanks so much for the input. My server is running on Win2k Server, so I'll certainly research the connector issue; however since I'm running Tomcat as a stand-alone, I'm not using mod_webapp. OTOH, it will save me a lot of time not to bother with configuring a tomcat-on-apache server to see what happens. scott - Original Message - From: Andy Eastham [EMAIL PROTECTED] Scott, If your server is running on Windows, I believe this is a common connector issue. It certainly happens to me with mod_webapp. It doesn't happen on the production Linux server though, so it's not an issue for me. Andy -Original Message- From: Scott Judd [mailto:[EMAIL PROTECTED]] Sent: 21 May 2002 17:38 To: [EMAIL PROTECTED] Subject: Tomcat 4 problem?--Graphics randomly fail to load Hi everyone, I've encountered a bizarre problem with Tomcat 4 stand-alone, regarding the loading of graphics. Some of the graphics for my site wil load, while others will not, as if they weren't located on the server. After thorough experimentation with what's NOT happening, I'm forced to believe that it's the server that's causing the problem. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: unable to serve static pages through apache web server (Tomca t 4.0 - Apache using AJP connector)
You also need to set forwardAll=false for ALL Listeners you have defined (for specific Contexts especially). Roger Whitcomb Computer Associates Senior Software Engineer Development Phone: +1 408 965 8653 FAX: +1 408 965 8805 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] -Original Message- From: Paresh Deshpande [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 21, 2002 6:46 AM To: Tomcat Users List Subject: RE: unable to serve static pages through apache web server (Tomca t 4.0 - Apache using AJP connector) Hi, Looks like I found out the solution myself :). To serve static pages via apache instead of tomcat, all I have to do is set the attribute forwardAll=false for ApacheConfig listener in server.xml. Listener className=org.apache.ajp.tomcat4.config.ApacheConfig forwardAll=false/ Since the flag is set to true by default and my server.xml configuration did not include this attribute, all the pages(static as well as dynamic) were served by tomcat in the tomcat-apache service mode. thanks Paresh Deshpande ( Hey Scott, once again thanks for your workaround suggestion. ) -Original Message- From: Paresh Deshpande [mailto:[EMAIL PROTECTED]] Sent: Monday, May 20, 2002 08:47 PM To: [EMAIL PROTECTED] Subject: unable to serve static pages through apache web server (Tomcat 4.0 - Apache using AJP connector) Hello, I have installed Apache web server (Apache/1.3.24 (Win32) mod_jk/1.1.0) with Tomcat as servlet engine (Apache Tomcat/4.0.3) to serve my application. I am using AJP connector to integrate tomcat with apache installation. Now regarding my problem, all my requests for static content (gifs, html files) as well as for servlets in webapp folder end up getting served by tomcat (i.e. when I type url http://localhost:8090/app1/test.html , where localhost:8090 stands for apache web server and app1 for the webapp folder for app1, I see test.html which is served by tomcat). Is it possible for apache web server to load static pages and for tomcat to serve only the servlets? Reason I want to load static pages via apache is that tomcat is case sensitive even for the static pages. If I type http://localhost:8090/app1/test.HTml , I get page not found error (and the error is served by tomcat). And in earlier versions of apache/tomcat setup, the static pages were served by apache instead of tomcat. Question is how can the page now be loaded via apache web server? Is there a way of configuring apache to serve static pages even in app1 folder / application? Or do I need to make any correction to my configuration? regards Paresh Plaese find attached : 1 server.xml 2 httpd.conf 3 auto generated mod_jk.conf server.xml configuration is as follows: Server port=8005 shutdown=SHUTDOWN debug=0 Service name=Tomcat-Apache Connector className=org.apache.ajp.tomcat4.Ajp13Connector port=8009 minProcessors=5 maxProcessors=75 acceptCount=10 debug=0/ Engine className=org.apache.catalina.core.StandardEngine name=localhost appBase=c:/program files/APPBASE/ debug=4 Host name=localhost debug=4 appBase=c:/program files/APPBASE/ unpackWARs=false Listener className=org.apache.ajp.tomcat4.config.ApacheConfig / Context path=/app1 docBase=c:/program files/APPBASE/app1 debug=4 reloadable=true/ /Host Realm className=org.apache.catalina.realm.MemoryRealm / /Engine /Service /Server *** AJP Connector related data in httpd.conf configuration is as follows : ## ## ServerName localhost ## ## ## ## ## Port 8090 ## ## ## Alias /app1 c:/program files/APPBASE/app1/ AliasMatch ^/[Aa][Pp][Pp][1]/(.*) c:/program files/APPBASE/app1/ ## AJP CONFIGURATION END LoadModule jk_module libexec/mod_jk.dll # Configure mod_jk JkWorkersFile C:/Program Files/Apache Tomcat 4.0/conf/jk/workers.properties JkLogFile C:/Program Files/Apache Tomcat 4.0/logs/mod_jk.log JkLogLevel debug JkMount /servlet/* ajp13 JkMount /app1/servlet/com.trivium.cis.* ajp13 Include C:/Program Files/Apache Tomcat 4.0/conf/auto/mod_jk.conf ## AJP CONFIGURATION END Here is auto generated mod_jk.conf file : * VirtualHost localhost ServerName localhost JkMount /app1 ajp13 JkMount /app1/* ajp13 /VirtualHost ** -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
HELP! Apache Virtual Server setup using Ajp13
All, I'm new to JBoss/Tomcat and need some help in the setup phase. Below I included the CONFIG and ERROR that I am getting. I installed the following: JBoss-2.4.4_Tomcat-4.0.1 jdk1.3.1_03 I can start the app server by doing run_with_catalina.sh in the JBoss-2.4.4_Tomcat-4.0.1/jboss/bin directory. Then by accessing http://localhost:8001/test.jsp I see the appropriate page. But I need to setup Virtual servers to use it with different Document Roots. APACHE CONFIG This is what I have tried so far: # Load mod_jk LoadModulejk_module modules/mod_jk.so AddModule mod_jk.c # Configure mod_jk JkWorkersFile /usr/local/src/JBoss-2.4.4_Tomcat-4.0.1/catalina/conf/workers.properties JkLogFile /usr/local/apache/logs/mod_jk.log JkLogLeveldebug #JkLogLevelinfo NameVirtualHost 209.220.157.67 VirtualHost 209.220.157.67:80 ServerAdmin [EMAIL PROTECTED] DocumentRoot /home/sites/mysite.com/public_html ServerName mysite.com ServerAlias www.mysite.com ScriptAlias /cgi-bin/ /home/sites/mysite.com/cgi-bin/ ErrorLog /home/sites/mysite.com/logs/error_log TransferLog /home/sites/mysite.com/logs/access_log JkMount /*.jsp ajp13 JkMount /servlet/* ajp13 /VirtualHost MOD_JK ERROR This is the error that I get when I hit the server trying to access a page on port 80: [Tue May 21 11:16:00 2002] [jk_uri_worker_map.c (351)]: Into jk_uri_worker_map_t::map_uri_to_worker [Tue May 21 11:16:00 2002] [jk_uri_worker_map.c (368)]: Attempting to map URI '/test.jsp' [Tue May 21 11:16:00 2002] [jk_uri_worker_map.c (416)]: jk_uri_worker_map_t::map_uri_to_worker, Found a suffix match ajp13 - *.jsp [Tue May 21 11:16:00 2002] [jk_worker.c (123)]: Into wc_get_worker_for_name ajp13 [Tue May 21 11:16:00 2002] [jk_worker.c (127)]: wc_get_worker_for_name, done found a worker [Tue May 21 11:16:00 2002] [jk_ajp13_worker.c (865)]: Into jk_worker_t::get_endpoint [Tue May 21 11:16:00 2002] [jk_ajp13_worker.c (775)]: Into jk_endpoint_t::service [Tue May 21 11:16:00 2002] [jk_ajp13.c (403)]: Into ajp13_marshal_into_msgb [Tue May 21 11:16:00 2002] [jk_ajp13.c (537)]: ajp13_marshal_into_msgb - Done [Tue May 21 11:16:00 2002] [jk_connect.c (108)]: Into jk_open_socket [Tue May 21 11:16:00 2002] [jk_connect.c (115)]: jk_open_socket, try to connect socket = 6 [Tue May 21 11:16:00 2002] [jk_connect.c (124)]: jk_open_socket, after connect ret = -1 [Tue May 21 11:16:00 2002] [jk_connect.c (143)]: jk_open_socket, connect() failed errno = 111 [Tue May 21 11:16:00 2002] [jk_ajp13_worker.c (196)]: In jk_endpoint_t::connect_to_tomcat, failed errno = 111 [Tue May 21 11:16:00 2002] [jk_ajp13_worker.c (635)]: Error connecting to the Tomcat process. Thanks, -pete -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: reloadable=true just not working. Any ideas gentlefolk?
I don't have the answer to why reloading isn't working, but I can recommend using the tomcat manager app to remove and install your app to freshen it. That doesn't require a restart of tomcat. One important note though, if your webapp's main directly exists, this won't work. You have to blow away that directory after you remove. I just have ant blow away the directory and drop a fresh .war in the webapps/ dir, then manager-remove, then manager-install. The only downside is that I haven't worked out why my db pool object doesn't release its connections. Thus, each time I do it I burn 3 database connections :) Michael --- Ray Letts [EMAIL PROTECTED] wrote: Below is a snippet from my conf/server.xml file. From all the docs I've read, and the examples, this should work. However the tomcat class loader does not recognize newly compiled class files and still uses the cached versions. Can anyone spot a problem with the xml below? It parses upon startup. But to get the newly compiled classes cached I have to restart the server. and whether thru cmd line or manager web app, this is not want I want to do during development. TIA Ray Context path=/BugTracker docBase=/app/tomcat/jakarta-tomcat/dist/webapps/BugTracker/ debug=0 reloadable=true / ps above is the full path to the webapp, however I have tried the relative as well. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
How to use Properties Object in a bean from a jsp
Hello, I am using the Properties object in a javabean that is being included in a jsp. How can the javabean get the base directory of the webserver in order to pass it to the Properties Object? Thanks for your help. Adam __ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
tomcat log analyzer
Hello List, Does anyone know if there is a log analyzer written in JAVA for tomcat (4 or otherwise)? I know about Weblizer and AWStats, but they aren't written in Java... Thanks, ...Robin -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Conncurency issue with tomcat???
Hi Raj, Which jvm are you using? I remember sun jvm 1.3.0 had an issue with HttpUrlConnection something I worked on. Upgrading to the latested jvm 1.3.1_whatever solved it... Regards, Dan On Tue, 21 May 2002, Ghorpade, Rajendra wrote: Hi Remy,Peter After some research I found out that there were no more concurrent session problems and the same request processed twice problem when I changed my simulator(test program) to use HttpClient API. There could be the a bug in implementaion of java.net.HttpUrlConenction. I tried HttpUrlConnection with the Coyote connector and I got the concurrent session problem and the same request being processed twice problem. When I used the API from HttpClient for connection I go no concurrent issues and the test run realibaly with 90 concurrent users. Thanx for ur valuable comment on this subject... Raj -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: reloadable=true just not working. Any ideas gentlefolk?
I don't believe the class loader recognizes any new code other than servlets and jsp files. If you have new classes called by servlets, they won't be reloaded. If you search in the archives, you should find a lot of discussions on this topic. If you have servlets or jsp's that aren't reloading, I'm not sure what may be going wrong. Best Regards, Jason Koeninger JJ Computer Consulting http://www.jjcc.com --- Ray Letts [EMAIL PROTECTED] wrote: Below is a snippet from my conf/server.xml file. From all the docs I've read, and the examples, this should work. However the tomcat class loader does not recognize newly compiled class files and still uses the cached versions. Can anyone spot a problem with the xml below? It parses upon startup. But to get the newly compiled classes cached I have to restart the server. and whether thru cmd line or manager web app, this is not want I want to do during development. TIA Ray Context path=/BugTracker docBase=/app/tomcat/jakarta-tomcat/dist/webapps/BugTracker/ debug=0 reloadable=true / ps above is the full path to the webapp, however I have tried the relative as well. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
HttpSession invalidate bug???
Hello, I'm calling session.getMaxInactiveInterval() on a session after it has been invalidated. Tomcat is throwing an IllegalStateException and saying that method cannot be called on an invalid session. However, the Servlet 2.3 API docs do not state that IllegalStateException should be thrown (as it is with many other methods in HttpSession) from getMaxInactiveInterval(). The reason I've run into this problem is because I'm trying to write a HttpSessionAttributeListener that determines if the session is being explicitly invalidated or if it timed out. The Servlet 2.3 spec (section 10.7) states, It is often useful in tracking sessions to know whether a session became invalid because the container timed out the session, or because a web component within the application called the invalidate method. The destinction may be determined indirectly using listeners and the HTTPSession API methods. If I can't call getMaxInactiveInterval() on an invalidated session, how can I determine if the session was invalidated due to time out? Is this a bug in Tomcat? It seems so since it doesn't follow the API docs for this call. Thanks in advance for any insight. Chris Wilson [EMAIL PROTECTED] www.wondergeek.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: HttpSession invalidate bug???
Hi Chris, Session.invalidate() is being called by Tomcat on session timeout, which is the same call that is given when you implicitly invalidate the session in your servlet code. Once session.invalidate() has been called, you no longer have any session properties to get, including your session listener. Also, you're gonna need to add some properties to your session object to determine how/why the session was invalidated. Just using the API calls without any support staff will not be sufficient. scott - Original Message - From: Chris Wilson [EMAIL PROTECTED] To: tomcat [EMAIL PROTECTED] Sent: Tuesday, May 21, 2002 2:38 PM Subject: HttpSession invalidate bug??? Hello, I'm calling session.getMaxInactiveInterval() on a session after it has been invalidated. Tomcat is throwing an IllegalStateException and saying that method cannot be called on an invalid session. However, the Servlet 2.3 API docs do not state that IllegalStateException should be thrown (as it is with many other methods in HttpSession) from getMaxInactiveInterval(). The reason I've run into this problem is because I'm trying to write a HttpSessionAttributeListener that determines if the session is being explicitly invalidated or if it timed out. The Servlet 2.3 spec (section 10.7) states, It is often useful in tracking sessions to know whether a session became invalid because the container timed out the session, or because a web component within the application called the invalidate method. The destinction may be determined indirectly using listeners and the HTTPSession API methods. If I can't call getMaxInactiveInterval() on an invalidated session, how can I determine if the session was invalidated due to time out? Is this a bug in Tomcat? It seems so since it doesn't follow the API docs for this call. Thanks in advance for any insight. Chris Wilson [EMAIL PROTECTED] www.wondergeek.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Bug report for Windows http connector?
Does anyone know of a bug report that has been submitted for the faulty http connector on Tomcat 4? After browsing the bug report database, I didn't see anything, and I'd prefer not to make a redundant submission if there's already an open case. scott
Re: Bug report for Windows http connector?
Sorry for the extra noise to the list -- that should be the faulty http connector on Tomcat 4 (Windows version). thanks, scott - Original Message - From: Scott Judd [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Tuesday, May 21, 2002 3:43 PM Subject: Bug report for Windows http connector? Does anyone know of a bug report that has been submitted for the faulty http connector on Tomcat 4? After browsing the bug report database, I didn't see anything, and I'd prefer not to make a redundant submission if there's already an open case. scott -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: HttpSession invalidate bug???
See my comments below... Chris Wilson [EMAIL PROTECTED] www.wondergeek.com -Original Message- From: Scott Judd [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 21, 2002 3:17 PM To: Tomcat Users List Subject: Re: HttpSession invalidate bug??? Hi Chris, Session.invalidate() is being called by Tomcat on session timeout, which is the same call that is given when you implicitly invalidate the session in your servlet code. Sure that makes sense, that's what I understood was happening... I don't think that's the problem though. I fully expect the session to be invalid. Once session.invalidate() has been called, you no longer have any session properties to get, including your session listener. Also, you're gonna need to add some properties to your session object to determine how/why the session was invalidated. This is the problem... The Servlet spec implies (10.7) that you CAN use at least some of the HttpSession API's to determine if the session is invalid because it timed out. I assume that you would do that with the following code... if((System.currentTimeMillis() - session.getLastAccessedTime()) session.getMaxInactiveInterval()) { // session timed out } If I run that code on an invalidated session the getLastAccessedTime() call works just fine (the javadocs say that it does not throw any exceptions) which is expected. However, the getMaxInactiveInterval() call fails with an InvalidStateException (this is thrown even though the javadocs DO NOT specify that it should be) which is not expected. It seems to be that there is no way for me to determine if a session is invalid (because it timed out) in a listener without getMaxInactiveInterval(). Now either the spec (10.7) is referring to some other combination of calls, or the javadocs are wrong, or Tomcat is throwing an IllegalStateException when it shouldn't be (most likely). So my question is if the Tomcat developers can justify why getMaxInactiveInterval() should throw an exception when called on an invalid session, how can I achieve section 10.7 in the spec? Just using the API calls without any support staff will not be sufficient. Again, this is not what the spec implies. It says I should be able to do it with HttpSession directly. Thanks for the help! scott - Original Message - From: Chris Wilson [EMAIL PROTECTED] To: tomcat [EMAIL PROTECTED] Sent: Tuesday, May 21, 2002 2:38 PM Subject: HttpSession invalidate bug??? Hello, I'm calling session.getMaxInactiveInterval() on a session after it has been invalidated. Tomcat is throwing an IllegalStateException and saying that method cannot be called on an invalid session. However, the Servlet 2.3 API docs do not state that IllegalStateException should be thrown (as it is with many other methods in HttpSession) from getMaxInactiveInterval(). The reason I've run into this problem is because I'm trying to write a HttpSessionAttributeListener that determines if the session is being explicitly invalidated or if it timed out. The Servlet 2.3 spec (section 10.7) states, It is often useful in tracking sessions to know whether a session became invalid because the container timed out the session, or because a web component within the application called the invalidate method. The destinction may be determined indirectly using listeners and the HTTPSession API methods. If I can't call getMaxInactiveInterval() on an invalidated session, how can I determine if the session was invalidated due to time out? Is this a bug in Tomcat? It seems so since it doesn't follow the API docs for this call. Thanks in advance for any insight. Chris Wilson [EMAIL PROTECTED] www.wondergeek.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
***Please reply as no one on this list has offered ANY help***
Hello, I'm having touble with my HTTP tunnelling servlet and its driving me crazy. The tunnel works fine for a single user. However when another user connects to the tunnel the servlet does not perform how I would expect it to. The problem is, that when another user sends a message. ALL instances of the variables seem to swap over to the most recent. However the threads still all run. So, if mr x and mr y are in a meeting. Mr x joined first, he says 'hello'. Hello is sent and recieved once how I would expect it to do it. However, now mr y joins and says 'hello'. and he recieves the messages for himself AND for mr x. This is driving me insane and I can't seem to find a way around it, I don't understand why the entire data structure is being overwritten when it is a different request for a different user. The sockets are different, yet when i do the test, they aren't! But the server isnt sending the message out on the wrong socket. I've tested that. It's somehow the right sockets, recieving the right messages, but then sending them to the wrong place. But how can this be? It makes no sense to me. The code for the tunnel is below. Stuart Stephen import javax.servlet.*; import javax.servlet.http.*; import javax.servlet.ServletException.*; import javax.servlet.UnavailableException.*; import java.lang.Exception.*; import java.io.*; import java.util.*; import java.net.*; public class TestTunnel extends HttpServlet { Hashtable connections = null; protected void service(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { try { String method = (String)req.getParameter(method).trim(); if(method!=null !method.equalsIgnoreCase()) { if(method.equalsIgnoreCase(connect)) connectUser(req, res, (String)req.getParameter(mid).trim(), , (String)req.getParameter(email).trim()); else if(method.equalsIgnoreCase(msg)) msgServer((String)req.getParameter(mid).trim(), , (String)req.getParameter(email).trim(), (String)req.getParameter(msg).trim()); else { System.err.println(redirecting user); res.sendRedirect(http://www.disney.com;); } } } catch(Exception e) { e.printStackTrace(); } } protected synchronized void msgServer(String mid, String uid, String email, String msg) { if(connections!=null) { try { System.err.println(msgServer()); Hashtable meet = (Hashtable)connections.get(mid++uid++email); if(meet!=null) { ((ToServer)meet.get(ToServer)).write(msg); } else System.err.println(msgServer(): meet == null); } catch(Exception e) { e.printStackTrace(); } } else System.err.println(msgServer(): No connections to use.); } protected void connectUser(HttpServletRequest req, HttpServletResponse res, String mid, String uid, String email) { try { System.err.println(CONNECTING +mid++uid++email); Socket socket = new Socket(127.0.0.1, 3000); ToApplet app = new ToApplet(socket, res, mid, uid, email); ToServer ser = new ToServer(socket, req, mid, uid, email); app.start(); ser.start(); Hashtable meet = new Hashtable(); meet.put(ToApplet, app); meet.put(ToServer, ser); meet.put(Socket, socket); if(connections==null) connections = new Hashtable(); connections.put(mid++uid++email, meet.clone()); while(meet!=null ((ToServer)meet.get(ToServer)).isAlive() ((ToApplet)meet.get(ToApplet)).isAlive()) { try { System.err.println(Threads alive); Thread.sleep(1000); } catch(Exception ex) { ex.printStackTrace(); } } if(meet!=null) { try { ((ToServer)meet.get(ToServer)).objIn.close(); } catch(Exception ex) { } try { ((ToServer)meet.get(ToServer)).sockObjOut.close(); } catch(Exception ex) { } try { ((ToApplet)meet.get(ToApplet)).objOut.close(); } catch(Exception ex) { } try { ((ToApplet)meet.get(ToApplet)).sockObjIn.close(); } catch(Exception ex) { } try { ((Socket)meet.get(Socket)).close(); } catch(Exception ex) { } } else System.err.println(connectUser(): meet == null); connections.remove(mid++uid++email); } catch(Exception e) { e.printStackTrace(); } System.err.println(DISCONNECTED +mid++uid++email); } } class ToApplet extends Thread implements Runnable { DataInputStream sockObjIn = null; DataOutputStream objOut = null; String mid = null; String uid = null; String email = null; Socket socket = null; HttpServletResponse res = null; boolean isAlive = true; public ToApplet(Socket socket, HttpServletResponse res, String mid, String uid, String email) { try { this.objOut = new DataOutputStream(res.getOutputStream()); this.sockObjIn = new DataInputStream(socket.getInputStream()); this.mid = mid; this.uid = uid; this.email =
Re: ***Please reply as no one on this list has offered ANY help***
A quick question without going over all that code: The problem is, that when another user sends a message. ALL instances of the variables seem to swap over to the most recent. static variables? these get instantiated once per class not per object and thus would act as you have said they are. ray -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: ***Please reply as no one on this list has offered ANY help***
I've not declared any variables as static -Original Message- From: Ray Letts [mailto:[EMAIL PROTECTED]] Sent: 21 May 2002 22:18 To: Tomcat Users List Subject: Re: ***Please reply as no one on this list has offered ANY help*** A quick question without going over all that code: The problem is, that when another user sends a message. ALL instances of the variables seem to swap over to the most recent. static variables? these get instantiated once per class not per object and thus would act as you have said they are. ray -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: ***Please reply as no one on this list has offered ANY help***
alright. leaving aside the issue of your subject line... I, too, am not reading all that code until I get a better idea of what you're actually asking. For instance, do you know the following? only ONE instance of a servlet is created in the servlet container. That means that every request hits the same instance method, instance variables, etc, just as though they were static. I haven't bothered to look over your threads, but what are they doing and what global data do they reference? On 5/21/02 2:20 PM, Stuart Stephen [EMAIL PROTECTED] wrote: I've not declared any variables as static -Original Message- From: Ray Letts [mailto:[EMAIL PROTECTED]] Sent: 21 May 2002 22:18 To: Tomcat Users List Subject: Re: ***Please reply as no one on this list has offered ANY help*** A quick question without going over all that code: The problem is, that when another user sends a message. ALL instances of the variables seem to swap over to the most recent. static variables? these get instantiated once per class not per object and thus would act as you have said they are. ray -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: ***Please reply as no one on this list has offered ANY help***
Without digging in too deeply, is it possible your problem is the cloning of the 'meet' Hashtable in connectUser? Remember that cloning a Hashtable (and other Collection/Dictionary objects) is a shallow clone. Only the table itself is cloned, not the objects pointed to by the table. I'm not *sure* that's a problem in this case, but is that what you intend? It's not clear to me why you're cloning it there, anyway... dwh Stuart Stephen wrote: Hello, I'm having touble with my HTTP tunnelling servlet and its driving me crazy. The tunnel works fine for a single user. However when another user connects to the tunnel the servlet does not perform how I would expect it to. [...] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: [Off Topic] HttpSession invalidate bug???
Chris, I can assure you that this is not a Tomcat issue. Let's try to take it off-list from here. I have attached some code inline to this post which will hopefully address, if not fix, your problem. See below: - Original Message - From: Chris Wilson [EMAIL PROTECTED] Sure that makes sense, that's what I understood was happening... I don't think that's the problem though. I fully expect the session to be invalid. But remember that if you call session.invalidate() on an already invalidated session, it throws an IllegalStateException, which is symptomatic of the problem you described. As a matter of fact, the session object is null after being invalidated, whether programmatically or by the servlet container, so getting any properties from a null object will return unexpected results. :) I assume that you would do that with the following code... if((System.currentTimeMillis() - session.getLastAccessedTime()) session.getMaxInactiveInterval()) { // session timed out } Actually, I believe the correct convention here would be to use getMaxInactiveInterval() when the session is valid, so that it's still *legal* to get attributes from the session. Ideally, you would do this in the valueUnbound() method of your listener class. I'm nearly positive that this is occurring through a getAttribute() call in the ServletContext class of the servlet container (which also throws IllegalStateException). After the servlet container invalidates the session, all future references to the session object will evaluate to null, thus causing the exception that you're getting. Note that running this code snippet on WebSphere and JRun produced a similar result as Tomcat. It's just plain not a server issue. This statement would get you the same net effect as what you're describing above: if(session == null) { //handle session timeout } I'm happy to help you off-list if needs be. Email me at [EMAIL PROTECTED] scott -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: ***Please reply as no one on this list has offered ANY help***
Nah, I put meet.clone() as a test, I just didn't take it off again. I've been told by someone on the list to try using the session to reference things instead. I'll have to give that a go before I continue asking questions. Thank you for a response. -Original Message- From: Denis Haskin [mailto:[EMAIL PROTECTED]] Sent: 21 May 2002 22:38 To: Tomcat Users List Subject: Re: ***Please reply as no one on this list has offered ANY help*** Without digging in too deeply, is it possible your problem is the cloning of the 'meet' Hashtable in connectUser? Remember that cloning a Hashtable (and other Collection/Dictionary objects) is a shallow clone. Only the table itself is cloned, not the objects pointed to by the table. I'm not *sure* that's a problem in this case, but is that what you intend? It's not clear to me why you're cloning it there, anyway... dwh Stuart Stephen wrote: Hello, I'm having touble with my HTTP tunnelling servlet and its driving me crazy. The tunnel works fine for a single user. However when another user connects to the tunnel the servlet does not perform how I would expect it to. [...] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Configuring Tomcat to authenticate with LDAP
Hi folks, Hoping someone can help me: I'd like to configure Tomcat(4.0.3) so that it will authenticate my web app users, using LDAP to access an enterprise directory (i.e Active Directory). Any pointers, examples, document references will be highly appreciated!! Ilan Shlosberg _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
JavaX Location
When we try to access a .jsp page from a browser, the page/compiler can't resolve the import of the java.servlet, etc. Can someone tell me where the javax directory should be located in order to compile .jsp when placing the .jsp page in a directory below webapps? Ed -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Control user access to directories in J-T ver 3.3 on unix?
Hi, please tell me if fine-grained user access control is possible in J-T, and if so, how to accomplish it. I'm using Jakarta-Tomcat version 3.3a on a solaris 8 box. I have access control enabled such that users of my app must supply a password; this uses a SimpleRealm with a local file of users and passwords as specified in the context for my webapp (in conf/apps-myapp.xml). To gain access to J-T/webapps/myapp, users enter a password. So the first line of defense is working. However, 'myapp' creates directories for each user under webapps/myapp where users store their work. Currently, an authenticated (but malicious) user can access the files for another user by guessing the appropriate URL under the J-T webapps/myapp/user directory. This is the hole we need to close. I'm asking about how to restrict access to specific directories. I have no need to restrict access on a file-by-file basis. We specify a role for the users, but it's not clear to me that the role information is used anywhere (?). I've read the SimpleRealm part of the Server.xml Configuration document. I have scanned the Tomcat Documentation, including the Tomcat User's Guide, the server configuration, etc. I've googled the question with little success (other than some security hole warnings). I sure hope that I don't have to create an instance of the webapp for each user! If it matters, we are using Apache as the front-end, and it forwards requests on to the J-T server as needed. Does this have anything to do with Slide (something Google turned up)?? (I don't mean to complain, but I sure would welcome some improvements in the J-T documentation. :-/) Thanks in advance, I look forward to hearing from someone. chris... (cml at cs dot umd dot edu) -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
session.getMaxInactiveInterval()
Hello, I'm calling session.getMaxInactiveInterval() on a session after it has been invalidated. Tomcat is throwing an IllegalStateException and saying that method cannot be called on an invalid session. However, the Servlet 2.3 API docs do not state that IllegalStateException should be thrown (as it is with many other methods in HttpSession) from getMaxInactiveInterval(). The reason I've run into this problem is because I'm trying to write a HttpSessionAttributeListener that determines if the session is being explicitly invalidated or if it timed out. The Servlet 2.3 spec (section 10.7) states, It is often useful in tracking sessions to know whether a session became invalid because the container timed out the session, or because a web component within the application called the invalidate method. The destinction may be determined indirectly using listeners and the HTTPSession API methods. If I can't call getMaxInactiveInterval() on an invalidated session, how can I determine if the session was invalidated due to time out? Is this a bug in Tomcat? It seems so since it doesn't follow the API docs for this call. Thanks in advance for any insight. Chris Wilson Web Developer Andrews University [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Help - Problem in accessing thru IIS
Hi, I am currently using Tomcat 3.2.3. I am trying to integrate Tomcat 3.2.3 with IIS on Windows NT. After following all the guidlines given, I was not able to open any page. I have used trouble shooting instructions also and everything appears correctly as follows 1. isapi.log log file is created - no data inside, 2. The UP arrow in Filters in IIS Management conslose also appears 3. I am not getting any GET error. Please provide me some more tips.. Thanks Regards Ramdass __ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
%@ include ... and tags with body
Hi all! I have a problem with splitting a jsp file into several files and keeping an open tag inside one file and corresponding closing tag inside another file. When I used Weblogic app server such a construction worked properly. I've moved to Tomcat and got the following error: 2002-05-21 11:40:17 - error-the file '/index.jsp' generated the following parse exception: org.apache.jasper.compiler.CompileException: /index.jsp(0,0) End of content reached while more parsing required: tag nesting error? What's going on? Tomcat 4.0.3/Solaris 8/jdk 1.3.1 Regards, Krzysztof __ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Servlet/Jsp
I have a servlet that sets an attribute in the request object containing a bean: ... MyBean bean = new MyBean(); bean.setS(Hello); req.setAttribute( mybean, bean ); ... And that gets forwarded to my JSP page: ... RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(MyPageJsp.jsp); dispatcher.forward(request, response); On the JSP page I unsuccessfully extract the value hello of the bean property S MyJspPage.jsp: jsp:useBean id=bean class=MyBean scope=session / %=bean.getS()% the result is : null Do you have any idea about why my page Jsp couldn't access to the value of the bean property? I am using JDK 1.3 and Tomcat 3.2 Thanks! Djaballah ___ Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français ! Yahoo! Mail : http://fr.mail.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: just one edit.
Maybe it's best to rely on transactional mechanisms of the database. Then you don't have to worry about locking in your application. When one administrator A saves the data, the application could easily check if data has been updated by any other administrator B (or perhaps a user) since A began his editing, and notify administrator A about this. Regards, Kent Vilhelmsen On Mon, 20 May 2002, Emilio Miranda wrote: Hi, really apreciate your help. but What I mean is a case in web. It is: administrator A login to a site and modify data of some user at the same time administrator B are modifying the data of the same user. I would like some message for administrator A, something like a sorry you cant change these data right now . So I want to know if Tomcat could help me in some way Thanks a lot! -Mensaje original- De: Mike Jackson [mailto:[EMAIL PROTECTED]] Enviado el: lunes, 20 de mayo de 2002 13:32 Para: Tomcat Users List Asunto: RE: just one edit. You'll probably want to synchronize on a static object I think. Something like this: public class WhatEver { protected static Object lock = new Object(); public void doStuff() { sychronized( lock ) { // do protected stuff here } } } --mikej -=- mike jackson [EMAIL PROTECTED] -Original Message- From: Emilio Miranda [mailto:[EMAIL PROTECTED]] Sent: Monday, May 20, 2002 11:15 AM To: Tomcat Users List Subject: just one edit. Hello, I am sorry if that is an offtopic. How can I be sure that only one user is changing some data at the time? could Tomcat help me on that? I mean , supouse that one user change a name an another try to change at the same time. Thanks a lot! -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Exception on persisted sessions - SimpleLog
hello: I am using Tomcat 4 binary version for jdk1.4 as a Standalone server working with Struts 1.1, no cluster. Suddenly, i have this exception popped up at the startup and shutdown of tomcat: On catalina start up - Standalone server: [-] Searching for random number generator has been completed [-] IOException while loading persisted sessions: java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: org.apache.commons.logging.impl.SimpleLog Caused by: java.io.NotSerializableException: org.apache.commons.logging.impl.SimpleLog ... 9 times When catalina is shutdown: [-] finalizing [-] cannot serialize session attribute user for session xx java.io.NotSerializableException: org.apache.commons.logging.impl.SimpleLog = our user object implements Serializable and set to each user session once the user is authenticated. Any help and/or suggestion. Thanks. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Tomcat 4.0 CVS won't start...
It seems that this problem is with v4.1.2 also. log4j:ERROR No appenders could be found for category (org.apache.commons.digester.Digester). log4j:ERROR Please initialize the log4j system properly. Catalina.start: java.lang.NullPointerException -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] Sent: Monday, April 08, 2002 10:18 AM To: Tomcat Users List Subject: Re: Tomcat 4.0 CVS won't start... On Sun, 7 Apr 2002, Jack Lauman wrote: Date: Sun, 07 Apr 2002 21:11:56 -0700 From: Jack Lauman [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: Tomcat User List [EMAIL PROTECTED] Subject: Tomcat 4.0 CVS won't start... I get the following error in catalina.out with todays build from the cvs. Tomcat will not start as a result of this error. Ran fine yesterday. Sorry about that ... I botched a patch to the commons-beanutils package that is used inside the parsing of server.xml. This will be fixed in tonight's nightly build. Would appreciate any suggestions on how to resolve it. Regards, Jack Craig McClanahan -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: ***Please reply as no one on this list has offered ANY help***
Hi Stuart, It looks as if you have a problem with instance variables (variables in a class declared outside a method). All logins are going to be using the same copy of the code, i.e. same variable space etc. All synchronizing does is make sure that the threads play nice when modifying the variables. Your Hashtable connections is an instance variable, so there is only one copy of it for all calls to connections. When you fill connections with data, another login may fill it again before you get a chance to copy that data to a new object. Also, all those instance variables at the top of your thread class ToApplet are all shared by all instances of ToApplet. Every thread is going to see what was stuffed into them by the last thread created. Generally you should only do that for data that needs to be the same for all threads and is initialized once and never changed. In general, if you are storing anything in an instance variable you might have problems. Create a class to hold data and use it instead. As a simple example, instead of : String myStr = req.getParameter(blaBla); use: StorageClass myData = new StorageClass(); myData.myStr = req.getParameter(blaBla); That way, you are certain to get a clean one-owner copy of myStr for each thread as long as you are careful to create and fill it in a sync block. If you need another method to see your object pass it as a parameter. The same thing will happen in a JSP if you create a class inside %! % and then call that object's methods with variables in the main JSP page. Although each call to the JSP will create a new class Hope this helps, Rick Hello, I'm having touble with my HTTP tunnelling servlet and its driving me crazy. The tunnel works fine for a single user. However when another user connects to the tunnel the servlet does not perform how I would expect it to. The problem is, that when another user sends a message. ALL instances of the variables seem to swap over to the most recent. However the threads still all run. So, if mr x and mr y are in a meeting. Mr x joined first, he says 'hello'. Hello is sent and recieved once how I would expect it to do it. However, now mr y joins and says 'hello'. and he recieves the messages for himself AND for mr x. This is driving me insane and I can't seem to find a way around it, I don't understand why the entire data structure is being overwritten when it is a different request for a different user. The sockets are different, yet when i do the test, they aren't! But the server isnt sending the message out on the wrong socket. I've tested that. It's somehow the right sockets, recieving the right messages, but then sending them to the wrong place. But how can this be? It makes no sense to me. The code for the tunnel is below. Stuart Stephen import javax.servlet.*; import javax.servlet.http.*; import javax.servlet.ServletException.*; import javax.servlet.UnavailableException.*; import java.lang.Exception.*; import java.io.*; import java.util.*; import java.net.*; public class TestTunnel extends HttpServlet { Hashtable connections = null; protected void service(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { try { String method = (String)req.getParameter(method).trim(); if(method!=null !method.equalsIgnoreCase()) { if(method.equalsIgnoreCase(connect)) connectUser(req, res, (String)req.getParameter(mid).trim(), , (String)req.getParameter(email).trim()); else if(method.equalsIgnoreCase(msg)) msgServer((String)req.getParameter(mid).trim(), , (String)req.getParameter(email).trim(), (String)req.getParameter(msg).trim()); else { System.err.println(redirecting user); res.sendRedirect(http://www.disney.com;); } } } catch(Exception e) { e.printStackTrace(); } } protected synchronized void msgServer(String mid, String uid, String email, String msg) { if(connections!=null) { try { System.err.println(msgServer()); Hashtable meet = (Hashtable)connections.get(mid++uid++email); if(meet!=null) { ((ToServer)meet.get(ToServer)).write(msg); } else System.err.println(msgServer(): meet == null); } catch(Exception e) { e.printStackTrace(); } } else System.err.println(msgServer(): No connections to use.); } protected void connectUser(HttpServletRequest req, HttpServletResponse res, String mid, String uid, String email) { try { System.err.println(CONNECTING +mid++uid++email); Socket socket = new Socket(127.0.0.1, 3000); ToApplet app = new ToApplet(socket, res, mid, uid, email); ToServer ser = new ToServer(socket, req, mid, uid, email); app.start(); ser.start(); Hashtable meet = new Hashtable(); meet.put(ToApplet, app); meet.put(ToServer, ser);
Re: tomcat.auth.originalLocation with Tomcat 4.X
Hi, I've posted this quest a few days ago in the mailing list. Anyone know a good solution for this problem? I really appreciate any thoughts/suggestion on this problem ta, On Mon, 20 May 2002 14:16, you wrote: I am using form-based authentication. With Tomcat 3.X when the user type the login.jsp page directly I set the tomcat.auth.originalLocation explicitly to tell tomcat where to forward. This doesn't seem to work anymore with Tomcat 4.0, although in my login.jsp page (when the user is redirected to the login page, not accessing it directly), Tomcat 4.0 does set the tomcat.auth.originalLocation, but it is not used. Anyone has any workaround/solution? Regards, -- Victor Hadianto -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
strange shut down problem
I've got Tomcat 4.0.3 on Redhat 7.1 and when I start it I get the usual batch of 20-50 threads. When I shut tomcat down (using shutdown.sh) there are about a dozen threads that don't go away. Tomcat is definately not running (at least it's not accepting requests), but the threads are still there. I'm not seeing any errors, but I'm not sure where to look. I've done some web searches of the archives and haven't found anything, but I'm hoping that someone will recognize this problem and point me in the right direction. Thanks!! Cindy -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: strange shut down problem
this might get you started... run the following commands and send your output: netstat -a lsof | grep java although that second one might have a lot of outputin which case look over that to see which files, devices, and ports the JVM has open. fillup On 5/21/02 4:58 PM, Cindy Ballreich [EMAIL PROTECTED] wrote: I've got Tomcat 4.0.3 on Redhat 7.1 and when I start it I get the usual batch of 20-50 threads. When I shut tomcat down (using shutdown.sh) there are about a dozen threads that don't go away. Tomcat is definately not running (at least it's not accepting requests), but the threads are still there. I'm not seeing any errors, but I'm not sure where to look. I've done some web searches of the archives and haven't found anything, but I'm hoping that someone will recognize this problem and point me in the right direction. Thanks!! Cindy -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: strange shut down problem
This is a documented bug. Apparently if there is a non Daemon thread running Tomcat won't shut down cleanly. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=8700 Subir -Original Message- From: Phillip Morelock [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 21, 2002 5:16 PM To: Tomcat Users List Subject: Re: strange shut down problem this might get you started... run the following commands and send your output: netstat -a lsof | grep java although that second one might have a lot of outputin which case look over that to see which files, devices, and ports the JVM has open. fillup On 5/21/02 4:58 PM, Cindy Ballreich [EMAIL PROTECTED] wrote: I've got Tomcat 4.0.3 on Redhat 7.1 and when I start it I get the usual batch of 20-50 threads. When I shut tomcat down (using shutdown.sh) there are about a dozen threads that don't go away. Tomcat is definately not running (at least it's not accepting requests), but the threads are still there. I'm not seeing any errors, but I'm not sure where to look. I've done some web searches of the archives and haven't found anything, but I'm hoping that someone will recognize this problem and point me in the right direction. Thanks!! Cindy -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: problem running apache and tomcat on seperate machines
Hi, Where is your workers.properties file? It should be seating in your apache machine. Thanks - Original Message - From: [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Tuesday, May 21, 2002 4:30 AM Subject: problem running apache and tomcat on seperate machines Hi I am having problem running apache and tomcat on seperate machines. I am able to do it on the one machine but when I take out localhost and specify my machine IP address where it should find tomcat I get an Internal Server 500 error message. In my workers.properties file I have specified worker.AJP13.host= 192.168.1.1 This is where I have tomcat running It works fine if I run it as localhost with tomcat running on my local machine. Any suggestions from anyone? My current setup is Apache 1.3.20 on Redhat Linux 7.2 and Tomcat 4.0.3 on windows 95 with mod_jk connectors. Thanxs -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: tomcat.auth.originalLocation with Tomcat 4.X
On Wed, 22 May 2002, Victor Hadianto wrote: Date: Wed, 22 May 2002 09:40:57 +1000 From: Victor Hadianto [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED], [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Subject: Re: tomcat.auth.originalLocation with Tomcat 4.X Hi, I've posted this quest a few days ago in the mailing list. Anyone know a good solution for this problem? I really appreciate any thoughts/suggestion on this problem IMHO, you are trying to misuse form-based authentication. The servlet spec requires that the container cache the *original* request that triggered the authentication, and then replay it after the user is successfully identified. From the user experience point of view, it works exactly like BASIC authentication does: * User submits a request for a protected URI * Container pops up the username/password dialog * User fills in the form and submits * Container replays the original request Note that, at no time, does the user ever enter the URL of the login page -- in fact, it doesn't really have one in BASIC authentication (because it's actually created for you by the browser in that case). User's simply ask for the pages they want, and containers simply challenge for username/password when they don't know who you are. Tomcat 3.x made a very poor design decision when they exposed the internal mechanics of this as request attributes that were visible to application level code. Reliance on this feature locks you in to that particular version of Tomcat -- it's not portable to Tomcat 4 or to any other servlet container in the world. ta, Craig McClanahan On Mon, 20 May 2002 14:16, you wrote: I am using form-based authentication. With Tomcat 3.X when the user type the login.jsp page directly I set the tomcat.auth.originalLocation explicitly to tell tomcat where to forward. This doesn't seem to work anymore with Tomcat 4.0, although in my login.jsp page (when the user is redirected to the login page, not accessing it directly), Tomcat 4.0 does set the tomcat.auth.originalLocation, but it is not used. Anyone has any workaround/solution? Regards, -- Victor Hadianto -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: tomcat-apache
Hi, On window environment, apache1.3.24, ajp13, tomcat4.0.3 and jdk1.4.0 should work no problem except if the load is heavy (I believe there is bugs on the connector) it will use up 100% after the all process hang. I think this is not a solid solution to use tomcat-apache on windows if the site is heavy load. I have this problem for so long, I need to restart the apache time to time. Thanks - Original Message - From: David Janssens [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Tuesday, May 21, 2002 5:41 AM Subject: tomcat-apache Is anybody could have the kindness to tell me which version of tomcat, tomcat-connector and apache (httpd and 2.0.36 is preferred) may I use to make they work together. Please, help me, I will be soon deseperated. I tried apache 2.0.36, tomcat-4.0.3 and connectors 4.0.2-01 and 4.0.4-b3. So I tried to use mod_jk.so. Everything about compilation for source build was OK. When I try the tomcat server stnadalone, it works when I try to access trought apache always get this error message message : Error message: handler jakarta-servlet not found for: examples If you think this is a server error, please contact the webmaster Error 500 localhost Tue May 21 14:09:55 2002 Apache/2.0.36 (Unix) Thnak you all for any suggestion. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: tomcat.auth.originalLocation with Tomcat 4.X
IMHO, you are trying to misuse form-based authentication. The servlet spec requires that the container cache the *original* request that triggered the authentication, and then replay it after the user is successfully identified. From the user experience point of view, it works exactly like BASIC authentication does: * User submits a request for a protected URI * Container pops up the username/password dialog This is where the problem arises. When the container pops up the username/password dialog in the form based authentication it directs the user to the login page. Thus the url in the browser have the http://host/login.jsp Now my problem is if the user bookmark this page then the next time he/she decided to use the bookmark he/she will go directly to the login page. level code. Reliance on this feature locks you in to that particular version of Tomcat -- it's not portable to Tomcat 4 or to any other servlet container in the world. Well didn't I learn the hard way :D. So ... you reckon the only solution for me is to use my own authentication mechanism? -- Victor Hadianto -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: tomcat.auth.originalLocation with Tomcat 4.X
On Wed, 22 May 2002, Victor Hadianto wrote: Date: Wed, 22 May 2002 10:46:38 +1000 From: Victor Hadianto [EMAIL PROTECTED] To: Craig R. McClanahan [EMAIL PROTECTED] Subject: Re: tomcat.auth.originalLocation with Tomcat 4.X IMHO, you are trying to misuse form-based authentication. The servlet spec requires that the container cache the *original* request that triggered the authentication, and then replay it after the user is successfully identified. From the user experience point of view, it works exactly like BASIC authentication does: * User submits a request for a protected URI * Container pops up the username/password dialog This is where the problem arises. When the container pops up the username/password dialog in the form based authentication it directs the user to the login page. Thus the url in the browser have the http://host/login.jsp Originally, Tomcat 4 did an internal forward to the login page, rather than a redirect, so that this wouldn't happen. Unfortunately, we got deluged with bug reports that said images on the login page didn't work -- because they were being resolved against the original request URI instead of that of the login page. You can't win sometimes ... :-( Now my problem is if the user bookmark this page then the next time he/she decided to use the bookmark he/she will go directly to the login page. level code. Reliance on this feature locks you in to that particular version of Tomcat -- it's not portable to Tomcat 4 or to any other servlet container in the world. Well didn't I learn the hard way :D. So ... you reckon the only solution for me is to use my own authentication mechanism? Either that or train your users to don't do that. -- Victor Hadianto Craig --- -- Victor Hadianto -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Tomcat 4.0.3 + mod_webapp + FORM authentication
Hi, I'm having a problem with authentication to my webapp when accessing it through Apache. I have my realm setup in server.xml to use JDBC (accessing a PostgreSQL database), and based the security constraints in my web.xml from the security example provided with Tomcat. - Apache is running on one machine (nova), and Tomcat on another (setsuna) - My webapp is at /opnexus under Tomcat, and my httpd.conf is set to redirect this same path to Tomcat (this all works fine) - Authentication works just fine when I access it directly through Tomcat - If I try to go to a protected page through Apache, authentication always fails, even if the username and password are correct. - The security example provided with Tomcat works fine when accessed through either Apache or Tomcat. I've looked through the list archives and seen this problem posted a couple times, but never any solution. If anyone has any suggestions that might help, I'd appreciate it. Thanks in advance. The context entry in server.xml looks like this: Context path=/opnexus docBase=opnexus debug=99 reloadable=true !-- Realm className=org.apache.catalina.realm.MemoryRealm / -- Realm className=org.apache.catalina.realm.JDBCRealm debug=99 connectionName=opnexus connectionPassword=password driverName=org.postgresql.Driver connectionURL=jdbc:postgresql://setsuna/opnexus2 userTable=account userNameCol=username userCredCol=password userRoleTable=account_role roleNameCol=role_name / Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_opnexus_log. suffix=.txt timestamp=true/ /Context And my web.xml is as follows (much of it is unchanged from the example): ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app security-constraint display-nameExample Security Constraint/display-name web-resource-collection web-resource-nameProtected Area/web-resource-name !-- Define the context-relative URL(s) to be protected -- url-pattern/crms/*/url-pattern !-- If you list http methods, only those methods are protected -- http-methodDELETE/http-method http-methodGET/http-method http-methodPOST/http-method http-methodPUT/http-method /web-resource-collection auth-constraint !-- Anyone with one of the listed roles may access this area -- role-nametomcat/role-name role-namerole1/role-name /auth-constraint /security-constraint !-- Default login configuration uses form-based authentication -- login-config auth-methodFORM/auth-method realm-nameExample Form-Based Authentication Area/realm-name form-login-config form-login-page/crms/login.jsp/form-login-page form-error-page/crms/error.jsp/form-error-page /form-login-config /login-config /web-app -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: HttpSession invalidate bug???
Comments below... Chris Wilson Web Developer Andrews University [EMAIL PROTECTED] -Original Message- From: Scott Judd [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 21, 2002 4:46 PM To: Tomcat Users List Subject: Re: [Off Topic] HttpSession invalidate bug??? Chris, I can assure you that this is not a Tomcat issue. Let's try to take it off-list from here. I have attached some code inline to this post which will hopefully address, if not fix, your problem. See below: - Original Message - From: Chris Wilson [EMAIL PROTECTED] Sure that makes sense, that's what I understood was happening... I don't think that's the problem though. I fully expect the session to be invalid. But remember that if you call session.invalidate() on an already invalidated session, it throws an IllegalStateException, which is symptomatic of the problem you described. As a matter of fact, the session object is null after being invalidated, whether programmatically or by the servlet container, so getting any properties from a null object will return unexpected results. :) I understand that you can't call session.invalidate() on an invalidated session--the javadocs support your claim. However, they do not say you can't call getMaxInactiveInterval() on an invalid session (check them out). Plus, your assertion that the session object is null doesn't make sense, because I can successfully call session.getLastAccessedTime(). That should throw a NullPointerException if the session is null, however it doesn't for me. Here try this HttpSessionListner you'll see what I'm talking about import javax.servlet.http.HttpSessionListener; import javax.servlet.http.HttpSessionEvent; import javax.servlet.http.HttpSession; public class TestListener implements HttpSessionListener { public void sessionCreated(HttpSessionEvent httpSessionEvent) { } public void sessionDestroyed(HttpSessionEvent httpSessionEvent) { // ok session should be invalid here... // lets test some assertions // let put it in a try block to catch any exceptions try { HttpSession session = httpSessionEvent.getSession(); // lets make sure session is not null System.out.println(session == null); // ok lets try last access time // this SHOULD work even if session is invalid // javadocs say it will... System.out.println(session.getLastAccessedTime()); // ta-da it does // ok if that worked then this should work too // javadocs do not say it throws IllegalStateException System.out.println(session.getMaxInactiveInterval()); // whoops this busts... // javadocs say this shouldn't happen // Servlet spec (10.7) implies using this method to see if // a session is invalid because of timeout as opposed // to explicit call to session.invalidate(); // now, we won't get here cause the above fails // but just to see if the session is invalid // lets call something that the javadocs DO say should // throw IllegalStateException on an invalid session session.invalidate(); } catch(Exception e) { e.printStackTrace(); } } } I assume that you would do that with the following code... if((System.currentTimeMillis() - session.getLastAccessedTime()) session.getMaxInactiveInterval()) { // session timed out } Actually, I believe the correct convention here would be to use getMaxInactiveInterval() when the session is valid, so that it's still *legal* to get attributes from the session. Ideally, you would do this in the valueUnbound() method of your listener class. I'm nearly positive that this is occurring through a getAttribute() call in the ServletContext class of the servlet container (which also throws IllegalStateException). After the servlet container invalidates the session, all future references to the session object will evaluate to null, thus causing the exception that you're getting. Note that running this code snippet on WebSphere and JRun produced a similar result as Tomcat. It's just plain not a server issue. This statement would get you the same net effect as what you're describing above: if(session == null) { //handle session timeout } The problem with your example is that it doesn't tell me if the session is invalid because session.invalidate() was explicitly called or because it timed out. I hate to sound like a broken record, but the spec (10.7) says determining the difference should be possible by calling methods on the HttpSession (read it, you'll see). Can any Tomcat developers weigh in on this? Thanks for all your help! -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Connection Pool Configuration OT!!
Hello Thanks for the info Fabio! I will be using WebSphere version 4 and it has a connection pool setup in the server admin pages. I have yet to test my code under but I have set it up (db conn pool) and it seems quit easy. I should be able to use my data access code (which is pretty much the same as your example). BTW, which version of WS are you using? Thanks and sorry for being OT!! D Watson - Original Message - From: Fabio Mengue [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Tuesday, May 21, 2002 8:23 AM Subject: Re: Connection Pool Configuration Hi, I have the same problem. Want connection pool to work on Tomcat and Websphere without to rewrite code. IBM send us instructions to set up the server and a piece of code that looks like this: ... java.util.Properties parms = new java.util.Properties(); parms.setProperty(javax.naming.Context.INITIAL_CONTEXT_FACTORY, com.ibm.websphere.naming.WsnInitialContextFactory); javax.naming.Context ctx = new javax.naming.InitialContext(parms); javax.sql.DataSource ds = (javax.sql.DataSource)ctx.lookup(jdbc/db2proddb02DS); java.sql.Connection c = ds.getConnection(user,pass); ... It works on Websphere, but as you can see, initial conext is provided by Websphere code, and I won't use that in Tomcat (in fact I think this is EJB code, and Tomcat does not support it; I can't use it even if I want to). So I'm trying an alternate path: ... javax.naming.Context ctx = new javax.naming.InitialContext(); javax.sql.DataSource ds = (javax.sql.DataSource)ctx.lookup(java:comp/env/jdbc/db2proddb02DS); java.sql.Connection c = ds.getConnection(user,pass); ... And on /conf/server.xml !-- MyApp Context -- Context path=/myapp docBase=myapp debug=0 reloadable=true crossContext=true !-- Pool de Conexao DB2 -- Resource name=jdbc/db2proddb02DS auth=SERVLET type=javax.sql.DataSource/ ResourceParams name=jdbc/db2proddb02DS parameternameuser/namevalue/value/parameter parameternamepassword/namevalue/value/parameter parameternamedriverClassName/name valueCOM.ibm.db2.jdbc.DB2ConnectionPoolDataSource/value/parameter parameternamedriverName/name valuejdbc:db2:database/value/parameter /ResourceParams /Context I'm still getting a Null Pointer error, but I think that when I got it to work, I might use the very same configuration (and code) on both servers, since COM.ibm.db2.jdbc.DB2ConnectionPoolDataSource it's not Websphere code. Hope it helps. And note that I may be wrong :) Perhaps one of the fine people in this list may correct me. Fabio. -- Fabio Mengue - Centro de Computacao - Unicamp [EMAIL PROTECTED] [EMAIL PROTECTED] Quem se mata de trabalhar merece mesmo morrer. - Millor -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
[Coyote] Coyote 1.0 Release Candidate 2 available
Coyote 1.0 RC 2 is now available, and includes: - HTTP/1.1 protocol handler - JK 2 protocol handler, with support for the AJP 1.3 protocol - An adapter for Tomcat 3.3.x - An adapter for Tomcat 4.x The only change over RC 1 is fixing compatibility with Tomcat 4.0.x. Note: The version of Coyote included in Tomcat 4.0.4 Beta 3 (Coyote 1.0 Beta 9) was not subject to this problem. Binaries can be downloaded at: http://jakarta.apache.org/builds/jakarta-tomcat-connectors/coyote/release/v1 .0-rc2/ Installation instructions for both 3.3.x and 4.0.x are given on the download page. The Tomcat 4.1.x milestones already include this new connector, and use it for HTTP/1.1 and AJP 1.3 support. Remy -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
jvm_recv
Hi , I'm using Tomcat3.2, jdk1.3.1,Ajp12 connector and jdbc driver for my application. I'm getting the following error.Any help will help me greatly. com.interra.web.dao.core.DALException: Error in get(). Error [Microsoft][SQLServer 2000 Driver for JDBC]Connection reset by peer: JVM_recv in socket input stream read at com.interra.web.dao.core.DAL.get(DAL.java:374) at com.interra.web.dao.DBMarquee.getAll(DBMarquee.java:36) at com.interra.web.actionObject.GetMarquees.serveRequest(GetMarquees.java:32) at com.interra.web.actionHandler.ActionHandler.serveRequest(ActionHandler.java: 79) at com.interra.web.common.utils.UserManager.GetMarquees(UserManager.java:74) at com.interra.web.presentationObject.NewsLetter.serveRequest(NewsLetter.java:3 1) at com.interra.web.presentationHandler.PresentationHandler.serveRequest(Present ationHandler.java:92) at com.interra.web.uiGenerator.UIGenerator.generateDynamicResponse(UIGenerator. java:173) at com.interra.web.requestHandler.RequestHandler.handleDynamicRequest(RequestHa ndler.java:199) at com.interra.web.requestHandler.RequestHandler.serveRequest(RequestHandler.ja va:139) at com.interra.web.requestHandler.servlet.RequestServlet.handleRequest(RequestS ervlet.java:256) at com.interra.web.requestHandler.servlet.RequestServlet.doGet(RequestServlet.j ava:117) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404) at org.apache.tomcat.core.Handler.service(Handler.java:286) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79 7) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743) at org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection (Ajp12ConnectionHandler.java:166) at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416) at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498) at java.lang.Thread.run(Thread.java:484) Regards Rajesh -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
/manager doesn't work on Apache2.0 w/Tomcat4.0.3
Hi, I'm struggling with Tomcat4.0.3 with Apache2.0 these days and I need help to make it work. The problem is, /manager of Tomcat 4.0.3 doesn't work (see the error message below) when it is connected through Apache 2.0, while /manager works if only Tomcat4.0.3 is used. java.lang.SecurityException: Servlet of class org.apache.catalina.servlets.ManagerServlet is privileged and cannot be loaded by this web application. In addition, clicking Tomcat Documentation on Tomcat top page does stop working (the error message: The requested resource (/tomcat-docs) is not available), while adding / at the end of URL on the browser leads to Tomcat documentation page without any problem. Any modifications of the config-related files of both Tomcat and Apache2.0 don't help so far. I'm using the following packages on Dell PowerEdge1650 / RedHat7.2 (2.4.9-31smp): *the same sympton is observed on RedHat7.2 (2.4.7-10). - Apache 2.0 (httpd-2.0.36.tar.gz) - tomcat4-4.0.3-1.noarch.rpm - tomcat4-webapps-4.0.3-1.noarch.rpm - tomcat-connectors-1.0-1.4.0.2.src.rpm - xerces-j-1.4.4.-2.noarch.rpm - regexp-1.2-1.noarch.rpm - servletapi4-4.0.3-1.noarch.rpm The changes made in config-related files to connect from Apache2.0 to Tomcat4.0.3 are: - Apache o use port80 to access to Tomcat o add mod_webapp.so (generated from tomcat-connectors' src package) o add entries to httpd.conf LoadModule webapp_module modules/mod-webapp.so WebAppConnectionwarpConnwarplocalhost:8008 WebAppDeployROOTwarpConn/ WebAppDeployexampleswarpConn/examples/ WebAppDeploymanagerwarpConn/manager/ WebAppDeploytomcat-docswarpConn/tomcat-docs - Tomcat4.0.3 o disable all Connector in server.xml Tomcat Manager Context entry in server.xml is properly defined as: Context path=/manager docBase=manager debug=0 privileged=true/ and tomcat-users.xml has the entry of: user name=manager password=manager roles=manager/ Has anyone come across the same problem? Any suggestions would be appreciated. Thank you. Masako Kinoshita -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Tomcat multiple tomcats out of the same base directory
Could there be a problem using the web application or sharing the work directories. Is there a problem with running multiple tomcat instances out of the same base? Thanx Ganesh -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]