combining host valve and address valve
Hi all, I've tried what the subject says, but unsuccessfully so far. I create a Remote Address Valve and allow '192.168.' (all of the LAN, including my PC from which I administer the server), then I try to create a Remote Host Valve and allow '.someExternalName.com' and get Validation Errors: 'Allow is invalid. Need to include the admin's Hostname.' Needless to say the admin was already allowed access in the Remote Address Valve. Thanks, Dragan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Passing init params to a listener?
G'day all, Can someone please advise how to pass init params to a listener? For example, in my web.xml file I have the following listener currently defined as:- listener listener-classczone.db.InitConnectionPool/listener-class /listener At the moment all parameters are hard coded in the listener. If I want to extend the flexibility of the code by adding init parameters to the listener definition do I merely do this:- listener listener-classczone.db.InitConnectionPool/listener-class init-param param-namejdbcConnectionString/param-name param-value.../param-value /init-param /listener If this is correct then what Java code is required in the contextInitialized(...) method to pull the init parameter name and value so the listener can use it? I really don't have a clue what I'm doing so some guideance on this matter would be greatly appreciated! Thanks if you can help. AB - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Passing init params to a listener?
For each parameter you need your listener to read, place name/value pairs in your web.xml. Here's an example for two parameters (mySQLServerName and mySQLPort): context-param param-name mySQLServerName /param-name param-value localhost /param-value /context-param context-param param-name mySQLPort /param-name param-value 3306 /param-value /context-param Then, in your listener class, read them like this: String serverName = application.getInitParameter(mySQLServerName); String mySQLPort = application.getInitParameter(mySQLPort); - Original Message - From: Adrian Beech [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, March 11, 2004 2:07 PM Subject: Passing init params to a listener? G'day all, Can someone please advise how to pass init params to a listener? For example, in my web.xml file I have the following listener currently defined as:- listener listener-classczone.db.InitConnectionPool/listener-class /listener At the moment all parameters are hard coded in the listener. If I want to extend the flexibility of the code by adding init parameters to the listener definition do I merely do this:- listener listener-classczone.db.InitConnectionPool/listener-class init-param param-namejdbcConnectionString/param-name param-value.../param-value /init-param /listener If this is correct then what Java code is required in the contextInitialized(...) method to pull the init parameter name and value so the listener can use it? I really don't have a clue what I'm doing so some guideance on this matter would be greatly appreciated! Thanks if you can help. AB - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: War does not unpack on deployment
Jacob Kjome wrote: At 06:19 PM 3/13/2004 -0500, you wrote: Jacob, My hosting service is Tomcat 4.18 so I'm kind of stuck with 4.x. Are you saying if I use tomcat 4.x I must not put a context for my applicaton in server.mxl? Then it will be unpacked automatially? thanks, Phil Yep, that's exactly what I'm saying. Or, do this... Context path=/coolapp docBase=coolapp.war/ Now you can specify any configuration you want for your app and it will be deployed just fine. It won't be unpacked. It will run directly from the .war file. Just note that you will not be able to use context.getRealPath(/) as it will return null if the app is deployed directly from the .war file and not a directory. Of course, you should never depend on this anyway if you want your application to run under any appserver. Also note that the above is exactly what you'd give to Tomcat5 and it will unpack it anyway. The app will run from the directory, not the .war file even though the docBase is specified as the .war file. Jake - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Thanks Jake, Good explaination. Phil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Defining a Realm inside a Context
Hi, I have some serious problems configuring a Realm, a DataSourceRealm to be exact, inside a context for a web application. I tried it as it is written in the documentation, but it didn't work and I tried to find some information on this on the net. But I didn't find anything. I am using Tomcat 5.0.19 and jdk 1.4.2_04. Well, here is my Context definition. ?xml version='1.0' encoding='utf-8'? Context docBase=D:/Eigene Dateien/Projekte/Java/fProjectManager path=/fProjectManager reloadable=true !-- Database Resource for fProjectManager. Used for database access and authentication. -- Resource name=fProjectManagerDB type=com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource auth=Container/ ResourceParams name=fProjectManagerDB parameter namefactory/name valuecom.mysql.jdbc.jdbc2.optional.MysqlDataSourceFactory/value /parameter parameter nameport/name value3306/value /parameter parameter nameuser/name valuefproject/value /parameter parameter namepassword/name valuefproject/value /parameter parameter nameserverName/name valuelocalhost/value /parameter parameter namedatabaseName/name valuefprojectmanager/value /parameter /ResourceParams !-- DataSource Realm based on the DataSource fProjectManagerDB -- Realm classname=org.apache.catalina.realm.DataSourceRealm dataSourceName=java:/comp/env/fProjectManagerDB localDataSource=true userTable=users userNameCol=username userCredCol=password roleNameCol=role userRoleTable=userroles/ /Context And this is the exception I get, when I start Tomcat 5 with this configuration. INFO: Processing Context configuration file URL file:D:\Java\Tomcat 5.0\conf\Catalina\localhost\fProjectManager.xml 14.03.2004 16:32:21 org.apache.commons.digester.Digester startElement SCHWERWIEGEND: Begin event threw exception java.lang.NullPointerException at org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader.java:804) at org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader.java:756) at org.apache.commons.digester.ObjectCreateRule.begin(ObjectCreateRule.java:252) at org.apache.commons.digester.Rule.begin(Rule.java:200) at org.apache.commons.digester.Digester.startElement(Digester.java:1273) at org.apache.catalina.util.CatalinaDigester.startElement(CatalinaDigester.java:112) at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source) at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.commons.digester.Digester.parse(Digester.java:1567) at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:519) at org.apache.catalina.core.StandardHost.install(StandardHost.java:906) at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:527) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:472) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1008) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:394) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:166) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1134) at org.apache.catalina.core.StandardHost.start(StandardHost.java:832) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1126) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:521) at org.apache.catalina.core.StandardService.start(StandardService.java:519) at org.apache.catalina.core.StandardServer.start(StandardServer.java:2345) at org.apache.catalina.startup.Catalina.start(Catalina.java:594) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:297) at
Setting HTTP headers for static resources?
Hello everyone, is there an easy way to set HTTP headers (specific: cache-control) in Tomcat 5 for static resources like CSS files or GIF pictures? By default, Tomcat does not seem to touch these headers. I know that I can set headers from Servlets/JSPs, but that does not help in the case of static resources. Regards, Andreas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Setting HTTP headers for static resources?
Andreas Schildbach wrote, On 3/14/2004 12:48 PM: is there an easy way to set HTTP headers (specific: cache-control) in Tomcat 5 for static resources like CSS files or GIF pictures? By default, Tomcat does not seem to touch these headers. I know that I can set headers from Servlets/JSPs, but that does not help in the case of static resources. You can write a Servlet Filter to do this. I am also unaware of any way to do this within Tomcat itself. -Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Passing init params to a listener?
G'day, I assume from this that init parameters can only be accessed by a listener if they have been declared globally within the applications context and not from within the scope of the listener itself? Hm AB -Original Message- From: Frank Burns [mailto:[EMAIL PROTECTED] Sent: Monday, 15 March 2004 12:30 AM To: Tomcat Users List; [EMAIL PROTECTED] Subject: Re: Passing init params to a listener? For each parameter you need your listener to read, place name/value pairs in your web.xml. Here's an example for two parameters (mySQLServerName and mySQLPort): context-param param-name mySQLServerName /param-name param-value localhost /param-value /context-param context-param param-name mySQLPort /param-name param-value 3306 /param-value /context-param Then, in your listener class, read them like this: String serverName = application.getInitParameter(mySQLServerName); String mySQLPort = application.getInitParameter(mySQLPort); - Original Message - From: Adrian Beech [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, March 11, 2004 2:07 PM Subject: Passing init params to a listener? G'day all, Can someone please advise how to pass init params to a listener? For example, in my web.xml file I have the following listener currently defined as:- listener listener-classczone.db.InitConnectionPool/listener-class /listener At the moment all parameters are hard coded in the listener. If I want to extend the flexibility of the code by adding init parameters to the listener definition do I merely do this:- listener listener-classczone.db.InitConnectionPool/listener-class init-param param-namejdbcConnectionString/param-name param-value.../param-value /init-param /listener If this is correct then what Java code is required in the contextInitialized(...) method to pull the init parameter name and value so the listener can use it? I really don't have a clue what I'm doing so some guideance on this matter would be greatly appreciated! Thanks if you can help. AB - 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]
editing the class path w
Hi every one, I am a new user of tomcat. Please don't mind if my question seems to be trivial. If we are having a java class that uses some package. Do we need to change the classpath for tomcat so that it can correctly compile the jsp page using that class? I have updated the system class path (CLASSPATH) to point to the correct location, but I was wondering if I need to make any special changes for tomcat as well. I am facing the following problem-- I can execute a program, which creates an instance of the MyUserInfo class (MyUserInfo implements the UserInfo interface, which is present in the package com.jcraft.jsch) on the command line but when I try to create the instance of MyUserInfo class in jsp page I get error. Below is the web page showing errors-- HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: com/jcraft/jsch/UserInfo at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:193) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:781) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:549) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:589) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:666) at java.lang.Thread.run(Thread.java:536) root cause javax.servlet.ServletException: com/jcraft/jsch/UserInfo at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:536) at org.apache.jsp.addCPValidate_jsp._jspService(addCPValidate_jsp.java:102) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at
getRequestedSessionId and URLEncode
Hello. (BI develop on Tomcat4.1.29. (BI have some problems. (B (BThe requested URL contains multibytes string. (BSo I encode URL by this. (B (B (BString str = response.encodeRedirectUrl("/ServletTest/ServletTest1/" + (BURLEncoder.encode(str, "UTF-8")); (B (Ba href="%= str %"%= str %/a (B (B (BUnder the condition of rejecting cookie, (BURL is like (B"/ServletTest/ServletTest1/%E3%81%82;jsessionid=50FBAE3645FA18D15CB898E04469 (BC2FF" (B (BWhen I click this link, (Brequest.getRequestedSessionId() returns "FBAE3645FA18D15CB898E04469C2FF" (BSo "50" is lost. (B (BAlso, When URL is like (B"/ServletTest/ServletTest1/%E3%81%82%E3%81%82;jsessionid=50FBAE3645FA18D15CB (B898E04469C2FF" (Brequest.getRequestedSessionId() returns "AE3645FA18D15CB898E04469C2FF" (BSo "50FB" is lost. (B (BWhy does the value get truncated by 2 for each multibyte character? (BPlease help me. (B (BI think this doesn't occur on Tomcat5.XX. (B (B (B (B (B (B (B (B- (BTo unsubscribe, e-mail: [EMAIL PROTECTED] (BFor additional commands, e-mail: [EMAIL PROTECTED]
JK2 VirtualHost-relative Location URI mapping
Hi. (B (BDoes anyone know how to get Locations in httpd.conf to be relative to the (BVirtualHost rather than global? (B (BI can get JK2 working properly by explicitly putting domains in my (Bworkers2.properties file but I'd prefer using mass virtual hosting with jk2 (Band avoid having to add domains to apache (requiring a restart) whenever I (Bget a new dynamic-website client. (B (BThe problem is that when I use the Location directive to map uri's (say (B"/*.htm") to tomcat, that Location maps ALL "/*.htm" requests even though I (Bput the Location inside a specific VirtualHost. This wouldn't be a problem (Bif all I had on the server were dynamic sites but I have static sites on the (Bserver as well. (B (BAll tomcat app sites are on one IP while static sites are on other IPs (B(that's how I'm doing mass virtual hosting). (B (BI've tried the following configuration (B (B+---start snip from httpd.conf---+ (B# this vhost is default for IP1. All dynamic content sites use IP1. (BVirtualHost IP1:80 (B... (BLocation "/*.htm" (BJkUriSet worker ajp13:localhost:8009 (B/Location (B/VirtualHost (B (B# this vhost is default for IP2. All static content sites use IP2. (BVirtualHost IP2:80 (B... regular static site stuff (B/VirtualHost (B+---end snip from httpd.conf---+ (B (BWhat ends up happening is that ALL *.htm pages get sent to Tomcat regardless (Bof what IP the request comes in on. (B (BAm I doing something wrong? Has anyone done this using JK (1) in case JK2 (Bdoesn't support this? Is this actually a limitation of Apache rather than (BJK? (B (BServer Stats: (B RedHat 9.0 (B Tomcat 5.0.19 - binary distribution (B JK2 2.0.2 - compiled from source. (B Apache 2.0.48 - compiled apache from source with (B mod_ssl. Also use php and openssl in (B case that makes a difference... (B (BThanks, (BAdrian Lanning (B (B (B- (BTo unsubscribe, e-mail: [EMAIL PROTECTED] (BFor additional commands, e-mail: [EMAIL PROTECTED]
Re: HTTPS on Tomcat
Can you give me a sample web.xml file that can help me out please? Thank you, Best Regards, Uma Keshav Sarin [EMAIL PROTECTED] it.comTo 03/12/2004 11:28 [EMAIL PROTECTED] PM cc Please respond to Tomcat Users List [EMAIL PROTECTED] Subject rta.apache.org Re: HTTPS on Tomcat You need to change the security constraint settings in the web.xml of the application that needs redirection. Read the web.xml DTD for more information. [EMAIL PROTECTED] 03/11/04 07:37PM Hi, I wanted to have the default page running on 80 port and when the user logs in, I need him to be in 443 port. I have made all the settings but I need a clarification on how to redirect the user who has logged in using 80 port to 443 port. How is this generally handled in realtime. Do I need 2 instances of the tomcat running? If so how? Thank you, Best Regards, Uma - 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]
Probem related to data files
Hello, In my jsp file, i am using a java class that reads a data file from the disk and use that data for fulfilling subsequent user requests. Now there is one other backgroud process that can change the disk file data. Now in the production environment where the application is running 24 hours, 7 days a week, how these changes will reflect in the object that reads this data files at the starting of the server. Regards Ashish Mittal - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
OutOfMemoryError
Hi, I am getting the following error message when I have accessed Tomcat for more than 2 days without shutting it down. I am using Tomcat 5.0.19 256 MB Ram Pentium III Win 2k Pro Mar 13, 2004 3:57:54 PM org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor processChildren SEVERE: Exception invoking periodic operation: java.lang.OutOfMemoryError Any help on how to solve the problem would be great. Do I need to create multiple instances of the server for load balancing? Thank you, Best Regards, Uma - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]