RE: tomcat 4.1.24 and struts
What is your problem? Be specific. I have been using Tomcat 4.1.24 + struts 1.1rc1 without any trouble. -Original Message- From: Jason Bainbridge [mailto:[EMAIL PROTECTED] Sent: June 4, 2003 5:50 PM To: Tomcat Users List Subject: Re: tomcat 4.1.24 and struts On Wed, 5 Jun 2002 05:42, Jan Pekník wrote: Hello, I have some troubles using struts on TC4.1.24. (Template engine don't work). I use jdk1.4 and appropriate distribution of Tomcat. Anybody had some problems with struts and TC4.1 too? Thanx for any information. I'm using it without any problems in my application, I'd say any problems you are having would be related to the setup of struts and not Tomcat so I would suggest you report any errors to the struts mailing list as you are more likely to get help there for such errors. Regards, -- Jason Bainbridge http://jblinux.org - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Guide for mod_jk2 + Apache2 + Tomcat 4.1.24
Thanks! I will check it out this weekend. John On Thu, 05 Jun 2003 07:57:36 +0800, Chong Yu Meng [EMAIL PROTECTED] wrote: I've updated my write-up for Tomcat to include integration with Apache2 using mod_jk2. At present, I only cover channel sockets and UNIX sockets. I was not able to get JNI to work. You can view the whole document at : http://www.cymulacrum.net/tomcat/tomcat_toc.html or you can jump to the mod_jk2 configuration at : http://www.cymulacrum.net/tomcat/tomcat_mod_jk2.html Note that this is BETA documentation ! It has not been extensively tested and may NOT work ! Do NOT blame me if your system crashes, or you lose data, or if your business suffers from following my instructions. Use the document at your own risk ! I welcome feedback, and especially corrections or clarifications, but questions should be directed to the Tomcat list and not to me personally. Regards, pascal chong - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Limiting processors - WarpConnector
Hi, Iam using Apache 1.3.27, tomcat 4.0.3 , java version 1.4.0 and jakarta-tomcat-connectors-4.0.2-01 in my virtual hosting setup and iam trying to limit the no of java threads spawned by tomcat. The problem is somehow tomcat does'nt use the below settings cos I always see about 99 to 150 threads of java running even though there are no requests to a virtual host. Below is my connector settings.. Connector className = org.apache.catalina.connector.warp.WarpConnector port=20762 minProcessors=10 maxProcessors=25 enableLookups=true appBase=webapps acceptCount=10 debug=0/ What else do I need to do to limit the threads ?. Is it possible to do it ? Cheers TIA dushy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: security of server.xml
Well, if you put in code, then every time it changes you need to recompile your code, and redeploy your application. If you put it in server.xml, you don't ever have to do that. The security on server.xml is easy: chmod 700 TOMCAT_USER TOMCAT_USER = whatever user Tomcat runs as John On Thu, 5 Jun 2003 10:40:21 +0100 (BST), Mohamed Tagari [EMAIL PROTECTED] wrote: Hi, Is there any way of taking the password and username for connecting to a database out of the server.xml, and placing it in code before the lookup is done on this?? As having the username and password as plain text is not very secure.. // java code Context init = new InitialContext(); Context ctx = (Context) init.lookup(java:comp/env); DataSource ds = (DataSource) ctx.lookup(jdbc/myoracle); // extract from server.xml Resource name=jdbc/myoracle auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/myoracle . . . parameter nameusername/name valuescott/value /parameter parameter namepassword/name valuetiger/value /parameter . . /ResourceParams mo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: mail/Session problem please help
At 13:19 05/06/03 +0100, you wrote: Hi all I am trying to use mail/Session resource as a global resource and it is not working!! I got stuck. Please help my server.xml is like GlobalNamingResources ResourceParams name=mail/Session parameter namemail.smtp.host/name valuebabel.image-data.com/value /parameter /ResourceParams /GlobalNamingResources my host and context entry host ... / context / ... ResourceLink name=mail-Session global=mail/Session type=javax.mail.Session / /Context /Host and I am trying to access it from a jsp page with : Context initCtx = new InitialContext(); System.out.println(mail session is about to be ); Object test = initCtx.lookup(java:comp/env/mail-Session); System.out.println(test.getClass().getName()); javax.mail.Session mailsession = (javax.mail.Session) initCtx.lookup(java:comp/env/mail-Session); System.out.println(mail session is created +mailsession); but I am receiving the error message mail session is about to be javax.naming.NamingException: Cannot create resource instance at org.apache.naming.factory.ResourceFactory.getObjectInstance(Resourc Factory.java:189) at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java 301) at org.apache.naming.NamingContext.lookup(NamingContext.java:835) at org.apache.naming.NamingContext.lookup(NamingContext.java:181) at org.apache.naming.NamingContext.lookup(NamingContext.java:822) at org.apache.naming.NamingContext.lookup(NamingContext.java:194) at org.apache.naming.factory.ResourceLinkFactory.getObjectInstance(Res urceLinkFactory.java:143) at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java 301) at org.apache.naming.NamingContext.lookup(NamingContext.java:835) at org.apache.naming.NamingContext.lookup(NamingContext.java:181) at org.apache.naming.NamingContext.lookup(NamingContext.java:822) at org.apache.naming.NamingContext.lookup(NamingContext.java:181) at org.apache.naming.NamingContext.lookup(NamingContext.java:822) at org.apache.naming.NamingContext.lookup(NamingContext.java:194) at org.apache.naming.SelectorContext.lookup(SelectorContext.java:183) at javax.naming.InitialContext.lookup(InitialContext.java:347) at org.apache.jsp.MailPage_jsp._jspService(MailPage_jsp.java:56) 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(JspServletWrapp r.java:204) 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.ApplicationDispatcher.invoke(ApplicationDi patcher.java:684) at org.apache.catalina.core.ApplicationDispatcher.doForward(Applicatio Dispatcher.java:432) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationD spatcher.java:356) at actions.ActionRouter.route(ActionRouter.java:68) at ActionServlet.service(ActionServlet.java:132) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Ap licationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(Applicatio FilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrappe Valve.java:260) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveCont xt.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.j va:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:99 ) at org.apache.catalina.core.StandardContextValve.invoke(StandardContex Valve.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveCont xt.invokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.RequestFilterValve.process(RequestFilter alve.java:324) at org.apache.catalina.valves.RemoteAddrValve.invoke(RemoteAddrValve.j va:131) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveCont xt.invokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.j va:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:99 ) at org.apache.catalina.core.StandardContext.invoke(StandardContext.jav :2396) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve java:180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveCont
Re: mod_jk windows 2000 pro
Ok, that will never work with your existing configuration. These lines: VirtualHost localhost ServerName localhost in your mod_jk.conf file tell Apache that requests coming in for localhost get the JkMount directives shown a little farther down. There are no JkMounts for the bostondev URL. You will have to either use the Alias/Alias directive in Tomcat's server.xml to alias the bostondev URL to the already-defined localhost HOST container, or setup another HOST container in server.xml, and change the name parameter to the bostondev URL instead of localhost. Basically, for everything that says localhost in your mod_jk.conf file, you need the same configuration for BostonDev.ad.dstsystems.com...so two VirtualHost containers, total. John On Wed, 4 Jun 2003 17:14:27 -0400, [EMAIL PROTECTED] wrote: http://BostonDev.ad.dstsystems.com/examples also, because of the way our network is set up, http://bostondev can be used instead of http://BostonDev.ad.dstsystems.com when I access the PC using http://bostondev, I get our default index.html page from apache. when I access the PC using http://bostondev:8080 I get the default index.jsp from tomcat. John Turner [EMAIL PROTECTED]To: Tomcat Users List tomcat- [EMAIL PROTECTED] turner.com cc: Subject: Re: mod_jk windows 2000 pro 06/04/2003 04:57 PM Please respond to Tomcat Users List OK, what URL are you trying to access? http://localhost/examples, or http://BostonDev.ad.dstsystems.com/examples? John On Wed, 4 Jun 2003 16:26:26 -0400, [EMAIL PROTECTED] wrote: Hi John, I have the server name set as ServerName BostonDev.ad.dstsystems.com:80. As far as I can tell I have no virtual hosts defined in httpd.conf. jim === begin httpd.conf # # Based upon the NCSA server configuration files originally by Rob McCool. # # This is the main Apache server configuration file. It contains the # configuration directives that give the server its instructions. # See URL:http://httpd.apache.org/docs-2.0/ for detailed information about # the directives. # # Do NOT simply read the instructions in here without understanding # what they do. They're here only as hints or reminders. If you are unsure # consult the online docs. You have been warned. # # The configuration directives are grouped into three basic sections: # 1. Directives that control the operation of the Apache server process as a # whole (the 'global environment'). # 2. Directives that define the parameters of the 'main' or 'default' server, # which responds to requests that aren't handled by a virtual host. # These directives also provide default values for the settings # of all virtual hosts. # 3. Settings for virtual hosts, which allow Web requests to be sent to # different IP addresses or hostnames and have them handled by the # same Apache server process. # # Configuration and logfile names: If the filenames you specify for many # of the server's control files begin with / (or drive:/ for Win32), the # server will use that explicit path. If the filenames do *not* begin # with /, the value of ServerRoot is prepended -- so logs/foo.log # with ServerRoot set to C:/Program Files/Apache Group/Apache2 will be interpreted by the # server as C:/Program Files/Apache Group/Apache2/logs/foo.log. # # NOTE: Where filenames are specified, you must use forward slashes # instead of backslashes (e.g., c:/apache instead of c:\apache). # If a drive letter is omitted, the drive on which Apache.exe is located # will be used by default. It is recommended that you always supply # an explicit drive letter in absolute paths, however, to avoid # confusion. # ### Section 1: Global Environment # # The directives in this section affect the overall operation of Apache, # such as the number of concurrent requests it can handle or where it # can find its configuration files. # # # ServerRoot: The top of the directory tree under which the server's # configuration, error, and log files are kept. # # NOTE! If you intend to place this on an NFS (or otherwise network) # mounted filesystem then please read the LockFile documentation (available # at URL:http://httpd.apache.org/docs- 2.0/mod/mpm_common.html#lockfile) ; # you will save yourself a lot of trouble. # # Do NOT add a slash at the end of the directory path. # ServerRoot C:/Program Files/Apache Group/Apache2 # # ScoreBoardFile: File used to store internal server process information. # If unspecified (the default), the scoreboard will be stored in an # anonymous shared memory segment, and will be unavailable to third- party # applications.
RE: Guide for mod_jk2 + Apache2 + Tomcat 4.1.24
I found apache wiki's using jk2 connector is quite helpful for setting up jk2 (http://nagoya.apache.org/wiki/apachewiki.cgi?Tomcat/Jk2Connector) and http://nagoya.apache.org/wiki/apachewiki.cgi?TomcatFAQ/ModJK2OnRedHat makes me realize that it is not necessary building coyote etc before building jk2 (as I used to follow that jboss+tomcat+jk2 guide). -Original Message- From: John Turner [mailto:[EMAIL PROTECTED] Sent: June 5, 2003 9:13 AM To: Tomcat Users List Subject: Re: Guide for mod_jk2 + Apache2 + Tomcat 4.1.24 Thanks! I will check it out this weekend. John On Thu, 05 Jun 2003 07:57:36 +0800, Chong Yu Meng [EMAIL PROTECTED] wrote: I've updated my write-up for Tomcat to include integration with Apache2 using mod_jk2. At present, I only cover channel sockets and UNIX sockets. I was not able to get JNI to work. You can view the whole document at : http://www.cymulacrum.net/tomcat/tomcat_toc.html or you can jump to the mod_jk2 configuration at : http://www.cymulacrum.net/tomcat/tomcat_mod_jk2.html Note that this is BETA documentation ! It has not been extensively tested and may NOT work ! Do NOT blame me if your system crashes, or you lose data, or if your business suffers from following my instructions. Use the document at your own risk ! I welcome feedback, and especially corrections or clarifications, but questions should be directed to the Tomcat list and not to me personally. Regards, pascal chong - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 4.1 HTTP headers?
Thanks! Good info, but the interesting thing is that they claim this has been fixed, when clearly it has not (as of 4.1.24). Does the bug need to be re-submitted? Jim [EMAIL PROTECTED] 6/4/2003 9:40:13 PM This is a known issue. See http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14292 for more details. Jim Michael [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I recently switched from Tomcat 4.0.3 to 4.1.24, and now I'm seeing something unexpected: When Tomcat 4.1.24 returns valid content, the HTTP header looks like HTTP/1.1 200 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
getResourceAsStream cached by Tomcat's Classloader?
I saw a question similar to this asked in the Archives early in 2002. I didn't see a response to it. So, I hope there is an answer. I have a generic config file that is an xml file. We'll call it my-config.xml. When I load my-config.xml using Classloader.getResourceAsStream(my-config.xml) everything works great. However, when I make a change to that file and again call Classloader.getResourceAsStream(my-config.xml) the changes are not picked up and the same initial resource is returned. How do I get the Classloader to reconginze the resource changes? I'm using Tomcat 4.1.18. Brandon Goodin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: getResourceAsStream cached by Tomcat's Classloader?
did you close the original stream before making changes and reloading? - Original Message - From: Brandon Goodin [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, June 05, 2003 3:45 PM Subject: getResourceAsStream cached by Tomcat's Classloader? I saw a question similar to this asked in the Archives early in 2002. I didn't see a response to it. So, I hope there is an answer. I have a generic config file that is an xml file. We'll call it my-config.xml. When I load my-config.xml using Classloader.getResourceAsStream(my-config.xml) everything works great. However, when I make a change to that file and again call Classloader.getResourceAsStream(my-config.xml) the changes are not picked up and the same initial resource is returned. How do I get the Classloader to reconginze the resource changes? I'm using Tomcat 4.1.18. Brandon Goodin - 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: mod_jk windows 2000 pro
Also, http://bostondev:8080 works because in the default server.xml, localhost is set as the defaultHost. Even though you have Apache's global ServerName set to the bostondev URL, there are no corresponding JkMount statements, so Apache will never send any requests to Tomcat for bostondev. HTH John On Wed, 4 Jun 2003 17:14:27 -0400, [EMAIL PROTECTED] wrote: http://BostonDev.ad.dstsystems.com/examples also, because of the way our network is set up, http://bostondev can be used instead of http://BostonDev.ad.dstsystems.com when I access the PC using http://bostondev, I get our default index.html page from apache. when I access the PC using http://bostondev:8080 I get the default index.jsp from tomcat. John Turner [EMAIL PROTECTED]To: Tomcat Users List tomcat- [EMAIL PROTECTED] turner.com cc: Subject: Re: mod_jk windows 2000 pro 06/04/2003 04:57 PM Please respond to Tomcat Users List OK, what URL are you trying to access? http://localhost/examples, or http://BostonDev.ad.dstsystems.com/examples? John On Wed, 4 Jun 2003 16:26:26 -0400, [EMAIL PROTECTED] wrote: Hi John, I have the server name set as ServerName BostonDev.ad.dstsystems.com:80. As far as I can tell I have no virtual hosts defined in httpd.conf. jim === begin httpd.conf # # Based upon the NCSA server configuration files originally by Rob McCool. # # This is the main Apache server configuration file. It contains the # configuration directives that give the server its instructions. # See URL:http://httpd.apache.org/docs-2.0/ for detailed information about # the directives. # # Do NOT simply read the instructions in here without understanding # what they do. They're here only as hints or reminders. If you are unsure # consult the online docs. You have been warned. # # The configuration directives are grouped into three basic sections: # 1. Directives that control the operation of the Apache server process as a # whole (the 'global environment'). # 2. Directives that define the parameters of the 'main' or 'default' server, # which responds to requests that aren't handled by a virtual host. # These directives also provide default values for the settings # of all virtual hosts. # 3. Settings for virtual hosts, which allow Web requests to be sent to # different IP addresses or hostnames and have them handled by the # same Apache server process. # # Configuration and logfile names: If the filenames you specify for many # of the server's control files begin with / (or drive:/ for Win32), the # server will use that explicit path. If the filenames do *not* begin # with /, the value of ServerRoot is prepended -- so logs/foo.log # with ServerRoot set to C:/Program Files/Apache Group/Apache2 will be interpreted by the # server as C:/Program Files/Apache Group/Apache2/logs/foo.log. # # NOTE: Where filenames are specified, you must use forward slashes # instead of backslashes (e.g., c:/apache instead of c:\apache). # If a drive letter is omitted, the drive on which Apache.exe is located # will be used by default. It is recommended that you always supply # an explicit drive letter in absolute paths, however, to avoid # confusion. # ### Section 1: Global Environment # # The directives in this section affect the overall operation of Apache, # such as the number of concurrent requests it can handle or where it # can find its configuration files. # # # ServerRoot: The top of the directory tree under which the server's # configuration, error, and log files are kept. # # NOTE! If you intend to place this on an NFS (or otherwise network) # mounted filesystem then please read the LockFile documentation (available # at URL:http://httpd.apache.org/docs- 2.0/mod/mpm_common.html#lockfile) ; # you will save yourself a lot of trouble. # # Do NOT add a slash at the end of the directory path. # ServerRoot C:/Program Files/Apache Group/Apache2 # # ScoreBoardFile: File used to store internal server process information. # If unspecified (the default), the scoreboard will be stored in an # anonymous shared memory segment, and will be unavailable to third- party # applications. # If specified, ensure that no two invocations of Apache share the same # scoreboard file. The scoreboard file MUST BE STORED ON A LOCAL DISK. # #ScoreBoardFile logs/apache_runtime_status # # PidFile: The file in which the server should record its process # identification number when it starts. # PidFile logs/httpd.pid # # Timeout: The number of seconds before receives and sends time out. # Timeout 300 # # KeepAlive: Whether or not to allow
Admin Tool
Hi I've noticed something funny about the Tomcat Admin tool. If you change details about users with the tool, it removes the roles entry for that user. Has anyone else experience this? Thanks Dom - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
JDBCRealm question
We are authenticating internal users for authorization of the Manager webapp. Currently this uses a JDBC Realm. The problem is that the user account for each of our four environments has a different password for security reasons. We have a custom object that can, given a schema name, look up the user id/password for the environment you are in and return a DB connection. Is there someway to configure a realm to call a custom class to get the DB connection? Each webapp is configured as it's own service. Per the docs, we have a manager webapp context for each host. Currently, all look like: Context docBase=../../server/webapps/manager path=/manager privileged=true Realm className=org.apache.catalina.realm.JDBCRealm digest=MD5 driverName=oracle.jdbc.driver.OracleDriver connectionURL=jdbc:oracle:thin:@server_name:1521:DEV01 connectionName=nunya connectionPassword=business userTable=schema.table userNameCol=user_id userCredCol=password userRoleTable=schema.table roleNameCol=role / Valve className=org.apache.catalina.valves.RemoteAddrValve allow=10.11.6.*,10.11.128.*,127.0.0.1/ /Context = Norris Shelton Software Engineer Sun Certified Java 1.1 Programmer Appriss, Inc. ICQ# 26487421 AIM NorrisEShelton YIM norrisshelton __ 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]
RE: getResourceAsStream cached by Tomcat's Classloader?
Yes, it is closed. Brandon Goodin -Original Message- From: Dominic Parry [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 7:44 AM To: Tomcat Users List Subject: Re: getResourceAsStream cached by Tomcat's Classloader? did you close the original stream before making changes and reloading? - Original Message - From: Brandon Goodin [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, June 05, 2003 3:45 PM Subject: getResourceAsStream cached by Tomcat's Classloader? I saw a question similar to this asked in the Archives early in 2002. I didn't see a response to it. So, I hope there is an answer. I have a generic config file that is an xml file. We'll call it my-config.xml. When I load my-config.xml using Classloader.getResourceAsStream(my-config.xml) everything works great. However, when I make a change to that file and again call Classloader.getResourceAsStream(my-config.xml) the changes are not picked up and the same initial resource is returned. How do I get the Classloader to reconginze the resource changes? I'm using Tomcat 4.1.18. Brandon Goodin - 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: getResourceAsStream cached by Tomcat's Classloader?
I had similar issues with getResourceAsStream which caused me to go another route. I now use: new File(getServletContext().getRealPath(modules.xml)) to read files in. I'm not sure what your needs are, but mine were satisfied by using my method. Hope this helps Dom - Original Message - From: Brandon Goodin [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Thursday, June 05, 2003 4:04 PM Subject: RE: getResourceAsStream cached by Tomcat's Classloader? Yes, it is closed. Brandon Goodin -Original Message- From: Dominic Parry [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 7:44 AM To: Tomcat Users List Subject: Re: getResourceAsStream cached by Tomcat's Classloader? did you close the original stream before making changes and reloading? - Original Message - From: Brandon Goodin [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, June 05, 2003 3:45 PM Subject: getResourceAsStream cached by Tomcat's Classloader? I saw a question similar to this asked in the Archives early in 2002. I didn't see a response to it. So, I hope there is an answer. I have a generic config file that is an xml file. We'll call it my-config.xml. When I load my-config.xml using Classloader.getResourceAsStream(my-config.xml) everything works great. However, when I make a change to that file and again call Classloader.getResourceAsStream(my-config.xml) the changes are not picked up and the same initial resource is returned. How do I get the Classloader to reconginze the resource changes? I'm using Tomcat 4.1.18. Brandon Goodin - 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: getResourceAsStream cached by Tomcat's Classloader?
Thanks Dominic. Unfortuately, this is not being called from within a servlet. Brandon Goodin -Original Message- From: Dominic Parry [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 8:05 AM To: Tomcat Users List Subject: Re: getResourceAsStream cached by Tomcat's Classloader? I had similar issues with getResourceAsStream which caused me to go another route. I now use: new File(getServletContext().getRealPath(modules.xml)) to read files in. I'm not sure what your needs are, but mine were satisfied by using my method. Hope this helps Dom - Original Message - From: Brandon Goodin [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Thursday, June 05, 2003 4:04 PM Subject: RE: getResourceAsStream cached by Tomcat's Classloader? Yes, it is closed. Brandon Goodin -Original Message- From: Dominic Parry [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 7:44 AM To: Tomcat Users List Subject: Re: getResourceAsStream cached by Tomcat's Classloader? did you close the original stream before making changes and reloading? - Original Message - From: Brandon Goodin [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, June 05, 2003 3:45 PM Subject: getResourceAsStream cached by Tomcat's Classloader? I saw a question similar to this asked in the Archives early in 2002. I didn't see a response to it. So, I hope there is an answer. I have a generic config file that is an xml file. We'll call it my-config.xml. When I load my-config.xml using Classloader.getResourceAsStream(my-config.xml) everything works great. However, when I make a change to that file and again call Classloader.getResourceAsStream(my-config.xml) the changes are not picked up and the same initial resource is returned. How do I get the Classloader to reconginze the resource changes? I'm using Tomcat 4.1.18. Brandon Goodin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Request parameters are all 'null' after using NTLM login-code
Hello, I've been working on an Intranet site in JSP, and one of the requirements was an NTLM-login based authorisation. NTLM is a closed Microsoft protocol that sends the username and domain from Internet Explorer tot a Microsoft webserver. We've been able to implement this in JSP using information about the protocol found on the Internet. The NTLM-authentication works fine, however, there is a very strange side-effect: after the NTLM-login sequence has completed, Tomcat seems to be unable to work with request-parameters anymore. All request-parameters, for example sent using forms or encoded in the URL using '?' end up being 'null' when I try to get them using request.getParameter. Even when I forward to another page and then again another (or redirect), still, those pages cannot read any request-parameters anymore. Very strange... The NTLM-code we use is included below. Maybe any of you can spot an error in it that causes this effect, or knows more about his mistake/bug? Tomcat version: latest stable release of Tomcat 4 Operating system: Redhat Linux 6.2 Thanx in advance for any imput you can provide! --Friso Geerlings -- *** Login_ntlm.jsp *** -- jsp:useBean id=credentials scope=session class=primeline_intranet.IntranetCredentialsBean / % boolean ok = false; //user not logged in jet String auth = request.getHeader(Authorization); if (auth == null) { response.setContentLength(0); response.setStatus(response.SC_UNAUTHORIZED); response.setHeader(WWW-Authenticate, NTLM); response.flushBuffer(); return; } if (auth.startsWith(NTLM )) { byte[] msg = new sun.misc.BASE64Decoder().decodeBuffer(auth.substring(5)); int off = 0, length, offset; if (msg[8] == 1) { byte z = 0; byte[] msg1 = {(byte)'N', (byte)'T', (byte)'L', (byte)'M', (byte)'S', (byte)'S', (byte)'P', z,(byte)2, z, z, z, z, z, z, z,(byte)40, z, z, z, (byte)1, (byte)130, z, z,z, (byte)2, (byte)2, (byte)2, z, z, z, z, z, z, z, z, z, z, z, z}; response.setContentLength(0); response.setStatus(response.SC_UNAUTHORIZED); response.setHeader(WWW-Authenticate, NTLM + new sun.misc.BASE64Encoder().encodeBuffer(msg1).trim()); response.flushBuffer(); return; } else if (msg[8] == 3) { off = 30; length = msg[off+17]*256 + msg[off+16]; offset = msg[off+19]*256 + msg[off+18]; String remoteHost = new String(msg, offset, length); length = msg[off+1]*256 + msg[off]; offset = msg[off+3]*256 + msg[off+2]; String domain = new String(msg, offset, length); length = msg[off+9]*256 + msg[off+8]; offset = msg[off+11]*256 + msg[off+10]; String username = new String(msg, offset, length); ok = credentials.login(username); //this returns true if the username can be found in a database } } if (!ok) { String paginaParameter = login.jsp?message=autologin unsuccesfull; String rootPath = request.getScheme()+:// + request.getServerName() + : + request.getServerPort() + request.getContextPath() + /; response.sendRedirect(rootPath + paginaParameter); } else { //login is ok, so we're forwarding to the main page % jsp:forward page=index.jsp /jsp:forward % } %
Re: Request parameters are all 'null' after using NTLM login-code
NTLM is a bit of a nightmare to create custom code for, I recommend you either plug Tomcat into IIS and use IIS's authentication and then use request.getRemoteUser() to get the details or my preferred method is to use the filter available with JCIFS (http://jcifs.samba.org), just change a few things in your web.xml file, drop in the .jar file and everything will start working automagically. Regards, -- Jason Bainbridge http://jblinux.org On Thu, 5 Jun 2003 22:22, Friso Geerlings wrote: Hello, I've been working on an Intranet site in JSP, and one of the requirements was an NTLM-login based authorisation. NTLM is a closed Microsoft protocol that sends the username and domain from Internet Explorer tot a Microsoft webserver. We've been able to implement this in JSP using information about the protocol found on the Internet. The NTLM-authentication works fine, however, there is a very strange side-effect: after the NTLM-login sequence has completed, Tomcat seems to be unable to work with request-parameters anymore. All request-parameters, for example sent using forms or encoded in the URL using '?' end up being 'null' when I try to get them using request.getParameter. Even when I forward to another page and then again another (or redi-- Jason Bainbridge http://jblinux.orgrect), still, those pages cannot read any request-parameters anymore. Very strange... The NTLM-code we use is included below. Maybe any of you can spot an error in it that causes this effect, or knows more about his mistake/bug? Tomcat version: latest stable release of Tomcat 4 Operating system: Redhat Linux 6.2 Thanx in advance for any imput you can provide! --Friso Geerlings -- *** Login_ntlm.jsp *** -- jsp:useBean id=credentials scope=session class=primeline_intranet.IntranetCredentialsBean / % boolean ok = false; //user not logged in jet String auth = request.getHeader(Authorization); if (auth == null) { response.setContentLength(0); response.setStatus(response.SC_UNAUTHORIZED); response.setHeader(WWW-Authenticate, NTLM); response.flushBuffer(); return; } if (auth.startsWith(NTLM )) { byte[] msg = new sun.misc.BASE64Decoder().decodeBuffer(auth.substring(5)); int off = 0, length, offset; if (msg[8] == 1) { byte z = 0; byte[] msg1 = {(byte)'N', (byte)'T', (byte)'L', (byte)'M', (byte)'S', (byte)'S', (byte)'P', z,(byte)2, z, z, z, z, z, z, z,(byte)40, z, z, z, (byte)1, (byte)130, z, z,z, (byte)2, (byte)2, (byte)2, z, z, z, z, z, z, z, z, z, z, z, z}; response.setContentLength(0); response.setS-- Jason Bainbridge http://jblinux.orgtatus(response.SC_UNAUTHORIZED); response.setHeader(WWW-Authenticate, NTLM + new sun.misc.BASE64Encoder().encodeBuffer(msg1).trim()); response.flushBuffer(); return; } else if (msg[8] == 3) { off = 30; length = msg[off+17]*256 + msg[off+16]; offset = msg[off+19]*256 + msg[off+18]; String remoteHost = new String(msg, offset, length); length = msg[off+1]*256 + msg[off]; offset = msg[off+3]*256 + msg[off+2]; String domain = new String(msg, offset, length); length = msg[off+9]*256 + msg[off+8]; offset = msg[off+11]*256 + msg[off+10]; String username = new String(msg, offset, length); ok = credentials.login(username); //this returns true if the username can be found in a database } } if (!ok) { String paginaParameter = login.jsp?message=autologin unsuccesfull; String rootPath = request.getScheme()+:// + request.getServerName() + : + request.getServerPort() + request.getContextPath() + /; response.sendRedirect(rootPath + paginaParameter); } else { //login is ok, so we're forwarding to the main page % jsp:forward page=index.jsp /jsp:forward % } % - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
SSL client authentication with IE 6.0
I'm running Tomcat 4.1.24 standalone with SSL client authentication enabled.Internet Explorer 6.0 when I try to access the server pops up a window that ask me which certificate will be used for client authentication, but the list of certificates is empty! I've tested my browser on apache with mod_ssl and client authentication, and IE pops up the same window but in this case my personal certificate is present. This is the only tomcat connector configured on my PC. Connector className=org.apache.coyote.tomcat4.CoyoteConnector port=8080 minProcessors=15 maxProcessors=25 enableLookups=true acceptCount=100 debug=0 scheme=https secure=true useURIValidationHack=false disableUploadTimeout=true Factory className=org.apache.coyote.tomcat4.CoyoteServerSocketFactory clientAuth=true protocol=TLS keystoreFile=C:/.keystore keystorePass=xx/ /Connector Thanks for your help. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: mod_jk windows 2000 pro
I appreciate all your help, but I don't know xml so I can not change the server.xml file. I can't find any virtual host or anything. I'll just leave it the way it is. typing in :8080 isn't so bad. Thanks! Jim John Turner [EMAIL PROTECTED]To: Tomcat Users List [EMAIL PROTECTED] turner.com cc: Subject: Re: mod_jk windows 2000 pro 06/05/2003 09:31 AM Please respond to Tomcat Users List Ok, that will never work with your existing configuration. These lines: VirtualHost localhost ServerName localhost in your mod_jk.conf file tell Apache that requests coming in for localhost get the JkMount directives shown a little farther down. There are no JkMounts for the bostondev URL. You will have to either use the Alias/Alias directive in Tomcat's server.xml to alias the bostondev URL to the already-defined localhost HOST container, or setup another HOST container in server.xml, and change the name parameter to the bostondev URL instead of localhost. Basically, for everything that says localhost in your mod_jk.conf file, you need the same configuration for BostonDev.ad.dstsystems.com...so two VirtualHost containers, total. John On Wed, 4 Jun 2003 17:14:27 -0400, [EMAIL PROTECTED] wrote: http://BostonDev.ad.dstsystems.com/examples also, because of the way our network is set up, http://bostondev can be used instead of http://BostonDev.ad.dstsystems.com when I access the PC using http://bostondev, I get our default index.html page from apache. when I access the PC using http://bostondev:8080 I get the default index.jsp from tomcat. John Turner [EMAIL PROTECTED]To: Tomcat Users List tomcat- [EMAIL PROTECTED] turner.com cc: Subject: Re: mod_jk windows 2000 pro 06/04/2003 04:57 PM Please respond to Tomcat Users List OK, what URL are you trying to access? http://localhost/examples, or http://BostonDev.ad.dstsystems.com/examples? John On Wed, 4 Jun 2003 16:26:26 -0400, [EMAIL PROTECTED] wrote: Hi John, I have the server name set as ServerName BostonDev.ad.dstsystems.com:80. As far as I can tell I have no virtual hosts defined in httpd.conf. jim === begin httpd.conf # # Based upon the NCSA server configuration files originally by Rob McCool. # # This is the main Apache server configuration file. It contains the # configuration directives that give the server its instructions. # See URL:http://httpd.apache.org/docs-2.0/ for detailed information about # the directives. # # Do NOT simply read the instructions in here without understanding # what they do. They're here only as hints or reminders. If you are unsure # consult the online docs. You have been warned. # # The configuration directives are grouped into three basic sections: # 1. Directives that control the operation of the Apache server process as a # whole (the 'global environment'). # 2. Directives that define the parameters of the 'main' or 'default' server, # which responds to requests that aren't handled by a virtual host. # These directives also provide default values for the settings # of all virtual hosts. # 3. Settings for virtual hosts, which allow Web requests to be sent to # different IP addresses or hostnames and have them handled by the # same Apache server process. # # Configuration and logfile names: If the filenames you specify for many # of the server's control files begin with / (or drive:/ for Win32), the # server will use that explicit path. If the filenames do *not* begin # with /, the value of ServerRoot is prepended -- so logs/foo.log # with ServerRoot set to C:/Program Files/Apache Group/Apache2 will be
RE: getResourceAsStream cached by Tomcat's Classloader?
Hey Brandon, Are you using this code to get a classloader? Thread.currentThread().getContextClassLoader(); If not, you are not getting tomcat's you are getting the system one. Larry [EMAIL PROTECTED] 06/05/03 8:04 AM Yes, it is closed. Brandon Goodin -Original Message- From: Dominic Parry [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 7:44 AM To: Tomcat Users List Subject: Re: getResourceAsStream cached by Tomcat's Classloader? did you close the original stream before making changes and reloading? - Original Message - From: Brandon Goodin [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, June 05, 2003 3:45 PM Subject: getResourceAsStream cached by Tomcat's Classloader? I saw a question similar to this asked in the Archives early in 2002. I didn't see a response to it. So, I hope there is an answer. I have a generic config file that is an xml file. We'll call it my-config.xml. When I load my-config.xml using Classloader.getResourceAsStream(my-config.xml) everything works great. However, when I make a change to that file and again call Classloader.getResourceAsStream(my-config.xml) the changes are not picked up and the same initial resource is returned. How do I get the Classloader to reconginze the resource changes? I'm using Tomcat 4.1.18. Brandon Goodin - 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]
JSP character conversion problem
Hello, We've got a problem with Tomcat 4.1.24. Data is entered and stored in a MySQL database using a JSP/Struts based web application. This process works fine. The input is converted correctly to UTF-8 and to ISO-8859-1 when stored in MySQL. However, when the data is retrieved again (which also works fine) and then stored in the outgoing HTML, something in the character conversion breaks. Some characters which are in the ASCII character range are not displayed correctly (a '?' character is shown instead). We've traced this problem to the JSP - HTML conversion: the data we get back from MySQL is displayed correctly on stdout. Only when the JSP page is compiled and shown in a browser (mozilla, IE) do you see question mark characters in place of unicode characters (some characters which are not displayed correctly are: (z with an accent), (U with a trailing c)) We've tried everything that came up on google searches. Setting the characterEncoding on the servlet request. Setting the Locale of the HttpSession. Putting a page tag in the JSP specifically stating the charset=ISO-8859-1. Even starting Tomcat with the option file.encoding=iso8859-1. None of this works. Does anyone here know what the problem could be? Regards, Jeroen Zwartepoorte - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Resource Reference and server.xml
One of the main reasons of using resource ref's in code is because you get a level of indirection. I see that level of indirection in the J2EE ref impl from Sun, but I don't see that in Tomcat. How can you specify a datasource (let's say) in the web.xml as a res ref different than the one setup in the server.xml. Is this possible? Here's an example: WEB.XML: resource-ref id=mail1 descriptionThis is used to send email/description res-ref-namemail/bay4/res-ref-name res-typejavax.mail.Session/res-type res-authContainer/res-auth res-sharing-scopeShareable/res-sharing-scope /resource-ref SERVER.XML: Resource name=mail/bay4 auth=Container type=javax.mail.Session/ ResourceParams name=mail/bay4 parameter namemail.smtp.host/name valuesmtp.host.net/value /parameter /ResourceParams --- mail/bay4 has to match everywhere, right? Anyway, this all works just fine for me. But I would like to disconnect the reference I use IN CODE, from the resourceparam used in the server.xml. This way I can change the server.xml without affecting the deployed WAR file. You can do this with SUN's Ref impl for the J2EE. Jim Kennedy IT Consultant -
Tomcat JDBC problem
Hi all, I am having a problem making the MySQL JDBC driver version 3 work with Tomcat correctly. I had previously used MySQL JDBC driver version 1 and developed a couple of programs to access my MySQL database. The programs worked just fine with this version of the driver. When I went to upgrade to the newest version of the MySQL JDBC driver I get errors in my programs saying there is an error before the beginning of the result set. I am wondering if I am not installing the driver correctly. All I did for the JDBC driver version 1 was to place the jar file in CATALINA_HOME/common/lib I also made a CLASSPATH variable and referenced the package. Since this worked I thought the it should still work for the JDBC driver version 3. But for some reason it does not. Does anybody have any experience setting up JDBC driver 2 or 3 for MySQL that could give me a few tips on installation. Thanks in advance, Jason Lanpher [EMAIL PROTECTED] http://www.stealthnetworking.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Running Tomcat As Service Errors Location
Hello, If I run Tomcat as a service, do I have to change all the catch(Exception) ... to log the errors in a log file? I used to run Tomcat as Standalone and had System.err.println()s when an exception was caught. Thanks, Lior - Do you Yahoo!? Free online calendar with sync to Outlook(TM).
RE: Admin Tool
Howdy, Search the archives: this has been brought up before. Yoav Shapira Millennium ChemInformatics -Original Message- From: Dominic Parry [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 9:48 AM To: Tomcat Users List Subject: Admin Tool Hi I've noticed something funny about the Tomcat Admin tool. If you change details about users with the tool, it removes the roles entry for that user. Has anyone else experience this? Thanks Dom - 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]
RE: getResourceAsStream cached by Tomcat's Classloader?
Howdy, I had similar issues with getResourceAsStream which caused me to go another route. I now use: new File(getServletContext().getRealPath(modules.xml)) to read files in. Just remember if you deploy in a packed war file the above will NPE every time. 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]
RE: JSTL and EL question - SOLVED
The setup can be a little simpler than this. The taglib jar can contain the TLD for the taglib in the META-INF directory of the jar. If it is present there, you do not have to deploy the TLD separately. In addition, if the TLD is present there, you do not have to have the explicit taglib map in your web.xml file. In this case, your taglib directive in the JSP page needs to specify the URI that is specified in the TLD in the taglib jar file, which is hopefully documented in the taglib documentation (so you don't have to open the file in the jar file). If this is done correctly, you can skip steps 2 and 3 of this process. -Original Message- From: Nikola Milutinovic [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 04, 2003 10:21 PM To: Tomcat Users List Subject: Re: JSTL and EL question - SOLVED I thought I liked the idea of having the taglib in the web.xml file. When I try it I'm getting This absolute uri (http://java.sun.com/jstl/core) cannot be resolved in either web.xml or the jar files deployed with this application. Do I have to download it somewhere in order to use it in the web.xml file? Any ideas? :-) OK, four things when dealing with ANY tag library: 1. PLACE JAR FILES Place JAR files that hold implementation of the tag library in a directory where Tomcat will pick it up. Either make it WEB-INF/lib/ (private) or ${CATALINA_HOME}/shared/lib (all web-apps will have access to it). You could place it in ${CATALINA_HOME}/common/lib, but I don't see the point in Tomcat having access to those JARs. There was a discussion recently naming pros/cons of each choice (Craig), so look up the archives. 2. PLACE TLD Place TLD files (Tag Library Descriptor) in either WEB-INF/ or (if I recall correctly) WEB-INF/taglibs/. The first placement will require for location in web.xml file to be absolute: /WEB-INF/name.tld, while the second will allow for relative links: name.tld 3. DECLARE TLD IN WEB.XML This part you've already seen. taglib taglib-urihttp://java.sun.com/jstl/core/taglib-uri taglib-location/WEB-INF/c.tld/taglib-location /taglib 4. DECLARE TLD USAGE IN JSP This you've seen %@ taglib uri=http://java.sun.com/jstl/core; prefix=c % The prefix is up to you. Nix. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: getResourceAsStream cached by Tomcat's Classloader?
Howdy, When I load my-config.xml using Classloader.getResourceAsStream(my-config.xml) everything works great. However, when I make a change to that file and again call Classloader.getResourceAsStream(my-config.xml) the changes are not picked up and the same initial resource is returned. How do I get the Classloader to reconginze the resource changes? I'm using Tomcat 4.1.18. I haven't looked at that code for a while myself, but I wouldn't be surprised if that were cached. It'd be a performance win, especially for frequently accessed resources. I don't think the servlet specification mandates resource caching, nor mandates that it be configurable -- both of these are container implementation details. I would guess that if you restart your webapp, the resource cache would be reset. But that may not be what you want to do... 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]
RE: Startup error
Nobody can point me in the right direction? Would this be the right RPM to fix this? libstdc++-3.2.2-5.i386.rpm OR this? glibc-2.3.2-11.9.i686.rpm (this package supplies libc.so.6, that that what I need) I am lost here, every other install of tomcat that I have done was fine. I am thinking when I installed Netscape or Mozilla it installed the needed stuff, but I did't install them this time, and don't think I want to. I just want the right package... Hmm.. I found this one now. can someone confirm if this is what I need? Standard C++ libraries for Red Hat 7.3 backwards compatibility compiler RedHat-9 for i386 compat-libstdc++-7.3-2.96.118.i386.rpm Thanks for looking at my ramblings :) -Original Message- From: Luc Foisy Sent: Wednesday, June 04, 2003 9:03 AM To: Tomcat User List (E-mail) Subject: Startup error I am getting the following error in my catalina.out Error: failed /usr/java/j2sdk1.4.0_03/jre/lib/i386/client/libjvm.so, because libstdc++-libc6.1-1.so.2: cannot open shared object file: No such file or directory I am using RedHat 9.0 Which package do I need to install to get this to function? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat JDBC problem
are you using com.mysql.jdbc.Driver? -Original Message- From: Jason Lanpher [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 11:08 AM To: 'Tomcat Users List' Subject: Tomcat JDBC problem Hi all, I am having a problem making the MySQL JDBC driver version 3 work with Tomcat correctly. I had previously used MySQL JDBC driver version 1 and developed a couple of programs to access my MySQL database. The programs worked just fine with this version of the driver. When I went to upgrade to the newest version of the MySQL JDBC driver I get errors in my programs saying there is an error before the beginning of the result set. I am wondering if I am not installing the driver correctly. All I did for the JDBC driver version 1 was to place the jar file in CATALINA_HOME/common/lib I also made a CLASSPATH variable and referenced the package. Since this worked I thought the it should still work for the JDBC driver version 3. But for some reason it does not. Does anybody have any experience setting up JDBC driver 2 or 3 for MySQL that could give me a few tips on installation. Thanks in advance, Jason Lanpher [EMAIL PROTECTED] http://www.stealthnetworking.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]
upgrade from tomcat4.1.12 to 4.1.24
Hi all, I upgraded my tomcat installation from 4.1.12 to 4.1.24. Now I have the following problem when I run my webapp: java.lang.ClassNotFoundException: org.apache.catalina.servlets.CGIServlet Someone know why I have this error ? Which jar files contains this class ? thank you for your help Xavier - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: JSTL and EL question - SOLVED
Thats a great idea much easier to implement. How can I determine if the jar file has the tld? More specifically, I'm using the jakarta dbtags. do they package it that way? -Original Message- From: Karr, David [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 11:21 AM To: Tomcat Users List Subject: RE: JSTL and EL question - SOLVED The setup can be a little simpler than this. The taglib jar can contain the TLD for the taglib in the META-INF directory of the jar. If it is present there, you do not have to deploy the TLD separately. In addition, if the TLD is present there, you do not have to have the explicit taglib map in your web.xml file. In this case, your taglib directive in the JSP page needs to specify the URI that is specified in the TLD in the taglib jar file, which is hopefully documented in the taglib documentation (so you don't have to open the file in the jar file). If this is done correctly, you can skip steps 2 and 3 of this process. -Original Message- From: Nikola Milutinovic [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 04, 2003 10:21 PM To: Tomcat Users List Subject: Re: JSTL and EL question - SOLVED I thought I liked the idea of having the taglib in the web.xml file. When I try it I'm getting This absolute uri (http://java.sun.com/jstl/core) cannot be resolved in either web.xml or the jar files deployed with this application. Do I have to download it somewhere in order to use it in the web.xml file? Any ideas? :-) OK, four things when dealing with ANY tag library: 1. PLACE JAR FILES Place JAR files that hold implementation of the tag library in a directory where Tomcat will pick it up. Either make it WEB-INF/lib/ (private) or ${CATALINA_HOME}/shared/lib (all web-apps will have access to it). You could place it in ${CATALINA_HOME}/common/lib, but I don't see the point in Tomcat having access to those JARs. There was a discussion recently naming pros/cons of each choice (Craig), so look up the archives. 2. PLACE TLD Place TLD files (Tag Library Descriptor) in either WEB-INF/ or (if I recall correctly) WEB-INF/taglibs/. The first placement will require for location in web.xml file to be absolute: /WEB-INF/name.tld, while the second will allow for relative links: name.tld 3. DECLARE TLD IN WEB.XML This part you've already seen. taglib taglib-urihttp://java.sun.com/jstl/core/taglib-uri taglib-location/WEB-INF/c.tld/taglib-location /taglib 4. DECLARE TLD USAGE IN JSP This you've seen %@ taglib uri=http://java.sun.com/jstl/core; prefix=c % The prefix is up to you. Nix. - 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]
Help with registering a listener
Hello, Could some one please tell me how to register a listener with Tomcat 4? When I add: listener listener-classTnTSearchCleanUp/listener-class /listener within web-app element, tomcat throws 404 errors. Also, I did not find a listener element defined in http://java.sun.com/j2ee/dtds/web-app_2_2.dtd Thank you, Vijay - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: getResourceAsStream cached by Tomcat's Classloader?
I have tried it both ways. My notion is that it has to do with the fact that the getResourceAsStream is being called in a static method and the resulting InputStream, which is wrapped in an InputStreamReader, is passed into an object that is a static variable in my BaseDAO class. So, because the reference is at the Class level it might be holding onto it no matter what I do. If you want I can show you the code. I have some ideas. But, I'm not sure if they will work. Brandon Goodin -Original Message- From: Larry Meadors [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 8:58 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: getResourceAsStream cached by Tomcat's Classloader? Hey Brandon, Are you using this code to get a classloader? Thread.currentThread().getContextClassLoader(); If not, you are not getting tomcat's you are getting the system one. Larry [EMAIL PROTECTED] 06/05/03 8:04 AM Yes, it is closed. Brandon Goodin -Original Message- From: Dominic Parry [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 7:44 AM To: Tomcat Users List Subject: Re: getResourceAsStream cached by Tomcat's Classloader? did you close the original stream before making changes and reloading? - Original Message - From: Brandon Goodin [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, June 05, 2003 3:45 PM Subject: getResourceAsStream cached by Tomcat's Classloader? I saw a question similar to this asked in the Archives early in 2002. I didn't see a response to it. So, I hope there is an answer. I have a generic config file that is an xml file. We'll call it my-config.xml. When I load my-config.xml using Classloader.getResourceAsStream(my-config.xml) everything works great. However, when I make a change to that file and again call Classloader.getResourceAsStream(my-config.xml) the changes are not picked up and the same initial resource is returned. How do I get the Classloader to reconginze the resource changes? I'm using Tomcat 4.1.18. Brandon Goodin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat JDBC problem
Yes I am using com.mysql.jdbc.Driver Here is the rest of the version numbers of the system. RedHat 7.2 system MySQL 3.56 Java 1.4.1_02 JDBC/MySQL 3.08 Jason Lanpher [EMAIL PROTECTED] http://www.stealthnetworking.com Remember there are only 10 types of people in this world. Those who understand Binary and those who don't. -Original Message- From: Pitre, Russell [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 10:25 AM To: Tomcat Users List Subject: RE: Tomcat JDBC problem are you using com.mysql.jdbc.Driver? -Original Message- From: Jason Lanpher [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 11:08 AM To: 'Tomcat Users List' Subject: Tomcat JDBC problem Hi all, I am having a problem making the MySQL JDBC driver version 3 work with Tomcat correctly. I had previously used MySQL JDBC driver version 1 and developed a couple of programs to access my MySQL database. The programs worked just fine with this version of the driver. When I went to upgrade to the newest version of the MySQL JDBC driver I get errors in my programs saying there is an error before the beginning of the result set. I am wondering if I am not installing the driver correctly. All I did for the JDBC driver version 1 was to place the jar file in CATALINA_HOME/common/lib I also made a CLASSPATH variable and referenced the package. Since this worked I thought the it should still work for the JDBC driver version 3. But for some reason it does not. Does anybody have any experience setting up JDBC driver 2 or 3 for MySQL that could give me a few tips on installation. Thanks in advance, Jason Lanpher [EMAIL PROTECTED] http://www.stealthnetworking.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]
Returning a Resultset...........best practice question
Running: Tomcat 4.1.24, JSDK 1.4.0_03 I'm writing a class to return a resultSet to use in a JSP page or at least i think thats what i want to do. Whats the best practice to return that resultset.As the class is written below, when i try to iterate through the resultset in the jsp page i get a NullPointerException which i understand because i closed the connection before returningIf i take out all the code in the finally section i can iterate through the data no problembut thats not a good idea to leave connections open...instead of returning a resultset should i return some other type such as an Array with all the data. How should i return the data? How can I alter my code for best practice. == package foo; import javax.naming.*; import javax.sql.*; import java.sql.*; public class DBTest{ String foo = Not Connected; String bar = Not; public ResultSet getUser(){ Connection conn = null; Statement stmt = null; //Or preparedStatement if needed ResultSet rs = null; try{ Context ctx = new InitialContext(); if(ctx == null) throw new Exception(Boom - No Context); DataSource ds = (DataSource)ctx.lookup(java:comp/env/jdbc/Show); if(ds != null){ conn = ds.getConnection(); if(conn != null){ foo = Got Connection + conn.toString(); stmt = conn.createStatement(); rs = stmt.executeQuery(SELECT * FROM user); if(rs.next()){ foo=rs.getString(login); bar=rs.getString(password); } } } }catch(Exception e){ e.printStackTrace(); }finally{ // Always make sure result sets and statements are closed, // and the connection is returned to the pool. if(rs != null){ try{ rs.close(); }catch(SQLException e){;} rs=null; } if(stmt != null){ try{stmt.close();}catch(SQLException e){;} stmt=null; } if(conn != null){ try{conn.close();}catch(SQLException e){;} conn=null; } } return rs; } public String getFoo(){return foo;} public String getBar(){return bar;}
RE: getResourceAsStream cached by Tomcat's Classloader?
Are the static variables transient? If not, the session manager may persist them on a reload. [EMAIL PROTECTED] 06/05/03 9:41 AM I have tried it both ways. My notion is that it has to do with the fact that the getResourceAsStream is being called in a static method and the resulting InputStream, which is wrapped in an InputStreamReader, is passed into an object that is a static variable in my BaseDAO class. So, because the reference is at the Class level it might be holding onto it no matter what I do. If you want I can show you the code. I have some ideas. But, I'm not sure if they will work. Brandon Goodin -Original Message- From: Larry Meadors [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 8:58 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: getResourceAsStream cached by Tomcat's Classloader? Hey Brandon, Are you using this code to get a classloader? Thread.currentThread().getContextClassLoader(); If not, you are not getting tomcat's you are getting the system one. Larry [EMAIL PROTECTED] 06/05/03 8:04 AM Yes, it is closed. Brandon Goodin -Original Message- From: Dominic Parry [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 7:44 AM To: Tomcat Users List Subject: Re: getResourceAsStream cached by Tomcat's Classloader? did you close the original stream before making changes and reloading? - Original Message - From: Brandon Goodin [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, June 05, 2003 3:45 PM Subject: getResourceAsStream cached by Tomcat's Classloader? I saw a question similar to this asked in the Archives early in 2002. I didn't see a response to it. So, I hope there is an answer. I have a generic config file that is an xml file. We'll call it my-config.xml. When I load my-config.xml using Classloader.getResourceAsStream(my-config.xml) everything works great. However, when I make a change to that file and again call Classloader.getResourceAsStream(my-config.xml) the changes are not picked up and the same initial resource is returned. How do I get the Classloader to reconginze the resource changes? I'm using Tomcat 4.1.18. Brandon Goodin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Help with registering a listener
Howdy, Listeners are a servlet specification 2.3 feature, so you wouldn't find them in the DTD version 2.2. Your XML listener element is correct and sufficient to register a listener in a servlet specification 2.3 container, like tomcat 4.x. The listener class must be available to tomcat: the proper place to put it is the WEB-INF/lib (if it's in a jar) or WEB-INF/classes (if it's not in a jar) of your webapp. Yoav Shapira Millennium ChemInformatics -Original Message- From: Vijay Kandy [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 11:32 AM To: 'Tomcat Users List' Subject: Help with registering a listener Hello, Could some one please tell me how to register a listener with Tomcat 4? When I add: listener listener-classTnTSearchCleanUp/listener-class /listener within web-app element, tomcat throws 404 errors. Also, I did not find a listener element defined in http://java.sun.com/j2ee/dtds/web-app_2_2.dtd Thank you, Vijay - 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]
RE: JSTL problem (was Oracle Type 4 Driver)
Jason, I finally cleaned it up got it working! Thanks for your help. I there a way to add that datasource info to an xml file just use the dbtags query string within the jsp file? (simialr to the way you describe using jndi)? Now on to the jndi stuff... -Original Message- From: Jason Bainbridge [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 04, 2003 4:11 PM To: Tomcat Users List Subject: Re: JSTL problem (was Oracle Type 4 Driver) On Thu, 5 Jun 2003 03:57, Schwartz, David (CHR) wrote: sql:urljdbc:oracle:thin:x:1521:/sql:url I don't think it likes the URL you are giving it, is x the servername or IP and the instance name? NB. the thin driver access the server directly so totally ignore your tnsnames.ora, well except for referring to it to get the server name and instance name of course. Also try passing it the username and password with: sql:userIdroot/sql:userId sql:passwordnotVerySecure/sql:password Another more standard way to use datasources is to use JNDI and define them in your server.xml as per this howto: http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-how to.html Then you can reduce your connection tag within your JSP pages to something like: sql:connection id=conn1 dataSource=jdbc/ds1 Regards, -- Jason Bainbridge http://jblinux.org - 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: getResourceAsStream cached by Tomcat's Classloader?
When I reload the webapp as a whole it is fine (via manager or a tomcat restart). But, when I want to reload the particular config while the app is running, it returns the original resource and not the updated one. Brandon Goodin -Original Message- From: Larry Meadors [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 9:45 AM To: [EMAIL PROTECTED] Subject: RE: getResourceAsStream cached by Tomcat's Classloader? Are the static variables transient? If not, the session manager may persist them on a reload. [EMAIL PROTECTED] 06/05/03 9:41 AM I have tried it both ways. My notion is that it has to do with the fact that the getResourceAsStream is being called in a static method and the resulting InputStream, which is wrapped in an InputStreamReader, is passed into an object that is a static variable in my BaseDAO class. So, because the reference is at the Class level it might be holding onto it no matter what I do. If you want I can show you the code. I have some ideas. But, I'm not sure if they will work. Brandon Goodin -Original Message- From: Larry Meadors [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 8:58 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: getResourceAsStream cached by Tomcat's Classloader? Hey Brandon, Are you using this code to get a classloader? Thread.currentThread().getContextClassLoader(); If not, you are not getting tomcat's you are getting the system one. Larry [EMAIL PROTECTED] 06/05/03 8:04 AM Yes, it is closed. Brandon Goodin -Original Message- From: Dominic Parry [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 7:44 AM To: Tomcat Users List Subject: Re: getResourceAsStream cached by Tomcat's Classloader? did you close the original stream before making changes and reloading? - Original Message - From: Brandon Goodin [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, June 05, 2003 3:45 PM Subject: getResourceAsStream cached by Tomcat's Classloader? I saw a question similar to this asked in the Archives early in 2002. I didn't see a response to it. So, I hope there is an answer. I have a generic config file that is an xml file. We'll call it my-config.xml. When I load my-config.xml using Classloader.getResourceAsStream(my-config.xml) everything works great. However, when I make a change to that file and again call Classloader.getResourceAsStream(my-config.xml) the changes are not picked up and the same initial resource is returned. How do I get the Classloader to reconginze the resource changes? I'm using Tomcat 4.1.18. Brandon Goodin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Help with registering a listener
Hi Yoav, Thanks for your reply. It makes sense now. My web.xml starts with ?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; Do I need to change anything there? Thanks again, Vijay -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 10:47 AM To: Tomcat Users List Subject:RE: Help with registering a listener Howdy, Listeners are a servlet specification 2.3 feature, so you wouldn't find them in the DTD version 2.2. Your XML listener element is correct and sufficient to register a listener in a servlet specification 2.3 container, like tomcat 4.x. The listener class must be available to tomcat: the proper place to put it is the WEB-INF/lib (if it's in a jar) or WEB-INF/classes (if it's not in a jar) of your webapp. Yoav Shapira Millennium ChemInformatics -Original Message- From: Vijay Kandy [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 11:32 AM To: 'Tomcat Users List' Subject: Help with registering a listener Hello, Could some one please tell me how to register a listener with Tomcat 4? When I add: listener listener-classTnTSearchCleanUp/listener-class /listener within web-app element, tomcat throws 404 errors. Also, I did not find a listener element defined in http://java.sun.com/j2ee/dtds/web-app_2_2.dtd Thank you, Vijay - 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]
mod_jk for Apache 2.0.45 not working with 2.0.46
Hi - I just updated my Win32 Apache to 2.0.46. The most recent mod_jk.dll file I can find is 2.0.45. This does not work with Apache 2.0.46. I downgraded mod_jk.dll to 2.0.43, and it DOES work with Apache 2.0.46. I used the same mod_jk.conf file for both DLLs. Has anyone else experienced this? Does anyone have a mod_jk.dll file for Apache 2.0.46? John -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: upgrade from tomcat4.1.12 to 4.1.24
Rename $TOMCAT_HOME/server/lib/servlets-cgi.renametojar to $TOMCAT_HOME/server/lib/servlets-cgi.jar and edit $TOMCAT_HOME/conf/web.xml to enable the cgi servlets -Tim Xavier Ambrosioni wrote: Hi all, I upgraded my tomcat installation from 4.1.12 to 4.1.24. Now I have the following problem when I run my webapp: java.lang.ClassNotFoundException: org.apache.catalina.servlets.CGIServlet Someone know why I have this error ? Which jar files contains this class ? thank you for your help Xavier - 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: Guide for mod_jk2 + Apache2 + Tomcat 4.1.24
At 07.57 05/06/2003 +0800, you wrote: I've updated my write-up for Tomcat to include integration with Apache2 using mod_jk2. At present, I only cover channel sockets and UNIX sockets. I was not able to get JNI to work. You can view the whole document at : http://www.cymulacrum.net/tomcat/tomcat_toc.html Weeks ago, I try to setup Tomcat mod_jk2 + Apache2 + Tomcat 4.1.24 with SSL and Tomcat CLIENT-CERT authentication !!! There are bugs in tomcat-jk2.jar co., I solve all my problem download and using tomcat-connectors-1.1M1.jar !!! Duccio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat JDBC problem
I definitely new to all this stuff but i was able to successfully use the driver here's what i did... 1.. Put mysql-connector-java-3.0.8-stable-bin.jarin CATALINA_HOME\common\lib 2.. Didn't worry about setting the classpath for it... 3.. Server.xml stuff parameter nameusername/name valuetomcat/value /parameter parameter namepassword/name valuesinner/value /parameter !-- Class name for MySQL jdbc driver-- parameter namedriverClassName/name valuecom.mysql.jdbc.Driver/value /parameter !--JDBC Connection URL-- parameter nameurl/name valuejdbc:mysql://localhost/tomcatbook?autoReconnect=true/value /parameter /ResourceParams 4. Web.xml stuff resource-ref descriptionDB Connection/description res-ref-namejdbc/Show/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref Hope this helps! Regards, Russ -Original Message- From: Jason Lanpher [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 11:38 AM To: 'Tomcat Users List' Subject: RE: Tomcat JDBC problem Yes I am using com.mysql.jdbc.Driver Here is the rest of the version numbers of the system. RedHat 7.2 system MySQL 3.56 Java 1.4.1_02 JDBC/MySQL 3.08 Jason Lanpher [EMAIL PROTECTED] http://www.stealthnetworking.com Remember there are only 10 types of people in this world. Those who understand Binary and those who don't. -Original Message- From: Pitre, Russell [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 10:25 AM To: Tomcat Users List Subject: RE: Tomcat JDBC problem are you using com.mysql.jdbc.Driver? -Original Message- From: Jason Lanpher [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 11:08 AM To: 'Tomcat Users List' Subject: Tomcat JDBC problem Hi all, I am having a problem making the MySQL JDBC driver version 3 work with Tomcat correctly. I had previously used MySQL JDBC driver version 1 and developed a couple of programs to access my MySQL database. The programs worked just fine with this version of the driver. When I went to upgrade to the newest version of the MySQL JDBC driver I get errors in my programs saying there is an error before the beginning of the result set. I am wondering if I am not installing the driver correctly. All I did for the JDBC driver version 1 was to place the jar file in CATALINA_HOME/common/lib I also made a CLASSPATH variable and referenced the package. Since this worked I thought the it should still work for the JDBC driver version 3. But for some reason it does not. Does anybody have any experience setting up JDBC driver 2 or 3 for MySQL that could give me a few tips on installation. Thanks in advance, Jason Lanpher [EMAIL PROTECTED] http://www.stealthnetworking.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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSTL and EL question - SOLVED
Ah, my bad. I thought you were declaring the tab library in the WEB.INF file kind of like you can declare your database connection: context-param param-name javax.servlet.jsp.jstl.sql.dataSource /param-name param-value jdbc:mysql://localhost:3307/ nfl2003,org.gjt.mm.mysql.Driver,username,password /param-value /context-param I was thinking that you could declare it on the application level and then not use the %@ taglib % in the JSP pages. Thanks for clearing that up, Jeff On Wednesday, June 4, 2003, at 10:21 PM, Nikola Milutinovic wrote: I thought I liked the idea of having the taglib in the web.xml file. When I try it I'm getting This absolute uri (http://java.sun.com/jstl/core) cannot be resolved in either web.xml or the jar files deployed with this application. Do I have to download it somewhere in order to use it in the web.xml file? Any ideas? :-) OK, four things when dealing with ANY tag library: 1. PLACE JAR FILES Place JAR files that hold implementation of the tag library in a directory where Tomcat will pick it up. Either make it WEB-INF/lib/ (private) or ${CATALINA_HOME}/shared/lib (all web-apps will have access to it). You could place it in ${CATALINA_HOME}/common/lib, but I don't see the point in Tomcat having access to those JARs. There was a discussion recently naming pros/cons of each choice (Craig), so look up the archives. 2. PLACE TLD Place TLD files (Tag Library Descriptor) in either WEB-INF/ or (if I recall correctly) WEB-INF/taglibs/. The first placement will require for location in web.xml file to be absolute: /WEB-INF/name.tld, while the second will allow for relative links: name.tld 3. DECLARE TLD IN WEB.XML This part you've already seen. taglib taglib-urihttp://java.sun.com/jstl/core/taglib-uri taglib-location/WEB-INF/c.tld/taglib-location /taglib 4. DECLARE TLD USAGE IN JSP This you've seen %@ taglib uri=http://java.sun.com/jstl/core; prefix=c % The prefix is up to you. Nix. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: upgrade from tomcat4.1.12 to 4.1.24
thanks, it's ok. Now I have another problem! java.lang.ClassNotFoundException: org.apache.commons.logging.impl.Log4jFactory I found this class in commons-logging.jar file in $TOMCAT_HOME/server/lib. So, why I have this error ? In my previous installation of tomcat, they put this jar file in $TOMCAT_HOME/common/lib Why ? I can make a symbolic link between $TOMCAT_HOME/common/lib/commons-logging.jar and $TOMCAT_HOME/server/lib/commons-logging.jar but I don't think that's the better solution. Thank you for your help Xavier [EMAIL PROTECTED] wrote: Rename $TOMCAT_HOME/server/lib/servlets-cgi.renametojar to $TOMCAT_HOME/server/lib/servlets-cgi.jar and edit $TOMCAT_HOME/conf/web.xml to enable the cgi servlets -Tim Xavier Ambrosioni wrote: Hi all, I upgraded my tomcat installation from 4.1.12 to 4.1.24. Now I have the following problem when I run my webapp: java.lang.ClassNotFoundException: org.apache.catalina.servlets.CGIServlet Someone know why I have this error ? Which jar files contains this class ? thank you for your help Xavier - 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]
503 Service Temporarily Unavailable
Hello, OS: debian woody Apache: 1.3.27 tomcat: 4.1.24 mod_jk2: compiled from connectors 4.1.24 sources When I connect to http://myhost.domain.fr/examples/ apache sends a 503 error: The servlet container is temporary unavailable or being upgraded HTTP/1.1 503 Date: Thu, 05 Jun 2003 16:12:15 GMT Server: Apache/1.3.26 (Unix) mod_jk2/2.0.3-dev Connection: close Transfer-Encoding: chunked Content-Type: text/html; charset=iso-8859-1 Service Temporarily Unavailable The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later. Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request. In the jk2.log: --- [Thu Jun 05 15:48:14 2003] (error) [jk_msg_ajp.c (447)]: msgAjp.receive(): Bad signature 00 [Thu Jun 05 15:48:14 2003] (error) [jk_channel_socket.c (549)]: channelSocket.receive(): Bad header [Thu Jun 05 15:48:14 2003] (error) [jk_workerEnv.c (482)]: workerEnv.processCallbacks() Error reading reply [Thu Jun 05 15:48:14 2003] (error) [jk_worker_ajp13.c (416)]: ajp13.service() ajpGetReply recoverable error 21000 [Thu Jun 05 15:48:34 2003] (error) [jk_msg_ajp.c (447)]: msgAjp.receive(): Bad signature 00 [Thu Jun 05 15:48:34 2003] (error) [jk_channel_socket.c (549)]: channelSocket.receive(): Bad header [Thu Jun 05 15:48:34 2003] (error) [jk_workerEnv.c (482)]: workerEnv.processCallbacks() Error reading reply [Thu Jun 05 15:48:34 2003] (error) [jk_worker_ajp13.c (416)]: ajp13.service() ajpGetReply recoverable error 21000 [Thu Jun 05 15:48:34 2003] (error) [jk_worker_ajp13.c (512)]: ajp13.service() Error forwarding ajp13:localhost:8009 1 0 [Thu Jun 05 15:48:34 2003] (error) [jk_worker_lb.c (407)]: lb.service() worker failed 21000 for ajp13:localhost:8009 [Thu Jun 05 15:48:54 2003] (error) [jk_msg_ajp.c (447)]: msgAjp.receive(): Bad signature 00 [Thu Jun 05 15:48:54 2003] (error) [jk_channel_socket.c (549)]: channelSocket.receive(): Bad header [Thu Jun 05 15:48:54 2003] (error) [jk_workerEnv.c (482)]: workerEnv.processCallbacks() Error reading reply [Thu Jun 05 15:48:54 2003] (error) [jk_worker_ajp13.c (416)]: ajp13.service() ajpGetReply recoverable error 21000 [Thu Jun 05 15:49:14 2003] (error) [jk_msg_ajp.c (447)]: msgAjp.receive(): Bad signature 00 [Thu Jun 05 15:49:14 2003] (error) [jk_channel_socket.c (549)]: channelSocket.receive(): Bad header [Thu Jun 05 15:49:14 2003] (error) [jk_workerEnv.c (482)]: workerEnv.processCallbacks() Error reading reply [Thu Jun 05 15:49:14 2003] (error) [jk_worker_ajp13.c (416)]: ajp13.service() ajpGetReply recoverable error 21000 [Thu Jun 05 15:49:14 2003] (error) [jk_worker_ajp13.c (512)]: ajp13.service() Error forwarding ajp13:localhost:8009 1 0 [Thu Jun 05 15:49:14 2003] (error) [jk_worker_lb.c (407)]: lb.service() worker failed 21000 for ajp13:localhost:8009 [Thu Jun 05 15:49:14 2003] (error) [jk_worker_lb.c (353)]: lb_worker.service() all workers in error or disabled state [Thu Jun 05 15:49:14 2003] (error) [mod_jk2.c (427)]: mod_jk.handler() Error connecting to tomcat 21000 -- An idea? Thanx, Manu. smime.p7s Description: S/MIME Cryptographic Signature
Re: commons-logging not working [was log4j not working]
You are using commons-logging and not log4j directly. Please don't state that log4j isn't working when you aren't using it directly. I don't have the slightest clue of how to get your commons-logging config working, but one fix is to dump commons-logging and use log4j directly. You will have far fewer problems. See http://www.qos.ch/logging/thinkAgain.html . Jake At 09:54 AM 6/5/2003 +0200, you wrote: Hi all, I'm trying to use the Log4J package in my webapplication. Therefore I placed the file log4j.properties in WEB-INF/classes which looks like this: log4j.rootLogger = DEBUG, stdout, rolling log4j.appender.stdout = ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n log4j.appender.rolling=org.apache.log4j.RollingFileAppender log4j.appender.rolling.File=/var/ordermanager/log/ordermanager.log log4j.appender.rolling.MaxFileSize=100KB log4j.appender.rolling.MaxBackupIndex=1 log4j.appender.rolling.layout=org.apache.log4j.PatternLayout log4j.appender.rolling.layout.ConversionPattern=%d{ABSOLUTE} - %p %c - %m%n I also have a file commons-logging.properties which contains: org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JCategoryLog (B.t.w. I also tried to remove this file (commons-logging.properties) which has affect). In my Actions I have code like this: Log log = LogFactory.getLog(BasicAction.class); if (log.isInfoEnabled()) { log.info(Log test!); } I'm using JBoss with integrated Tomcat 4.1 (on linux). In the JBoss log I see: 09:51:52,853 INFO [OrdermanagerBaseAction] OrderManagerBaseAction called! But, nothing appears in /var/ordermanager/log/ordermanager.log Permissions, etc are all okay What could be wrong here? Many thanks, Harm de Laat Informatiefabriek The Netherlands - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat Manager deploy and undeploy
I finally had my Catalina-Ant undeploy task working after I included context.xml into my war's META-INF directory. What this deployment doing is - war is uploaded to $CATALINA/work/Standalone/my.host/manager; - war is unpacked into $CATALIAN_HOME/webapps/myapp; - context.xml is extracted to manager directory as myapp.xml; - server.xml is modified to include the content in myapp.xml; - myapp is loaded. I noticed that myapp's docBase in the modified server.xml is the war in manager directory. This helps to undeploy myapp but prevents me from reading my configuration xmls from WEB-INF/conf. I cannot getServletContext().getRealPath(/) to get $CATALINA_HOME/webapps/myapp. According to Servlet API doc, getRealPath returns null if content is available from war. I don't want to hard-code the path into web.xml as init-param or into my init Servlet. Does any one have input? Regards, PQ The difference between 'involvement' and 'commitment' is like an eggs-and-ham breakfast: the chicken was 'involved' - the pig was 'committed'.
RE: getResourceAsStream cached by Tomcat's Classloader?
Are you using this code to get a classloader? Thread.currentThread().getContextClassLoader(); If not, you are not getting tomcat's you are getting the system one. Are you sure this is true? A ClassLoader can have a parent ClassLoader. But, a class does not maintain a single copy across all ClassLoader contexts. Therefore, the Class type can exist in multiple ClassLoaders. So a Class has a reference to it's ClassLoader context when it is created. When the this.getClass().getClassLoader() is called it calls the context that the class was loaded in. I think you would have to specifically call the getParent() of the Classloader in order to go up the Classloader chain. In this situation I think Thread.currentThread().getContextClassLoader() and this.getClass().getClassLoader() will accomplish the same thing. Brandon Goodin -Original Message- From: Larry Meadors [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 9:45 AM To: [EMAIL PROTECTED] Subject: RE: getResourceAsStream cached by Tomcat's Classloader? Are the static variables transient? If not, the session manager may persist them on a reload. [EMAIL PROTECTED] 06/05/03 9:41 AM I have tried it both ways. My notion is that it has to do with the fact that the getResourceAsStream is being called in a static method and the resulting InputStream, which is wrapped in an InputStreamReader, is passed into an object that is a static variable in my BaseDAO class. So, because the reference is at the Class level it might be holding onto it no matter what I do. If you want I can show you the code. I have some ideas. But, I'm not sure if they will work. Brandon Goodin -Original Message- From: Larry Meadors [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 8:58 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: getResourceAsStream cached by Tomcat's Classloader? Hey Brandon, Are you using this code to get a classloader? Thread.currentThread().getContextClassLoader(); If not, you are not getting tomcat's you are getting the system one. Larry [EMAIL PROTECTED] 06/05/03 8:04 AM Yes, it is closed. Brandon Goodin -Original Message- From: Dominic Parry [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 7:44 AM To: Tomcat Users List Subject: Re: getResourceAsStream cached by Tomcat's Classloader? did you close the original stream before making changes and reloading? - Original Message - From: Brandon Goodin [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, June 05, 2003 3:45 PM Subject: getResourceAsStream cached by Tomcat's Classloader? I saw a question similar to this asked in the Archives early in 2002. I didn't see a response to it. So, I hope there is an answer. I have a generic config file that is an xml file. We'll call it my-config.xml. When I load my-config.xml using Classloader.getResourceAsStream(my-config.xml) everything works great. However, when I make a change to that file and again call Classloader.getResourceAsStream(my-config.xml) the changes are not picked up and the same initial resource is returned. How do I get the Classloader to reconginze the resource changes? I'm using Tomcat 4.1.18. Brandon Goodin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat Manager deploy and undeploy
One clarification and a solution... At 12:48 PM 6/5/2003 -0400, you wrote: I finally had my Catalina-Ant undeploy task working after I included context.xml into my war's META-INF directory. What this deployment doing is - war is uploaded to $CATALINA/work/Standalone/my.host/manager; - war is unpacked into $CATALIAN_HOME/webapps/myapp; completely false It is actually (partially) unpacked to CATALINA_HOME/work/Standalone/my.host/myapp . I say partially because only contents of the WEB-INF/classes and WEB-INF/lib directory are extracted to said place. - context.xml is extracted to manager directory as myapp.xml; - server.xml is modified to include the content in myapp.xml; - myapp is loaded. I noticed that myapp's docBase in the modified server.xml is the war in manager directory. This helps to undeploy myapp but prevents me from reading my configuration xmls from WEB-INF/conf. I cannot getServletContext().getRealPath(/) to get $CATALINA_HOME/webapps/myapp. According to Servlet API doc, getRealPath returns null if content is available from war. I don't want to hard-code the path into web.xml as init-param or into my init Servlet. Does any one have input? This one is easy. Never ever use File IO unless there is no other way to do what you need. I this case, you can use context.getResourceAsStream(/WEB-INF/myconfigfile.properties); See the javadoc for ServletContext for other ways to do this as well. Jake Regards, PQ The difference between 'involvement' and 'commitment' is like an eggs-and-ham breakfast: the chicken was 'involved' - the pig was 'committed'.
Configuring SSL on Tomcat
Hello, I've managed to configure SSL ok on port 443 with Tomcat. How do you configure Tomcat to only run certain pages under SSL as opposed to the entire site? Thanks, Eugene. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
stdout log file for Tomcat Windows Service
I am running Tomcat 4.1.24 as Windows Service in production environment. I have a server_stdout.log file for logging the stdout. However, I have two problems with this log file: (1) I added -verbose:gc option as the JVM option when install the Windows service, however, no GC info is logged in this file. How can I make GC info to be logged in this file? (2) Every time when I restart the service, this file will be overwritten. Is there a way to prevent this? Thank you for your help! Hua - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Guide for mod_jk2 + Apache2 + Tomcat 4.1.24
Duccio Fallani wrote: Weeks ago, I try to setup Tomcat mod_jk2 + Apache2 + Tomcat 4.1.24 with SSL and Tomcat CLIENT-CERT authentication !!! There are bugs in tomcat-jk2.jar co., I solve all my problem download and using tomcat-connectors-1.1M1.jar !!! Not sure if I understand you, Duccio ... where did you download tomcat-connectors-1.1M1.jar ? Also, could you tell us how you installed with SSL ? If it is ok with you, I would like to include that inside my document. Regards, pascal chong - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: getResourceAsStream cached by Tomcat's Classloader?
I think you are right, but I always use Thread method because it works even in a static method - you do not need 'this' for it to work. I prefer having one way to do this instead of two - that way I can think less about how to get the CL, and more about the problem it will help me solve (and I am lazy). ;-) Larry [EMAIL PROTECTED] 06/05/03 10:58 AM Are you using this code to get a classloader? Thread.currentThread().getContextClassLoader(); If not, you are not getting tomcat's you are getting the system one. Are you sure this is true? A ClassLoader can have a parent ClassLoader. But, a class does not maintain a single copy across all ClassLoader contexts. Therefore, the Class type can exist in multiple ClassLoaders. So a Class has a reference to it's ClassLoader context when it is created. When the this.getClass().getClassLoader() is called it calls the context that the class was loaded in. I think you would have to specifically call the getParent() of the Classloader in order to go up the Classloader chain. In this situation I think Thread.currentThread().getContextClassLoader() and this.getClass().getClassLoader() will accomplish the same thing. Brandon Goodin -Original Message- From: Larry Meadors [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 9:45 AM To: [EMAIL PROTECTED] Subject: RE: getResourceAsStream cached by Tomcat's Classloader? Are the static variables transient? If not, the session manager may persist them on a reload. [EMAIL PROTECTED] 06/05/03 9:41 AM I have tried it both ways. My notion is that it has to do with the fact that the getResourceAsStream is being called in a static method and the resulting InputStream, which is wrapped in an InputStreamReader, is passed into an object that is a static variable in my BaseDAO class. So, because the reference is at the Class level it might be holding onto it no matter what I do. If you want I can show you the code. I have some ideas. But, I'm not sure if they will work. Brandon Goodin -Original Message- From: Larry Meadors [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 8:58 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: getResourceAsStream cached by Tomcat's Classloader? Hey Brandon, Are you using this code to get a classloader? Thread.currentThread().getContextClassLoader(); If not, you are not getting tomcat's you are getting the system one. Larry [EMAIL PROTECTED] 06/05/03 8:04 AM Yes, it is closed. Brandon Goodin -Original Message- From: Dominic Parry [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 7:44 AM To: Tomcat Users List Subject: Re: getResourceAsStream cached by Tomcat's Classloader? did you close the original stream before making changes and reloading? - Original Message - From: Brandon Goodin [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, June 05, 2003 3:45 PM Subject: getResourceAsStream cached by Tomcat's Classloader? I saw a question similar to this asked in the Archives early in 2002. I didn't see a response to it. So, I hope there is an answer. I have a generic config file that is an xml file. We'll call it my-config.xml. When I load my-config.xml using Classloader.getResourceAsStream(my-config.xml) everything works great. However, when I make a change to that file and again call Classloader.getResourceAsStream(my-config.xml) the changes are not picked up and the same initial resource is returned. How do I get the Classloader to reconginze the resource changes? I'm using Tomcat 4.1.18. Brandon Goodin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - 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: getResourceAsStream cached by Tomcat's Classloader?
Aaaah. A man after my own heart! Keep it simple. Brandon Goodin -Original Message- From: Larry Meadors [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 11:12 AM To: [EMAIL PROTECTED] Subject: RE: getResourceAsStream cached by Tomcat's Classloader? I think you are right, but I always use Thread method because it works even in a static method - you do not need 'this' for it to work. I prefer having one way to do this instead of two - that way I can think less about how to get the CL, and more about the problem it will help me solve (and I am lazy). ;-) Larry [EMAIL PROTECTED] 06/05/03 10:58 AM Are you using this code to get a classloader? Thread.currentThread().getContextClassLoader(); If not, you are not getting tomcat's you are getting the system one. Are you sure this is true? A ClassLoader can have a parent ClassLoader. But, a class does not maintain a single copy across all ClassLoader contexts. Therefore, the Class type can exist in multiple ClassLoaders. So a Class has a reference to it's ClassLoader context when it is created. When the this.getClass().getClassLoader() is called it calls the context that the class was loaded in. I think you would have to specifically call the getParent() of the Classloader in order to go up the Classloader chain. In this situation I think Thread.currentThread().getContextClassLoader() and this.getClass().getClassLoader() will accomplish the same thing. Brandon Goodin -Original Message- From: Larry Meadors [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 9:45 AM To: [EMAIL PROTECTED] Subject: RE: getResourceAsStream cached by Tomcat's Classloader? Are the static variables transient? If not, the session manager may persist them on a reload. [EMAIL PROTECTED] 06/05/03 9:41 AM I have tried it both ways. My notion is that it has to do with the fact that the getResourceAsStream is being called in a static method and the resulting InputStream, which is wrapped in an InputStreamReader, is passed into an object that is a static variable in my BaseDAO class. So, because the reference is at the Class level it might be holding onto it no matter what I do. If you want I can show you the code. I have some ideas. But, I'm not sure if they will work. Brandon Goodin -Original Message- From: Larry Meadors [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 8:58 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: getResourceAsStream cached by Tomcat's Classloader? Hey Brandon, Are you using this code to get a classloader? Thread.currentThread().getContextClassLoader(); If not, you are not getting tomcat's you are getting the system one. Larry [EMAIL PROTECTED] 06/05/03 8:04 AM Yes, it is closed. Brandon Goodin -Original Message- From: Dominic Parry [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 7:44 AM To: Tomcat Users List Subject: Re: getResourceAsStream cached by Tomcat's Classloader? did you close the original stream before making changes and reloading? - Original Message - From: Brandon Goodin [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, June 05, 2003 3:45 PM Subject: getResourceAsStream cached by Tomcat's Classloader? I saw a question similar to this asked in the Archives early in 2002. I didn't see a response to it. So, I hope there is an answer. I have a generic config file that is an xml file. We'll call it my-config.xml. When I load my-config.xml using Classloader.getResourceAsStream(my-config.xml) everything works great. However, when I make a change to that file and again call Classloader.getResourceAsStream(my-config.xml) the changes are not picked up and the same initial resource is returned. How do I get the Classloader to reconginze the resource changes? I'm using Tomcat 4.1.18. Brandon Goodin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL
performance config
Question for production admins: I am preparing a tomcat standalone installation for a production environment. I would be very interested to hear your opinions on best performance config setup. Details and params I am specifically considering below: Params: JVM ..JAVA_OPTS (eg -server) ..CATALINA_OPTS (eg -Xms512m -Xmx512m) TOMCAT ..minProcessors ..maxProcessors ..acceptcount ..debug (eg 0) ..enableLookups (eg false) + anything else?? Setup: Compaq Intel, 2 PIII 700Mhz w 1MB cache, 1 GB ram Linux RH 7.3 Tomcat 1.1.24 j2sdk_1.4.1_01-b01 App: 1 App only, jsp + servlet based, minimal html, oracle DB on seperate box. max 150 concurrent users, non intensive. uploading + downloading files via app frequent. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat Manager deploy and undeploy
Yes, the classes and jars are unpacked to work/my.host/myapp too. I use Digester to parse my xmls. I'll give getResourceAsStream a try. -Original Message- From: Jacob Kjome [mailto:[EMAIL PROTECTED] Sent: June 5, 2003 1:04 PM To: Tomcat Users List Subject: Re: Tomcat Manager deploy and undeploy One clarification and a solution... At 12:48 PM 6/5/2003 -0400, you wrote: I finally had my Catalina-Ant undeploy task working after I included context.xml into my war's META-INF directory. What this deployment doing is - war is uploaded to $CATALINA/work/Standalone/my.host/manager; - war is unpacked into $CATALIAN_HOME/webapps/myapp; completely false It is actually (partially) unpacked to CATALINA_HOME/work/Standalone/my.host/myapp . I say partially because only contents of the WEB-INF/classes and WEB-INF/lib directory are extracted to said place. - context.xml is extracted to manager directory as myapp.xml; - server.xml is modified to include the content in myapp.xml; - myapp is loaded. I noticed that myapp's docBase in the modified server.xml is the war in manager directory. This helps to undeploy myapp but prevents me from reading my configuration xmls from WEB-INF/conf. I cannot getServletContext().getRealPath(/) to get $CATALINA_HOME/webapps/myapp. According to Servlet API doc, getRealPath returns null if content is available from war. I don't want to hard-code the path into web.xml as init-param or into my init Servlet. Does any one have input? This one is easy. Never ever use File IO unless there is no other way to do what you need. I this case, you can use context.getResourceAsStream(/WEB-INF/myconfigfile.properties); See the javadoc for ServletContext for other ways to do this as well. Jake Regards, PQ The difference between 'involvement' and 'commitment' is like an eggs-and-ham breakfast: the chicken was 'involved' - the pig was 'committed'.
problem with updating an web app through manager app (linux work,win no)
I'm having a strange problem, in linux, if I upload a war through manager app, remove it , and upload again, it works fine, but in windows me, with the same tomcat version (4.1.26), it uploads ok, remove ok, but when i try to upload the same war as before, i t says : FAIL - War file upLoad.war already exists on server I get the same error on linux if I don't remove the context before uploading again. Has anyone noted this behaviour on windows? -- Emerson Cargnin Analista de Sitemas Setor de Desenvolvimento de Sistemas - TRE-SC tel : (048) - 251-3700 - Ramal 3181 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: problem with updating an web app through manager app (linux work, win no)
Looks like some files are not removed. I had similar problem on Windows, my struts.jar under WEB-INF/lib never got removed. Linux is OK. Try put context.xml into META-INF. -Original Message- From: Emerson Cargnin [mailto:[EMAIL PROTECTED] Sent: June 5, 2003 1:28 PM To: [EMAIL PROTECTED] Subject: problem with updating an web app through manager app (linux work, win no) I'm having a strange problem, in linux, if I upload a war through manager app, remove it , and upload again, it works fine, but in windows me, with the same tomcat version (4.1.26), it uploads ok, remove ok, but when i try to upload the same war as before, i t says : FAIL - War file upLoad.war already exists on server I get the same error on linux if I don't remove the context before uploading again. Has anyone noted this behaviour on windows? -- Emerson Cargnin Analista de Sitemas Setor de Desenvolvimento de Sistemas - TRE-SC tel : (048) - 251-3700 - Ramal 3181 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
package basicServlets does not match directory error message... help !
Hi I'm a Java student starting to learn about Tomcat and Servlets, and i am trying to run the Servlets using JBuilder 8 Personal. I loaded a basicServlets package that contains one class called BasicServlet. When I tried to compile the class the error message said: BasicServlet.java: Error #: 901 : package basicServlets stated in source C:\Documents and Settings\Gateway User\jbproject\basicServlets\src\basicservlets\BasicServlet.java does not match directory basicServlets at line 1, column 9 Your advice is appreciated Joseph
Re: problem with updating an web app through manager app (linux work, win no)
what would be this context.xml? The problem is that i'm at work, and i let my home computer on, with tomcat, but i'm having that problem, can't deploy the same app two times : ) If you could sday more about how the context work and an exemple could be helpful thanks in advance emerson Phillip Qin wrote: Looks like some files are not removed. I had similar problem on Windows, my struts.jar under WEB-INF/lib never got removed. Linux is OK. Try put context.xml into META-INF. -Original Message- From: Emerson Cargnin [mailto:[EMAIL PROTECTED] Sent: June 5, 2003 1:28 PM To: [EMAIL PROTECTED] Subject: problem with updating an web app through manager app (linux work, win no) I'm having a strange problem, in linux, if I upload a war through manager app, remove it , and upload again, it works fine, but in windows me, with the same tomcat version (4.1.26), it uploads ok, remove ok, but when i try to upload the same war as before, i t says : FAIL - War file upLoad.war already exists on server I get the same error on linux if I don't remove the context before uploading again. Has anyone noted this behaviour on windows? -- Emerson Cargnin Analista de Sitemas Setor de Desenvolvimento de Sistemas - TRE-SC tel : (048) - 251-3700 - Ramal 3181 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
package basicServlets does not match directory error message... help !
It seems I have corrected the previous error but now have an error message that says: BasicServlet.java: Error #: 302 : cannot access class javax.servlet.GenericServlet; java.io.IOException: class not found: class javax.servlet.GenericServlet at line 4, column 22 Thanks Joseph Hi I'm a Java student starting to learn about Tomcat and Servlets, and i am trying to run the Servlets using JBuilder 8 Personal. I loaded a basicServlets package that contains one class called BasicServlet. When I tried to compile the class the error message said: BasicServlet.java: Error #: 901 : package basicServlets stated in source C:\Documents and Settings\Gateway User\jbproject\basicServlets\src\basicservlets\BasicServlet.java does not match directory basicServlets at line 1, column 9 Your advice is appreciated Joseph
RE: problem with updating an web app through manager app (linux w ork, win no)
I assume that you put your webapp's context in server.xml, something like Context path=/myapp docBase=myapp debug=5 reloadable=true crossContext=false Logger className=org.apache.catalina.logger.FileLogger prefix=myapp_log. suffix=.txt timestamp=true/ Resource name=mail/Session auth=Container type=javax.mail.Session/ ResourceParams name=mail/Session parameter namemail.smtp.host/name valueexchange.myhost.com/value /parameter /ResourceParams /Context Before I use Tomcat Manager to deploy myapp, I stored this context in an XML file called myapp.xml, drop it off $CATALINA_HOME/webapps and copy my app files to $CATALINA_HOME/webapps/myapp. With Tomcat Manager, I have to use context.xml to let the manager extract it from myapp.war. -Original Message- From: Emerson Cargnin [mailto:[EMAIL PROTECTED] Sent: June 5, 2003 1:43 PM To: Tomcat Users List Subject: Re: problem with updating an web app through manager app (linux w ork, win no) what would be this context.xml? The problem is that i'm at work, and i let my home computer on, with tomcat, but i'm having that problem, can't deploy the same app two times : ) If you could sday more about how the context work and an exemple could be helpful thanks in advance emerson Phillip Qin wrote: Looks like some files are not removed. I had similar problem on Windows, my struts.jar under WEB-INF/lib never got removed. Linux is OK. Try put context.xml into META-INF. -Original Message- From: Emerson Cargnin [mailto:[EMAIL PROTECTED] Sent: June 5, 2003 1:28 PM To: [EMAIL PROTECTED] Subject: problem with updating an web app through manager app (linux work, win no) I'm having a strange problem, in linux, if I upload a war through manager app, remove it , and upload again, it works fine, but in windows me, with the same tomcat version (4.1.26), it uploads ok, remove ok, but when i try to upload the same war as before, i t says : FAIL - War file upLoad.war already exists on server I get the same error on linux if I don't remove the context before uploading again. Has anyone noted this behaviour on windows? -- Emerson Cargnin Analista de Sitemas Setor de Desenvolvimento de Sistemas - TRE-SC tel : (048) - 251-3700 - Ramal 3181 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat Manager deploy and undeploy
Phillip Qin wrote: - war is uploaded to $CATALINA/work/Standalone/my.host/manager; - war is unpacked into $CATALIAN_HOME/webapps/myapp; Jacob Kjome wrote: completely false I have to agree with Phillip -- I've seen (and reliably reproduced) this behavior with Tomcat 4.1.24-LE. The only way I got around problems caused by this (undeploy would not work if the app had been unpacked in the CATALINA_HOME/webapps folder, but remove would) was to modify the distributed server.xml, adding unpackWARs=false to the Host entry. I'd love to know *what* (if anything) I'm doing wrong, or have configured wrong. But I've reproduced this multiple times on 3 different Windows 2X servers with clean 4.1.24-LE installations. PC - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Embedded Apache
Hi All, After while I am back on line and my question is: Has any one have experience working with embedded version of Apache server for the VxWorks RTOS, if yes let me know please I am curious about portability, performance, ... . Thanks, Tomislav
Sharing a connection pool among contexts
Hi, I have configured the commons-dbcp datasource as a JNDI resource for MSSQL and Oracle and all is working as expected. However, as I understand, it is only possible to keep a factory as a resource and so a new datapool must be created everytime a JNDI lookup is done. I would like to share a single connection pool among different contexts. My first attempt was to create a listener that put a single instance of a pool into the JNDI only to find that it is read-only. For my next attempt I am thinking of creating a javabean with a static collection of datasources and name keys that can be gotten as a JNDI resource so that the different applications can just retrieve the bean and do a lookup of the datasource that way. Am I missing an easier or better way to do this? I do not have any experience with Javabeans and based on the stuff I've seen on the web beans are usually graphic oriented. Is this an appropriate use of a bean (or perhaps an Enterprise Javabean)? Thank you in advance, Scott - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[SOLVED]RE: getResourceAsStream cached by Tomcat's Classloader?
Well, here is how I solved my problem: -- code start -- String resource = my-config.xml; ClassLoader loader = Thread.currentThread().getContextClassLoader(); URL url = loader.getResource(resource); Reader reader = new FileReader( new File( url.getFile())); -- code stop -- Directly calling the getResourceAsStream failed to produce a copy of the altered config. Is this a bug? Brandon Goodin -Original Message- From: Brandon Goodin [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 11:23 AM To: Tomcat Users List Subject: RE: getResourceAsStream cached by Tomcat's Classloader? Aaaah. A man after my own heart! Keep it simple. Brandon Goodin -Original Message- From: Larry Meadors [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 11:12 AM To: [EMAIL PROTECTED] Subject: RE: getResourceAsStream cached by Tomcat's Classloader? I think you are right, but I always use Thread method because it works even in a static method - you do not need 'this' for it to work. I prefer having one way to do this instead of two - that way I can think less about how to get the CL, and more about the problem it will help me solve (and I am lazy). ;-) Larry [EMAIL PROTECTED] 06/05/03 10:58 AM Are you using this code to get a classloader? Thread.currentThread().getContextClassLoader(); If not, you are not getting tomcat's you are getting the system one. Are you sure this is true? A ClassLoader can have a parent ClassLoader. But, a class does not maintain a single copy across all ClassLoader contexts. Therefore, the Class type can exist in multiple ClassLoaders. So a Class has a reference to it's ClassLoader context when it is created. When the this.getClass().getClassLoader() is called it calls the context that the class was loaded in. I think you would have to specifically call the getParent() of the Classloader in order to go up the Classloader chain. In this situation I think Thread.currentThread().getContextClassLoader() and this.getClass().getClassLoader() will accomplish the same thing. Brandon Goodin -Original Message- From: Larry Meadors [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 9:45 AM To: [EMAIL PROTECTED] Subject: RE: getResourceAsStream cached by Tomcat's Classloader? Are the static variables transient? If not, the session manager may persist them on a reload. [EMAIL PROTECTED] 06/05/03 9:41 AM I have tried it both ways. My notion is that it has to do with the fact that the getResourceAsStream is being called in a static method and the resulting InputStream, which is wrapped in an InputStreamReader, is passed into an object that is a static variable in my BaseDAO class. So, because the reference is at the Class level it might be holding onto it no matter what I do. If you want I can show you the code. I have some ideas. But, I'm not sure if they will work. Brandon Goodin -Original Message- From: Larry Meadors [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 8:58 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: getResourceAsStream cached by Tomcat's Classloader? Hey Brandon, Are you using this code to get a classloader? Thread.currentThread().getContextClassLoader(); If not, you are not getting tomcat's you are getting the system one. Larry [EMAIL PROTECTED] 06/05/03 8:04 AM Yes, it is closed. Brandon Goodin -Original Message- From: Dominic Parry [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 7:44 AM To: Tomcat Users List Subject: Re: getResourceAsStream cached by Tomcat's Classloader? did you close the original stream before making changes and reloading? - Original Message - From: Brandon Goodin [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, June 05, 2003 3:45 PM Subject: getResourceAsStream cached by Tomcat's Classloader? I saw a question similar to this asked in the Archives early in 2002. I didn't see a response to it. So, I hope there is an answer. I have a generic config file that is an xml file. We'll call it my-config.xml. When I load my-config.xml using Classloader.getResourceAsStream(my-config.xml) everything works great. However, when I make a change to that file and again call Classloader.getResourceAsStream(my-config.xml) the changes are not picked up and the same initial resource is returned. How do I get the Classloader to reconginze the resource changes? I'm using Tomcat 4.1.18. Brandon Goodin - 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]
logic:forward tag and tile definitions...
Hi, In a struts logic:forward tag can the forward referenced by the name attribute be a global forward where the path is a tile definition? This does not seem to be the case, but I want to verify. I can forward to the same page defined by the tile definition using an ActionForward in an Action class, but I cannot forward to the page using the logic:forward tag. In a JSP: logic:forward name=myTileDefinitionPage/ In the struts-config: global-forwards forward name=myTileDefinitionPage path=myTileDefinition/ /global-forwards where myTileDefinition is a tile definition in my tile-definitions.xml file. Thx, Mike - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [SOLVED]RE: getResourceAsStream cached by Tomcat's Classloader?
Howdy, Please note your approach will fail when running from a packed .war file, as the new File(..) will throw an exception. This might be OK for your environment, but is important to keep in mind for portability. Yoav Shapira Millennium ChemInformatics -Original Message- From: Brandon Goodin [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 2:08 PM To: Tomcat Users List Subject: [SOLVED]RE: getResourceAsStream cached by Tomcat's Classloader? Well, here is how I solved my problem: -- code start -- String resource = my-config.xml; ClassLoader loader = Thread.currentThread().getContextClassLoader(); URL url = loader.getResource(resource); Reader reader = new FileReader( new File( url.getFile())); -- code stop -- Directly calling the getResourceAsStream failed to produce a copy of the altered config. Is this a bug? Brandon Goodin -Original Message- From: Brandon Goodin [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 11:23 AM To: Tomcat Users List Subject: RE: getResourceAsStream cached by Tomcat's Classloader? Aaaah. A man after my own heart! Keep it simple. Brandon Goodin -Original Message- From: Larry Meadors [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 11:12 AM To: [EMAIL PROTECTED] Subject: RE: getResourceAsStream cached by Tomcat's Classloader? I think you are right, but I always use Thread method because it works even in a static method - you do not need 'this' for it to work. I prefer having one way to do this instead of two - that way I can think less about how to get the CL, and more about the problem it will help me solve (and I am lazy). ;-) Larry [EMAIL PROTECTED] 06/05/03 10:58 AM Are you using this code to get a classloader? Thread.currentThread().getContextClassLoader(); If not, you are not getting tomcat's you are getting the system one. Are you sure this is true? A ClassLoader can have a parent ClassLoader. But, a class does not maintain a single copy across all ClassLoader contexts. Therefore, the Class type can exist in multiple ClassLoaders. So a Class has a reference to it's ClassLoader context when it is created. When the this.getClass().getClassLoader() is called it calls the context that the class was loaded in. I think you would have to specifically call the getParent() of the Classloader in order to go up the Classloader chain. In this situation I think Thread.currentThread().getContextClassLoader() and this.getClass().getClassLoader() will accomplish the same thing. Brandon Goodin -Original Message- From: Larry Meadors [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 9:45 AM To: [EMAIL PROTECTED] Subject: RE: getResourceAsStream cached by Tomcat's Classloader? Are the static variables transient? If not, the session manager may persist them on a reload. [EMAIL PROTECTED] 06/05/03 9:41 AM I have tried it both ways. My notion is that it has to do with the fact that the getResourceAsStream is being called in a static method and the resulting InputStream, which is wrapped in an InputStreamReader, is passed into an object that is a static variable in my BaseDAO class. So, because the reference is at the Class level it might be holding onto it no matter what I do. If you want I can show you the code. I have some ideas. But, I'm not sure if they will work. Brandon Goodin -Original Message- From: Larry Meadors [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 8:58 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: getResourceAsStream cached by Tomcat's Classloader? Hey Brandon, Are you using this code to get a classloader? Thread.currentThread().getContextClassLoader(); If not, you are not getting tomcat's you are getting the system one. Larry [EMAIL PROTECTED] 06/05/03 8:04 AM Yes, it is closed. Brandon Goodin -Original Message- From: Dominic Parry [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 7:44 AM To: Tomcat Users List Subject: Re: getResourceAsStream cached by Tomcat's Classloader? did you close the original stream before making changes and reloading? - Original Message - From: Brandon Goodin [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, June 05, 2003 3:45 PM Subject: getResourceAsStream cached by Tomcat's Classloader? I saw a question similar to this asked in the Archives early in 2002. I didn't see a response to it. So, I hope there is an answer. I have a generic config file that is an xml file. We'll call it my-config.xml. When I load my-config.xml using Classloader.getResourceAsStream(my-config.xml) everything works great. However, when I make a change to that file and again call Classloader.getResourceAsStream(my-config.xml) the changes are not picked up and the same initial resource is returned. How do I get the Classloader to reconginze the resource changes? I'm using Tomcat 4.1.18. Brandon Goodin - To
RE: Help with registering a listener
Howdy, My web.xml starts with ?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; Do I need to change anything there? Change it to a 2.3 DTD. You can copy and paste from $CATALINA_HOME/conf/web.xml. 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]
RE: Tomcat Manager deploy and undeploy
There is nothing wrong with both of you. My interpretation is inaccurate. It should be: 1. *Tomcat Manager* deployed myapp from myapp.war 2. *Tomcat* unpacked myapp.war because unpackWar=true in server.xml Since context's docBase is the war (if deployed by *Tomcat Manager*), it makes no sense unpacking the war. -Original Message- From: Paul Christmann [mailto:[EMAIL PROTECTED] Sent: June 5, 2003 1:54 PM To: [EMAIL PROTECTED] Subject: Re: Tomcat Manager deploy and undeploy Phillip Qin wrote: - war is uploaded to $CATALINA/work/Standalone/my.host/manager; - war is unpacked into $CATALIAN_HOME/webapps/myapp; Jacob Kjome wrote: completely false I have to agree with Phillip -- I've seen (and reliably reproduced) this behavior with Tomcat 4.1.24-LE. The only way I got around problems caused by this (undeploy would not work if the app had been unpacked in the CATALINA_HOME/webapps folder, but remove would) was to modify the distributed server.xml, adding unpackWARs=false to the Host entry. I'd love to know *what* (if anything) I'm doing wrong, or have configured wrong. But I've reproduced this multiple times on 3 different Windows 2X servers with clean 4.1.24-LE installations. PC - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [SOLVED]RE: getResourceAsStream cached by Tomcat's Classloader?
Because Tomcat Manager deploys webapp from war. -Original Message- From: Brandon Goodin [mailto:[EMAIL PROTECTED] Sent: June 5, 2003 2:50 PM To: Tomcat Users List Subject: RE: [SOLVED]RE: getResourceAsStream cached by Tomcat's Classloader? Dang it! I knew it was too good to be true. Well, it works just fine for me. I do not deal with WARs. Anywyas, why would anyone want to run from a packed WAR anyways (instead of unpacked)? I'm not being sarcastic. I am just trying to think of an instance where it makes sense. Brandon Goodin -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 12:37 PM To: Tomcat Users List Subject: RE: [SOLVED]RE: getResourceAsStream cached by Tomcat's Classloader? Howdy, Please note your approach will fail when running from a packed .war file, as the new File(..) will throw an exception. This might be OK for your environment, but is important to keep in mind for portability. Yoav Shapira Millennium ChemInformatics -Original Message- From: Brandon Goodin [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 2:08 PM To: Tomcat Users List Subject: [SOLVED]RE: getResourceAsStream cached by Tomcat's Classloader? Well, here is how I solved my problem: -- code start -- String resource = my-config.xml; ClassLoader loader = Thread.currentThread().getContextClassLoader(); URL url = loader.getResource(resource); Reader reader = new FileReader( new File( url.getFile())); -- code stop -- Directly calling the getResourceAsStream failed to produce a copy of the altered config. Is this a bug? Brandon Goodin -Original Message- From: Brandon Goodin [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 11:23 AM To: Tomcat Users List Subject: RE: getResourceAsStream cached by Tomcat's Classloader? Aaaah. A man after my own heart! Keep it simple. Brandon Goodin -Original Message- From: Larry Meadors [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 11:12 AM To: [EMAIL PROTECTED] Subject: RE: getResourceAsStream cached by Tomcat's Classloader? I think you are right, but I always use Thread method because it works even in a static method - you do not need 'this' for it to work. I prefer having one way to do this instead of two - that way I can think less about how to get the CL, and more about the problem it will help me solve (and I am lazy). ;-) Larry [EMAIL PROTECTED] 06/05/03 10:58 AM Are you using this code to get a classloader? Thread.currentThread().getContextClassLoader(); If not, you are not getting tomcat's you are getting the system one. Are you sure this is true? A ClassLoader can have a parent ClassLoader. But, a class does not maintain a single copy across all ClassLoader contexts. Therefore, the Class type can exist in multiple ClassLoaders. So a Class has a reference to it's ClassLoader context when it is created. When the this.getClass().getClassLoader() is called it calls the context that the class was loaded in. I think you would have to specifically call the getParent() of the Classloader in order to go up the Classloader chain. In this situation I think Thread.currentThread().getContextClassLoader() and this.getClass().getClassLoader() will accomplish the same thing. Brandon Goodin -Original Message- From: Larry Meadors [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 9:45 AM To: [EMAIL PROTECTED] Subject: RE: getResourceAsStream cached by Tomcat's Classloader? Are the static variables transient? If not, the session manager may persist them on a reload. [EMAIL PROTECTED] 06/05/03 9:41 AM I have tried it both ways. My notion is that it has to do with the fact that the getResourceAsStream is being called in a static method and the resulting InputStream, which is wrapped in an InputStreamReader, is passed into an object that is a static variable in my BaseDAO class. So, because the reference is at the Class level it might be holding onto it no matter what I do. If you want I can show you the code. I have some ideas. But, I'm not sure if they will work. Brandon Goodin -Original Message- From: Larry Meadors [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 8:58 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: getResourceAsStream cached by Tomcat's Classloader? Hey Brandon, Are you using this code to get a classloader? Thread.currentThread().getContextClassLoader(); If not, you are not getting tomcat's you are getting the system one. Larry [EMAIL PROTECTED] 06/05/03 8:04 AM Yes, it is closed. Brandon Goodin -Original Message- From: Dominic Parry [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 7:44 AM To: Tomcat Users List Subject: Re: getResourceAsStream cached by Tomcat's Classloader? did you close the original stream before making changes and reloading? - Original Message - From: Brandon Goodin [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, June 05, 2003
RE: [SOLVED]RE: getResourceAsStream cached by Tomcat's Classloader?
packed WARs occur all the time, especially if they are inside an EAR file Filip -Original Message- From: Brandon Goodin [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 11:50 AM To: Tomcat Users List Subject: RE: [SOLVED]RE: getResourceAsStream cached by Tomcat's Classloader? Dang it! I knew it was too good to be true. Well, it works just fine for me. I do not deal with WARs. Anywyas, why would anyone want to run from a packed WAR anyways (instead of unpacked)? I'm not being sarcastic. I am just trying to think of an instance where it makes sense. Brandon Goodin -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 12:37 PM To: Tomcat Users List Subject: RE: [SOLVED]RE: getResourceAsStream cached by Tomcat's Classloader? Howdy, Please note your approach will fail when running from a packed .war file, as the new File(..) will throw an exception. This might be OK for your environment, but is important to keep in mind for portability. Yoav Shapira Millennium ChemInformatics -Original Message- From: Brandon Goodin [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 2:08 PM To: Tomcat Users List Subject: [SOLVED]RE: getResourceAsStream cached by Tomcat's Classloader? Well, here is how I solved my problem: -- code start -- String resource = my-config.xml; ClassLoader loader = Thread.currentThread().getContextClassLoader(); URL url = loader.getResource(resource); Reader reader = new FileReader( new File( url.getFile())); -- code stop -- Directly calling the getResourceAsStream failed to produce a copy of the altered config. Is this a bug? Brandon Goodin -Original Message- From: Brandon Goodin [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 11:23 AM To: Tomcat Users List Subject: RE: getResourceAsStream cached by Tomcat's Classloader? Aaaah. A man after my own heart! Keep it simple. Brandon Goodin -Original Message- From: Larry Meadors [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 11:12 AM To: [EMAIL PROTECTED] Subject: RE: getResourceAsStream cached by Tomcat's Classloader? I think you are right, but I always use Thread method because it works even in a static method - you do not need 'this' for it to work. I prefer having one way to do this instead of two - that way I can think less about how to get the CL, and more about the problem it will help me solve (and I am lazy). ;-) Larry [EMAIL PROTECTED] 06/05/03 10:58 AM Are you using this code to get a classloader? Thread.currentThread().getContextClassLoader(); If not, you are not getting tomcat's you are getting the system one. Are you sure this is true? A ClassLoader can have a parent ClassLoader. But, a class does not maintain a single copy across all ClassLoader contexts. Therefore, the Class type can exist in multiple ClassLoaders. So a Class has a reference to it's ClassLoader context when it is created. When the this.getClass().getClassLoader() is called it calls the context that the class was loaded in. I think you would have to specifically call the getParent() of the Classloader in order to go up the Classloader chain. In this situation I think Thread.currentThread().getContextClassLoader() and this.getClass().getClassLoader() will accomplish the same thing. Brandon Goodin -Original Message- From: Larry Meadors [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 9:45 AM To: [EMAIL PROTECTED] Subject: RE: getResourceAsStream cached by Tomcat's Classloader? Are the static variables transient? If not, the session manager may persist them on a reload. [EMAIL PROTECTED] 06/05/03 9:41 AM I have tried it both ways. My notion is that it has to do with the fact that the getResourceAsStream is being called in a static method and the resulting InputStream, which is wrapped in an InputStreamReader, is passed into an object that is a static variable in my BaseDAO class. So, because the reference is at the Class level it might be holding onto it no matter what I do. If you want I can show you the code. I have some ideas. But, I'm not sure if they will work. Brandon Goodin -Original Message- From: Larry Meadors [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 8:58 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: getResourceAsStream cached by Tomcat's Classloader? Hey Brandon, Are you using this code to get a classloader? Thread.currentThread().getContextClassLoader(); If not, you are not getting tomcat's you are getting the system one. Larry [EMAIL PROTECTED] 06/05/03 8:04 AM Yes, it is closed. Brandon Goodin -Original Message- From: Dominic Parry [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 7:44 AM To: Tomcat Users List Subject: Re: getResourceAsStream cached
RE: [SOLVED]RE: getResourceAsStream cached by Tomcat's Classloader?
Howdy, Dang it! I knew it was too good to be true. Well, it works just fine for me. I do not deal with WARs. Anywyas, why would anyone want to run from a packed WAR anyways (instead of unpacked)? I'm not being sarcastic. I am just trying to think of an instance where it makes sense. Two cases come to mind: - Running from a non filesystem-based server that can't unpack wars. Oracle's servlet container was like this (at least used to be), as it used the DB instead of the filesystem to serve resources. - When you want to just have one file (the .war) for your app, and you want to prohibit (for intellectual property legal protection etc.) users from examining its contents. Note that the servlet specification does not mandate filesystem support for web applications. That said, it's always a debate on whether WAR should be seen as a packaging format only, to be unpacked on the server, or an equivalent to an executable file on windows, which is one unit. 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]
Re: Sharing a connection pool among contexts
I do it in a different way : I have a servlet in charge to set all pools, and I have a class with statics methods to manage the pools, creating, test, and show their use. This class is shared with all contexts through a jar in common/lib. So I have a servlet, with all configuration of the pools in param in the web.xml. this servlet can create pools (in its init method), test and show it, and show statistics. I works great, and I can share a pool among contexts. I use the bitmechanic connection pool, a little old, but still works. http://www.bitmechanic.com/projects/jdbcpool/dist/jdbcpool-1.0b1.zip I put the jar of the pool in the common/lib dir. I f anyone is interested in the ConnectionManager, I can share it, it's an eclipse project with ant build file that generates both war and the lib jar. Hope it can help :) Emerson Scott wrote: Hi, I have configured the commons-dbcp datasource as a JNDI resource for MSSQL and Oracle and all is working as expected. However, as I understand, it is only possible to keep a factory as a resource and so a new datapool must be created everytime a JNDI lookup is done. I would like to share a single connection pool among different contexts. My first attempt was to create a listener that put a single instance of a pool into the JNDI only to find that it is read-only. For my next attempt I am thinking of creating a javabean with a static collection of datasources and name keys that can be gotten as a JNDI resource so that the different applications can just retrieve the bean and do a lookup of the datasource that way. Am I missing an easier or better way to do this? I do not have any experience with Javabeans and based on the stuff I've seen on the web beans are usually graphic oriented. Is this an appropriate use of a bean (or perhaps an Enterprise Javabean)? Thank you in advance, Scott - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Emerson Cargnin Analista de Sitemas Setor de Desenvolvimento de Sistemas - TRE-SC tel : (048) - 251-3700 - Ramal 3181 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [SOLVED]RE: getResourceAsStream cached by Tomcat'sClassloader?
Really? I guess I have seen enough right answers from you to not doubt it, but I thought that using the URL would work... Larry [EMAIL PROTECTED] 06/05/03 12:37 PM Howdy, Please note your approach will fail when running from a packed .war file, as the new File(..) will throw an exception. This might be OK for your environment, but is important to keep in mind for portability. Yoav Shapira Millennium ChemInformatics -Original Message- From: Brandon Goodin [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 2:08 PM To: Tomcat Users List Subject: [SOLVED]RE: getResourceAsStream cached by Tomcat's Classloader? Well, here is how I solved my problem: -- code start -- String resource = my-config.xml; ClassLoader loader = Thread.currentThread().getContextClassLoader(); URL url = loader.getResource(resource); Reader reader = new FileReader( new File( url.getFile())); -- code stop -- Directly calling the getResourceAsStream failed to produce a copy of the altered config. Is this a bug? Brandon Goodin -Original Message- From: Brandon Goodin [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 11:23 AM To: Tomcat Users List Subject: RE: getResourceAsStream cached by Tomcat's Classloader? Aaaah. A man after my own heart! Keep it simple. Brandon Goodin -Original Message- From: Larry Meadors [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 11:12 AM To: [EMAIL PROTECTED] Subject: RE: getResourceAsStream cached by Tomcat's Classloader? I think you are right, but I always use Thread method because it works even in a static method - you do not need 'this' for it to work. I prefer having one way to do this instead of two - that way I can think less about how to get the CL, and more about the problem it will help me solve (and I am lazy). ;-) Larry [EMAIL PROTECTED] 06/05/03 10:58 AM Are you using this code to get a classloader? Thread.currentThread().getContextClassLoader(); If not, you are not getting tomcat's you are getting the system one. Are you sure this is true? A ClassLoader can have a parent ClassLoader. But, a class does not maintain a single copy across all ClassLoader contexts. Therefore, the Class type can exist in multiple ClassLoaders. So a Class has a reference to it's ClassLoader context when it is created. When the this.getClass().getClassLoader() is called it calls the context that the class was loaded in. I think you would have to specifically call the getParent() of the Classloader in order to go up the Classloader chain. In this situation I think Thread.currentThread().getContextClassLoader() and this.getClass().getClassLoader() will accomplish the same thing. Brandon Goodin -Original Message- From: Larry Meadors [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 9:45 AM To: [EMAIL PROTECTED] Subject: RE: getResourceAsStream cached by Tomcat's Classloader? Are the static variables transient? If not, the session manager may persist them on a reload. [EMAIL PROTECTED] 06/05/03 9:41 AM I have tried it both ways. My notion is that it has to do with the fact that the getResourceAsStream is being called in a static method and the resulting InputStream, which is wrapped in an InputStreamReader, is passed into an object that is a static variable in my BaseDAO class. So, because the reference is at the Class level it might be holding onto it no matter what I do. If you want I can show you the code. I have some ideas. But, I'm not sure if they will work. Brandon Goodin -Original Message- From: Larry Meadors [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 8:58 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: getResourceAsStream cached by Tomcat's Classloader? Hey Brandon, Are you using this code to get a classloader? Thread.currentThread().getContextClassLoader(); If not, you are not getting tomcat's you are getting the system one. Larry [EMAIL PROTECTED] 06/05/03 8:04 AM Yes, it is closed. Brandon Goodin -Original Message- From: Dominic Parry [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 7:44 AM To: Tomcat Users List Subject: Re: getResourceAsStream cached by Tomcat's Classloader? did you close the original stream before making changes and reloading? - Original Message - From: Brandon Goodin [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, June 05, 2003 3:45 PM Subject: getResourceAsStream cached by Tomcat's Classloader? I saw a question similar to this asked in the Archives early in 2002. I didn't see a response to it. So, I hope there is an answer. I have a generic config file that is an xml file. We'll call it my-config.xml. When I load my-config.xml using Classloader.getResourceAsStream(my-config.xml) everything works great. However, when I make a change to that file and again call Classloader.getResourceAsStream(my-config.xml) the changes are not picked up and the same initial resource is returned. How do I get the
Re: Startup error
FWIW. RH 8.0 'Server' install also had this problem. I had to install 'compat-libstdc++-7.3-2.96.110.i386.rpm' by hand (off the installation CDs). Workstation install was fine (already did it I guess. Looks like RH 9 has the same quirk? tim Luc Foisy wrote: Nobody can point me in the right direction? Would this be the right RPM to fix this? libstdc++-3.2.2-5.i386.rpm OR this? glibc-2.3.2-11.9.i686.rpm (this package supplies libc.so.6, that that what I need) I am lost here, every other install of tomcat that I have done was fine. I am thinking when I installed Netscape or Mozilla it installed the needed stuff, but I did't install them this time, and don't think I want to. I just want the right package... Hmm.. I found this one now. can someone confirm if this is what I need? Standard C++ libraries for Red Hat 7.3 backwards compatibility compiler RedHat-9 for i386 compat-libstdc++-7.3-2.96.118.i386.rpm Thanks for looking at my ramblings :) -Original Message- From: Luc Foisy Sent: Wednesday, June 04, 2003 9:03 AM To: Tomcat User List (E-mail) Subject: Startup error I am getting the following error in my catalina.out Error: failed /usr/java/j2sdk1.4.0_03/jre/lib/i386/client/libjvm.so, because libstdc++-libc6.1-1.so.2: cannot open shared object file: No such file or directory I am using RedHat 9.0 Which package do I need to install to get this to function? - 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: [SOLVED]RE: getResourceAsStream cached by Tomcat's Classloader?
I checked out tomcat from the HEAD and found the following information in the WebAppClassloader: I see now that the WebAppClassLoader does intend to have a cache for the loaded Resources (some day). code snip WebappClassLoader - Line 1211 ... // (0) Check for a cached copy of this resource stream = findLoadedResource(name); ... code snip It does this by examining the ResourcEntry(s) in the resourceEntries Hashmap and checking binaryContent (null vs not null). code snip WebappClassLoader - Line 1898 ... /** * Finds the resource with the given name if it has previously been * loaded and cached by this class loader, and return an input stream * to the resource data. If this resource has not been cached, return * codenull/code. * * @param name Name of the resource to return */ protected InputStream findLoadedResource(String name) { ResourceEntry entry = (ResourceEntry) resourceEntries.get(name); if (entry != null) { if (entry.binaryContent != null) return new ByteArrayInputStream(entry.binaryContent); } return (null); } } ... code snip But, there is no caching going on when the resources are loaded. So, the code is executing with no purpose? Matter of fact the code has //FIX ME cache??? statements intermingled with the ClassLoader delegation. code snip WebappClassLoader - Line 1219 ... // (1) Delegate to parent if requested if (delegate) { if (debug = 3) log( Delegating to parent classloader); ClassLoader loader = parent; if (loader == null) loader = system; stream = loader.getResourceAsStream(name); if (stream != null) { // FIXME - cache??? if (debug = 2) log( -- Returning stream from parent); return (stream); } } // (2) Search local repositories if (debug = 3) log( Searching local repositories); URL url = findResource(name); if (url != null) { // FIXME - cache??? if (debug = 2) log( -- Returning stream from local); stream = findLoadedResource(name); try { if (hasExternalRepositories (stream == null)) stream = url.openStream(); } catch (IOException e) { ; // Ignore } if (stream != null) return (stream); } // (3) Delegate to parent unconditionally if (!delegate) { if (debug = 3) log( Delegating to parent classloader); ClassLoader loader = parent; if (loader == null) loader = system; stream = loader.getResourceAsStream(name); if (stream != null) { // FIXME - cache??? if (debug = 2) log( -- Returning stream from parent); return (stream); } } // (4) Resource was not found if (debug = 2) log( -- Resource not found, returning null); return (null); ... code snip --- So there are three things that I can conclude as a result of seeing this code. 1) My getResourceAsStream loading problems are NOT caused by Tomcat because Tomcat is grabbing the resource fresh each time. 2) Resource caching still needs to be implemented in Tomcat 3) The caching check in Tomcat does not check resource Timestamps. So, even if the cache was working it would not reload resources upon file changes. (only binaryContent is being checked. eg null or not null). Are my observations correct? Brandon Goodin -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 12:49 PM To: Tomcat Users List Subject: RE: [SOLVED]RE: getResourceAsStream cached by Tomcat's Classloader? Howdy, Dang it! I knew it was too good to be true. Well, it works just fine for me. I do not deal with WARs. Anywyas, why would anyone want to run from a packed WAR anyways (instead of unpacked)? I'm not being sarcastic. I am just trying to think of an instance where it makes sense. Two cases come to mind: - Running from a non filesystem-based server that can't unpack wars. Oracle's servlet container was like this (at least used to be), as it used the DB instead of the filesystem to serve resources. - When you want to just have one file (the .war) for your app, and you want to prohibit (for intellectual property legal protection etc.) users from examining its contents. Note that the servlet specification does not mandate filesystem support for web applications. That said, it's always a debate on whether WAR should be seen as a packaging format only, to be unpacked on the server, or an equivalent to an executable file on windows, which is one unit. 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
Re: Startup error
I didn't encounter it with RH 9, but I think I did a custom install. John On Thu, 05 Jun 2003 20:41:34 +0100, Tim Shaw [EMAIL PROTECTED] wrote: FWIW. RH 8.0 'Server' install also had this problem. I had to install 'compat-libstdc++-7.3-2.96.110.i386.rpm' by hand (off the installation CDs). Workstation install was fine (already did it I guess. Looks like RH 9 has the same quirk? tim Luc Foisy wrote: Nobody can point me in the right direction? Would this be the right RPM to fix this? libstdc++-3.2.2-5.i386.rpm OR this? glibc-2.3.2-11.9.i686.rpm (this package supplies libc.so.6, that that what I need) I am lost here, every other install of tomcat that I have done was fine. I am thinking when I installed Netscape or Mozilla it installed the needed stuff, but I did't install them this time, and don't think I want to. I just want the right package... Hmm.. I found this one now. can someone confirm if this is what I need? Standard C++ libraries for Red Hat 7.3 backwards compatibility compiler RedHat-9 for i386 compat-libstdc++-7.3-2.96.118.i386.rpm Thanks for looking at my ramblings :) -Original Message- From: Luc Foisy Sent: Wednesday, June 04, 2003 9:03 AM To: Tomcat User List (E-mail) Subject: Startup error I am getting the following error in my catalina.out Error: failed /usr/java/j2sdk1.4.0_03/jre/lib/i386/client/libjvm.so, because libstdc++-libc6.1-1.so.2: cannot open shared object file: No such file or directory I am using RedHat 9.0 Which package do I need to install to get this to function? - 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] -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [SOLVED]RE: getResourceAsStream cached by Tomcat'sClassloader?
Howdy, Seeing your comment made me think twice, and then test it out... And I was wrong! The code below works even in a packed .war it seems. (Tomcat 4.1.24, JDK 1.4.1, Solaris 8, autoDeploy=false, unpackWARS=false, test.war attached). Sorry about that -- my mistake. Yoav Shapira Millennium ChemInformatics -Original Message- From: Larry Meadors [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 3:38 PM To: [EMAIL PROTECTED] Subject: RE: [SOLVED]RE: getResourceAsStream cached by Tomcat'sClassloader? Really? I guess I have seen enough right answers from you to not doubt it, but I thought that using the URL would work... Larry [EMAIL PROTECTED] 06/05/03 12:37 PM Howdy, Please note your approach will fail when running from a packed .war file, as the new File(..) will throw an exception. This might be OK for your environment, but is important to keep in mind for portability. Yoav Shapira Millennium ChemInformatics -Original Message- From: Brandon Goodin [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 2:08 PM To: Tomcat Users List Subject: [SOLVED]RE: getResourceAsStream cached by Tomcat's Classloader? Well, here is how I solved my problem: -- code start -- String resource = my-config.xml; ClassLoader loader = Thread.currentThread().getContextClassLoader(); URL url = loader.getResource(resource); Reader reader = new FileReader( new File( url.getFile())); -- code stop -- Directly calling the getResourceAsStream failed to produce a copy of the altered config. Is this a bug? Brandon Goodin -Original Message- From: Brandon Goodin [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 11:23 AM To: Tomcat Users List Subject: RE: getResourceAsStream cached by Tomcat's Classloader? Aaaah. A man after my own heart! Keep it simple. Brandon Goodin -Original Message- From: Larry Meadors [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 11:12 AM To: [EMAIL PROTECTED] Subject: RE: getResourceAsStream cached by Tomcat's Classloader? I think you are right, but I always use Thread method because it works even in a static method - you do not need 'this' for it to work. I prefer having one way to do this instead of two - that way I can think less about how to get the CL, and more about the problem it will help me solve (and I am lazy). ;-) Larry [EMAIL PROTECTED] 06/05/03 10:58 AM Are you using this code to get a classloader? Thread.currentThread().getContextClassLoader(); If not, you are not getting tomcat's you are getting the system one. Are you sure this is true? A ClassLoader can have a parent ClassLoader. But, a class does not maintain a single copy across all ClassLoader contexts. Therefore, the Class type can exist in multiple ClassLoaders. So a Class has a reference to it's ClassLoader context when it is created. When the this.getClass().getClassLoader() is called it calls the context that the class was loaded in. I think you would have to specifically call the getParent() of the Classloader in order to go up the Classloader chain. In this situation I think Thread.currentThread().getContextClassLoader() and this.getClass().getClassLoader() will accomplish the same thing. Brandon Goodin -Original Message- From: Larry Meadors [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 9:45 AM To: [EMAIL PROTECTED] Subject: RE: getResourceAsStream cached by Tomcat's Classloader? Are the static variables transient? If not, the session manager may persist them on a reload. [EMAIL PROTECTED] 06/05/03 9:41 AM I have tried it both ways. My notion is that it has to do with the fact that the getResourceAsStream is being called in a static method and the resulting InputStream, which is wrapped in an InputStreamReader, is passed into an object that is a static variable in my BaseDAO class. So, because the reference is at the Class level it might be holding onto it no matter what I do. If you want I can show you the code. I have some ideas. But, I'm not sure if they will work. Brandon Goodin -Original Message- From: Larry Meadors [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 8:58 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: getResourceAsStream cached by Tomcat's Classloader? Hey Brandon, Are you using this code to get a classloader? Thread.currentThread().getContextClassLoader(); If not, you are not getting tomcat's you are getting the system one. Larry [EMAIL PROTECTED] 06/05/03 8:04 AM Yes, it is closed. Brandon Goodin -Original Message- From: Dominic Parry [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 7:44 AM To: Tomcat Users List Subject: Re: getResourceAsStream cached by Tomcat's Classloader? did you close the original stream before making changes and reloading? - Original Message - From: Brandon Goodin [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, June 05, 2003 3:45 PM Subject: getResourceAsStream cached by Tomcat's Classloader?
help with SEVERE: Exception starting filter Set Character Encoding
Hi, I get the error SEVERE: Exception starting filter Set Character Encoding java.lang.ClassNotFoundException: filters.SetCharacterEncodingFilter when I start tomcat (see below). My environment is AIX 5.1: I loaded Java 2 SDK 1.4 (port for aix from ibm website) and tomcat 5.0 from apache website (no aix port available from ibm). Anyone know what am I missing? Or is this config unworkable? p.s. tomcat runs, i can access admin and manger apps but the jsp examples and servlet examples fail # catalina.sh run Using CATALINA_BASE: /usr/jakarta-tomcat-5.0.2 Using CATALINA_HOME: /usr/jakarta-tomcat-5.0.2 Using CATALINA_TMPDIR: /usr/jakarta-tomcat-5.0.2/temp Using JAVA_HOME: /usr/java14 Jun 5, 2003 2:25:38 PM org.apache.commons.modeler.modules.MbeansDescriptorsDOMSource execute INFO: Reading descriptors ( dom ) 1177 Jun 5, 2003 2:25:38 PM org.apache.commons.modeler.modules.MbeansDescriptorsDOMSource execute INFO: Reading descriptors ( dom ) 249 Jun 5, 2003 2:25:39 PM org.apache.commons.modeler.modules.MbeansDescriptorsDOMSource execute INFO: Reading descriptors ( dom ) 698 Jun 5, 2003 2:25:39 PM org.apache.commons.modeler.modules.MbeansDescriptorsDOMSource execute INFO: Reading descriptors ( dom ) 89 Jun 5, 2003 2:25:40 PM org.apache.commons.modeler.modules.MbeansDescriptorsDOMSource execute INFO: Reading descriptors ( dom ) 604 Jun 5, 2003 2:25:40 PM org.apache.commons.modeler.modules.MbeansDescriptorsDOMSource execute INFO: Reading descriptors ( dom ) 53 Jun 5, 2003 2:25:40 PM org.apache.commons.modeler.modules.MbeansDescriptorsDOMSource execute INFO: Reading descriptors ( dom ) 113 Jun 5, 2003 2:25:40 PM org.apache.commons.modeler.modules.MbeansDescriptorsDOMSource execute INFO: Reading descriptors ( dom ) 313 Jun 5, 2003 2:25:40 PM org.apache.commons.modeler.modules.MbeansDescriptorsDOMSource execute INFO: Reading descriptors ( dom ) 57 Jun 5, 2003 2:25:41 PM org.apache.commons.modeler.modules.MbeansDescriptorsDOMSource execute INFO: Reading descriptors ( dom ) 25 Jun 5, 2003 2:25:41 PM org.apache.commons.modeler.modules.MbeansDescriptorsDOMSource execute INFO: Reading descriptors ( dom ) 65 Jun 5, 2003 2:25:41 PM org.apache.commons.modeler.modules.MbeansDescriptorsDOMSource execute INFO: Reading descriptors ( dom ) 44 Jun 5, 2003 2:25:41 PM org.apache.commons.modeler.modules.MbeansDescriptorsDOMSource execute INFO: Reading descriptors ( dom ) 33 Jun 5, 2003 2:25:44 PM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on port 8080 Jun 5, 2003 2:25:44 PM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 9354 ms Jun 5, 2003 2:25:45 PM org.apache.catalina.core.StandardService start INFO: Starting service Catalina Jun 5, 2003 2:25:45 PM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/5.0.2 Jun 5, 2003 2:25:46 PM org.apache.catalina.core.StandardHost getDeployer INFO: Create Host deployer for direct deployment ( non-jmx ) Jun 5, 2003 2:25:52 PM org.apache.struts.util.PropertyMessageResources init INFO: Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true Jun 5, 2003 2:25:52 PM org.apache.struts.util.PropertyMessageResources init INFO: Initializing, config='org.apache.struts.action.ActionResources', returnNull=true Jun 5, 2003 2:25:57 PM org.apache.struts.util.PropertyMessageResources init INFO: Initializing, config='org.apache.webapp.admin.ApplicationResources', returnNull=true Jun 5, 2003 2:25:57 PM org.apache.catalina.core.StandardHostDeployer install INFO: Installing web application at context path /tomcat-docs from URL file:/usr/jakarta-tomcat-5.0.2/webapps/tomcat-docs Jun 5, 2003 2:25:58 PM org.apache.catalina.core.StandardHostDeployer install INFO: Installing web application at context path /jsp-examples from URL file:/usr/jakarta-tomcat-5.0.2/webapps/jsp-examples Jun 5, 2003 2:26:00 PM org.apache.catalina.core.StandardHostDeployer install INFO: Installing web application at context path /servlets-examples from URL file:/usr/jakarta-tomcat-5.0.2/webapps/servlets-examples Jun 5, 2003 2:26:02 PM org.apache.catalina.core.StandardContext filterStart SEVERE: Exception starting filter Set Character Encoding java.lang.ClassNotFoundException: filters.SetCharacterEncodingFilter at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1327) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1174) at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:257) at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:352) at org.apache.catalina.core.ApplicationFilterConfig.init(ApplicationFilterConfig.java:125) at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3559) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4112) at
JDBC and MS Access DB connectivity.
I'm trying to use DataSource objects (eventually connection pooling) with MS Access Database. My question is, do we have to have an ODBC-JDBC Bridge driver in place in $CATALINA_HOME/common/lib/ location for using javax.sql.DataSource objects to create connections to the database. If so, where do I get this jar file for the driver? cheers Hassan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: help with SEVERE: Exception starting filter Set Character Encoding
Howdy, I get the error SEVERE: Exception starting filter Set Character Encoding java.lang.ClassNotFoundException: filters.SetCharacterEncodingFilter when I start tomcat (see below). Do you have this class anywhere in your distribution? I loaded Java 2 SDK 1.4 (port for aix from ibm website) and tomcat 5.0 from apache website (no aix port available from ibm). Tomcat 5.x is alpha-quality. The examples in particular (which both the ContentEncoding and the Compression filters are) are not perfect yet. Comment these two filters out of the examples web.xml if you want to see the rest of the examples. If you need a stable environment, I suggest you try tomcat 4.1.24. Out of curiosity, why would you expect an AIX port of tomcat from IBM (or anyone else)? Tomcat is pure Java -- there's no more AIX port than Solaris port ;) 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]
RE: Startup error
I bet the workstation install worked because it installed Netscape or Mozilla in the newer versions. So it is in fact the compatibility rpm, thanks -Original Message- From: Tim Shaw [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 3:42 PM To: Tomcat Users List Subject: Re: Startup error FWIW. RH 8.0 'Server' install also had this problem. I had to install 'compat-libstdc++-7.3-2.96.110.i386.rpm' by hand (off the installation CDs). Workstation install was fine (already did it I guess. Looks like RH 9 has the same quirk? tim Luc Foisy wrote: Nobody can point me in the right direction? Would this be the right RPM to fix this? libstdc++-3.2.2-5.i386.rpm OR this? glibc-2.3.2-11.9.i686.rpm (this package supplies libc.so.6, that that what I need) I am lost here, every other install of tomcat that I have done was fine. I am thinking when I installed Netscape or Mozilla it installed the needed stuff, but I did't install them this time, and don't think I want to. I just want the right package... Hmm.. I found this one now. can someone confirm if this is what I need? Standard C++ libraries for Red Hat 7.3 backwards compatibility compiler RedHat-9 for i386 compat-libstdc++-7.3-2.96.118.i386.rpm Thanks for looking at my ramblings :) -Original Message- From: Luc Foisy Sent: Wednesday, June 04, 2003 9:03 AM To: Tomcat User List (E-mail) Subject: Startup error I am getting the following error in my catalina.out Error: failed /usr/java/j2sdk1.4.0_03/jre/lib/i386/client/libjvm.so, because libstdc++-libc6.1-1.so.2: cannot open shared object file: No such file or directory I am using RedHat 9.0 Which package do I need to install to get this to function? - 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]
[OFF-TOPIC] Re: JDBC and MS Access DB connectivity.
MS Access = bad bridge driver = bad If you must use MS Access, you will need a bridge driver. The best you can do is a Type 3 driver, like the one at easysoft.com. If that isn't an option, the Type 1 bridge driver is part of the Java 2 SDK: package sun.jdbc.odbc. Check the SDK docs. John On Thu, 5 Jun 2003 21:26:32 +0100, Hassan [EMAIL PROTECTED] wrote: I'm trying to use DataSource objects (eventually connection pooling) with MS Access Database. My question is, do we have to have an ODBC-JDBC Bridge driver in place in $CATALINA_HOME/common/lib/ location for using javax.sql.DataSource objects to create connections to the database. If so, where do I get this jar file for the driver? cheers Hassan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: help with SEVERE: Exception starting filter Set Character Encoding
Hi, firstly, thanks for the quick response. Let me answer you last comment first re Out of curiosity, why would you expect an AIX port of tomcat from IBM (or anyone else)? Tomcat is pure Java -- there's no more AIX port than Solaris port ;) Here's what led me to believe I need to put down the ibm SDK port http://java.sun.com/cgi-bin/java-ports.cgi Also this comment AIX SDK 1.4 - A beta version of IBM's AIX port of Java 2 SDK, Standard Edition, Version 1.4.0. on IBM's website http://www.alphaworks.ibm.com/nav/Java?openc=Java+-+Developer+Kits Can I infer from your comment that I should just load the sdk directly from Sun rather than the port and then load tomcat 4.1.24 Thanks again, Ian - Original Message - From: Shapira, Yoav [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Thursday, June 05, 2003 3:31 PM Subject: RE: help with SEVERE: Exception starting filter Set Character Encoding Howdy, I get the error SEVERE: Exception starting filter Set Character Encoding java.lang.ClassNotFoundException: filters.SetCharacterEncodingFilter when I start tomcat (see below). Do you have this class anywhere in your distribution? I loaded Java 2 SDK 1.4 (port for aix from ibm website) and tomcat 5.0 from apache website (no aix port available from ibm). Tomcat 5.x is alpha-quality. The examples in particular (which both the ContentEncoding and the Compression filters are) are not perfect yet. Comment these two filters out of the examples web.xml if you want to see the rest of the examples. If you need a stable environment, I suggest you try tomcat 4.1.24. Out of curiosity, why would you expect an AIX port of tomcat from IBM (or anyone else)? Tomcat is pure Java -- there's no more AIX port than Solaris port ;) 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: help with SEVERE: Exception starting filter Set Character Encoding
It would be handy if I read you comment properly, I see you were refering to Tomcat not the SDK. Sorry - Ian - Original Message - From: Ian Warner [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Thursday, June 05, 2003 4:01 PM Subject: Re: help with SEVERE: Exception starting filter Set Character Encoding Hi, firstly, thanks for the quick response. Let me answer you last comment first re Out of curiosity, why would you expect an AIX port of tomcat from IBM (or anyone else)? Tomcat is pure Java -- there's no more AIX port than Solaris port ;) Here's what led me to believe I need to put down the ibm SDK port http://java.sun.com/cgi-bin/java-ports.cgi Also this comment AIX SDK 1.4 - A beta version of IBM's AIX port of Java 2 SDK, Standard Edition, Version 1.4.0. on IBM's website http://www.alphaworks.ibm.com/nav/Java?openc=Java+-+Developer+Kits Can I infer from your comment that I should just load the sdk directly from Sun rather than the port and then load tomcat 4.1.24 Thanks again, Ian - Original Message - From: Shapira, Yoav [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Thursday, June 05, 2003 3:31 PM Subject: RE: help with SEVERE: Exception starting filter Set Character Encoding Howdy, I get the error SEVERE: Exception starting filter Set Character Encoding java.lang.ClassNotFoundException: filters.SetCharacterEncodingFilter when I start tomcat (see below). Do you have this class anywhere in your distribution? I loaded Java 2 SDK 1.4 (port for aix from ibm website) and tomcat 5.0 from apache website (no aix port available from ibm). Tomcat 5.x is alpha-quality. The examples in particular (which both the ContentEncoding and the Compression filters are) are not perfect yet. Comment these two filters out of the examples web.xml if you want to see the rest of the examples. If you need a stable environment, I suggest you try tomcat 4.1.24. Out of curiosity, why would you expect an AIX port of tomcat from IBM (or anyone else)? Tomcat is pure Java -- there's no more AIX port than Solaris port ;) 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OFF-TOPIC] Re: JDBC and MS Access DB connectivity.
On Fri, 6 Jun 2003 04:48, John Turner wrote: MS Access = bad bridge driver = bad Couldn't have said it better myself... Is there any reason you must use MS Access? I highly recommend that you use MySQL or Postgres instead, they are much better solutions and give you a type 4 jdbc driver you can use. If you are tied into using some MS Access forms or reports, there is no reason you can't keep them and point them at a MySQL database, I believe that sort of thing is done quite commonly but I have never done so myself. Regards, -- Jason Bainbridge http://jblinux.org - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OFF-TOPIC] Re: JDBC and MS Access DB connectivity.
Hi John, From the functional specs on http://industry.java.sun.com/products/jdbc/drivers, EasySoft's driver does not support DataSources! From Tomcat 4 documentation, it appears as you need to have a jar file (physical copy) of the driver placed in common/lib directory in order for Tomcat to set its classpath. Is this the case for built in generic drivers also, such as sun.jdbc.odbc. I'm getting the error ' Driver not found in the classpath.' when I try DataSource mechanism. Hassan - Original Message - From: John Turner [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Thursday, June 05, 2003 9:48 PM Subject: [OFF-TOPIC] Re: JDBC and MS Access DB connectivity. MS Access = bad bridge driver = bad If you must use MS Access, you will need a bridge driver. The best you can do is a Type 3 driver, like the one at easysoft.com. If that isn't an option, the Type 1 bridge driver is part of the Java 2 SDK: package sun.jdbc.odbc. Check the SDK docs. John On Thu, 5 Jun 2003 21:26:32 +0100, Hassan [EMAIL PROTECTED] wrote: I'm trying to use DataSource objects (eventually connection pooling) with MS Access Database. My question is, do we have to have an ODBC-JDBC Bridge driver in place in $CATALINA_HOME/common/lib/ location for using javax.sql.DataSource objects to create connections to the database. If so, where do I get this jar file for the driver? cheers Hassan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/ - 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]
RES: Sharing a connection pool among contexts
I do it in another different way: First - I have a JavaBean that sets my connection pools Second - My main servlet' init method uses this Java Bean instance to get an data source pool object Third - create my sql... I guess it's right. Euclides. -Mensagem original- De: Emerson Cargnin [mailto:[EMAIL PROTECTED] Enviada em: quinta-feira, 5 de junho de 2003 16:42 Para: Tomcat Users List Assunto: Re: Sharing a connection pool among contexts I do it in a different way : I have a servlet in charge to set all pools, and I have a class with statics methods to manage the pools, creating, test, and show their use. This class is shared with all contexts through a jar in common/lib. So I have a servlet, with all configuration of the pools in param in the web.xml. this servlet can create pools (in its init method), test and show it, and show statistics. I works great, and I can share a pool among contexts. I use the bitmechanic connection pool, a little old, but still works. http://www.bitmechanic.com/projects/jdbcpool/dist/jdbcpool-1.0b1.zip I put the jar of the pool in the common/lib dir. I f anyone is interested in the ConnectionManager, I can share it, it's an eclipse project with ant build file that generates both war and the lib jar. Hope it can help :) Emerson Scott wrote: Hi, I have configured the commons-dbcp datasource as a JNDI resource for MSSQL and Oracle and all is working as expected. However, as I understand, it is only possible to keep a factory as a resource and so a new datapool must be created everytime a JNDI lookup is done. I would like to share a single connection pool among different contexts. My first attempt was to create a listener that put a single instance of a pool into the JNDI only to find that it is read-only. For my next attempt I am thinking of creating a javabean with a static collection of datasources and name keys that can be gotten as a JNDI resource so that the different applications can just retrieve the bean and do a lookup of the datasource that way. Am I missing an easier or better way to do this? I do not have any experience with Javabeans and based on the stuff I've seen on the web beans are usually graphic oriented. Is this an appropriate use of a bean (or perhaps an Enterprise Javabean)? Thank you in advance, Scott - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Emerson Cargnin Analista de Sitemas Setor de Desenvolvimento de Sistemas - TRE-SC tel : (048) - 251-3700 - Ramal 3181 - 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: [OFF-TOPIC] Re: JDBC and MS Access DB connectivity.
Hi Jason, Your advise sounds very interesting and i'll look into the MySQL database to check the available possibilities. The only reason I'm using Access is that my current staff is affluent in that. Hassan - Original Message - From: Jason Bainbridge [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Thursday, June 05, 2003 10:06 PM Subject: Re: [OFF-TOPIC] Re: JDBC and MS Access DB connectivity. On Fri, 6 Jun 2003 04:48, John Turner wrote: MS Access = bad bridge driver = bad Couldn't have said it better myself... Is there any reason you must use MS Access? I highly recommend that you use MySQL or Postgres instead, they are much better solutions and give you a type 4 jdbc driver you can use. If you are tied into using some MS Access forms or reports, there is no reason you can't keep them and point them at a MySQL database, I believe that sort of thing is done quite commonly but I have never done so myself. Regards, -- Jason Bainbridge http://jblinux.org - 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: [OFF-TOPIC] Re: JDBC and MS Access DB connectivity.
On Fri, 6 Jun 2003 05:37, Hassan wrote: Your advise sounds very interesting and i'll look into the MySQL database to check the available possibilities. The only reason I'm using Access is that my current staff is affluent in that. This is getting further off-topic but if it leads to one less use of MS Access then it is worth it... You should look at PHPMyAdmin to help your staff make the move to MySQL, I am often amazed at how good of a tool it is and I always loathe going back to SQL Server's Enterprise Manager afterwards... Regards, -- Jason Bainbridge http://jblinux.org - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Sun JVM vs. JRockit
Info for those interested in benchmarking Tomcat + JVM. Original configuration: Windows 2000. 256 MB Ram JVM: 1.3.1 Tomcat 4.0.4 with Jasper2 Application is struts based (1.0.2) This server was upgraded to Tomcat 4.1.24 and JDK 1.4.1 After having set up everything, I realized that the performance had drop considerably. For example, a request to the same page (20 threads) before the upgrade was producing 6.5 pages/sec. After the upgrade to Tomcat 4.1.24 and JDK 1.4.1 the performance was 4.3 pages/sec. Since I was't sure what was producing this performance degradation, I started to experiment with JDBC, Connectors, etc, but no change. Only when I degraded the JVM to 1.3.1, the performance went up to 8 pages/sec. Since our next release of the application uses features from JDK 1.4.1, I could not stay in JDK 1.3.1. So I decided to try BEA's JRockit 8.1 which complies with Sun's JDK 1.4.1. The performance improved greatly to 14 pages/sec. The problem now was that I could not run Tomcat as an NT service using JRockit. The service would start, but after a few seconds, it would die abruptly. No errors reported. I saw one posting in this list with the same problem, but no solution. So I decided to install the Java Service Wrapper (http://wrapper.tanukisoftware.org/) After setting it up, I was able to run Tomcat with JRockit as an NT service. So far it looks really promising. We will conduct some more testing during the rest of the week and hopefully install this configuration in our production servers next week. Regards Victor - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
mod_jk2 and shm
I keep getting errors like the following from my mod_jk2 installation. Everything seems to work fine but my apache_error log has errors relating to the shm worker which I don't even configure in workers.properties since I don't see that it's in any way required for a simple channel.socket configuration. My load balancing through Apache seems to work fine too so I'm pretty confused. I've inlined the errors followed by OS and Apache information followed by my workers2.properties. I'm using Tomcat 4.1.24. Should I be configuring Apache to use an on-disk scoreboard file and should I be configuring the shm worker to point to that file? I've tried this and the shm.init(): No file error goes away but that's it. Thanks ahead of time for the help! Jamey ** ** apache_error.log ** ** [Thu Jun 05 13:54:45 2003] [error] shm.init(): No file [Thu Jun 05 13:54:45 2003] [notice] workerEnv.init() ok /home/jamey/cvs/inunison /pt30/server/conf/workers2.properties [Thu Jun 05 13:54:45 2003] [error] mod_jk child init 1 -2 [Thu Jun 05 13:54:46 2003] [error] jk2_init() Can't find child 11023 in scoreboa rd * ** OS Info ** * SunOS viagra 5.8 Generic_108528-19 sun4u sparc SUNW,Ultra-60 Solaris * ** Apache Info ** * Server version: Apache/2.0.45 Server built: May 8 2003 09:58:18 Server's Module Magic Number: 20020903:0 Architecture: 32-bit Server compiled with -D APACHE_MPM_DIR=server/mpm/worker -D APR_HAS_MMAP -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled) -D APR_USE_PROC_PTHREAD_SERIALIZE -D APR_USE_PTHREAD_SERIALIZE -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT -D APR_HAS_OTHER_CHILD -D AP_HAVE_RELIABLE_PIPED_LOGS -D HTTPD_ROOT=/apps/apache/2.0.45 -D SUEXEC_BIN=/apps/apache/2.0.45/bin/suexec -D DEFAULT_SCOREBOARD=logs/apache_runtime_status -D DEFAULT_ERRORLOG=logs/error_log -D AP_TYPES_CONFIG_FILE=conf/mime.types -D SERVER_CONFIG_FILE=conf/httpd.conf * ** workers2.properties ** * # only at beginning. In production comment it out [logger.apache2] level=DEBUG # First socket channel, override port and host. [channel.socket:localhost:6670] host=localhost port=6670 tomcatId=localhost group=lb:balanced # Define the first worker [ajp13:localhost:6670] channel=channel.socket:localhost:6670 # Define a status worker [status:stat] # URI mapping [uri:/*] group=ajp13:localhost:6670 # Status URI mapping (should not be publicly accessible!!!) [uri:/jk2status] group=status:stat - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: JSTL and EL question - SOLVED
The jar file is not encrypted, it's just a zip file. Look in the META-INF directory for a .tld file. This file will also tell you what URI you need to use in the uri attribute of the taglib directive in your JSP page. -Original Message- From: Schwartz, David (CHR) [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 8:37 AM To: 'Tomcat Users List' Subject: RE: JSTL and EL question - SOLVED Thats a great idea much easier to implement. How can I determine if the jar file has the tld? More specifically, I'm using the jakarta dbtags. do they package it that way? -Original Message- From: Karr, David [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 11:21 AM To: Tomcat Users List Subject: RE: JSTL and EL question - SOLVED The setup can be a little simpler than this. The taglib jar can contain the TLD for the taglib in the META-INF directory of the jar. If it is present there, you do not have to deploy the TLD separately. In addition, if the TLD is present there, you do not have to have the explicit taglib map in your web.xml file. In this case, your taglib directive in the JSP page needs to specify the URI that is specified in the TLD in the taglib jar file, which is hopefully documented in the taglib documentation (so you don't have to open the file in the jar file). If this is done correctly, you can skip steps 2 and 3 of this process. -Original Message- From: Nikola Milutinovic [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 04, 2003 10:21 PM To: Tomcat Users List Subject: Re: JSTL and EL question - SOLVED I thought I liked the idea of having the taglib in the web.xml file. When I try it I'm getting This absolute uri (http://java.sun.com/jstl/core) cannot be resolved in either web.xml or the jar files deployed with this application. Do I have to download it somewhere in order to use it in the web.xml file? Any ideas? :-) OK, four things when dealing with ANY tag library: 1. PLACE JAR FILES Place JAR files that hold implementation of the tag library in a directory where Tomcat will pick it up. Either make it WEB-INF/lib/ (private) or ${CATALINA_HOME}/shared/lib (all web-apps will have access to it). You could place it in ${CATALINA_HOME}/common/lib, but I don't see the point in Tomcat having access to those JARs. There was a discussion recently naming pros/cons of each choice (Craig), so look up the archives. 2. PLACE TLD Place TLD files (Tag Library Descriptor) in either WEB-INF/ or (if I recall correctly) WEB-INF/taglibs/. The first placement will require for location in web.xml file to be absolute: /WEB-INF/name.tld, while the second will allow for relative links: name.tld 3. DECLARE TLD IN WEB.XML This part you've already seen. taglib taglib-urihttp://java.sun.com/jstl/core/taglib-uri taglib-location/WEB-INF/c.tld/taglib-location /taglib 4. DECLARE TLD USAGE IN JSP This you've seen %@ taglib uri=http://java.sun.com/jstl/core; prefix=c % The prefix is up to you. Nix. - 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]
get some manners
now all i managed to do is get these condescending nasty emails. i am a ceramic sculptor i have no interest in this conversation. i have followed the unsubscribe directions MANY TIMES to no avail. now i get snotty messages? who are you people? get some manners simone From: Angus Mezick [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] Date: Tue, 3 Jun 2003 13:24:37 -0400 To: Tomcat Users List [EMAIL PROTECTED] Subject: TO SIMONE LEIGH Please read the whole message(especially the last couple of lines detailing UNSUBSCRIBE instructions) and do it yourself. -Original Message- From: Simone Leigh [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 03, 2003 1:10 PM To: Tomcat Users List Subject: Re: Forms and JSPs PLEASE TAKE ME OFF THIS LIST!!! From: Jason Bainbridge [EMAIL PROTECTED] Organization: KDE Web Team Reply-To: Tomcat Users List [EMAIL PROTECTED] Date: Sat, 31 May 2003 08:43:29 +0800 To: Tomcat Users List [EMAIL PROTECTED] Subject: Re: Forms and JSPs On Sat, 31 May 2003 08:30, Jeff Knox wrote: Has anybody ever seen JSP pages that work with forms using the POST method and not the GET method? I am using Apache 1.3.22 and Tomcat 4.1.24. Yup I am using it in work's intranet application but with Apache 2.0.44 Tomcat 4.1.24, I also use GET on a few forms without any problems. :) -- Jason Bainbridge KDE Web Team - http://kde.org [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
GET SOME MANNERS!!!!! Re: TO SIMONE LEIGH
it's not working, that's why i asked! you people are driving me nuts From: Angus Mezick [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] Date: Tue, 3 Jun 2003 13:24:37 -0400 To: Tomcat Users List [EMAIL PROTECTED] Subject: TO SIMONE LEIGH Please read the whole message(especially the last couple of lines detailing UNSUBSCRIBE instructions) and do it yourself. -Original Message- From: Simone Leigh [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 03, 2003 1:10 PM To: Tomcat Users List Subject: Re: Forms and JSPs PLEASE TAKE ME OFF THIS LIST!!! From: Jason Bainbridge [EMAIL PROTECTED] Organization: KDE Web Team Reply-To: Tomcat Users List [EMAIL PROTECTED] Date: Sat, 31 May 2003 08:43:29 +0800 To: Tomcat Users List [EMAIL PROTECTED] Subject: Re: Forms and JSPs On Sat, 31 May 2003 08:30, Jeff Knox wrote: Has anybody ever seen JSP pages that work with forms using the POST method and not the GET method? I am using Apache 1.3.22 and Tomcat 4.1.24. Yup I am using it in work's intranet application but with Apache 2.0.44 Tomcat 4.1.24, I also use GET on a few forms without any problems. :) -- Jason Bainbridge KDE Web Team - http://kde.org [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]