RE: Connection class unknown...
You could try importing java.sql.Connection (not javax.sql.Connection). Maybe this would help. Regards, Andy -Original Message- From: Sexy Prague To: [EMAIL PROTECTED] Sent: 05/09/2004 18:12 Subject: Connection class unknown... Hello everybody, I've got a problem with creating Connection object in my jsp where I'd like to use DB. I use JNDI and this is the code of my jsp's scriptlet: Context initContext = new InitialContext(); Context envContext = (Context)initContext.lookup(java:/comp/env); DataSource ds = (DataSource)envContext.lookup(jdbc/TestDB); //until this part it works perfectly, but when I add the next line, tomcat screams, that //can not resolve symbol Connection... so classic error with unknown class Connection conn; //after previous line it doesn't work It is strange, because I have imported the whole javax.sql.* package Have somebody already met this problem? Thanks in advance, Peter _ Emotikony a pozadi programu MSN Messenger ozivi vasi konverzaci. http://messenger.msn.cz/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat4 performance issue when manually removing compiledjsps in work folder
Could your jsp source files have been modified In the future? -Original Message- From: Duncan Krebs To: Tomcat Users List Sent: 26/03/2004 09:39 Subject: Re: Tomcat4 performance issue when manually removing compiledjsps in work folder Peter, I'm getting closer. I installed the latest stable version of Tomcat, copied my web application folder into the tomcat5 webapps folder and this what I have noticed. Any jsp page from the existing web app seems to be getting recompiled and not cached in tomcat. This is what I can't figure out: If I create a new jsp page in the web app and copy the exact source from an existing jsp into the new file (named differently than the existing one), the new jsp is getting cached just fine. When I refresh that page a bunch of times, the response time is instant and my cpu activity stays very low. But when I continue to load any jsp pages from the existing web app, my cpu hits 60%, the response time is slower and they seem to be getting recompiled on every request. Makes no sense, both the new and old jsp page have the same content but the old one seems to keep getting recompiled on every request. Do you have any ideas why Tomcat would be doing this? Thanks again for your help, - Duncan - Original Message - From: Peter Johnson [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Tuesday, March 30, 2004 2:35 AM Subject: Re: Tomcat4 performance issue when manually removing compiledjspsin work folder Duncan, Restarting is like wiping the slate clean in terms of Tomcat's caching in the work directory. So, it is expected that it would take a little while, even just to load the classes in to memory to serve. If you are using JSP I believe that these are always recompiled at start with the class files from the your webapp/WEB-INF/classes and lib directories being loaded in to memory. PJ On Fri, 2004-03-26 at 19:11, Duncan Krebs wrote: Peter, Thanks for the reply. It would make sense that on the request immediately after I delete the .java and .class files in the work folder it would take longer because tomcat has to recompile the jsp's. However even after they are recompiled (not deleted again)and tomcat is restarted subsequent requests continue to take longer and the CPU continues to hit 100%. I wonder if there is a way to analyze the request and see what code is taking so long to execute. - Duncan - Original Message - From: Peter Johnson [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Tuesday, March 30, 2004 2:00 AM Subject: Re: Tomcat4 performance issue when manually removing compiled jspsin work folder Duncan, I believe (and could be wrong) that this is intended behaviour. The work directory is like Tomcat's cache of all the webapps it is currently serving. When a request comes in for a page it tries to serve from this directory, if the class file does not exist it generates the .java files from /webapp and then compiles them so that it can serve them. So, the 3s delay and 100% utilisation is expected because Tomcat is recompiling the files so that it can serve them. PJ On Fri, 2004-03-26 at 18:39, Duncan Krebs wrote: Hi, I have had this snag for some time now and its starting to get the best of me. I'm running tomcat 4.1 and when I manually remove the .java and .class files in the /work/standalone folder even after the initial request of recompiling the jsp's tomcat hits 100% on my CPU and the overall response time is delayed by about 3 seconds on each request. As I deleted different sub folders in the work folder (all within the same web application) the degraded performance was consistent with the different sub folders that I was deleting even after the pages were recompiled. Has anyone experienced this before? All of my requests are going through a Servlet controller and I have a lot of classes in my WEB-INF folder that are part of the framework but I don't think that would have anything to do with this. I've also tried rebuilding my entire project from scratch and I'm still having the same issue of a slowed response time of about 3 seconds and tomcat taking all my CPU. Regards, dkrebs - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Getting Context Parameters from server.xml
I think you want to use getServletContext().getInitParameter(companyName); There is a difference between a servlet init parameter (defined in web.xml) and a servlet context init parameter (defined in the context.xml or server.xml file) -Original Message- From: Jon Wingfield To: Tomcat Users List Sent: 25/03/2004 10:22 Subject: Re: Getting Context Parameters from server.xml If you had String name = config.getInitParameter(companyName); it might work ;) HTH, Jon Michael Jones wrote: Hello- I'm trying to store some values in my server.xml and then get them with my Servlet. I followed the instructions at: http://jakarta.apache.org/tomcat/tomcat-4.0-doc/config/context.html under the Context Parameters section. In my servlet I got all init params and iterated over the enumeration. The parameter I defined in server.xml did not show up. Has anyone gotten this feature to work? Am I missing something? Here are a few code snippets: server.xml in the Context tag for my webapp Parameter name=companyName value=MyCompany override=false/ from my servlet ServletConfig config = getServletConfig(); String name = getInitParameter(companyName); System.err.println(CompanyName = ' + name + '); Enumeration enum = config.getInitParameterNames(); while(enum.hasMoreElements()) { System.err.println(enum.nextElement()); } Thanks- Michael - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: HttpSession Replication in Tomcat Cluster not working with EJ B's!
Think of a stateful session bean as an extension of the client. By storing the remote reference inside your session, you are attempting to persist your Client extension across 2 different clients (2 different tomcat instances). I don't think this is a sensible idea, and I'm not sure it's even allowed. I would advise you not to store remote references inside your session objects. Try storing just the current 'state' inside the session. Use a ServiceLocator to get an instance of the session bean each time you need it, using the current session to populate the state. This may work better for you. Regards, Andy -Original Message- From: Suraj Prabhu To: [EMAIL PROTECTED] Sent: 19/03/2004 07:34 Subject: HttpSession Replication in Tomcat Cluster not working with EJB's! Hi everybody, I am trying to cluster Tomcat Servers ver 5.0.18 (Two servers) and my application servlets are accessing Stateful session beans. Typically, the first invocation of the servlet gets the Remote of the SFSB and stores it into the session. The other Tomcat's in the cluster throw up an error ClassNotFoundException while loading persisted sessions. I have the same war file deployed in all the Tomcats and the Tomcats in turn talk to the same app server (JBOSS 3.2.3). I am attaching my configuration and log outputs of both the servers. Would like to know if this is a bug/limitation or is there a solution to it. Cheers Suraj -- This is the log file o/p of the first server (which the client actually is accessing): INFO: Jk running ID=0 time=0/16 config=C:\Tomcat5\conf\jk2.properties Mar 18, 2004 4:25:40 PM org.apache.catalina.startup.Catalina start INFO: Server startup in 5297 ms Mar 18, 2004 4:26:20 PM org.apache.catalina.cluster.tcp.SimpleTcpCluster memberAdded INFO: Replication member added:org.apache.catalina.cluster.mcast.McastMember[tcp://10.5.18.9:4001 ,10.5.18.9,4001, alive=16] This is the log file o/p of the second server (which starts up and joins the cluster after a session has been created in the first server) Mar 18, 2004 4:25:12 PM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on port Mar 18, 2004 4:25:12 PM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 1125 ms Mar 18, 2004 4:25:12 PM org.apache.catalina.core.StandardService start INFO: Starting service Catalina Mar 18, 2004 4:25:12 PM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/5.0.18 Mar 18, 2004 4:25:12 PM org.apache.catalina.core.StandardHost start INFO: XML validation disabled Mar 18, 2004 4:25:12 PM org.apache.catalina.cluster.tcp.SimpleTcpCluster start INFO: Cluster is about to start Mar 18, 2004 4:25:12 PM org.apache.catalina.cluster.tcp.SimpleTcpCluster start INFO: Sleeping for 2000 secs to establish cluster membership Mar 18, 2004 4:25:12 PM org.apache.catalina.cluster.tcp.SimpleTcpCluster memberAdded INFO: Replication member added:org.apache.catalina.cluster.mcast.McastMember[tcp://10.5.18.27:400 1,10.5.18.27,4001, alive=45657] Mar 18, 2004 4:25:14 PM org.apache.catalina.core.StandardHost getDeployer INFO: Create Host deployer for direct deployment ( non-jmx ) Mar 18, 2004 4:25:14 PM org.apache.catalina.core.StandardHostDeployer install INFO: Processing Context configuration file URL file:C:\Tomcat5\conf\Catalina\localhost\admin.xml Mar 18, 2004 4:25:15 PM org.apache.struts.util.PropertyMessageResources init INFO: Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true Mar 18, 2004 4:25:15 PM org.apache.struts.util.PropertyMessageResources init INFO: Initializing, config='org.apache.struts.action.ActionResources', returnNull=true Mar 18, 2004 4:25:15 PM org.apache.struts.util.PropertyMessageResources init INFO: Initializing, config='org.apache.webapp.admin.ApplicationResources', returnNull=true Mar 18, 2004 4:25:16 PM org.apache.catalina.core.StandardHostDeployer install INFO: Processing Context configuration file URL file:C:\Tomcat5\conf\Catalina\localhost\balancer.xml Mar 18, 2004 4:25:16 PM org.apache.catalina.core.StandardHostDeployer install INFO: Processing Context configuration file URL file:C:\Tomcat5\conf\Catalina\localhost\manager.xml Mar 18, 2004 4:25:16 PM org.apache.catalina.core.StandardHostDeployer install INFO: Installing web application at context path /TestWeb from URL file:C:/Tomcat5/webapps/TestWeb Mar 18, 2004 4:25:17 PM org.apache.catalina.cluster.session.DeltaManager start INFO: Starting clustering manager...:/TestWeb Mar 18, 2004 4:25:17 PM org.apache.catalina.cluster.session.DeltaManager doLoad SEVERE: ClassNotFoundException while loading persisted sessions: java.lang.ClassNotFoundException: chnhr.EmployeeEditorSB java.lang.ClassNotFoundException: chnhr.EmployeeEditorSB at org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLo
RE: Réf. : read it immediately
Without wanting to cause too much alarm, that is the kind of message that could potentially contain a virus. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 25 February 2004 10:59 To: Tomcat Users List Subject: Réf. : read it immediately the attached file is empty. I don't know what you mean. Could you explain more. ___ NATEXIS ASSET MANAGEMENT Meissa SAKHO 01 58 19 45 71. . . . . . . . . . . . (84571) [EMAIL PROTECTED] [EMAIL PROTECTED] 25/02/2004 11:01 Veuillez répondre à Tomcat Users List Pour : [EMAIL PROTECTED] cc : Objet : read it immediately is that your account? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Pièce jointe supprimée : swimmingpool.zip L'integrite de ce message n'etant pas assuree sur internet, Natexis Banques Populaires ne peut etre tenu responsable de son contenu. Toute utilisation ou diffusion non autorisee est interdite. Si vous n'etes pas destinataire de ce message, merci de le detruire et d'avertir l'expediteur. The integrity of this message cannot be guaranteed on the Internet. Natexis Banques Populaires can not therefore be considered responsible for the contents.Any unauthorized use or dissemination is prohibited. If you are not the intended recipient of this message, then please delete it and notify the sender. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Relative links do not work with controller servlet.
The BASE tag may help you here (or html:base if you are using struts) -Original Message- From: Juergen Weber [mailto:[EMAIL PROTECTED] Sent: 22 February 2004 00:20 To: [EMAIL PROTECTED] Subject: Relative links do not work with controller servlet. I want to run all requests through a controller servlet. The requests should be like /controller/dir/fileXXX.html This is done with a servlet-mapping servlet-nameController/servlet-name url-pattern/controller/*/url-pattern /servlet-mapping request.getPathInfo() is dir/fileXXX.html fileXXX.html in reality are JSPs, which the Controller servlet forwards to. In the JSPs are relative links to images and CSS. Well, as in the browsers view the html files are below /controller, it requests these relative links also below /controller, but the controller cannot and should not handle CSS and images. This problem surfaces often in the newsgroups, but I did not find a solution. Is there a good, portable solution to the problem ? Ideally would be a url-pattern-exclude*.css,*.jpg,*.gif/url-pattern-exclude Tag in web.xml. Thanks, Juergen __ Do you Yahoo!? Yahoo! Mail SpamGuard - Read only the mail you want. http://antispam.yahoo.com/tools - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: tomcat certificate
It's in the documentation: http://jakarta.apache.org/tomcat/tomcat-5.0-doc/ssl-howto.html -Original Message- From: secam secam [mailto:[EMAIL PROTECTED] Sent: 23 February 2004 10:00 To: [EMAIL PROTECTED] Subject: tomcat certificate hello, I'm a new user of tomcat. Can tomcat authenticate a user with a certifcate ? Thanks, Secam - Yahoo! Mail : votre e-mail personnel et gratuit qui vous suit partout ! Créez votre Yahoo! Mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Touble with context container
What is in your H:\Tomcat\WEB-INF\web.xml file? -Original Message- From: Didier Croutz [mailto:[EMAIL PROTECTED] Sent: 23 February 2004 14:22 To: [EMAIL PROTECTED] Subject: Touble with context container Hello, I'm starting with Tomcat and I've got a configuration problem. I've installed Tomcat 5.014 on a Windows 2K SP4 workstation into the default directory (C:\Program Files\Tomcat 5.0). I've kept the default settings (e.g. port 8080, admin.xml, server.xml ). I stored my applications on a network drive (H:) into a directory named Tomcat. I've just modified C:\Program Files\Tomcat 5.0\conf\server.xml file a little bit adding Context path=/Tomcat docBase=H:/Tomcat debug=0 line (server.xml joined to this mail). My testing application is into H:\Tomcat directory (departement.class and recherchDep.html files joined to this mail). I fill the address field of my web browser (internet explorer 6.0.2800.1106) with: htpp://localhost:8080/Tomcat/recherchDep.html. I can reach the html page but when I tried to launch departement script I get a 404 message into my browser saying that it can reach departement resource. Could somebody help me ? Thanks, Regards. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Touble with context container
Tomcat will not see your servlet until you create a web.xml file for your application. The following document explains the directory layout: http://jakarta.apache.org/tomcat/tomcat-5.0-doc/appdev/ Pay particular attention to this section: http://jakarta.apache.org/tomcat/tomcat-5.0-doc/appdev/deployment.html In short, you need to do the following: 1. Create a WEB-INF directory under H:\Tomcat. 2. Create a lib directory under H:\Tomcat\WEB-INF 3. Create a classes directory under H:\Tomcat\WEB-INF 4. Move your class file to H:\Tomcat\WEB-INF\classes\your\package. (I don't know what package your class is in, so I'm assuming your.package for now) 5. Create a web.xml file under H:\Tomcat\WEB-INF. Add the following text: ?xml version=1.0 encoding=ISO-8859-1? web-app servlet servlet-namedepartement/servlet-name servlet-classyour.package.departement/servlet-class servlet servlet-mapping servlet-namedepartement/servlet-name url-pattern/departement/url-pattern /servlet-mapping /web-app 6. Restart tomcat 7. Type http://localhost:8080/Tomcat/departement into your browser to see if your servlet is working. Regards, Andy -Original Message- From: Didier Croutz [mailto:[EMAIL PROTECTED] Sent: 23 February 2004 16:12 To: Bodycombe, Andrew Subject: RE: Touble with context container Hi, First thanks for your response. I have no H:\Tomcat\WEB-INF\web.xml file but C:\Program Files\Tomcat 5.0\conf\server.xml. Regards. A 14:42 23/02/2004 +, vous avez écrit : What is in your H:\Tomcat\WEB-INF\web.xml file? -Original Message- From: Didier Croutz [mailto:[EMAIL PROTECTED] Sent: 23 February 2004 14:22 To: [EMAIL PROTECTED] Subject: Touble with context container Hello, I'm starting with Tomcat and I've got a configuration problem. I've installed Tomcat 5.014 on a Windows 2K SP4 workstation into the default directory (C:\Program Files\Tomcat 5.0). I've kept the default settings (e.g. port 8080, admin.xml, server.xml ). I stored my applications on a network drive (H:) into a directory named Tomcat. I've just modified C:\Program Files\Tomcat 5.0\conf\server.xml file a little bit adding Context path=/Tomcat docBase=H:/Tomcat debug=0 line (server.xml joined to this mail). My testing application is into H:\Tomcat directory (departement.class and recherchDep.html files joined to this mail). I fill the address field of my web browser (internet explorer 6.0.2800.1106) with: htpp://localhost:8080/Tomcat/recherchDep.html. I can reach the html page but when I tried to launch departement script I get a 404 message into my browser saying that it can reach departement resource. Could somebody help me ? Thanks, Regards. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Disable Directory Listing for Specific Apps.
I don't know if this would work because I've never tried it, but you could try overriding the default servlet in each of your webapps (just copy the servlet and servlet-mapping from the TOMCAT_HOME/conf/web.xml) Then you can control the 'listings' parameter in each individual web application, instead of relying on the setting in the default web.xml. -Original Message- From: Ben Souther [mailto:[EMAIL PROTECTED] Sent: 20 February 2004 16:36 To: Tomcat Users List Subject: Re: Disable Directory Listing for Specific Apps. That would do except that we are allowing customers to create directories and have no guarantee that the welcome file will exist there. It would be nice if we could disable directory listing for the entire app from within the war file. We have no guarantee that they won't be using the same instance of Tomcat for other apps and we are hoping to avoid walking customers through editing the global web.xml file. It's starting to look like this isn't possible.. :-( On Thursday 19 February 2004 05:44 pm, Parsons Technical Services wrote: If I understand the notes correctly, if you simply include a welcome file then TC will not serve up the directory listing. This is also how my setup acts. It will not show the directory for my app which has an index file. And the global web.xml is untouched. See the notes in the global web.xml and Servlet 2.4 specifications. Doug www.parsonstechnical.com - Original Message - From: Ben Souther [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Thursday, February 19, 2004 4:54 PM Subject: Disable Directory Listing for Specific Apps. Is it possible to disable directory listings for a specific web app as opposed to editing the global web.xml file in TOMCAT_HOME/conf/web.xml? We would like to ship our app as a war file and don't want require that our customers make global changes to Tomcat for it to behave properly. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Ben Souther F.W. Davison Company, Inc. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Servlet thread safety in Tomcat
You could try jmeter http://jakarta.apache.org/jmeter/index.html -Original Message- From: kwirirai [mailto:[EMAIL PROTECTED] Sent: 11 February 2004 17:32 To: Tomcat Users List Subject: Re: Servlet thread safety in Tomcat Thanks to All for your help ! :-) Sofar it seems to be working ,no data corruption,I localized all variables ,put in some synchronized blocks,removed them again(synchronized blocks) and seems to work, but not sure why without the synchrozed blocks its working . :-\ Is there free software that I can use to test the concurrency issues,because at the moment I am trying to test all this using two client machines and this does not work at all.Software that can create many simultanoeus connections sending in the request parameters to Tomcat would do well for testing . Shapira, Yoav wrote: Howdy, this has made me think a lot about threading , it is really complicated , I have researched about it but never found a clean solution to Threading is complicated, yes, and difficult to do well. Which is why when possible you should let someone else do the work for you and use a library like Doug Lea's util.concurrent, which is now java.util.concurrent in JDK 1.5. It has thread pools, executors, locks, etc so you don't have to write any of this sync code yourself. Yoav Shapira This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Weird Problems
I think the problem with your listener is that you assume the number of active sessions will be 0 when the server starts up. Tomcat may persist (passivate) sessions when the server is shut down. These sessions will be re-activated the next time the server starts up. If you reduce your session counter in the sessionWillPassivate() method and increase the session counter in the sessionDidActivate() method, that may get around your problem. I think your 404 problem needs further investigation. 7-8% seems a very high error rate. Regards, Andy -Original Message- From: Vernon Wu [mailto:[EMAIL PROTECTED] Sent: 10 February 2004 16:10 To: Tomcat Users List Subject: RE: Weird Problems Thanks Yoav for your response. The first problem is the session counter. It is implemented with the HttpSessionListener. It works fine until recently. Under the TC5.0.X, the counter can be a negative figure. The problem is obviously in your session counter code: if you posted it, we could help more. I wish I can say the same. It, however, doesn' explain why the problem only occurs recently. I note it on TC 5.0.x with the same code (I believe). Here is the code segment: public final class MyListener implements ServletContextListener, HttpSessionListener, HttpSessionActivationListener { private static int activeSessionCount = 0; public void contextInitialized(ServletContextEvent evt) { // ... } public void contextDestroyed(ServletContextEvent evt) { // ... } public void sessionCreated(HttpSessionEvent evt) { activeSessionCount++; HttpSession session = evt.getSession(); // ... logger.info( The session ID: + session.getId() + , the total # of active sessions: + activeSessionCount); } public void sessionDestroyed(HttpSessionEvent evt) { activeSessionCount--; logger.debug(The number of active sessions: + activeSessionCount); } public void sessionWillPassivate(HttpSessionEvent evt) { // ... } public void sessionDidActivate(HttpSessionEvent evt) { logger.info(sessionDidActivate); } public static int getActiveSessionCount() { return activeSessionCount; } } The second is a quite severe problem. I configure the welcome file to map a JSP file. Sometimes, an incoming URL of the default domain leads to the 404 error. After I click the reload button on my browser, the JSP file shows up. You need to do better than sometimes in order to get precise help. When does it happen, when does it not happen, and what's in the logs in both cases? If I could pin point the occasion, I might solve it by now. I don't observe any logs from the container during the time when the error occurs, but I would like to know how set up logging messages for the problem. I don't know whether it is related with the container configuration. The tag pool is disable. Also, some users report the 404 error on some other use scenario, but we haven't observe the same. The error rate is above 7-8% of the total hits. If a user follows the action options on a screen, the error shall never happen. Vernon Find what you are looking for with the Lycos Yellow Pages http://r.lycos.com/r/yp_emailfooter/http://yellowpages.lycos.com/default.asp ?SRC=lycos10 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: need help adding classpath to Tomcat 5.0.18 NT Service
If you moved engine.jar from the shared/lib folder to the common/lib folder, would that remove the need to explicitly set the classpath? -Original Message- From: Robert Ensinger [mailto:[EMAIL PROTECTED] Sent: 06 February 2004 16:49 To: 'Tomcat Users List' Subject: RE: need help adding classpath to Tomcat 5.0.18 NT Service Hi folks. I'm still unsuccessful at adding an explicit classpath to Tomcat when running as a service via the -Djava.class.path= switch detailed below. Can someone confirm or deny that this is the proper way to add an explicit classpath to the service? If so, I'll log the bug. Thanks, -R -Original Message- From: Robert Ensinger [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 03, 2004 11:40 PM To: [EMAIL PROTECTED] Subject: need help adding classpath to Tomcat 5.0.18 NT Service Hi Folks, I'm working with an app that needs a classpath kickstart to run properly. The jar is deployed to %CATALINA_HOME%\shared\lib\. When starting the server via the startup.bat, the app works properly when the set classpath variable in the setclasspath.bat is defined as: set CLASSPATH=%JAVA_HOME%\lib\tools.jar;%CATALINA_HOME%\shared\lib\engine.jar Now I wish to see this app run when Tomcat is started as a service. Under Java VM in the configuration utility I have added: -Djava.class.path=%JAVA_HOME%\lib\tools.jar;%CATALINA_HOME%\shared\lib\engi ne.jar My Java Options box reads as follows: -Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 5.0 -Djava.endorsed.dirs=C:\Program Files\Apache Software Foundation\Tomcat 5.0\common\endorsed -Djava.class.path=%JAVA_HOME%\lib\tools.jar;%CATALINA_HOME%\shared\lib\engi ne.jar -Xrs This isn't working. I've read the docs and How Tos, spelunked this list, googled, added this classpath to the systems environmental variables, to the catalina.xml, and even the catalina.proprties. None of this seems to work. Where is the proper spot to add a classpath to Tomcat running as a service? What is the proper syntax? (examples?) My java version is 1.4.2. I have successfully setup this app in JRun4 Weblogic 8.1 running as services. Need a little help with the Tomcat. Thanks! Robert Ensinger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: an question occured during using tomcat5.0
Tomcat does not expose it's JNDI resources to the outside world. Therefore you cannot access any Tomcat Data Sources from an application outside tomcat. -Original Message- From: asd [mailto:[EMAIL PROTECTED] Sent: 03 February 2004 09:41 To: [EMAIL PROTECTED] Subject: an question occured during using tomcat5.0 All friends: hello. I had used DataSource accompanyed with tomcat5.I configured this Data which named JDBC/ORADB via the web page http://localhost:8080/admin,everything was completed.then ,i retrieved this DataSource on my client which is an application. My core code of client is here: java.util.Properties p = new java.util.Properties(); p.put( Context.INITIAL_CONTEXT_FACTORY,org.apache.naming.factory.ResourceFactory) ; //p.put( Context.INITIAL_CONTEXT_FACTORY,com.sun.jndi.fscontext.RefFSContextFactory ); p.put( Context.PROVIDER_URL,http://localhost:8080;); // System.setProperty(java.naming.factory,initial, org.apache.catalina.users.MemoryUser); try { Context context = new javax.naming.InitialContext( p); Context initCtx = ( Context)context.lookup(java:comp/env); DataSource ds = ( DataSource) initCtx.lookup(JDBC/ORADB); return ds; } catch (NamingException e) { e.printStackTrace(); return null; } but it failed.And the all err message like this : javax.naming.NoInitialContextException: Cannot instantiate class: org.apache.naming.factory.ResourceFactory. Root exception is java.lang.ClassCastException at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:649) at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243) at javax.naming.InitialContext.init(InitialContext.java:219) at javax.naming.InitialContext.init(InitialContext.java:195) at com.airversal.cer.utility.service.ServiceImp.getDataSource(ServiceImp.java:4 8) at com.ariversal.cer.debug.DSTest.main(DSTest.java:21) i do not know what had happend.i look view some sample code on www.apache.org. They all are too simple.Error occur with my try. what had happend or how did i use datasource with tomcat5,i beg someone give me some introduce and some advise . - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Reg HTTP status 404 on Tomcat 5.0.16
You have mapped your servlet to the /sampleapp URL, so to access your servlet, you need to use the following URL: http://localhost:8080/sampleapp/sampleapp I suggest changing your servlet-mapping as follows: servlet-mapping servlet-nameHelloServlet/servlet-name url-pattern/HelloServlet/url-pattern /servlet-mapping Then, you can use the http://localhost:8080/sampleapp/HelloServlet URL -Original Message- From: Avinash Sridhar [mailto:[EMAIL PROTECTED] Sent: 03 February 2004 14:03 To: [EMAIL PROTECTED] Subject: Reg HTTP status 404 on Tomcat 5.0.16 I have my sampleapp folder into which a small trial of HelloServlet needs to be tested. The directory structure of sampleapp is as follows, e:\sampleapp\WEB-INF\classes\ WEB-INF\lib WEB-INF\sourcefiles WEB-INF\web.xml The classes directory has got classes\package1\structure The Context /Context tag in server.xml has been added like this. / server.xml ***/ Context path=/sampleapp docBase=e:\sampleapp debug=0 reloadable=true /Context / server.xml / /** web.xml ***/ ?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 display-nameServlet 2.4 Examples/display-name description Servlet 2.4 Examples /description !-- Servlet mapping start -- !-- Define servlets. i.e. bind a servlet name to a class -- servlet servlet-nameHelloServlet/servlet-name servlet-classpackage1.structure.HelloServlet/servlet-class /servlet !-- bind a servlet name to a URL (pattern) -- servlet-mapping servlet-nameHelloServlet/servlet-name url-pattern/sampleapp/url-pattern /servlet-mapping !-- Servlet mapping end -- /web-app /** web.xml ***/ The error I am getting in the browser is this HTTP Status 404 - /sampleapp/HelloServlet --- type Status report message /sampleapp/HelloServlet description The requested resource (/sampleapp/HelloServlet) is not available. This is the url I gave http://localhost:8080/sampleapp/HelloServlet Kindly let me know what could be wrong in the above configuration. Any help would be appreciated. Thanks AS - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Please help Console Problem in tomcat 5.0.16
This indicates your server.xml is invalid. -Original Message- From: Avinash Sridhar [mailto:[EMAIL PROTECTED] Sent: 02 February 2004 16:07 To: [EMAIL PROTECTED] Subject: Please help Console Problem in tomcat 5.0.16 have my own directory as sampleapp which has the necessary structure and the .class file is put into the following directory structure. classes/package1/structure/HelloServlet.class. All in the %TOMCAT% home directory. My question is in %TOMCAT%/conf/server.xml file how is the Context /Context tag written. I have written it like this Context path=/sampleapp docBase=sampleapp debug=0 reloadable=true /Context The directory structure of sampleapp is as follows.. %TOMCAT%/webapps/sampleapp/WEB-INF/classes /lib /sourcefiles /web.xml. The classes directory has the structure like this.. classes/package1/structure/HelloServlet class file. My Web.xml file looks like this / web.xml / ?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 display-nameServlet 2.4 Examples/display-name description Servlet 2.4 Examples /description !-- Servlet mapping start -- !-- Define servlets. i.e. bind a servlet name to a class -- servlet servlet-nameHelloServlet/servlet-name servlet-classpackage1.structure.HelloServlet/servlet-class /servlet !-- bind a servlet name to a URL (pattern) -- servlet-mapping servlet-nameHelloServlet/servlet-name url-pattern/sampleapp/url-pattern /servlet-mapping !-- Servlet mapping end -- /web-app /* web.xml **/ /*** Console error */ Feb 2, 2004 8:33:19 AM org.apache.commons.digester.Digester fatalError SEVERE: Parse Fatal Error at line 3 column 6: The processing instruction target matching [xX][mM][lL] is not allowed. /*** Console error */ Let me know if any changes are to be made. Help greatly apreciated. Thanks AS - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: IOException while loading persisted sessions continued..
If you read a bit further down: When traversing a graph, an object may be encountered that does not support the Serializable interface. In this case the NotSerializableException will be thrown and will identify the class of the non-serializable object. If you want session serialization, you will have to make the MyLinks class implement this interface. If you don't want the fields inside this class to be serialized, make them transient. Andy -Original Message- From: Allistair Crossley [mailto:[EMAIL PROTECTED] Sent: 30 January 2004 10:20 To: Tomcat Users List Subject: RE: IOException while loading persisted sessions continued.. It says Classes that do not implement this interface will not have any of their state serialized or deserialized So, to me that means I do not have to put Serializable if I do not want my MyLinks class to be persisted. But Tomcat is throwing an error which means it thinks MyLinks should be Serialized for some reason. I do not want MyLinks to be Serializable. Why does Tomcat throw an error for this object and for no others? Thanks ADC -Original Message- From: Yiannis Mavroukakis [mailto:[EMAIL PROTECTED] Sent: 30 January 2004 09:50 To: 'Tomcat Users List' Subject: RE: IOException while loading persisted sessions continued.. No this is Java specific, not Tomcat. See http://java.sun.com/j2se/1.4.2/docs/api/java/io/Serializable.html Yiannis -Original Message- From: Allistair Crossley [mailto:[EMAIL PROTECTED] Sent: 30 January 2004 09:43 To: TOMCAT USER (E-mail) Subject: IOException while loading persisted sessions continued.. Yes, but I don't want to may this object Serializable - is this Tomcat specific? I have plenty of other objects in session but they don't have these errors thrown?? Cheers, ADC -- snip -- When tomcat persists sessions, it will try to serialize all objects stored in your sessions to disk. In order to be successful, all the objects must be serializable. In this example, the class com.comp.newmedia.intranet.iq.dto.myiq.mylinks.Link is not serializable - it does not implement the Serializable interface. Vitor -- snip -- Allistair Crossley wrote: Hi, I quite often but not always get a huge stack trace thrown when Tomcat boots up the top part of which is the following. I'm not sure why it thinks it needs to be loading anything to do with my bean here from persisted sessions. Is that a setting that I have switched on that I need to switch off? Like I say, only happens on every 3rd or 4th reboot (development instance) and it does not stop TC5.0.18 working either. SEVERE: IOException while loading persisted sessions: java.io.WriteAbortedExcept ion: writing aborted; java.io.NotSerializableException: com.comp.newmedia.intranet.iq.dto.myiq.mylinks.Link java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException : com.comp.newmedia.intranet.iq.dto.myiq.mylinks.Link at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1278) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324) at java.util.LinkedList.readObject(LinkedList.java:702) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:39) Cheers ADC FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLUE --- QAS Ltd. Developers of QuickAddress Software a href=http://www.qas.com;www.qas.com/a Registered in England: No 2582055 Registered in Australia: No 082 851 474 --- /FONT This e-mail has been scanned for all viruses by Star Internet. The service is powered by MessageLabs. Note:__ This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any mistransmission. If you receive this message in error, please immediately delete it and all copies of it from your system, destroy any hard copies of it and notify the sender. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. Jaguar Freight Services and any of its subsidiaries each reserve the right to monitor all e-mail communications through its networks. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorized to state them to be the views of any such entity. This e-mail has been scanned for all viruses by Star Internet. The service is powered by MessageLabs.
RE: IOException while loading persisted sessions continued..
I suspect that the MyLinks object is just the FIRST non-serializable session attribute encountered. Tomcat is trying to serialize the session, which fails as soon as any non-serializable attribute is found. If you made MyLinks serializable, you would probably start getting errors about your other non-serializable session attributes. -Original Message- From: Allistair Crossley [mailto:[EMAIL PROTECTED] Sent: 30 January 2004 10:53 To: Tomcat Users List Subject: RE: IOException while loading persisted sessions continued.. Hi There, I think either I am missing the point, or my message was not clear :) I totally understand the persistent thing. I understand the transient keyword. However, my real question is why does MyLinks have to be altered at all, when none of my other session objects have a problem. Tomcat seems to be picking on the MyLinks object in particular. For example, I have a User object in session but that is not Serializable. Tomcat does not complain about this. So my question is not about Serialization in general, it is about why Tomcat is deciding to throw exceptions for 1 of my session objects and not others. Why should it care about MyLinks and not User? Cheers, hope this is clearer, ADC -Original Message- From: Bodycombe, Andrew [mailto:[EMAIL PROTECTED] Sent: 30 January 2004 10:46 To: 'Tomcat Users List' Subject: RE: IOException while loading persisted sessions continued.. If you read a bit further down: When traversing a graph, an object may be encountered that does not support the Serializable interface. In this case the NotSerializableException will be thrown and will identify the class of the non-serializable object. If you want session serialization, you will have to make the MyLinks class implement this interface. If you don't want the fields inside this class to be serialized, make them transient. Andy -Original Message- From: Allistair Crossley [mailto:[EMAIL PROTECTED] Sent: 30 January 2004 10:20 To: Tomcat Users List Subject: RE: IOException while loading persisted sessions continued.. It says Classes that do not implement this interface will not have any of their state serialized or deserialized So, to me that means I do not have to put Serializable if I do not want my MyLinks class to be persisted. But Tomcat is throwing an error which means it thinks MyLinks should be Serialized for some reason. I do not want MyLinks to be Serializable. Why does Tomcat throw an error for this object and for no others? Thanks ADC -Original Message- From: Yiannis Mavroukakis [mailto:[EMAIL PROTECTED] Sent: 30 January 2004 09:50 To: 'Tomcat Users List' Subject: RE: IOException while loading persisted sessions continued.. No this is Java specific, not Tomcat. See http://java.sun.com/j2se/1.4.2/docs/api/java/io/Serializable.html Yiannis -Original Message- From: Allistair Crossley [mailto:[EMAIL PROTECTED] Sent: 30 January 2004 09:43 To: TOMCAT USER (E-mail) Subject: IOException while loading persisted sessions continued.. Yes, but I don't want to may this object Serializable - is this Tomcat specific? I have plenty of other objects in session but they don't have these errors thrown?? Cheers, ADC -- snip -- When tomcat persists sessions, it will try to serialize all objects stored in your sessions to disk. In order to be successful, all the objects must be serializable. In this example, the class com.comp.newmedia.intranet.iq.dto.myiq.mylinks.Link is not serializable - it does not implement the Serializable interface. Vitor -- snip -- Allistair Crossley wrote: Hi, I quite often but not always get a huge stack trace thrown when Tomcat boots up the top part of which is the following. I'm not sure why it thinks it needs to be loading anything to do with my bean here from persisted sessions. Is that a setting that I have switched on that I need to switch off? Like I say, only happens on every 3rd or 4th reboot (development instance) and it does not stop TC5.0.18 working either. SEVERE: IOException while loading persisted sessions: java.io.WriteAbortedExcept ion: writing aborted; java.io.NotSerializableException: com.comp.newmedia.intranet.iq.dto.myiq.mylinks.Link java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException : com.comp.newmedia.intranet.iq.dto.myiq.mylinks.Link at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1278) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324) at java.util.LinkedList.readObject(LinkedList.java:702) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:39) Cheers ADC FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLUE --- QAS Ltd. Developers of QuickAddress Software a href=http
RE: Special URL servlet request.
In web.xml: web-app servlet servlet-namedigfidl/servlet-name servlet-classse.two4hr.servlet.DLServlet/servlet-class /servlet servlet-mapping servlet-namedigfidl/servlet-name url-pattern/digfidl/url-pattern /servlet-mapping servlet-mapping servlet-namedigfidl/servlet-name url-pattern/digfidl/*/url-pattern /servlet-mapping /web-app -Original Message- From: matsmobil [mailto:[EMAIL PROTECTED] Sent: 23 January 2004 13:25 To: [EMAIL PROTECTED] Subject: Special URL servlet request. This request works:http://digfi.com/digfidl/digfidl and calls my Servlet OK. The question is how can I call my servlet with the following URL: http://digfi.com/digfidl/digfidl/dAc/OM1617RbR/YT4075/Uk5673We/qih/dFOE1051/ 1gpus/LYxx/tKG0/iXcaP.rm/?copyright=digfi.comauthor=Chine The Slippery Hornstitle=Scatterminded I have to make this request like this because my calling applikation can't use '?' in the URL-requests. Could this be done in TC 5.0.18 only ore do I have to have apache as frontend for TC 5.0.18. - In TC/conf/server.xml I have added the following row: Context path=/digfidl docBase=digfidl debug=0 reloadable=true / - TC/webapps/digfidl/WEB-INF/web.xml contains: web-app - servlet servlet-namedigfidl/servlet-name servlet-classse.two4hr.servlet.DLServlet/servlet-class /servlet - servlet-mapping servlet-namedigfidl/servlet-name url-pattern/digfidl/url-pattern /servlet-mapping /web-app -- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: What does this mean? ajp13.service() Error sending initial p ost -1 0 0
Could the 10 second delay be caused by tomcat recompiling your jsp? -Original Message- From: Hooper, Brian [mailto:[EMAIL PROTECTED] Sent: 20 January 2004 16:16 To: Tomcat Users List Subject: RE: What does this mean? ajp13.service() Error sending initial post -1 0 0 Not sure about your problem, but I recently ran across this URL: http://jspisapi.neurospeech.com/ Anyone have any experience with this product? Coincidently I'm having some weird problems using 4.1.29, IIS 5, and JK2. If a user goes to a jsp page, it takes a really long time initially (~10 seconds for a simple page). They can click on other pages that pop up immediately, but if they wait for a while, the next page request takes a long time. If I look at the NT event log there are a lot of application warnings from Apache Jakarta Connector2. I was going to ask the list about it but I wanted to see if TC5 fixes the problem. Interestingly the problem only appeared on my production server, never on my dev server. -Original Message- From: Rasmus Munk [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 20, 2004 9:22 AM To: 'Tomcat Users List' Subject: RE: What does this mean? ajp13.service() Error sending initial post -1 0 0 Nothing happens, but i guess that is because I have no mapping for the root! The strange thing about my error is this: It happens only somtimes. It seems like I caused by the folowing conditions: 1. The size of the POST is something like 10k or bigger. 2. The last call to tomcat is more than 2 minutes old!! I know it sounds incredible, but this is what I have come to to after several days of testing. As I cannot make the connector work, does anyone know if it is possible to run tomcat in-process, thereby passing the requests from IIS using som sort of other technique than the HTTP redirecting? -Rasmus -Original Message- From: Edson Alves Pereira [mailto:[EMAIL PROTECTED] Sent: 20. januar 2004 15:12 To: 'Tomcat Users List' Subject: RE: What does this mean? ajp13.service() Error sending initial post -1 0 0 What happens if you type ( http://127.0.0.1/index.jsp ) in your browser? -- De: Rasmus Munk[SMTP:[EMAIL PROTECTED] Responder:Tomcat Users List Enviada: terça-feira, 20 de janeiro de 2004 9:06 Para: 'Tomcat Users List' Assunto: What does this mean? ajp13.service() Error sending initial post -1 0 0 Hi I am running tomcat 4.1.29 on IIS 5.0 and j2k 2.0.2 (have also tried older versions) Sometimes I get this error in the j2k.log: [Tue Jan 20 13:03:18 2004] (error ) [jk_worker_ajp13.c (380)] ajp13.service() Error sending initial post -1 0 0 the log continues: [Tue Jan 20 13:03:18 2004] (debug ) [jk_handler_response.c (155)] handler.response() Header[0] [Content-Encoding] = [gzip] [Tue Jan 20 13:03:18 2004] (debug ) [jk_handler_response.c (155)] handler.response() Header[1] [Content-Type] = [text/xml;charset=ISO-8859-1] [Tue Jan 20 13:03:18 2004] (debug ) [jk_handler_response.c (155)] handler.response() Header[2] [Content-Length] = [199] [Tue Jan 20 13:03:18 2004] (debug ) [jk_handler_response.c (172)] handler.response(): status=200 headers=3 [Tue Jan 20 13:03:18 2004] (debug ) [jk_service_iis.c (93)] Into jk_ws_service_t::head [Tue Jan 20 13:03:18 2004] (debug ) [jk_service_iis.c (227)] Into jk_ws_service_t::write [Tue Jan 20 13:03:18 2004] (debug ) [jk_isapi_plugin.c (516)] HttpExtensionProc service() returned OK But the request is not passed to Tomcat, and a response i never sent to the browser!! Anya ideas? Thanks, Rasmus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: TC5 won't start on Xeon
Try catalina run instead of catalina start -Original Message- From: K. Harvatis [mailto:[EMAIL PROTECTED] Sent: 19 January 2004 12:26 To: Tomcat Users List Subject: Re: TC5 won't start on Xeon No change - window closes as soon as I hit enter... In Catalina.bat replace the below line with set _EXECJAVA=start Tomcat %_RUNJAVA% With set _EXECJAVA= %_RUNJAVA% Then cd to the bin directory and type Catalina start - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Unable to start web application
I have to disagree with you on this point. A war file is the standard way to deploy a web application. See the servlet specification: http://jcp.org/aboutJava/communityprocess/final/jsr154/index.html -Original Message- From: Emile Coetzee [mailto:[EMAIL PROTECTED] Sent: 15 January 2004 12:05 To: 'Tomcat Users List'; [EMAIL PROTECTED] Subject: RE: Unable to start web application AFAIK you can't run a webapp from a war. You have to deploy (expand/extract) the war in the webapp folder to be able to run it. Usually Tomcat will deploy this for you when you start it up. It will also auto deploy depending on your configuration. If you're not to sure that your war was built correctly copy the extracted webapp as is from your machine onto the other machine to see if it will load. Then carry on troubleshooting your new war. Also your version of Tomcat 5 is a tad old the first stable release, which is now out, is 5.0.16 Cheers Emile -Original Message- From: Ralf Schneider [mailto:[EMAIL PROTECTED] Sent: 15 January 2004 11:45 To: Tomcat Users List Subject: Unable to start web application -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, I'm quite new to developing web applications with Tomcat (5.0.6 that comes with JWSDP 1.3). I have a problem with starting a web application that is deployed as a WAR file. On my machine the web application works fine, but here I use it from the unpacked directory structure. Now, I generated a WAR file from within Eclipse (using the Tomcat plugin from Sysdeo) and copied it to another machine into the webapps directory where the same Tomcat version runs. When I open the HTML frontend of the manager application I then see the web application, but I'm not able to start it. The logfile says: INFO: standardHost.start /demo_02 15.01.2004 09:41:28 org.apache.catalina.core.StandardContext start SCHWERWIEGEND: Error listenerStart 15.01.2004 09:41:28 org.apache.catalina.core.StandardContext start SCHWERWIEGEND: Context startup failed due to previous errors Do I have to change anything to be able to run the application from within a WAR file? Best regards, Ralf. -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFABmEW7YyyfykA0YkRAnHFAKCN1qdPnLCJfRZgkndWnhVjoX1laACgieBk ZqNqRezrodFXc8kv6gYbk5o= =bPMD -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to get session in Session Bean ?
Sounds like you need to use a stateful session bean instead. -Original Message- From: Chirs Wahl [mailto:[EMAIL PROTECTED] Sent: 11 December 2003 03:11 To: Tomcat Users List Subject: How to get session in Session Bean ? Hi, I am using sevlet and stateless Session Bean , I want to get session in session bean to get user info (such as user ID), but I can not transfer request to session bean , because can not transfer a parameter of request by sessionbeanHome.create(), i.e. sessionbeanHome.create(req, ...), Could someone help me? Chris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: response.reset() and forward() ... problematic? DBCP related?
A word of warning - synchronizing the forward() method does not stop another thread from changing the values of the 'req' and 'res' variables, so you will still get problems if you implement the first solution. -Original Message- From: Altankov Peter [mailto:[EMAIL PROTECTED] Sent: 11 December 2003 16:00 To: Tomcat Users List Subject: RE: response.reset() and forward() ... problematic? DBCP related? If you go for the SingleThreadModel, try this to workaround your problem: public class TestServlet extends HttpServlet implements SingleThreadModel { ... } However, this interface does not prevent synchronization problems that result from servlets accessing shared resources such as static class variables or classes outside the scope of the servlet and moreover its depricated.(http://jakarta.apache.org/tomcat/tomcat-5.0-doc/servletapi/javax /servlet/SingleThreadModel.html) In general avoid any global variables in the scope of the servlet class definition unless you know what you are doing. Use method variables instead. If you decide to go for the real problem solution, either declare the req and res objects in the, lets say, doGet method and pass them to the forward method, or keep their declaration in the servlet class but mark the forward method as syncronized (causing threads to enter it one by one). Here are your hnt snipplets: // the workaround public class TestServlet extends HttpServlet { private HttpServletRequest req; private HttpServletResponse res; [...] public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { [.] forward(whatever); } protected synchronized void forward(String s) { [.. Here is where you refer the global req and res objects ..] [.. but its safe, since the method is marked as synchronized ..] } } -- Or -- // some real solution public class TestServlet extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { HttpServletRequest req; HttpServletResponse res; [] forward(whatever, req, res); } protected void forward(String s, HttpServletRequest req, HttpServletResponse res) { [...] } } I hope this helps. -Original Message- From: Philipp Taprogge [mailto:[EMAIL PROTECTED] Sent: 11 2003 . 16:28 To: Tomcat Users List Subject: Re: response.reset() and forward() ... problematic? DBCP related? Hi! Antonio Fiol Bonnn wrote: My guess: req and res are attributes of the Servlet, like in: public class TestServlet extends HttpServlet { private HttpServletRequest req; private HttpServletResponse res; [...] } So you are calling forward(s) for a request once req and res have been overwritten by another request. Hmm... Im a bit lost here... could anyone perhaps be so kind and post a code snipplet of how a thread safe use of a Servlet's request and response attribute could look like? I have not been working with Servlets for too long and I worried I might run into the same problem. Thanks in advance Phil -- I love deadlines, I love the whooshing noise they make as they go by - Douglas Adams - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [jk_ajp_common.c (970)]: ERROR sending data to client. Connec tio n aborted or network problems
Look at the com.beganto.listeners.SessionListener class. In the sessionDestroyed() method, check for a call to Session.getAttribute(). This is not allowed here because the session has been invalidated. If you are interested in Session attributes, perhaps you should be using an HttpSessionAttributeListener or an HttpSessionBindingListener HTH Andy -Original Message- From: Raja Balasubramanian [mailto:[EMAIL PROTECTED] Sent: 09 December 2003 16:08 To: '[EMAIL PROTECTED]' Cc: '[EMAIL PROTECTED]' Subject: [jk_ajp_common.c (970)]: ERROR sending data to client. Connectio n aborted or network problems Importance: High Hi Guys, I am getting following error could you pls advice me what could be the reason and it could be resolved. in mod_jk.log file, [Tue Jun 24 16:20:05 2003] [jk_ajp_common.c (970)]: ERROR sending data to client. Connection aborted or network problems localhost_log.2003-12-09 2003-12-09 15:20:41 StandardManager[] Session event listener threw exception java.lang.IllegalStateException: getAttribute: Session already invalidated at org.apache.catalina.session.StandardSession.getAttribute(StandardSession.jav a:900) at org.apache.catalina.session.StandardSessionFacade.getAttribute(StandardSessi onFacade.java:171) at com.beganto.listeners.SessionListener.sessionDestroyed(SessionListener.java: 41) at org.apache.catalina.session.StandardSession.expire(StandardSession.java:617) at org.apache.catalina.session.StandardManager.processExpires(StandardManager.j ava:755) at org.apache.catalina.session.StandardManager.run(StandardManager.java:832) at java.lang.Thread.run(Thread.java:484) Thanks in advance! Raja - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: HttpSessionListener in Tomcat 4.1.27 (or HttpSessionListener in general)
The sessionCreated() method is called when the session is first created, and therefore has no attributes set. If you are interested in session attributes, perhaps you should look at HttpSessionAttributeListener or HttpSessionBindingListener. Hope this helps Andy -Original Message- From: Tommy Smith [mailto:[EMAIL PROTECTED] Sent: 03 December 2003 11:03 To: [EMAIL PROTECTED] Subject: Re: HttpSessionListener in Tomcat 4.1.27 (or HttpSessionListener in general) Sorry, just joined this group - so I hope I am not jumping in at the wrong time to this thread. I am running Tomcat 4.1.18 (with Cocoon on Windows 2000, incidentally) Anyway, I have implemented a HttpSessionListener, code below is for the on sessionCreated event handler I am interested in various session attributes, and I am confused as to why I can only access the session id and not any attributes. I have propogated attributes to the session (I am able to access them in Cocoon). Output from Tomcat as follows : User null Session E0647E125B965537D1B7E087F5915FA2 Driver loaded OK Acquired connection OK Executed OK - login public void sessionCreated(HttpSessionEvent se) { Object sessionId = se.getSession().getId(); Object sessionUser = se.getSession().getAttribute(user); System.out.println(User +sessionUser); System.out.println(Session +sessionId); for (Enumeration e = se.getSession().getAttributeNames() ; e.hasMoreElements() ;) { System.out.println(Attribute +e.nextElement()); } try { Class.forName(dbDriver); System.out.println(Driver loaded OK); con = DriverManager.getConnection(dbURL,dbUser, dbPwd); System.out.println(Acquired connection OK); Statement s = con.createStatement(); rs = s.executeQuery(update calib_users set logged_in = 'Y' where username = 'simon'); rs = s.executeQuery(commit); System.out.println(Executed OK - login); } catch (ClassNotFoundException cnfe) { System.out.println(No driver); return; } catch (SQLException sqle) { System.out.println(No connection); return; } } _ It's fast, it's easy and it's free. Get MSN Messenger today! http://www.msn.co.uk/messenger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: JSP Editors
www.jedit.org www.eclipse.org Both are free and up to the task. Andy -Original Message- From: Duncan [mailto:[EMAIL PROTECTED] Sent: 28 November 2003 09:54 To: Tomcat User List Subject: JSP Editors Sorry if off topic but... What do people use to edit JSPs? I'm after an editor, free if possible, to run on windows, with syntax colouring and possibly auto complete for java. Have tried vim for windows, but it doesn't seem as nice on windows as it is on linux. Any other suggestions? Cheers Duncan Smith Decker Telecom Ltd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to deploy a WAR file in Tomcat
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/appdev/deployment.html -Original Message- From: dakavara [mailto:[EMAIL PROTECTED] Sent: 27 November 2003 12:14 To: Tomcat Users List (E-mail) Subject: How to deploy a WAR file in Tomcat Hi, How to deploy a WAR file in Tomcat. Thanks Regards, Ashok.D - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Moving from 3.3.1 to 4.1.29 question
Please read the tomcat FAQ: http://jakarta.apache.org/tomcat/faq/misc.html#invoker -Original Message- From: Charles Gardner [mailto:[EMAIL PROTECTED] Sent: 24 November 2003 14:35 To: Tomcat Users List Subject: Moving from 3.3.1 to 4.1.29 question I am converting from 3.3.1 to 4.1.29. Everything seems to be works, got the admin part working. It will bring up my application web pages but when it goes to run a servlet which is in the same place as it was in 3.3.1, it give me the following error on any servlet. The web page specifies the server as ../servlet/servlet name which worked in 3.3.1. I have the server.xml file with a context additiona just like the example setup without the dbf stuff. I have a servlet which is run at startup and it starts up ok but any thing run from a web page cant be found? The other files I have not found a home for is tomcat3.3.1/conf/apps_adventa.xml and tomcat3.3.1/conf/users/adventa-users.xml. HTTP Status 404 - /adventa/servlet/TWSC01 type Status report message /adventa/servlet/TWSC01 description The requested resource (/adventa/servlet/TWSC01) is not available. Apache Tomcat/4.1.29 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: generate images on the fly
You could try the JAI (Java Advanced Imaging) API. http://java.sun.com/products/java-media/jai/ You can generate jpegs and pngs but not gifs because the gif image format is commercial. I think you must have a license to create gif images. -Original Message- From: Thorsten Möller [mailto:[EMAIL PROTECTED] Sent: 31 October 2003 13:33 To: Tomcat Users List Subject: generate images on the fly Hi, slightly off topic but does anybody know an Java open source framework or class library which makes it possible to generate images (gif, jpg, png) on the fly on server side and send them to the client (or store them on the web app context)? Thanks, Thorsten - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: character sets showing as ?
I have fixed similar problems in the past by setting CATALINA_OPTS to -Dfile.encoding=ISO-8859-1 and restarting tomcat. -Original Message- From: chad kellerman [mailto:[EMAIL PROTECTED] Sent: 28 October 2003 19:27 To: Tomcat Users List Subject: character sets showing as ? Hey guys, I moved a few tomcat Apps from a 6.2 server to a 7.3 server. Running the same version of Tomcat. But now the character sets that are displayed are coming out as ? .. They are all spanish character sets. I tried changing to the character set to utf-8 from iso-8859-1 but still it comes up. Anyone ever seen this before? Maybe point me in the right direction. Thanks, Chad - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Servlet Deployment Problem
http://jakarta.apache.org/tomcat/faq/misc.html#invoker -Original Message- From: Miles, Fiske III [NTWK SVCS] [mailto:[EMAIL PROTECTED] Sent: 28 October 2003 20:10 To: [EMAIL PROTECTED] Subject: Servlet Deployment Problem I've spent 6-8 hours trying to figure out why Tomcat (ver 4.1.27) could not find servlet classes using a standard http://localhost:8080/%CATALINA_HOME%/appdir/servlet/ServletName url. While trying to run this down I used a stack of JSP development manuals, the WROX Apache Tomcat manual, and the Jakarta website to no avail. I tried every conceivable permutation of deployment web.xml file, server.xml file and app directory structure (carefully following directions from multiple books). The solution was finally found in a devshed forum -- the invoker servlet mapping has been commented out of the conf/web.xml file in the binary distribution. Why My second question is where would documentation for this issue reasonably be found? Fiske (frustrated JSP developer) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Multiple requests to the same servlet is problem
Sounds like your servlet is not thread-safe. Have you got any instance variables declared in your servlet class? -Original Message- From: Edson Alves Pereira [mailto:[EMAIL PROTECTED] Sent: 29 October 2003 13:07 To: 'Tomcat-User List' Subject: Multiple requests to the same servlet is problem Hello folks, i have one page with iframes, each iframe has a GET request, to a servlet that must bring description for a product code, and therefore each iframe has a different request like: url=/osctrl/exec/ProductDescription?code=478541.1 But when tomcat seems to confuse those three request and all of then display errors or the first request is displayed for all! Why does this happen? Regards, Edson - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Multiple requests to the same servlet is problem
If your servlet is NOT thread-safe, then concurrent requests could cause unpredictable behaviour. You say that the servlet works if the requests are sent one after the other, but not if the requests are sent at the same time. This indicates a possible threading issue. Many requests to the servlet could use the same servlet instance, so storing request information in instance variables is a bad idea because another request (thread) could change these values before you have finished with them. Regards, Andy -Original Message- From: Edson Alves Pereira [mailto:[EMAIL PROTECTED] Sent: 29 October 2003 13:49 To: 'Tomcat Users List' Subject: RE: Multiple requests to the same servlet is problem There´s no variable that would control that behavior, if reload each iframe, one after another, it fine ( using mouse for example ). But tell me, a thread-safe servlet could change this situation? -- De: Bodycombe, Andrew[SMTP:[EMAIL PROTECTED] Responder:Tomcat Users List Enviada: quarta-feira, 29 de outubro de 2003 9:08 Para: 'Tomcat Users List' Assunto: RE: Multiple requests to the same servlet is problem Sounds like your servlet is not thread-safe. Have you got any instance variables declared in your servlet class? -Original Message- From: Edson Alves Pereira [mailto:[EMAIL PROTECTED] Sent: 29 October 2003 13:07 To: 'Tomcat-User List' Subject: Multiple requests to the same servlet is problem Hello folks, i have one page with iframes, each iframe has a GET request, to a servlet that must bring description for a product code, and therefore each iframe has a different request like: url=/osctrl/exec/ProductDescription?code=478541.1 But when tomcat seems to confuse those three request and all of then display errors or the first request is displayed for all! Why does this happen? Regards, Edson - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Servlet.Service() NullPointer on Filter - Really need some he lp on this one...
Where are your req and res variables defined? They should be local to the doFilter() method or you could get concurrency issues. Andy -Original Message- From: Bradley Beddoes [mailto:[EMAIL PROTECTED] Sent: 28 October 2003 07:50 To: [EMAIL PROTECTED] Subject: Servlet.Service() NullPointer on Filter - Really need some help on this one... Hi All, I am hoping that someone is able to assist with some problems I am currently having with a filter I have written. The filter is designed to deal with authentication for users to check they have a particular cookie set then place an object into the session for further use. I have researched this error extensively online and can't find any documentation on correcting it. The error presented below only occurs on around 12% of requests (sometimes a few percent either side of this) according to my profiler when the code is put under some load - I am wondering if it may be caused by some form of concurrent request error in the filters whereby the Servlet object is being reset or otherwise nulled out. The codebase looks like: public void doFilter( ServletRequest request, ServletResponse response, FilterChain chain )throws IOException, ServletException { try { req = (HttpServletRequest)request; res = (HttpServletResponse)response; .. //Create Session object HttpSession session = req.getSession( true ); session.setAttribute( QutClientObject.NAME, qutClient ); sessionCreated = true; //set REMOTE_USER res.addHeader(REMOTE_USER,qutClient.getUserName()); // Filter chaining completed, move to next filter in chain chain.doFilter( request, response ); return; } } Error occurs on line: req.getSession( true ); The error from tomcat(both 4.1.24 and 4.1.27) is: 2003-10-28 17:35:35 StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception java.lang.NullPointerException at org.apache.coyote.tomcat4.CoyoteRequestFacade.getSession(CoyoteRequestFacade .java:365) at au.edu.qut.jauth.client.JAuthFilter.doFilter(JAuthFilter.java:197) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:213) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja va:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2416) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180 ) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve. java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172 ) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java :174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:601) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne ction(Http11Protocol.java:392) at
RE: Servlet.Service() NullPointer on Filter - Really need some he lp on this one...
Many requests may share the same Filter instance, so having instance variables to store the state of a request is a bad idea. You should look at re-coding your Filter to remove any instance variables. Andy -Original Message- From: Bradley Beddoes [mailto:[EMAIL PROTECTED] Sent: 28 October 2003 09:55 To: Tomcat Users List Subject: RE: Servlet.Service() NullPointer on Filter - Really need some he lp on this one... Hi Andy, I was considering that also however the req and res objects are specified as private members of the overall class that has been created (extends filter obviously) and i would have assumed that each request would instatiate a new object. Certainly willing to try them as local variables if you think that may help. cheers, Bradley Where are your req and res variables defined? They should be local to the doFilter() method or you could get concurrency issues. Andy -Original Message- From: Bradley Beddoes [mailto:[EMAIL PROTECTED] Sent: 28 October 2003 07:50 To: [EMAIL PROTECTED] Subject: Servlet.Service() NullPointer on Filter - Really need some help on this one... Hi All, I am hoping that someone is able to assist with some problems I am currently having with a filter I have written. The filter is designed to deal with authentication for users to check they have a particular cookie set then place an object into the session for further use. I have researched this error extensively online and can't find any documentation on correcting it. The error presented below only occurs on around 12% of requests (sometimes a few percent either side of this) according to my profiler when the code is put under some load - I am wondering if it may be caused by some form of concurrent request error in the filters whereby the Servlet object is being reset or otherwise nulled out. The codebase looks like: public void doFilter( ServletRequest request, ServletResponse response, FilterChain chain )throws IOException, ServletException { try { req = (HttpServletRequest)request; res = (HttpServletResponse)response; .. //Create Session object HttpSession session = req.getSession( true ); session.setAttribute( QutClientObject.NAME, qutClient ); sessionCreated = true; //set REMOTE_USER res.addHeader(REMOTE_USER,qutClient.getUserName()); // Filter chaining completed, move to next filter in chain chain.doFilter( request, response ); return; } } Error occurs on line: req.getSession( true ); The error from tomcat(both 4.1.24 and 4.1.27) is: 2003-10-28 17:35:35 StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception java.lang.NullPointerException at org.apache.coyote.tomcat4.CoyoteRequestFacade.getSession(CoyoteRe questFacade .java:365) at au.edu.qut.jauth.client.JAuthFilter.doFilter(JAuthFilter.java:197 ) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( Application FilterChain.java:213) at org.apache.catalina.core.ApplicationFilterChain.doFilter(Applicat ionFilterCh ain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrap perValve.ja va:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveCo ntext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline .java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java: 995) at org.apache.catalina.core.StandardContextValve.invoke(StandardCont extValve.ja va:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveCo ntext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline .java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java: 995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.j ava:2416) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostVal ve.java:180 ) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveCo ntext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispa tcherValve. java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveCo ntext.invok eNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportVal ve.java:172 ) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveCo ntext.invok eNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline .java:480) at
RE: modifying shutdown behaviour?
You could implement a ServletContextListener. The contextDestroyed() method will be called when your application is about to be removed. -Original Message- From: Julie McCabe [mailto:[EMAIL PROTECTED] Sent: 27 October 2003 13:30 To: [EMAIL PROTECTED] Subject: modifying shutdown behaviour? Hello, Config details: tomcat 4.1.24; java 1.4.1_02 When the $CATALINA_HOME/bin/shutdown.sh script is called I would like a particular web application to release its resources cleanly and perform tidy up operations before Tomcat shuts down. What is the best method of doing this? Does it involve modifying the $CATALINA_HOME/bin/catalina.sh script? Many thanks, Julie. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: JavaMail doesn't work
Try placing those jars in /common/lib instead -Original Message- From: Lawence [mailto:[EMAIL PROTECTED] Sent: 07 October 2003 16:39 To: Tomcat Users List Subject: JavaMail doesn't work Dear all, I installed Tomcat4.1.27 on one win2000 and one winXP. I tried the SendMailServlet that ships with it. The servlet worked fine on win2000 and it gave the following message on winXP:java.lang.NoClassDefFoundError: javax/mail/Message I guess this is because somehow Tomcat can't find the class. (This is wierd since I do not have the problem on win2000). So I downloaded the JavaMail and copied the mail.jar and activation.jar to $CATALINA_HOME/server/lib. But the problem was still there. Any suggestions? Thanks! - Do you Yahoo!? The New Yahoo! Shopping - with improved product search - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Unable to open the servlet.
You have not mapped your servlet to the /com/scheduler/addDataServlet URL. Try adding the following to your web.xml, before your welcome-file-list: servlet-mapping servlet-nameaddDataServlet/servlet-name url-pattern/com/scheduler/addDataServlet/url-pattern /servlet-mapping You may find the following documents useful: http://marc.theaimsgroup.com/?l=tomcat-userm=104327383710262w=2 http://jakarta.apache.org/tomcat/faq/misc.html http://java.sun.com/dtd/web-app_2_3.dtd -Original Message- From: anunay ashish [mailto:[EMAIL PROTECTED] Sent: 06 October 2003 10:05 To: Tomcat Users List Subject: Unable to open the servlet. Hi, My servlet is placed at: C:\Program Files\Apache Group\Tomcat 4.1\webapps\Tracking_system\WEB-INF\classes\com\scheduler with the name addDataServlet My web.xml is as follows: web-app servlet servlet-name addDataServlet /servlet-name servlet-class com.scheduler.addDataServlet /servlet-class /servlet welcome-file-list welcome-filepageFormat.jsp/welcome-file /welcome-file-list web-app I am calling it from my JSP page as: form action=servlet/com/scheduler/addDataServlet method=Post input type=text name=newPageFormat input type=Submit name=submitButton value=Submit /form But on clicking the submit button it takes me to: HTTP Status 404 - /com/scheduler/addDataServlet --- - type Status report message /com/scheduler/addDataServlet description The requested resource (/com/scheduler/addDataServlet) is not available. --- - Apache Tomcat/4.1.27 The text in the file localhost_log.2003-10-06.txt in logs folder corresponding to the above error message is: 2003-10-06 12:36:19 WebappLoader[/Tracking_system]: Deploy class files /WEB-INF/classes to C:\Program Files\Apache Group\Tomcat 4.1\webapps\Tracking_system\WEB-INF\classes 2003-10-06 12:36:19 StandardManager[/Tracking_system]: Seeding random number generator class java.security.SecureRandom Please suggest me the remedy for this. Regards, Anunay Ashish. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problem finding class files in tomcat-4.1.24
Check the FAQ http://jakarta.apache.org/tomcat/faq/classnotfound.html -Original Message- From: N.B.Bopanna [mailto:[EMAIL PROTECTED] Sent: 22 September 2003 11:33 To: [EMAIL PROTECTED] Subject: Problem finding class files in tomcat-4.1.24 Hi All, I am not able to find unpackaged class files in my web application. Class files which are packaged are working fine. I have placed the file in catalina_home\shared\classes. The server is Tomcat-4.1.24. Thanks in advance, Bopanna Sr Software Engineer, RCS Technologies. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: A Hebrew Problem
I suggest setting the file.encoding system property. export CATALINA_OPTS=-Dfile.encoding=utf-8 Then restart tomcat. I once had a similar problem with German umlaute characters and this seemed to fix it. Andy -Original Message- From: Yair Zohar [mailto:[EMAIL PROTECTED] Sent: 17 September 2003 10:33 To: Tomcat Users List Subject: Re: A Hebrew Problem After some investigation I'll try to refrase and improve my problem description: My Goal: including a hebrew html inside a jsp page. The Problem: hebrew is viewed by browser as question marks (no matter charset). Some details from my investigation: When I request the hebrew html directly (not included in a jsp but as the request target itself) I see it right (charset=windows-1255). When writing hebrew (same charset) in the same jsp page (that has the include action) I see it right (but the included html is still ). To be sure it's not the 'include' action (jsp:include page=relativePath/fileName flush=true /) fault, I replaced it by a function that returns the included page as a string and ensures it's read in ascii: %= pageExecuter.readHtml() % when this didn't help, I wanted to be sure my function is returning the jsp page an ascii string, I wrote this in the jsp page: //moving the html string to a char array. %char [] c = pageExecuter.readHtml().toCharArray(); for (int i=0; ic.length; i++){% //displaying 'character code' 'character' %= (int)c[i] %;nbsp; %= c[i] %br % } % in that way I can see in the browser each character's code and the character itself. I've got ascii codes, but near the hebrew ascii codes there were '?' (I'm aware of the different hebrew ascii sets exists I tried both 224-250 , 128 - 154 ) My conclusion: Tomcat doesn't send the browser a response with ascii code but with some other code. Any Idea ? Thanks for your efforts. Anton Tagunov wrote: Hello Yair! YZ I have this hebrew problem: YZ I'm trying to include a html in a jsp page: YZ jsp:include page=relativePath/fileName flush=true / YZ When it comes to a hebrew html the browser displays question marks YZ instead of hebrew (no matter what charset do I choose in the browser). YZ The same html is viewed nicely when I get it directly as a file 1) Do I get you right that you have web-app-root/some/a.jsp web-app-root/other/b.html and when you do http://www.myserver.some-domain/my-web-app/other/b.html you get something real, not question marks? 2) I vagually recall some talks about this being a JSP spec limitation on the list, but I did not delve into the topic then. I also recall that the it was mentioned then that the new spec-compliant but unconvinient behavior has been introduced recently. Anyone, any tips? (nagoya.apache.org eyebrowse search is not too much responsive when searching tomcat-dev, and tomcat-user is not indexed at all :-( YZ System: RH9 with tomcat-4.1.18, mod_jk-2.0.43, apache-2.0.44, j2sdk1.4.2 YZ It all works fine on an old server: RH7.1 tomcat-4.0.4 apache-1.3 YZ mysql-connector-java-3.0.7 j2sdk1.4.0_03 Anton - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Character Encoding problem (umlauts, etc).
This problem can usually be fixed by changing the file.encoding system property. Set CATALINA_OPTS to -Dfile.encoding=utf-8 (or iso-8859-1 or whatever character set you like) and restart tomcat Hope this helps Andy -Original Message- From: Robert Priest [mailto:[EMAIL PROTECTED] Sent: 08 September 2003 14:18 To: 'Tomcat Users List' Subject: RE: Character Encoding problem (umlauts, etc). Thanks for the information Anton. But just getting rid of umlauts or other international characters is not an option when you have clients that use your software in other countries, that have those special characters. We cannot rename user files or changed that data. That would be very, very, bad :) -Original Message- From: Anton Tagunov [mailto:[EMAIL PROTECTED] Sent: Saturday, September 06, 2003 5:46 AM To: Tomcat Users List Subject: Re: Character Encoding problem (umlauts, etc). Hello Robert! Robert Priest [EMAIL PROTECTED] wrote: RP I am requesting file : RP /38CF278C0186B466222FC48571080B83/51/dms00051/äää.txt RP but what is coming across in the request is: RP /38CF278C0186B466222FC48571080B83/51/dms00051/???.txt Probably your browser is sending it that way? I guess it is a bad idea anyways to type anything nasty in the browser URL input line. You may try to spy your interaction between browser and server, I have described how to do it in one of the sections of my ancient http://tagunov.tripod.com, try to find it there, then you'll know for sure what bytes are sent by browser. I guess that it is generally a bad idea to have anything nasty in the url at all. The closest you could get would be to encode it all as %AD and etc. But then you should be sure what encoding this is (utf-8 or anything). So, if these are links from your HTML page, why don't you encode all in the url directly on the server side and have A href=context/38CF278C0186B466222FC48571080B83/51/dms00051/%88%AA.txt but then why don't you get rid of these nasty umlauts at all? Why not use only normal latin letters, or, in case you heavily use numeric ids already, use only numeric ids? Anton - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Using jndi to get a DBCP BasicDataSource give ClassCastExce ption
I suppose there could be two different classes called BasicDataSource, in two different packages... -Original Message- From: Adam Hardy [mailto:[EMAIL PROTECTED] Sent: 05 September 2003 16:03 To: Tomcat Users List Subject: Re: Using jndi to get a DBCP BasicDataSource give ClassCastException And that was with the GlobalResourceLinK That doesn't make sense! If you get BasicDataSource as the class's name, then you won't get a ClassCastException if you try to cast it to that, but you did, so er. wow, you've got me stumped. On 09/05/2003 02:31 PM Angus Mezick wrote: I did an I got BasicDataSource. --Angus -Original Message- From: Adam Hardy [mailto:[EMAIL PROTECTED] Sent: Friday, September 05, 2003 4:19 AM To: Tomcat Users List Subject: Re: Using jndi to get a DBCP BasicDataSource give ClassCastException Hi Angus, looked at your first mail and couldn't see anything wrong with it. I can only suggest that you do some debugging, like output the .getClass().getName() from the datasource, to see what it really thinks it is. Adam On 09/04/2003 10:27 PM Angus Mezick wrote: Anyone have a clue as to whether or not this is a Real bug, or am I just screwing something up? -Original Message- From: Angus Mezick Sent: Wednesday, September 03, 2003 4:32 PM To: [EMAIL PROTECTED] Subject: Using jndi to get a DBCP BasicDataSource give ClassCastException I am having problems with the GlobalNamingResources. If I put my two DB resource entries into the GlobalNamingResources section and just use Resource-Links to access them I cannot cast from DataSource to BasicDataSource.. I need to do this to use this line in my monitoring app: (I can still use the Datasources to get talk to the DB, just not recast it from the interface to the concrete class) pageContext.getOut().println( jdbc/CommerceDB: Active: + ((BasicDataSource)ds).getNumActive() + Idle: + ((BasicDataSource)ds).getNumIdle() + br); If I define the resources directly in the Context everything works fine. ARGH! Here is my server.xml snippets: GlobalNamingResources Resource name=jdbc/SessionDBGlobal auth=Container type=javax.sql.DataSource/ Resource name=jdbc/CommerceDBGlobal auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/SessionDBGlobal parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter namemaxActive/name value100/value /parameter parameter namemaxIdle/name value5/value /parameter parameter namemaxWait/name value1/value /parameter parameter nameusername/name value/value /parameter parameter namepassword/name value/value /parameter parameter namedriverClassName/name valuecom.inet.tds.TdsDriver/value /parameter parameter nameurl/name valuejdbc:inetdae7a:IPADDR/value /parameter parameter namevalidationQuery/name valueselect top 1 name from syscolumns/value /parameter parameter nameremoveAbandoned/name valuetrue/value /parameter parameter nameremoveAbandonedTimeout/name value300/value /parameter parameter namelogAbandoned/name valuetrue/value /parameter parameter nametimeBetweenEvictionRunsMillis/name value6/value /parameter parameter nametestOnBorrow/name valuetrue/value /parameter parameter nametestWhileIdle/name valuetrue/value /parameter /ResourceParams ResourceParams name=jdbc/CommerceDBGlobal parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
RE: Using jndi to get a DBCP BasicDataSource give ClassCastExce ption
You could try Resource name=jdbc/SessionDBGlobal auth=Container type=org.apache.commons.dbcp.BasicDataSource/ Resource name=jdbc/CommerceDBGlobal auth=Container type=org.apache.commons.dbcp.BasicDataSource/ -Original Message- From: Angus Mezick [mailto:[EMAIL PROTECTED] Sent: 05 September 2003 16:37 To: Tomcat Users List Subject: RE: Using jndi to get a DBCP BasicDataSource give ClassCastExce ption Andrew: I wish, I don't use * in my imports though. I have attached the full tag that causes this error. Adam: Is there a tag named GlobalResourceLink that I am not aware of? I am using ResourceLink as the docs tell me. --Angus (3 A's) -Original Message- From: Bodycombe, Andrew [mailto:[EMAIL PROTECTED] Sent: Friday, September 05, 2003 11:11 AM To: 'Tomcat Users List' Subject: RE: Using jndi to get a DBCP BasicDataSource give ClassCastExce ption I suppose there could be two different classes called BasicDataSource, in two different packages... -Original Message- From: Adam Hardy [mailto:[EMAIL PROTECTED] Sent: 05 September 2003 16:03 To: Tomcat Users List Subject: Re: Using jndi to get a DBCP BasicDataSource give ClassCastException And that was with the GlobalResourceLinK That doesn't make sense! If you get BasicDataSource as the class's name, then you won't get a ClassCastException if you try to cast it to that, but you did, so er. wow, you've got me stumped. On 09/05/2003 02:31 PM Angus Mezick wrote: I did an I got BasicDataSource. --Angus -Original Message- From: Adam Hardy [mailto:[EMAIL PROTECTED] Sent: Friday, September 05, 2003 4:19 AM To: Tomcat Users List Subject: Re: Using jndi to get a DBCP BasicDataSource give ClassCastException Hi Angus, looked at your first mail and couldn't see anything wrong with it. I can only suggest that you do some debugging, like output the .getClass().getName() from the datasource, to see what it really thinks it is. Adam On 09/04/2003 10:27 PM Angus Mezick wrote: Anyone have a clue as to whether or not this is a Real bug, or am I just screwing something up? -Original Message- From: Angus Mezick Sent: Wednesday, September 03, 2003 4:32 PM To: [EMAIL PROTECTED] Subject: Using jndi to get a DBCP BasicDataSource give ClassCastException I am having problems with the GlobalNamingResources. If I put my two DB resource entries into the GlobalNamingResources section and just use Resource-Links to access them I cannot cast from DataSource to BasicDataSource.. I need to do this to use this line in my monitoring app: (I can still use the Datasources to get talk to the DB, just not recast it from the interface to the concrete class) pageContext.getOut().println( jdbc/CommerceDB: Active: + ((BasicDataSource)ds).getNumActive() + Idle: + ((BasicDataSource)ds).getNumIdle() + br); If I define the resources directly in the Context everything works fine. ARGH! Here is my server.xml snippets: GlobalNamingResources Resource name=jdbc/SessionDBGlobal auth=Container type=javax.sql.DataSource/ Resource name=jdbc/CommerceDBGlobal auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/SessionDBGlobal parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter namemaxActive/name value100/value /parameter parameter namemaxIdle/name value5/value /parameter parameter namemaxWait/name value1/value /parameter parameter nameusername/name value/value /parameter parameter namepassword/name value/value /parameter parameter namedriverClassName/name valuecom.inet.tds.TdsDriver/value /parameter parameter nameurl/name valuejdbc:inetdae7a:IPADDR/value /parameter parameter namevalidationQuery/name valueselect top 1 name from syscolumns/value /parameter parameter nameremoveAbandoned/name valuetrue/value
RE: Counting active sessions if server restarts very often
The easiest way is probably to have a single listener that implements both the HttpSessionListener and HttpSessionActivationListener interfaces. This has a single count of active sessions. In the sessionCreated() method, increment the count In the sessionDestroyed() method, decrement the count In the sessionDidActivate() method, increment the count In the sessionWillPassivate() method, decrement the count. This should eliminate the need to store anything in the session. Hope this helps Andy -Original Message- From: Christian Hauser [mailto:[EMAIL PROTECTED] Sent: 04 September 2003 10:01 To: Tomcat Users List Subject: Re: Counting active sessions if server restarts very often Shapira, Yoav wrote: Howdy, Is there an other way to implement this? Maybe by saving the variable activeSessions to a session (which is restored when the server has restarted)? This is not a bad idea, and might be the easiest way. A DB write on shutdown/read on startup is also an option. To recapitulate: I want to display all active sessions (~ active users). I use HttpSessionListener and increment a static int field every time sessionCreated is called. Unfortunately the server is restarted very often so I'd like to remember the active sessions by putting them into the session. But how? Like this? public class SessionCounter implements HttpSessionListener { public synchronized void sessionCreated(HttpSessionEvent event) { Integer i = (Integer)event.getSession().getAttribute(session.counter); if (i == null) { i = new Integer(0); } int activeSessions = i.intValue() + 1; event.getSession().setAttribute(session.counter, activeSessions); } public synchronized void sessionDestroyed(HttpSessionEvent event) { Integer i = (Integer)event.getSession().getAttribute(session.counter); if (i == null) { i = new Integer(0); } int activeSessions = i.intValue(); if (activeSessions 0) { activeSessions--; } event.getSession().setAttribute(session.counter, activeSessions); } public static int getActiveSessions() { return activeSessions; } } Jon Wingfield gave me the hint to put an object that implements HttpSessionActivationListener as an attribute to the session. But if I do that in the SessionListener#sessionCreated method I have 100 of those objects around when 100 concurrent users are using my web application. Does that make any sense? And what should I do when the object implementing HttpSessionActivationListener enters sessionWillPassivate? How do I save the count of active sessions? Sorry for all those questions, but I'd like to count the sessions even when the server restarts very often. Thank you for your help, Christian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Counting active sessions if server restarts very often
The sessionWillActivate() method is called every time a session activates. If your sessions are persistent, then each one will be re-activated when the server restarts, so this method is called once for each session that was passivated. One further point I forgot to mention - your SessionActivationListener must be bound to every session, otherwise the sessionWillActivate() and sessionDidPassivate() methods will not be called. You can bind the listener inside the sessionCreated() method. Sorry for the delay, I've just found this email in my 'Drafts' folder. Regards, Andy -Original Message- From: Christian Hauser [mailto:[EMAIL PROTECTED] Sent: 04 September 2003 10:51 To: Tomcat Users List Subject: Re: Counting active sessions if server restarts very often Thank you, Andrew, for your fast reply. I hope this works, but I still don't undestand what happens when the server is restarted when the sessionCount (current active sessions) is 10. Will sessionWillPassivate() and sessionDidActivate() be called 10 times? Why not once? But if they were called once, my count variable would be 1 instead of 10 after a restart. Could someone explain me in a few words what happens when the server is restarted? Thanx, Christian Bodycombe, Andrew wrote: The easiest way is probably to have a single listener that implements both the HttpSessionListener and HttpSessionActivationListener interfaces. This has a single count of active sessions. In the sessionCreated() method, increment the count In the sessionDestroyed() method, decrement the count In the sessionDidActivate() method, increment the count In the sessionWillPassivate() method, decrement the count. This should eliminate the need to store anything in the session. Hope this helps Andy -Original Message- From: Christian Hauser [mailto:[EMAIL PROTECTED] Sent: 04 September 2003 10:01 To: Tomcat Users List Subject: Re: Counting active sessions if server restarts very often Shapira, Yoav wrote: Howdy, Is there an other way to implement this? Maybe by saving the variable activeSessions to a session (which is restored when the server has restarted)? This is not a bad idea, and might be the easiest way. A DB write on shutdown/read on startup is also an option. To recapitulate: I want to display all active sessions (~ active users). I use HttpSessionListener and increment a static int field every time sessionCreated is called. Unfortunately the server is restarted very often so I'd like to remember the active sessions by putting them into the session. But how? Like this? public class SessionCounter implements HttpSessionListener { public synchronized void sessionCreated(HttpSessionEvent event) { Integer i = (Integer)event.getSession().getAttribute(session.counter); if (i == null) { i = new Integer(0); } int activeSessions = i.intValue() + 1; event.getSession().setAttribute(session.counter, activeSessions); } public synchronized void sessionDestroyed(HttpSessionEvent event) { Integer i = (Integer)event.getSession().getAttribute(session.counter); if (i == null) { i = new Integer(0); } int activeSessions = i.intValue(); if (activeSessions 0) { activeSessions--; } event.getSession().setAttribute(session.counter, activeSessions); } public static int getActiveSessions() { return activeSessions; } } Jon Wingfield gave me the hint to put an object that implements HttpSessionActivationListener as an attribute to the session. But if I do that in the SessionListener#sessionCreated method I have 100 of those objects around when 100 concurrent users are using my web application. Does that make any sense? And what should I do when the object implementing HttpSessionActivationListener enters sessionWillPassivate? How do I save the count of active sessions? Sorry for all those questions, but I'd like to count the sessions even when the server restarts very often. Thank you for your help, Christian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: tomcat migration problem
Hi Shanta, The order of your elements is important: (icon?,servlet-name,display-name?,description?,(servlet-class|jsp-file),ini t-param*,load-on-startup?,security-role-ref*) Your servlet-class tags must appear before your init-param tags. display-name and description must appear before servlet-class Hope this helps Andy -Original Message- From: Shanta B [mailto:[EMAIL PROTECTED] Sent: 03 September 2003 14:32 To: '[EMAIL PROTECTED]' Subject: tomcat migration problem [EMAIL PROTECTED] Hi I have an application siefriend..it had apache,jrun configuration.No w i am migrating to apache ,tomcat4.1.18 ...now i am getting following error. pl find my web.xml and catalina.out(sorry its big one). Thanks in advance shanta.B ?xml version=1.0 encoding=ISO-8859-1 ? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.2//EN http://java.sun.com/j2ee/dtds/web-app_2_2.dtd; web-app servlet servlet-nameInitParams/servlet-name init-param param-nameinitParam1/param-name param-valuevalue1/param-value /init-param init-param param-nameinitParam2/param-name param-valuevalue2/param-value /init-param servlet-classcom.siemens.mobile.framework.common.ServletParams/servlet-cl ass display-name/display-name description/description /servlet servlet servlet-nameFactoryInit/servlet-name init-param param-nameinitParam1/param-name param-valuevalue1/param-value /init-param init-param param-nameinitParam2/param-name param-valuevalue2/param-value /init-param servlet-classcom.siemens.mobile.framework.adapters.factory.ServletInit/se rvlet-class display-name/display-name description/description load-on-startup2/load-on-startup /servlet servlet servlet-nameInitUserServlet/servlet-name init-param param-nameinitParam1/param-name param-valuevalue1/param-value /init-param init-param param-nameinitParam2/param-name param-valuevalue2/param-value /init-param servlet-classcom.siemens.mobile.applications.siefriend.user.entry.InitUser Servlet/servlet-class display-name/display-name description/description load-on-startup3/load-on-startup /servlet servlet servlet-nameInitAdminServlet/servlet-name init-param param-nameinitParam1/param-name param-valuevalue1/param-value /init-param init-param param-nameinitParam2/param-name param-valuevalue2/param-value /init-param servlet-classcom.siemens.mobile.applications.siefriend.admin.servlet.InitA dminServlet/servlet-class display-name/display-name description/description load-on-startup4/load-on-startup /servlet servlet servlet-namewebaccess/servlet-name init-param param-nameinitParam1/param-name param-valuevalue1/param-value /init-param init-param param-nameinitParam2/param-name param-valuevalue2/param-value /init-param servlet-classcom.siemens.mobile.applications.siefriend.user.entry.WebAcces sServlet/servlet-class display-name/display-name description/description load-on-startup5/load-on-startup /servlet servlet servlet-namewapaccess/servlet-name init-param param-nameinitParam1/param-name param-valuevalue1/param-value /init-param init-param param-nameinitParam2/param-name param-valuevalue2/param-value /init-param servlet-classcom.siemens.mobile.applications.siefriend.user.entry.WapAcces sServlet/servlet-class display-name/display-name description/description load-on-startup6/load-on-startup /servlet servlet servlet-nameadminaccess/servlet-name init-param param-nameinitParam1/param-name param-valuevalue1/param-value /init-param init-param param-nameinitParam2/param-name param-valuevalue2/param-value /init-param servlet-classcom.siemens.mobile.applications.siefriend.admin.servlet.Admin AccessServlet/servlet-class display-name/display-name description/description load-on-startup7/load-on-startup /servlet servlet servlet-nameremoteadminaccess/servlet-name init-param param-nameinitParam1/param-name param-valuevalue1/param-value /init-param init-param param-nameinitParam2/param-name param-valuevalue2 /param-value /init-param
RE: Including port no in req.getServerName() output.
It may be better to use relative URLs (like '/shop/category.jsp') instead of the complete URL. This removes the need to hard-code your server name and port. Alternatively, you could use http://%=request.getServerName()+:+request.getServerPort()%/shop/categor y.jsp Note you may run into problems if you use SSL, because the http: will need to change to https: Hope this helps, Andy -Original Message- From: Antony paul [mailto:[EMAIL PROTECTED] Sent: 12 August 2003 11:07 To: tomcat mail list Subject: Including port no in req.getServerName() output. Hello, Is it possible to include the port no in the output of a call to request.getServerName(). I have written all JSP and Servlets which dont use the port no. The call is like this http://%=request.getServerName()%/shop/category.jsp. Now there is a need to change the port no of Tomcat. Is there any other way to change the JSP and servlets to include the port no. regards Antony Paul. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: question marks appearing after deploy to production server
Try setting CATALINA_OPTS=-Dfile.encoding=iso-8859-1 I think Sun changed the default character set in JDK1.4 - It is now ASCII HTH Andy -Original Message- From: Hans Wichman [mailto:[EMAIL PROTECTED] Sent: 13 August 2003 09:24 To: [EMAIL PROTECTED] Subject: question marks appearing after deploy to production server Hi, I have a strange problem, I wrote a servlet that retrieves some data from a database, which may contains characters such as ë. On my local tomcat 4.1.24 testserver the output shows correctly as in 'aërobe'. However if I deploy the application to one of our testservers, the result is 'a?robe'. Does anybody have a clue how this may happen? regards, Hans - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problem Generating ID
You may find the java.text.DecimalFormat class useful. -Original Message- From: N.B.Bopanna [mailto:[EMAIL PROTECTED] Sent: 12 August 2003 10:57 To: [EMAIL PROTECTED] Subject: Problem Generating ID Hi All, I am generating a ID to use as primary key in my table with the follwing code. double regno = (double)System.currentTimeMillis() * Math.random(); I am getting the result in exponential form (5.797797409006919E11) . But I do not want the result in exponential form, but like for eg something like 57977974090069.3219 is there a way out? thanks Bopanna Power of Global Information Access... .. Browser based RCS products. - Visit us at http://www.rcssoft.com/ for an online DEMO of all our web based products. User ID and Password will be available on request. PAYMAN - Payroll Management System TRAXX - Asset Management and Tracking System eSHOP - Online Information and Ordering System SALES STREAM - Sales Force Automation CARE - Call Management System DATA MINER - Query Builder and Report Generator Please write to [EMAIL PROTECTED] or reply to this mail for further details. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: cookie problem
The request.getCookies() will return null if no cookies were sent with the request. You should check that cookies != null before checking cookies.length -Original Message- From: Paul [mailto:[EMAIL PROTECTED] Sent: 12 August 2003 17:13 To: Tomcat Users List Subject: cookie problem I hava a JSP application under Tomcat 4.1.24, jdk 1.4, running as service on win2k currently in standalone mode. The default index.jsp page checks for cookie that has not yet been set. Under Tomcat 3.x (jdk 1.2), this cookie checking does not generate an error; however, under Tomcat 4 it generates an HTTP Status 500 exception report, where the root cause is given as java.lang.NullPointerException. If i subsequently run a page which does not check for cookie, that non-cookie checking page loads fine; and then the cookie checking page loads fine without any exception report. It is only when the cookie checking page runs FIRST that error message is generated. I am uncertain if this is some sort of jsp error or some sort of Tomcat error. here is code used to check for cookie, where that cookie does not exist when this code generates error. But then again, that cookie still does not exist when this code works fine (ie, after running a jsp that does not check for cookie) - which is why i am wondering if this has something to do with Tomcat 4, or perhaps how it is configured??? Cookie[] cookies = request.getCookies(); for(int j=0; jcookies.length; j++) { cookieName = cookies[j].getName(); cookieValue = cookies[j].getValue(); if (cookieName.equals(ex)) { xx = cookieValue; // wher xx is previously defined as a String object break; } } Any and all help is more than welcome, as i am a bit stumped as to how to begin troubleshooting this. -paul lomack - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Filter and servlet mapping problem
Maybe you could try rewriting your URL as /myjsp.jsp?time=timestamp_in_millis instead of /myjsp_timestamp_in_millis.jsp -Original Message- From: Mailing Listen [mailto:[EMAIL PROTECTED] Sent: 28 July 2003 11:16 To: Tomcat Users List Subject: Filter and servlet mapping problem I have written a filter for my webapp where i catch the response and Rewrite all URLs with a timestamp for bypassing some proxies that ignore The settings i set on my webserver (e.g. no-cache, no-store,...). The Filter works fine, but i haveto modify the requests when the reache my webserver. I am able to do this, but this only works if i the servlets i access are mapped in the web.xml of tomcat in the conf directory. The servlets that are mapped within the web.xmnl in the current context are not found. For explaining my problem a little more here an example: I have a URL like /myjsp.jsp I rewrite ist with /myjsp_timstamp_in_millis.jsp (timstamp_in_millis is the current timestamp) I filter this to /myjsp.jsp if the user requests the rewritten URL For .jsps that are mapped in the conf/web.xml file (by the default jsp servlet) anything works But i have some more servlet and some special jsp mappings that are mapped within the context and here i recieve an 404 although the servlet pathe and the URI are set correctly. Any advice is welcome Burkard Endres - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Servlet mapping problem in Tomcat 4.1.24
There are 2 ways you can use wildcards in URL mappings: 1. /content/* - maps all URLs in the content directory to your servlet 2. *.vp - maps all URLs with a .vp extension to your servlet You cannot mix these (/content/*.vp, for example) The servlet specification discusses this. Look at section 11.2 The spec can be downloaded from the following URL: http://www.jcp.org/aboutJava/communityprocess/final/jsr053/ Andy -Original Message- From: Jan Pekník [mailto:[EMAIL PROTECTED] Sent: 28 July 2003 21:39 To: Tomcat Users List Subject: Servlet mapping problem in Tomcat 4.1.24 Hi, I need to map servlet to some virtual file extension, i.e. /content/*.vp. When I set this in web.xml, and make request /content/somepage.html.vp, Tomcat ignores this mapping and servlets is not invoked. When I change mapping to /content/*, everything works ok. Where is the problem? I'm using Tomcat 4.1.24 on Windows 2000. Thanks for any help. -Jan Peknik - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: OnSessionEnd for Tomcat ?
Look at the HttpSessionListener interface. http://java.sun.com/j2ee/sdk_1.3/techdocs/api/ Create the sessionDestroyed() implementation and add a listener element to web.xml: http://java.sun.com/dtd/web-app_2_3.dtd -Original Message- From: Robert Priest [mailto:[EMAIL PROTECTED] Sent: 25 July 2003 16:50 To: '[EMAIL PROTECTED]' Subject: OnSessionEnd for Tomcat ? Hello All, I am looking for a way to detect when a session ends in tomcat and do a few things such as temp dir clean up, and so on. Can anyone point me to the proper documentation or provide info on this? thanks in advance... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Servlet Caching question
Just one question: The output from a servlet/JSP is dynamic, so why would you want to cache the output? -Original Message- From: Atreya Basu [mailto:[EMAIL PROTECTED] Sent: 25 July 2003 18:03 To: 'Tomcat Users List' Subject: RE: Servlet Caching question Okay, So if I want to do some caching for say: GET requests. Is there a way to cache output based on URL? Is this kind of thing simply not supported, and I will have to go to some other application server. _ Atreya Basu Developer, Greenfield Research Inc. e-mail: atreya (at) greenfieldresearch (dot) ca -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: July 25, 2003 1:59 PM To: Tomcat Users List Subject: RE: Servlet Caching question Howdy, Basically, tomcat doesn't. Yoav Shapira Millennium ChemInformatics -Original Message- From: Atreya Basu [mailto:[EMAIL PROTECTED] Sent: Friday, July 25, 2003 12:42 PM To: [EMAIL PROTECTED] Subject: Servlet Caching question Hello, I wanted to know how Tomcat caches the output of Servlets/JSPs. Could someone direct me to where I could find some information on that? _ Atreya Basu Developer, Greenfield Research Inc. e-mail: atreya (at) greenfieldresearch (dot) ca This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Servlet Caching question
That makes sense. I'd always considered that it was too dangerous to cache servlet output. I might try implementing this Filter and try to gain some performance... -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: 25 July 2003 18:17 To: Tomcat Users List Subject: RE: Servlet Caching question Howdy, Actually, caching of servlet/JSP output is not a rare request, and is sometimes valid. Especially if there is a common set of request parameters (ViewPage?pageId=... where the pageId has three values that are very common). It would be fairly trivial to write a URL-based caching filter. One does not come with tomcat, but it's less than a 20 minutes effort to write I think. Yoav Shapira Millennium ChemInformatics -Original Message- From: Bodycombe, Andrew [mailto:[EMAIL PROTECTED] Sent: Friday, July 25, 2003 1:06 PM To: 'Tomcat Users List' Subject: RE: Servlet Caching question Just one question: The output from a servlet/JSP is dynamic, so why would you want to cache the output? -Original Message- From: Atreya Basu [mailto:[EMAIL PROTECTED] Sent: 25 July 2003 18:03 To: 'Tomcat Users List' Subject: RE: Servlet Caching question Okay, So if I want to do some caching for say: GET requests. Is there a way to cache output based on URL? Is this kind of thing simply not supported, and I will have to go to some other application server. _ Atreya Basu Developer, Greenfield Research Inc. e-mail: atreya (at) greenfieldresearch (dot) ca -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: July 25, 2003 1:59 PM To: Tomcat Users List Subject: RE: Servlet Caching question Howdy, Basically, tomcat doesn't. Yoav Shapira Millennium ChemInformatics -Original Message- From: Atreya Basu [mailto:[EMAIL PROTECTED] Sent: Friday, July 25, 2003 12:42 PM To: [EMAIL PROTECTED] Subject: Servlet Caching question Hello, I wanted to know how Tomcat caches the output of Servlets/JSPs. Could someone direct me to where I could find some information on that? _ Atreya Basu Developer, Greenfield Research Inc. e-mail: atreya (at) greenfieldresearch (dot) ca This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: War files don't work
You need to make sure that you delete the webapps/nsfs directory before starting tomcat, or tomcat won't unpack the .war file. Place the .war file directly in the webapps directory. From: http://jakarta.apache.org/tomcat/tomcat-4.1-doc/appdev/deployment.html Copy the web application archive file into directory $CATALINA_HOME/webapps/. When Tomcat is started, it will automatically expand the web application archive file into its unpacked form, and execute the application that way. This approach would typically be used to install an additional application, provided by a third party vendor or by your internal development staff, into an existing Tomcat installation. NOTE - If you use this approach, and wish to update your application later, you must both replace the web application archive file AND delete the expanded directory that Tomcat created, and then restart Tomcat, in order to reflect your changes. -Original Message- From: Rick Roberts [mailto:[EMAIL PROTECTED] Sent: 23 July 2003 20:27 To: Tomcat Users List Subject: Re: War files don't work Making docBase = nsfs.war vice nsfs works!! :) However; the war file is not being unpacked. It seems that unpackWARs=true works the same as unpackWARs=false Thanks, Rick John Turner wrote: From the docs for Context: The Document Base (also known as the Context Root) directory for this web application, or the pathname to the web application archive file (if this web application is being executed directly from the WAR file). You may specify an absolute pathname for this directory or WAR file, or a pathname that is relative to the appBase directory of the owning Host. Thus, if you're going to put a Context entry in server.xml for nsfs, make the docBase nsfs.war, not nsfs. Further: http://jakarta.apache.org/tomcat/tomcat-4.1-doc/config/host.html#Automatic%2 0Application%20Deployment John Rick Roberts wrote: Does the nsfs.war file go into webapps directory or into webapps/nsfs directory? Currently, the webapps/nsfs dir does not exist. There is only the nsfs.war file setting in the webapps directory. I am assuming that Tomcat will create the webapps/nsfs directory for me when it expands the war file. I have temporarily set permissions to 777 on the webapps directory and it still does not expand, nor try to use, the war file. Rick John Turner wrote: You've told Tomcat the docBase is nsfs. Tomcat thusly looks for a directory called nsfs in the Host's appBase. If it finds it, and unpackWars is true, it will unpack your WAR file into that directory (webapps/nsfs, NOT webapps). Thus, Tomcat needs r+w on webapps/nsfs. Does Tomcat have r+w on webapps/nsfs? Alternatively, make unpackWars false. John Rick Roberts wrote: My directory permissions are as follows: drwxrwx---7 root tomcat4 4096 Jul 23 12:17 webapps ps -ef shows me this, which is think is Tomcat, which is run by user tomcat4: tomcat4 6199 1 0 12:17 pts/200:00:36 /usr/java/jdk1.4/bin/java -Djava.endorsed.dirs= -classpath /usr/java/jdk1.4/lib/tools.jar:/var Thanks, Rick Shapira, Yoav wrote: Howdy, 2003-07-23 11:09:30 StandardContext[/nsfs]: Resources start failed: java.lang.IllegalArgumentException: Document base /var/tomcat4/webapps/nsfs does not exist or is not a readable directory Well explain it to me! :) There is a /var/tomcat4/webapps/nsfs.war file. There should not be a /var/tomcat4/webapps/nsfs directory. If you have unpackWARS=true tomcat will try to explode your war into the directory specified as the docBase, which is nsfs under webapps. If it can't create this directory or read/write into it, you get the above error. Check file permissions on webapps. Yoav Shapira -- *** * Rick Roberts* * Advanced Information Technologies, Inc. * *** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat and Weblogic Integration
I'm guessing, but I suspect that the classes in weblogic.jar probably have dependencies on j2ee.jar. You may need to include the complete j2ee.jar in common/lib (and remove the servlet.jar, because that forms part of j2ee.jar) Andy -Original Message- From: Will Hartung [mailto:[EMAIL PROTECTED] Sent: 21 July 2003 19:05 To: Tomcat Users List Subject: Re: Tomcat and Weblogic Integration Did you ever manage to get this to work? We're having similar issues but don't find much in terms of resolution to the problems. Any luck?? Regards, Will Hartung ([EMAIL PROTECTED]) - Original Message - From: Rodney Leger [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, May 23, 2003 1:21 PM Subject: Tomcat and Weblogic Integration Tomcat Users: I am runing into some integration difficulties. I need to integrate Weblogic 8.1 and Tomcat 4.1. I realize that weblogic has its own JSP container but for this particular assignment it would be helpful to integrate them. I've added weblogic.jar to my tomcat/common/lib directory, however, I keep getting hit with the following error message: exception org.apache.jasper.JasperException: weblogic/rmi/extensions/server/Stub at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2 48) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:260) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) javax.servlet.ServletException: weblogic/rmi/extensions/server/Stub at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp l.java:497) at org.apache.jsp.UserManage_jsp._jspService(UserManage_jsp.java:152) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:136) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2 04) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) I've verified that the /weblogic/rmi/extensions/server/Stub is in the weblogic.jar file but it doesn't seem to find it. I've also tried to obtain the classpath that tomcat is using with a jsp that gets the system properties and prints the classpath. Unfortunately, the only thing that was return was: /usr/java/j2sdk1.4.1_01/lib/tools.jar:/usr/local/tomcat41/bin/bootstrap.jar This doesn't seem to be what I am looking for. What am i missing? I've seen a similar configuration work at another site, but I can't tell what I am doing wrong. Your help is greatly appreciated. Thanks- Rodney - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat and system properties
Yes. System properties are set for the JVM not each individual web application. http://java.sun.com/docs/books/tutorial/essential/system/properties.html If you require properties specific to your web application, you should use Servlet initialization parameters or ServletContext Initialization parameters. Andy -Original Message- From: Olivier Jouny [mailto:[EMAIL PROTECTED] Sent: 22 July 2003 10:28 To: [EMAIL PROTECTED] Subject: Tomcat and system properties Hi all, The system properties seems to be global in the tomcat JVM which means that a webapps can get the property of an other. This is annoying when you use two different version of the same web app where properties have different value. Is it a normal behavior ? Thanks. Olivier. _ MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. http://join.msn.com/?page=features/virus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problem with Dir Structure...
It depends on your servlet mapping in the web.xml file. -Original Message- From: Lenandlar Singh [mailto:[EMAIL PROTECTED] Sent: 22 July 2003 14:57 To: [EMAIL PROTECTED] Subject: Problem with Dir Structure... Hello, I have the following directory structure for an application under Tomcat 4.1. c:\Tomcat 4.1\webapps\testapp\postform.html c:\Tomcat 4.1\webapps\testapp\Web-inf\classes\ShowParameters.class where testapp is my application directory. How do i set the path for the Action attribute in postform.html? My Action is action = /ShowParameters Thanks. Len. - Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problem with Dir Structure...
Try adding the following to your web.xml servlet servlet-nameShowParameters/servlet-name servlet-classShowParameters/servlet-class !-- assumes your ShowParameters.class is not in a package -- /servlet servlet-mapping servlet-nameShowParameters/servlet-name url-mapping/ShowParameters/url-mapping /servlet-mapping NOTE: The servlet tags must appear before your servlet-mapping tags Your servlet is now mapped to the /ShowParameters URI, so your action attribute is correct. This is the preferred way to map your servlets. Alternatively, if you uncomment this part of your web.xml: servlet-mapping servlet-nameinvoker/servlet-name url-pattern/servlet/*/url-pattern /servlet-mapping Then you have already mapped /servlet/* to the invoker servlet, so you can then set your action to /servlet/ShowParameters. However, it opens a security hole if you use this second approach. -Original Message- From: Lenandlar Singh [mailto:[EMAIL PROTECTED] Sent: 22 July 2003 15:17 To: Tomcat Users List Subject: RE: Problem with Dir Structure... !-- The mapping for the default servlet -- servlet-mapping servlet-namedefault/servlet-name url-pattern//url-pattern /servlet-mapping !-- The mapping for the invoker servlet -- !-- servlet-mapping servlet-nameinvoker/servlet-name url-pattern/servlet/*/url-pattern /servlet-mapping -- Bodycombe, Andrew [EMAIL PROTECTED] wrote: It depends on your servlet mapping in the web.xml file. -Original Message- From: Lenandlar Singh [mailto:[EMAIL PROTECTED] Sent: 22 July 2003 14:57 To: [EMAIL PROTECTED] Subject: Problem with Dir Structure... Hello, I have the following directory structure for an application under Tomcat 4.1. c:\Tomcat 4.1\webapps\testapp\postform.html c:\Tomcat 4.1\webapps\testapp\Web-inf\classes\ShowParameters.class where testapp is my application directory. How do i set the path for the Action attribute in postform.html? My Action is action = /ShowParameters Thanks. Len. - Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: achieving a clients (browsers) certificate in a webapp
The 'javax.servlet.request.X509Certificate' request property will give you the client certificate chain. It contains an array of java.security.cert.X509Certificate Objects. Element [0] is the client certificate, Element [1] is the CA for the client certificate etc. -Original Message- From: Karli Christoph (CSE) [mailto:[EMAIL PROTECTED] Sent: 22 July 2003 16:04 To: 'Tomcat Users List' Subject: achieving a clients (browsers) certificate in a webapp now this seems like a big task! we've been trying to achieve a clients certificate from the request-object, which failed because there is no parameter for achieving the x509Certificate installed in the browser of the client out of the request-object (javax.servlet.ServletRequest). the certification of the server works fine, except the fact that the server-name on the certificate doesn't match the actual server-name of the webserver (we're about to change the server-name) anyway, we've spend the whole day - but we had no chance to figure out where the problem's hidden. what we use: jdk 1.3 apache 2.0.45 with openssl tomcat 4.1.24 mod_jk connector other hint: - https connection works on the webapp important parts of the configuration files: *** configuration of ssl.conf looks like this: IfDefine SSL Listen 443 AddType application/x-x509-ca-cert .crt AddType application/x-pkcs7-crl.crl SSLPassPhraseDialog builtin SSLSessionCache dbm:logs/ssl_scache SSLSessionCacheTimeout 300 SSLMutex file:logs/ssl_mutex SSLRandomSeed startup builtin SSLRandomSeed connect builtin VirtualHost _default_:443 DocumentRoot /opt/httpd-2.0.45/htdocs #ServerName new.host.name:443 ServerName servername.is.ok:443 ServerAdmin [EMAIL PROTECTED] ErrorLog logs/error_log TransferLog logs/access_log # SSL Engine Switch: # Enable/Disable SSL for this virtual host. SSLEngine on SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL SSLCertificateFile /opt/httpd-2.0.45/conf/ssl.crt/server.crt SSLCertificateKeyFile /opt/httpd-2.0.45/conf/ssl.key/server.key Files ~ \.(cgi|shtml|phtml|php3?)$ SSLOptions +StdEnvVars /Files Directory /opt/httpd-2.0.45/cgi-bin SSLOptions +StdEnvVars /Directory SetEnvIf User-Agent .*MSIE.* \ nokeepalive ssl-unclean-shutdown \ downgrade-1.0 force-response-1.0 CustomLog logs/ssl_request_log \ %t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \%r\ %b /VirtualHost /IfDefine *** configuration of httpd.conf looks like this: ... # # Bring in additional module-specific configurations # IfModule mod_ssl.c Include conf/ssl.conf /IfModule ... JkWorkersFile /opt/jakarta/conf/jk/workers.properties JkLogFile /opt/jakarta/logs/mod_jk.log JkLogLevel debug JkMount /examples ajp13 JkMount /examples/* ajp13 ... *** configuration of server.xml looks like this: ... !-- Define a SSL Coyote HTTP/1.1 Connector on port 8443 -- Connector className=org.apache.coyote.tomcat4.CoyoteConnector port=8443 minProcessors=5 maxProcessors=75 enableLookups=true acceptCount=10 debug=0 scheme=https secure=true useURIValidationHack=false Factory className=org.apache.coyote.tomcat4.CoyoteServerSocketFactory clientAuth=false protocol=TLS keystoreFile=.keystore keystorePass=x / /Connector !-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -- Connector className=org.apache.coyote.tomcat4.CoyoteConnector port=8009 minProcessors=5 maxProcessors=75 enableLookups=true redirectPort=8443 acceptCount=10 debug=0 connectionTimeout=0 useURIValidationHack=false protocolHandlerClassName=org.apache.jk.server.JkCoyoteHandler/ ... *** just anyone? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: achieving a clients (browsers) certificate in a webapp
You can set the javax.net.debug=ALL system property before starting tomcat. This may give you some insight to the problem. export CATALINA_OPTS=-Djavax.net.debug=ALL Then restart tomcat. -Original Message- From: Karli Christoph (CSE) [mailto:[EMAIL PROTECTED] Sent: 22 July 2003 16:53 To: 'Tomcat Users List' Subject: RE: achieving a clients (browsers) certificate in a webapp that's the point.. with the following code String certAttribute = javax.servlet.request.X509Certificate; X509Certificate certificate[] = (java.security.cert.X509Certificate[]) request.getAttribute(certAttribute); for (Enumeration e = request.getAttributeNames(); e.hasMoreElements();) { System.out.println(attribute: + e.nextElement()); } we just can achieve the following attributes: attribute: javax.servlet.include.servlet_path attribute: javax.servlet.include.context_path attribute: javax.servlet.request.cipher_suite attribute: javax.servlet.request.key_size attribute: javax.servlet.include.request_uri any other ideas? -Original Message- From: Bodycombe, Andrew [mailto:[EMAIL PROTECTED] Sent: Dienstag, 22. Juli 2003 17:39 To: 'Tomcat Users List' Subject: RE: achieving a clients (browsers) certificate in a webapp The 'javax.servlet.request.X509Certificate' request property will give you the client certificate chain. It contains an array of java.security.cert.X509Certificate Objects. Element [0] is the client certificate, Element [1] is the CA for the client certificate etc. -Original Message- From: Karli Christoph (CSE) [mailto:[EMAIL PROTECTED] Sent: 22 July 2003 16:04 To: 'Tomcat Users List' Subject: achieving a clients (browsers) certificate in a webapp now this seems like a big task! we've been trying to achieve a clients certificate from the request-object, which failed because there is no parameter for achieving the x509Certificate installed in the browser of the client out of the request-object (javax.servlet.ServletRequest). the certification of the server works fine, except the fact that the server-name on the certificate doesn't match the actual server-name of the webserver (we're about to change the server-name) anyway, we've spend the whole day - but we had no chance to figure out where the problem's hidden. what we use: jdk 1.3 apache 2.0.45 with openssl tomcat 4.1.24 mod_jk connector other hint: - https connection works on the webapp important parts of the configuration files: *** configuration of ssl.conf looks like this: IfDefine SSL Listen 443 AddType application/x-x509-ca-cert .crt AddType application/x-pkcs7-crl.crl SSLPassPhraseDialog builtin SSLSessionCache dbm:logs/ssl_scache SSLSessionCacheTimeout 300 SSLMutex file:logs/ssl_mutex SSLRandomSeed startup builtin SSLRandomSeed connect builtin VirtualHost _default_:443 DocumentRoot /opt/httpd-2.0.45/htdocs #ServerName new.host.name:443 ServerName servername.is.ok:443 ServerAdmin [EMAIL PROTECTED] ErrorLog logs/error_log TransferLog logs/access_log # SSL Engine Switch: # Enable/Disable SSL for this virtual host. SSLEngine on SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL SSLCertificateFile /opt/httpd-2.0.45/conf/ssl.crt/server.crt SSLCertificateKeyFile /opt/httpd-2.0.45/conf/ssl.key/server.key Files ~ \.(cgi|shtml|phtml|php3?)$ SSLOptions +StdEnvVars /Files Directory /opt/httpd-2.0.45/cgi-bin SSLOptions +StdEnvVars /Directory SetEnvIf User-Agent .*MSIE.* \ nokeepalive ssl-unclean-shutdown \ downgrade-1.0 force-response-1.0 CustomLog logs/ssl_request_log \ %t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \%r\ %b /VirtualHost /IfDefine *** configuration of httpd.conf looks like this: ... # # Bring in additional module-specific configurations # IfModule mod_ssl.c Include conf/ssl.conf /IfModule ... JkWorkersFile /opt/jakarta/conf/jk/workers.properties JkLogFile /opt/jakarta/logs/mod_jk.log JkLogLevel debug JkMount /examples ajp13 JkMount /examples/* ajp13 ... *** configuration of server.xml looks like this: ... !-- Define a SSL Coyote HTTP/1.1 Connector on port 8443 -- Connector className=org.apache.coyote.tomcat4.CoyoteConnector port=8443 minProcessors=5 maxProcessors=75 enableLookups=true acceptCount=10 debug=0 scheme=https secure=true useURIValidationHack=false Factory className=org.apache.coyote.tomcat4.CoyoteServerSocketFactory clientAuth=false protocol=TLS keystoreFile=.keystore keystorePass=x / /Connector !-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -- Connector className=org.apache.coyote.tomcat4.CoyoteConnector port=8009 minProcessors=5 maxProcessors=75 enableLookups=true redirectPort=8443 acceptCount=10 debug=0 connectionTimeout=0 useURIValidationHack=false
RE: Weird Problems installing servlets in Tomcat
Tomcat 4.1.24 comes with commons-fileupload-1.0-beta-1.jar bundled in the $CATALINA_HOME/server/lib directory. Tomcat needs this file to work, and also this version because the interface changed between this beta and the 1.0 final release. Tomcat is relying on the interface from the beta version (this may explain the NoSuchMethodError), so this file should be left where it is. If you wish your webapp to use the 1.0 release version of commons-fileupload, you can put in the WEB-INF/lib directory inside the .war file, or if you wish to share between several webapps, you can place the file in $CATALINA_HOME/shared/lib So, you may actually need 2 copies of commons-fileupload to get your application working: $CATALINA_HOME/server/lib/commons-fileupload-1.0-beta-1.jar $CATALINA_HOME/shared/lib/commons-fileupload-1.0.jar -Original Message- From: Rhino [mailto:[EMAIL PROTECTED] Sent: 22 July 2003 17:59 To: Tomcat Users List Subject: Re: Weird Problems installing servlets in Tomcat - Original Message - From: John Turner [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Tuesday, July 22, 2003 10:22 AM Subject: Re: Weird Problems installing servlets in Tomcat Rhino wrote: I'm still relatively new to Tomcat and Linux so I may be asking stupid questions; if so, I don't mean to be. I'm just trying to understand what's going wrong. It's very possible that I've made some kind of newbie mistake; I'm just trying to understand what it is and how to fix it. Move the JAR file to where it should be, like $CATALINA_HOME/lib or $CATALINA_HOME/common/lib as described in the ClassLoader HOWTO. I have had no luck getting Tomcat to load War files yet; I've been trying various things for hours but no joy yet First of all, I made a big mistake when I told you earlier that commons-fileupload-1.0.jar was in /var/tomcat4/server/lib, AKA $CATALINA_HOME/server/lib. I just plain looked at the wrong darned line of the screen. In fact, commons-fileupload-1.0.jar was in $CATALINA_HOME/common/lib (and still is). I think that's where I want it, right? Tomcat uses FileUpload itself doesn't it? Otherwise I would put it in the /shared path, right? I've been reading the HOWTO that you cited and I'm getting a bit confused; it seems to contradict both itself and you! According to the Quick Start section, JAR files containing resource which are to be shared across all web applications are to be placed in $CATALINA_HOME/shared/lib. Later, in the detailed description of the class loaders, it says that JAR resources which need to be shared across all web applications (except Tomcat itself) should be put in $CATALINA_HOME/lib, not shared/lib. I suspect that the Quick Start is wrong because it I don't even have a $CATALINA_HOME/shared/lib on the server. That assumption would also agree with your remarks which say to use $CATALINA_HOME/lib. The only problem is that I don't have a $CATALINA_HOME/lib either! (We are using Tomcat 4.1.24 on Linux Mandrake 9.1 and running Tomcat as a service.) Anyway, this is probably all a bit off point anyway; I should have commons-fileupload-1.0.jar in /common/lib, right? There's one other thing that I didn't post earlier which I'm starting to suspect is fairly critical. When I first copied commons-fileupload-1.0.jar into the $CATALINA_HOME/commons/lib, I noticed that there was already a jar in that directory with the name commons-upload.jar. I assumed that was an old version of the jar and deleted it. The reason I think this might have been a major mistake was that nothing worked right from that point on. I have been unable to install a single WAR file, even one whose servlets did no FileUploads, since the point where I copied commons-fileupload-1.0 jar into /commons/lib and deleted the commons-fileupload.jar. Could that really be the cause of my problems? If yes, what do I do about it? Do I need to find a copy of commons-fileupload.jar and put it into /commons/lib? If yes, what do I do about commons-fileupload-1.0.jar? Should it be in /common/lib as well? But won't that cause conflicts? I hope this note isn't too incoherent; I'm fairly confused right now and may not be making quite as much sense as I would like Rhino - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Classpath Conundrum (2nd try)
A very quick and very dirty solution is to change to setClasspath.sh (or .bat) script and include all your required .jar files in the tomcat system classpath. However, I would not recommend this solution. A better solution is to copy all your jar files into the WEB-INF/lib directory. Why are you not allowed to do this? -Original Message- From: Thomas Davis [mailto:[EMAIL PROTECTED] Sent: 17 July 2003 15:41 To: [EMAIL PROTECTED] Subject: Classpath Conundrum (2nd try) [I apologize is this message is a dupe. I had trouble sending messages to this group from a hotmail account.] I have been tasked with trying to get a legacy Java Servlet based application running under Tomcat 4.1.24 -- The application currently runs on JRun 2.3.3 On of the requirements imposed upon me is that I can't disturb the existing directory structure. I can't rename or move any directories (or their contents). Our third-party Java classes are in: c:\myapp\foreign Our application and development Java classes are in: c:\myapp\native The root directory of the web server is: c:\myapp\native\web I created the following Context in server.xml: Context path=/tomcat docBase=c:/myapp/native/web debug=0/ Then I created the servlet deployment file: c:\myapp\native\web\WEB-INF\web.xml The contents of said file: ?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 servlet servlet-namemyapp/servlet-name servlet-classcom.myapp.servlet.BootStrap/servlet-class /servlet servlet-mapping servlet-namemyapp/servlet-name url-pattern/myapp/url-pattern /servlet-mapping /web-app So now I'm all set to go, except that I'm going to (and did) get a class not found error because there is no /classes directory under WEB-INF and as mentioned above I can't copy the classes from /foreign and /native there. I can't create a symbolic link from /classes to /native since that would be recursive, and it wouldn't include /foreign which is also required. The /native and /foreign directories are in the CLASSPATH environment variable, but as documented in Class Loader HOW-TO that variable is ignored by the class loaders. It would seem to me that the easiest and most straight-forward solution is to get the class loaders to honor the CLASSPATH environment variable. I tried to accomplish this by hacking the start-up scripts, but could not get it to work. Could somebody please help me out here? What's the best way to get the class loader to look in /native and /foreign? Or is there a better solution (other than shuffling the directories around, which I can't do). Thanks a million! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Servlet Context Listener problem...
Make sure your DTD is the correct servlet 2.3 DTD. The listener element was introduced in version 2.3 of the servlet spec. -Original Message- From: Mufaddal Khumri [mailto:[EMAIL PROTECTED] Sent: 15 July 2003 04:58 To: Tomcat Users List Subject: Re: Servlet Context Listener problem... Yes , my listener has been declared before anything else under web-app .. the problem persists .. any clues ? On Tuesday, July 15, 2003, at 07:00 AM, Januski, Ken wrote: Listeners must be declared before any servlets in web.xml. I'd check that first. -Original Message- From: Mufaddal Khumri [mailto:[EMAIL PROTECTED] Sent: Monday, July 14, 2003 6:41 AM To: Tomcat List Subject: Servlet Context Listener problem... Hi: I implemented ServletContextListener in my class. I then wrote the xml in the web.xml file and started tomcat. The error tomcat threw tells me that it did not recognize the listener and listener-class elements ?? i have them declared in the web.xml as: web-app !-- ServletContextListener -- listener listener-class com.wavesinmotion.cw.classes.jsphelpers.CourseWizardContextListener /listener-class /listener /web-app Any ideas where I am going wrong ? Thanks. Tomcat threw this error below: SEVERE: Parse Error at line 10 column 12: Element type listener must be declared. org.xml.sax.SAXParseException: Element type listener must be declared. at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Erro r HandlerWrapper.java:232) at org.apache.xerces.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.ja v a:173) at org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.ja v a:371) at org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.ja v a:305) at org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(XMLDTDVal i dator.java:1833) at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator . java:724) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement( X MLDocumentFragmentScannerImpl.java:759) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDi s patcher.dispatch(XMLDocumentFragmentScannerImpl.java:1477) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLD o cumentFragmentScannerImpl.java:329) at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java: 5 25) at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java: 5 81) at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:152) at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.jav a :1175) at org.apache.commons.digester.Digester.parse(Digester.java:1495) at org.apache.catalina.startup.ContextConfig.applicationConfig(ContextConf i g.java:282) at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:639) at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig. j ava:243) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleS u pport.java:166) at org.apache.catalina.core.StandardContext.start(StandardContext.java:356 7 ) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188) at org.apache.catalina.core.StandardHost.start(StandardHost.java:738) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:347) at org.apache.catalina.core.StandardService.start(StandardService.java:497 ) at org.apache.catalina.core.StandardServer.start(StandardServer.java:2189) at org.apache.catalina.startup.Catalina.start(Catalina.java:512) at org.apache.catalina.startup.Catalina.execute(Catalina.java:400) at org.apache.catalina.startup.Catalina.process(Catalina.java:180) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.ja v a:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccesso r Impl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203) Jul 14, 2003 3:56:11 PM org.apache.commons.digester.Digester error SEVERE: Parse Error at line 11 column 19: Element type listener-class must be declared. org.xml.sax.SAXParseException: Element type listener-class must be declared. at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Erro r HandlerWrapper.java:232) at org.apache.xerces.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.ja v a:173) at
RE: Exception:getOutputStream() has already been called for thisresponse
Try commenting out the following lines and see if that works: RequestDispatcher rd = request.getRequestDispatcher(BidProxy); rd.include(request, response); It may be that the include is writing output to the response. -Original Message- From: Abid Ali Teepo [mailto:[EMAIL PROTECTED] Sent: 11 July 2003 16:38 To: Tomcat Users List Subject: RE: Exception:getOutputStream() has already been called for this response I don't understand Tim As far as i can see, i make no call to getOutputStream() And how come the exact same jsp-page will forward to my menu.jsp but not to safe.html. When i request the latter i get this exception. Here is my JSP : %@ page import=Bid.BidSession% % BidSession bidSession = BidSession.readParameters(request, AUTHCLIENT); RequestDispatcher rd = request.getRequestDispatcher(BidProxy); rd.include(request, response); session.setAttribute(bid.authenticated,new String(true)); String pageWanted = (String)session.getAttribute(bid.pageWanted); if(pageWanted!=null !.equals(pageWanted)) { System.out.println(PageWanted in netbid_done: +pageWanted); rd = request.getRequestDispatcher(pageWanted); rd.forward(request, response); } else { rd = request.getRequestDispatcher(/secure/menu.jsp); rd.forward(request, response); } % Could you please pinpoint my error ? Abid -Original Message- From: Tim Funk [mailto:[EMAIL PROTECTED] Sent: 11. juli 2003 17:13 To: Tomcat Users List Subject: Re: Exception:getOutputStream() has already been called for this response You have code which is getting the response's output stream, then NOT using it. Then your JSP is trying to gett the writer. You can get one or the other, not both. -Tim Abid Ali Teepo wrote: Hi Anyone recognize this exception : org.apache.jasper.JasperException: getOutputStream() has already been called for this response I get this exception when using requestDispatcher to forward to a html file. The exact same code works when i forward to a jsp file ?? Here is some code : pageWanted is /secure/safe.html if(pageWanted!=null !.equals(pageWanted)) { rd = request.getRequestDispatcher(pageWanted); rd.forward(request, response); } else { rd = request.getRequestDispatcher(/secure/menu.jsp); rd.forward(request, response); } Any suggestions ? Abid - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: RMI on Tomcat
You may problems using RMI if tomcat is installed in a directory containing whitespace. (e.g. C:\Program Files\Apache Group\...). -Original Message- From: Sanjay [mailto:[EMAIL PROTECTED] Sent: 09 July 2003 14:02 To: Tomcat Users List Subject: Re: RMI on Tomcat Anybody has any ideas on this, Thanks again, Sanjay --- Sanjay [EMAIL PROTECTED] wrote: I am trying to set a RMI-IIOP server on Tomcat. Getting some issues. MY RMI Server works fine if I start it standalone- without Tomcat. I think have been able to set security codebase etc correctly. Environment : Tomcat 4.1, Win NT4, JDK1.4.1 I have issues when I start the RMIServer in Tomcat. I can start tomcat in the secured mode and start my RMI server successfully but then I run into two different kinds of problems: 1. If I run the client from the same m/c as Tomcat then I can do the lookup and also do the PortableRemoteObject.narrow(). But a client on a difffrent m/c (in the same LAN) can not execute the narrow() - gives classcast Exception. 2. I can not execute a method on the server (even when I get the narrow() to succeeed). Gives error: java.rmi.NoSuchObjectException: CORBA OBJECT_NOT_EXIST 1398079692 No Has anyone done this. Any ideas suggestions would be welcome Thanks Sanjay __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: outof memory error
Hi Shanta You get an OutOfMemoryError when the stack or heap space is exhausted. You can increase the heap size by setting the -Xmx option in the startserver script, but I think it already allocates 300Mb at startup. 300Mb should be plenty of memory for these applications, so I suspect there is a serious memory leak. You can use a profiling tool, such as jmeter to examine your memory. http://jakarta.apache.org/jmeter/ Its free, but I've never used it, so I don't know how useful it will be. Andy -Original Message- From: Shanta B [mailto:[EMAIL PROTECTED] Sent: 09 July 2003 16:09 To: Tomcat Users List Subject: outof memory error Hi Sorry for disturbing...i would like to whats the reason behind java.lang.outofmemory...because currently at one site we are getting these errors in mscore and locator...what may be the reason ..how should i debug the processes memoryif u have any idea or links u pl forward to me...in the mean time iwill search for net alsoi hope ur not envoy with these mails... Thanks shanta.B - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: TomCat and EJBs in WebSphere
Try putting the jars you need in WEB-INF/lib -Original Message- From: brainSucka [mailto:[EMAIL PROTECTED] Sent: 08 July 2003 00:32 To: [EMAIL PROTECTED] Subject: Re: TomCat and EJBs in WebSphere absolutely no one out there, who can help me :-((( - Original Message - From: brainSucka [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, July 04, 2003 7:03 AM Subject: TomCat and EJBs in WebSphere Hi Guys! Im trying to use my TomCat as EJB-Client and reach WebSphere5 EJBs. (This is necessary for a special scenario i try to access). To reach WebSphere-JNDI-Namespace with a Client, one has to use the launchClient.bat that is shipped with WebSphere. This batch sets several properties, uses IBM-JRE and starts a com.ibmWSLauncher class. With this class the EJB-client is started. This works fine with a simple test-class that uses com.ibmInitialFactory. Now i tried to add the property-settings into catalina.bat, startup.bat = and setclasspath.bat. The problem is, that the WSLauncher starts the TomCat Bootstrap thats a Launcher itself. I read that TomCat ignores property-set Classpath e.g.. I tried to add = the .jars that are needed in TC\common\lib, but they still ignored. This = means, that i cant start TomCat, because it wants to instanciate the Factory. I tried to use a Factory thats included in j2se too, but its imopssible = to reach WebSphere JNDI-Namespace with it. I really need a solution :- Hope someone out there that can help me :-)) Greetings Patrick Elgner - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Where to put java code
Tomcat, by default, has symbolic links disabled. -Original Message- From: Peter Flynn [mailto:[EMAIL PROTECTED] Sent: 08 July 2003 10:54 To: Tomcat Users List Subject: Where to put java code I'm running jakarta-tomcat-4.1.18 for the purpose of serving with Cocoon, and that's working fine. But I also have a handful of users who have small .jsp files, most of which are trivial (the files, not the users :-)...with one exception, which calls on a custom search bean. This was working fine under the old JServ, but I can't make it work under jakarta-tomcat. The error messages in all the localhost_log.-MM-DD.txt files say: 2003-07-07 09:37:01 Error compiling file: /usr/local/tomcat/jakarta-tomcat-4.1.18/work/Standalone/localhost/_/info/eol as/2002/3_11/search_jsp.java [javac] Compiling 1 source file /usr/local/tomcat/jakarta-tomcat-4.1.18/work/Standalone/localhost/_/info/eol as/2002/3_11/search_jsp.java:48: package ie.b2bsoft.eolas does not exist ie.b2bsoft.eolas.SearchBean Search1 = null; ^ so I've obviously put it in the wrong place, but the Class Loader HOW-TO at http://jakarta.apache.org/tomcat/tomcat-4.1-doc/class-loader-howto.html says: For classes and resources specific to a particular web application, place unpacked classes and resources under /WEB-INF/classe of your web application archive, or place JAR files containing those classes and resources under /WEB-INF/lib of your web application archive. [presumably that should be classes in the second line], which is exactly where I *have* put the unpacked stuff. This server also runs regular Apache, and the JSP users all have regular HTML sites under the Apache docroot, so I have softlinked that docroot to ROOT in my jakarta-tomcat-4.1.18/webapps (yes, I know it's a horrible thing to do). In that docroot is a WEB-INF directory containing the classes subdirectory containing the unpacked classes thus: /usr/local/tomcat/jakarta-tomcat-4.1.18/webapps/ROOT/WEB-INF/classes/ie/b2bs oft/eolas: drwxrwxr-x2 root root 4096 Oct 12 2001 . drwxrwxr-x3 root root 4096 Oct 12 2001 .. -rw-rw-r--1 root root 1976 Oct 12 2001 HParser.class -rw-rw-r--1 root root 1180 Oct 12 2001 HParser.java -rw-rw-r--1 root root 3218 Oct 12 2001 SearchBean.class -rw-rw-r--1 root root 2111 Oct 12 2001 SearchBean.java The error message refers to a package (by which it presumably means a jar file?) but the classes were supplied unpacked so I typed jar cf eolas.jar . in the classes directory and moved the eolas.jar file to the lib directory...still no change. What have I done wrong? (apart from not being a Java person :-) ///Peter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: strange error
Sounds like you may have a corrupted .jar file. -Original Message- From: harsh [mailto:[EMAIL PROTECTED] Sent: 08 July 2003 10:18 To: Tomcat Users List Subject: strange error I ran the tomcat for second time and now when i try to stop it behaves like this.. [EMAIL PROTECTED] bin]# ./shutdown.sh Guessing CATALINA_HOME from catalina.sh to ./.. Setting CATALINA_HOME to ./.. Using CLASSPATH: ./../bin/bootstrap.jar:/usr/local/j2sdk1.4.0_01/lib/tools.jar Using CATALINA_BASE: ./.. Using CATALINA_HOME: ./.. Using JAVA_HOME: /usr/local/j2sdk1.4.0_01 Exception during startup processing java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39 ) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl .java:25) at java.lang.reflect.Method.invoke(Method.java:324) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243) Caused by: java.lang.ClassFormatError: org/apache/xerces/readers/DefaultEntityHandler$NullReader (Illegal Class name java/lang/Exce`tion) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:509) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at java.net.URLClassLoader.defineClass(URLClassLoader.java:246) at java.net.URLClassLoader.access$100(URLClassLoader.java:54) at java.net.URLClassLoader$1.run(URLClassLoader.java:193) at java.security.AccessController.doPrivileged(Native Method) at org.apache.catalina.util.xml.XmlMapper.readXml(XmlMapper.java:228) at org.apache.catalina.startup.Catalina.stop(Catalina.java:817) at org.apache.catalina.startup.Catalina.execute(Catalina.java:683) at org.apache.catalina.startup.Catalina.process(Catalina.java:179) and more like thisIf someone could understand the possible cause.. regards. -- harsh http://www.cse.iitb.ac.in/~harsh -- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: how to configure diff web applications under one tomcat
Just create a new context in server.xml Andy -Original Message- From: Shanta B [mailto:[EMAIL PROTECTED] Sent: 07 July 2003 17:07 To: Tomcat Users List Subject: how to configure diff web applications under one tomcat Hi I would like to know how to configure different web applications(web.xml) under one tomcat Thanks Regards Shanta.B - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: reply urgently tomcat installation query !!!!!!!
Yes. -Original Message- From: Eric J. Pinnell [mailto:[EMAIL PROTECTED] Sent: 03 July 2003 17:08 To: Tomcat Users List Subject: RE: reply urgently tomcat installation query !!! Hi, This is off topic but does tomcat/JDK even work on windows 98? -e On Thu, 3 Jul 2003, Shapira, Yoav wrote: Howdy, Don't use JDK 1.2, use JDK 1.3 or later. Set JAVA_HOME via the environment tab in My Computer. Yoav Shapira Millennium ChemInformatics -Original Message- From: harpreet kapur [mailto:[EMAIL PROTECTED] Sent: Thursday, July 03, 2003 11:25 AM To: [EMAIL PROTECTED] Subject: reply urgently tomcat installation query !!! sir/mam i have tried to install tomcat on windows 98 several times and tht mens several timesss actuallly 20 times but i am not able to install it pl cld u see the error its giving on startup command i ran on command mode and let me know wht RE CHANGES REQUIRED IF ANY??pl help me out I have noone to help me out as none of my aquaintances know java hope someone replies sooon I HAVE GIVEN THE RIGHT PATH AS FAR AS I KNOW I.E. in autoexec.bat file i did the following: set JAVA_HOME =C:\jdk1.2 set CATALINA_HOME = C:\TOMCAT set PATH = %PATH%;C:\jdk1.2\bin;C:\TOMCAT\bin ERROR: C:\Tomcat\binstartup The JAVA_HOME environment variable is not defined This environment variable is needed to run this program Using CATALINA_BASE: .. Using CATALINA_HOME: .. Using CATALINA_TMPDIR: ..\temp Using JAVA_HOME: Invalid switch - -DJAVA.ENDORSED.DIRS= SMS using the Yahoo! Messenger;Download latest version. This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Can any body help me?
The sun java compiler (javac) seems to run out of memory fairly quickly when compiling a large number of files. I found that using jikes from IBM got round this problem. Andy -Original Message- From: B.A.S.Perumal [mailto:[EMAIL PROTECTED] Sent: 02 July 2003 11:53 To: [EMAIL PROTECTED] Subject: Can any body help me? Hi guys, In the build process, I am getting the following stack trace error, while i am compiling 4200 java files. I made the changes in ant.bat as of the following %_JAVACMD% -Xms256m -Xmx384m -classpath %LOCALCLASSPATH% -Dant.home=%ANT_HOME% %ANT_OPTS% org.apache.tools.ant.Main %ANT_CMD_LINE_ARGS% still i am facing the stack trace problem. [compile.ecp] The system is out of resources. [compile.ecp] Consult the following stack trace for details. [compile.ecp] java.lang.OutOfMemoryError [compile.ecp] no stack trace available can any one help me on this. I am using jakarta ant 1.5.1 waiting for ur early reply. bas - Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Can any body help me?
Did you set your build.compiler property to jikes? -Original Message- From: B.A.S.Perumal [mailto:[EMAIL PROTECTED] Sent: 02 July 2003 12:01 To: Tomcat Users List Subject: RE: Can any body help me? Hi andrew, I even tried with jikes also.. still i am getting stack trace error.. my jikes settings goes like this. :runAntWithJikes %_JAVACMD% -Xms256m -Xmx384m -classpath %LOCALCLASSPATH% -Dant.home=%ANT_HOME% -Djikes.class.path=%JIKESPATH% %ANT_OPTS% org.apache.tools.ant.Main %ANT_CMD_LINE_ARGS% with luv, bas Bodycombe, Andrew [EMAIL PROTECTED] wrote: The sun java compiler (javac) seems to run out of memory fairly quickly when compiling a large number of files. I found that using jikes from IBM got round this problem. Andy -Original Message- From: B.A.S.Perumal [mailto:[EMAIL PROTECTED] Sent: 02 July 2003 11:53 To: [EMAIL PROTECTED] Subject: Can any body help me? Hi guys, In the build process, I am getting the following stack trace error, while i am compiling 4200 java files. I made the changes in ant.bat as of the following %_JAVACMD% -Xms256m -Xmx384m -classpath %LOCALCLASSPATH% -Dant.home=%ANT_HOME% %ANT_OPTS% org.apache.tools.ant.Main %ANT_CMD_LINE_ARGS% still i am facing the stack trace problem. [compile.ecp] The system is out of resources. [compile.ecp] Consult the following stack trace for details. [compile.ecp] java.lang.OutOfMemoryError [compile.ecp] can any one help me on this. I am using jakarta ant 1.5.1 waiting for ur early reply. bas - Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Can any body help me?
I have a line in the build.xml file: property name=build.compiler value=jikes/ -Original Message- From: B.A.S.Perumal [mailto:[EMAIL PROTECTED] Sent: 02 July 2003 12:21 To: Tomcat Users List Subject: RE: Can any body help me? Hi, I dont know, I am new to this build process... Could you please tell me how to set that attribute. bas Bodycombe, Andrew [EMAIL PROTECTED] wrote: Did you set your build.compiler property to jikes? -Original Message- From: B.A.S.Perumal [mailto:[EMAIL PROTECTED] Sent: 02 July 2003 12:01 To: Tomcat Users List Subject: RE: Can any body help me? Hi andrew, I even tried with jikes also.. still i am getting stack trace error.. my jikes settings goes like this. :runAntWithJikes %_JAVACMD% -Xms256m -Xmx384m -classpath %LOCALCLASSPATH% -Dant.home=%ANT_HOME% -Djikes.class.path=%JIKESPATH% %ANT_OPTS% org.apache.tools.ant.Main %ANT_CMD_LINE_ARGS% with luv, bas Bodycombe, Andrew wrote: The sun java compiler (javac) seems to run out of memory fairly quickly when compiling a large number of files. I found that using jikes from IBM got round this problem. Andy -Original Message- From: B.A.S.Perumal [mailto:[EMAIL PROTECTED] Sent: 02 July 2003 11:53 To: [EMAIL PROTECTED] Subject: Can any body help me? Hi guys, In the build process, I am getting the following stack trace error, while i am compiling 4200 java files. I made the changes in ant.bat as of the following %_JAVACMD% -Xms256m -Xmx384m -classpath %LOCALCLASSPATH% -Dant.home=%ANT_HOME% %ANT_OPTS% org.apache.tools.ant.Main %ANT_CMD_LINE_ARGS% still i am facing the stack trace problem. [compile.ecp] The system is out of resources. [compile.ecp] Consult the following stack trace for details. [compile.ecp] java.lang.OutOfMemoryError [compile.ecp] can any one help me on this. I am using jakarta ant 1.5.1 waiting for ur early reply. bas - Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Servlet mapping error
Try the following URL: http://host:port/bugtracker/servlets/LoginServlet Hope this helps, Andy -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 27 June 2003 18:17 To: [EMAIL PROTECTED] Subject: Servlet mapping error I'm trying to map a Servlet URL and then invoke that Servlet in my web app. When I attempt this, I'm getting the following error in my browser: [start error] HTTP Status 404 - /servlets/LoginServlet type Status report message /servlets/LoginServlet description The requested resource (/servlets/LoginServlet) is not available. Apache Tomcat/4.1.24 [end error] Under tomcat home/webapps/bugtracker/WEB-INF/web.xml, I have the following snippet of lines: servlet servlet-nameLoginServlet/servlet-name servlet-classcom.bugtracker.servlets.LoginServlet/servlet-class /servlet servlet-mapping servlet-nameLoginServlet/servlet-name url-pattern/servlets/LoginServlet/url-pattern /servlet-mapping Under tomcat home/webapps/bugtracker/WEB-INF/classes, I have: /com/bugtracker/servlets/LoginServlet.class In my login.jsp, I have this line: form method=post action=/servlets/LoginServlet Can anyone give me suggestions on what I might be doing wrong? Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Special characters
You have to specify the file.encoding system property export CATALINA_OPTS=-Dfile.encoding=iso-8859-1 Then restart tomcat. HTH, Andy -Original Message- From: David Del Sacramento [mailto:[EMAIL PROTECTED] Sent: 12 June 2003 15:04 To: [EMAIL PROTECTED] Subject: Special characters Hi, I installed Tomcat 4.1.24 in a Solaris server and I'm using a JSP form that received special characters like: á é Ó É ú. The action of the form send an e-mail (using javamail). When de tomcat process the e-mail changes the special characters with ?. I used the directive %@ page contentType=text/html; charset=iso-8859-1 % but it isn't working. I installed Tomcat 4.0.6 and the error is the same. I used java.net.URLDecoder and java.net.URLEncode and isn´t work too. Can you help me? Regards, David __ Do you Yahoo!? Yahoo! Calendar - Free online calendar with sync to Outlook(TM). http://calendar.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Special characters
There should not be an '=' after the iso-8859-1. What does echo $CATALINA_OPTS show? Andy -Original Message- From: David Del Sacramento [mailto:[EMAIL PROTECTED] Sent: 12 June 2003 15:27 To: Tomcat Users List Subject: RE: Special characters Thnaks Andy, I did export CATALINA_OPTS, but I got the next error. - java.io.UnsupportedEncodingException: iso-8859-1= at sun.io.Converters.getConverterClass(Converters.java:107) at sun.io.Converters.newConverter(Converters.java:138) at sun.io.CharToByteConverter.getConverter(CharToByteConverter.java:67) at java.io.OutputStreamWriter.init(OutputStreamWriter.java:75) at com.sun.mail.handlers.text_plain.writeTo(text_plain.java:106) at javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:839) at javax.activation.DataHandler.writeTo(DataHandler.java:295) at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1147) at javax.mail.internet.MimeMessage.writeTo(MimeMessage.java:1600) at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:321) at javax.mail.Transport.send0(Transport.java:163) at javax.mail.Transport.send(Transport.java:80) at SendMessage.send(SendMessage.java:116) at org.apache.jsp.procesar_0002dpublicacion_0002dcarro_0002dpr$jsp._jspService( procesar_0002dpublicacion_0002dcarro_0002dpr$jsp.java:526) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja va:201) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:243) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 66) 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.ja va:190) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 66) 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:2347) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180 ) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 66) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve. java:170) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 64) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170 ) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 64) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 64) 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 :174) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 66) 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: 1027) at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125 ) at java.lang.Thread.run(Thread.java:484) - Do you have any idea? I will apreciate your help David --- Bodycombe, Andrew [EMAIL PROTECTED] wrote: You have to specify the file.encoding system property export CATALINA_OPTS=-Dfile.encoding=iso-8859-1 Then restart tomcat. HTH, Andy -Original Message- From: David Del Sacramento [mailto:[EMAIL PROTECTED] Sent: 12 June 2003 15:04 To: [EMAIL PROTECTED] Subject: Special characters Hi, I installed Tomcat 4.1.24 in a Solaris server and I'm
RE: SSL client authentication with tomcat 4.1.24
You need to import your personal certificate into your browser. In IE: Select 'Internet Options' from the Tools Menu Select the Content tab Press the certificates button This takes you to the screen showing all your certificates Select the 'Personal' tab Press Import to import your certificate Andy -Original Message- From: Duma Rolando [mailto:[EMAIL PROTECTED] Sent: 06 June 2003 11:31 To: Tomcat Mailing List Subject: SSL client authentication with tomcat 4.1.24 Is there anyone that have a running tomcat 4.1.24 standalone server with SSL and clientAuth=true? My current config doesn't work ( i.e. Internet Explorer doesn't display my personal certificate, Mozilla displays an error message ).I tried with only one SSL connector on port 443 and with also an http connector on port 80 without success.I would like to know if I'm wasting time or there are success stories about this in this community. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: handling of Unicode still broken in 4.1.24
You could try setting your file.encoding system property. That might help. Sun changed the default value for this property in JDK1.4 On *nix systems it changed from ISO-8859-1 to ASCII. Andy -Original Message- From: Carole Mah [mailto:[EMAIL PROTECTED] Sent: 26 March 2003 17:19 To: [EMAIL PROTECTED] Subject: handling of Unicode still broken in 4.1.24 Hello, I've been using Tomcat 4.0.6 for some time now, because neither 4.1.12 nor 4.1.18 handled my Unicode correctly. When 4.1.18 came out, my co-worker Paul Caton posted to this list asking for help on this issue. I had supposed by now the issue would have been solved, so I cheerily and with much anticipation installed 4.1.24. However, the unicode handling is still bad in 4.1.24, so we are sticking with 4.0.6. We're wondering if this issue is going to be addressed in future releases. I am willing to send the actual URLs of the tomcat servers on which the test documents reside to any developer who wants them, but I'd rather not post those URLs to the public at large. I can also send any jsp code, xsl stylesheets, Xinclude stuff, etc. In lieu of that here, I'll just give the URLs of two comparative screenshots to show the differences in the Unicode handling: bad: http://dev.stg.brown.edu/screenshots/acsam-4.1.24.jpg good: http://dev.stg.brown.edu/screenshots/acsam-4.0.6.jpg Thank you very much for any help with this! -carole -- Carole E. Mah [EMAIL PROTECTED] Senior Programmer/Analyst Brown University Computing Information Services Academic Technology Services Scholarly Technology Group phn 401-863-2669 fax 401-863-9313 http://www.stg.brown.edu/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Class not found
JspServlet is found in jasper-compiler.jar. It should be in $CATALINA_HOME/common/lib Andy -Original Message- From: Herbert G. Fischer [mailto:[EMAIL PROTECTED] Sent: 26 March 2003 14:13 To: Tomcat Users List Subject: Re: Class not found And why there is no JspServlet on Tomcat 4.1.24's servlet.jar ??? Tim Funk wrote: http://tomcatfaq.sourceforge.net/classnotfound.html Odds are servlet.jar is somewhere it shouldn't be. servlet.jar should be in $CATALINA_HOME/common/lib/ (and only there) -Tim Herbert G. Fischer wrote: Hi again, Just after starting Tomcat, I'm getting the following error. I don't know if this is problematic, but I don't like errors. Anyone here knows what can be wrong?? WebappClassLoader: addRepository(/WEB-INF/classes/) WebappClassLoader: loadClass(java.lang.Integer, false) WebappClassLoader: loadClass(java.lang.Number, false) WebappClassLoader: loadClass(org.apache.jasper.servlet.JspServlet, false) WebappClassLoader: Searching local repositories WebappClassLoader: findClass(org.apache.jasper.servlet.JspServlet) WebappClassLoader: findClassInternal(org.apache.jasper.servlet.JspServlet) WebappClassLoader: -- Passing on ClassNotFoundException java.lang.ClassNotFoundException: org.apache.jasper.servlet.JspServlet at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLo ader.java:1623) at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.jav a:968) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav a:1409) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav a:1289) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:88 5) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:823) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java: 3420) at org.apache.catalina.core.StandardContext.start(StandardContext.java:3608) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188) at org.apache.catalina.core.StandardHost.start(StandardHost.java:738) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:347) at org.apache.catalina.core.StandardService.start(StandardService.java:497) at org.apache.catalina.core.StandardServer.start(StandardServer.java:2190) at org.apache.catalina.startup.Catalina.start(Catalina.java:512) at org.apache.catalina.startup.Catalina.execute(Catalina.java:400) at org.apache.catalina.startup.Catalina.process(Catalina.java:180) 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:203) WebappClassLoader: Delegating to parent classloader WebappClassLoader: Loading class from parent EngineConfig: EngineConfig: Processing START Mar 26, 2003 10:19:06 AM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on port 8180 Mar 26, 2003 10:19:06 AM org.apache.jk.common.ChannelSocket init INFO: JK2: ajp13 listening on /0.0.0.0:8109 Mar 26, 2003 10:19:06 AM org.apache.jk.server.JkMain start INFO: Jk running ID=0 time=5/14 config=/root/tomcat/conf/jk2.properties WebappClassLoader: modified() WebappClassLoader: modified() WebappClassLoader: modified() - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Do you run Tomcat with SSL?
You can write a class that implements the X509TrustManager interface. Then initialize your SSLContext with this TrustManager. Get a SocketFactory for your SSLContext. Finally, set this as the default SocketFactory for all HttpsUrlConnections. The code in your checkClientTrusted method will execute every time someone tries to make a connection via HTTPS. This method takes an array of X509Certificates as a parameter (the whole certificate chain, not just the supplied client certificate) HTH Andy -Original Message- From: Josef Templ [mailto:[EMAIL PROTECTED] Sent: 14 March 2003 11:10 To: Tomcat Users List Subject: Re: Do you run Tomcat with SSL? I can confirm that it works. I am using tomcat 4.1.12. The only point I have not solved so far is how to get access to the client certificate in my servlet or JSP. I would like to do programmatic security, i.e. store users in a database and verify the authenticated user in a JSP or servlet. Does anybody know if this is possible at all? - Josef Templ - Original Message - From: Gabriel Santonja [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Friday, March 14, 2003 11:56 AM Subject: Re: Do you run Tomcat with SSL? On Thu, 13 Mar 2003 19:51:57 -0800 (PST) Mark Liu [EMAIL PROTECTED] wrote: I know you guys have your great strategies in balancing Apache and Tomcat. But, my project isn't really so picky about efficiency, so I simply run Tomcat with SSL all the time. It simplifies my project a little bit. But then I do need to be able to run Tomcat SSL with the certificated generated by my little Java program. Why don't you use the SSL HOwto in tomcat?. I'am not sure on windows but on linux it work fine with SSL on the 8443 port Actually my own problem is to use SSL only in realm login page but it's visibly difficult. Goodbye. ___ Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français ! Yahoo! Mail : http://fr.mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Apache - Tomcat connectors
I'm sure the tomcat developers would be delighted if you provided this documentation... -Original Message- From: Chris Dodunski [mailto:[EMAIL PROTECTED] Sent: 14 March 2003 12:07 To: Tomcat Users List Subject: Apache - Tomcat connectors I'm honestly astounded at the number of people struggling with successfully installing and configuring Apache - Tomcat connectors. An extensive search of apache.org (and other sites) reveals why. Documentation is vague, fragmented, and quite frankly confusing. It's frustrating and it's time wasting. Time I say for some clear, concise, blow by blow documentation on performing what should be a relatively simple procedure. Do you agree? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Microsoft ISA Proxie
You can use the solution offered by nogoop http://www.nogoop.com You can download an evaluation copy of the software for free, but you need to purchase it if its going to be used commercially... I've been evaluating this solution with good results - it gets round the NTLM authentication problem nicely, but I've found the performance is quite poor. However, the documentation states that performance is poor in the evaluation version due to all the debug messages. Regards, Andy. -Original Message- From: Edson Alves Pereira [mailto:[EMAIL PROTECTED] Sent: 11 March 2003 14:42 To: 'Tomcat-User List' Subject: Microsoft ISA Proxie Hello folks, i having some problems with Microsoft Proxies in our network, it´s use Microsoft specific User Authentication protocol (NTLM), someone known how i could fix it? With best wishes, Edson Alves Pereira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat/RMI and Spaces in Filenames
I am having a problem with Tomcat 4.1.18 running on Windows NT 4, and JDK 1.4 I have a servlet accessing a remote server via RMI, and the RMI calls fail with an UnmarshallException, but only when the tomcat install directory contains spaces. e.g. C:\Program Files\Apache Group\Tomcat 4.1\, the default install directory. I enclose the stack trace: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: java.net.MalformedURLException: no protocol: Files/Apache java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: java.net.MalformedURLException: no protocol: Files/Apache java.net.MalformedURLException: no protocol: Files/Apache at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteC all.java:240) at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:215) at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:117) at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source) at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProx y.java:128) at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:108) at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:73 ) at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:76) at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:185) at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:76) at $Proxy0.create(Unknown Source) at uk.co.siemenscomms.eng.j2ee.model.GazetteerManager.getStreet(GazetteerManage r.java:103) at uk.co.siemenscomms.eng.j2ee.action.MoreDetailsAction.perform(MoreDetailsActi on.java:90) at org.apache.struts.action.ActionServlet.processActionPerform(ActionServlet.ja va:1786) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1585) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:243) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 66) 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.ja va:190) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 66) 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:2347) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180 ) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 66) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve. java:170) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 64) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170 ) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 64) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 64) 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 :174) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 66) 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: 1027) at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125 ) at java.lang.Thread.run(Thread.java:479) In this case, the servlet is accessing an EJB on a remote machine when the exception occurs, but the same happens when accessing an RMI server on the same machine, in a different VM. Note the
RE: JSP source
Fetching the HTML is straightforward. Just create a URL connection and read the data from the stream. You could try the following: 1. Implement your report as a JSP or Servlet 2. Write an email component that acts as a client to this servlet which a) opens a URL connection to your servlet b) reads the HTML c) mails it to the intended recipients. 3. Write a cron job to run your email component Andy -Original Message- From: Deepa Raja [mailto:[EMAIL PROTECTED]] Sent: 09 January 2003 15:43 To: Tomcat Users List Subject: RE: JSP source Hi John With JSP it is like a template and I need not worry about placing the content within the template. that is the only reason for me to use a JSP. We have some applications already running Apache - Tomcat and adding a JSP is not going to be difficult Also with JSP I can alter the format very easily Please feel free to point out if I'm wrong. how could I get the html source? Could you please explain it for me. Thanks Deepa -Original Message- From: Turner, John [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 09, 2003 3:02 PM To: 'Tomcat Users List' Subject: RE: JSP source If you combine #3 and #4, your problem is solved. Format the details as a report...how would you format them if not HTML? All you have to do is stream the HTML into a buffer, then send that out as the body of a message. You'll want to set the ContentType on your message to HTML. You could do all of this from a JSP, but why would you want to? A cron job can call java and execute a class. If, on the other hand, you are saying that you already have a JSP that generates the report to a browser, and you want to sent that output to someone as an email message, that's different. John -Original Message- From: Deepa Raja [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 09, 2003 8:30 AM To: [EMAIL PROTECTED] Subject: JSP source Hi I want to do some reporting that is to be called by a cron job. I do not want to use a reporting tool. Can use JSP * to talk to the database * fetch the relevant details * format the details as a report * fetch the HTML source of the generated report * and email it to intended recipients My doubt is is it possible to fetch the HTML source of a JSP? I know I could use java mail to email if I could manage to get the source. Please pour in your suggestions Thanks deepa -- 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: CORBA initialization error with Tomcat 4.1
Sounds like you have hit your CORBA implementation limit. See the CORBA documentation for more details. Andy -Original Message- From: Xu, David [mailto:[EMAIL PROTECTED]] Sent: 08 January 2003 17:49 To: '[EMAIL PROTECTED]' Subject: CORBA initialization error with Tomcat 4.1 Importance: High Hi, there, I use a Bea Tuxedo CORBA client and the CORBA client object within a servlet has been working fine with Tomcat 3. Now with Tomcat 4.1.18, the servelet start up with errors: Exception err=org.omg.CORBA.IMP_LIMIT: vmcid: 0x0 minor code: 0 completed: No Has anyone has a clue? or doing the same? Regards, David -- 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: configuring two servlets into my application
Try this: servlet servlet-nameHelloWorld/servlet-name servlet-classHelloWorld/servlet-class /servlet servlet servlet-nameHolasAlMundo/servlet-name servlet-classHolasAlMundo/servlet-class /servlet servlet-mapping servlet-nameHelloWorld/servlet-name url-pattern/HelloWorld/url-pattern /servlet-mapping servlet-mapping servlet-nameHolasAlMundo/servlet-name url-pattern/HolasAlMundo/url-pattern /servlet-mapping Regards, Andy -Original Message- From: Dionisio Ruiz de Zarate [mailto:[EMAIL PROTECTED]] Sent: 07 January 2003 12:31 To: [EMAIL PROTECTED] Subject: configuring two servlets into my application i am tryin of configuring two test servlets in mytomcat application but when i try to declare them into the web.xml appears error: This file is not valid. unexpected child element 'servlet' the configuration is: servlet servlet-nameHelloWorld/servlet-name servlet-classHelloWorld/servlet-class /servlet servlet-mapping servlet-nameHelloWorld/servlet-name url-patternHelloWorld/url-pattern /servlet-mapping servlet servlet-nameHolasAlMundo/servlet-name servlet-classHolasAlMundo/servlet-class /servlet servlet-mapping servlet-nameHolasAlMundo/servlet-name url-patternHolasAlMundo/url-pattern /servlet-mapping -- 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: Mapping an external folder!
Try the following in your web.xml: web-app servlet servlet-nameMemberAuth/servlet-name servlet-classMemberAuth/servlet-class /servlet servlet servlet-nameMemberAuth2/servlet-name servlet-classMemberAuth2/servlet-class /servlet servlet-mapping servlet-nameMemberAuth/servlet-name url-pattern/login1/url-pattern /servlet-mapping servlet-mapping servlet-nameMemberAuth2/servlet-name url-pattern/login2/url-pattern /servlet-mapping /web-app http://localhost:8080/myAps/login1 will run your MemberAuth servlet class http://localhost:8080/myAps/login2 will run your MemberAuth2 servlet class hth Andy -Original Message- From: kim teri [mailto:[EMAIL PROTECTED]] Sent: 06 January 2003 12:05 To: [EMAIL PROTECTED] Subject: Mapping an external folder! Hi all, Am want to be running my servlets from C:\myAps and below is how i've configured Server.xml and web.xml in C:\myAps\WEB-INF\web.xml. Problem: I cannot add more servlet mappings to the web.xml. I have to delete one to test the other! How can i add/map all my servlets e.g http://localhost:8080/myAps/servletname1...servletname2.. without removing MemberAuth for me to run MemberAuth2?? Server.xml Context path=\myAps docBase=C:\myAps debug=0 reloadable=true / Here is the setup in the etc/web.xml file !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.2//EN http://java.sun.com/j2ee/dtds/web-app_2_2.dtd; web-app servlet servlet-nameMemberAuth/servlet-name servlet-classMemberAuth/servlet-class /servlet servlet-mapping servlet-nameMemberAuth/servlet-name url-pattern/login2/url-pattern /servlet-mapping /web-app Thanx __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.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]
RE: java.lang.OutOfMemoryError
There is a memory leak in the Sun javac compiler which could be the cause of this problem. You could use the jikes compiler to get around this problem. Andy -Original Message- From: Laxmikanth M.S. [mailto:[EMAIL PROTECTED]] Sent: 04 January 2003 12:21 To: Tomcat Users List Subject: java.lang.OutOfMemoryError Hi all, sometimes I get java.lang.OutOfMemoryError Error in my JSP page ..what is the reason for this... can anyone help.. thanks in advance Regards Laxmikanth M S Off : 91-80-6610330 extn 1256 http://www.sonata-software.com * Disclaimer: The information in this e-mail and any attachments is confidential / privileged. It is intended solely for the addressee or addressees. If you are not the addressee indicated in this message, you may not copy or deliver this message to anyone. In such case, you should destroy this message and kindly notify the sender by reply email. Please advise immediately if you or your employer does not consent to Internet email for messages of this kind. * -- 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: Simultaneous request from same IP
You have a global servlet variable 'trafficCop'. If two requests come in at the same time, they will be sharing this variable. The code is not thread safe. Move your trafficCop instance variable - make it a local variable of the doGet method, and invoke the constructor inside the doGet method. This should solve your problem. Andy -Original Message- From: Chris Bick [mailto:[EMAIL PROTECTED]] Sent: 16 December 2002 17:36 To: Tomcat Users List Subject: RE: Simultaneous request from same IP No offense taken. I still can't believe that this problem may exist. If you can find a problem with my code, that would be much easy then getting a fix into tomcat. Thanks, -cb import javax.servlet.*; import javax.servlet.http.*; import java.io.*; import java.util.*; import java.net.*; /** * pTitle: /p * pDescription: /p * pCopyright: Copyright (c) 2002/p * pCompany: /p * @author not attributable * @version 1.0 */ public class TrafficCopServlet extends HttpServlet { private static final String CONTENT_TYPE_XML = text/xml; private static final String CONTENT_TYPE_HTML = text/html; /**@todo set DTD*/ private static final String DOC_TYPE = null; //Initialize global variables private TrafficCop trafficCop; public void init() throws ServletException { trafficCop = new TrafficCop(false); } //Process the HTTP Get request public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { PrintWriter out = response.getWriter(); try { if (request.getRequestURI().endsWith(/insert)) { response.setContentType(CONTENT_TYPE_XML); out.println(?xml version=\1.0\?); String pcpVersion = request.getHeader(PCP-Client-Version); String clientId = request.getHeader(PCP-Client-ID); String listenIP = request.getHeader(Listen-IP); String behindFirewall = request.getHeader(Behind-Firewall); String urn = request.getQueryString(); synchronized(System.out) { System.out.println(URN: + request.getQueryString()); System.out.println(request.getHeader(Listen-IP)); } //System.out.println(Listen-IP: + listenIP); if (pcpVersion == null || clientId == null || listenIP == null || behindFirewall == null || urn == null) { String error = errorBad Headers/error; out.println(error); return; } String xml = trafficCop.add(urn,new URL(null,pcp://+listenIP,new Handler()), new Boolean(behindFirewall).booleanValue(), 0); System.out.println(xml); out.println(xml); } else if (request.getRequestURI().endsWith(/delete)) { response.setContentType(CONTENT_TYPE_XML); out.println(?xml version=\1.0\?); String clientId = request.getHeader(PCP-Client-ID); String sessionId = request.getHeader(My-Session-ID); String deleteSessionId = request.getHeader(Delete-Session-ID); String listenIP = request.getHeader(Listen-IP); String behindFirewall = request.getHeader(Behind-Firewall); String completed = request.getHeader(Completed); String elapsedTime = request.getHeader(Elapsed-Time); String avgDownstream = request.getHeader(Average-Downstream); String urn = request.getQueryString(); if (clientId == null || sessionId == null || deleteSessionId == null || listenIP == null || behindFirewall == null) { String error = errorBad Headers/error; out.println(error); return; } String xml = trafficCop.remove(urn, deleteSessionId, sessionId,new URL(null,pcp://+listenIP, new Handler()), new Boolean(behindFirewall).booleanValue(),0,0); System.out.println(xml); out.println(xml); } else if (request.getRequestURI().endsWith(/update)) { response.setContentType(CONTENT_TYPE_XML); out.println(?xml version=\1.0\?); String clientId = request.getHeader(PCP-Client-ID); String sessionId = request.getHeader(My-Session-ID); String listenIP = request.getHeader(Listen-IP); String behindFirewall = request.getHeader(Behind-Firewall); String urn = request.getQueryString(); if (clientId == null || sessionId == null || listenIP == null || behindFirewall == null) { String error = errorBad Headers/error; out.println(error); return; } String xml = trafficCop.connectionUpdate(urn, sessionId,new URL(null,pcp://+listenIP,new Handler()), new Boolean(behindFirewall).booleanValue(),0,0); System.out.println(xml); out.println(xml); } } catch (Exception e) { out.println(error+e.getMessage()+/error);
RE: Creating a signed SSL certificate with my own CA
You can turn SSL debugging by setting the following environment variable CATALINA_OPTS=-Djavax.net.debug=ALL Then, restart tomcat. You will then see much more info in the log. This might help you to debug your problem. Andy. -Original Message- From: Donie Kelly To: 'Tomcat Users List' Sent: 12/12/2002 14:11 Subject: RE: Creating a signed SSL certificate with my own CA Just to clarify, when I try to connect via SSL the SSL Handshake fails. Donie -Original Message- From: Donie Kelly [mailto:[EMAIL PROTECTED]] Sent: 12 December 2002 12:08 To: 'Tomcat Users List' Subject: Creating a signed SSL certificate with my own CA Hi all I'm really stuck here and I'd appreciate some help. To summarise, I've followed the instructions below to generate a CA key so that I can sign my own certificates for use with tomcat. The instructions below work and the ca.crt and client.crs.der certs that pop out are viewable in IE. If I import the CA key it shows the client.crs.der key with the CA above. Everything looks great. Then I use the testkeys with tomcat Connector className=org.apache.catalina.connector.http.HttpConnector address=192.168.1.4 port=443 enableLookups=true scheme=https secure=true Factory className=org.apache.catalina.net.SSLServerSocketFactory clientAuth=false protocol=TLS keystoreFile=c:\tomcat4.0\conf\testkeys keystorePass=changeit / /Connector Now when I try to connect with SLL from IE it just shows Cannot find server or DNS Error What am I doing wrong? Are the certs I am creating suitable for SLL with Tomcat. I'd really appreciate some help. Donie PS: Instructions from http://www.ddj.com/documents/s=870/ddj0102a/0102a.htm Certificate Authority In a nutshell, what I'm suggesting is that you create your own Certificate Authority (CA) to sign your keys. This gets complicated because nothing in the Java Development Kit or JSSE lets you set up a CA and sign keys. You have to go elsewhere for tools to do this. I chose to go with the OpenSSL toolkit (http://www.openssl.org/) running on Linux. There are toolsets available from other vendors and platforms, however. If you choose to use a different toolset, you will just have to substitute the appropriate commands; the theory is the same no matter what. First, you need to generate your CA's key. That key is used to sign all the other application keys. The OpenSSL toolkit comes configured to setup a CA from whatever directory you start it in. This means that you need to use all the CA commands from the same directory. In the sample code, you'll find the CA directory that I used to generate the CA key and sign all the application keys: 1.Generate the CA key $ openssl genrsa -rand -des -out ca.key 1024 2.Create a self signed certificate $ openssl req -new -x509 -days 365 -key ca.key -out ca.crt You are prompted for location information for the certificate. Enter whatever you want, but make sure you enter something for each field: 3.Setup the OpenSSL CA tools $ mkdir demoCA $ mkdir demoCA/newcerts $ touch demoCA/index.txt $ cp ca.crt demoCA/ $ echo 01 demoCA/serial You now can create the client application's key store and export its public key so your CA can sign it. You can enter whatever you want for all the location information, but again make sure you enter something - standard alphanumeric characters and spaces, but no underscores or other special characters - for every field: 4.Create a new key store for the client application $ keytool -keystore testkeys -genkey - alias client When prompted, enter passphrase for the password to use this keystore with the sample applications. 5.Export the client's public key $ keytool -keystore testkeys -certreq -alias client -file client.crs 6.Sign the client's key with our CA key $ openssl ca -config /etc/openssl.cnf -in client.crs -out client.crs.pem -keyfile ca.key -cert ca.crt At this point, you should have a file called client.crs.pem, which is the signed public key. It needs to be converted to a format suitable for the JDK's keytool command, and then imported into the testkeys keystore: 7.Convert to DER format $ openssl x509 -in client.crs.pem -out client.crs.der -outform DER 8.Import CA certificate into client's key store $ keytool -keystore testkeys -alias jsse_article_ca -import -file ca.crt 9.Import signed key into client's key store $ keytool -keystore testkeys -alias client -import -file client.crs.der Step 8 must be completed so that the keytool command agrees to import the signed key. While importing the signed key, keytool checks the signatories to ensure that their signatures can be validated. They can be validated if their public keys are in the key store. Once you have completed all of these steps, move the testkeys key store to the client directory. Start over with step 4 and create a key store for the server process. Just substitute server everywhere you see client. Make sure you enter something different in one of the location fields
RE: [OT] RE: Creating a signed SSL certificate with my own CA
Strange. I was expecting to see an error in this log. The server has definitely sent the certificate chain, so the client and server are communicating. At the end, it says SSL v3.0 Handshake, so check that you have got your Use SSL 3.0 option checked in your Internet Options (Advanced tab). A long shot, I know. If this is the end of the log, it looks like the server is waiting for more information from the client. This may be the point where IE is supposed to bring up a dialog asking you if you accept the certificate, or a dialog asking you for the client certificate to send to the server. I'm not sure. Andy -Original Message- From: Donie Kelly To: 'Bodycombe, Andrew'; Donie Kelly; ''Tomcat Users List' ' Sent: 12/12/2002 16:14 Subject: [OT] RE: Creating a signed SSL certificate with my own CA Here's a trace of the SSL using CATALINA_OPTS=-Djavax.net.debug=ALL It's large so I'd appreciate if somebody who can understand this stuff could point me in some direction. Thanks Donie Apache Tomcat/4.0.4 12 Dec 16:04:24 [RELAYSTARTUP] [INFO Alarms.144] BACKGOUND_THREADS alarm has been switched OFF 12 Dec 16:04:24 [LDAP Operator-MESSAGE-STORE] [INFO Alarms.144] MESSAGE_STORE alarm has been switched OFF 12 Dec 16:04:25 [LDAP Operator-LDAP-CACHE] [INFO Alarms.144] LDAP_CACHES alarm has been switched OFF Finalizer, SEND SSL v3.1 ALERT: warning, description = close_notify Finalizer, WRITE: SSL v3.1 Alert, length = 2 [read] MD5 and SHA1 hashes: len = 3 : 01 03 00 ... [read] MD5 and SHA1 hashes: len = 73 : 00 33 00 00 00 10 00 00 04 00 00 05 00 00 0A 01 .3.. 0010: 00 80 07 00 C0 03 00 80 00 00 09 06 00 40 00 00 .@.. 0020: 64 00 00 62 00 00 03 00 00 06 02 00 80 04 00 80 d..b 0030: 00 00 13 00 00 12 00 00 63 78 91 B2 8F 94 4C 65 cxLe 0040: EE F2 AD 21 F5 18 D7 A5 BB ...!. HttpProcessor[443][4], READ: SSL v2, contentType = 22, translated length = 65 *** ClientHello, v3.0 RandomCookie: GMT: 0 bytes = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 120, 145, 178, 143, 148, 76, 101, 238, 242, 173, 33, 245, 24, 215, 165, 187 } Session ID: {} Cipher Suites: { 0, 4, 0, 5, 0, 10, 0, 9, 0, 100, 0, 98, 0, 3, 0, 6, 0, 19, 0, 18, 0, 99 } Compression Methods: { 0 } *** %% Created: [Session-1, SSL_NULL_WITH_NULL_NULL] matching server alias : client *** ServerHello, v3.0 RandomCookie: GMT: 1022866086 bytes = { 75, 187, 79, 84, 25, 0, 159, 141, 94, 87, 237, 18, 177, 217, 24, 51, 123, 66, 77, 118, 51, 41, 57, 155, 56, 165, 203, 208 } Session ID: {61, 248, 179, 166, 219, 88, 242, 12, 148, 68, 61, 81, 220, 184, 52, 137, 146, 135, 207, 23, 128, 188, 14, 47, 246, 149, 54, 36, 82, 54, 255, 253} Cipher Suite: { 0, 19 } Compression Method: 0 *** Cipher suite: SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA *** Certificate chain chain [0] = [ [ Version: V3 Subject: CN=xenia.tecnomen.ie, OU=dad, O=tecnomen, ST=clare, C=IE Signature Algorithm: MD5withRSA, OID = 1.2.840.113549.1.1.4 Key: Sun DSA Public Key Parameters:DSA p: fd7f5381 1d751229 52df4a9c 2eece4e7 f611b752 3cef4400 c31e3f80 b6512669 455d4022 51fb593d 8d58fabf c5f5ba30 f6cb9b55 6cd7813b 801d346f f26660b7 6b9950a5 a49f9fe8 047b1022 c24fbba9 d7feb7c6 1bf83b57 e7c6a8a6 150f04fb 83f6d3c5 1ec30235 54135a16 9132f675 f3ae2b61 d72aeff2 2203199d d14801c7 q: 9760508f 15230bcc b292b982 a2eb840b f0581cf5 g: f7e1a085 d69b3dde cbbcab5c 36b857b9 7994afbb fa3aea82 f9574c0b 3d078267 5159578e bad4594f e6710710 8180b449 167123e8 4c281613 b7cf0932 8cc8a6e1 3c167a8b 547c8d28 e0a3ae1e 2bb3a675 916ea37f 0bfa2135 62f1fb62 7a01243b cca4f1be a8519089 a883dfe1 5ae59f06 928b665e 807b5525 64014c3b fecf492a y: 89fd70d7 22014032 6e0b42d6 50a1a02c 65ee48da c7497916 bd0c9042 e8f6cd36 54bd2e02 4a0af933 0b4135fe fae96972 a50bad43 920ec9ff f48ed90a 4f786f9b 89758fca a48330fa b55340ed b4d3edc2 ee8133ff ba083e46 6bee41cc f47620ee 14d2762a 9f271fd9 6ced97ba e48abe17 286430f1 8dc36dea 5342ca5f ff53abad Validity: [From: Thu Dec 12 12:20:39 GMT+00:00 2002, To: Fri Dec 12 12:20:39 GMT+00:00 2003] Issuer: CN=tecnomen ca, OU=dad, O=tecnomen, L=shannon, ST=clare, C=IE SerialNumber: [01] Certificate Extensions: 4 [1]: ObjectId: 2.16.840.1.113730.1.13 Criticality=false Extension unknown: DER encoded OCTET string = : 04 1F 16 1D 4F 70 65 6E 53 53 4C 20 47 65 6E 65 OpenSSL Gene 0010: 72 61 74 65 64 20 43 65 72 74 69 66 69 63 61 74 rated Certificat 0020: 65 e [2]: ObjectId: 2.5.29.14 Criticality=false SubjectKeyIdentifier [ KeyIdentifier [ : FC 88 B1 F0 C6 7F 17 E0 FC CD B2 14 99 B1 2A AA ..*. 0010: 8D 67 53 51.gSQ ] ] [3]: ObjectId: 2.5.29.35 Criticality=false AuthorityKeyIdentifier [ KeyIdentifier [ : D8 18 22 CF F1 9D DE E6 0E 83 D3 04 E7 96 09 2C
RE: Tomcat shared libraries
If there are libraries you require both inside and outside tomcat, you could consider placing them in /jre/lib/ext. They are then available to all java applications using the particular JRE instance, including tomcat. For pre 1.4 versions, I found this useful for things like JSSE and regular expressions. Andy. -Original Message- From: Dave Ford To: Tomcat Users List Cc: [EMAIL PROTECTED] Sent: 08/12/2002 20:38 Subject: Re: Tomcat shared libraries Now the problem is this: Tomcat doesn't use libraries from anywhere but within its scope. Rick, I was reading your discussion with Craig McClanahan and I agree with you - that a web app should be able to access classes outside the tomcat folder. Copying class into catalina/shared for each build is a pain (even with ant). Symlinks won't work on windows. Why couldn't tomcat add an entry into server.xml, to point to extra class location? Orion has had this for a few years now. * Mung around with the batch files and add the required directories to the classpath for Tomcat. How exactly did you do this? What batch file? Dave Ford Smart Soft - The Developer Training Company http://www.smart-soft.com - Original Message - From: Herrick, Rick [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, September 10, 2002 7:29 PM Subject: Tomcat shared libraries I'm currently in the process of developing a web application with Tomcat as the default reference platform. Although we'll support running with BEA, JRun, etc., our installer app will install and modify settings only if you're installing for Tomcat. I have to make a decision on how to proceed with our installer and really need to understand this problem. Now the problem is this: Tomcat doesn't use libraries from anywhere but within its scope. That is, it ignores the system classpath in its default configuration. I've read the class loader how-to (which isn't really a how-to, but whatever), and also worked with it for quite some time, so I understand pretty well how it works. Basically your classes and JARs need to be placed somewhere within the context of Tomcat: WEB-INF\classes, WEB-INF\lib, $CATALINA_HOME/common/classes, $CATALINA_HOME/common/endorsed/*.jar, $CATALINA_HOME/common/lib/*.jar, $CATALINA_HOME/shared/classes, and $CATALINA_HOME/shared/lib/*.jar. The problem is that this is a strictly web app-centric view of the world. In fact, many of the libraries that we need to use from within our web app are standard class libraries that other non-web applications need to use, such as our main server product, our non-web client applications, development tools, and so on. This leaves me three choices: * Replicate the libraries in two places, one for non-web apps and one for web apps (this solution, BTW, has to be cross-platform capable, so using links is out). This is less than desirable because of the maintenance problem with controlling versions. * Place the primary libraries within the Tomcat context and refer the other applications to that location. This doesn't work both for legacy and upgrade reasons (i.e. if you've already got a server installed, it expects to find its support libraries in a particular place and not have them moved over to another location) and because it's nonsensical for a non-web-based application to refer to an app server's repository. I do the third. This works just dandy: my required libraries remain in their central product-centric location, everyone can find what they need, and there's only one version of the libraries around (well, it's a development machine, so of course there's about 10 versions of every library around, but *I* know where they are :^). I browsed through the archives of this list and found the following quote: From http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg64144.html : How do I add an existing jar to a servlet's classpath, if that jar doesn't want to live under WEB-INF/lib? (I ultimately asked this here, and got a solid you can't response, so I'm satisfied. However, I've seen this asked here often, so it'd make a great FAQ submission.--Paul Brinkley My question is, why is this so? Why is it that you can't? Since I know you can in practice (by setting the CLASSPATH sometime after setclasspath.bat nukes the system classpath or by removing setclasspath.bat altogether), the prohibition seems arbitrary. Is there a security issue with Tomcat doing class loading outside of the Tomcat context? It seems to me that it's mainly due to a provincial view of a web app as a self-contained entity, but in reality most of the people I know writing web apps nowadays are running into *exactly* this sort of issue again and again. So to make our installer work, at this point I'm actually moving the existing setclasspath.bat file to some tmp name and creating a new one that sets the CLASSPATH to what we need. Is there any problem with this other than it's not
RE: Connection Pooling Help
I've not done it myself in tomcat, only in EJB containers, but as a starting point, I would suggest trying to get it to work by setting the connection pool as a global resource instead of a resource specific to your context. Then try and get your context-specific connection pool working. I too am surprised by the number of people facing this problem. Andy. -Original Message- From: Manavendra Gupta To: Tomcat Users List Sent: 09/12/2002 14:14 Subject: RE: Connection Pooling Help I am surprised with the number of ppl facing this problem, including myself. And it makes me wonder how others on this list have been able to use DataSource/Connection Pooling with tomcat. It seems to be one feature where majority of ppl have been facing problems, yet there is not much of information on this (including the JNDI HOW-TO). It would be interesting to hear from someone who had faced and subsequently resolved this problem. Manav. -Original Message- From: Hari Venkatesan [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 7:27 PM To: Tomcat Users List Subject: RE: Connection Pooling Help Try changing the following parameter value in server.xml file valuejdbc:as400://10.0.0.1/value valuejdbc:as400://{name of your machine} /value instead of the ip address of the as400 Hari -Original Message- From: Kevin Passey [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 8:40 AM To: 'Tomcat Users List' Subject: RE: Connection Pooling Help Eric, It's the same - DS == null. :-( Thanks anyway. Kevin -Original Message- From: Roberts, Eric [mailto:[EMAIL PROTECTED]] Sent: 09 December 2002 13:33 To: Tomcat Users List Subject: RE: Connection Pooling Help Kevin, Try: Context ctx = new InitialContext(); Context envCtx = (Context) ctx.lookup(java:/comp/env/); DataSource ds = (DataSource) envCtx.lookup(/jdbc/shiltonDB); -Original Message- From: Kevin Passey [mailto:[EMAIL PROTECTED]] Sent: Montag, 09. Dezember 2002 14:25 To: Tomcat Users List (E-mail) Subject: Connection Pooling Help Hi, Can somebody point out my mistake for me - I'm starting to bang my head.. I am trying to get connection pooling working on my AS/400 using the Commons-DBCP. I have placed this JAR in TOMCAT_HOME/common/lib along with the JT400.JAR I have added the context entries to my server.xml file - thus:- !-- AS400 Connection Pooling Test -- Context path=/shilton docBase=shilton debug=5 reloadable=true crossContext=true Resource name=jdbc/shiltonDB auth=Container type=javax.sql.DataSource / ResourceParams name=jdbc/shiltonDB parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter namemaxActive/name value100/value /parameter parameter namemaxIdle/name value3/value /parameter parameter namemaxWait/name value100/value /parameter parameter nameusername/name valueINTERNET/value /parameter parameter namepassword/name valueINTERNET/value /parameter parameter namedriverClassName/name valuecom.ibm.as400.access.AS400JDBCDriver/value /parameter parameter nameurl/name valuejdbc:as400://10.0.0.1/value /parameter /ResourceParams /Context I have added this to my WEB-INF web.xml file:- resource-ref description Resource reference to a factory for java.sql.Connection instances that may be used for talking to a particular database that is configured in the server.xml file. /description res-ref-name jdbc/shiltonDB /res-ref-name res-type javax.sql.DataSource /res-type res-auth Container /res-auth /resource-ref And I have this java program to test the connection import javax.naming.*; import javax.sql.*; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.ServletOutputStream; import java.sql.*; public class DBCPServlet extends HttpServlet { public void doGet(HttpServletRequest req, HttpServletResponse res) { try { ServletOutputStream out = res.getOutputStream(); out.println(htmlbody); out.println(h2Using Tomcat Connection Pooling with DBCP/h2);
RE: REPOST: SSL and setContentType() and secure and nonsecure it ems
In earlier versions of the servlet spec, you must call setContentType() before you call getOutputStream(). Although I thought this was changed in later versions, so maybe this is a red herring. Andy. -Original Message- From: Chris Parker To: Tomcat Users List Sent: 09/12/2002 16:01 Subject: REPOST: SSL and setContentType() and secure and nonsecure items Greetings all, Apologies in advance for the blatant repost; I originally posted Friday afternoon, and I'm not sure if I got lost in the 'it's Friday - let's go home' shuffle or if nobody knows how/wants to help. --Original Message--- No doubt there's a simple way around this, but I can't find it. I have some dynamic content that is being sent to the user's browser as PDF on an SSL enabled page. When the user goes to the page, she gets the message This page contains both secure and nonsecure items. I've traced the problem to this method call: response.setContentType(application/pdf); When I set the content type, I get the error message. When I don't set the content type, the user is prompted to download the file as an http download (which is obviously correct behavior). Is there another way to set the header? Do I need to encode the header into the ByteArrayOutputStream by hand? -- A somewhat truncated code snippet -- ByteArrayOutputStream baos = GoSomeplace.getPdfContent(); ServletOutputStream out = response.getOutputStream(); response.setContentLength( baos.size() ); response.setContentType(application/pdf); //Causes error message baos.writeTo( out ); out.flush(); -- 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 went unconcious :-)
This could be an issue with your browser. Maybe the page has been cached? Andy -Original Message- From: Vy Ho To: Tomcat Users List Sent: 06/12/2002 16:46 Subject: Tomcat went unconcious :-) When a dog sneeze and the cat got knocked down. The following case show that simple things could knock error out of tomcat (note that the cat does not die). Imagine authentication usin gmemory or database. 2 users 1 role for each. When you login with a valid user name/pass, but wrong role for the selected page, you won't see the invalid user/login, but you'll see access error. Now, go back (clicking on the back button), and then login as valid user/role, you'll see a gain, the same message, although you should be able to get into the page without any problem. That's 2 knockouts right there. How could something this obvious, and sensity, and common slip into the cat? -- 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 went unconcious :-)
I think this is a matter of interpretation. You have successfully logged, using a valid user name and password so you do not see the login failure page. You are then trying to access a resource to which you have no access so are presented with a 403 Forbidden page. Personally, I see no problem here, but others may disagree. Andy. -Original Message- From: Vy Ho To: Tomcat Users List Sent: 06/12/2002 17:59 Subject: RE: Tomcat went unconcious :-) I think it has something to do with both. When close the browser, and try again, it works on the later problem (logging in with valid users after an invalid login). However, the first problem, where logging in with an invalid role but valid user/pass still there. That is the web should not send the access forbidden, or illegal access, but show the loginerror page. (I forget to mention this is form type login). The cache problem maybe due to browser, but I think the news information does get submitted to the server. So the cache is not the username/password, but it's the session information. Again, if this is the case, then the server should use the username/password instead of the invalid session (Which I suspect they store in the basic authen scheme, or cookies). So, the server should be able to solve this problem too. This problem also show up using the built-in (versus formbase) popup basic authen. When you log into a webapp using valid user/pass/role. Then you change to another webapp on the server with a different users/pass/role, then you get error. This should be fixed by browsers (that is to detect that you went to a differernt directory now). For the server, it may be able to address this too, but I don't know much about it. On Fri, 6 Dec 2002, Bodycombe, Andrew wrote: This could be an issue with your browser. Maybe the page has been cached? Andy -Original Message- From: Vy Ho To: Tomcat Users List Sent: 06/12/2002 16:46 Subject: Tomcat went unconcious :-) When a dog sneeze and the cat got knocked down. The following case show that simple things could knock error out of tomcat (note that the cat does not die). Imagine authentication usin gmemory or database. 2 users 1 role for each. When you login with a valid user name/pass, but wrong role for the selected page, you won't see the invalid user/login, but you'll see access error. Now, go back (clicking on the back button), and then login as valid user/role, you'll see a gain, the same message, although you should be able to get into the page without any problem. That's 2 knockouts right there. How could something this obvious, and sensity, and common slip into the cat? -- 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]