https problem after upgrading from Tomcat 5.5 to Tomcat 6
Hi, I've been trying to upgrade from Tomcat 5.5.26 to Tomcat 6.0.18 for the past couple days but just cannot get https to work. Everything works as expected in Tomcat 5.5. Plain old http works in Tomcat 6, but the moment I try to switch to https, the connection just times out. After starting up, I see: Sep 5, 2008 10:56:05 PM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on http-80 Sep 5, 2008 10:56:05 PM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on http-443 Sep 5, 2008 10:56:05 PM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 280 ms Sep 5, 2008 10:56:05 PM org.apache.catalina.core.StandardService start INFO: Starting service Catalina Sep 5, 2008 10:56:05 PM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/6.0.18 Sep 5, 2008 10:56:35 PM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on http-80 Sep 5, 2008 10:56:35 PM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on http-443 Sep 5, 2008 10:56:35 PM org.apache.catalina.startup.Catalina start INFO: Server startup in 29762 ms There's nothing else of interest that I can find in any other log. My server.xml looks like this: lt;Connector port=80 redirectPort=443 maxThreads=150 minSpareThreads=25 maxSpareThreads=75 acceptCount=100 enableLookups=false connectionTimeout=2 disableUploadTimeout=true /gt; lt;Connector port=443 scheme=https secure=true clientAuth=false sslProtocol=TLS keystoreFile=path to my.keystore keystorePass=myPassword maxThreads=150 minSpareThreads=25 maxSpareThreads=75 acceptCount=100 enableLookups=false connectionTimeout=2 disableUploadTimeout=true /gt; Any ideas what might be the trouble here? I'm pretty much at the end of my rope. All other references to problems of this sort that I can find relate to using APR, which I'm not. Thanks! -- View this message in context: http://www.nabble.com/https-problem-after-upgrading-from-Tomcat-5.5-to-Tomcat-6-tp19343433p19343433.html Sent from the Tomcat - User mailing list archive at Nabble.com.
Re: mod_jk is not getting compile on centos 5.2 64-bit
On Fri, Sep 5, 2008 at 9:22 PM, Rainer Jung [EMAIL PROTECTED] wrote: Hi Ankush, mod_jk configure uses ${APXS} -q PREFIX to see if it works, where ${APXS} is what you gave to --with-apxs. You can try that directly, and see if it works, or if your apxs is broken: /usr/sbin/apxs -q PREFIX Regards, Rainer a Hi Rainer, The problem got fixed as apr-devel package for 64-bit architecture was missing on the server. This is acutally a yum bug which does not install apr-devel 64-bit package for httpd-devel package. Regards Ankush - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Good JSP editor
Hi there, I know it is better for me to ask this quetion in a jsp forum, but I couldn't find one for mailing list . And you guys are very helpful too in terms of this experience. If you are using a good jsp editor, can you tell me where its download link? My current development enviornment is Eclipse 3.4 and Tomcat 5.5.26 Thanks
Re: Upgrading to 6.0.18
Yoryos wrote: Hello Does anyone knows if with a simple replacement of the jars of CATALINA_HOME/lib can I upgrade from 6.0.14 to 6.0.18? No. It won't pick up changes to the startup scripts, the security policy file, the documentation, server.xml, global web.xml, global config.xml etc. I haven't checked the changelog in detail but at least some of these have changed since 6.0.14. Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 5.5. META-INF/context.xml ignored when deploying as war.
Eric Berry wrote: Mark, Chuck, Thank you both very much for the detailed explanations. I can certainly see how this would definitely speed development along, and how - in most cases - the context.xml is unnecessary. I myself, have rarely used them unless as Mark mentioned, I needed specific context parameters. In this case however, I'm using maven 2 to build the war file locally, and maven 2 is appending the version and -SNAPSHOT to the war (as well as the exploded war directory). This simply means that I have to rename the war every time in order to deploy it. I was trying to use the Context/path to remove a little bit of tedium on my part. Not a really big deal, but I would like to ask why the path attribute is ignored - meaning, why originally was the decision made to ignore it in this type of situation? It was part of a re-write of the deployer. There were several aims including: - simplify the code - make behaviour more consistent - make behaviour easier to predict One of the benefits of this change is that the process of determining a context path from a war/dir/context.xml file is much, much simpler. Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 6 and corruption of text in French error pages
André-John Mas wrote: Hi, I have Tomcat 6 installed on a French version of Windows XP. When error pages, such as the 404 error page, appear the French text is corrupted. For example, instead of the expected: La ressource demandée (/manager/html) n'est pas disponible. I get: La ressource demand�e (/manager/html) n'est pas disponible. This would appear to indicate that the page is being encoded as UTF-8 and then treated as ISO-8859-1. The display is consistent in all browsers I have tested with, which include IE6, Safari and Firefox. Has anyone seen this and do they know how to resolve it? I know I could simply use my own error page, but that is not the answer I am looking for, That would be a bug. Add it to bugzilla and someone will take a look. The error page probably just needs to set the response charset although it could be a little more complex. If you fancy trying to write this patch yourself, just shout. Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: https problem after upgrading from Tomcat 5.5 to Tomcat 6
randomw wrote: I've been trying to upgrade from Tomcat 5.5.26 to Tomcat 6.0.18 for the past couple days but just cannot get https to work. Everything works as expected in Tomcat 5.5. Plain old http works in Tomcat 6, but the moment I try to switch to https, the connection just times out. [...] My server.xml looks like this: lt;Connector port=443 scheme=https secure=true clientAuth=false sslProtocol=TLS keystoreFile=path to my.keystore keystorePass=myPassword maxThreads=150 minSpareThreads=25 maxSpareThreads=75 acceptCount=100 enableLookups=false connectionTimeout=2 disableUploadTimeout=true /gt; Any ideas what might be the trouble here? I'm pretty much at the end of my rope. All other references to problems of this sort that I can find relate to using APR, which I'm not. Try adding SSLEnabled=true to the Connector's attributes. Regards mks - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: https problem after upgrading from Tomcat 5.5 to Tomcat 6
Markus Schönhaber-10 wrote: Try adding SSLEnabled=true to the Connector's attributes. Duh... *bangs head on table* I feel like a total fool. Thanks for the help! -- View this message in context: http://www.nabble.com/https-problem-after-upgrading-from-Tomcat-5.5-to-Tomcat-6-tp19343433p19345115.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Exception when trying to configure a pool of connections for use of WS
Thanks David! The code is: Class.forName(com.mysql.jdbc.Driver); String url = jdbc:mysql://localhost:3306/cellmlrep; Connection con = DriverManager.getConnection(url, root, ); Statement stmt = con.createStatement(); String query = SELECT * FROM user_accounts u;; stmt.executeQuery(query); Daniele On Fri, Sep 5, 2008 at 6:00 PM, David Smith [EMAIL PROTECTED] wrote: And the code you use to get a connection? Looks like the database pool should be fine, you are getting a javax.sql.DataSource object but treating it as a java.naming.Context object. As an aside and definitely not things affecting the issue you describe below: 1. Do not use the root user in the database service for a web application. It's a potential security flaw big enough to fit a jumbo jet into. 2. Do use strong passwords on the database (especially for the root account) with at least three character classes (upper case, lower case, punctuation, numbers) and no dictionary words present. 2. Add a validatonQuery=select 1 attribute to your Resource ... / element so connections are tested and regenerated as needed. --David Daniele Development-ML wrote: Hello everybody, I am trying to set up the configuration for a pool of connections to a MySQL DB and I get the following exception when deploying on Tomcat. I followed the steps at http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html . The application actually consists of a web service that performs a query to the DB. Any hints or suggestions? Thank you! Context file ?xml version=1.0 encoding=UTF-8? Context path=/DB_WS debug=5 reloadable=true crossContext=true Resource name=jdbc/MySQL_cellmlrep type=javax.sql.DataSource auth=Container user=root password=root driverClassName=com.mysql.jdbc.Driver url=jdbc:mysql://localhost:3306/cellmlrep maxActive=8 maxIdle=4/ /Context Web.xml ?xml version=1.0 encoding=UTF-8? web-app version=2.5 xmlns=http://java.sun.com/xml/ns/javaee; xmlns:xsi= http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation= http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd; listener listener-classcom.sun.xml.ws.transport.http.servlet.WSServletContextListener/listener-class /listener servlet servlet-nameDBAccess/servlet-name servlet-classcom.sun.xml.ws.transport.http.servlet.WSServlet/servlet-class load-on-startup1/load-on-startup /servlet servlet servlet-nameDBAccessService/servlet-name servlet-classcom.sun.xml.ws.transport.http.servlet.WSServlet/servlet-class load-on-startup1/load-on-startup /servlet servlet-mapping servlet-nameDBAccess/servlet-name url-pattern/DBAccess/url-pattern /servlet-mapping servlet-mapping servlet-nameDBAccessService/servlet-name url-pattern/DBAccessService/url-pattern /servlet-mapping session-config session-timeout 30 /session-timeout /session-config welcome-file-list welcome-fileindex.jsp/welcome-file /welcome-file-list resource-ref description The database DataSource for the Acme web application. /description res-ref-namejdbc/MySQL_cellmlrep/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref /web-app Exception java.lang.ClassCastException: org.apache.tomcat.dbcp.dbcp.BasicDataSource cannot be cast to javax.naming.Context at org.apache.catalina.core.NamingContextListener.createSubcontexts(NamingContextListener.java:1203) at org.apache.catalina.core.NamingContextListener.addResource(NamingContextListener.java:1015) at org.apache.catalina.core.NamingContextListener.createNamingContext(NamingContextListener.java:633) at org.apache.catalina.core.NamingContextListener.lifecycleEvent(NamingContextListener.java:237) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4252) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525) at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:627) at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:553) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at
Re: difference in how applications are displaying
- Original Message - From: Scott, Ewan [EMAIL PROTECTED] To: users@tomcat.apache.org Sent: Friday, September 05, 2008 1:04 PM Subject: difference in how applications are displaying Hi I think this may relate to a tomcat setting - but I may be completely wrong. I have 2 servers which should be running identical looking webapps under Apache Tomcat. Accessing the test app on server 1 from a client using IE6, within the app, next to a range of data input fields, an arrow icon permanently exists which, if you click on it, brings up a lookup table of values. Accessing the live app on server 2 from the same IE6 client, next to the range of data input fields the arrow icon only exists once you hover the mouse over the relevant area of the browser. How can I get the arrow icon to appear permanently as in test? Installed on both servers (Windows 2003): Java 2 RuntimeEnv SE v1.4.2_15 Java 2 SDX, SE v1.4.2_15 Java TM 6 Update 3 Apache Tomcat 4.1 Regards Ewan Scott - Hi Ewan... luv this question, if TC had a hall of (sh)fame, this would be in it ;) No way that TC is making a icon in a web page act weird ;) Welcome to the wonderful world of browser standards Get yourself, FireFox, and Opera, and IE... and test your web apps on every one before they go out. My guess... you using CSS, the span or div tags are not closed properly and on one browser it works and on another browser it cant see the section until the mouse goes over it. This is very common... get yourself all those browsers, or this will catch you forever ;) You cannot develop on one browser I think I heard a whole bunch of people say... especially just IE ;) have fun... --- HARBOR : http://www.kewlstuff.co.za/index.htm The most powerful application server on earth. The only real POJO Application Server. See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm --- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 5.5
Ed Abukhdeir wrote: I moved my keystore to a new server and modified the server.xml to point to the keystore, but I'm unable to connect via https. However, I'm able to connect with http. Thanks Ed google the following: keytool import certificate HH -- H. Hall ReedyRiver Group LLC http://www.reedyriver.com - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Good JSP editor
- Original Message - From: sam wun [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Saturday, September 06, 2008 9:37 AM Subject: Good JSP editor Hi there, I know it is better for me to ask this quetion in a jsp forum, but I couldn't find one for mailing list . And you guys are very helpful too in terms of this experience. If you are using a good jsp editor, can you tell me where its download link? My current development enviornment is Eclipse 3.4 and Tomcat 5.5.26 Thanks Sam, I have made no comparison between them... but have a look at netbeans. If you looking for something like, you in JSP and want a little palette to drag a table, or form onto it... Having said that... I still use external html editors... I see that in netbeans... PHP is now also working, and in the latest beta's they starting to get javascript stuff going... Actually for Javascript I use the now very old MS Interdev... as well as FireFox That Interdev is from the old VS 6 days so its possible to bum a free copy from someone.. its becomeing hard to install on XP and such, but its probably the best JS editor debuggng tool out there... step thru in IE and bounce back and forth from browser to the code etc. Dont know what other people are finding but I still use a complete mismatched bundle of tools... bounce around between tools. ie I dont think there is one do it all tool Have fun... --- HARBOR : http://www.kewlstuff.co.za/index.htm The most powerful application server on earth. The only real POJO Application Server. See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm --- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Default application or HTML redirect
Hello Konstantin, I changed the port number during installation to avoid having users writing :8080 whenever the access my application Also, I believe I have the manager application installed, I took a look at it a while ago, however, my .WAR file is deployed and I didn't find any need to use the manager application. I have checked my META-INF folder, and didn't find any files except for MANIFEST.ME What do you think? Regards, Mostafa -Original Message- From: Konstantin Kolinko [mailto:[EMAIL PROTECTED] Sent: Thursday, September 04, 2008 12:22 PM To: Tomcat Users List Subject: Re: Default application or HTML redirect Well, Judging from your server.xml file, you are using Tomcat 6.0. Well, the file is the same as the default one, only connector port number is changed, s/8080/80/ Do you have manager application installed? Usally it is installed. If yes, you can add user username=foo password=bar roles=manager/ to your conf/tomcat-users.xml, and access the application by the http://localhost/manager/html/ It will list all the applications that are deployed, and allows you to undeploy applications and deploy your war file by uploading it. Also, do you have META-INF/context.xml in your war file? If it does exist there, and is not correctly written, it may break some things. Best regards, Konstantin Kolinko 2008/9/4 Mostafa Mossaad [EMAIL PROTECTED]: Hello Konstantin, I believe I've miss lead you. I'm not using IIS and Tomcat concurrently. What I mean is that I had an older version of this application that used to run on IIS *instead* of Tomcat. When I had the IIS application, I used to access my URL directly, without the /MyApp extension via a simple .html redirect file in the wwwroot folder. Right now, I don't even use IIS, only Tomcat. Regards, Mostafa -Original Message- From: Konstantin Kolinko [mailto:[EMAIL PROTECTED] Sent: Thursday, September 04, 2008 1:59 AM To: Tomcat Users List Subject: Re: Default application or HTML redirect I have a thought that there is some specifics in integrating Tomcat with IIS. You did not mention how you did that, and what is in your worker.properties, and so on. Do you have proper configuration of IIS-Tomcat ISAPI redirector? I have to say that I have yet no experience with configuring IIS with Tomcat, so the following are somewhat theoretical findings. Maybe, if the following won't help you, you can repost your question mentioning IIS in its title, and properly describing all components of your configuration. Also, you may try searching on how to access tomcat root application through IIS. Here is what I have found: 1) http://tomcat.apache.org/tomcat-5.5-doc/catalina/docs/api/org/apache/j k/ config/IISConfig.html It is some Tomcat class that writes IIS configuration files for you (e.g. as the initial configuration of the server). Note the noRoot configuration attribute. If you examine the sources of that class, you may note, that root context (ctxPath equals ) have some special processing. That includes the following comment: # Note: To correctly serve the Tomcat's root context, IIS's Home Directory must # must be set to: \ + getAbsoluteDocBase(context) + \ May be that is what you are missing? Somehow I cannot not find any mention of root context specifics in the tomcat and tomcat connector documention and wiki. 2) The following two articles might be useful: http://www.iisadmin.co.uk/?p=8 http://blogs.msdn.com/david.wang/archive/2005/10/14/HOWTO_IIS_6_Reques t_ Processing_Basics_Part_1.aspx I did not read them through, though. Best regards, Konstantin Kolinko 2008/9/3 Mostafa Mossaad [EMAIL PROTECTED]: Any ideas Konstantin? Any ideas Mark? Regards, Mostafa -Original Message- From: Mostafa Mossaad [mailto:[EMAIL PROTECTED] Sent: Monday, September 01, 2008 3:56 PM To: Tomcat Users List Subject: RE: Default application or HTML redirect I forgot to add that yes, I can access my application locally but with using the external IP address, also without the /MyApp extension and it loads like I want -Original Message- From: Mostafa Mossaad [mailto:[EMAIL PROTECTED] Sent: Monday, September 01, 2008 11:51 AM To: Tomcat Users List Subject: RE: Default application or HTML redirect Hello Konstantin 1- Yes, my host is accessible by its IP address, when I enter the IP, without the /MyAPp extension, it loads the web page I want normally, not the Apache default page 2- I always delete temp files and clear my cookies whenever I'm trying 3- After uninstalling Tomcat, I deleted all its folders, especially the ones that contain conf/server.xml and conf/web.xml 4- No, my ISA isn't on the same machine, and my ISA acts as a firewall/gateway, and I in this case, I use it to publish my application/web site A small comment, my application used to be published via
RE: jsvc creates pid file owned by root
if you're in Ubuntu and want to exec a process with elevated privileges try Coggshall's (sp?) sudo utility http://en.wikipedia.org/wiki/Sudo Martin __ Disclaimer and confidentiality note Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. Date: Fri, 5 Sep 2008 17:34:56 -0500 From: [EMAIL PROTECTED] To: users@tomcat.apache.org Subject: Re: jsvc creates pid file owned by root [EMAIL PROTECTED] wrote: See Thread at: http://www.techienuggets.com/Detail?tx=31984 Posted on behalf of a User You shouldn't be messing about with the ownership of the PID file. It is created by jsvc at startup. If you use jsvc properly it will start as root, create the pid file, startup tomcat ... Ah, but what if you are using jsvc to run something other than tomcat? I am using jsvc to run a standalone java application as a daemon that starts whenever the server is restarted. However, I would like a certain user other than root to be able to run the same launching script for this daemon to start and stop the service as needed. I find I cannot do it because of the permission on the .pid file. No matter where I put the pidfile and no matter whether or not I run umask in the launching script, the pidfile gets created with an owner of root and perms of 600. If I run umask 133 and then create a file, I get perm 644 as I want on the file. But the same does not work from within my jsvc-launch script with the pid file. Nothing I've tried works. In Response To: Hi, I can start and stop Tomcat 5.5 with the jsvc program but the problem is that the pid file is created with permissions 600 and owned by root. I want to be able to read the pid file to check if the Tomcat process is up and running and also for other purposes. Is it possible to make the pid file be owned by the user that runs Tomcat or have the permissions to be set to 666? Regards Gunnar I am the anonymous author of the piece you're responding to. What a coincidence seeing it bounce back here on the Tomcat list - Of course, my example did NOT concern Tomcat. Anyway my JSVC daemon needs to fulfill two needs: 1) restart the application on bootup - which is done by root 2) allow non-root user to start-stop the application using the standard daemon start/stop/restart kinds of commands. The only way I could get this to work was to modify my shell script to change the permissions and the group of the pid file after the jsvc start call was made. This works very nicely. Putting a call to umask in the script before the jsvc invocation did not work. I still don't know why. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Stay up to date on your PC, the Web, and your mobile phone with Windows Live. http://clk.atdmt.com/MRT/go/msnnkwxp1020093185mrt/direct/01/
Re: difference in how applications are displaying
If the same browser is displaying the two pages differently, there must be a difference in the web pages. Compare the HTML of the pages as they are received by the browser. Also compare any CSS and Javascript files referenced by the HTML page. -- Len On 05/09/2008, Scott, Ewan [EMAIL PROTECTED] wrote: Hi I think this may relate to a tomcat setting - but I may be completely wrong. I have 2 servers which should be running identical looking webapps under Apache Tomcat. Accessing the test app on server 1 from a client using IE6, within the app, next to a range of data input fields, an arrow icon permanently exists which, if you click on it, brings up a lookup table of values. Accessing the live app on server 2 from the same IE6 client, next to the range of data input fields the arrow icon only exists once you hover the mouse over the relevant area of the browser. How can I get the arrow icon to appear permanently as in test? Installed on both servers (Windows 2003): Java 2 RuntimeEnv SE v1.4.2_15 Java 2 SDX, SE v1.4.2_15 Java TM 6 Update 3 Apache Tomcat 4.1 Regards Ewan Scott ** This email and any files transmitted with it are privileged, confidential and subject to copyright. Any unauthorised use or disclosure of any part of this email is prohibited. If you are not the intended recipient please inform the sender immediately; you should then delete the email and remove any copies from your system. The views or opinions expressed in this communication may not necessarily be those of Scottish Borders Council. Please be advised that Scottish Borders Council's incoming and outgoing email is subject to regular monitoring and any email may require to be disclosed by the Council under the provisions of the Freedom of Information (Scotland) Act 2002. ** - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Exception when trying to configure a pool of connections for use of WS
Does the error occur in that piece of code or is it during Tomcat startup? The stack trace looks like the exception is thrown during startup, if I'm reading it correctly. -- Len On Sat, Sep 6, 2008 at 06:29, Daniele Development-ML [EMAIL PROTECTED] wrote: Thanks David! The code is: Class.forName(com.mysql.jdbc.Driver); String url = jdbc:mysql://localhost:3306/cellmlrep; Connection con = DriverManager.getConnection(url, root, ); Statement stmt = con.createStatement(); String query = SELECT * FROM user_accounts u;; stmt.executeQuery(query); Daniele On Fri, Sep 5, 2008 at 6:00 PM, David Smith [EMAIL PROTECTED] wrote: And the code you use to get a connection? Looks like the database pool should be fine, you are getting a javax.sql.DataSource object but treating it as a java.naming.Context object. As an aside and definitely not things affecting the issue you describe below: 1. Do not use the root user in the database service for a web application. It's a potential security flaw big enough to fit a jumbo jet into. 2. Do use strong passwords on the database (especially for the root account) with at least three character classes (upper case, lower case, punctuation, numbers) and no dictionary words present. 2. Add a validatonQuery=select 1 attribute to your Resource ... / element so connections are tested and regenerated as needed. --David Daniele Development-ML wrote: Hello everybody, I am trying to set up the configuration for a pool of connections to a MySQL DB and I get the following exception when deploying on Tomcat. I followed the steps at http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html . The application actually consists of a web service that performs a query to the DB. Any hints or suggestions? Thank you! Context file ?xml version=1.0 encoding=UTF-8? Context path=/DB_WS debug=5 reloadable=true crossContext=true Resource name=jdbc/MySQL_cellmlrep type=javax.sql.DataSource auth=Container user=root password=root driverClassName=com.mysql.jdbc.Driver url=jdbc:mysql://localhost:3306/cellmlrep maxActive=8 maxIdle=4/ /Context Web.xml ?xml version=1.0 encoding=UTF-8? web-app version=2.5 xmlns=http://java.sun.com/xml/ns/javaee; xmlns:xsi= http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation= http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd; listener listener-classcom.sun.xml.ws.transport.http.servlet.WSServletContextListener/listener-class /listener servlet servlet-nameDBAccess/servlet-name servlet-classcom.sun.xml.ws.transport.http.servlet.WSServlet/servlet-class load-on-startup1/load-on-startup /servlet servlet servlet-nameDBAccessService/servlet-name servlet-classcom.sun.xml.ws.transport.http.servlet.WSServlet/servlet-class load-on-startup1/load-on-startup /servlet servlet-mapping servlet-nameDBAccess/servlet-name url-pattern/DBAccess/url-pattern /servlet-mapping servlet-mapping servlet-nameDBAccessService/servlet-name url-pattern/DBAccessService/url-pattern /servlet-mapping session-config session-timeout 30 /session-timeout /session-config welcome-file-list welcome-fileindex.jsp/welcome-file /welcome-file-list resource-ref description The database DataSource for the Acme web application. /description res-ref-namejdbc/MySQL_cellmlrep/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref /web-app Exception java.lang.ClassCastException: org.apache.tomcat.dbcp.dbcp.BasicDataSource cannot be cast to javax.naming.Context at org.apache.catalina.core.NamingContextListener.createSubcontexts(NamingContextListener.java:1203) at org.apache.catalina.core.NamingContextListener.addResource(NamingContextListener.java:1015) at org.apache.catalina.core.NamingContextListener.createNamingContext(NamingContextListener.java:633) at org.apache.catalina.core.NamingContextListener.lifecycleEvent(NamingContextListener.java:237) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4252) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525) at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:627) at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:553) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488) at
Re: Exception when trying to configure a pool of connections for use of WS
No, actually it happens when I invoke the WS, which access to the DB. Daniele On Sat, Sep 6, 2008 at 4:44 PM, Len Popp [EMAIL PROTECTED] wrote: Does the error occur in that piece of code or is it during Tomcat startup? The stack trace looks like the exception is thrown during startup, if I'm reading it correctly. -- Len On Sat, Sep 6, 2008 at 06:29, Daniele Development-ML [EMAIL PROTECTED] wrote: Thanks David! The code is: Class.forName(com.mysql.jdbc.Driver); String url = jdbc:mysql://localhost:3306/cellmlrep; Connection con = DriverManager.getConnection(url, root, ); Statement stmt = con.createStatement(); String query = SELECT * FROM user_accounts u;; stmt.executeQuery(query); Daniele On Fri, Sep 5, 2008 at 6:00 PM, David Smith [EMAIL PROTECTED] wrote: And the code you use to get a connection? Looks like the database pool should be fine, you are getting a javax.sql.DataSource object but treating it as a java.naming.Context object. As an aside and definitely not things affecting the issue you describe below: 1. Do not use the root user in the database service for a web application. It's a potential security flaw big enough to fit a jumbo jet into. 2. Do use strong passwords on the database (especially for the root account) with at least three character classes (upper case, lower case, punctuation, numbers) and no dictionary words present. 2. Add a validatonQuery=select 1 attribute to your Resource ... / element so connections are tested and regenerated as needed. --David Daniele Development-ML wrote: Hello everybody, I am trying to set up the configuration for a pool of connections to a MySQL DB and I get the following exception when deploying on Tomcat. I followed the steps at http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html . The application actually consists of a web service that performs a query to the DB. Any hints or suggestions? Thank you! Context file ?xml version=1.0 encoding=UTF-8? Context path=/DB_WS debug=5 reloadable=true crossContext=true Resource name=jdbc/MySQL_cellmlrep type=javax.sql.DataSource auth=Container user=root password=root driverClassName=com.mysql.jdbc.Driver url=jdbc:mysql://localhost:3306/cellmlrep maxActive=8 maxIdle=4/ /Context Web.xml ?xml version=1.0 encoding=UTF-8? web-app version=2.5 xmlns=http://java.sun.com/xml/ns/javaee; xmlns:xsi= http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation= http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd; listener listener-classcom.sun.xml.ws.transport.http.servlet.WSServletContextListener/listener-class /listener servlet servlet-nameDBAccess/servlet-name servlet-classcom.sun.xml.ws.transport.http.servlet.WSServlet/servlet-class load-on-startup1/load-on-startup /servlet servlet servlet-nameDBAccessService/servlet-name servlet-classcom.sun.xml.ws.transport.http.servlet.WSServlet/servlet-class load-on-startup1/load-on-startup /servlet servlet-mapping servlet-nameDBAccess/servlet-name url-pattern/DBAccess/url-pattern /servlet-mapping servlet-mapping servlet-nameDBAccessService/servlet-name url-pattern/DBAccessService/url-pattern /servlet-mapping session-config session-timeout 30 /session-timeout /session-config welcome-file-list welcome-fileindex.jsp/welcome-file /welcome-file-list resource-ref description The database DataSource for the Acme web application. /description res-ref-namejdbc/MySQL_cellmlrep/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref /web-app Exception java.lang.ClassCastException: org.apache.tomcat.dbcp.dbcp.BasicDataSource cannot be cast to javax.naming.Context at org.apache.catalina.core.NamingContextListener.createSubcontexts(NamingContextListener.java:1203) at org.apache.catalina.core.NamingContextListener.addResource(NamingContextListener.java:1015) at org.apache.catalina.core.NamingContextListener.createNamingContext(NamingContextListener.java:633) at org.apache.catalina.core.NamingContextListener.lifecycleEvent(NamingContextListener.java:237) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4252) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) at
Virtual Hosting of Mutliple Domains
I added a host entry in the format of www.mydomain.com. Its a very simple site with only an index.html so that I can get the config straight before loading a bunch of content. There is no domain specific context given. I created a folder in the format mydomain.com is the /usr/share/tomcat5/webapps directory and the index file is the only file in the folder domain.com. I used the tomcat manager to deploy the 'app'. When I access the site from the link in the tomcat manager, the page is displayed as expected. when I try to access it using the domain name on the local server, get a blank screen. When I try to bring the page up from another computer, I get HTTP 400 - Bad Request Any ideas? This seems simple enough, but I obviously missed a step somewhere. I would greatly appreciate hearing from anyone that has had similar issues and got it resolved. I need to get this going so that I can move on to developing the sites. I need to deploy at least 3 domains on the server. I'm certain this is some simple embarrassing oversight of mine. I'm running Tomcat 5.5.3 on Red Hat EL 5.1
Re: Exception when trying to configure a pool of connections for use of WS
This isn't the code I was asking for. You should have some code that looks up the DataSource via JNDI (javax.naming.* classes). Following the examples in the tomcat docs, it would look like: Context initContext = new InitialContext(); DataSource ds = (Context)initContext.lookup(java:/comp/env/jdbc/MySQL_cellmlrep); Connection conn = ds.getConnection(); ... on to doing some work here ... --David Daniele Development-ML wrote: Thanks David! The code is: Class.forName(com.mysql.jdbc.Driver); String url = jdbc:mysql://localhost:3306/cellmlrep; Connection con = DriverManager.getConnection(url, root, ); Statement stmt = con.createStatement(); String query = SELECT * FROM user_accounts u;; stmt.executeQuery(query); Daniele On Fri, Sep 5, 2008 at 6:00 PM, David Smith [EMAIL PROTECTED] wrote: And the code you use to get a connection? Looks like the database pool should be fine, you are getting a javax.sql.DataSource object but treating it as a java.naming.Context object. As an aside and definitely not things affecting the issue you describe below: 1. Do not use the root user in the database service for a web application. It's a potential security flaw big enough to fit a jumbo jet into. 2. Do use strong passwords on the database (especially for the root account) with at least three character classes (upper case, lower case, punctuation, numbers) and no dictionary words present. 2. Add a validatonQuery=select 1 attribute to your Resource ... / element so connections are tested and regenerated as needed. --David Daniele Development-ML wrote: Hello everybody, I am trying to set up the configuration for a pool of connections to a MySQL DB and I get the following exception when deploying on Tomcat. I followed the steps at http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html . The application actually consists of a web service that performs a query to the DB. Any hints or suggestions? Thank you! Context file ?xml version=1.0 encoding=UTF-8? Context path=/DB_WS debug=5 reloadable=true crossContext=true Resource name=jdbc/MySQL_cellmlrep type=javax.sql.DataSource auth=Container user=root password=root driverClassName=com.mysql.jdbc.Driver url=jdbc:mysql://localhost:3306/cellmlrep maxActive=8 maxIdle=4/ /Context Web.xml ?xml version=1.0 encoding=UTF-8? web-app version=2.5 xmlns=http://java.sun.com/xml/ns/javaee; xmlns:xsi= http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation= http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd; listener listener-classcom.sun.xml.ws.transport.http.servlet.WSServletContextListener/listener-class /listener servlet servlet-nameDBAccess/servlet-name servlet-classcom.sun.xml.ws.transport.http.servlet.WSServlet/servlet-class load-on-startup1/load-on-startup /servlet servlet servlet-nameDBAccessService/servlet-name servlet-classcom.sun.xml.ws.transport.http.servlet.WSServlet/servlet-class load-on-startup1/load-on-startup /servlet servlet-mapping servlet-nameDBAccess/servlet-name url-pattern/DBAccess/url-pattern /servlet-mapping servlet-mapping servlet-nameDBAccessService/servlet-name url-pattern/DBAccessService/url-pattern /servlet-mapping session-config session-timeout 30 /session-timeout /session-config welcome-file-list welcome-fileindex.jsp/welcome-file /welcome-file-list resource-ref description The database DataSource for the Acme web application. /description res-ref-namejdbc/MySQL_cellmlrep/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref /web-app Exception java.lang.ClassCastException: org.apache.tomcat.dbcp.dbcp.BasicDataSource cannot be cast to javax.naming.Context at org.apache.catalina.core.NamingContextListener.createSubcontexts(NamingContextListener.java:1203) at org.apache.catalina.core.NamingContextListener.addResource(NamingContextListener.java:1015) at org.apache.catalina.core.NamingContextListener.createNamingContext(NamingContextListener.java:633) at org.apache.catalina.core.NamingContextListener.lifecycleEvent(NamingContextListener.java:237) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4252) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525) at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:627) at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:553) at
Tomcat vs Weblogic JNDI Lookup
The Weblogic servers we are using have been configured to allow JNDI datasource names like appds. For development (localhost), we might be running Tomcat and when declared in the context section of server.xml, Tomcat will hang JNDI datasources on java:comp/env/jdbc/* in the JNDI tree. *Problem:* in Weblogic, the JNDI lookup is appds whilst in Tomcat, it seems that that I must provide the formal java:comp/env/jdbc/appds. I'm afraid the Tomcat version is an implicit standard but unfortunately, I can't change Weblogic's config ... so that means we end up with two different spring config files (we're using spring 2.5) to facilitate the different environments. Is there an elegant way to address this. Can I look JNDI names up directly in Tomcat?
Re: Exception when trying to configure a pool of connections for use of WS
Oops! I goofed in adapting the docs example. The code yours should look like is below. Oddly enough, the mistake I made in my previous post would have caused the error you were asking about. --David David Smith wrote: This isn't the code I was asking for. You should have some code that looks up the DataSource via JNDI (javax.naming.* classes). Following the examples in the tomcat docs, it would look like: Context initContext = new InitialContext(); DataSource ds = (Datasource)initContext.lookup(java:/comp/env/jdbc/MySQL_cellmlrep); Connection conn = ds.getConnection(); ... on to doing some work here ... --David Daniele Development-ML wrote: Thanks David! The code is: Class.forName(com.mysql.jdbc.Driver); String url = jdbc:mysql://localhost:3306/cellmlrep; Connection con = DriverManager.getConnection(url, root, ); Statement stmt = con.createStatement(); String query = SELECT * FROM user_accounts u;; stmt.executeQuery(query); Daniele On Fri, Sep 5, 2008 at 6:00 PM, David Smith [EMAIL PROTECTED] wrote: And the code you use to get a connection? Looks like the database pool should be fine, you are getting a javax.sql.DataSource object but treating it as a java.naming.Context object. As an aside and definitely not things affecting the issue you describe below: 1. Do not use the root user in the database service for a web application. It's a potential security flaw big enough to fit a jumbo jet into. 2. Do use strong passwords on the database (especially for the root account) with at least three character classes (upper case, lower case, punctuation, numbers) and no dictionary words present. 2. Add a validatonQuery=select 1 attribute to your Resource ... / element so connections are tested and regenerated as needed. --David Daniele Development-ML wrote: Hello everybody, I am trying to set up the configuration for a pool of connections to a MySQL DB and I get the following exception when deploying on Tomcat. I followed the steps at http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html . The application actually consists of a web service that performs a query to the DB. Any hints or suggestions? Thank you! Context file ?xml version=1.0 encoding=UTF-8? Context path=/DB_WS debug=5 reloadable=true crossContext=true Resource name=jdbc/MySQL_cellmlrep type=javax.sql.DataSource auth=Container user=root password=root driverClassName=com.mysql.jdbc.Driver url=jdbc:mysql://localhost:3306/cellmlrep maxActive=8 maxIdle=4/ /Context Web.xml ?xml version=1.0 encoding=UTF-8? web-app version=2.5 xmlns=http://java.sun.com/xml/ns/javaee; xmlns:xsi= http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation= http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd; listener listener-classcom.sun.xml.ws.transport.http.servlet.WSServletContextListener/listener-class /listener servlet servlet-nameDBAccess/servlet-name servlet-classcom.sun.xml.ws.transport.http.servlet.WSServlet/servlet-class load-on-startup1/load-on-startup /servlet servlet servlet-nameDBAccessService/servlet-name servlet-classcom.sun.xml.ws.transport.http.servlet.WSServlet/servlet-class load-on-startup1/load-on-startup /servlet servlet-mapping servlet-nameDBAccess/servlet-name url-pattern/DBAccess/url-pattern /servlet-mapping servlet-mapping servlet-nameDBAccessService/servlet-name url-pattern/DBAccessService/url-pattern /servlet-mapping session-config session-timeout 30 /session-timeout /session-config welcome-file-list welcome-fileindex.jsp/welcome-file /welcome-file-list resource-ref description The database DataSource for the Acme web application. /description res-ref-namejdbc/MySQL_cellmlrep/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref /web-app Exception java.lang.ClassCastException: org.apache.tomcat.dbcp.dbcp.BasicDataSource cannot be cast to javax.naming.Context at org.apache.catalina.core.NamingContextListener.createSubcontexts(NamingContextListener.java:1203) at org.apache.catalina.core.NamingContextListener.addResource(NamingContextListener.java:1015) at org.apache.catalina.core.NamingContextListener.createNamingContext(NamingContextListener.java:633) at org.apache.catalina.core.NamingContextListener.lifecycleEvent(NamingContextListener.java:237) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4252) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) at
Re: symlinks in webapps
FYI, If I add several Context docBase=WebMail path=/ / blocks each with a different path , in my server.xml, it seems to work . The problem is that it's discouraged in tomcat's documentation, and anyway it causes my app to start several times, while with a simple symlink I had the same webapp referenced as many times as I wished without multiplying the load on the server (the app starts ldap pools... db pools and so on...). On Sat, Sep 6, 2008 at 6:34 PM, Claudio Tassini [EMAIL PROTECTED]wrote: Don't seem to work. It seems that I can't use a docBase in a context.xml that points to something under the appBase directory, as it's simply ignored and tomcat assumes that the docbase is in /webapps : Sep 6, 2008 6:23:28 PM org.apache.catalina.startup.HostConfig deployDescriptor WARNING: A docBase /opt/webmail-portal-tomcat/webapps/WebMail inside the host appBase has been specified, and will be ignored Sep 6, 2008 6:23:28 PM org.apache.catalina.core.StandardContext resourcesStart SEVERE: Error starting static Resources java.lang.IllegalArgumentException: Document base /opt/webmail-portal-tomcat/webapps/WebMail2 does not exist or is not a readable directory On Fri, Sep 5, 2008 at 9:05 PM, Caldarale, Charles R [EMAIL PROTECTED] wrote: From: Claudio Tassini [mailto:[EMAIL PROTECTED] Subject: symlinks in webapps The goal is to have the same webapp referenced by two contexts Rather than use symlinks, try using an additional Context element in conf/Catalina/[host]/WebMail2.xml: Context docBase=WebMail / (Include whatever else is needed from the META-INF/context.xml file, if there is one. Do NOT use a path attribute.) Haven't tried this exact situation, but I think it should work... (famous last words). - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Claudio Tassini -- Claudio Tassini
Re: symlinks in webapps
Of course you *could* do something to encourage a double deploy and get the desired result. Just make a context xml file named after the second context path and set it's docbase to point to the original webapp's folder. It'd look something like this: Assuming you have this in your conf/[Engine name]/[Host name] directory for the original webapp in webapps/originalWebapp (URL would be http://localhost:8080/originalWebapp): originalWebapp.xml: Context!-- Define resources here -- /Context The second context xml file, named secondInstance.xml (URL would be http://localhost:8080/secondInstance): Context docBase=originalWebapp !-- Define second instance resources if any -- /Context That should deploy the webapp a second time. Most developers try to avoid that, but you seem to be looking for exactly this kind of thing. --David Claudio Tassini wrote: FYI, If I add several Context docBase=WebMail path=/ / blocks each with a different path , in my server.xml, it seems to work . The problem is that it's discouraged in tomcat's documentation, and anyway it causes my app to start several times, while with a simple symlink I had the same webapp referenced as many times as I wished without multiplying the load on the server (the app starts ldap pools... db pools and so on...). On Sat, Sep 6, 2008 at 6:34 PM, Claudio Tassini [EMAIL PROTECTED]wrote: Don't seem to work. It seems that I can't use a docBase in a context.xml that points to something under the appBase directory, as it's simply ignored and tomcat assumes that the docbase is in /webapps : Sep 6, 2008 6:23:28 PM org.apache.catalina.startup.HostConfig deployDescriptor WARNING: A docBase /opt/webmail-portal-tomcat/webapps/WebMail inside the host appBase has been specified, and will be ignored Sep 6, 2008 6:23:28 PM org.apache.catalina.core.StandardContext resourcesStart SEVERE: Error starting static Resources java.lang.IllegalArgumentException: Document base /opt/webmail-portal-tomcat/webapps/WebMail2 does not exist or is not a readable directory On Fri, Sep 5, 2008 at 9:05 PM, Caldarale, Charles R [EMAIL PROTECTED] wrote: From: Claudio Tassini [mailto:[EMAIL PROTECTED] Subject: symlinks in webapps The goal is to have the same webapp referenced by two contexts Rather than use symlinks, try using an additional Context element in conf/Catalina/[host]/WebMail2.xml: Context docBase=WebMail / (Include whatever else is needed from the META-INF/context.xml file, if there is one. Do NOT use a path attribute.) Haven't tried this exact situation, but I think it should work... (famous last words). - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Claudio Tassini - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: symlinks in webapps
From: Claudio Tassini [mailto:[EMAIL PROTECTED] Subject: Re: symlinks in webapps it causes my app to start several times, while with a simple symlink I had the same webapp referenced as many times as I wished I don't think that's true - each directory or .war file in the appBase directory will cause a separate application deployment, which is what I thought you wanted. If what you really want is just to have multiple URLs refer to the same (single) webapp, you have a couple of fairly easy choices: 1) Implement a valve or filter that catches references to the alternate URLs and redirects or forwards them to the primary. 2) Create dummy webapps for the alternate URLs that contain nothing but an index.html page that redirects to the primary. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Virtual Hosting of Mutliple Domains
From: Alan Hancock [mailto:[EMAIL PROTECTED] Subject: Virtual Hosting of Mutliple Domains I'm running Tomcat 5.5.3 on Red Hat EL 5.1 1) If you're really running that old of a Tomcat version, you need to move up, ASAP. 5.5.3 is almost four years old, and many bugs have been fixed between then and the current 5.5.26. 2) If this is a 3rd-party repackaged version of Tomcat, throw it away and install a real one from tomcat.apache.org. The 3rd-party ones provide no end of grief when doing anything other than the most basic operations. 3) Consult the Tomcat virtual hosting doc: http://tomcat.apache.org/tomcat-5.5-doc/virtual-hosting-howto.html If that doesn't solve your problem, post your server.xml for people to look at. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Yet another context logging question
Caldarale, Charles R wrote: From: Jonathan Mast [mailto:[EMAIL PROTECTED] Subject: Yet another context logging question Foo has a subdirectory bar which I would now like to be it's own Context and AccessLogValue. Such a configuration is not supported - webapps may not be nested. Whatever results you get will be purely accidental and not necessarily repeatable from one Tomcat level to the next. You can't deploy one web app that is located within the docBase of another but you can deploy /foo and /foo/bar at the same time. The easiest way to do this with Tomcat 6.0.18+ is to name your WARs foo.war and foo#bar.war and place them in the host's appBase. Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Virtual Hosting of Mutliple Domains
Alan Hancock wrote: I added a host entry in the format of www.mydomain.com. Its a very simple site with only an index.html so that I can get the config straight before loading a bunch of content. There is no domain specific context given. I created a folder in the format mydomain.com is the /usr/share/tomcat5/webapps directory and the index file is the only file in the folder domain.com. I used the tomcat manager to deploy the 'app'. When I access the site from the link in the tomcat manager, the page is displayed as expected. when I try to access it using the domain name on the local server, get a blank screen. When I try to bring the page up from another computer, I get HTTP 400 - Bad Request Any ideas? This seems simple enough, but I obviously missed a step somewhere. I would greatly appreciate hearing from anyone that has had similar issues and got it resolved. I need to get this going so that I can move on to developing the sites. I need to deploy at least 3 domains on the server. I'm certain this is some simple embarrassing oversight of mine. I'm running Tomcat 5.5.3 on Red Hat EL 5.1 For 6.0.x but it is basically the same in 5.5.x http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: symlinks in webapps
The second context xml file, named secondInstance.xml (URL would be http://localhost:8080/secondInstance): Context docBase=originalWebapp !-- Define second instance resources if any -- /Context This don't work. It seems that with tomcat 5.0 you can't point a context's docBase to something INSIDE the appBase directory when using context files in conf/[Engine name]/[Host name]/[context].xml . You must add them to server.xml, which is discouraged. -- Claudio Tassini
Re: symlinks in webapps
I don't think that's true - each directory or .war file in the appBase directory will cause a separate application deployment, which is what I thought you wanted. As you may have noted, I am not a Tomcat expert so you are probably right. But my app logs in catalina.out when it reads its config files, and when I made a symlink in webapps/ to the same webapp it happened just once, while if I create more contexts blocks in server.xml it loads as many times as are the instances. Another evidence is that the app create a connection pool of 10 connections to an LDAP server, and with the server just started I have exactly 20 established connections , while I was used to only 10 with the old method. 1) Implement a valve or filter that catches references to the alternate URLs and redirects or forwards them to the primary. I am going to study how to accomplish this. Will let you know. 2) Create dummy webapps for the alternate URLs that contain nothing but an index.html page that redirects to the primary. This does not sound really clean :) I will keep it as last resort... -- Claudio Tassini
Re: Need help with Tomcat MBean support
Okay using approach of first article. The MBean server is correctly initialized and everything on the server side looks good. Now we come to the client side. The first article assumes you are just going to connect using a tool such as MC4J or JManage (monitoring tools). That is not my use case. I want to write a command-line client that can talk to the MBean (which is inside of Tomcat) and invoke an operation on the MBean. I use the Client.java sample from the Sun tutorial as a starting point. I am able to connect to the server, and get a list of MBeans, but I fail when trying to call createMBean(). I am using the simple two-parameter version of createMBean() and it always fails with javax.management.ReflectionException: The MBean class could not be loaded by the default loader repository It seems pretty clear that my client needs to use one of the other versions of createMBean(), one that specifies some other Class Loader but I have no clue what I should be using for that. H. Hall wrote: Steve Cohen wrote: Let me ask my question a little more directly: Does the presence of a descriptor cause instantiation of an instance of an MBean or do I have to write code to create a server-side instance of my MBean and if so, where should this code reside or is there some configuration artifact that causes this instantiation to happen? Why don't you take a look at these two articles: http://today.java.net/pub/a/today/2005/11/15/using-jmx-to-manage-web-applications.html?page=1 http://marxsoftware.blogspot.com/2008/07/jmx-model-mbeans-with-apache-commons.html If you use the NetBeans IDE you might be interested in the JMX plugin for NB. Here is a link to a tutorial Getting Started with JMX Monitoring in NetBeans IDE 6.0 http://www.netbeans.org/kb/60/java/jmx-getstart.html cheers, HH - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat vs Weblogic JNDI Lookup
if you use a JNDI lookup with a declared namespace such as xmlns:jee=http://www.springframework.org/schema/jee; more specifically in the case of spring http://www.springframework.org/schema/jee/spring-jee.xsd where jndi-name is declared to be xsd:attribute name=jndi-name type=xsd:string use=required xsd:annotation xsd:documentationThe JNDI name to look up./xsd:documentation /xsd:annotation /xsd:attribute which can then reference a specific jdbc resource supplying provided jndi-name of jpetstore-order such as jee:jndi-lookup id=orderDataSource jndi-name=java:comp/env/jdbc/jpetstore-order/ I dont know what specific resource you are trying to locate with wildcard nulls we might be able to help out better if you could explain your specific testcase HTH Martin __ Disclaimer and confidentiality note Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. Date: Sat, 6 Sep 2008 12:22:54 -0500 From: [EMAIL PROTECTED] To: users@tomcat.apache.org Subject: Tomcat vs Weblogic JNDI Lookup The Weblogic servers we are using have been configured to allow JNDI datasource names like appds. For development (localhost), we might be running Tomcat and when declared in the context section of server.xml, Tomcat will hang JNDI datasources on java:comp/env/jdbc/* in the JNDI tree. *Problem:* in Weblogic, the JNDI lookup is appds whilst in Tomcat, it seems that that I must provide the formal java:comp/env/jdbc/appds. I'm afraid the Tomcat version is an implicit standard but unfortunately, I can't change Weblogic's config ... so that means we end up with two different spring config files (we're using spring 2.5) to facilitate the different environments. Is there an elegant way to address this. Can I look JNDI names up directly in Tomcat? _ See how Windows connects the people, information, and fun that are part of your life. http://clk.atdmt.com/MRT/go/msnnkwxp1020093175mrt/direct/01/
Newbies, becareful of pure cookie based magic... theres a few gotcha's
I see this in the Netbeans group and its popping up its ugly head and making other area's complex. It seems with these modern day frameworks, I have an idea which one it is in particular but wont mention names... that its possible to build an entire site behind one URL http://mydomain/IamInTroubleProject and every thing is cookie managed and delivered behind this URL... If you are doing that... just start by asking yourself, how google is going to index it... the actual content. And as I'm starting to realize there are other issues like caching proxies and the like... Going to add this to my other no no's like those people that insist on building entire site only in JSP pages... but this one is actually a big gotcha, especially when the client comes back and says... um I want them to find the stuff I'm selling ;) Have Fun... --- HARBOR : http://www.kewlstuff.co.za/index.htm The most powerful application server on earth. The only real POJO Application Server. See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm --- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Newbies, becareful of pure cookie based magic... theres a few gotcha's
if you want to leave the cookies behind you'll have to request the filter to rewrite your URLs with the params http://tuckey.org/urlrewrite/ you should be able to implement your filter with netbeans or Jdeveloper or eclipse with no impact to your work.. Martin __ Disclaimer and confidentiality note Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. From: [EMAIL PROTECTED] To: users@tomcat.apache.org Subject: Newbies, becareful of pure cookie based magic... theres a few gotcha's Date: Sun, 7 Sep 2008 02:42:19 +0200 I see this in the Netbeans group and its popping up its ugly head and making other area's complex. It seems with these modern day frameworks, I have an idea which one it is in particular but wont mention names... that its possible to build an entire site behind one URL http://mydomain/IamInTroubleProject and every thing is cookie managed and delivered behind this URL... If you are doing that... just start by asking yourself, how google is going to index it... the actual content. And as I'm starting to realize there are other issues like caching proxies and the like... Going to add this to my other no no's like those people that insist on building entire site only in JSP pages... but this one is actually a big gotcha, especially when the client comes back and says... um I want them to find the stuff I'm selling ;) Have Fun... --- HARBOR : http://www.kewlstuff.co.za/index.htm The most powerful application server on earth. The only real POJO Application Server. See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm --- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Get more out of the Web. Learn 10 hidden secrets of Windows Live. http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-cns!550F681DAD532637!5295.entry?ocid=TXT_TAGLM_WL_domore_092008
Re: Newbies, becareful of pure cookie based magic... theres a few gotcha's
- Original Message - From: Martin Gainty [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Sunday, September 07, 2008 5:03 AM Subject: RE: Newbies, becareful of pure cookie based magic... theres a few gotcha's if you want to leave the cookies behind you'll have to request the filter to rewrite your URLs with the params http://tuckey.org/urlrewrite/ you should be able to implement your filter with netbeans or Jdeveloper or eclipse with no impact to your work.. Martin Thx Nice to know TC also has a mod_rewrite... --- HARBOR : http://www.kewlstuff.co.za/index.htm The most powerful application server on earth. The only real POJO Application Server. See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm --- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]