Re: Reload on Tomcat 5.5
Don't let the snotty attitude get to you. You encounter those type on the list from time to time. LOL - Original Message - From: Remy Maucherat [EMAIL PROTECTED] To: Tomcat Users List tomcat-user@jakarta.apache.org Sent: Sunday, May 22, 2005 11:07 AM Subject: Re: Reload on Tomcat 5.5 On 5/22/05, Robert Parsons [EMAIL PROTECTED] wrote: Hi, Thanks for the reply. Well to be more specific then I will give you an example of what I have tried as a test. I write a basic servlet that simply prints a line of text to the screen. If i compile it and deploy it, all is good. If I then make a modification to that that string in the source file, recompile then RELOAD (using ant), the servlet still outputs the ORIGINAL string (before the modification). The same thing happens If i recompile then press 'reload' in the tomcat manager application instead of using ant. I tested this, and it (of course) works fine. If i perform the steps above on the latest tomcat 5.0 (rather than 5.5), the NEW string would be printed out after the reload. Any ideas? Coz i'm stumped. Well, don't plan to upgrade ever, because the bug will obviously never be fixed. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Basic load balancing
Yeah, it's a mix of load balancing and clustering. SNIP - lots of good stuff Regards, Will Hartung ([EMAIL PROTECTED]) Thank you for posting that reply, Will. What load balancing system would you recommend? (Is there some consensus, cost issues aside, as to what the best type of load balancing system is?) Kind regards Harry Mantheakis London, UK - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How do I handle International Characters
Hi Lutz As far as HTML forms are concerned, you can force the browser to submit them to the server using a particular charset by adding the accept-charset attribute to the form tag, i.e.: form accept-charset=utf-8 ... ... /form http://www.w3.org/TR/REC-html40/interact/forms.html#adef-accept-charset Thanks for that tip! Setting the 'http-equiv' meta-tag seems to suffice, but I'm all for a belt and braces approach. Kind regards Harry Mantheakis London, UK - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How do I handle International Characters
A method we have used with success for inbound request encoding is to add a Servlet Filter to our application whose sole job is to call request.setCharacterEncoding(UTF-8) Allistair. And you might consider adding a call to: response.setContentType( text/html; charset=UTF-8 ); In the same filter. It can be reset if a servlet (or JSP) needs to do something different, like downloading files. Harry Mantheakis London, UK - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: UTF-8 Problem with Tomcat 5.0.27 and POST
I desperatly try to POST UTF-8 data to an application using struts. GET method works perfectly fine, but post does not. I am using CharacterEncodingFilter All pages have Content-Type header I assume you're calling: response.setContentType( text/html; charset=UTF-8 ); You'll also want to specify the following HTML header meta-tag in your JSPs: meta http-equiv=Content-Type content=text/html; charset=UTF-8 I'm not using Struts, so I account account for that fact. HTH Harry Mantheakis London, UK - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How do I handle International Characters
Hello I am using Tomcat 5.0 and I am trying to receive and send thai characters. Can someone please tell me the simplest ways to do this. This worked for me with Japanese characters: Use a filter to set encodings for both requests and responses: request.setCharacterEncoding( UTF-8 ); response.setContentType( text/html; charset=UTF-8 ); Specify the following HTML header meta-tag in your JSPs: meta http-equiv=Content-Type content=text/html; charset=UTF-8 Always specify UTF-8 as the charset. Stick to submitting form-data with POST methods. I have not tried encoding URI's with GET requests. If you must use URI's with GET requests, try to limit yourself to working with ID-string parameters, so that you can avoid encoding issues. NOTE: Calling the 'ServletResponse.setContentType()' method (as above) is equivalent to calling the following two ServletResponse methods together: response.setContentType( text/html ); response.setCharacterEncoding( UTF-8 ); Browsers should (and mostly do, I think) respect the encoding you specify when setting the response content-type (and the meta-tag content-type) so you can simply assume (in your filter) that your form-data will be in UTF-8. Clients still need to, of course, set their browsers to display the relevant charsets correctly. HTH. Harry Mantheakis London, UK - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat Timers/threads?
Does Tomcat 4.1 provide a way to schedule tasks? Something similar to java.util.Timer? AFAIK not in Tomcat, but Quartz might be of interest to you: http://www.opensymphony.com/quartz/ HTH Harry Mantheakis London, UK - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: replacing ROOT
This reminds me that we've been having a lot of issues with Tomcat caching (refusing to recompile) changed JSP files. Not sure if there's a bug on it, but it stinks having to restart the whole container sometimes, just for a small JSP change. This problem seems to have gotten worse if anything in Tomcat 5.0.x. See the documentation for the 'reloadable' Context attribute: http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/context.html Reloading is switched off by default, because it's not a feature you want to use with production servers. The documentation also mentions that you can - as an alternative - use the Manager web application to conveniently trigger reloads 'on demand'. HTH Harry Mantheakis London, UK - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: book for servlet programming
3/ Download a copy of the servlet spec (java.sun.com) and give it a good skim. It's dry -- it's a spec, after all -- but it contains what every servlet developer should know. Sticking to spec-compliant code will make your apps container-agnostic, such that you can use Tomcat, WebLogic, etc with little difficulty. I second that whole heartedly. It is essential to understand that everything is driven by the specifications - make them your bibles. The O'Reilly Java Servlet and JSP Cookbook book is also a good secondary source. Harry Mantheakis London, UK - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: changing my web app and then deploying takes a lot of time!!!
I am currently developoing a web application and whenever I change my project (jsp file or java classes) I have to deploy and undeploy the application again. Which take a lot of time and it drives me crazy!!! Do you know how can I foce tomcat to deploy my build directory and whenever I change something in the build directory it can automatically detect it and refresh the deployed web application? See the documentation for the 'reloadable' Context attribute: http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/context.html HTH Harry Mantheakis London, UK - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
OT - Beware of Firefox + HTML Validator Extension
I thought I should share this with any web-app developers on this list. I recently installed the HTML Validator extension in Firefox. This caused me no-end of troubles because HTML Validator (on Windows XP) was firing off rogue secondary requests (!) whenever I was selecting any of my form submit buttons. Then I read this blog entry, and realised who the culprit was: http://ronin.keyboardsamurais.de/evil_firefox_extensions.html I uninstalled the HTML Validator extension and everything was fine again. Kudos to the LiveHTTPHeaders extension which showed the double requests being generated - though at first it made me think I had a faulty mouse! http://livehttpheaders.mozdev.org/ HTH somebody who may be pulling their hair out. Harry Mantheakis London, UK - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OutOfMemory / JMeter / Profiler questions
We've started performance testing one of our REMOTE web apps using JMeter. We're gathering benchmark data before doing further fine tuning. Details: Win2K only have ssh + cygwin access to this remote server JDK 1.4.1_03 Tomcat 4.1.26, running as a service: a.. Use security manager 1 b.. Security policy file D:\Tomcat4\conf\catalina.policy c.. Initial heap 256 d.. Max heap 512 e.. Stack size 256 f.. JVM server I cannot help you with respect to your OOM problems, but I would recommend that you consider upgrading to JVM 1.4.2. You should also be able to migrate your app to TC 5.0.28 without too much grief. You should probably avoid TC 5.5.x for the meantime. JVM 1.4.2 and TC 5.0.28 play well together. Good luck in case! Harry Mantheakis London, UK - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: WELCOME to tomcat-user@jakarta.apache.org
Complete guess here, but you might want to check permission settings for the Tomcat home (installation) directory - and also see that you've got a Tomcat user account set up, etc. I have a no-login 'tomcat' user, and permissions for the Tomcat home directory (and all its contents) is assigned to that user. if I manually run script with start argument... What happens when you call the 'tomcatd' script (from the console) without any arguments? (Surely that's what happens when the system calls 'tomcatd'?) Harry Mantheakis Fedora Core 3 using Gnome Installed Tomcat 5.5.4, created tomcatd script to start tomcat in /etc/rc.d/init.d, chmod +755 tomcatd chkconfig --add tomcatd 5 on On startup it says it's starting tomcatd, yet tomcat is not run. if I manually run script with start argument it starts fine. I've tried searching google, and everyone says put the script in init.d and chmod it, which I've already done. - 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: Running heavily loaded tomcat sites.
The 'LD_ASSUME_KERNEL' setting was needed with Red Hat 9. I'm on FC3 now and it seems to be working fine *without* having to specify LD_ASSUME_KERNEL. Actually, I could swear (though I have no metrics) that FC3 is running my Java stuff much faster than RH9 did with a forced LD_ASSUME_KERNEL setting. Your suggestion to avoid using the Java 'new' keyword is interesting, and I believe I know what you're getting at - but I think you should expand on it, perhaps with some specific pointers. It seems to leave too much to the imagination at the moment :-) As an example, in my application all the 'action objects' that handle requests are singletons - instantiated at start-up, and handed out as needed at runtime. But you have to be careful with that approach - instance variables are a complete no-no. HTH Harry Mantheakis Hello, I have collected my experiences with running a heavily loaded (and soon to be high availability) tomcat setup in a paper available here: http://brandlay.com/wojtek/publ/tomcat.jsp Have a look if you're interested and please email any comments directly to my email. Thanks! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JNDI without edit server.xml
Any idea? No idea I'm afraid :-/ All I can tell you for sure is that this stuff *does* work, pretty much out-of-the-box, as described in the Tomcat docs - but everything has to be spot on. So don't lose faith, even if that means starting from scratch again - which might be worth considering, if there's any chance your configuration files have got messed up. Good luck! Harry Mantheakis I try it and now the error is changed: java.lang.NoSuchMethodError: org.apache.naming.resources.ProxyDirContext.lookupCache(Ljava/lang/String;)Lor g/apache/nami ng/resources/CacheEntry; at org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.java: 663) Any idea? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JNDI without edit server.xml
I think your ResourceParams element is missing the 'factory' parameter. Mine looks like this: ResourceParams name=jdbc/myDatabase parameter namefactory/name value org.apache.commons.dbcp.BasicDataSourceFactory /value /parameter parameter namedriverClassName/name value org.postgresql.Driver /value /parameter parameter nameurl/name value jdbc:postgresql://localhost:5432/myDatabaseUsername /value /parameter ... /ResourceParams The first parameter ('factory') is missing from the example you posted. HTH Harry Mantheakis Hi all, I've got a problem. I'm using tomcat 5.0 with Oracle 9.2i. Now I want to upgrade tomcat to the newest version, but the same configuration doesn't work again. I used this solution for tomcat 5.0, because I don't whant to write anithing on tomcat server.xml file. To configure and use it I created ONLY this xml and put it on $TOMCAT_HOME/conf/catalina/localhost/strutsProva.xml file. Context displayName=Everithing managing system docBase=D:\dev\strutsProva path=/strutsProva reloadable=true Resource name=jdbc/strutsProva auth=Container type=javax.sql.DataSource / ResourceParams name=jdbc/strutsProva parameter namedriverClassName/name valueoracle.jdbc.OracleDriver/value /parameter parameter nameurl/name valuejdbc:oracle:thin:@localhost:1521:sweet/value /parameter parameter nameusername/name valuedasit/value /parameter parameter namepassword/name valuedasilab/value /parameter parameter namemaxActive/name value1/value /parameter parameter namemaxWait/name value5000/value /parameter parameter namemaxIdle/name value2/value /parameter /ResourceParams /Context Anybody knows how to configure a jndi service on tomcat, without write anithing on server.xml file? I have to leave it clean 'cause I don't know who will install my application. Thanks all, Davide - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How does Tomcat know that a browser supports cookies?
The API for the HttpServletResponse.encodeURL() method states that the implementation of this method includes the logic to determine whether the session ID needs to be encoded in the URL. How does Tomcat know whether or not a browser supports cookies, or session tracking is turned off? Is it simply a case of looking for the presence of a Cookie: header in the request, and assuming that cookies are enabled if the header is found? And if that is the case, would I be correct in assuming that browsers (when permitted by their users) will set Cookie: headers in their requests even if they do NOT actually have any (previously set) cookies to send back to the server? I'm just guessing, of course - and I know I should not generalise about browsers: I'm thinking of IE, Mozilla/Firefox and Opera. TIA Harry Mantheakis - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How does Tomcat know that a browser supports cookies?
I understand what you are saying, Javier, if you have a round-trip situation, where you set cookies in one response, and then test for them in a follow-up request. But I'm not convinced that's how Tomcat does it. The first time a client connects to a server, there will not be any cookies, session or otherwise, for the client browser to send to the server - but Tomcat can still figure out whether or not cookies are enabled in the client browser. At least, that seems to be the case with my application: Tomcat automatically decides whether or not to apply URL rewriting if I call the HttpServletResponse.encodeURL() method. I wonder if anyone here knows for sure? Regards Harry I use a HttpSession object. HttpSession object = null; When user access to site, i use: object = request.getSession(); later i use: boolean n = object.isNew(); if n = true, then user is not using cookies. I suppose that tomcat is using Session Cookies and not re-writting politic.. because, tomcat keep session with user using cookies, so.. if session is new mean that user is new for tomcat, because it can't send cookie. regards.. Javier At 10:12 27-01-2005 +, you wrote: The API for the HttpServletResponse.encodeURL() method states that the implementation of this method includes the logic to determine whether the session ID needs to be encoded in the URL. How does Tomcat know whether or not a browser supports cookies, or session tracking is turned off? Is it simply a case of looking for the presence of a Cookie: header in the request, and assuming that cookies are enabled if the header is found? And if that is the case, would I be correct in assuming that browsers (when permitted by their users) will set Cookie: headers in their requests even if they do NOT actually have any (previously set) cookies to send back to the server? I'm just guessing, of course - and I know I should not generalise about browsers: I'm thinking of IE, Mozilla/Firefox and Opera. TIA Harry Mantheakis - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Javier Villalobos Arancibia Ing. Civ. Electrónico ImageMaker Information Technology - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How does Tomcat know that a browser supports cookies?
Thanks Mike - and Javier I installed 'livehttpheaders' (cool!) and all was revealed - pretty much as you and Javier said. First time requests always result in URLs being rewritten to include the session cookie ID - and it carries on that way if the client browser has cookies disabled. If cookies are enabled at the browser, then URL rewriting stops after the first request. I should figured this out myself, so I'm sorry to have wasted the bandwidth. What made me slip out of gear on this was Zone Alarm Pro mangling the request session cookies, but somehow fooling Tomcat into *not* rewriting the URLs which meant that persistence went out the window :-/ Thanks again for the replies - I recommend 'livehttpheaders' which works with both Mozilla and Firefox. Harry Mantheakis So you're saying that you've seen Tomcat *not* rewrite URLs in a response to a first request from a client that *does* support cookies, and *does* rewrite the URLs in a response to a first request from a client that doesn't support cookies? That would indeed be very powerful software. Tomcat needs at least one request/response cycle to be able to determine if cookies are enabled or not; which it does on the subsequent request/response cycle. Your request comes in. You have no cookie (either because you don't allow them, or it's your first visit this session) Tomcat responds with a session cookie, and if you've run URLs through that method, URLs are rewritten too. The next time you request something, your browser sends back the cookie (if you allowed the cookie). Tomcat sees this cookie, and then stops rewriting URLs. If your browser doesn't send back a cookie with the next request, the method continues to rewrite URLs. My only doubt is: Does it continue to also send the cookie in a 'faint hope' that it might one day be accepted? This could be easily investigated with liveheaders in firefox. Come to think of it, liveheaders would help you confirm what I've just said. ;) Mike Curwen -Original Message- From: Harry Mantheakis [mailto:[EMAIL PROTECTED] Sent: Thursday, January 27, 2005 10:12 AM To: Tomcat Users List Subject: Re: How does Tomcat know that a browser supports cookies? I understand what you are saying, Javier, if you have a round-trip situation, where you set cookies in one response, and then test for them in a follow-up request. But I'm not convinced that's how Tomcat does it. The first time a client connects to a server, there will not be any cookies, session or otherwise, for the client browser to send to the server - but Tomcat can still figure out whether or not cookies are enabled in the client browser. At least, that seems to be the case with my application: Tomcat automatically decides whether or not to apply URL rewriting if I call the HttpServletResponse.encodeURL() method. I wonder if anyone here knows for sure? Regards Harry I use a HttpSession object. HttpSession object = null; When user access to site, i use: object = request.getSession(); later i use: boolean n = object.isNew(); if n = true, then user is not using cookies. I suppose that tomcat is using Session Cookies and not re-writting politic.. because, tomcat keep session with user using cookies, so.. if session is new mean that user is new for tomcat, because it can't send cookie. regards.. Javier At 10:12 27-01-2005 +, you wrote: The API for the HttpServletResponse.encodeURL() method states that the implementation of this method includes the logic to determine whether the session ID needs to be encoded in the URL. How does Tomcat know whether or not a browser supports cookies, or session tracking is turned off? Is it simply a case of looking for the presence of a Cookie: header in the request, and assuming that cookies are enabled if the header is found? And if that is the case, would I be correct in assuming that browsers (when permitted by their users) will set Cookie: headers in their requests even if they do NOT actually have any (previously set) cookies to send back to the server? I'm just guessing, of course - and I know I should not generalise about browsers: I'm thinking of IE, Mozilla/Firefox and Opera. TIA Harry Mantheakis - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Javier Villalobos Arancibia Ing. Civ. Electrónico ImageMaker Information Technology - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED
Re: What is it mean that Java code does not belong in well designed JSP pages?
I just read this thread and didn't quite understand it. If it means what it seems to mean on the surface, I'm doing everything wrong. I belong to the camp that thinks Java code in JSPs is evil. I happen to think that tag libraries are wonderful. JSPs are HTML documents that are empowered to retrieve information from Java objects. At least that's how I think of them. The focus in a JSP is HTML/CSS presentation and design - all the data should be retrieved, validated and prepared for presentation before you call the JSP. If you work on a large, complex project, you must approach it that way. If you're working on something simple, quick and dirty, then by all means do all your coding in JSPs - that's what makes them cool. Debugging code in JSPs is very painful. Debugging tag libraries is the same as debugging any ordinary Java object. HTH Harry Mantheakis - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ConnectionPooling
Connection pooling is virtually a standard feature in web apps - IOW many, many people are using it all the time - so the first thing to say is that you must believe that the mistake is yours. Which also means that you have the power to fix it :-) So take a deep breath and carefully check all your stuff against the documentation links Doug has given you. Then you should copy and paste (in an email to this list) the full contents of your server.xml file, web.xml file, and the Java code that is trying to get a connection. You should also copy and paste any error messages that you are getting. Then we might be able to help you. Harry People who have to figure out how to use other peoples work either have messy hair or are bald. There are three main pages for reference: http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto .html#Database%20Connection%20Pool%20(DBCP)%20Configurations http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-resources-howto.html http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/globalresources.html Now the basics. There are four pieces to the puzzle. I am going for a Global Setup. First is the server.xml Resource and ResourceParams elements. It appears that you have these. Connects to the database and create a pool of connections. Second is the web.xml entry for the resource-ref. Third is the Resource link placed in the apps context. Fourth is the calling of the resource from code. When you say use to BasicDataSource to see thw no. of active connections is this you application or something built into Tomcat? Doug - Original Message - From: micky none [EMAIL PROTECTED] To: Tomcat Users List tomcat-user@jakarta.apache.org Sent: Wednesday, January 19, 2005 4:54 PM Subject: Re: Re: ConnectionPooling Tried that too my friend,isn't there any sure shot answer for this one..im like half mad after this...as of now. On Thu, 20 Jan 2005 Harry Mantheakis wrote : This may not help, but try swapping the order of the ResourceParams and Resource elements in your 'server.xml' file. Also, you seem to be declaring the DefaultContext element three times (!) which seems wrong. HTH Harry Mantheakis Hi Friends, This is my first message on this list.I want to use the dbcp connection pooling.I set up the server.xml according to an example,but when i trying to use to BasicDataSource to see thw no. of active connections it's throwing errors.I tried searching a lot but to no use.If I go into the administrator tool,it shows nothing there?I am using tomcat5.0..please tell me ..where i am going wrong and if there is any other way to see the number of active connections. Here's my server.xml,please tell me if there's anything wrong with it: Logger className=org.apache.catalina.logger.FileLogger directory=logs prefix=localhost_log. suffix=.txt timestamp=true / DefaultContext reloadable=true / DefaultContext path=/database docBase=database debug=0 reloadable=true / - DefaultContext - ResourceParams name=jdbc/conversion - parameter nameusername/name value/value /parameter - parameter namepassword/name value/value /parameter - parameter namedriverClassName/name valuecom.ibm.db2.jcc.DB2Driver/value /parameter - parameter nameurl/name valuejdbc:db2j:net/value /parameter - parameter nameremoveAbandoned/name valuetrue/value /parameter - parameter nameremoveAbandonedTimeout/name value0/value /parameter - parameter namelogAbandoned/name valuetrue/value /parameter - parameter namemaxActive/name value1/value /parameter - parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter /ResourceParams Resource name=jdbc/conversion auth=Container type=javax.sql.DataSource / /DefaultContext Loader className=org.apache.catalina.loader.WebappLoader loaderClass=org.apache.catalina.loader.WebappClassLoader checkInterval=3 / /Host please,please,please help me...its very urgent. - 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: Question about JNDI resources
It sounds plausible to hold onto the DataSource once you had it. I do, with PostgreSQL. And then there is an issue of synchronization? Hmm... You got me thinking there :-) I have always assumed that a DataSource reference retrieved from a JNDI lookup is a singleton - IOW the connection pool created by Tomcat in response to a Context-Resource element in '/conf/server.xml' only contains one DataSource object. If that assumption is correct, then it seems logical to assume that vendor DataSource implementations *must* ensure their 'getConnection' methods are synchronized. But I do not like living with such assumptions (!) so I wonder if anyone might be kind enough to confirm whether or not JNDI DataSource references are singletons? Harry Mantheakis - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Question about JNDI resources
I think I found the answer to my own question in the Commons DBCP documentation: http://jakarta.apache.org/commons/dbcp/apidocs/org/apache/commons/dbcp/datas ources/package-summary.html Under the JNDI section, the last paragraph states: quote The reference to the DataSource could be maintained, for multiple getConnection() requests. /quote Which seems clear enough. Phew :-) Harry Mantheakis It sounds plausible to hold onto the DataSource once you had it. I do, with PostgreSQL. And then there is an issue of synchronization? Hmm... You got me thinking there :-) I have always assumed that a DataSource reference retrieved from a JNDI lookup is a singleton - IOW the connection pool created by Tomcat in response to a Context-Resource element in '/conf/server.xml' only contains one DataSource object. If that assumption is correct, then it seems logical to assume that vendor DataSource implementations *must* ensure their 'getConnection' methods are synchronized. But I do not like living with such assumptions (!) so I wonder if anyone might be kind enough to confirm whether or not JNDI DataSource references are singletons? Harry Mantheakis - 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: ConnectionPooling
This may not help, but try swapping the order of the ResourceParams and Resource elements in your 'server.xml' file. Also, you seem to be declaring the DefaultContext element three times (!) which seems wrong. HTH Harry Mantheakis Hi Friends, This is my first message on this list.I want to use the dbcp connection pooling.I set up the server.xml according to an example,but when i trying to use to BasicDataSource to see thw no. of active connections it's throwing errors.I tried searching a lot but to no use.If I go into the administrator tool,it shows nothing there?I am using tomcat5.0..please tell me ..where i am going wrong and if there is any other way to see the number of active connections. Here's my server.xml,please tell me if there's anything wrong with it: Logger className=org.apache.catalina.logger.FileLogger directory=logs prefix=localhost_log. suffix=.txt timestamp=true / DefaultContext reloadable=true / DefaultContext path=/database docBase=database debug=0 reloadable=true / - DefaultContext - ResourceParams name=jdbc/conversion - parameter nameusername/name value/value /parameter - parameter namepassword/name value/value /parameter - parameter namedriverClassName/name valuecom.ibm.db2.jcc.DB2Driver/value /parameter - parameter nameurl/name valuejdbc:db2j:net/value /parameter - parameter nameremoveAbandoned/name valuetrue/value /parameter - parameter nameremoveAbandonedTimeout/name value0/value /parameter - parameter namelogAbandoned/name valuetrue/value /parameter - parameter namemaxActive/name value1/value /parameter - parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter /ResourceParams Resource name=jdbc/conversion auth=Container type=javax.sql.DataSource / /DefaultContext Loader className=org.apache.catalina.loader.WebappLoader loaderClass=org.apache.catalina.loader.WebappClassLoader checkInterval=3 / /Host please,please,please help me...its very urgent. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Memory leak
Possibly. If you are using a connection pool and do not close the connection, it will not be released back to the pool, so subsequent calls to the pool will create new connections. There's a simple procedure to help you avoid this problem, even when errors occur during your JDBC calls, and that is to close connections within a finally block: Connection con = null; try { // initialise and create connections here // do all your other JDBC stuff here too } catch ( SLQException e ) { // handle exceptions here } finally { if ( con != null ) { try { con.close(); } catch ( SQLException ignored ) {} } } As you know, finally blocks are guaranteed to execute, even if an exception is thrown. HTH Harry Mantheakis - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Compile and Deploy JSPs - Tomcat 4.0
I might be picking up fag ends here, but I noticed that in this block: servlet servlet-nameclient/servlet-name servlet-classclient/servlet-class /servlet The 'servlet-class' element would normally take the fully qualified name of the class - IOW the complete package name. Also, classes, by Java conventions, should have capitalised names - so perhaps your entry there is wrong. Good luck. Harry Mantheakis Hi, Thanks for your help. Also, I looked into archives and got more details. Still, I am not able to load any jsp which is comipled to class and deployed in a war file containing web.xml. On the other hand, I am able to get an html (also packed in the war file) loaded without any error. conf/server.xml has entry as follows - Context path=/myProj docBase=C:/tomcat4.0/myProj.war debug=0 privileged=true conf/web.xml has enry as follows - servlet servlet-nameclient/servlet-name servlet-classclient/servlet-class /servlet ... servlet-mapping servlet-nameclient/servlet-name url-pattern/client.jsp/url-pattern /servlet-mapping Upon issuing URL as : http://localhost:8080/myProj/client.jsp, following error is thrown : HTTP Status 500 : Internal Server Error ... javax.servlet.ServletException: Wrapper cannot find servlet class client or a class it depends on at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:87 3) at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:655) Could any one help. Thanks in advance, Abhay -Original Message- From: Antony Paul [mailto:[EMAIL PROTECTED] Sent: Tue, 21 Dec 2004 09:34 To: Tomcat Users List Subject: Re: Compile and Deploy JSPs - Tomcat 4.0 The proper way to do this is use the JSPC task to compile JSP files to class files and then create url mappings in the web.xml for the JSPs to class files. The class files are to be deployed in the WEB-INF/classes directory. The Anto JSPC task(which is same supplied with Tomcat). I think this topic is discussed previously and you can find details in the archives. rgds Antony Paul On Tue, 21 Dec 2004 09:21:00 +0200, Abhay Hiwarkar [EMAIL PROTECTED] wrote: Hi, I have around 120 JSP files and want to avoid deploying them with the source-code. Using JSPC utility, I am able to compile them to .java files. If required, I can get the .class files from: /tomcat4.0/work/myApp. Can anybody help me deploying only the .class files with Tomcat4.0. Many Thanks in advance, Regards, Abhay - 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: SuSE 9.2 and Tomcat...
Thank you sharing this information. Harry Mantheakis London, UK Hi Again, Well after pulling my hair out and getting very frustrated I have finally fixed and documented everything that needs to be done in order to get Tomcat 5 working on SuSE 9.2. This seems a little strange since I am using the version of Tomcat that comes with SuSE 9.2, but I won't say anymore on the matter. There are basically two important permission things that need to be done. 1). The files admin.xml and manager.xml in /etc/tomcat5/base/Catalina/localhost/ need to be given write access to the tomcat user. There new profile should look like this: -rw-rw-r-- 1 root tomcat 862 Oct 5 03:20 admin.xml -rw-rw-r-- 1 root tomcat 428 Oct 5 03:20 manager.xml This fix removes the previous error regarding the admin and manager applications that I posted earlier. 2). The tomcat user needs to be given access to /var/run in order to create the relevant PID file. Because my server is behind a firewall and I change the ROOT and user password on the server regularly, I changed the /var/run permissions so that everyone could read and write from and to this directory. The new profile should look like this: drwxrwxrwx 15 root root 1032 Nov 24 09:11 run This fix solves various issues regarding the admin and manager applications as well as the start.log error. Thats it. I don't know if this information will be useful to anyone, but I thought I would share it with you all anyway. Regards Q - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Testing/Development environment setups..
My 2 cents: Learning to use Ant - especially for features Yoav and others have suggested - is very worth while. Ant is a fantastic tool. Harry Mantheakis Yoav, Ben: Thanks for the tips - I think I finally have a grasp on how a real project would be run properly. I already use MySQL, cvs(in a manual fashion), ant(still new) so I'm not that far away. Development Box Question: Is it *inadvisable* to do the development using the same tomcat version, ant and a local mysql database on a Windows XP box versus the production server which is a linux box? I'd like to start using an real IDE(Eclipse or Netbeans) and having everything on my XP box sounds doable. Thanks for all your help. --JW - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: getParameter() should be case insensitive?
Dave You had me worried there, for a moment... Surprisingly, the servlet spec is quite clear on this issue: getParameter() is not valid for GET requests (which was totally unexpected). Servlet Spec 2.3, Section SRV.4.1: I read the specs again, and then I realised that you are getting mixed between path parameters and request parameters - and the bit of the specifications you looked at (and quoted) refers to path parameters, not request parameters. In Hans Bergsten (author of Author of JavaServer Pages, O'Reilly) own words, copied from another forum discussion I just Googled... quote A path parameter and a request parameter are two different things. A path parameter can be inserted at any node in a URL, and is used in the Servlet API to encode the session ID in the URL: /foo/bar;jsessionid=1234567 A request parameter is defined using a query string in the URL: /foo/bar?a=b Both types of parameters can be used in the same URL: /foo/bar;jsessionid=1234567?a=b The Servlet API currently does not provide direct access to path parameters and treats the session ID path parameter in a special way (strips it off and uses it to associate the request with the specified session). If you need to use other path parameters, you must use getRequestURI() and parse the string yourself. The getParameter() method, et. al, returns request parameters. In addition to parameters defined by a query string, these methods also find parameters defined in the body of a POST request. So, the answer to your question is, it's safe to use getParameter() et. al. to access request parameter values for both GET and POST requests in all normal cases. The exception is a POST request that uses a content type other than application/x-www-form-urlencoded, for instance a file upload request (multipart/form-data). /quote There you go - you can sleep easy again :-) Regards Harry Mantheakis London, UK Thanks for your input! I guess I was looking for some objective discussion on the possibility of the Servlet API being incorrect, according to the standards its supposed to implement. The Servlet specification ultimately needs to adhere to external standards. For example, HttpRequest.getHeader() is case insensitive because RFC 2616 says HTTP headers are case insensitive. So presumably HttpRequest.getParameter() is case sensitive because *something* says so... I just don't know what. Surprisingly, the servlet spec is quite clear on this issue: getParameter() is not valid for GET requests (which was totally unexpected). Servlet Spec 2.3, Section SRV.4.1: Path parameters that are part of a GET request (as defined by HTTP1.1) are not exposed by these APIs. They must be parsed from the String values returned by the getRequestURI method or the getPathInfo method. getParameter() is only valid for POST requests of the content type application/x-www-form-urlencoded. So, it sounds like applications cannot count on a servlet container to implement getParameter() for GET requests at all, which is completely unbelievable, IMHO. And strictly speaking, Tomcat should actually not return anything for GET requests. Though, this would conceivable break *tons* of applications. Hrm -Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Finding CSS files in webapp
Hello I have no knowledge of XSLT-generated XHTML pages, but I make extensive use of the header 'BASE' tag and my CSS files always come through, so you may want to consider that option. html head ... base href=https://www.my-domain-name.com/my-web-app-name/; link rel=stylesheet type=text/css href=asset/css/my.css ... /head body ... Notice the trailing forward-slash in the BASE tag hyperlink reference. This means that all other hyperlink references are stated as being relative to that, and must NOT start with a leading forward-slash. I specify the BASE tag using a custom tag that retrieves the base hyperlink value from a context initialisation parameter (specified in the deployment descriptor). Using the BASE means that *all* my URL references are relative - and it has not let me down yet. Good luck! Harry Mantheakis London, UK Greetings fellow Tomcat dancers, Been losing cycles in a gumption trap, trying to hook a CSS file up to XSLT-generated XHTML pages. Many thanks to whomever sees my obvious error. If I hardwire the full-path filename of my development environment into the XSLT file, all works as hoped/planned/dreamed. But all other techniques I've tried fail. Tomcat: 5.0.19. Webapp name: nrd. WAR layout: |-nrd |-css/nrd.css |-images/ |-Meta-inf/ |-Web-inf/ |-classes/ |-dtd/ |-lib/ |-xsl/ |-web.xml web.xml: web-app servlet servlet-name controller /servlet-name servlet-class org.apnp.nrd.ControlServlet /servlet-class /servlet servlet-mapping servlet-name controller /servlet-name url-pattern /* /url-pattern /servlet-mapping /web-app XSLT source that works: head meta http-equiv=Content-Type content=application/xhtml+xml; charset=utf-8/ link rel=stylesheet type=text/css href=C:\Apache\Tomcat\Tomcat50\webapps\nrd\css\nrd.css/ /head Versions of CSS href that do not work: href=css/nrd.css/ href=/css/nrd.css/ href=./css/nrd.css/ href=nrd/css/nrd.css/ href=/nrd/css/nrd.css/ href=./nrd/css/nrd.css/ I've also tried setting a global XSLT parameter: xsl:param name=rootDir select='../docroot'/ and calling that: link rel=stylesheet type=text/css href={$rootDir}css/nrd.css/ which results in a known unsuccesful link: href=/nrd/css/nrd.css Please, if you can, tell me what obvious thing I've missed. Thanks for any suggestions. Best wishes, William BC Crandall bc.crandall [around] earthlink.net - 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: I've officially decided that JSTL is one of the worstthingsto ever happen
Hello I agree that I find taglibs impossible to understand. Tag libraries are not actually that difficult, and offer many advantages. I just thought I would mention that, for the record :-) Harry Mantheakis London, UK - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Sysdeo, Eclipse, Tomcat
Hello Should I be able to set a breakpoint normally in a servlet? Yes, as long as you have started Tomcat using the Sysdeo plugin (from within Eclipse). How do I set a breakpoint in JSP? AFAIK that is not possible, at least not with the Sysdeo plugin. Something like the 'MyEclipse' plugin might be able to help you there, though that is a commercial plugin which you can test for a month or so. Where is my source (and binaries) supposed to be? Source can be anywhere you like - as long as Eclipse knows where it is, and can compile your project, the (servlet and object) debugging will work. Binaries go in WEB-INF/classes. It is safer to *package* your classes, BTW. I cannot help with the other two miscellaneous questions, though I do not think you need be concerned with the Tomcat 'base' attribute if you have a simple setup, and again, to begin with at least, I do not think you need be concerned with JVM settings. (There are several JVM settings that you have to consider on a production server, but that is another story.) My solution to debugging JSPs is not to put any code in them at all (!) I do everything with custom tags, which of course, are just objects that can debugged in the usual way. Good luck! Harry Mantheakis London, UK I am trying to figure out how to debug servlets and JSPs. I am running Windows ME, Tomcat 5.0, Eclipse 2.1.3, and Sysdeo Tomcat Plugin 3.0.0.alpha1. So, how should Sysdeo be set up? Should I be able to set a breakpoint normally in a servlet? How do I set a breakpoint in JSP? Where is my soruce (and binaries) supposed to be? Miscellaneous questions: 1. What is Tomcat base? (Preferences/Tomcat) 2. Any JVM settings needed? (Preferences/Tomcat/JVM settings) Thanks for your help. I have already tried to find a tutorial on the Web, but nothing has helped. - 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: jsvc and the -server option
Hello Hadn't heard about any instability on the server VM. Anybody? The -server option works fine for me on RedHat 9 and Java 1.4.2_xxx. In a recent article: http://www.kano.net/javabench/ The author is minded to write: The results I got show that no one should ever run the client JVM when given the choice... HTH. Good luck! Harry Mantheakis London, UK - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 5.0.16 behind SSL Accelerator - 2nd post
Hello the easiest is to just use relative links... I also find the HTML 'BASE' header tag very useful in this respect. Setting the BASE tag guarantees the relative links work, and all the links are relative to the same base directory, which makes things a little easier. Setting the BASE tag itself with a custom tag (as suggested by Filip) allows me to switch the whole application from HTTP to HTTPS by simply changing one application attribute. Good luck! Harry Mantheakis London, UK how are you creating your links right now, the easiest is to just use relative links, like a href=/myapp/some.jspA Link/a here the browser will connect up using same protocol as the data came down on. or you can create your own tag, like a href=app:MyLink href=/myapp/some.jsp/A link using tag/a Filip - Original Message - From: Adrian Klingel [EMAIL PROTECTED] To: Tomcat User List [EMAIL PROTECTED] Sent: Tuesday, June 22, 2004 8:20 AM Subject: Tomcat 5.0.16 behind SSL Accelerator - 2nd post I searched for this in the archives at mikal.org, and only found the question and no answer. I have Tomcat 5.0.16 behind a hardware SSL accelerator box. The links in my webapps of course refer back to HTTP://myserver.com/myapp, but I of course want them to be rewritten as HTTPS://mysslaccelertor:port/myapp. Is there a simple configuration change in the server.xml that I can make in order to fix this? Thanks, Adrian Klingel - 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: Denial Service Attack Prevention apache-tomcat modjk2
I've just come off implementing something very much like what Wade has recommended, and it works a treat. Note the use of a finally block to release the session lock, which is cool. Basically, the first request sets a flag stored in the session object so that no other (subsequent) request will be processed for that session object. The problem is that the response from the first request will never be received by the client, if the client manages to send another request before the first one has responded. If the client sends another request whilst the first is still processing, the controller servlet redirects the request to come back to the server (and make a fresh request) in the expectation that the first request will have finished by the time the second request has re-bounded. The server keeps a count of how many 'rebounds' are made, so that if the first request is taking a long time to process, the 3rd rebound is passed to a 'progress bar' JSP that is programmed to refresh itself at increasingly slower rates. (I use custom tags to programmatically set the refresh rate.) It is theoretically possible for the user to be left in limbo if something happens to permanently block the processing of the first request - but that is an unlikely event, so the risk is worthwhile. The cool bit is that once the fist request has finished processing it sets a 'state' attribute (or set of attributes) in the session, so that any subsequent request (a rebound or a progress-bar JSP seeking to refresh itself) will get a response that is identical to what the first request would have generated. That's kind of like a restaurant where the customer can never change their order. If they ask for a salad, that is it. No matter how long it takes to cook, and however many times they ask to change their order to chicken, they get a salad at the end! This stuff can really do your head in when you first start thinking about it, but after while it gets easier. Bottom line: session is you best friend. Use it. Good luck! Harry Mantheakis London, UK Replying on top of Yoav's because I don't have the other message. If it is a large enough operation your could do something like this: //check if running String methodName = com.mypackage.MyClass.myMethod; //pull value from session test and add if needed. Boolean isRunning = (Boolean)session.getAttribute(methodName); if( isRunning != null isRunning.booleanValue() ) { //hand off to other method that tells them to please wait. } else { //first let app know user is doing task. session.setAttribute(methodName, new Boolean(true)); //perform that large task try { //do work that might jump out here... } catch(Throwable e) { } finally { //ok, it's done...remove from session. session.removeAttribute(methodName); } }//end else Now the large task can't eat up your cpu more than you let it because it only runs once per user at a time. Sleeping the thread a little after so many iterations in loops also will help your entire server and application. After maybe every 1000 iterations sleep for a couple of millis. Play with that sometimes it helps sometimes not. It spreads out the load over time a bit and allows the computer to service more users, it just takes longer... Hope that helps you some. Wade - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Denial Service Attack Prevention apache-tomcat modjk2
I assumed the forcing of cookies and sessions. Me too. Most web applications that need to be concerned about repeat requests are likely to be dependant on session objects one way or another. And with that, a good weekend to all ;) An excellent idea! Kind regards Harry - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Hiding Implementation using Tomcat 5
Hello You can register your JSPs (just like you can servlets) in the deployment descriptor, and then map them to a URL pattern of your choice. Have a look at this link: http://edocs.bea.com/wls/docs70/webapp/components.html#145275 If you only register a JSP (but do not define a mapping for it) you can invoke it using the ServletContext.getNamedDispatcher( String ) method where 'String' is the registered name of the JSP. The getNamedDispatcher method is useful when you do not want clients to be able to access JSPs directly - but only via 'controller' servlets which process requests before invoking any JSPs. Good luck. Harry Mantheakis London, UK Hi, I'm in the process of rebuilding the website for the company I work for, with JSP using Tomcat 5. Is there a way to hide the implementation from the URI, so that the extension does not need to be typed to get the resource. eg. If I have a file: /foo/bar.jsp How can I set up the server, so that if I type in the URI http://www.example.com/foo/bar I actually get bar.jsp delivered, rather than a 404 Not Found error. From what I've been able to find and read, it seems possible to do this using Apache HTTP Server content negotiation, so is it possible using Apache Tomcat 5? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Changing the 'ROOT' webapp (newbie question)
Definitely smart! Yoav, I think you're a smartass, but I mean that in the nicest and most complimentary way possible ;-) You're a constant source of help and relief to tomcat users on this list. I am always interested to read your posts and take a great interest in what you have to say! Thanks! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat configuration
Hello Syed Taj yeah thats what even i thought, but my web pages are not visible if i put myappl directory directly under webapps, only if i put it under ROOT doed the server even display the web pages. You are mistaken. Placing your 'myapp' directory under the ROOT context simply means that your web pages are *nested* in a ROOT context sub-directory. In other words your web pages are assumed to belong to the ROOT context, and your 'myapp' folder is treated as a sub-directory and *not* as a separate context. By the way, in servlet containers such as Tomcat the word 'context' is synonymous with the word 'application'. (They mean the same thing.) If you want to create your *own* separate application (context) then you must place it under the $CATALINA_HOME/webapps directory - not under ROOT. One thing you must *not* do is have a ROOT sub-directory that is the same name as a directory (folder) that represents a context (application) in the 'webapps' directory. So if your application (context) is called 'banana' then you must not have this: $CATALINA_HOME/ | webapps/ | ROOT/ | | | banana/ | banana/ You should delete the $CATALINA_HOME/webapps/ROOT/banana sub-directory. Odd as it may seem, you could place a web page called (say) 'yellow.jsp' under either of the two 'banana' directories shown above and you would call that page with the same (!) URL: http://localhost:8080/banana/yellow.jsp If the 'yellow.jsp' sits under the $CATALINA_HOME/webapps/ROOT/banana directory then it is treated as belonging to the ROOT context (application). If 'yellow.jsp' sits under the $CATALINA_HOME/banana directory then it is treated as belonging to the 'banana' context (application). The difference is important! Finally, you say that 'my web pages are not visible if i put myappl directory directly under webapps'. All I can suggest is that you are doing something wrong, because this aspect of Tomcat is rock-solid and works 100%. So try again, and make sure you do not have a ROOT sub-directory that conflicts with the name of your 'myapp' context, whatever that is. If you are still having problems, start a new thread on this forum, giving all the relevant details, and I'm sure you will be helped. I'm off on holiday now, so I cannot follow up on this I'm afraid. Good luck! Harry From: Harry Mantheakis [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Subject: Re: Tomcat configuration Date: Sun, 04 Apr 2004 20:08:19 +0100 Hello ROOT is the default context (application). By default, ROOT handles requests that do not specify an application. Hence this URL: http://localhost:8080/ Would be handled by the 'ROOT' application, which displays the Tomcat welcome page. You can re-configure this, of course, but that is how it is set up by default. Your 'myapplication' directory (and everything it contains) should not be located within the ROOT directory. It should be located within the 'webapps' directory. HTH Harry - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: UTF-8 encoding
Hello Nikki Just send UTF8 encoded data and everything will be allright. Yes, that seems to work for me at the moment, though I am relying on default settings because I do not even specify UTF-8. (Java defaults to Unicode anyway.) I'm only using LATIN-1 characters at the moment, so I cannot comment on what would happen if I was working with (say) Chinese characters. I have to leave it at that because this is something I shall be looking into later. All the best! Harry Simply I don't get it. You send data over HTTP. You can send data as you wish. What about servlet serving images? Just send UTF8 encoded data and everything will be allright. No way Tomcat knows do you want to send cyrrilic letter or french accent letter. It's up to you. Niki Harry Mantheakis wrote: - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Cannot create JDBC driver of class '' for connect URL 'null'
Hello My web.xml contains: That looks the same as mine (which works) so no problem there. You do not actually *need* this element in the deployment descriptor if you are using Tomcat 5, but it makes your code portable, should you ever (God forbid!) switch to another servlet container. My $TOMCAT_HOME/conf/server.xml contains the following... BTW, it is $CATALINA_HOME that matters - $TOMCAT_HOME is not used. Looking at your resource definitions, this sub-element: parameter nameurl/name value jdbc:postgresql://localhost/mydb /value /parameter Maybe should read: parameter nameurl/name value jdbc:postgresql://localhost:5432/mydb /value /parameter Mine, at least, needs a port number to be specified. The rest of the resource element looks okay to me. Also, your look-up code looks good too, so my only guess is that you have forgotten to put the PostgreSQL JDBC driver under the container's classpath. You probably have the driver located under your application's 'WEB-INF/lib' directory. Try placing the driver in the '$CATALINA_HOME/common/lib' directory, but do not have it both places! (Remove it from the 'WEB-INF/lib' directory.) Also, make sure you have a driver named 'pg74.1jdbc3.jar'. The one that comes bundled with the PostgreSQL 7.4 RPM is out of date. You can download the 7.4 driver from PG's JDBC site. Good luck. Harry Mantheakis London, UK Hi, I am trying to convert my Tomcat web application to use JNDI to lookup a DataSource rather than using DriverManager directly. My application works fine using DriverManager so I know I have my classpath set up correctly. The problem I have seems to be a very common one yet I cannot find a solution to it using Google. I am getting the following error message when I attempt to look up a DataSource: Cannot create JDBC driver of class '' for connect URL 'null' This implies to me that Tomcat is recognizing my Resource declaration in my conf/server.xml but is not loading the associated ResourceParams. I get this problem with Tomcat 4.1 and 5.0 on Red Hat 9 with Sun JDK 1.4.2. My web.xml contains: resource-ref descriptionDB Connection/description res-ref-namejdbc/mydb/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref My $TOMCAT_HOME/conf/server.xml contains the following (I have tried defining this within the context of my webapp and also in the GlobalNamingResources section). Resource name=jdbc/mydb auth=Container type=javax.sql.DataSource / ResourceParams name=jdbc/mydb parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter namemaxActive/name value100/value /parameter parameter namemaxIdle/name value30/value /parameter parameter namemaxWait/name value1/value /parameter parameter nameusername/name valueebay/value /parameter parameter namepassword/name value/value /parameter parameter namedriverClassName/name valueorg.postgresql.Driver/value /parameter parameter nameurl/name valuejdbc:postgresql://localhost/mydb/value /parameter /ResourceParams Lastly, my Java code is as follows: InitialContext initCtx = new InitialContext(); Object obj = initCtx.lookup( java:comp/env/jdbc/mydb ); DataSource ds = (DataSource) obj; return ds.getConnection(); Does anyone have JNDI working with Tomcat? Any help would be much appreciated! Thanks, Andy Grove. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Cannot create JDBC driver of class '' for connect URL 'null'
I'm glad you sorted yourself out Andy. Just for the record, you *can* define the resource (and its parameters) within the context of an application - as opposed to making it a global resource that requires a resource link. I have it working that way, and I suspect so do many others because this is the way the Tomcat documents indicate things should be done. See, for example: http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-how to.html In that document the resource element is defined as part of a context. I'm tempted to think that you had something broken in your code, before, and when you rehashed everything the other way it worked because you got it right. IOW it's another way to skin this particular cat (oops!) but not the only way. All the best Harry I found the problem. To get it working I needed to have the Resource and ResourceParams in the Global section and then add a ResourceLink in the context for my webapp. This enabled Tomcat to resolve the parameters. I've posted my config files here for anyone interested: http://www.codefutures.com/weblog/openknowledge/archives/77.html On Mon, 2004-04-05 at 15:08, Andy Grove wrote: Thanks Harry but the problem is that it is not even trying to load the Postgres driver - it is not getting that far. It is trying to load JDBC driver class '' (empty string) and is trying to access JDBC URL of 'null'. It seems that the ResourceParams section is not being used. I do have the postgres jar deployed to common/lib. Thanks. On Mon, 2004-04-05 at 14:52, Harry Mantheakis wrote: Hello My web.xml contains: That looks the same as mine (which works) so no problem there. You do not actually *need* this element in the deployment descriptor if you are using Tomcat 5, but it makes your code portable, should you ever (God forbid!) switch to another servlet container. My $TOMCAT_HOME/conf/server.xml contains the following... BTW, it is $CATALINA_HOME that matters - $TOMCAT_HOME is not used. Looking at your resource definitions, this sub-element: parameter nameurl/name value jdbc:postgresql://localhost/mydb /value /parameter Maybe should read: parameter nameurl/name value jdbc:postgresql://localhost:5432/mydb /value /parameter Mine, at least, needs a port number to be specified. The rest of the resource element looks okay to me. Also, your look-up code looks good too, so my only guess is that you have forgotten to put the PostgreSQL JDBC driver under the container's classpath. You probably have the driver located under your application's 'WEB-INF/lib' directory. Try placing the driver in the '$CATALINA_HOME/common/lib' directory, but do not have it both places! (Remove it from the 'WEB-INF/lib' directory.) Also, make sure you have a driver named 'pg74.1jdbc3.jar'. The one that comes bundled with the PostgreSQL 7.4 RPM is out of date. You can download the 7.4 driver from PG's JDBC site. Good luck. Harry Mantheakis London, UK Hi, I am trying to convert my Tomcat web application to use JNDI to lookup a DataSource rather than using DriverManager directly. My application works fine using DriverManager so I know I have my classpath set up correctly. The problem I have seems to be a very common one yet I cannot find a solution to it using Google. I am getting the following error message when I attempt to look up a DataSource: Cannot create JDBC driver of class '' for connect URL 'null' This implies to me that Tomcat is recognizing my Resource declaration in my conf/server.xml but is not loading the associated ResourceParams. I get this problem with Tomcat 4.1 and 5.0 on Red Hat 9 with Sun JDK 1.4.2. My web.xml contains: resource-ref descriptionDB Connection/description res-ref-namejdbc/mydb/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref My $TOMCAT_HOME/conf/server.xml contains the following (I have tried defining this within the context of my webapp and also in the GlobalNamingResources section). Resource name=jdbc/mydb auth=Container type=javax.sql.DataSource / ResourceParams name=jdbc/mydb parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter namemaxActive/name value100/value /parameter parameter namemaxIdle/name value30/value /parameter parameter namemaxWait/name value1/value /parameter parameter nameusername/name valueebay/value /parameter parameter namepassword/name value/value /parameter parameter namedriverClassName/name valueorg.postgresql.Driver/value /parameter parameter nameurl/name valuejdbc:postgresql://localhost/mydb/value /parameter /ResourceParams Lastly, my Java code
Re: UTF-8 encoding
implement a EncodingFilter class Where's the interface? Hi, you can specify the utf-8 encoding with a filter. All you need to do is implement a EncodingFilter class, and then in your deployment descriptor add the filter element as follows: filter filter-nameEncodingFilter/filter-name display-nameEncodingFilter/display-name descriptionUTF-8 encoding/description filter-classorg.mysite.EncodingFilter/filter-class init-param param-nametargetEncoding/param-name param-valueutf-8/param-value /init-param /filter Hope this helps:) -Yan -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, April 05, 2004 6:49 AM To: Tomcat Users List Subject: UTF-8 encoding Hi! I have a web-application which on the serverside needs UTF-8 encoding. I tried to install and run apache/tomcat on a Windows-XP environment, and the server says, the encoding is not UTF-8. same applicationwith the same apache/tomcat version runs correctly on a windows 2000 environment. Is this a XP specific problem and is there any possibility to force tomcat to send data in UTF-8 encoding. Best regards bab - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: UTF-8 encoding
Okay, thanks Yoav. I got the source, and I can see what's happening - thanks to Google - at this URL: http://java.sun.com/blueprints/code/jps131/src/com/sun/j2ee/blueprints/encod ingfilter/web/EncodingFilter.java.html The 'doFilter' method sets the encoding for the *request* which does not seem to address the original question, which was asking how to 'force tomcat to send data in UTF-8 encoding'. Interesting filter nevertheless! It is a subject that concerns me. Kind regards Harry Hi, implement a EncodingFilter class Where's the interface? javax.servlet.Filter is the interface. He probably had http://java.sun.com/blueprints/code/jps131/api/com/sun/j2ee/blueprints/e ncodingfilter/web/EncodingFilter.html in mind. Yoav Shapira - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Cannot create JDBC driver of class '' for connect URL 'null'
Hello What is postgresql JAR? It is the JDBC driver for the PostgreSQL database. You do not need it if you are connecting to an Oracle database - but, of course, you need the Oracle equivalent, which I am sure you already have if you have managed to make 'single' connections, as you say. I cannot help you with your problem, but the key words in the error output would seem to be: 'Connection refused'. Make sure that *all* your connection details are specified correctly. HTH Harry Hi, This is my server.xml code: parameter namedriverClassName/name valueoracle.jdbc.driver.OracleDriver/value /parameter parameter nameurl/name valuejdbc:oracle:thin:@servername.mot.com:1521:dev/value /parameter What is postgresql JAR? Do I need this ? I am using Oracle 8.x and T5. I am able to connect thru driverManager code .. Single connection Best Regards Abhay Kumar -Original Message- From: Paul Mansfield [mailto:[EMAIL PROTECTED] Sent: Monday, April 05, 2004 12:29 PM To: Tomcat Users List Subject: RE: Cannot create JDBC driver of class '' for connect URL 'null' On Mon, 2004-04-05 at 18:35, Kumar Abhay-CAK203C wrote: Hi, I am getting following error while creating Connection Pool using above code: Error Caught while creating a connection in EPP dB: = org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory, cause: Io exception: Connection refused(DESCRIPTION=(TMP=)(VSNNUM=135290880)(ERR=12505)(ERROR_STACK=(E RROR=(CODE=12505)(EMFI=4 sounds like either firewall blocking conn's, or bad username/password in your config try an manual telnet dbserver portnum to verify the former - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to configure the default webapplication (ROOT)?
You could have a default 'index' JSP in ROOT that redirects the user to the 'abc' context. Hi Yoav, I understand that, but my application must sometimes run in context path= sometimes context path=/abc and I must refer images in ApplicationResources.properties such as IMG SRC= ... and that depends of course on context path. I would prefer a solution that the applications always uses a context path=/abc but the user just can enter an URL: http://localhost:8080 How can I solve that problem? Zsolt -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: Monday, April 05, 2004 2:46 PM To: Tomcat Users List Subject: RE: How to configure the default webapplication (ROOT)? Hi, The default web application is the one whose context path= (the empty string). ROOT is nothing special. Yoav Shapira Millennium Research Informatics -Original Message- From: Zsolt Koppany [mailto:[EMAIL PROTECTED] Sent: Sunday, April 04, 2004 5:31 AM To: Tomcat Users List Subject: How to configure the default webapplication (ROOT)? Hi, how can I configure tomcat (4,5) which application under (webapps) is the default one? I understand that is right now ROOT and I would like to modify that the user doesn't always have to enter the context path. Zsolt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat configuration
Hello ROOT is the default context (application). By default, ROOT handles requests that do not specify an application. Hence this URL: http://localhost:8080/ Would be handled by the 'ROOT' application, which displays the Tomcat welcome page. You can re-configure this, of course, but that is how it is set up by default. Your 'myapplication' directory (and everything it contains) should not be located within the ROOT directory. It should be located within the 'webapps' directory. HTH Harry Under ROOT exists myapplication directory The structure goes like : tomcat-home webapps ROOT myapplication Html pages WEB-INF Web.xml classes Class files See whether u can help If u have set ur server successfully, u would definitely know this one. Thanks -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: Friday, April 02, 2004 7:39 PM To: Tomcat Users List Subject: RE: Tomcat configuration Hi, What are your files under ROOT instead of just under webapps? Yoav Shapira Millennium Research Informatics -Original Message- From: Taj [mailto:[EMAIL PROTECTED] Sent: Friday, April 02, 2004 2:26 AM To: 'Tomcat Users List' Subject: Tomcat configuration Hi Iam having problem in setting my application running in Tomcat 4.1 The applications directory is situated at /Tomcat4.1/webapps/ROOT/myapplication This is the only place that my pages are visible to the server. My class files are situated at /Tomcat4.1/webapps/ROOT/myapplication/WEB-INF/classes/ The html pages in the directory /Tomcat4.1/webapps/ROOT/myapplication/ are visible to the server but my class files are not. I have tried everthing. The web.xml file is kept in the directory /Tomcat4.1/webapps/ROOT/myapplication/WEB-INF/ and the web.xml file goes like: web-app servlet servlet-nameGetInput/servlet-name servlet-classGetInput/servlet-class /servlet servlet-mapping servlet-nameGetInput/servlet-name url-pattern/GetInput/url-pattern /servlet-mapping /web-app Where the GetInput in the servlet-name. The HTML page that calls the servlet has the following syntax for the POST command: form method=POST action=GetInput I have also added to the environment variables of my OS, the following: CATALINA_HOME=E:\Program Files\Apache Group\Tomcat 4.1 TOMCAT_HOME=E:\Program Files\Apache Group\Tomcat 4.1 But to no difference Even after all this I get the 404 error: the required source was not found. I would by very thankful to anyone who can find what I have missed and help me out. Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat configuration
Hello I think this: form method=POST action=GetInput Should read: form method=POST action=/myapplication/GetInput Also, consider packing your classes, so that this servlet registration: servlet servlet-nameGetInput/servlet-name servlet-classGetInput/servlet-class /servlet Becomes something like: servlet servlet-nameGetInput/servlet-name servlet-classcom.foo.bar.GetInput/servlet-class /servlet Packaging is not necessary to invoke a servlet, but it used to be necessary if you used JavaBeans in JSPs. (Maybe JavaBeans in JSPs is old hat now, I'm not sure.) Finally, $TOMCAT_HOME is not used. Only $CATALINA_HOME is needed. Good luck! Harry - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat5 and HttpServletRequest#getSession
JSPs are designed to create sessions automatically - unless you explicitly tell them NOT to. Hence, calling %= request.getSession(false)% Will always get you a session. There is a JSP directive you need to use which will prevent your JSP from creating a session. I'm sure you can find the directive. Regards Harry Hello All, I'm a little confused about the creation of new sessions. I have a webapp running (Tomcat 5.0.19), and I can see from a SessionListener that the session is timed out - Session destroyed, all attributes removed. So far, so good. But when a subsequent request is made like the following excerpt from a JSP page: %= request.getSession(false)% I would have expected to get null as the response, instead I get a non-null session object (e.g. [EMAIL PROTECTED]) and the SessionListener reports that a new session was indeed created at the time of the JSP request. So, it seems to me that a session is always created when the getSession() method is called regardless of the boolean parameter. Can someone clarify for me? Thanks! -- john = John Cartwright Associate Scientist Geospatial Data Services Group CIRES, National Geophysical Data Center/NOAA (303) 497-6284 [EMAIL PROTECTED] = - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Question on debuggin JNDI/prepared statement in a bean
Hello pstmt.setString(1,ClassifiedAd); pstmt.setString(2,UniqueDateId); Are those two parameters - 'ClassifiedAd' and 'UniqueDateId' - variables? They should be, and if so, where do you declare and initialise them? They do not appear in the method you posted. Harry I am frustrated trying to debug a prepared statement within a bean; what am I doing wrong?; ANY clues appreciated It is not throwing any exceptions yet I methodically went over the code; granted this is the first time I used beans versus servlets. Can anyone point me to a good example (JNDI, JSP, JavaBean, Resultset) Code within bean: private void prepareStatement(){ try{ Context env = (Context) new InitialContext().lookup(java:comp/env); pool = (DataSource) env.lookup(jdbc/myDB); if (pool == null) throw new NamingException(`jdbc/ myDB ' is an unknown DataSource); //dbConnection = null; dbConnection = pool.getConnection(); String SQLCmd = select * from AdInfoView where Classification = ? + and UniqueDateId ? order by UniqueDateId desc; pstmt = dbConnection.prepareStatement(SQLCmd); // TEST Exception thrown here. //pstmt.setString(1,searchWord); pstmt.setString(1,ClassifiedAd); pstmt.setString(2,UniqueDateId); }catch(Exception e){ System.err.println(Problem preparing statement + e.getMessage() + e.getCause()); } } --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.557 / Virus Database: 349 - Release Date: 12/30/2003 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Question on debuggin JNDI/prepared statement in a bean
Hi Tom how do you set up a JNDI connection in a bean? Exactly the same way as you would anywhere else, so if you have some code working in a servlet, copy it. To be precise, it is a database connection, acquired from a DataSource, which is itself acquired via a JNDI lookup. The fact that your code is in a bean makes no difference. how do you... use a prepared statement (in a bean) Same as anywhere else. how do you... retrieve a resultset, and forward the result Again, same as anywhere else. BTW - you should not be passing about references to JDBC objects that are tethered (so to speak) to database connections - it is bad practice, and likely to cause connection (and memory) leaks. The best thing to do with database connections is, grab your data, store it in some collection object, and then make damn sure you close the db connection - usually within a 'finally' block which is guaranteed to execute, even when exceptions occur. Having stored the data you need in a collection object, you can pass that about as much as you like. That has not really answered your original question, but unless you provide us with all your relevant code we probably cannot solve the problem. Since you got it working before, I would be inclined to start again, making sure that you copy the same JNDI/connection procedures in your 'bean' as in the servlet that works. The fact that your 'bean' is not throwing any exceptions suggests, to me, that there is a bug (logic error) in your code. Starting over might sort that out. Sprinkle about a few (temporary) 'System.out.println' statements to see where your code gets to. Not cool, but they do the job sometimes! If you are using an IDE - like Eclipse - you can run in debug mode, so it's easy to see what is happening - though may be not with JSPs. Good luck. Harry Harry, Yes the ClassifiedAd and UniqueDateId are two parameters taken from an html form, the values of ClassifiedAd and UniqueDateId are used in a prepared statement for substitution of ? and ? the results are then forwarded to a results jsp, which used the getXXX() to retrieve the values from the bean. I have this code working in another form as a Servlet using JNDI and prepared statements. In the servlet the JNDI connection is made in the init(blah, blah) and calls the super.init(config) which I super.init(config) is implicit from reading the Tomcat docs. The bottom line on this, is how do you set up a JNDI connection in a bean, use a prepared statement (in a bean), retrieve a resultset and forward the result for the results jsp to retrieve the value from the bean. Finally, I apologize to those who feel this is off topic. I have similar code working in Resin but for the life of me, I can't get it working with Tomcat 5 :-( I searched all the archives and can't find a good example for doing this. TIA Tom K. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Question on debuggin JNDI/prepared statement in a bean
Tom In a servlet you have an init() statement that executes only once which you get your db connection in... I hope you are not in a fog about this: there is nothing pre-ordained about getting a connection in a servlet init method - that just happens to be where your code is. also you need to call super.init(config), where you don't have to do this in a bean, because it is implicit... Hmm... I think maybe you are in a bit of fog about all this :-) Calling 'super.init( config )' within a servlet's init method has nothing to do with database connections. Anyway, if you are prepared to post the *exact* bean code that is not working for you, I am prepared to look at it and try to help you. Posting snippets of code is not good enough. The alternative is for you to walk through your code (with println statements, or a debugger) and see where it stops working. Next challenge is I have a blob that I set and get, but when I get the blob on my results page, it comes up with... Is that the servlet providing the 'results' - or did you fix the bean? Regards Harry Not exactly...it is not the same! I have it working with a connection pool, mySQL and JNDI. To keep my reply short it goes like this within the bean: getDBConnection(); // get the connection prepareStatement(); // prepare the statement rs = pstmt.executeQuery();// execute the query and of course after that I get my parameters. In a servlet you have an init() statement that executes only once which you get your db connection in, also you need to call super.init(config), where you don't have to do this in a bean, because it is implicit. (By the way, if someone wants an example, I will post it, but you'll then be my wife.) Next challenge is I have a blob that I set and get, but when I get the blob on my results page, it comes up with something like this @1eb2473 which I assume is an address. Anyone know what know how to get, what's in the address. Maybe open a stream? TIA Tom K. -Original Message- From: Harry Mantheakis [mailto:[EMAIL PROTECTED] Sent: Friday, March 26, 2004 10:43 AM To: Tomcat Users List Subject: Re: Question on debuggin JNDI/prepared statement in a bean Hi Tom how do you set up a JNDI connection in a bean? Exactly the same way as you would anywhere else, so if you have some code working in a servlet, copy it. To be precise, it is a database connection, acquired from a DataSource, which is itself acquired via a JNDI lookup. The fact that your code is in a bean makes no difference. how do you... use a prepared statement (in a bean) Same as anywhere else. how do you... retrieve a resultset, and forward the result Again, same as anywhere else. BTW - you should not be passing about references to JDBC objects that are tethered (so to speak) to database connections - it is bad practice, and likely to cause connection (and memory) leaks. The best thing to do with database connections is, grab your data, store it in some collection object, and then make damn sure you close the db connection - usually within a 'finally' block which is guaranteed to execute, even when exceptions occur. Having stored the data you need in a collection object, you can pass that about as much as you like. That has not really answered your original question, but unless you provide us with all your relevant code we probably cannot solve the problem. Since you got it working before, I would be inclined to start again, making sure that you copy the same JNDI/connection procedures in your 'bean' as in the servlet that works. The fact that your 'bean' is not throwing any exceptions suggests, to me, that there is a bug (logic error) in your code. Starting over might sort that out. Sprinkle about a few (temporary) 'System.out.println' statements to see where your code gets to. Not cool, but they do the job sometimes! If you are using an IDE - like Eclipse - you can run in debug mode, so it's easy to see what is happening - though may be not with JSPs. Good luck. Harry Harry, Yes the ClassifiedAd and UniqueDateId are two parameters taken from an html form, the values of ClassifiedAd and UniqueDateId are used in a prepared statement for substitution of ? and ? the results are then forwarded to a results jsp, which used the getXXX() to retrieve the values from the bean. I have this code working in another form as a Servlet using JNDI and prepared statements. In the servlet the JNDI connection is made in the init(blah, blah) and calls the super.init(config) which I super.init(config) is implicit from reading the Tomcat docs. The bottom line on this, is how do you set up a JNDI connection in a bean, use a prepared statement (in a bean), retrieve a resultset and forward the result for the results jsp to retrieve the value from the bean. Finally, I apologize to those who feel
Re: JSP suggestion
Sorry, but that wouldn't help the original poster. Oh, Ralph, now you've gone and spoiled the fun. I was really enjoying this thread. He is searching for a way to include taglib definitions and imports that are used in the pages. Any kind of dynamic include or decorators wouldn't achieve that. Yes, of course, you are absolutely right :-) Regards Harry - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: catalina-ant task (deploy) question
Brice I may have got you wrong, and I cannot offer any solutions specific to your questions (because I am in a hurry!) but here is how I sorted things out for myself recently, using what I know as the Tomcat 'manager' tasks, but which I assume are the same as what you refer to as the 'catalina-ant' tasks. Basically, with my local system - used for development - I have exploded WAR files and their respective context files are *copied* from my project folder to the conf/Catalina/localhost directory. I use the Tomcat 'manager' tasks to STOP the application. Then I use a combination of ant 'sync' and 'copy' tasks to update my WAR file (and its context) from my project folder. Then I use the manager START task to get the app running again. For my deployed stuff - on a separate server - I only use packed WAR files, so my ant task is simple: - undeploy - copy new WAR file to webapps directory - deploy And that seems to automatically take care of updating the application's context file, which makes sense. HTH Harry Mantheakis London, UK I was reading up on the context.xml file yesterday in the Tomcat-5.0 documentation on the main Jakarta Tomcat site and came across the information that the context.xml file can be placed in conf/Catalina/localhost -OR- it can be placed in the META-INF directory of your web-app. Now, when I use the catalina-ant deploy task, with the localWar attribute pointing to file:///${basedir} -- where ${basedir} is the directory containing the exploded WAR for my project -- it doesn't seem to pick up that context.xml file that I've placed in the META-INF directory (leaving out the config attribute to explicitly point it to that file). I'm leaving out the config attribute, because it appears that the deploy task then copies the XML file provided to the conf/Catalina/localhost directory ... and I want to be able to drive the web-app from the context.xml file provided in the META-INF directory (so when I edit the context.xml file in META-INF, the application will reload (hot)) - to get this same effect with the context placed in conf/Catalina/localhost, I'd have to remove and re-install the context (since that file lives outside of the deployment directory, at that point). I guess I'm getting caught up in the fact that the catalina-ant tasks seem to arbitrarily limit what can be done with deploying projects to Tomcat ... versus what Tomcat's true abilities are. Any clarity here would be appreciated!! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Ant and Tomcat Manager over HTTPS
Hello Does anyone know if it is possible to use the Tomcat Manager tasks in Ant over HTTPS? I had everything working beautifully over HTTP, then I got the bright idea to get Manager to work off HTTPS only, and now my Ant tasks are all broken. I re-set Ant's Manager ULR to HTTPS//:...:8443/... But I get this error: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found Sadly, certificates are still a mystery to me. I rolled my own as per the Tomcat how-to, and for my development needs that was fine, but I never got past that stage. Now I am running my own server, and I have got to bite this bullet. Any pointers would be much appreciated! Regards Harry Mantheakis London, UK - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Ant and Tomcat Manager over HTTPS
Hi Phil Firstly, it would be nice if you could start your own thread next time instead of hijacking an existing one with your question. I am sorry you thought I had hijacked a thread - I thought I had started a new one! (Did you have a thread with the same subject name?) As for your problem: is SSL not working altogether or is it just ant complaining? Can you access the manager via a browser using https? Just Ant complaining, with the exception I mentioned: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found I can access the manager via SSL with my browser. That all works fine. Ant is unhappy. Kind regards Harry - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Ant and Tomcat Manager over HTTPS - Done!
Hi Kovi Thanks for the tip! That sorted me out :-) It took a little while (Googling, etc.) but I finally got the whole thing to work. One thing I had to do - and this is just for the record - was to make sure that my certificate's 'common name' was exactly the same as my server's host name. When Java's 'keytool' asks What is your first and last name you have to enter the server's host name (!) It took a bit of head-scratching to figure that one out, but I suppose that is not an issue with a proper certificate. Many thanks again! Harry Mantheakis London, UK Importing CA's certificate to cacerts($JAVA_HOME/jre/lib/security) should resolve your problem. Password for cacerts is changeit Best regards, Kovi -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ | Gregor Kovac |[EMAIL PROTECTED] | | In A World Without Fences Who Needs Gates? | | Experience Linux. | -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JNDI Datasource Reference in DD Not Necessary?
Hi Chris I am afraid I cannot answer most of your questions (!) but I am writing in because a couple of my earlier postings did not make it through to this mail list, and it looks like my original question remained unanswered. The question was answered, and here it is again, for the record. Basically, my initial concern on this thread was with the 'resource-ref' element in the deployment descriptor. As a reminder, this is what the resource-ref element looks like in the deployment descriptor: resource-ref descriptionMy DB DataSource/description res-ref-namejdbc/postgres/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref My understanding is that Tomcat creates a 'data-source' object and somewhere along the line wraps it up as a 'javax.sql.DataSource' object, so that when I get an 'Object' reference to the data-source object I can safely cast it to 'javax.sql.DataSource', like this: return ( DataSource )new InitialContext(). lookup( java:comp/env/jdbc/postgres ); The suggestion is that another servlet container (Weblogic, etc.) would hand over some *other* type of data-source object, unless I explicitly inform the container that I need a 'javax.sql.DataSource' type by including the 'resource-ref' element in my deployment descriptor. IOW, the 'resource-ref' element in the deployment descriptor is an insurance policy - it is not, strictly speaking, needed with Tomcat version 5, but that might not be true with future versions of Tomcat, and likely not to be true with other servlet containers. So the 'resource-ref' element is recommended for portability. I hope that helps! For the record, my thanks to Yoav Shapira for putting me straight on this. Kind regards Harry Mantheakis London, UK All, I was just about to ask a question like this thread's today... glad I read the archives. ;) I have an intersting observation in Tomcat 4.1.29. I found that my resource-ref was misnamed in web.xml, so I decided to check it out. A long time ago, I wrote a quick-and-dirty JNDI browser to help me figure out these things. Using my JNDI browser, and looking at the path java:/comp/env/jdbc I find the following entries: * DSMstandard, class = org.apache.naming.ResourceLinkRef * diagnosis, class = org.apache.commons.dbcp.BasicDataSource (I have two DataSources configured -- I have to deal w/two DBs, so they're both there). It's odd that one of them shows up as a ResourceLinkRef and the other as a BasicDataSource. (I have no resource-ref elements in my web.xml, for testing). They were defined the same way in server.xml: GlobalNamingResources Resource name=jdbc/diagnosis auth=Container type=javax.sql.DataSource/ Resource name=jdbc/DSMstandard auth=Container type=javax.sql.DataSource/ (I'll spare you the details of the ResourceParams, but they are identical except for the name used). /GlobalNamingResources N.B.: I have my Resource declaration in GlobalNamingResources because I need to use it for my Realm. Apparently, Resources defined within a Context that will use it as a Realm don't work well -- at least this was my experience. I found that putting the resource in the global resources and then using a ResourceLink did the trick. Then, later, within the Context that will be using these, I had to add these: ResourceLink name=jdbc/diagnosis global=jdbc/diagnosis type=javax.sql.DataSource / ResourceLink name=jdbc/DSMstandard global=jdbc/DSMstandard type=javax.sql.DataSource / Why wouldn't I get both BasicDataSource objects, or both ResourceLinkRef objects? I thought it may have to do with the fact that I have the same name for the global reference and the local reference, so I changed the global references to jdbc/[dbname]-global and re-started. I got the exact same stuff in that JNDI context. Can anyone explain what's going on? Logically, I would expect the following: 1. Resource elements in the GlobalNamingResources would show up for all Contexts. If this is true, then why do I need ResourceLink in my context? 2. ResourceLink elements in a Context grant access to a globally-defined resource to that particular Context. Makes sense -- maybe you have a global resource for convenience, but it's a security issue to grant that resource to *any* webapp running on the server. So, if this is true, why don't I get two objects of type ResourceLinkRef in my context's JNDI namespace? Instead, I get one DataSource and one ResourceLinkRef. 3. resource-ref elements in web.xml should map the local name of a resource (the one you use from your webapp in JNDI lookups) to the resource mentioned in the Context's ResourceLink element. So, if all that's true, then here's what happens: Resource defines the canonical name for the resource. ResourceLink grants the resource to a particular webapp
Re: JNDI Datasource Reference in DD Not Necessary?
Hi Yoav I am on a 24 hour response cycle at the moment, because my ISP is saving up all the Tomcat-User emails and giving them to me once a day somewhere between the time I go to bed and the time I get up! This morning I had about 160 'new' messages :-) It allows the container to map your portable descriptor in web.xml to its specific instance in the container (which is defined in server.xml). So resource-ref is the same for your app in your dev, test, and production environments, on tomcat, weblogic, websphere, etc. But the container-specific configuration elements change. It's a way to map container-specific resources in a portable and consistent manner. See also env-entry-ref... Thank you for that explanation. (I always value your time.) I read it a couple of times, and pondered it for a while, and in the end I think I understood it (!) Bearing in mind this is what the resource-ref element looks like in the deployment descriptor: resource-ref descriptionMy DB DataSource/description res-ref-namejdbc/postgres/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref My understanding of it is that, even though I can get away without declaring that element in my Tomcat deployment, I would need to restore it if I was to deploy my application to (say) Weblogic, Websphere, etc. That implies that the 'container-specific configuration' in Tomcat is to actually use 'javax.sql.DataSource' as the resource type. IOW, the Tomcat container creates a 'data-source' object and somewhere along the line it wraps it up as a 'javax.sql.DataSource' object, so that when I get an 'Object' reference to it I can safely cast it to 'javax.sql.DataSource'. That is what happens when I call: return ( DataSource )new InitialContext(). lookup( java:comp/env/jdbc/postgres ); The suggestion is that on another container (Weblogic, etc.) would handed some *other* type of data-source object, unless I informed the container that I need a 'javax.sql.DataSource' type by including the resource-ref element in my deployment descriptor. If that 'understanding' is correct, Yoav, just say 'yes' or 'yep' or something simple like that :-) Kind regards Harry Mantheakis London, UK - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JNDI Datasource Reference in DD Not Necessary?
Hi Dave Sorry for my long absence - I was away from my computer for while. I think Doug's last message just about says it all in respect of connection pools. Follow his advice to use the Tomcat How-Tos exactly as they are, and you should be okay. I looked through your code - the stuff you originally posted following my suggestion to do so - and I did spot one crucial mistake. This line in your test JSP: DataSource ds = ( DataSource ) ctx.lookup(java:comp/env/jdbc/MyDS ); Should read: DataSource ds = ( DataSource ) ctx.lookup(java:comp/env/jdbc/mysql ); Spot the difference? :-) The jdbc/mysql context refers to the name given to the resource in the context.xml: Resource name=jdbc/mysql type=com.mysql.jdbc.jdbc2... auth=Container/ I would also urge you to go back to using the Commons DBCP resources, and specifying the jdbc/mysql resource as in the Tomcat How-To - namely, this definition: Resource name=jdbc/mysql type=com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource auth=Container/ Should read: Resource name=jdbc/mysql auth=Container type=javax.sql.DataSource/ And this ResourceParams element: parameter namefactory/name value com.mysql.jdbc.jdbc2.optional.MysqlDataSourceFactory /value /parameter Should read: parameter namefactory/name value org.apache.commons.dbcp.BasicDataSourceFactory /value /parameter Stick to the Tomcat How-Tos, using the Commons DBCP package, at least until you get the thing working, and then you can switch if you want. Finally, just a suggestion, but I would specify the minimum possible for the 'url' attribute: parameter nameurl/name value jdbc:mysql://localhost:3306/DATABASE /value /parameter Keep it simple, to start with :-) because it could just be one of those non-essential parameters is causing the thing to break. Good luck! Harry Despite my posting - and I really hope someone chips in concerning the question I raised about the resource-ref being redundant in the deployment descriptor (!) - the first thing to say is, have faith! Connection pooling works, and it is actually quite simple, so do not give up on it. Cheers for the advice Harry... here's where I'm at I have no choice on the giving up side of things, need to implement it for some client code I'm working on ;-) I've been doing a lot of googling to try and get answers so I may have got crossed wires, I had a version working (or thinking it was working) with the info in $JAKARTA_HOME/conf/server.xml but I wasn't happy with this solution (preferring to have the connection defined in $JAKARTA_HOME/conf/Catalina/localhost/app_name.xml for good reasons... so I'm basically restarting and I now have the following config $JAKARTA_HOME/conf/Catalina/localhost/app_name.xml ?xml version='1.0' encoding='utf-8'? Context docBase=dev-sstl path=/dev-sstl reloadable=true useNaming=false Resource name=jdbc/mysql type=com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource auth=Container/ ResourceParams name=jdbc/mysql parameter namefactory/name valuecom.mysql.jdbc.jdbc2.optional.MysqlDataSourceFactory/value /parameter parameter nameport/name value3306/value /parameter parameter nameuser/name valueUSERNAME/value /parameter parameter namepassword/name valuePASSWORD/value /parameter parameter nameserverName/name valuelocalhost/value /parameter parameter namedatabaseName/name valueDATABASE/value /parameter parameter nameexplicitUrl/name valuetrue/value /parameter parameter nameurl/name valuejdbc:mysql://localhost:3306/DATABASE?autoReconnect=trueamp;useUnicode= trueamp;characterEncoding=UTF8amp;max-connections=50amp;min-connections=2a mp;inactivity-timeout=30amp;wait-timeout=30/value /parameter /ResourceParams /Context The info for the above i gleaned from http://www.russellbeattie.com/notebook/1006529.html Then in web_app/WEB-INF/web.xml I have ?xml version=1.0 encoding=ISO-8859-1? web-app xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd; version=2.4 resource-ref descriptionDB connection/description res-ref-namejdbc/mysql/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref /web-app Then in my test JSP I have try { Context ctx = new InitialContext(); DataSource ds = ( DataSource ) ctx.lookup(java:comp/env/jdbc/MyDS ); Connection conn = ds.getConnection(); ... And the error I get is javax.servlet.ServletException: Name java:comp is not bound in this Context Which is an error I've managed to hit several times, I know the whole connection pooling is the right way to go about this, just
Re: JNDI Datasource Reference in DD Not Necessary?
Hi Yoav Thanks for your message. I'm fairly sure you'd understand them just fine ;) It's SRV.9.11 in the Servlet Specification 2.4 and J2EE.5 in the J2EE Specification v1.4. Okay, I shall look at those and see what happens :-) Even though in tomcat's current implementation resource-ref might not be strictly required under certain conditions, you should include it as the tomcat documentation suggestions, for completeness, portability, and spec compliance. Yes, point taken. I was really trying to figure out what resource-ref is meant for - hopefully the specs will sort me out. I shall post a follow up in due course. Kind regards Harry Hi, I use Tomcat as a stand-alone server, but in the back of my mind I know there are J2EE specifications that Tomcat is adhering to which I am likely not to understand. I'm fairly sure you'd understand them just fine ;) It's SRV.9.11 in the Servlet Specification 2.4 and J2EE.5 in the J2EE Specification v1.4. Even though in tomcat's current implementation resource-ref might not be strictly required under certain conditions, you should include it as the tomcat documentation suggestions, for completeness, portability, and spec compliance. 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: JNDI Datasource Reference in DD Not Necessary?
Hi Yoav I'm fairly sure you'd understand them just fine ;) Well, I read both specs, the J2EE section 5.4 being the relevant one here, and I am sorry to say but I think I am a little more confused now than before! It was good to see this bit of succinct code being sanctioned: javax.sql.DataSource ds = (javax.sql.DataSource) initCtx.lookup(java:comp/env/jdbc/EmployeeAppDB); I actually arrived at that on my own, so I guess my Java instincts are not so bad after all. What I cannot figure out is: what does the 'resource-ref' element in the deployment descriptor *actually* do? What is its function, and am I breaking something by not having it there at all? You wrote: Even though in tomcat's current implementation resource-ref might not be strictly required under certain conditions, you should include it as the tomcat documentation suggestions, for completeness, portability, and spec compliance. Which suggests that *perhaps* for a stand-alone Tomcat server this element is not needed. I guess I might (time permitting) post a question on Server-Side and see if one of the J2EE boffins can shed any light on this. Please do not get me wrong about this: I am just trying to understand what the code I am using in my application is doing - or not doing :-) Many thanks, and kind regards BTW - the Ant 'filtering' trick you put me onto works a treat. Fantastic. Ant should be mandatory learning! Harry Mantheakis London, UK Hi, I use Tomcat as a stand-alone server, but in the back of my mind I know there are J2EE specifications that Tomcat is adhering to which I am likely not to understand. I'm fairly sure you'd understand them just fine ;) It's SRV.9.11 in the Servlet Specification 2.4 and J2EE.5 in the J2EE Specification v1.4. Even though in tomcat's current implementation resource-ref might not be strictly required under certain conditions, you should include it as the tomcat documentation suggestions, for completeness, portability, and spec compliance. 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: newbie need help whit server naming
is there a way to rite the server name instead off the ip address in the address bar? Yes, if the server name is mapped to the server's IP address :-) Somewhere along the line, the 'name' has to be converted into an IP address, which is what DNS is all about. In a (small) local network you can do your own convenience mapping in the hosts files. Good luck Harry - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Application directory outside webapp in tomcat
With Tomcat 5 you specify the 'docbase' in the META-INF/context.xml file. Is that possible to have application directory located outside the default webapp directory inside tomcat? How to configure the server.xml to do it? I've tried to do that but failed. Please help. Kenneth - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JNDI Datasource Reference in DD Not Necessary?
Hi Dave Despite my posting - and I really hope someone chips in concerning the question I raised about the resource-ref being redundant in the deployment descriptor (!) - the first thing to say is, have faith! Connection pooling works, and it is actually quite simple, so do not give up on it. I've tried having the connection defined in $JAKARTA_HOME/conf/server.xml and in $JAKARTA_HOME/Catalina/localhost/app_name.xml Stick to the app-name.xml - do not put anything in the server.xml. You need to tell us what errors you are getting. It will also help if you copy and paste the *exact code* elements from the app-name.xml, and the method that is trying to look up the DataSource. The context fragment bit should look like this: Resource name=jdbc/postgres auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/postgres ... /ResourceParams The deployment descriptor bit should look like this: resource-ref descriptionDB Connection/description res-ref-namejdbc/postgres/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref And then the JNDI lookup method should look like this: public DataSource getDataSource() { try { return ( DataSource )new InitialContext(). lookup( java:comp/env/jdbc/postgres ); } catch ( ... ) { ... } } The above can be written in a more long-winded way, but that one line does the job. Harry I have to say I'm having a large number of issues with JNDI and MySQL I'm using TC 5 on Fedora Core 1 with the JDBC / MySQL 3.1.1 Alpha Connector (after I had no luck getting the 3.0.11 Stable connector working either) I've been looking at various how-to's and other doco on the whole thing but don't seem to be getting very far with the whole thing. I've tried having the connection defined in $JAKARTA_HOME/conf/server.xml and in $JAKARTA_HOME/Catalina/localhost/app_name.xml I have resource-ref defined in the app_name/WEB-INF/web.xml but in spite of all this I seem to be getting nowhere... (which is a pain) I've managed to create a straight JDBC connection though so I know that the DB is accepting connections on the relevant user. TIA - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JNDI Datasource Reference in DD Not Necessary?
Hi Yoav The documentation is updated, but of course no documentation set is ever perfect. If you have documentation patches, please suggest them in the usual format (http://jakarta.apache.org/site/source.html#Patches) as all our docs are in CVS (http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-catalina/webapps/docs/ ). Thanks, Yoav Shapira I'd be happy to help with the documentation, except I want to make sure I am not overlooking something - possibly something vital! I use Tomcat as a stand-alone server, but in the back of my mind I know there are J2EE specifications that Tomcat is adhering to which I am likely not to understand. My initial question concerned the resource-ref element in the deployment descriptor being redundant, at least with Tomcat set up as a stand alone server. Is it redundant, or am I missing something? If it is redundant, I shall happy to write some amended documentation and offer it up. Many thanks, and kind regards Harry Mantheakis London, UK - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Your Message to tomcat-user@jakarta.apache.org is Blocked
do sombody else received that antivirus publicity ? Yes, I did. Very suspicious - it had several grammatical and spelling errors. Harry - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
JNDI Datasource Reference in DD Not Necessary?
Hello For some time now I have implemented the Tomcat 'JNDI DataSource' How-To on connection pooling, and everything has been fine. I define a resource in the context fragment: Resource name=jdbc/postgres auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/postgres ... /ResourceParams And a resource reference to it in the deployment descriptor: resource-ref descriptionDB Connection/description res-ref-namejdbc/postgres/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref And then do a JNDI lookup at runtime: return ( DataSource )new InitialContext(). lookup( java:comp/env/jdbc/postgres ); Magic. The other day I noticed that the resource reference in my deployment descriptor was actually broken - the name did not match that defined in the context - and yet my application was still working - perfectly. When I thought about it, it occurred to me that the resource reference in the deployment descriptor may not actually be necessary. So I deleted the resource reference from the web.xml file, and everything still works as expected. Can anyone enlighten me? Many thanks in anticipation. Harry Mantheakis London, UK - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Driver class not found
If you name it *.zip, it will definitely NOT be found in common/lib, shared/lib, or anywhere else. Tomcat only loads *.jar files. Yes, you are right (!) I'm sorry, but my memory let me down there: it used to be that Oracle supplied its driver as a '.zip' file and you simply had to re-name the file to '.jar'. I really slipped out of gear there :-) Harry If you name it *.zip, it will definitely NOT be found in common/lib, shared/lib, or anywhere else. Tomcat only loads *.jar files. For some strange reason It's not strange if you're trying to make a container configured DataSource. -Original Message- From: Harry Mantheakis [mailto:[EMAIL PROTECTED] Sent: Thursday, March 04, 2004 8:05 AM To: Tomcat Users List Subject: Re: Driver class not found Hello After adding class12.jar in setclasspath.bat file I am I would undo that - that should not be necessary. Try re-naming 'Clasess12.jar' to 'Clasess12.zip' and place the 'zip' file in the $CATALINA_HOME/common/lib directory. Make sure you do NOT have another copy of this 'zip' file (at the same time) in your application's WEB-INF/lib directory. For some strange reason I found that with the Oracle drivers I HAD to keep them in $CATALINA_HOME/common/lib - and NOT in my application's WEB-INF/lib directory. You might also want to consider downloading one of the more recent Oracle drivers, which are now correctly named as '.jar' files. The '*14' driver (I cannot remember the exact name) relates to Java 1.4 and is compatible with Oracle 8i. Good luck. Harry Mantheakis London, UK Hi After adding class12.jar in setclasspath.bat file I am getting below error. I have copied Clasess12.jar in Common\lib directory. DBConnection - getConnection()namingexception caught: Name jdbc is not bound in this Context com.ge.voc.util.SqlBean.executeQuery() outer caught: No suitable driver. SQL sta te = 08001, error code = 0 java.sql.SQLException: No suitable driver at java.sql.DriverManager.getConnection(DriverManager.java:532) at java.sql.DriverManager.getConnection(DriverManager.java:171) at com.ge.voc.util.DBConnection.getConnection(DBConnection.java:53) DBConnection - getConnection()namingexception caught: Name jdbc is not bound in this Context com.ge.voc.util.SqlBean.executeQuery() outer caught: No suitable driver. SQL sta te = 08001, error code = 0 Can anyone pls help me to solve this problem Thanks Bikash --- Bikash Paul [EMAIL PROTECTED] wrote: Hi, Iam using Tomcat5.0 and iam trying to connect oracle8i Data base through Datasource and I have created one Datasource using administrator tool of Tomcat using oracle driver and I have kept my driver classes12.jar file in common\lib folder and also in server\lib folder but still it giving me error that java.lang.ClassNotFoundException :oracle.jdbc.driver.OracleDriver.Can any one please tell me is there any class path setting require for that if it is require then in which file.Eagerly waiting for reply. Thanks Regards Bikash __ Do you Yahoo!? Yahoo! Search - Find what you?re looking for faster http://search.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Search - Find what you?re looking for faster http://search.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: invoker servlet question
The Tomcat FAQ has a cautionary note about the invoker servlet: http://jakarta.apache.org/tomcat/faq/misc.html#evil call http://localhost:8080/web_app_context/servlet/servlet_name That *should* work, assuming servlet_name is the fully qualified name of the servlet you are trying to invoke. (And assuming everything else is correct, too.) I do not wish to change the web apps WEB.XML file just for testing. Registering and mapping servlets in the deployment descriptor is correct thing. A servlet is not much use if you do not at least register it - that allows you to forward requests to it from other servlets. Mapping is optional: it allows you to invoke the servlet with a URL, which is what a browser does. Is there a simple way to test a servlet, where I can create a servlet, put it someplace and call it via a standard URL?? Register a servlet, and call it (say) Test: servlet servlet-name Test /servlet-name servlet-class com.foo.bar.MyNewServlet /servlet-class /servlet Then specify a convenient mapping: servlet-mapping servlet-name Test /servlet-name url-pattern /test /url-pattern /servlet-mapping That allows you to invoke MyNewServlet with just '/test' in the URL. When you want to test another servlet, just replace the fully qualified name 'com.foo.bar.MyNewServlet' to that of the newer servlet. Good luck.. Harry Mantheakis London, UK I don't understand the invoker servlet. I understand that you have to uncomment it from the default web.xml file (did that). BUT, If I create a servlet and put it web_app_context/WEB-INF/classes, then call http://localhost:8080/web_app_context/servlet/servlet_name WHY does that not work?? I simply want to test a servlet - I do not wish to change the web apps WEB.XML file just for testing. Is there a simple way to test a servlet, where I can create a servlet, put it someplace and call it via a standard URL?? - 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: Loosing sessions when poping a window
I'm still trying to figure out how Tomcat sees a new window as a new session I do not think Tomcat sees anything more than what is sent to with the request. As I understand it, if the browser does not send a session cookie id, Tomcat will not be able to associate the request with any of its existing session objects. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Driver class not found
Hello After adding class12.jar in setclasspath.bat file I am I would undo that - that should not be necessary. Try re-naming 'Clasess12.jar' to 'Clasess12.zip' and place the 'zip' file in the $CATALINA_HOME/common/lib directory. Make sure you do NOT have another copy of this 'zip' file (at the same time) in your application's WEB-INF/lib directory. For some strange reason I found that with the Oracle drivers I HAD to keep them in $CATALINA_HOME/common/lib - and NOT in my application's WEB-INF/lib directory. You might also want to consider downloading one of the more recent Oracle drivers, which are now correctly named as '.jar' files. The '*14' driver (I cannot remember the exact name) relates to Java 1.4 and is compatible with Oracle 8i. Good luck. Harry Mantheakis London, UK Hi After adding class12.jar in setclasspath.bat file I am getting below error. I have copied Clasess12.jar in Common\lib directory. DBConnection - getConnection()namingexception caught: Name jdbc is not bound in this Context com.ge.voc.util.SqlBean.executeQuery() outer caught: No suitable driver. SQL sta te = 08001, error code = 0 java.sql.SQLException: No suitable driver at java.sql.DriverManager.getConnection(DriverManager.java:532) at java.sql.DriverManager.getConnection(DriverManager.java:171) at com.ge.voc.util.DBConnection.getConnection(DBConnection.java:53) DBConnection - getConnection()namingexception caught: Name jdbc is not bound in this Context com.ge.voc.util.SqlBean.executeQuery() outer caught: No suitable driver. SQL sta te = 08001, error code = 0 Can anyone pls help me to solve this problem Thanks Bikash --- Bikash Paul [EMAIL PROTECTED] wrote: Hi, Iam using Tomcat5.0 and iam trying to connect oracle8i Data base through Datasource and I have created one Datasource using administrator tool of Tomcat using oracle driver and I have kept my driver classes12.jar file in common\lib folder and also in server\lib folder but still it giving me error that java.lang.ClassNotFoundException :oracle.jdbc.driver.OracleDriver.Can any one please tell me is there any class path setting require for that if it is require then in which file.Eagerly waiting for reply. Thanks Regards Bikash __ Do you Yahoo!? Yahoo! Search - Find what you?re looking for faster http://search.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Search - Find what you?re looking for faster http://search.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Where to store log files from packed WAR file apps
Hello Now that I've got my Ant build/deploy scripts working nicely, I'm tempted to start running my applications out of packed WAR files. I cannot figure out if there is a *portable* way to specify paths for where my Log4J log files should be saved. I assume I could use the 'catalina.home' property to save the logs under the Tomcat installation directory - but that's Tomcat specific. Has anyone got around this, somehow, or is it a case of getting Ant to glue things with some hard-coded values at build time? Many thanks for any contributions. Harry Mantheakis London, UK - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Where to store log files from packed WAR file apps
Thanks to everyone for the replies to my question! Lots there for me to look into - JNDI, Alpha_2, and Chainsaw. Phew! Sorry, for *my* slow response: my ISP has dropped all my mail today, of all days - so I went online to get your answers. Regards Harry Mantheakis London, UK - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Where to store log files from packed WAR file apps
Thanks to everyone for the replies to my question! Lots there for me to look into - JNDI, Alpha_2, and Chainsaw. Phew! Sorry, for *my* slow response: my ISP has dropped all my mail today, of all days - so I went online to get your answers. Regards Harry Mantheakis London, UK - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: (was: similar problem) Connection Pool Dies
This is a follow-up message, for the record. Following Antonio Fiol's kind prompting, I added the following Commons-DBCP elements to the DataSource resource parameters specified in my application's context fragment: validationQuery -- select 'x' from dual testWhileIdle -- true timeBetweenEvictionRunsMillis -- 60 numTestsPerEvictionRun -- 10 minEvictableIdleTimeMillis -- 60 And I'm glad to say that my web application has maintained its connection(s) despite being idle for several hours, overnight. I logged in immediately this morning. It seems easy enough once you know how, but I suppose trying to wear both developer and administrator hats is a bit of a tall order: there is just so much stuff! Good stuff, I hasten to add. Really good stuff :-) Thanks again to Antonio, and the others who responded. Kind regards Harry Mantheakis London, UK Hi Harry, I'm going to try and hijack this thread if I may (!) because, as you say... Welcome! ;-) [...] The other Tomcat server runs on a Red Hat 9 machine at my home. It connects to the above Oracle DB box - far away - using the same static IP address. [...] The problem is with the the DB connections on my own RH9 server - they just *die* after a period of inactivity :-( That period of inactivity can be as little as half and hour. [...] Very typical behaviour... at least in our scenario. BTW - the 'first' login attempt (which reactivates the connection pooling) never gets a response - it just times out. Very true. Do you think you can shed any light on this? I'll try. I have read just about every single forum discussion - from Tomcat-User to Commons DBCP to you-name-it, and I just cannot find the answer. I have a very strict firewall policy on my Linux box - using iptables. Only port 80 packets get through. Nothing else. Does that have something to do with my problem? Is there an ICMP port that I need to open up? Nope. No ICMP is needed for keepalives. The reason of your headaches may be in /proc/sys/net/ipv4/netfilter There, you have several timeout values. Check ip_conntrack_tcp_timeout_established. Anyway, however high you set the values in there, there will be an upper limit. So, I think you need to avoid your connection being idle, so that your firewall does not drop it, even with low timeout values. To do that, I suggest to use the mechanism provided by DBCP to test idle connections every now and then. testWhileIdle -- true validationQuery -- select 'x' from dual timeBetweenEvictionRunsMillis -- 30 (five minutes. Or longer, as far as it works...) On Monday, I may send you out production values. Now I don't have them, so I worked out some ;-) I am not sure whether you will need to set some more parameters. The authoritative source of information is: http://jakarta.apache.org/commons/dbcp/configuration.html Other sources (link below) say that you also have to set numTestsPerEvictionRun. I'd suggest a value equal to maxIdle. http://www.mail-archive.com/[EMAIL PROTECTED]/msg05339.html And he also proposes another solution (which I have not tested): --- You can prevent that your firewall from dropping the connection using a oracle technique. SQL*Net has a parameter which defines time interval to send a probe message to identify if the client process is still alive - SQLNET.EXPIRE_TIME, sqlnet.ora file on the server side. SQLNET.EXPIRE_TIME = your_value Set it to something like 30 when your firewall drops connection after 60 minutes. --- I hope that helped. Antonio Fiol - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Relative links do not work with controller servlet.
Hi Jurgen I want to run all requests through a controller servlet. That's a good thing to do, and I do it the same way - using extra path information to determine where to send a request once the controller receives it. I happen to have some cribs on this subject, so here goes... When a Servlet forwards a request to a JSP, the JSP document is read 'out of context' and the relative HTML links in that document cannot be interpreted. Typically this means that images fail to load, and style sheet definitions are not enforced. The relative HTML links in the JSP are 'broken'. I *think* this is your problem. The solution is to specify a 'base URL' for all the links in a JSP document. The HTML BASE element - which must be placed within the HEAD element of an HTML document - serves this purpose. Using the BASE element will help ensure your image and CSS links are not broken when a Servlet forwards a request to a JSP. It will also make your JSPs more portable, by allowing you to specify relative URLs for all your resource links. The value of the HREF attribute in the BASE element must be an absolute URI. The following example illustrates the HREF attribute being set with a hard coded literal value: head base href=http://localhost:8080/; /head Note the trailing slash, just after the port number. This is necessary. The above example assumes you are using the default 'ROOT' context in a Servlet container running locally. (The port number '8080' is the Tomcat default. If you are using port '80' you do not need to specify the port number in the URI.) If your application has its own context, then you must add the context name to the URI: head base href=http://localhost:8080/context-name/; /head Again, note the trailing slash, just after the context name. The above examples illustrate the use of hard-coded literal values to set the base URL. If the web application were to be deployed to another server, with a different base URL, one would have to edit each and every JSP that specified a base URL. In a large application that would be a tiresome and error-prone exercise! There is a simple solution to this problem: You can dynamically retrieved the base URL from the ServletContext initialisation parameters at runtime: % String baseURL = application.getInitParameter( baseURL ); % And then set the HREF attribute value with a JSP expression: head base href=%= baseURL % /head I have a custom tag that takes care of this in all my JSPs. Initialisation parameters are defined in a web application's 'web.xml' deployment descriptor file. If the base URL were to change, one would simply edit the 'web.xml' parameter, and leave the JSPs untouched! When you specify a base URL you must take care to specify relative URLs correctly for all the links in a JSP document. The fundamental rule is: do NOT use leading forward slashes in the URLs. An image file named 'flower.gif' located in the context root directory would be referenced as follows: img src=flower.gif Notice there is no leading forward slash. The same rule applies to links for HTML and JSP documents located in the context root directory: a href=shopping.jspimg src=basket.gif/a If a link is to a resource that is located in a sub-directory, forward slashes are used to delineate the pathname, but a slash is still not required at the start of the URL: img src=images/flower.gif In the above example, the 'flower.gif' file is assumed to be located in a folder named 'images' which is itself located in the context root directory. Finally, this is how you would specify a raw link to a Servlet named 'Login' that is packaged under the ubiquitous 'com.foo.bar' name: form action=servlet/com.foo.bar.Login method=post Servlets can (and should) be registered and mapped in a web application's 'web.xml' deployment descriptor file. This enables you to reference them with simple names. For example, if the above 'com.foo.bar.Login' Servlet was mapped to /login, then the link to this Servlet would be: form action=login method=post Again, notice there is no leading forward slash. Good luck. Harry Mantheakis London, UK The requests should be like /controller/dir/fileXXX.html This is done with a servlet-mapping servlet-nameController/servlet-name url-pattern/controller/*/url-pattern /servlet-mapping request.getPathInfo() is dir/fileXXX.html fileXXX.html in reality are JSPs, which the Controller servlet forwards to. In the JSPs are relative links to images and CSS. Well, as in the browsers view the html files are below /controller, it requests these relative links also below /controller, but the controller cannot and should not handle CSS and images. This problem surfaces often in the newsgroups, but I did not find a solution. Is there a good, portable solution to the problem ? Ideally would be a url-pattern-exclude*.css,*.jpg,*.gif/url
Re: Very Very Slow performance of Tomcat - Connection Pool Dies
Hi Antonio I'm going to try and hijack this thread if I may (!) because, as you say... Otherwise, you will bang your head against a wall. And that causes headache ;-) And I *do* have a headache with a problem that might be related to what you are talking about. Basically, I have deployed the *same web application* on two different machines running Tomcat, both of them connecting to the *same remote database* using the usual JNDI connection pooling mechanism. One Tomcat server runs on a Windows 2000 machine, and it sits next to the box that runs the Oracle database. The Oracle DB box has its own static IP address. The other Tomcat server runs on a Red Hat 9 machine at my home. It connects to the above Oracle DB box - far away - using the same static IP address. Now, the DB connections on the Windows server are *always* available, even after long periods of inactivity. IOW the DBCP connection pooling works fine. I can log in at 4.00 am in the morning, and the connections respond immediately. The problem is with the the DB connections on my own RH9 server - they just *die* after a period of inactivity :-( That period of inactivity can be as little as half and hour. On my machine, I have to 're-establish' the connection pooling by making a login request, waiting for about a minute, and then starting a *new* login request. Then it works until the next period of inactivity. BTW - the 'first' login attempt (which reactivates the connection pooling) never gets a response - it just times out. Do you think you can shed any light on this? I have read just about every single forum discussion - from Tomcat-User to Commons DBCP to you-name-it, and I just cannot find the answer. You also wrote: If your firewall drops idle connections after some time, you will need to tune a couple of settings. In your sysctl settings for the Apache machine, set your tcp keepalive time to a value lower than the drop time of your firewall. I have a very strict firewall policy on my Linux box - using iptables. Only port 80 packets get through. Nothing else. Does that have something to do with my problem? Is there an ICMP port that I need to open up? I shall be very grateful for any help you can offer, and thank you for your time so far. Kind regards Harry Mantheakis London, UK - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: (was: similar problem) Connection Pool Dies
Thank you Antonio (!) Your suggestions sound very plausible - I shall look into them and I promise to post a follow up (for the record) in due course, though it might take me a couple of days. Many thanks indeed, and kind regards Harry Mantheakis London, UK Hi Harry, I'm going to try and hijack this thread if I may (!) because, as you say... Welcome! ;-) [...] The other Tomcat server runs on a Red Hat 9 machine at my home. It connects to the above Oracle DB box - far away - using the same static IP address. [...] The problem is with the the DB connections on my own RH9 server - they just *die* after a period of inactivity :-( That period of inactivity can be as little as half and hour. [...] Very typical behaviour... at least in our scenario. BTW - the 'first' login attempt (which reactivates the connection pooling) never gets a response - it just times out. Very true. Do you think you can shed any light on this? I'll try. I have read just about every single forum discussion - from Tomcat-User to Commons DBCP to you-name-it, and I just cannot find the answer. I have a very strict firewall policy on my Linux box - using iptables. Only port 80 packets get through. Nothing else. Does that have something to do with my problem? Is there an ICMP port that I need to open up? Nope. No ICMP is needed for keepalives. The reason of your headaches may be in /proc/sys/net/ipv4/netfilter There, you have several timeout values. Check ip_conntrack_tcp_timeout_established. Anyway, however high you set the values in there, there will be an upper limit. So, I think you need to avoid your connection being idle, so that your firewall does not drop it, even with low timeout values. To do that, I suggest to use the mechanism provided by DBCP to test idle connections every now and then. testWhileIdle -- true validationQuery -- select 'x' from dual timeBetweenEvictionRunsMillis -- 30 (five minutes. Or longer, as far as it works...) On Monday, I may send you out production values. Now I don't have them, so I worked out some ;-) I am not sure whether you will need to set some more parameters. The authoritative source of information is: http://jakarta.apache.org/commons/dbcp/configuration.html Other sources (link below) say that you also have to set numTestsPerEvictionRun. I'd suggest a value equal to maxIdle. http://www.mail-archive.com/[EMAIL PROTECTED]/msg05339.html And he also proposes another solution (which I have not tested): --- You can prevent that your firewall from dropping the connection using a oracle technique. SQL*Net has a parameter which defines time interval to send a probe message to identify if the client process is still alive - SQLNET.EXPIRE_TIME, sqlnet.ora file on the server side. SQLNET.EXPIRE_TIME = your_value Set it to something like 30 when your firewall drops connection after 60 minutes. --- I hope that helped. Antonio Fiol - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JDK Versions
It might run on 1.3, but why not go for 1.4.2? Wich Version JDK must be installed to run Tomcat 5.0.18. Does Tomcat 5.0.18 run with JDK 1.3? Greetings Stephan Melchior Es wird immer weitergehen, Musik als Träger von Ideen! - 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: no ojdbc14 in java.library.path, Help I'm stuck trying to write this servlet!
I had this problem, and got it work by having the ojdbc14.jar in the '$CATALINA_HOME/common/lib' directory ONLY. If I kept a copy of ojdbc14.jar in my application's 'WEB-INF/lib' directory, the thing just did not work. Strange. I cannot explain it! Harry Mantheakis London, UK Hey All. I've been trying to write a servlet that uses a jdbc driver to connect to a remote Oracle server. I've manage to compile my own standalone app to connect to the DB. I included the ojdbc14.jar in my classpath and everything seemed to work fine. I can't seem to get the same code to work in a servlet with tomcat 5, and I'm pretty sure it's because tomcat does not know where ojdbc14.jar is. I've put it in server/lib and /bin and common/lib, but to no avail. Using the web tool, I've added the ojdbc14.jar file with multiple paths and i've still got nothing. Any help would be appreciates. I'm running this on Linux with tomcat 5, Oracle 9i and apache 1.3.29. Regards, Jeremie - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Stopping repeating requests
I use a system where a servlet sets a 'token' (a random number attribute) which the JSP must return (using a hidden form field attribute) to the servlet when the form is submitted. The servlet keeps a copy of the token. The servlet checks the token sent by the JSP with its own (current) copy. If the two match, the form is processed, otherwise it is rejected. When the servlet processes a form-submit request, it always discards the current token, so that it can never be reused. It means, of course, that you have to design things so that the same 'controller' servlet is used to both display the JSP (after it sets the token) and then to handle the form submit from it. It works for me. Harry Mantheakis London, UK Hi, I have a problem where a user enters data into a form and then submits this to the server, which in turn wrights this content into a database. The problem I have is that if the user then refreshes the page via F5 then it adds the same data in again. Is there any way to ensure that this does not occur. Any help would be greatly appreciated. Thanks Pete - 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: Configuring a Data Resource in web.xml
I not think you can put the JNDI/Resource stuff in the deployment descriptor, though I stand to be corrected (!) AFAIK the JNDI/Resource stuff is placed within an application's 'Context' element. With Tomcat 5 you can have separate context fragments - individual XML documents - for each application. Context fragments are cool because you can update them without having to touch the server's configuration file (server.xml). Context fragments reside in $CATALINA_HOME/conf/Catalina/host directory where host is the name of the relevant host specified in server.xml. The default host setting is 'localhost'. I hope that helps! Harry Mantheakis London, UK The reference book I have shows how to configure a data resource (JDBC) in the server.xml. Does anyone have a reference on how to do this in the web.xml? I'd like to be able to unpack a war and have everything run, without the need to edit the server.xml. Thanks for your help. Mike __ Do you Yahoo!? Yahoo! Finance: Get your refund fast by filing online. http://taxes.yahoo.com/filing.html - 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: Configuring a Data Resource in web.xml
Well, get ready to start standing I knew about the bit that goes in the deployment descriptor (!) It was 'the rest' I was referring to :-) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How Servlets work?
Hello how the webserver handles more than one request at the same time. The answer is: by invoking the servlet's service method in a new thread for each new request to that servlet. Think of any Java object, instantiated once - a public method in that object can be called any number of times, concurrently. Each invocation will be processed in a new thread. Synchronisation is an issue only when the method in question uses references to other objects. If the method only works with local variables, there is no synchronisation problem! So, in a nutshell: with servlets, make sure the service method only uses local variables, including, of course, those two most useful parameters, the request and the response objects. Regards Harry Mantheakis London, UK Hi all, may be not the right place to ask this question. Hope somebody is kind enough to clarify this doubt of mine. i understand, in a servlet, if i need any code to be thread safe, then i shud put that code inside a synhronized block or declared the entire method as synchronized. if my understanding is right, only instance of our serlvet class is being created. in that case how the webserver handles more than one request at the same time. i mean, is some queuing structure being followed, (i am tempted to believe it is not multithreaded)? Could anybody clarify this doubt of mine or atleast point out some ref. material for this. Thanks R.Saravanan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to write to a properties file
Hi Yoav One possible alternative is to have the properties file outside the webapp (or better yet, change from properties file to a database?), and configure the location of the file using one of the above approaches. That way you can still deploy a packed WAR, write/update the properties file, and (if you use the JNDI approach) the server admin can control the location of the file. What an amazing fountain of knowledge you are (!) I have a special email rule just to highlight your messages, and I am utterly humbled by your energy and goodwill on this site. Have a great week-end! Regards Harry Mantheakis London, UK - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Special URL servlet request.
Joe Francis wrote: But it was no longer able to find other content such as static html files and image files that were bundled into my servlet. Tell us how you are trying to 'find other content' and we might be able to help you. Harry When I tried that approach (adding /* to the mapping), my servlet received the requests to those url's with additional path, and was able to extract the patch info using HttpServeltRequest.getPathInfo. But it was no longer able to find other content such as static html files and image files that were bundled into my servlet. How do I receive requests to urls that have additional path, but not cut off access to my own internal content? Bodycombe, Andrew wrote: In web.xml: web-app servlet servlet-namedigfidl/servlet-name servlet-classse.two4hr.servlet.DLServlet/servlet-class /servlet servlet-mapping servlet-namedigfidl/servlet-name url-pattern/digfidl/url-pattern /servlet-mapping servlet-mapping servlet-namedigfidl/servlet-name url-pattern/digfidl/*/url-pattern /servlet-mapping /web-app -Original Message- From: matsmobil [mailto:[EMAIL PROTECTED] Sent: 23 January 2004 13:25 To: [EMAIL PROTECTED] Subject: Special URL servlet request. This request works:http://digfi.com/digfidl/digfidl and calls my Servlet OK. The question is how can I call my servlet with the following URL: http://digfi.com/digfidl/digfidl/dAc/OM1617RbR/YT4075/Uk5673We/qih/dFOE1051/ 1gpus/LYxx/tKG0/iXcaP.rm/?copyright=digfi.comauthor=Chine The Slippery Hornstitle=Scatterminded I have to make this request like this because my calling applikation can't use '?' in the URL-requests. Could this be done in TC 5.0.18 only ore do I have to have apache as frontend for TC 5.0.18. - In TC/conf/server.xml I have added the following row: Context path=/digfidl docBase=digfidl debug=0 reloadable=true / - TC/webapps/digfidl/WEB-INF/web.xml contains: web-app - servlet servlet-namedigfidl/servlet-name servlet-classse.two4hr.servlet.DLServlet/servlet-class /servlet - servlet-mapping servlet-namedigfidl/servlet-name url-pattern/digfidl/url-pattern /servlet-mapping /web-app -- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - 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: [REALLY OT] CSS tag
This is good 'reference' site for HTML and CSS: http://www.blooberry.com/indexdot/css/index.html The 'vertical-align' property should do the trick. With block stuff you have to specify 'margin auto auto' I *think*. Good luck Harry Mantheakis London, UK I am looking for a quick answer, I don't belong to any other list thats appropriate, and we should be full of web developers :) I appologize to the admins. Any, I was wondering if there was a css tag that would align my text vertically. like in TD VALIGN=top TD.productdisplayfieldname { color:Red; font-size:16px; font-family:Arial, Helvetica, sans-serif; font-style:normal; font-weight:bold; text-decoration:none; text-align:right; } Anyone got a quick answer? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Special URL servlet request.
Hello Tim Funk wrote... But you won't have access to request parameters since there are none. Not as parameters, true, but Tomcat lets you retrieve the information through the extra path information. See: HttpServeltRequest.getPathInfo I use it all the time :-) Harry Mantheakis London, UK 2 Ways: 1) Map /digfidl like you are currently doing. But you won't have access to request parameters since there are none. You'll need a custom api/code to decode the request. Or you could use a Filter and HttpServletRequestWrapper to handle the decoding for you so you could use getParameter() 2) Use mod rewrite to rewrite the request so it places all the parameters in a key valued query string. Use google and the mod_rewrite guide on the specifics of how to do that. -Tim matsmobil wrote: This request works:http://digfi.com/digfidl/digfidl and calls my Servlet OK. The question is how can I call my servlet with the following URL: http://digfi.com/digfidl/digfidl/dAc/OM1617RbR/YT4075/Uk5673We/qih/dFOE1051/1 gpus/LYxx/tKG0/iXcaP.rm/?copyright=digfi.comauthor=Chine The Slippery Hornstitle=Scatterminded I have to make this request like this because my calling applikation can't use '?' in the URL-requests. Could this be done in TC 5.0.18 only ore do I have to have apache as frontend for TC 5.0.18. - In TC/conf/server.xml I have added the following row: Context path=/digfidl docBase=digfidl debug=0 reloadable=true / - TC/webapps/digfidl/WEB-INF/web.xml contains: web-app - servlet servlet-namedigfidl/servlet-name servlet-classse.two4hr.servlet.DLServlet/servlet-class /servlet - servlet-mapping servlet-namedigfidl/servlet-name url-pattern/digfidl/url-pattern /servlet-mapping /web-app - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: 2 questions
Hello The sendRedirect method sends a response back to the client browser with a special header that instructs the *browser* to make a *new* request to whatever URL you have specified - usually back to your server, but it can be to anywhere. The forward method is quite different: it 'calls' another resource in your server to take over the processing of the current request. You can think of forwarding as if you are calling another method to continue processing the request that the servlet started processing. At some point, the other resource should, of course, send a response back to the client browser. To clear an existing session and start a new one, try: HttpSession session = request.getSession( false ); If ( session != null ) { session.invalidate(); session = request.getSession( true ) } // then add your attributes here... Calling 'request.getSession( false )' will *not* create a new session, but will return an existing one if there is one already there. Good luck. Harry Mantheakis London, UK 1) What is the differences between two ? res.sendRedirect(http://localhost:8080/authendication/Logout/body_logout.jsp; ); or getServletContext().getRequestDispatcher(/authendication/Logout/body_logout.j sp).forward(req, res); 2) 1 )Whenever for the first time if the user enters, I want to store the username,rights in the session How to do it in Servlet. Is it right ? HttpSession session = request.getSession(true); //can u tell me when we have keep false here. session.setAttribute(username,usernamevalue); session.setAttribute(rights,rights); - Do you Yahoo!? Yahoo! SiteBuilder - Free web site building tool. Try it! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: web.xml config
Hi Allan I tried: http://kes:8080/WinGalagaHST?Op=GetScore and http://kes:8080/WinGalagaHST/WinGalagaHST?Op=GetScore I assume 'kes' is a valid IP address - why not start with 'localhost'? Anyway, I cannot see anything (obviously) wrong with your setup, other than (as suggested by others) that you should package your class files. The packages, of course, still get placed under the 'WEB-INF/classes' directory. I know for sure that you cannot use un-packaged JavaBeans. Try packaging your servlets, and let us know how you get on. One other option you could consider - if you are running Tomcat 4.1x - is to enable the Invoker Servlet instead of registering and mapping your servlets. To enable the Invoker Servlet copy and paste the following servlet mapping code into the 'web.xml' application deployment descriptor: !-- The mapping for the invoker servlet -- servlet-mapping servlet-nameinvoker/servlet-name url-pattern/servlet/*/url-pattern /servlet-mapping To call your servlet, you need to specify the '/servlet' mapping: http://myDomain/myWebApp/servlet/myServlet?x=1 If that works, then you know there is something wrong with the way you have registered and mapped your servlets in the deployment descriptor. BTW, the Invoker Servlet should NOT be used in a production environment because of security issues - so this is just a testing solution. Regards Harry but both just show HTTP 404 message. This servlet runs on my friends machine, with his own coded web-server, and to get a score, he calls ?Op=GetScore. Thanks Allan - Original Message - From: Harry Mantheakis [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Saturday, January 17, 2004 12:21 PM Subject: Re: web.xml config Hello What is the problem? How exactly are you calling (requesting) the servlet? - Give us the complete URL you are using to invoke the servlet. Harry I have tomcat up and running fine - verified by running the example jsp pages and servlets. I have a servlet that I want to get working, called WinGalagaHST which is used for my game I have been developing. I have put it in my tomcats webapps directory, and the necessary subdirs like /usr/local/sites/tomcat/tomcat/webapps/WinGalagaHST/WEB-INF/classes I have put the class files in the classes folder (2 of them, called EDSServlet.class and WinGalagaHST.class), and have my web.xml in the WEB-INF directory. Is this correct? Below is my web.xml file. If anybody knows where I am going wrong, I would much appreciate the help. Thanks very much Allan -web.xml ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app servlet servlet-name WinGalagaHST /servlet-name servlet-class WinGalagaHST /servlet-class /servlet servlet-mapping servlet-nameWinGalagaHST/servlet-name url-pattern/WinGalaga/url-pattern /servlet-mapping /web-app - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - 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: web.xml config
Hello What is the problem? How exactly are you calling (requesting) the servlet? - Give us the complete URL you are using to invoke the servlet. Harry I have tomcat up and running fine - verified by running the example jsp pages and servlets. I have a servlet that I want to get working, called WinGalagaHST which is used for my game I have been developing. I have put it in my tomcats webapps directory, and the necessary subdirs like /usr/local/sites/tomcat/tomcat/webapps/WinGalagaHST/WEB-INF/classes I have put the class files in the classes folder (2 of them, called EDSServlet.class and WinGalagaHST.class), and have my web.xml in the WEB-INF directory. Is this correct? Below is my web.xml file. If anybody knows where I am going wrong, I would much appreciate the help. Thanks very much Allan -web.xml ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app servlet servlet-name WinGalagaHST /servlet-name servlet-class WinGalagaHST /servlet-class /servlet servlet-mapping servlet-nameWinGalagaHST/servlet-name url-pattern/WinGalaga/url-pattern /servlet-mapping /web-app - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: append text into a file
Hello Could please give me some advice about how to append some data into an existed log file? Thanks. The GenericServlet.log method (which HttpServlets inherit) appends to the log file - within a servlet, just call 'log'. In a JSP you can do the same thing using the ServletContext.log method. The ServletContext is referenced through the 'application' object that is given to you by the container - hence, just call 'application.log' within a JSP scriptlet. Regards Harry Mantheakis London, UK - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Installation problem
Hello Got this error message Sancha, please copy and paste into an email the complete contents of the 'web.xml' file located in the '$CATALIA_HOME\webapps\Sancha\WEB-INF' directory. I had not intended that you provide a 'welcome' page - the intention was for you to place documents in the 'Sancha' directory so that your friend could access them over the wire. By going to your 'site' your friend would simply see a directory listing of documents. This could be text documents, or image documents - anything that a browser can display. I hasten to add that this is *not* how Tomcat is intended to be used (!) but if it solves your 'network problem' so be it :-) Regards Harry Mantheakis London, UK - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Installation problem (For Harry and the rest....)
Hello I faced this kind of problem before, a window disappear as soon as it appears. I notice (after i checked the log files in the tomcat directory) that's because of the IP binding... my background environment is still running the services thus when i start again... give me the same syndrom. The only thing that comes to mind is that another service is using port 8080. IIRC Oracle 9i runs a service on that port. Do netstat and see what's running. Is anything written to the log file? Regards Harry Mantheakis London, UK - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Installation problem
Okay Sancha Delete all of of the following lines from the 'web.xml' file in '$CATALINA_HOME/webapps/Sancha/WEB-INF': !-- JSPC servlet mappings start -- servlet servlet-nameorg.apache.jsp.index_jsp/servlet-name servlet-classorg.apache.jsp.index_jsp/servlet-class /servlet servlet-mapping servlet-nameorg.apache.jsp.index_jsp/servlet-name url-pattern/index.jsp/url-pattern /servlet-mapping !-- JSPC servlet mappings end -- Make sure you do NOT delete the closing /web-app tag at the end of the page (!) otherwise Tomcat will complain. Now you will have an 'empty' context (application). Any files you place into the '$CATALINA_HOME/webapps/Sancha' folder will be displayed as a directory list. Test it yourself by calling: http://your_ip_address:8080/Sancha/ You should see just a list of files, assuming there are any to list. I hasten to add that this is not how Tomcat is normally used (!) and it could be that I have misunderstood your intentions for using Tomcat. It is a very crude way of 'sharing' certain files, but I assume that is what you want to do. All the best. Harry Mantheakis London, UK - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Path not found problem.
Hello This: style type=css/text src=../styles/global_style.css Should read: style type=css/text href=../styles/global_style.css The devil is in the details :-) Harry Mantheakis London, UK Sorry directory should be, (typo): - Directory structure: j2ee-test |- doc |- src |- web |- jsp |- testMain.jsp |- styles |- global_style.css |- |- WEB-INF |... -Original Message- From: Yansheng Lin [mailto:[EMAIL PROTECTED] Sent: Thursday, November 20, 2003 10:52 AM To: 'Tomcat Users List' Subject: Path not found problem. My setting: - Tomcat-Standalone - Context className=org.apache.catalina.core.StandardContext cachingAllowed=true charsetMapperClass=org.apache.catalina.util.CharsetMapper cookies=true crossContext=false debug=0 docBase=C:\Web\development\eclipse\workspace\j2ee-test\web mapperClass=org.apache.catalina.core.StandardContextMapper path=/j2ee privileged=false reloadable=false swallowOutput=false useNaming=true wrapperClass=org.apache.catalina.core.StandardWrapper - Directory structure: j2ee-test |- doc |- src |- web |- jsp |testMain.jsp |- styles |global.css |- WEB-INF |... And here is the problem. In my testMain.jsp page, I have: style type=css/text src=../styles/global_style.css style type=css/text src=../styles/elements.css style type=css/text src=../styles/navigation.css But I have to comment out these three lines in order for the page to be displayed in IE, otherwise IE doesn't display anything(not even errors), while Mozilla just ignores it. I tried both http://localhost:8080/j2ee/jsp/ and http://localhost:8080/j2ee/styles/, I can see my files under that directory. I also tried to play with the '..' a bit, but none worked. Anyone see the problem? Thanks in advance! -Yan - 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: Installation problem
Hello I changed that path name to C:\Program Files\j2sdk_nb\j2sdk1.4.2 If you are talking about your $PATH system environment variable, the setting should be: C:\Program Files\j2sdk_nb\j2sdk1.4.2\bin Til now , I didnt try to create any path for JAVA_HOME AND CATALINA_HOME, do i have to do that? You need both. JAVA_HOME should be: C:\Program Files\j2sdk_nb\j2sdk1.4.2 CATALINA_HOME should be the root-installation folder for Tomcat, wherever it is - analogous to JAVA_HOME. Good luck! Harry Mantheakis London, UK I uninstalled and reinstalled tomcat still experiencing the same flickering window error. While installing tomcat during the JVM path selection the default path listed was C:\Program Files\Oracle\jre\1.1.7 I changed that path name to C:\Program Files\j2sdk_nb\j2sdk1.4.2 Til now , I didnt try to create any path for JAVA_HOME AND CATALINA_HOME, do i have to do that? Your help is most appreciated.. Thanks in anticipation. bfn Try uninstalling, and then re-installing Tomcat. It should then pick up your J2SDK install path. If this doesn't work, then try ÊTALINA_HOME%\bin\catalina run, and post the error messages on the list for more help. [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Sorry to bother you with this elementary question. But being a neebie I am finding difficulties in installing tomcat 5.0 1. I ran the installation file for installing the tomcat 5.0. 2. Then I ran the j2sdk setup file , since tomcat was asking for a JVM. 3. i. Now, i clicked the Start Tomcat icon the windows key + Program files + Apache tomcat. I find a window disappearing as soon as it appears. ii. I tried again by running the catalina.bat or startup.exe file icon in the bin folder of tomcat. Again , i find the disappearing window. iii. Even if i run that file in the command prompt i am getting the same response. I also need to know as to how I could allow a friend access my files via the browser. i.e where should i make the appropriate modifications to allow him to view my files. Your help will be most appreciated. Thanks for your help inanticipation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Installation problem
Hello Hoping for your help again... Try Wendell's instructions (carefully) and tell us what happens (what you see on the DOS prompt command window). Regards Harry Mantheakis London, UK - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Installation problem
Hello i tried accessing the welcome page. Then, got the welcome page... Congratulations! At least we got over the flickering problem. Could you please tell me as to how should i allow my file to viewed by my friend in another machine? Err... Is your friend connected to your machine? Regards Harry Mantheakis London, UK - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]