Re: how to get help if no answer from this list?
Dr. Exner, It helps to understand classloading in Tomcat. I just got Axis up and running on the following system. Windows/2000 Professional Java JDK 1.5.0_04 Tomcat 5.59 I will assume that this works the same on my Linux box (Fedora Core 4) since Apache is great in making cross-platform tools. The reference in the Tomcat documentation you want is the following: http://localhost:8080/tomcat-docs/class-loader-howto.html In particular, the following paragraph: For classes and resources that must be shared across all web applications, place unpacked classes and resources under $CATALINA_BASE/shared/classes, or place JAR files containing those classes and resources under $CATALINA_BASE/shared/lib. For my environment, this is what I did. 1) Downloaded axis-bin-1_3.zip 2) Unzipped it someplace convenient (C:\src\axis-1_3) 3) Copied the axis folder under webapps to my $CATALINA_HOME\webapps 4) Ran the Axis Happiness Page and noted I needed the following jars a) activation.jar b) mailapi.jar c) xmlsec.jar 5) Read the instructions and picked up the jars from the appropriate places. The first two are from Sun, and the last one is from Apache. 6) Dropped the jars in $CATALINA_HOME\shared\lib since I expect to write multiple webapps with Axis 7) Stopped and restated Tomcat The Axis Happiness Page now reports happiness. In general, if you need jars in a single web application, put them in WEB-INF\lib of the webapp. If you need to share libraries across all web applications, put the jar in $CATALINA_HOME\shared\lib. If you need to have Tomcat use them as well (for example, JDBC drivers to set up JNDI datasources), then you put the jars in $CATALINA_HOME\common\lib (see http://localhost:8080/tomcat-docs/jndi-datasource-examples-howto.html) Hope this helps. /mde/ --- Dr. Exner [EMAIL PROTECTED] wrote: Thanks for this hint, but it did not work. I copied the file into both directories but got the same old error on startup. May be I did something wrong from the beginning? But there is not much to configure with the self extracting exe file. D. Exner - Original Message - From: Hadraba Petr [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Monday, February 20, 2006 11:28 AM Subject: Re: how to get help if no answer from this list? Hi, did you try to copy the `activation.jar' in the common/lib/ (or common/endorsed/ if newer version then in JRE) directory? This path is _always_ included in the CLASSPATH by the startup scripts... I have there JDBC drivers, xalan, xerces (in the common/endorsed-) and it works fine. And the second benefit of this directories is platform independence... Simply you copy tomcat directory to UNIX or other Windoze with no Control Panel hacking or other problems... PETR On 2/20/06, Richard Schilling [EMAIL PROTECTED] wrote: Dr. Exner: Don't dismay. Sometimes it takes this listserve of volunteers time to answer questions. You didn't mention what platform you're using, but it appears to be Windows - by you mentioning the Windows control panel. /WEB-INF/server-config.wsdd was created, but you should check it for settings appropriate for your installation. If it was there to begin with you might check the path your shortcut executes Tomcat in. As for the .jar files not being found, you might want to try setting the path that Tomcat starts in in the shortcut link. There's a place to indicate what directory to run the program from. Richard Schilling Cognition Group, Inc. Seattle, WA Dr. Exner wrote: Hi, for a course including a short introduction and demo on web services I have to decide, whether to base it on java/tomcat/axis or on C#/.NET. Because I'm using xerces-j already in this course (and for some other reasons), I preffered the java solution. However, I hang with the test installation and I got no answer to my question from this list. Is there another chance for support with tomcat/axis or is C#/.NET the solution to my aim? The question was: with both, the preconfigured version from jakarta-tomcat-5.5.9-preconfigured.zip and the installation from apache-tomcat-5.5.15.exe I get the following startup messages: - Unable to find config file. Creating new servlet engine config file: /WEB-INF/server-config.wsdd - Unable to find required classes (javax.activation.DataHandler and javax.mail.internet.MimeMultipart). ... However, the activation.jar (from jaf-1.0.2) is included in the CLASSPATH (via Windows Control Panel) correctly and a test application successfully uses the javax.activation.DataHandler class from this archive. I wouldn't care for this but the main reason for using tomcat (at the moment) is the axis-j toolset. While validating the axis installation with the happy
Re: users Digest 20 Feb 2006 20:29:12 -0000 Issue 6230
You might try using existing environment variables. %HOMEPATH% is the user's home path, but they might not like having temporary files stuffed into their Documents and Settings directory. Maybe %HOMEPATH%\My Documents wouldn't be too bad. Or, you could use the TMP or TEMP environment variable. Just type: set at a command prompt to see what environment variables are available to use. Finally, if you do use one of those environment variables, it might be nice to rewrite the batch file so that it creates a subdirectory if one doesn't exist. Cleaning up when you shut down would also be nice. Just some thoughts - I'm not much of a Windows person. /mde/ --- Alexander E Genaud [EMAIL PROTECTED] wrote: Thanks for the reply George, Scratch directories are not a problem. I am able to set the workDir=C:\mywork. However, this is not generic enough. I've tried workDir=~/mywork, but that simply places a directory named ~ in CATALINA_HOME. You suggest creating a CatalinaBase directory. And that makes sense to cover all the output (work, logs, etc). But the question remains; Can I set CATALINA_BASE to a generic location (such as the user home directory or the OS temp space)? Thanks in advance, Alex - Forwarded message -- From: George Sexton [EMAIL PROTECTED] To: 'Tomcat Users List' users@tomcat.apache.org Date: Mon, 20 Feb 2006 11:24:46 -0700 Subject: RE: Tomcat running from CDROM Since the spec requires some directories (work, tmp) be writable this won't work. The best solution would be to create a stub CatalinaBase directory and put on the workstation in the temp directory, and then set CatalinaHome to the CDROM and run it that way. George Sexton MH Software, Inc. http://www.mhsoftware.com/ Voice: 303 438 9585 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Alexander E Genaud Sent: Monday, February 20, 2006 3:07 AM To: users@tomcat.apache.org Subject: Tomcat running from CDROM Hello, I am attempting to place a web application on a CDROM, without requiring further installations by the end user. Does anyone have experience doing this? I have been playing with Tomcat and Jetty, but have been most satisfied with Tomcat. Is it possible to make Tomcat run readonly (disable temporary files, scratch directories, or logs), or to redirect those written files to the operating system's default temp/scrath area? I have tried to create a Context, but fail to understand where to put the Context node (filename nor directory). Modifying the system.xml Host (line 216) was successful: ... Host name=localhost debug=0 appBase=webapps unpackWARs=true or_rather_unpackWARs=false autoDeploy=true xmlValidation=false xmlNamespaceAware=false workDir=myworkdir or_workDir=C:\myworkdir ... However, I would need to set something more generic (for Unix, Mac OS X, and Windows) such as workDir=$SYSTEM_TEMP_DIR/myworkdir. Is that possible? I expect the same can be done for the Logger(s). Is there anything else that gets written during runtime? Thanks in advance, Alex Please send your reply to: ( lx at pobox point com ) === For completeness and posterity: I've converted all JSP's to Servlets, removed all but my webapp, balancer, and static pages, and run Tomcat from an alternate JRE (rather than JDK) on disk. I have placed a Context in server.xml (line 144) to no effect: ... Engine name=Catalina defaultHost=localhost debug=0 Context workDir=myworkdir docBase=mywebapp /Context ... Anywhere else and Tomcat may fail to start. -- Alex -- Those who can make you believe absurdities can make you commit atrocities -- Fran�ois Marie Arouet (Voltaire) http://cph.blogsome.com http://genaud.org/alex/key.asc -- CCC7 D19D D107 F079 2F3D BF97 8443 DB5A 6DB8 9CE1 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Sad: Tomcat 5.5.x crashes almost every single day.
enableLookups=true redirectPort=8443 / Why enableLookups=true ??? Also, Cocoon can be very resource-intensive depending on which blocks you've built. JSP under Cocoon 2.1.7 and JDK 1.5 is also problematic, see for example: http://issues.apache.org/jira/browse/COCOON-1457 I have some ideas as to how to approach this, but I've not had the time to investigate. /mde/ __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Sad: Tomcat 5.5.x crashes almost every single day.
I'm confused - but wouldn't an enableLookups on the AJP connector return the hostname of the remote Apache server sending the request (and not the remote web client)? I don't know since I'm at work, and I always disable enableLookups since it's a potential performance hit. /mde/ --- Tomasz Nowak [EMAIL PROTECTED] wrote: Mark Eggers [EMAIL PROTECTED] wrote: enableLookups=true redirectPort=8443 / Why enableLookups=true ??? I use request.getRemoteHost in couple of places. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Invoker servlet
For a general view: http://tomcat.apache.org/tomcat-5.5-doc/appdev/deployment.html For an example web.xml file: http://tomcat.apache.org/tomcat-5.5-doc/appdev/web.xml.txt For the specification: http://www.jcp.org/aboutJava/communityprocess/final/jsr053/ Basically you need to define your servlets in the qwb application's web.xml as servlet/servlet elements. You then need to use servlet-mapping/servlet-mapping elements to map the servlet definitions to URL patterns. /mde/ --- Devireddy, Nagendra Reddy (STSD) [EMAIL PROTECTED] wrote: Hi Doug, Thanks for your reply. I have uncommented that servlet in web.xml Will it cause any harm ?? Thanks -Original Message- From: Parsons Technical Services [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 08, 2006 6:04 PM To: Tomcat Users List Subject: Re: Invoker servlet Do a search on servlet mapping. It will go in your web.xml. Doug - Original Message - From: Devireddy, Nagendra Reddy (STSD) [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: Tomcat Users List users@tomcat.apache.org Sent: Wednesday, March 08, 2006 12:57 AM Subject: RE: Invoker servlet Hi Wendy, Thanks for your reply. So it may lead to some security problems. How can I avoid this ? Any document/link will be of great help. Thanks, Nagendra -Original Message- From: Wendy Smoak [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 08, 2006 10:45 AM To: Tomcat Users List Subject: Re: Invoker servlet On 3/7/06, Devireddy, Nagendra Reddy (STSD) [EMAIL PROTECTED] wrote: As per Our product documentation guideline I have uncommented invoker servlet. Will it lead to any security problems ?? By Default its commented in tomcat 5.x. http://tomcat.apache.org/faq/misc.html#invoker -- Wendy - 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] __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Upgrade to Tomcat 5.5 has broken my jndi
Document link: http://tomcat.apache.org/tomcat-5.5-doc/config/globalresources.html From the document: The resources defined in this element are not visible in the per-web-application contexts unless you explicitly link them with ResourceLink elements. If you use a GlobalNamingResource element, you will then have to use a ResourceLink element in the Context element of server.xml. I think you would then use the name attribute specified in the ResourceLink element in your /WEB-INF/web.xml resource-ref or resource-ref-env elements (specifically res-ref-name or resource-env-ref-name). I'm not at a machine where I can try this, but that's my reading of the documentation. Hope this helps. /mde/ --- ALEX HYDE [EMAIL PROTECTED] wrote: Thanks for the help. I seem to be able to get it working when I have a context file under my web-app in the meta-inf directory. But I am still unable to properly configure a global datasource. Here is my context.xml. very standard: ?xml version=1.0 encoding=UTF-8? Context Resource name=jdbc/testdb auth=SERVLET type=javax.sql.DataSource driverClassName=com.mysql.jdbc.Driver url=jdbc:mysql://localhost:3306/testdb username=me password=me maxActive=30 maxIdle=2000 maxWait=120/ /Context If I remove this and instead add this to server.xml GlobalNamingResources Resource name=jdbc/testdb auth=SERVLET type=javax.sql.DataSource driverClassName=com.mysql.jdbc.Driver url=jdbc:mysql://localhost:3306/testdb username=me password=me maxActive=30 maxIdle=2000 maxWait=120/ /GlobalNamingResources It no longer finds the datasource. My web.xml looks like this: web-app version=2.4 display-nameJNDI Test/display-name description Welcome to JNDI /description resource-ref descriptionhello /description res-ref-namejdbc/testdb/res-ref-name res-typejavax.sql.DataSource/res-type res-authSERVLET/res-auth /resource-ref /web-app I tried this, but it is failing to parse: web-app version=2.4 display-nameJNDI Test/display-name description Welcome to JNDI /description resource-env-ref descriptionhello /description res-env-ref-namejdbc/testdb/res-env-ref-name res-env-typejavax.sql.DataSource/res-env-type /resource-env-ref /web-app Any input would be great. Thanks alot. [EMAIL PROTECTED] wrote: Follows is to do: extract your Resource section from server.xml and copy to context.xml. I did the same and my jndi works very fine. György Tomcat Users List schrieb am 07.03.06 22:58:18: here are the docs http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html I don't see them declare the factory attribute in 5.5, you didn't tell us what version you were on Filip ALEX HYDE wrote: Hi All, I've seen this one all over the user group but I seem to have come to a dead end with this. I have upgraded from tomcat 4 to 5 and I can't seem to get my app working again. The part that has broken is the jndi datasource look-up. I notice that I'm definitly not the first to experience this problem. Perhaps things might have been made a bit clearer. I thought I had set things up correctly. I have extracted my old context from server.xml and added it under my web app context. debug=0 reloadable=true crossContext=true type=javax.sql.DataSource maxActive=10 maxIdle=7 maxWait=5 driverClassName=com.mysql.jdbc.Driver url=jdbc:mysql://localhost:1521/testdb username=user1 password= factory=org.apache.commons.dbcp.BasicDataSourceFactory / I now have this error where it had been working in version 4. org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of cla ss '' for connect URL 'null' Thanks for your help. ___ Win a BlackBerry device from O2 with Yahoo!. Enter now. http://www.yahoo.co.uk/blackberry - 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] -- Mit freundlichen Grüßen Dr. György Kelemen Email: [EMAIL PROTECTED] Mobil: 0173 534 5668 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To help you stay safe and
RE: TomCat + mod_jk performance
There are lots of reasons to run Apache in front of Tomcat, and lots of reasons not to. This just depends on your use cases and web site. At any rate, here's one way to find out in your case if the Apache -- ajp13 -- Tomcat process is your bottleneck. 1. Get jmeter at http://jakarta.apache.org/jmeter/ 2. Design and run tests against your web site as: http://yourhost/yoursite/ 3. Design and run test against your web site as: http://yourhost:8080/yoursite/ Caveats 1. Your static content will have to be available to Tomcat 2. Tomcat will have to run the http connector on 8080 (or another port - check server.xml) 3. You will have to be able to connect to your web site on the port listed in caveat 2. just some random thoughts . . . . /mde/ __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: help please?
http://www.wickedlysmart.com/HeadFirst/HeadFirstDesignPatterns/HeadFirstPatternsIndex.html Grab the examples. I think the last ones have a full blown MVC example. One uses Spring and one is coded plain. Of course, any prof worth his or her salt is going to both read this mailing list and know the online examples . . . so please use 'em as templates, not verbatum. BTW, I've found the Head First series of books to be really good. They're more conversational than more traditional texts, which may help some people to learn more easily. I'll skip the editorializing . . . except to say that a little bit of scheduling might help in the future. Oh - and a day without sleep is not necessarily a bad thing. Just my two cents . . . . /mde/ --- Asegid Debebe [EMAIL PROTECTED] wrote: Do you have any suggestion, David? Thanks, On 3/27/06, David Kerber [EMAIL PROTECTED] wrote: Waited a bit too long to start your homework, did you? ;-) Asegid Debebe wrote: Dear all, I really need to complete a very simple web application which demonstrate the MVC architecture fully. I would love to do it myself from scratch but given the time I have, I can't!. I really appreciate if someone can point me where I can find a very simple implementation of MVC using Servlet, JSP on tomcat platform. I promise I will never ask such a question and take your worthy time in the future. I really don't have time!! have to submit it in 24 hours!! please? Regards, Asegid - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Site Configuration on 5.5.15 Pt 2
There are probably a couple of things going on here. On the Aliasname/Alias, do you really need Tomcat to respond to the host name of www? You probably just want Tomcat to respond to www.theuniquepear.com and theuniquepear.com. I don't think the Aliaswww/Alias is necessary. It looks like www.theuniquepear.com is a CNAME for theuniquepear.com. A CNAME is resolved to the underlying name, so I think the resolution goes like this: a) www.theuniquepear.com is a CNAME for theuniquepear.come b) theuniquepear.com is used to get the address Google comes back with theuniquepear.com in its search results. Instead of a CNAME, you could use a separate A record to resolve www.theuniquepear.com to your web site. That still would leave you with a certificate problem if someone entered theuniquepear.com in the browser address bar. Maybe reversing the CNAME entries is what you need. In other words: www.theuniquepear.com IN A 66.128.124.198 theuniquepear.com IN CNAME www.theuniquepear.com That would get Google to return www.theuniquepear.com in irs search results. There would still be a certificate issue if someone typed theuniquepear.com in the browser address bar. Some thoughts on a solution: a) Not respond to theuniquepear.com as a web site. b) Virtual host that responds to theuniquepear.com consisting of a single page with a redirect to www.theuniquepear.com. Just some random thoughts . . . . /mde/ __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: SSL not working on Tomcat
Did you try this with Firefox? IE has some problems with no-cache in the header or as a pragma. Later versions of Tomcat 5.5 set this. There is a mailing list thread concerning this: http://marc.theaimsgroup.com/?t=11180675668r=1w=2 along with some solutions. Hope this helps. /mde/ just my two cents . . . . --- Michael Casale [EMAIL PROTECTED] wrote: Howdy all, I'm struggling through setting up Tomcat with SSL on a Windows 2003 server, and even when I get the server running, with no errors in the logs when restarting the tomcat service, all I get is a Page Not Found error when I point to the ssl port on the server. Pointing to the default connector on port 8080 works fine. Here's a little background: 1.Using keytool, I created a certificate request, sent it off to Geotrust, and purchased a cert to import. It was emailed to me. 2.Following the recommendations of geotrust (http://www.geocerts.com/support/install/install_tomcat.php ) , I downloaded their root cert, imported it, converted their cert to DER format (on a separate Linux box), and imported it into the keystore. 3.I restarted the Tomcat service with no errors, see the connector started on port 8443: Nov 7, 2006 4:55:35 PM org.apache.coyote.http11.Http11BaseProtocol init INFO: Initializing Coyote HTTP/1.1 on http-8080 Nov 7, 2006 4:55:35 PM org.apache.coyote.http11.Http11BaseProtocol init INFO: Initializing Coyote HTTP/1.1 on http-8443 Nov 7, 2006 4:55:35 PM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 812 ms Nov 7, 2006 4:55:35 PM org.apache.catalina.core.StandardService start INFO: Starting service Catalina Nov 7, 2006 4:55:35 PM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/5.5.12 Nov 7, 2006 4:55:35 PM org.apache.catalina.core.StandardHost start INFO: XML validation disabled Nov 7, 2006 4:55:36 PM org.apache.coyote.http11.Http11BaseProtocol start INFO: Starting Coyote HTTP/1.1 on http-8080 Nov 7, 2006 4:55:36 PM org.apache.coyote.http11.Http11BaseProtocol start INFO: Starting Coyote HTTP/1.1 on http-8443 Nov 7, 2006 4:55:37 PM org.apache.jk.common.ChannelSocket init INFO: JK: ajp13 listening on /0.0.0.0:8009 Nov 7, 2006 4:55:37 PM org.apache.jk.server.JkMain start INFO: Jk running ID=0 time=0/31 config=null Nov 7, 2006 4:55:37 PM org.apache.catalina.storeconfig.StoreLoader load INFO: Find registry server-registry.xml at classpath resource Nov 7, 2006 4:55:37 PM org.apache.catalina.startup.Catalina start INFO: Server startup in 1203 ms Now, opening any page on the server at http://servername:8080 http://servername:8080/ works fine, but https://servername:8443 https://servername:8443/ doesn't work. All ports are opened through the firewall, etc. Same for https://localhost:8443 https://localhost:8443/ . Here is the server.xml file entry for the connector: Connector className=org.apache.coyote.tomcat5.CoyoteConnector port=8443 minProcessors=5 maxProcessors=20 enableLookups=true disableUploadTimeout=true acceptCount=100 debug=0 scheme=https secure=true sslProtocol=TLS keystoreFile=c:\files\tomcat keystorePass=THEPASS/ According to the Tomcat SSL documentation, I need to have the root cert and the purchased cert in the keystore file, and I need to use the keyAlias to tell Tomcat which one to use. But whenever I add in the keyAlias entry it gives me the Alias name tomcat does not identify a key entry error in the logs. If I could find out how to enable better logging I may be able to troubleshoot this further. Want to start your own business? Learn how on Yahoo! Small Business. http://smallbusiness.yahoo.com/r-index - 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 Hosts [mostly solved]
You may find that the default host loads all of the web applications. In order to solve this, make sure that each of the contexts are not some subdirectory of another context. Host name=localhost appBase=vhosts/local / Host name=foo.mydomain.com appBase=vhosts/foo / Host name=bar.mydomain.com appBase=vhosts/bar / Host name=eggs.mydomain.com appBase=vhosts/eggs / You can use an absolute path to place this structure outside of your Tomcat installation. For large structures I think this is nice, because then you can upgrade Tomcat without disturbing your applications. Cutover would involve installing a parallel Tomcat, modifying server.xml. shutting down the old version, and starting up the new version. If the new version failed, recovery is just shutting down the new version and starting up the old version. If you want a one-stop place for all of your web applications, please ignore this comment. For a root context, I usually set up an application.xml file in conf/Catalina/hostname/ with the appropriate path= in the Context element, or a context.xml file in the web application's META-INF directory with the same context information. Once you separate each of the virtual hosts so that subdirectories don't overlap, I think you will find that multiple manager applications work. The manager application will then be specific to the virtual host, and you'll have to access that manager application by going to the specific virtual host (ie, http://hostname:8080/manager/html) HTH /mde/ . . . . . just my two cents --- Gormley, Josh [EMAIL PROTECTED] wrote: With the help of several people on this list, I've been able to get my server configured [mostly] the way I wanted it configured. Here's my solution, hopefully it will be helpful to others Goals: * One instance of Tomcat running behind Apache * Multiple VirtualHosts, each pointing to its own Tomcat webapp * The ability to hot-deploy an app without affecting the other apps * Minimal or no modifications required to server.xml for additional hosts * A solution that is maintainable and is not a hack Solution: * Apache with mod_jk * Each domain has a .conf file at /etc/httpd/conf.d/vhosts * The conf file routes .do and .jsp files to tomcat using mod_jk JkMount /*.do router JkMount /*.jsp router * The VirtualHost declaration has the DocumentRoot set to the path of the webapp * Tomcat's server.xml file has a host declaration for each webapp and a declaration for localhost (though that is not necessary) Host name=localhost appBase=webapps / Host name=foo.mydomain.com appBase=webapps/foo / Host name=bar.mydomain.com appBase=webapps/bar / Host name=eggs.mydomain.com appBase=webapps/eggs / * Deploy a war file named ROOT.war to the correct appBase for each application. This file must be named ROOT.war * GOTCHA: I tried to also include the manager webapp for each of the hosts by adding the manager.xml file to $CATALINA_HOME/conf/Catalina/foo.mydomain.com/ as described here http://webtuitive.com/samples/virtual-hosting-howto.jsp but by having a context defined in this location, I was not able to deploy my applications using Automatic Application Deployment as defined in the Tomcat docs. I'm not sure why this doesn't work but by removing the manager.xml file, I am able to hot-deploy my apps. This is working well for me, and that in itself makes me happy. The only things I'd like to improve upon are: * Not having to modify server.xml directly. According to the Tomcat docs, you shouldn't modify this file. I'm not sure how to avoid this. * Being able to include the manager app for each host that I define. I was using ant's tomcat tasks to tie into the manager for deploying my apps, but now I have to scp the war file into the directory. This isn't the worst thing that could happen, but it seems like there is a solution out there for this. Anyway, thanks to everybody who helped out on this. Josh Gormley -Original Message- From: Mikolaj Rydzewski [mailto:[EMAIL PROTECTED] Sent: Thursday, December 28, 2006 9:34 AM To: Tomcat Users List Subject: Re: Virtual Hosts Gormley, Josh wrote: As a side question, is this possible to do without modifying the server.xml file every time I want to add a new host? I've read that it's bad practice to modify the server.xml file much like it's bad practice to modify the httpd.conf file in Apache. In Apache, I have a vhost directory with .conf files for each host -- is there a similar method to do this with Tomcat? There is a host-manager webapp which comes with Tomcat to allow adding vhosts on the fly (I haven't used it, however). You will need user with admin role in tomcat-users.xml to access it. -- Mikolaj Rydzewski [EMAIL
Re: TCNative installation failed
Bingo and thanks. Note to the impatient (me) - Bugzilla is your friend.. Thanks again, /mde/ --- On Thu, 1/21/10, Konstantin Kolinko knst.koli...@gmail.com wrote: From: Konstantin Kolinko knst.koli...@gmail.com Subject: Re: TCNative installation failed To: Tomcat Users List users@tomcat.apache.org Date: Thursday, January 21, 2010, 7:12 PM 2010/1/22 Mark Eggers its_toas...@yahoo.com: (...) In all four cases, the tcnative library failed to load. In the first two cases, the INFO message indicated that the library was not found in /home/mdeggers/Apache/apache-tomcat-5.5.28/bin. In the last two cases, the INFO message listed all directories in java.library.path The same steps were used to build and deploy the tcnative libraries on Tomcat 6.0.24. Configurations 1 and 3 from above were tried. Both worked for Tomcat 6.0.24 as indicated by the INFO message: Ah, 5.5.28. There is https://issues.apache.org/bugzilla/show_bug.cgi?id=47712 Best regards, Konstantin Kolinko - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Frustrating refusal to serve *some* pages, scripts, images.
--- On Mon, 6/8/09, Zaq Rizer idhindsi...@gmail.com wrote: WARNING: Unable to find configured definition '/WEB-INF/tiles.xml' Jun 8, 2009 3:35:00 PM org.apache.tiles.factory.TilesContainerFactory initializeContainer Just a random thought, which you've alluded to from your iPhone-posted message: Could there be permissions / file ownership issues? Also, are there any SE Linux issues outstanding? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: tomcat install/testing help.
Tom, I tried responding to you off-line, but alaska.gov does not seem to like your mail address. Basically, it sounds like you have a permissions problem with the account under which Tomcat runs. By default, the Tomcat service runs as the Local System account, so that account needs appropriate access to %CATALINA_HOME% (where Tomcat is installed), and its subdirectories. I hope that helps. /mde/ --- On Fri, 7/17/09, Burton, Tom (DOR sponsored) tom.bur...@alaska.gov wrote: From: Burton, Tom (DOR sponsored) tom.bur...@alaska.gov Subject: tomcat install/testing help. To: users@tomcat.apache.org Date: Friday, July 17, 2009, 5:51 PM I've been trying to get tomcat and netbeans to work properly on my new computer. I'm running a windows XP computer. I have been able to get tomcat and netbeans to install successfully. However I've been unable to get them to work together correctly. I've tried installing from the executable and running the standalone version. I've removed the standalone and uninstalled/reinstalled the version with the installer. I've tried installing some software that works on our production servers just fine. It currently gives me ServletException when I try to load the / directory in my browser. I have another strange issue as well. The servlet code examples that come with tomcat work just fine but bundled jsp code examples do not they all seem to throw an AbstractMethodError exception. Any help and or suggestions would be much appreciated. I'd be happy to provide some of the trace roots if you think it will help in diagnosing what I did wrong in seting everything up. Thanks in advance, Tom Burton - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Trouble setting up virtual host
As usual, late to the thread. I'll use C) then: C) on another workstation : - close the browser and re-open it. - in the browser, find the place where you can clear the cache. - do it (clear the cache) - request the URL : http://adm138/InfoViewApp - indicate the result here : A: Internet Explorer cannot display the webpage This usually means that the other workstation cannot translate between the name you gave the host on the other workstation (adm138) and the IP address of your server. I also noticed that while you use the fully qualified name in the other example (www.fmdreports.vcu.edu) you use the short name in your tests (adm138). There are several things to try here, to see where the breakdown is. I'll use numbers since everyone else is using letters. 1. From another workstation, open a DOS window (if it's Windows) or a UNIX shell command (if it's UNIX), and type the following: ping adm138 1a) If you get: Ping could not find the host adm138, then the other workstation does not know how to translate between the name and the IP address. 1b) If you get: Four lines with a bunch of numbers, then the other workstation knows how to translate between the name and the IP address 2. From another workstation, open a DOS window (if it's Windows) or a UNIX shell command (if it's UNIX) and type the following: ping adm138.fmdreports.vcu.edu 2a) If you get: Ping could not find the host adm138.fmdreports.vcu.edu, then the other workstation does not know how to translate between the name and the IP address. 2b) If you get: Four lines with a bunch of numbers, then the other workstation knows how to translate between the name and the IP address adm138.fmdreports.vcu.edu may be the fully qualified name, but this depends on how your network administrator has set up something called DNS. Firewall check == Windows comes with a built-in firewall. On XP/Professional it's located in Start-Control Panel-Network Connections. You'll have to single-click on the active network (the one your server connects to) to see Change Firewall Settings on the left hand side. Once you click on that (Change Firewall Settings), you should be able to edit the settings by selecting Exceptions tab. Hopefully you'll see two entries for Java(TM) Platform SE Binary. Make sure that the JRE you're using to run Tomcat is there (by clicking on edit and reading the properties). Short term fix (once you've checked your firewall) == If you have administrative privileges on the other workstation (Windows) or root access (UNIX), you can add some information in a file called hosts. On Windows, it's located in the %windir%\System 32\drivers\etc directory. In UNIX it's located in /etc The line you need to add is the following: aaa.bbb.ccc.ddd adm138 where aaa.bbb.ccc.ddd is the IP address of the machine with your Tomcat server. If the fully qualified name is supposed to be adm138.fmdreports.vcu.edu, then add this line instead to the hosts file aaa.bbb.ccc.ddd adm138 adm138.fmdreports.vcu.edu where aaa.bbb.ccc.ddd is the IP address of the machine with your Tomcat server. Long term (proper) fixes = There are really two parts to this fix. The first part is to get your network administrator to add this hostname and IP address to your campus DNS server. The DNS server is responsible for translating between human-readable names and IP addresses. Once the name you have chosen for your server is in DNS, all machines using DNS servers will know how to interpret the name of the host. The second part of the fix is to alter your virtual host definition in server.xml. In general, it's a good idea to only use fully qualified names in the server.xml file. So, in part, your host element should look like this: Host name=fully-qualified-host-name . . . . /Host For example: Host name=adm138.fmdreports.vcu.edu . . . /Host However, if you want to have this virtual host respond to other names, you can add aliases for each name. To do that, just add an alias element for each name you want. Host name=fully-qualified-host-name . . . . Aliassome-other-name/Alias Aliasstill-another-name/Alias /Host For example: Host name=production.fmdreports.vcu.edu . . . Aliasadm138.fmdreports.vcu.edu/Alias Aliasanother.fmdreports.vcu.edu/Alias /Host If you want those aliases to be visible to other select workstations, then you will have to edit the hosts file for each workstation like I've shown above. Obviously, this is not a permanent fix if you have to edit 1000s of hosts on campus. If you want to have those alias names reachable from workstations that are not your server, then tell your network administrator what those names should be. Please remember if these names are going to be globally visible, you will have to use fully qualified names, not
RE: Someone Please: Why Is Tomcat Looking In The Wrong Directory?
As an additional comment: Based on earlier comments, it looks like the vendor's application is using the system property tomcat.home to create the file path to open. As you found out this will prevent using CATALINA_BASE or creating virtual hosts under one Tomcat. The vendor might look at using something like: getServletConfig().getServletContext().getRealPath(virtual) and then getting virtual fed in via a context-param in the web.xml file. That should return the real path to the file. It will fail when the application is being served from a .war file, but requiring the war file to be exploded should be OK. Just some random thoughts at the end of the thread. /mde/ --- Robinson, Eric [EMAIL PROTECTED] wrote: Okay, so I finally connected with someone at the vendor. Surprise! It turns out they do not follow the standard method for creating multiple instances of tomcat, i.e., by using $CATALINA_BASE. Instead, I was advised to copy the entire tomcat directory structure for each instance. I did this and it worked. I also had to create a new entry in init.d for the new tomcat service and edit a few other files, but at least now it is working. Talk about brute force! At least its good to know I wasn't being a complete ninny with the way I was configuring it. Nonetheless, THANKS VERY MUCH TO ALL for the many responses. I am completely floored by the amount of help people offered. This is a very active list, to say the least. -- Eric Robinson -Original Message- From: David Smith [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 01, 2006 11:34 AM To: Tomcat Users List Subject: Re: Someone Please: Why Is Tomcat Looking In The Wrong Directory? Hmmm. and the plot thickens. Have you asked the vendor about this issue? Can they offer any insights as to how they access the myapp.properties file? --David Robinson, Eric wrote: David, I do not know if the 3rd party app has hard-coded paths. I grepped for tomcat in the app directory and below and I see a couple of places where it is doing a System.GetProperty(tomcat.home), but that's about it. -- Eric Robinson -Original Message- From: David Smith [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 01, 2006 8:55 AM To: Tomcat Users List Subject: Re: Someone Please: Why Is Tomcat Looking In The Wrong Directory? Fair enough. Are the JSPs, servlets, etc., ... all being called from the /home/myaccount/tomcat5/webapps directory? Here's where I'm going with this: If resources like this properties file are being opened from the wrong location, but other webapp resources (images, jsps, servlets, etc., ...) are being served up from the proper location, it could be the result of bugs in your third party webapp. Maybe it's reliant on a hard coded path or a relative path to the current directory at the time tomcat was started. --David Robinson, Eric wrote: Sorry, I cannot answer that question as I am not the developer. Although I called it myapp for simplicty, it is really a third-party application. -- Eric Robinson -Original Message- From: David Smith [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 01, 2006 8:23 AM To: Tomcat Users List Subject: Re: Someone Please: Why Is Tomcat Looking In The Wrong Directory? I'm responding to the first message in the thread, but have read all of it. A thought: How are you opening this file? Hopefully it's via ServletContext.getResourceAsStream( /myapp/conf/myapp.properties ) ; --David Robinson, Eric wrote: Hello all, When I start tomcat, I get several messages like these: java.io.FileNotFoundException: /usr/local/tomcat5/webapps/myapp/conf/myapp.properties (No such file or directory) This file actually exists in /home/myaccount/tomcat5/webapps/myapp/conf/myapp.properties I have $CATALINA_BASE set to /home/myaccount/tomcat5 My instance of tomcat is starting mostly fine. I can connect to it on my custom port and see my own default page, but for some reason tomcat is still looking for myapp in the directory specified by $CATALINA_HOME. Someone please take a moment and give me some tips on why this might be happening. Thanks much, -- Eric Robinson Disclaimer - August 1, 2006 This email and any files transmitted with it are confidential and === message truncated === __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.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: Connector Problems -
I just finally moved over to mod_jk from mod_jk2. Since this is a development environment on Windows/2000 Professional, I didn't have the pressure to move. Anyway, here's my environment: Windows/2000 Professional Apache 2.054 (will upgrade one of these days) Tomcat 5.5.17 JDK 1.5.0_06-b05 Since I don't like spaces in my file names, everything is installed under C:\Apache\Apache2 and C:\Apache\Tomcat. My workers file looks like the following (I specify a lot of the defaults). # only one worker # a better name is called for worker.list=worker1 # # worker1 specs # worker.worker1.typw=ajp13 worker.worker1.host=localhost worker.worker1.port=8009 worker.worker1.socket_timeout=60 Loading mod_jk in my httpd.conf file: # # mod_jk # LoadModule jk_module modules/mod_jk.so JkWorkersFile conf/workers.properties JkLogFile logs/mod_jk.log Now I create aliased for each of my web applications and set up directory controls. I do that so I can serve static files from Apache, and dynamic files from Tomcat. I could also use JkAutoAlias. Directory C:/Apache/Tomcat/webapps/jsp-examples Options Indexes MultiViews AllowOverride None Order deny,allow Allow from 192.168.1 Allow from 127.0.0.1 /Directory This sets directory access, since the Tomcat webapps directory is outside my document root. An Alias and a JkMount finish up the configuration. # all on one line Alias /jsp-examples C:/Apache/Tomcat/webapps/jsp-examples # separate line JkMount /jsp-examples/*.jsp worker1 Hope this helps. /mde/ just my two cents . . . . --- M. Goodell [EMAIL PROTECTED] wrote: I am unable to get the tomcat connectors to work after spending hours reading docs and scouring google in search of answers. I have seen the problem I am having posted all over the web but there are no solutions to it that I have seen. Here is the summary of the problem: Component information: - MS Windows XP - Tomcat-5.5.17 - Apache 2.0.58 - mod_jk-1.2.18 I define the workers.properties file as specified per the documentation which resides in: C:/Program Files/Apache Group/Apache2/conf/workers.properties worker.list = worker1 worker.worker1.type = ajp13 (according to the docs type is the only mandatory element) And the VirtualHost portion of httpd.conf looks like this: VirtualHost 172.27.224.236:80 ServerAdmin [EMAIL PROTECTED] DocumentRoot /www/sandbox ServerName dummy-host.example.com ErrorLog logs/172.27.224.236.error.log CustomLog logs/172.27.224.236.access.log common LoadModule jk_module C:/Program Files/Apache Group/Apache2/modules/mod_jk.so JkWorkersFile C:/Program Files/Apache Group/Apache2/conf/workers.properties JkLogFile C:/Program Files/Apache Group/apache-tomcat-5.5.17/logs/mod_jk.log JkLogLevel debug JkMount /axis ajp13 JkMount /axis/* ajp13 JkMount /servlets-examples ajp13 JkMount /servlets-examples/* ajp13 JkMount /jsp-examples ajp13 JkMount /jsp-examples/* ajp13 JkMount /MGGWebApp worker1 JkMount /MGGWebApp/* worker1 /VirtualHost When I attempt to access http://172.27.224.236/MGGWebApp/ I get an Internal Server Error page and the error info is dumped to the log. The regular ajp13 references work perfect. Alas, Here is the log entry: [Tue Aug 08 12:47:16 2006] [1988:0324] [debug] jk_uri_worker_map.c (508): Attempting to map URI '/MGGWebApp/index.jsp' from 8 maps [Tue Aug 08 12:47:16 2006] [1988:0324] [debug] jk_uri_worker_map.c (520): Attempting to map context URI '/servlets-examples/*' [Tue Aug 08 12:47:16 2006] [1988:0324] [debug] jk_uri_worker_map.c (520): Attempting to map context URI '/jsp-examples/*' [Tue Aug 08 12:47:16 2006] [1988:0324] [debug] jk_uri_worker_map.c (520): Attempting to map context URI '/MGGWebApp/*' [Tue Aug 08 12:47:16 2006] [1988:0324] [debug] jk_uri_worker_map.c (534): Found a wildchar match worker1 - /MGGWebApp/* [Tue Aug 08 12:47:16 2006] [1988:0324] [debug] mod_jk.c (1832): Into handler jakarta-servlet worker=worker1 r-proxyreq=0 [Tue Aug 08 12:47:16 2006] [1988:0324] [debug] jk_worker.c (111): did not find a worker worker1 [Tue Aug 08 12:47:16 2006] [1988:0324] [info] mod_jk.c (1986): Could not find a worker for worker name=worker1 It seems to me, from the log file information, that it simply cannot find the workers.properties file. Also, it looks as though the mod_jk is loading due to Apaches lack of complaining. Any help / direction or chastisment on this would be welcomed. Many thanks! M Goodell __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For
Re: tomcat JSP Servlet Apache JK2
There are a lot of issues here, mostly having to do with how you've structured your virtual hosts. However, I think the following should get you up and running quickly. In your VirtualHost directive, add the following line: DirectoryIndex index.html index.html.var login.jsp That should bring up the login.jsp as a default index when someone just goes to the directory. Note, I have not tried this, but I do use this to serve up .pl and .php index files. I normally don't have a login.jsp page as the entry point into my web application. I normally put an index.html splash page with a note about the web application, and then on that page provide a link to the login page should the user want to log in. As I said above, there are a lot of potential issues with the way you've constructed virtual hosts, both with Apache and Tomcat. The Tomcat issues are certainly on topic for this mailing list, but the Apache issues are probably not. Hope this helps. /mde/ just my two cents . . . . --- jeusdi [EMAIL PROTECTED] wrote: Hello, mmm, I've compiled and linked and configured mod_jk with Apache 2.0 correctly, but I doesn't work correctly. Mmm, if I access to http://192.168.1.2 explorer continues show me the code of my JSP, but if I access to http://192.168.1.2/ecommerce/login.jsp it shows me correctly the JSP formatted or interpreted as simpe HTML file. I don't know What more Can I do. Can you say me what do I do wrong? jk.conf - JkWorkersFile /etc/apache2/properties/workers.properties JkLogFile /var/log/apache2/jk.log JkLogLevel debug workers.properties - # # List workers worker.list=treb # # Define work worker.treb.tomcat_home=$TOMCAT_HOME worker.treb.java_home=$JAVA_HOME worker.treb.port=8009 worker.treb.host=localhost worker.treb.type=ajp13 worker.treb.cachesize=10 worker.treb.cache_timeout=600 worker.treb.socket_timeout=300 worker.treb.lbfactor=1 And httpd.conf - ServerName 192.168.1.2 NameVirtualHost 192.168.1.2 VirtualHost 192.168.1.2 ServerName 192.168.1.2 ServerAdmin [EMAIL PROTECTED] DocumentRoot /usr/local/tomcat/webapps/ecommerce ErrorLog /usr/local/tomcat/webapps/webshop/logs/error_log CustomLog /usr/local/tomcat/webapps/webshop/logs/access_log common LocationMatch .*WEB-INF.* AllowOverride None Deny from all /LocationMatch JkMount /*.jsp treb /VirtualHost -- View this message in context: http://www.nabble.com/tomcat-JSP-Servlet-Apache-JK2-tf2071029.html#a5724146 Sent from the Tomcat - User forum 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] __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.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: Measuring traffic pr. virtualhost
If you want to do logging on at the Engine, Host, or Context level, then you can use the access logging valve in Tomcat. Configuration information can be found here: http://tomcat.apache.org/tomcat-5.5-doc/config/valve.html Note that if you serve static material with a front-end Apache server, that will NOT be logged by the access logging valve (obviously). If you use mod_jk in Apache 2.0 (or I assume mod_proxy_ajp in Apache 2.2), then the web server can log everything. Just set up a log file per each VirtualHost. There is a lot of documentation in the httpd.conf file and in the Apache manual for setting up logging on Apache. The Tomcat logs are in the Apache common format (by default). There are many web statistics packages that will parse and analyze these files. If you want more detailed help, I would be happy to correspond with you off the mailing list, since log configurations for the Apache web server are probably not on topic here. /mde/ Just my two cents . . . . --- Lars Nielsen Lind [EMAIL PROTECTED] wrote: Hi. I need to measure the traffic pr. month/year for each virtualhost. How can I do that with Apache/Tomcat? Lars Nielsen Lind - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.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: workers.properties
This should be like any other web application. I just set it up as a test on my machine and it works fine. Take a look at: http://tomcat.apache.org/connectors-doc/ 1) Set up a standard workers.properties file (example) # only one worker # a better name is called for worker.list=myworker # # worker1 specs # worker.myworker.typw=ajp13 worker.myworker.host=localhost worker.myworker.port=8009 worker.myworker.socket_timeout=60 2) Load the mod_jk module in httpd.conf # # mod_jk # LoadModule jk_module modules/mod_jk.so JkWorkersFile conf/workers.properties JkLogFile logs/mod_jk.log 3) Set up a JkMount in httpd.conf - something like: JkMount /mmbase/* myworker where myworker has been defined in the workers.properties file. This basically sends everything from: www.mydomain.com/mmbase/* to Tomcat. There are other ways of doing this, but this is sort of the minimalist approach. Directory definitions and aliases in httpd.conf can be useful (for example, to block hosts). HTH /mde/ just my two cents . . . --- D. Salemink Klikstudio [EMAIL PROTECTED] wrote: Does anybody have experience setting up the workers.properties file to serve mmbase through apache? -- D. Salemink Zomerdijkstraat 1-11079WX Amsterdam +31207726869 +31651611510 Nieuwe media cursussen http://www.klikstudio.net Webdesign en hosting http://www.klikstudio.nl - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.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: [SPAM ?]Error in dependencyCheck when using Connection pooling
From looking for this error message with Google, it appears that there is a problem with the manifest information in your jar file. Use the following two search items in Google: java.io.IOException invalid header field error in dependencycheck What JDBC driver (DB and version), Tomcat version, and JDK version are you using? HTH /mde/ just my two cents . . . . --- Tom Bednarz [EMAIL PROTECTED] wrote: I get a very strange error when starting my web-app: --- 14.08.2006 18:38:25 org.apache.catalina.core.StandardContext start SCHWERWIEGEND: Error in dependencyCheck java.io.IOException: invalid header field at java.util.jar.Attributes.read(Attributes.java:393) at java.util.jar.Manifest.read(Manifest.java:167) at java.util.jar.Manifest.init(Manifest.java:52) at org.apache.catalina.util.ExtensionValidator.validateApplication(ExtensionValidator.java:152) at org.apache.catalina.core.StandardContext.start(StandardContext.java:3998) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012) at org.apache.catalina.core.StandardHost.start(StandardHost.java:718) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442) at org.apache.catalina.core.StandardService.start(StandardService.java:450) at org.apache.catalina.core.StandardServer.start(StandardServer.java:680) at org.apache.catalina.startup.Catalina.start(Catalina.java:536) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:275) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) 14.08.2006 18:38:25 org.apache.catalina.core.StandardContext start SCHWERWIEGEND: Error getConfigured 14.08.2006 18:38:25 org.apache.catalina.core.StandardContext start SCHWERWIEGEND: Context [/mytrixpert] startup failed due to previous errors 14.08.2006 18:38:25 org.apache.catalina.core.StandardContext stop - This happens since I copied my JDBC driver to %CATALINA_HOME%/common/lib. If the JDBC driver is deployed with my web-app in WEB-INF\lib I get an error that the JDBC driver cannot be loaded. It seems that the driver needs to be in the common/lib directory of the container to make connection pooling work. Unfortunately I get now the above error. Any help with this would be greatly apreciated, since I am stuck with this problem. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.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: Tomcat Crashed - Please Help.
Are you using Tomcat 5.5.x or Tomcat 5.0.x? Tomcat 5.5.x requires either JSE 1.5 or JDK 1.4.x with the JDK compatibility pack. See the following: http://www.devlib.org/apache/tomcat/tomcat-5/v5.5.17/README.html The compatibility pack can be found here: http://tomcat.apache.org/download-55.cgi HTH /mde/ just my two cents . . . . --- Uday Bhaskar [EMAIL PROTECTED] wrote: Hi, When I start tomcat following is th error message: Starting tomcat5: /usr/bin/rebuild-jar-repository: error: could not find jdbc-stdext Java extension for this JVM /usr/bin/rebuild-jar-repository: error: could not find jndi Java extension for this JVM /usr/bin/rebuild-jar-repository: error: All detected jars were not found for this jvm /usr/bin/rebuild-jar-repository: error: could not find jaas Java extension for this JVM /usr/bin/rebuild-jar-repository: error: All detected jars were not found for this jvm [ OK ] I did not made any changes on SDK (new installations etc). when I say *# sudo /usr/sbin/alternatives --config java* Selection Command --- 1 /usr/share/java/libgcj-java-placeholder.sh 2 /usr/lib/jvm/java-1.4.2-ibm-1.4.2.0/jre/bin/java 3 /usr/lib/jvm/java-1.4.2-ibm-1.4.2.2/jre/bin/java *+ 4 /usr/lib/jvm/java-1.4.2-ibm-1.4.2.3/jre/bin/java And when I say, *$ java -version* java version 1.4.2_06 Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_06-b03) Java HotSpot(TM) Client VM (build 1.4.2_06-b03, mixed mode) *Tomcat log :* Bootstrap: Class loader creation threw exception java.lang.IllegalArgumentException: addRepositoryInternal at org.apache.catalina.loader.StandardClassLoader.addRepositoryInternal(StandardClassLoader.java:957) at org.apache.catalina.loader.StandardClassLoader.init(StandardClassLoader.java:153) at org.apache.catalina.startup.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:207) at org.apache.catalina.startup.Bootstrap.createClassLoader(Bootstrap.java:163) at org.apache.catalina.startup.Bootstrap.initClassLoaders(Bootstrap.java:104) at org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:196) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:402) Caused by: java.util.zip.ZipException: No such file or directory at java.util.zip.ZipFile.open(Native Method) at java.util.zip.ZipFile.init(ZipFile.java:112) at java.util.jar.JarFile.init(JarFile.java:127) at java.util.jar.JarFile.init(JarFile.java:65) at org.apache.catalina.loader.StandardClassLoader.addRepositoryInternal(StandardClassLoader.java:944) ... 6 more Can anyone help me. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.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: Apache 5.5 HelloWorldExample 404 error
If you're talking about the regular Hello World example in : http://localhost:8080/servlets-examples/servlet/HelloWorldExample I don't know why it wouldn't work. I have a very vanilla Tomcat 5.5.17 install on Windows/2000 Professional with JDK 1.5.0_08 (just rebuilt the system), and everything works out of the box. What changes have you made to the stock Tomcat? Can you install a completely changed Tomcat somewhere and see what happens? I don't use the invoker servlet. I edit the web application's web.xml and reload the application or build another war file and upgrade the application. That way when I go to production, there are no surprises - like forgetting a servlet definition in web.xml and wondering why things don't work . . . . Just some random thoughts . . . . /mde/ --- David Smith [EMAIL PROTECTED] wrote: My only guess is packageless classes are not officially supported. Reality is packageless classes sometime work and sometimes not. If it were in a package, it */might/* work. --David Steve Willett (Initiative Computing) wrote: Thanks, David, that seems to have got it. Any idea why the default Hello World (down one) example is not working? Steve -Original Message- From: David Smith [mailto:[EMAIL PROTECTED] Sent: Thursday, August 24, 2006 10:59 AM To: Tomcat Users List Subject: Re: Apache 5.5 HelloWorldExample 404 error We have a winner. Take a look at http://faq.javaranch.com/view?InvokerServlet. The form tag should be: form action=servlet/elsewise.ui.user.LoginServlet method=POST If the package of LoginServlet.class is elsewise.ui.user. --David Steve Willett (Initiative Computing) wrote: Thanks again, David. Since I restarted, the localhost log has: Aug 24, 2006 9:31:17 AM org.apache.catalina.core.ApplicationContext log SEVERE: Error loading WebappClassLoader delegate: false repositories: /WEB-INF/classes/ -- Parent Classloader: [EMAIL PROTECTED] ui java.lang.ClassNotFoundException: ui ... Aug 24, 2006 9:31:17 AM org.apache.catalina.core.ApplicationContext log SEVERE: invoker: Cannot allocate servlet instance for path /elsewise/servlet/ui/user/LoginServlet javax.servlet.ServletException: Wrapper cannot find servlet class ui or a class it depends on ... And Aug 24, 2006 9:32:00 AM org.apache.catalina.core.ApplicationContext log SEVERE: Error loading WebappClassLoader delegate: false repositories: /WEB-INF/classes/ -- Parent Classloader: [EMAIL PROTECTED] elsewise java.lang.ClassNotFoundException: elsewise ... Aug 24, 2006 9:32:00 AM org.apache.catalina.core.ApplicationContext log SEVERE: invoker: Cannot allocate servlet instance for path /elsewise/servlet/elsewise/ui/user/LoginServlet javax.servlet.ServletException: Wrapper cannot find servlet class elsewise or a class it depends on ... However, I shut Tomcat down again, restarted it, and tried to access the Hello World (down one) Servlet Example from the default Tomcat home page. I got no error messages in the log, even though it still gives me the 404, not found error. So I guess these two 404 errors are from a different cause? Steve -Original Message- From: David Smith [mailto:[EMAIL PROTECTED] Sent: Thursday, August 24, 2006 10:03 AM To: Tomcat Users List Subject: Re: Apache 5.5 HelloWorldExample 404 error Ok. Have you taken a look at the logs generated by tomcat from startup through the request? May have some insight as to what's happening (or not happening). --David Steve Willett (Initiative Computing) wrote: David, thanks for your quick response to my post! My reading of the dire warnings about enabling the invoker servlet lead me to believe that I should not do so in a production environment. However, this is a development environment, and I don't want to have to modify a web.xml file every time I create a new Servlet class. Am I reading this wrong? As to the problem - my servlet was in package elsewise.ui.user (not ui.user) and my class file was in the directory you specified. I just tried moving the class tree down one level: webapps/elsewise/WEB-INF/classes/elsewise/ui/user/LoginServlet.class and changed the form tag to: form action=servlet/elsewise/ui/user/LoginServlet method=POST I got a similar error: The requested resource (/elsewise/servlet/elsewise/ui/user/LoginServlet) is not available. In my original post I pointed out that I was having a similar problem with the default Tomcat home page Hello World example. Since I did not change the location of these files from the original installation, I assume there is a configuration error. If I get that working, I can compare my attempts
Re: Tomcat dies suddenly
Carl, A couple of random thoughts . . . I'm not familiar with the Slackware monitoring tools, but I am with the various tools that come with Fedora / Redhat. One of the things that I've noticed with those GUI tools is that they add cache and buffers to the free memory total. Tools like top and vmstat should give a more complete picture of your memory. With vmstat you can watch free, cache, buffers, and swap conveniently. With top, you can actually do a command line monitor and watch a particular PID. From the taroon-list: If you're running a 32 bit Linux and run out of low memory, it doesn't matter how much high memory you have, the OOM killer will start killing processes off. Since you're running a 64 bit Linux, this should not be the problem. A discussion on stackoverflow.com may be more relevant to your situation. It turns out (according to the discussion) that calling Runtime.getRuntime().exec() on a busy system can lead to transient memory shortages which trigger the OOM killer. If Runtime.getRuntime().exec() or similar calls do not exist in your application, then please skip the following speculation. I've made some comments concerning host resolution at the end of this message which might be helpful. If Runtime.getRuntime().exec() is used, the scenario goes like this: 1. call Runtime.getRuntime().exec() 2. fork() gets called and makes a copy of the parent process 3. System runs a different process At this point you have two processes with largish memory requirements At this point the OOM killer may get triggered 4. exec() gets called on the child process and memory requirements go back down. At least that's how I read the this reference: http://stackoverflow.com/questions/209875/from-what-linux-kernel-libc-version-is-java-runtime-exec-safe-with-regards-to-m Since processes that fork a lot of child processes are high on OOM killer's kill list, Tomcat gets killed. See for example: http://prefetch.net/blog/index.php/2009/09/30/how-the-linux-oom-killer-works/ As to why it would happen on the newer production systems and not the older system, my only idea concerns the version of the kernel you're using. Memory management has been significantly reworked between the 2.4 and 2.6 kernels. If you use a 2.4 kernel on your older system, this could explain some of the differences with memory allocation. So, if Runtime.getRuntime().exec() is used, what are some possible solutions? 1. Reducing Xms, Xmx while adding physical memory If you do this, then the fork() call without the exec() being called directly afterwards won't be as expensive. Your application will be able to serve more clients without potentially triggering the OOM killer. Garbage collection may be an issue if this is done, so tuning with JMeter is probably a good idea. 2. Create a lightweight process that forks what Runtime.getRuntime().exec() calls and communicate with the process over sockets. This is pretty unpleasant, but you might be able to treat this as a remote process server. You could then end up using a custom object, JNDI lookups, and pooling, much like database pooling. As I've said, this is all based on an assumption that the application is requesting a transiently large amount of memory caused by Runtime.getRuntime().exec() or other similar action. If this is not the case, then the above arguments are null and void. DNS Thoughts As for the ideas concerning DNS - I've never seen DNS issues actually take down an environment. However, I've seen orders of magnitude performance issues caused by poorly configured DNS resolution and missing DNS entries. One way to test DNS performance issues is to set up a client with a static IP address, but don't put it in your local DNS. Then run JMeter on this client and stress your server. Finally, add the client into DNS and stress your server with JMeter. If you notice a difference, then there are some issues with how your server uses host resolution. Make sure that nonexistent address resolution services (nisplus, nis, hesiod) are not listed as sources on the host line in /etc/nsswitch.conf (or wherever Slackware puts it). At least put a [NOTFOUND=return] entry after dns but before all the other services listed on the hosts: line of the nsswitch.conf file. So, here's a summary to all of this rambling: 1. Monitor memory with vmstat and top to get a better picture of the system memory 2. If Runtime.getRuntime().exec() is used, then transient memory allocations could trigger the OOM killer on a busy system 3. Make sure host resolution works properly, and turn it off in server.xml OK, enough rambling - hope this is useful. /mde/ --- On Wed, 2/3/10, Carl c...@etrak-plus.com wrote: From: Carl c...@etrak-plus.com Subject: Re: Tomcat dies suddenly To: Tomcat Users List users@tomcat.apache.org Date: Wednesday, February 3, 2010, 5:07 PM Chris, Interesting idea. I tried over the weekend to force that situation with
Re: Mod_JK connector configuration Error
apxs gets configuration information for apr and apr-utils, and httpd among other things. It does this by using pkg-config to find the libdir for apr, then prefixing that to httpd/build. For example, pkg-config --variable=libdir apr-1 on my system returns /usr/lib Then apxs looks in /usr/lib/httpd/build for a file called config_vars.mk. One of the first variables it pulls up and tests is PREFIX (prefix in config_vars.mk), If this doesn't work, then you'll get the message that you received. What does /opt/dasyedib/apache/bin/apxs -q PREFIX return? Is there a file config_vars.mk in PREFIX/httpd/build (where PREFIX is the value returned in the previous command)? What are the values for the APR_ and APU_ variables at the bottom of the config_vars.mk file? It sounds like your Apache utilities don't agree with your Apache httpd build / installation / configuration. Just my two cents, /mde/ --- On Wed, 2/3/10, daulat khan daulat@gmail.com wrote: From: daulat khan daulat.@gmail.com Subject: Mod_JK connector configuration Error To: Tomcat Users List users@tomcat.apache.org, us...@httpd.apache.org Date: Wednesday, February 3, 2010, 6:12 PM Hi, i am hitting the following error while configuring mod_jk connector in solaris 10 machine. i am using sun studio tools for compiling. tomcat connector latest verson 1.2.28 apache latest verson 2.2.14 and tomcat latest version 6.0.20 configure: error: You must specify a valid --with-apxs path i am using the following statement while configuring ./configure --with-apxs=/opt/dasyedib/apache/bin/apxs CFLAGS=-liconv and this tried the below statement too ./configure --with-apxs2=/opt/dasyedib/apache/bin/apxs CFLAGS=-liconv Please help. Thanks, Daulatkhan - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Parameters disappear from PUTs
As a quick check, can you go into /etc/init.d/tomcat6 and at around line 68 you'll see: TOMCAT_SECURITY=yes If you're allowed to, change that line to: TOMCAT_SECURITY=no Then restart tomcat with: ../tomcat6 restart Of course, you have to be root to do this. On first glance, I don't see a security policy that would cause this. However, if you look at the Ubuntu bugs database, there are many instances of people complaining about the security manager being enabled by default. Just my two cents . . . /mde/ --- On Wed, 2/3/10, c...@munat.com c...@munat.com wrote: From: c...@munat.com c...@munat.com Subject: RE: Parameters disappear from PUTs To: Tomcat Users List users@tomcat.apache.org Date: Wednesday, February 3, 2010, 10:43 PM OK, turns out my brother has wireshark installed. We ran it, and the packets are definitely getting to the server with the PUT params intact. So they arrive at the server, but they are missing from the output of the valve. Does this mean Tomcat is hosed? I thought maybe I'd test 24 on my laptop, but macports is still at 20, too. Guess I'll have to do it the hard way. From: c...@munat.com [mailto:c...@munat.com] Subject: Parameters disappear from PUTs When I load my app into Tomcat 6 (Ubuntu), the form submission works perfectly if I use a POST: the params are definitely received. If I use a PUT, it works, but the parameters are missing 1) Tell us your /exact/ Tomcat aversion, and whether it's a 3rd-party repackaged one or a real Tomcat from tomcat.apache..org. (The Ubuntu flavor of Tomcat gives many people grief, albeit not with the symptoms you describe.) I don't actually have a Tomcat aversion, which is why I'm using it. (It's more of an aversion to computers in general, I'd say.) But the Tomcat version is 6.0.20-2ubuntu2. 2) Tell us the /exact/ JVM version and vendor you're using. Looks like Sun JDK 6-15-1.. 3) Take a Wireshark or equivalent trace to verify that the parameters are being sent over the wire. Wireshark is kind of a bear to use and I'm not at the server. If I used Live HTTP Header in Firefox and confirmed that the params are going out, is that enough? Because I did and they are. The only difference in the headers is that the POST header includes: Pragma: no-cache Cache-Control: no-cache 4) Enable the Request Dumper Valve to see if the parameters are making it into Tomcat (but heed the warning about character encoding side effects): http://tomcat.apache.org/tomcat-6.0-doc/config/valve.html#Request%20Dumper%20Valve I did. If I POST the params are there. If I PUT, they are not, repeat, not. 5) Try the latest Tomcat 6.0.24 download and see if the problem persists. Note the following bug report: https://issues.apache.org/bugzilla/show_bug.cgi?id=37794 which was corrected in 6.0.21. It's for handling POST parameters, but might be related. Sadly, this is not currently possible. Apt-get is still at 20, and nothing goes on the server that doesn't go through Apt-get. Fortunately, I can work around it by using POST for now, but it would be nice to be able to do REST right. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Tomcat dies suddenly
--- On Thu, 2/4/10, Caldarale, Charles R chuck.caldar...@unisys.com wrote: 6. Carl was using 32-bit Linux, which he isn't :( Correct, which made the whole point moot, so I'm not sure why Dan even brought it up. I just mentioned the 32-bit Linux behavior for completeness. I did state that I realized 32-bit Linux is not in play. AFAIK, 64-bit Linux has a wide-open memory addressing scheme. Maybe it considers everything under 17 billion GiB to be low memory, now :) No, the hardware restrictions don't exist in 64-bit mode. This is what I've read as well. If you use 64-bit Linux, this problem goes away. There are also some ways to build the 32-bit kernel in order to reduce this problem. All this is moot since a 64-bit Linux kernel is being used. As to the copy-on-write behavior for fork()d processes, it would help if I read the man pages: Under Linux, fork() is implemented using copy-on-write pages, so the only penalty that it incurs is the time and memory required to duplicate the parent’s page tables, and to create a unique task structure for the child. It turns out that things are a little bit more complicated than that, in that since version 2.3.3 fork is actually a wrapper to clone(2) with the appropriate flags to give the same result as a traditional fork(2) call. All of this is moot however if there is no Runtime.exec() call in the application. I'm a bit curious though about several points: 1. The application runs fine on an older system. Do we have the glibc and kernel versions for all systems? 2. Different usage patterns (?) seem to cause the outages at different rates (if I remember an account of one Friday). What paths in the application were being exercised most heavily during that time? As for cache / buffer / free - I've seen cases where the cache did not go to 0, but swap was in play (slow disk, small amount of memory). Sorry for chasing down the rabbit hole . . . /mde/ - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat dies suddenly
--- On Fri, 2/5/10, Carl c...@etrak-plus.com wrote: Carl, 1. The application runs fine on an older system. Do we have the glibc and kernel versions for all systems? The old system: P4. 1GB memory, 1.3GB swap. Uses swap on a regular basis. kernel is 2.4.25. Java is 1.5.0_01-b08. Tomcat is 5.5.23. Glibc is version 2.3..1. New systems: Server A (Dell T110) is a Xeon 3440, sever B (Dell T105) is an AMD. A has 4GB memory and 19GB swap which is never used. B has 6GB memory and 10GB swap which is never used. A and B both use kernel version 2.6.29.6, Java 1.6.0_18-b07 and Tomcat 6.0.24.. Glibc version is 4.3.3 for both A and B. A couple of observations here: Both the old new kernels end in odd numbers. From memory, I thought the odd kernel numbers were experimental, while the even numbers were production or mainline. I don't remember when this numbering system took place, but certainly by the time the 2.6 kernels were released. From kernel.org, I didn't see a 2.6.29 release marked as stable. The thread implementation has changed between the 2.4 and 2.6 kernels. You can see the thread implementation change by running: getconf GNU_LIBPTHREAD_VERSION I'd be interested in knowing the result of that and getconf GNU_LIBC_VERSION on both systems, since I don't recognize 4.3.3 as a glibc version (latest stable is 2.11.1, so I'm assuming 2.4.3.3?). glibc has some thread bugs that were fixed, but not until 2.8 or 2.9. There was also a persistent bug for 32-bit systems that bites Java applications (not your concern since you're running 64-bit) that wasn't fixed until 2.10.1. So in short, I'm guessing this may be a glibc NPTL issue. There are some observations that don't match, in that you're using Java 6 (most problems are reported with Java 1.4 and Java 5), and that you've used OpenSuSE (kernel, glibc version?) with the same Tomcat failure. However: For some of the earlier 2.6 kernels, you could get around NPTL problems by setting this environment variable: export LD_ASSUME_KERNEL=2.4.1 which forces the use of the old linuxthreads model. I don't know if that option is available with the 2.6 kernel that you are using. Another work-around has been posted on the Java bugs forum, albeit for a different threading problem and Java 5: -XX:ParallelGCThreads=1 sets GC to single threads. It's not fixed in the Java bugs database, because later versions of RedHat Linux don't exhibit the SIGSEGV problem. Some people report that single-threading GC solves their problems, while other people report that it doesn't. Some things to try I guess: 1. export LD_ASSUME_KERNEL=2.4.1 (maybe in startup.sh?) if your kernel supports this.. 2. set -XX:ParallelGCThreads=1 in catalina.sh (JAVA_OPTS). This is an experimental switch, not documented here: http://java.sun.com/javase/technologies/hotspot/vmoptions.jsp, but documented here: http://java.sun.com/javase/technologies/hotspot/gc/gc_tuning_6.html 3. Move to an even-numbered kernel with a glibc of 2.10.1 or better. 2.10 might be OK for your environment since the bug fixed in 2.10.1 causes problems for 32-bit systems only. just my two cents . . . . /mde/ - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: development platform for jaxws-based webapps
Caveats: I'm normally a systems architect, so I get build architectures or debug performance / crash issues. I've also not built web services by hand. Getting into the middle of an IDE debate starts a religious war similar in intensity to emacs versus vi. All of that said, I just worked through the beginning examples for web services development using Netbeans 6.8 and Tomcat 6.0.26. The first tutorial was clean, easy to follow, and worked fine under Fedora 11, JDK 1.6.0_19, and Tomcat 6.0.26. As always, just my two cents . . . . --- On Mon, 4/26/10, Christoph Kukulies k...@kukulies.org wrote: From: Christoph Kukulies k...@kukulies.org Subject: development platform for jaxws-based webapps To: Tomcat Users List users@tomcat.apache.org Date: Monday, April 26, 2010, 1:19 PM I was experimenting with MyEclipse for a couple of days now to find an efficient way to generate wsdl/jaxws based wep apps. MyEclipse seem promising to me when I was starting with the article http://www.myeclipseide.com/documentation/quickstarts/webservices_jaxws/index.html but later on it turned out that the building the delegate classes /updating of webservices is not yet matured enough to allow for efficient development - I'm waiting for a response of the developer team though. Anyone here on the tomcat list using Eclipse (the open one, eclipse.org) or any other tool for developing wsdl based webservices? -- Christoph Kukulies - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: development platform for jaxws-based webapps
Addendum: It looks like the annotation @WebService() does a lot of magic under the covers. This will create some problems with you shut down the service provider. In particular: SEVERE: A web application created a ThreadLocal with key of type [null] (value [org.glassfish.gmbal.generic.operationtrace...@6de4b]) and a value of type [java.util.ArrayList] (value [[]]) but failed to remove it when the web application was stopped. To prevent a memory leak, the ThreadLocal has been forcibly removed. SEVERE: A web application created a ThreadLocal with key of type [null] (value [com.sun.xml.bind.v2.runtime.coordinato...@ec32de]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;@ffab0a]) but failed to remove it when the web application was stopped. To prevent a memory leak, the ThreadLocal has been forcibly removed. SEVERE: A web application created a ThreadLocal with key of type [null] (value [com.sun.xml.bind.v2.classfactor...@1365360]) and a value of type [java.util.WeakHashMap] (value [ {class com.sun.xml.ws.runtime.config.Tubelines =java.lang.ref.weakrefere...@19bf996, class com.sun.xml.ws.runtime.config.MetroConfig =java.lang.ref.weakrefere...@11f1f12, class javax.xml.bind.annotation.W3CDomHandler =java.lang.ref.weakrefere...@30e4a7, class com.sun.xml.ws.runtime.config.TubelineDefinition =java.lang.ref.weakrefere...@1f39c59, class java.util.ArrayList =java.lang.ref.weakrefere...@9db0ad, class com.sun.xml.ws.runtime.config.TubeFactoryList =java.lang.ref.weakrefere...@ba679e, class javax.xml.bind.annotation.adapters.CollapsedStringAdapter =java.lang.ref.weakrefere...@1e8b671, class com.sun.xml.ws.runtime.config.TubeFactoryConfig =java.lang.ref.weakrefere...@121dcac}]) but failed to remove it when the web application was stopped. To prevent a memory leak, the ThreadLocal has been forcibly removed. SEVERE: A web application created a ThreadLocal with key of type [null] (value [org.glassfish.gmbal.generic.operationtrace...@6de4b]) and a value of type [java.util.ArrayList] (value [[]]) but failed to remove it when the web application was stopped. To prevent a memory leak, the ThreadLocal has been forcibly removed. It looks like some cleanup or hand coding is in order. Otherwise repeated deployments will cause a memory leak in earlier versions of Tomcat 6, and fill up your log files with Tomcat 6.0.26. --- On Mon, 4/26/10, Mark Eggers its_toas...@yahoo.com wrote: From: Mark Eggers its_toas...@yahoo.com Subject: Re: development platform for jaxws-based webapps To: Tomcat Users List users@tomcat.apache.org Date: Monday, April 26, 2010, 3:30 PM Caveats: I'm normally a systems architect, so I get build architectures or debug performance / crash issues. I've also not built web services by hand. Getting into the middle of an IDE debate starts a religious war similar in intensity to emacs versus vi. All of that said, I just worked through the beginning examples for web services development using Netbeans 6.8 and Tomcat 6.0.26. The first tutorial was clean, easy to follow, and worked fine under Fedora 11, JDK 1.6.0_19, and Tomcat 6.0.26. As always, just my two cents . . . . - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: how to use
Google is your friend: http://openejb.apache.org/tomcat.html A bit dated: http://javanotebook.com/2007/09/28/openejb_3_and_tomcat_6.html Lots of tutorials once you get it installed: http://openejb.apache.org/ejb3-tutorial.html --- On Tue, 4/27/10, Navid Esfahani na...@sobhanpaya.com wrote: From: Navid Esfahani na...@sobhanpaya.com Subject: how to use To: users@tomcat.apache.org Date: Tuesday, April 27, 2010, 1:11 AM Hi, How to use openEJB and tomcat server for developing enterprise application in netbeans? RGDS - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Log4j logging doesn't work when a web application is moved outside Tomcat/webapps directory
I just hacked together a quick example on Windows/XP Professional. I imagine it will work the same way on my Linux machine. Environment: OS: Windows/XP Professional - all the latest patches Java: 1.6.0_20 from Sun Tomcat: 6.0.26 IDE:NetBeans 6.8 I am reworking the Spring Developer's Notebook bike store example, so I can understand Spring testing and using mock objects. I've run into a lot of interesting issues, mostly having to do with Spring test libraries versus Junit versus mock objects. However, that's a topic for another discussion. At any rate, I set up the following system: Tomcat location: C:\Apache\apache-tomcat-6.0.26 localhost webapps: C:\Apache\apache-tomcat-6.0.26\webapps foo webapps: C:\Apache\hosts\foo-hosts\webapps bar webapps: C:\Apache\hosts\bar-hosts\webapps I like to put my virtual hosts outside of the Tomcat directory tree. That way, when I upgrade Tomcat I don't have to worry about virtual host applications. Next, I duplicated the Host/Host node in server.xml for the foo and bar hosts. The resulting Host/Host nodes from my server.xml are shown below. Host name=localhost appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false /Host Host name=foo appBase=C:/Apache/hosts/foo-host/webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false /Host Host name=bar appBase=C:/Apache/hosts/bar-host/webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false /Host Note that I didn't change any of the logging prefixes and suffixes, so all common logging gets mixed together. Since this is just a proof of concept, I don't really mind. Next, I copied manager.xml from conf/Catalina/localhost to conf/Catalina/foo, and conf/Catalina/bar. I also copied the manager and ROOT web applications to foo-host\webapps and bar-host\webapps (full path above). It's nice to have a generic welcome page on test hosts just to make sure your servers are running. The manager application is useful as well, although I can just copy war files around. Finally for my setup, I added 127.0.0.1 foo and 127.0.0.1 bar to my hosts file in WINNT\system32\drivers\etc (this is an upgraded Windows/2000 Professional machine). Upon starting up this mess, all three hosts were visible at localhost:8080, foo:8080, and bar:8080 as you would expect. I then took the web application, and created three war files. The only difference in each of the war files was the location of the log file. An example is shown below. ### direct messages to file dnb-02.log ### log4j.appender.file=org.apache.log4j.FileAppender log4j.appender.file.File=${catalina.home}/logs/dnb-02.log log4j.appender.file.layout=org.apache.log4j.PatternLayout log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n ### set log levels - for more verbose logging change 'info' to 'debug' ### log4j.rootLogger=warn, file ### Spring Framework logging log4j.logger.org.springframework=info For the other two war files, I just changed dnb-02.log to foo-dnb-02.log and bar-dnb-02.log. I really should use a different environment variable and pass it in via JAVA_OPTS. That way I can set it easily in my IDE to do testing that will include logging. I then used the Tomcat manager on all three virtual hosts to load up the appropriate applications. To test, I caused different warnings to be logged in different virtual hosts, then grepped the logs for the results. As expected, I got three different log files, and the warnings (along with time stamps) were in the right log files. Note that I do not have any non-Tomcat jar in apache-tomcat-6.0.26 besides JDBC jars at this point. Just for completeness - here's the 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; context-param param-namecontextConfigLocation/param-name param-value/WEB-INF/applicationContext.xml/param-value /context-param listener listener-class org.springframework.web.context.ContextLoaderListener /listener-class /listener servlet servlet-namedispatcher/servlet-name servlet-class org.springframework.web.servlet.DispatcherServlet /servlet-class load-on-startup2/load-on-startup /servlet servlet-mapping servlet-namedispatcher/servlet-name url-pattern*.htm/url-pattern /servlet-mapping session-config session-timeout 30 /session-timeout /session-config welcome-file-list welcome-fileredirect.jsp/welcome-file /welcome-file-list /web-app Sorry for the formatting. Hope this helps. I hate to say this . . . it works for me.
RE: Tomcat 6 error compiling JSPs with nested @include directives
It also sounds like that there are CVS version control files in the deployment. While I cannot think of any security issues with this on a servlet container, there are known problems with this model when doing straight web development. I can think of two variations to your development process that would address the issue. 1. Do a CVS export of the project you are working on when you're ready to test in a servlet container. This means that you will have to check in potentially buggy code to the CVS server. In a multi-developer environment this may or may not be acceptable. 2. Use a private branch for your changes, then work on that branch (checking in, and exporting). Using branches will keep you from adding potentially broken code to the main line. It's also a great way to try out and abandon new ideas without foregoing the advantages of SCM. I also find that I don't need to run a web application in a servlet container as often if I make use of JUnit, EasyMock (or another mock solution), and the Spring test jars (if I'm working with Spring). The only times I run things in a servlet container are for integration testing and JSP - heavy applications. This is a bit far from the Tomcat core subject, but I agree with Chuck. Set up the correct environment when doing development and testing. This makes software release management and deployment much easier, and you're much less likely to break production environments. just my two cents . . . /mde/ --- On Wed, 5/5/10, Caldarale, Charles R chuck.caldar...@unisys.com wrote: From: Caldarale, Charles R chuck.caldar...@unisys.com Subject: RE: Tomcat 6 error compiling JSPs with nested @include directives To: Tomcat Users List users@tomcat.apache.org Date: Wednesday, May 5, 2010, 6:35 AM From: Nuno Faria [mailto:nuno.m.fa...@gmail.com] Subject: Re: Tomcat 6 error compiling JSPs with nested @include directives That would be a pain because I develop and maintain over 20 apps in a CVS system and would force major changes on the dir estructure for our development environments. Getting it wrong in your initial setup is not an excuse for not correcting the problem. Do you want reliable operation, or just continue to hope that invalid environments happen not to cause too many problems? I got to this working config Working would be a relative term here... Would apreciate your comments. See the response to your message in the log4j thread. - Chuck - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Help need for implementing Custom Login Module
--- On Wed, 5/5/10, Srinivasa Rao.Kandula srinivas_j...@yahoo.com wrote: I need help implementing a Custom Login module for a web application which will run on Tomcat 6.X. I need to access ServletRequest/HttpSession in side the login module to access an attribute from the HttpSession. Basically I'm supposed to use form-based authentication for the web application and the login module/relam should use an attribute from the HttpSession which was already created for the current user session(browser session).Any help will be much appreciated. Regards, Srinivas. Book: Head First Servlets and JSP by Bryan Basham, Kathy Sierra, and Bert Bates published by O'Reilly. Reference is for the first edition which covers the Servlet 2.4 spec. See Chapter 12, page 617 for a detailed explanation along with code samples, exercises, and a mock exam. Google: java form-based authentication This will turn up the Sun (now Oracle) tutorial, and an O'Reilly article on onjava.com complete with source code. /mde/ - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Context in conf/Catalina/localhost question
I just ran a series of tests on my Linux platform. I've not rebooted yet to run this on Windows, but I don't imagine there will be any change. Environment (all 32 bit): OS: Fedora 11 with latest patches Java:JRE / JDK 1.6.0_20 from Sun Tomcat: 6.0.26 installed in my local account for development / testing NetBeans:6.8 installed globally in /opt/netbeans-6.8 Application: DVDStore based on the NetBeans tutorial Scenario 1 a. Start NetBeans b. Load standard project (DVDStore) c. Set as main project d. Run (without building first) Expected result: Browser with new tab containing the application pops up Actual result: Browser with new tab containing the application pops up DVDStore.xml generated in $CATALINA_HOME/conf/Catalina/localhost contains path=/DVDStore and appBase=/home/mdeggers/NB8-Projects/DVDStore/build/web I did not put these entries into web/META-INF/context.xml in the source tree. Right mouse clicking on the project node and selecting clean removes $CATALINA_HOME/conf/Catalina/localhost/DVDStore.xml and all traces of the web application from $CATALINA_HOME/work/Catalina/localhost. Scenario 2 a. Clean and build web application b. Use Tomcat manager to deploy web application (DVDStore) c. Browse to localhost:8080/DVDStore Expected result: Application works as before Actual result: Application works as before Note that in this case, the $CATALINA_HOME/conf/Catalina/localhost/DVDStore.xml file does NOT have the path or docBase attributes in Context. Undeploying via the Tomcat manager cleanly removes all traces (war file, webapps directory, work directory, and DVDStore.xml). Trivial modifications of a JSP file (adding a meta content=blah item) appear immediately in the running application if I started with F6 (run). I did manage to run into the posted exception once, but I have been unable to reproduce it. Cleaning out .netbeans/6.8/var/cache may help. Summary: Do not add appBase and path to META-INF/context.xml in the actual project. NetBeans 6.8 seems to manage that properly (merging existing context.xml information with the path and appBase attributes). . . . . just my two cents /mde/ --- On Mon, 5/10/10, Leo Donahue - PLANDEVX leodona...@mail.maricopa.gov wrote: From: Leo Donahue - PLANDEVX leodona...@mail.maricopa.gov Subject: RE: Context in conf/Catalina/localhost question To: 'Tomcat Users List' users@tomcat.apache.org Date: Monday, May 10, 2010, 3:02 PM NetBeans 6.8 Output window: In-place deployment at C:\NetBeans_Projects\webappname\build\web Cannot deploy the module. The context.xml file seems to be broken. Check whether it is well-formed and valid. C:\NetBeans_Projects\webappname\nbproject\build-impl.xml:584: The module has not been deployed. -Original Message- From: Leo Donahue - PLANDEVX [mailto:leodona...@mail.maricopa.gov] Sent: Monday, May 10, 2010 2:51 PM To: 'Tomcat Users List' Subject: RE: Context in conf/Catalina/localhost question NetBeans 6.8 won't even run the webapp within the IDE unless the path attribute is set in META-INF/context.xml I understand why the IDE needs the path to run the webapp from the the NetBeans work directory, but do the NetBeans people talk to the Tomcat people? :) Maybe, the clean and build tool in NetBeans could strip that out when it creates the war file? I'm just saying. People forget. -Original Message- From: Leo Donahue - PLANDEVX [mailto:leodona...@mail.maricopa.gov] Sent: Sunday, May 09, 2010 6:27 PM To: 'Tomcat Users List' Subject: RE: Context in conf/Catalina/localhost question This always happens. Once I send a question I find the answer. Normally I've been copying expanded webapp directories to the webapps folder when I have Tomcat stopped for other server maintenance. I forgot that I experimented with deploying a war file for the apnxy servlet. I'm going to point the finger at NetBeans for adding the path attribute to my context. Tomcat was just doing what it is supposed to under automatic deployment: http://tomcat.apache.org/tomcat-6.0-doc/config/host.html#Automatic%20Application%20Deployment -Original Message- From: Leo Donahue - PLANDEVX [mailto:leodona...@mail.maricopa.gov] Sent: Sunday, May 09, 2010 6:17 PM To: 'Tomcat Users List' Subject: Context in conf/Catalina/localhost question I've noticed that sometimes when I make a change to an existing webapp or deploy a new one, that the file contents created in conf/Catalina/localhost do not match the contents of the context file in META-INF/context.xml of the webapp dir. Tomcat 6.0.24 - still. Upgrade is coming. Example, I added a valve to each of my webapps context.xml to turn on the access logs. The valve was the same for each webap, I only changed the name of the access log file name. Three of four webapps produced a log file, but one webapp would not produce an access log file, no matter how many times I
Re: Porting app from Tomcat 5.0.28 to 6.0.26
Here's a link from the Tomcat Wiki. http://wiki.apache.org/tomcat/TomcatHibernate The bottom portion of the document explains how to use Hibernate to manage database pooling instead of Tomcat. I hope it gives you some leads. . . . . just my two cents /mde --- On Thu, 5/13/10, Jeff Hubbs jhubbsl...@att.net wrote: From: Jeff Hubbs jhubbsl...@att.net Subject: Porting app from Tomcat 5.0.28 to 6.0.26 To: Tomcat Users List users@tomcat.apache.org Date: Thursday, May 13, 2010, 12:55 PM Hello - I have a DB2-backed legacy app on a legacy platform that I'm trying to modernize. My objective is to modernize the platform underneath the app (Gentoo Linux for now, Tomcat 6.0.26, Sun JDK 1.6.0.20) and do so in a way that a longtime Java/Tomcat integrator would readily recognize (I'm not one). App uses Hibernate and c3p0; Hibernate is packaged in the app's war but c3p0 is not; I've installed c3p0 through Gentoo's usual package management system. I've also brought in the jar for the proper version of IBM DB2 JDBC driver and its corresponding license jar to match the DB2 instance version (versioning between DB2 and JDBC driver are tightly coupled). On the legacy Tomcat 5.0 / JDK 1.5 platform, the database connection configuration info is handled in a seemingly customized way - something to do with virtual hosts. At the top of the Tomcat-instance-wide server.xml file is this structure: !DOCTYPE web-app[ !ENTITY vhosts SYSTEM vhosts.xml ] But for now, I'm not interested in dealing with any kind of virtual host arrangement. The impetus behind that was so that users can run two independent sessions of the app in two separate browser tabs or windows . In the vhosts.xml file is info that looks like it ought to belong in the app's context.xml file. I understand that how context sections are written have changed since 5.0 and I *think* I've got that worked out. The app's original MANIFEST.MF file has this in it: Classpath: WEB-INF/classes/mycapp/resource WEB-INF/classes/myapp/resource /tld WEB-INF/classes/elms/resource/hbm/MYAPP So: given a working platform and after deploying the app war that I've been given (let's call it myapp.war), here are the post-deploy steps I've worked out so far: * Create a symlink for $CATALINA_BASE/webapps/myapp/WEB-INF/lib/c3p0.jar to where the package manager has put c3p0.jar * Create symlinks for db2jcc.jar and db2jcc_license_cu.jar in $CATALINA_BASE/webapps/myapp/WEB-INF/lib to where I've put them under /usr/src * Generate a new $CATALINA_BASE/webapps/myapp/META-INF/context.xml (see below) and symlink $CATALINA_BASE/conf/Catalina/localhost/myapp.xml to it * Add the following to $CATALINA_BASE/webapps/myapp/WEB-INF/web.xml, before the closing /web-app: resource-ref descriptionDB connection pool for MYAPP/description res-ref-namejdbc/myappqa/res-ref-name res-typecom.mchange.v2.c3p0.ComboPooledDataSource/res-type res-authContainer/res-auth /resource-ref I've created a context.xml that looks like: Context docBase=${catalina.home}/webapps/myapp path= reloadable=false Resource name=jdbc/myappqa description = MYAPP connection pool auth=Container type=com.mchange.v2.c3p0.ComboPooledDataSource username=myappuser password=myapppassword driverClass=com.ibm.db2.jcc.DB2Driver url=jdbc:db2://mydb2server:5/TESTDATA factory=org.apache.naming.factory.BeanFactory minPoolSize=15 . . scissors of brevity applied - more parameters set . / /Context I've been able to browse to the app and get a login page, but things explode at login attempt, i.e., first attempt to access the data source. Question 1: For this to work, do I need to add WEB-INF/lib to the Classpath: list? There are about 80 jar files (including log4j, ftpbean, Hibernate) in there aside from the symlinks I've added for the c3p0, JDBC driver, and license jar files. Question 2: In my context.xml, is that one parameter supposed to be driverClass or driverClassName? I've seen both used seemingly for the same purpose. Question 3: Some customization has been done involving hibernate.properties which I don't think is necessarily causing a problem (its meat has been replaced by a reference to another file much like server.xml), but in there I've noticed this: property name=hibernate.connection.pool_size15/property As I understand it, setting this parameter activates Hibernate's own connection pooler and further that Hibernate's own connection pooler is not supposed to be used in any capacity other than learning and testing. Does having this setting be in here mean that this app was built (intentionally or not - likely not) to use Hibernate's connection pooler and c3p0 end-to-end? Thanks in advance
Re: Porting app from Tomcat 5.0.28 to 6.0.26
I'm not familiar with the earlier versions of Hibernate, so I can't reliably comment. However, the principles should be the same even if some of the names have changed. If you are relying on Hibernate for database connections and database pooling, then you'll want to put all of that information into the Hibernate configuration files and none of it in META-INF/context.xml and WEB-INF/web.xml. Just a quick skim of the documentation at http://simoes.org/docs/hibernate-2.1/reference/html/index.html and a forum message concerning cp30 configuration doesn't reveal any name changes, but your mileage may vary. Also, according to the migration document found at http://community.jboss.org/wiki/HibernateCoreMigrationGuide30, there are a lot of code changes between Hibernate 2 and Hibernate 3, but apparently no configuration changes. Hopefully, the c3p0 / Hibernate managed database connection configuration given at the bottom of the Wiki page should work for Hibernate 2.x. just my two cents . . . . /mde/ --- On Fri, 5/14/10, Jeff Hubbs jhubbsl...@att.net wrote: Also, this wiki says Hibernate ships with the CP30 connection pooling classes, so as long as the Hibernate jars are in WEB-INF/lib directory (which they should be), they should be available. Was that also true as of Hibernate 2.1b6? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: stuck confused an need help please
OK - I have a huge message that I'm going to cut and paste into this one, rather than finding the original and editing it online. I'm going to edit in place and try to point out some issues. I'll ask some questions along the way. I am trying to tweak my web application at thejarbar.org to be bug free. Currrntly here is an issue whn clicking the tutorials button as you can view in your browser. I am getting some kind of exceptions as ell listed in the following stack trace and don't know how to osolve after days of trying. I have been getting mysql SELECT privilege denied exception even though user has all access to database. code deleted . . . although I recommend reworking in with try, catch, and finally blocks. Otherwise you WILL have connection leaks. As a first timer I would likw to know how a typical hibernate webapp is moved from development to production please have a look at the page if you have the time Use the same database names in both cases. Unfortunately, the URL will be different. One way is to parametrize your build to use different hibernate.cfg.xml files. You could also use Ant and appropriate build.properties files. Finally, you could spend some time with Maven. here is a log of all errors related to clicking that link ERROR main org.apache.catalina.core.ContainerBase.[Catalina] - Exception opening database connection java.sql.SQLException: Access denied for user ' yucca123_tom'@'localhost' (using password: YES) This looks like you cannot even connect. As others have pointed out, there is a space in front of the user name. I'm also a bit confused here. You say (further down or in another message), that you have the JDBC driver in your WEB-INF/lib folder, but this looks like you are using Tomcat's database pooling? If you're using Tomcat's database pooling, do not put the driver jars in WEB-INF/lib. If you're using Hibernate to control the connections, then don't put the driver jars in Tomcat's lib. See this link for a complete explanation of how to set everything up. http://wiki.apache.org/tomcat/TomcatHibernate The only way I was able to sort of reproduce your error was by changing the attribute resource=username in my context.xml file to resource= username. Adding a space to the username property in hibernate.cfg.xml caused no error. Fix your configuration files here. INFO main org.apache.catalina.core.StandardContext - The listener com.sun.faces.config.ConfigureListener is already configured for this context. The duplicate definition has been ignored. INFO main org.apache.catalina.core.StandardContext - The listener com.sun.faces.config.ConfigureListener is already configured for this context. The duplicate definition has been ignored. Are you using the database login ID to create tables? This is a very dangerous practice. One slip concerning SQL injection and you'll have a completely destroyed database. ERROR TP-Processor2 org.hibernate.tool.hbm2ddl.SchemaUpdate - Unsuccessful: create table jarbartest.user_roles (user_name varchar not null, role_name varchar not null, primary key (user_name, role_name)) Fix your HQL ERROR TP-Processor2 org.hibernate.tool.hbm2ddl.SchemaUpdate - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null, role_name varchar not null, primary key (user_name, role_name))' at line 1 ERROR TP-Processor2 org.hibernate.tool.hbm2ddl.SchemaUpdate - Unsuccessful: create table jarbartest.usercomments (commentID int unsigned not null, commentMade varchar not null, dateMade datetime not null, flagged bit not null, page_id varchar not null, made_by varchar(20) not null, primary key (commentID)) Fix your HQL ERROR TP-Processor2 org.hibernate.tool.hbm2ddl.SchemaUpdate - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null, dateMade datetime not null, flagged bit not null, page_id varchar not ' at line 1 ERROR TP-Processor2 org.hibernate.tool.hbm2ddl.SchemaUpdate - Unsuccessful: create table jarbartest.users (user_name varchar not null, first_name varchar not null, last_name varchar not null, user_email varchar not null, ip_address varchar not null, user_pass varchar not null, primary key (user_name)) Fix your HQL ERROR TP-Processor2 org.hibernate.tool.hbm2ddl.SchemaUpdate - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'not null, first_name varchar not null, last_name varchar not null, user_email va' at line 1 ERROR TP-Processor2 org.hibernate.tool.hbm2ddl.SchemaUpdate - Unsuccessful: alter table jarbartest.usercomments add index FKAA77CEBF792FED2F (made_by), add constraint FKAA77CEBF792FED2F foreign key (made_by) references jarbartest.users (user_name) This is assigned to a different database user. Are you using multiple
Re: stuck confused an need help please
They have to be on the classpath. The base configuration file ends up in WEB-INF/classes. I've always put my hbm.xml files alongside the classes they map. Make sure that there is only one copy of your JDBC driver in your classpath as well, and that it's in the right location. /mde/ --- On Tue, 5/25/10, Yucca Nel yucca...@live.co.za wrote: From: Yucca Nel yucca...@live.co.za hello and than you. I will spend next few hours fixing this. I need to fix hibernate catalog too as it is still trying to create tables in my test datatabase probably because catalogs are defined for test database in entity hbm.xml mappings? Do these mappings ususally go in the WEB-INF classes directory or can I put them with other metadata directly in WEB-INF? I am not too sure on the username being incorrect for my credentials defined in xml as I made sure to check for trailing and leading whitespace but will look again.I will also fix the error handle and path to error page - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: sneaky JDBC connection (was: THANK YOU ALL for help)
--- On Fri, 5/28/10, Christopher Schultz ch...@christopherschultz.net wrote: Problem #2: I noticed another message in intellij complaianing that a mysql connecton was not closed but was closed by the container to prevent a memory leak. I have look everywhere in code and have closed the connection in a finally block ehrnever it has been opened. Any idea where I should close this connection? I am using hibernate btw. Search your code for DriverManager or getConnection. Can you post the log message that you get? Can you post a sanitized sample of your JDBC code so we can see it? A couple of things here. You've posted a section of your Hibernate code in the past, and I had commented that you really need to surround your connections with try / catch / finally. Someone (Chris or Chuck) has posted boilerplate code on the list recently in answer to another question that demonstrates a good template. You'll also want to be at the latest release of the MySQL JDBC connector. There are some permgen memory leaks fixed in 5.1.11, and the latest release is 5.1.12 (5.1.11 is not available for download). In particular, 5.1.11 fixes: - Fixed Bug#36565 - permgen leak from java.util.Timer. Unfortunately no great fix exists that lets us keep the timer shared amongst connection instances, so instead it's lazily created if need be per-instance, and torn down when the connection is closed. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: sneaky JDBC connection (was: THANK YOU ALL for help)
I apologize to the list, the last message got truncated and sent. I hit return twice while editing in Yahoo (normally edit off-line). OK - for the database leak. Use try / catch / finally blocks around all connection code (Hibernate or otherwise). I think someone posted boilerplate code to the list not too long ago. // try catch finally pseudocode // review and use at your own risk Session session = HibernateUtil.getSessionFactory.openSession(); Transaction tx = null; try { tx = session.beginTransaction(); // do your database stuff here tx.commit(); } catch (Exception e) { if (tx != null) { tx.rollback(); } // do something meaningful here - log and recover } finally { if (session != null) { session.close(); } The Hibernate documentation advocates using filters to get and close sessions, especially if you're using a secondary cache. Secondly, there have been some permgen leaks fixed in the latest versions of the MySQL JDBC driver. Make sure you're using 5.1.12 (latest version). 5.1.11 fixed a permgen leak from java.util.Timer. Here's the permgen leak bug notation: - Fixed Bug#36565 - permgen leak from java.util.Timer. Unfortunately no great fix exists that lets us keep the timer shared amongst connection instances, so instead it's lazily created if need be per-instance, and torn down when the connection is closed. Again, sorry for the earlier message. . . . . just my two cents /mde/ - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: problems at thejarbar.org
I think you are running into a MySQL database connection timeout. You can use a MySQL admin interface (command line, PHPAdmin, MySQL Workbench, etc.) to verify the idle connection timeout limit. There have been comments on the web concerning this. One such discussion and a solution are here: http://lists.mysql.com/java/6578 The explanation of the parameters given in the above link can be found here: http://dev.mysql.com/doc/refman/5.0/en/connector-j-reference-configuration-properties.html Based on those two references, you'll need to modify your Realm database URL: connectionURL=jdbc:mysql://localhost:3306/yucca123_thejarbarautoReconnect=truereconnectAtTxEnd=true Note, I have not tried this, so test before production. The other solution mentioned is to use a DataSource Realm. This requires you to configure a JNDI datasource describing your database connection as well as the DataSource Realm. You can add all of this information in your web application's META-INF/context.xml file if it's application-specific. If this is a host or service-based definition, then you'll have to define the JNDI resources in a GlobalNamingResources element. See the following: http://tomcat.apache.org/tomcat-6.0-doc/config/globalresources.html Note the warning that this resource will not be available to an individual web application unless you use a ResourceLink in your META-INF/context.xml file. See the globalresources link above for an example. Since you're using this connection for container managed authentication and authorization, I'm not sure why your web application would need access to this resource. However, it's 3 am, so I may have missed a few points that Chuck, Charles, or Pid will be happy to correct. To summarize - it seems the easiest fix is to add the following properties to your JDBC url: autoReconnect=true reconnectAtTxEnd=true Add them to the end of the URL, connected with ampersands. I hope this gets you up and running. . . . . . just my two cents /mde/ --- On Sun, 5/30/10, Yucca Nel yucca...@live.co.za wrote: From: Yucca Nel yucca...@live.co.za Subject: Re: problems at thejarbar.org To: Tomcat Users List users@tomcat.apache.org Date: Sunday, May 30, 2010, 9:34 AM Yes, but I am using JDBC and followed the setup step by step from tomcat docs ?xml version=1.0 encoding=UTF-8? Server port=9170 Listener className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener/ Listener className=org.apache.catalina.core.JasperListener / Listener className=org.apache.catalina.mbeans.ServerLifecycleListener/ GlobalNamingResources Resource auth=Container description=User database name=UserDatabase type=org.apache.catalina.UserDatabase pathname=conf/tomcat-users.xml factory=org.apache.catalina.users.MemoryUserDatabaseFactory/ /GlobalNamingResources Service name=Catalina Connector port=9670 minSpareThreads=1 address=127.0.0.1 maxThreads=50 maxSpareThreads=3 connectionTimeout=3 protocol=AJP/1.3 /Connector Engine defaultHost=thejarbar.org name=Catalina Realm className=org.apache.catalina.realm.UserDatabaseRealm/Realm className=org.apache.catalina.realm.JDBCRealm driverName=com.mysql.jdbc.Driver connectionURL=jdbc:mysql://localhost:3306/yucca123_thejarbar connectionName=yucca123_tom connectionPassword=myPass userTable=users userNameCol=user_name userCredCol=user_pass userRoleTable=user_roles roleNameCol=role_name/Host appBase=/home/yucca123/public_html name=thejarbar.org Aliaswww.thejarbar.org/Alias Context path=/the_jar_bar Listener className=org.apache.catalina.startup.TldConfig/ /Context Context docBase=/usr/local/tomcat/users/yucca123/tomcat/webapps/manager path=/manager privileged=true reloadable=true Listener className=org.apache.catalina.startup.TldConfig/ ResourceEnvRef name=users type=org.apache.catalina.UserDatabase/ /Context Context docBase=the_jar_bar path= reloadable=true Listener className=org.apache.catalina.startup.TldConfig/ /Context /Host /Engine /Service /Server May be missing something... http://tomcat.apache.org/tomcat-6.0-doc/jndi-resources-howto.html#JDBC%20Data%20Sources This error does not occur every time -- From: Jeff jwi...@cox.net Sent: Sunday, May 30, 2010 5:54 PM To: Tomcat Users List users@tomcat.apache.org Subject: Re: problems at thejarbar.org would this help? http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html#Common%20Problems On 5/30/2010 10:08 AM, Yucca Nel
Re: problems at thejarbar.org
Chris, based on what you're saying and the server.xml posted earlier in this thread, the following should be done? 1. Remove the JDBCRelm from the Engine node 2. Create a GlobalNamingResources Resource entry with the following: Resource name=jdbc/auth description=The Jar Bar user authentication type=javax.sql.DataSource auth=Container driverClassName=com.mysql.jdbc.Driver maxActive=10 maxIdle=3 maxWait=1 password=MyPassword url=jdbc:mysql://localhost:3306/yucca123_thejarbar validationQuery=/* ping */ SELECT 1 username=MyUser/ This is basically what I would normally put in the context.xml file of a web application for an application-specific database connection. 3. Then create a DataSource Realm under the Engine node to replace JDBCRealm. Realm className=org.apache.catalina.realm.DataSourceRealm userTable=users userNameCol=user_name userCredCol=user_pass userRoleTable=user_roles roleNameCol=role_name dataSourceName=jdbc/auth It was a little unclear to me from the documentation that I could put all of the resource attributes in a GlobalNamingResources Resource entry. It was also a little unclear to me that I could just refer to a global resource name with dataSourceName in the Realm. Thanks for clearing that up. . . . just my two cents /mde/ --- On Tue, 6/1/10, Christopher Schultz ch...@christopherschultz.net wrote: From: Christopher Schultz ch...@christopherschultz.net Subject: Re: problems at thejarbar.org To: Tomcat Users List users@tomcat.apache.org Date: Tuesday, June 1, 2010, 7:14 AM -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Yucca Nel, On 5/30/2010 1:53 PM, Yucca Nel wrote: Ok I need to keep connection open to avoid exceeption but have found this is deprecated autoReconnect=true can someone provide up to date strategy for dealing with this? Don't use autoReconnect as a parameter to the JDBC driver. Instead, use the validationQuery on the connection pool to have the pool verify that the connection is still valid. MySQL Connector/J even supports a ping query that can gracefully fall-back to driver versions that don't support it. I highly recommend that you: 1. Use a Tomcat-configured DataSource 2. Use a DataSourceRealm coupled with #1 3. Tell Hibernate to use #1 That way, all your db configuration is in one place. Add this parameter to your DataSource configuration (it configures the connection pool): validationQuery=/* ping */ SELECT 1 This will cause the connection pool to execute that query every time a connection is requested from the pool, just to verify that it's properly connected. Your web application should never get a dead connection and therefore shouldn't have to deal with that situation. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
[OT] Re: problems at thejarbar.org
Chris, I think it all depends what you need your Realm to manage. In this instance (single application on Tomcat), then it probably doesn't matter if the Realm sits at the application, Host, or Engine level. Like you've pointed out before it's nice to have a self-contained application with all of the database configurations in one spot. Having some database configurations in META-INF/context.xml, and others in Tomcat's server.xml seems to be a maintenance / migration challenge waiting to happen. If you have multiple applications using the same Realm information, then it might make sense to move the Realm to a Host or Engine level. However I cannot think of a good use case off the top of my head to potentially run multiple hosts under one Engine with the same authentication Realm . . . . Maybe a better place to document all of this and some use case scenarios would be the Wiki. Since I'm thinking about this, I'll see what I can cobble up in the next few days. Thanks for the comments . . . . /mde/ --- On Tue, 6/1/10, Christopher Schultz ch...@christopherschultz.net wrote: From: Christopher Schultz ch...@christopherschultz.net Subject: Re: problems at thejarbar.org To: Tomcat Users List users@tomcat.apache.org Date: Tuesday, June 1, 2010, 3:03 PM -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Mark, Yes, but honestly, I'd put the Resource and Realm. configuration into my webapp's META-INF/context.xml file (which requires that localDataSource=true be set on the Realm, btw). - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: hibernate not finding global resource datasource defined by tomcat
Please read the following for a detailed description on how to configure Hibernate to use JNDI resources supplied by Tomcat. http://wiki.apache.org/tomcat/TomcatHibernate Then you will need a ResourceLink element in META-INF/context.xml to make the resource in GlobalNamingResources available to your application. The configuration for that information can be found here: http://tomcat.apache.org/tomcat-6.0-doc/config/context.html#Resource%20Links Finally, unless you place Tomcat's manager and admin application's authentication and authorization information in your database, removing the UserDatabaseRealm from GlobalNamingResources will prevent you from using the manager and admin application. You can place more than one Resource element in the GlobalNamingResources element of your server.xml. I'm trying to finish up a document on DataSourceRealms. Hopefully that will get posted on Tomcat's Wiki today or tomorrow, depending on other time constraints. just my two cents . . . . . /mde/ --- On Mon, 6/14/10, yucca...@live.co.za yucca...@live.co.za wrote: Hello tomcats!! Please advise as to why hibernate us unable to find jndi datasource configured in tomcat? Trying 2 different setups here: 1) server.xml resource as follows: GlobalNamingResources !-- Editable user database that can also be used by UserDatabaseRealm to authenticate users -- Resource name=jdbc/auth description=The Jar Bar user authentication type=javax.sql.DataSource auth=Container driverClassName=com.mysql.jdbc.Driver maxActive=30 maxIdle=10 maxWait=1 password=myPass url=jdbc:mysql://localhost:3306/yucca123_thejarbar validationQuery=/* ping */ SELECT 1 username=yucca123_tom/ /GlobalNamingResources with hibernate.cfg.xml: ?xml version='1.0' encoding='utf-8'? !DOCTYPE hibernate-configuration PUBLIC -//Hibernate/Hibernate Configuration DTD//EN http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd; hibernate-configuration session-factory property name=connection.urljdbc:mysql://localhost:3306/yucca123_thejarbar/property property name=hibernate.connection.datasourcejava:comp/env/jdbc/auth/property property name=connection.driver_classcom.mysql.jdbc.Driver/property property name=connection.usernameyucca123_tom/property property name=current_session_context_classthread/property property name=connection.passwordpookie123/property mapping resource=org/bar/jar/model/UserRolesEntity.hbm.xml/ mapping resource=org/bar/jar/model/UsercommentsEntity.hbm.xml/ mapping resource=org/bar/jar/model/UsersEntity.hbm.xml/ !-- DB schema will be updated if needed -- !-- property name=hbm2ddl.autoupdate/property -- /session-factory /hibernate-configuration so I try 2) moving resource and realm element to context.xml with adding localdatasource attribute to resource (true) and get same exception? What am I missing here? tomcat is latest 6.0.26 mysql 5 with global connector (inside common/lib) Ideally I want the global(server.xml) config for the resource as it WILL be shared among deployed applications, but because this is first application I am willing to use just contect configured resource. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: hibernate not finding global resource datasource defined by tomcat
Sure, I can make an attempt at it. I'd like to finish the wiki entry first. What I'm writing though will have to be drastically shortened for the documentation page I think. I just ran into a bit of a puzzle though. I was trying to unravel what happens when you put everything into server.xml and use a CombinedRealm. Under Linux, I had to add a ResourceLink element to my context.xml in order to use the sub-Realm. I can understand that I need a ResourceLink when I put the Resource in GlobalNamingResources and the Realm in context.xml, but I was rather surprised that I needed the ResourceLink when both are in server.xml. I'll see if I can reproduce this on Windows/XP (make sure I've done everything in a reasonable order). If that is indeed the case, can someone explain: 1. Context.xml - everything no ResourceLink needed (obviously) 2. Context.xml - Realm, server.xml Resource in GlobalNamingResources ResourceLink needed (obviously) 3. Server.xml - CombinedRealm, Resource in GlobalNamingResources ResourceLink needed (??) thanks for clearing things up . . . . /mde/ --- On Mon, 6/14/10, Mark Thomas ma...@apache.org wrote: From: Mark Thomas ma...@apache.org Subject: Re: hibernate not finding global resource datasource defined by tomcat To: Tomcat Users List users@tomcat.apache.org Date: Monday, June 14, 2010, 2:59 PM On 14/06/2010 22:45, Mark Eggers wrote: I'm trying to finish up a document on DataSourceRealms. Hopefully that will get posted on Tomcat's Wiki today or tomorrow, depending on other time constraints. I don't suppose you fancy providing a patch for the Tomcat docs as well... (or instead of) Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: tomcat hibernate wiki
I've added a sentence clarifying that, saying that you still need the dialect property. --- On Tue, 6/15/10, yucca...@live.co.za yucca...@live.co.za wrote: Please add to the wiki that hibernate dialect must still be set. Wiki says, must have NO database configuration properties but just got an exception complaining om missing dialect properties - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: hibernate not finding global resource datasource defined by tomcat
My bad. Copy and paste laziness led to a stray localDataSource=true attribute winding up in my server.xml Realm definition. Fixed, and now everything works as expected. Back to writing. /mde/ --- On Mon, 6/14/10, Mark Thomas ma...@apache.org wrote: From: Mark Thomas ma...@apache.org Subject: Re: hibernate not finding global resource datasource defined by tomcat To: Tomcat Users List users@tomcat.apache.org Date: Monday, June 14, 2010, 11:31 PM On 15/06/2010 02:21, Mark Eggers wrote: Sure, I can make an attempt at it. I'd like to finish the wiki entry first. What I'm writing though will have to be drastically shortened for the documentation page I think. I just ran into a bit of a puzzle though. I was trying to unravel what happens when you put everything into server.xml and use a CombinedRealm. Under Linux, I had to add a ResourceLink element to my context.xml in order to use the sub-Realm. I can understand that I need a ResourceLink when I put the Resource in GlobalNamingResources and the Realm in context.xml, but I was rather surprised that I needed the ResourceLink when both are in server.xml. I'll see if I can reproduce this on Windows/XP (make sure I've done everything in a reasonable order). If that is indeed the case, can someone explain: 1. Context.xml - everything no ResourceLink needed (obviously) 2. Context.xml - Realm, server.xml Resource in GlobalNamingResources ResourceLink needed (obviously) 3. Server.xml - CombinedRealm, Resource in GlobalNamingResources ResourceLink needed (??) Should be no. If not, it is a bug. Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'
Are you developing on 6.0.x but deploying on 5.?.x (5.0 or 5.5)? What version is running in production? --- On Tue, 6/15/10, yucca...@live.co.za yucca...@live.co.za wrote: From: yucca...@live.co.za yucca...@live.co.za Subject: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' To: Tomcat Users List users@tomcat.apache.org Date: Tuesday, June 15, 2010, 1:11 PM I have tried to check why this exception is thrown in production but not development The difference between production snd development server is: development) put mysql jar into CATALINA/lib (tomcat 6.0.26) production) choice of common/lib or share/lib exception is thrown by hibernate which is wrapping the exception from realm - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: basic 2 virtual hosts configuration
MB, You can follow the instructions given for Tomcat 6 on this wiki page: http://wiki.apache.org/tomcat/TomcatDevelopmentVirtualHosts The only difference is that the Manager application for Tomcat 5.5.29 is contained in the ROOT application. This means that you will skip the following step. 3. Copy the manager application from $CATALINA_HOME/webapps to each of the virtual host webapp directories 1. For virtual host foo, this means copying manager to hosts/foo-host/webapps (full path depends on actual location to match the server.xml entry) 2. For virtual host bar, this means copying manager to hosts/bar-host/webapps (full path depends on actual location to match the server.xml entry) I just tested this on my 5.5.29 installation on Fedora 13 (Java 6.0.20). Works as advertised. just my two cents . . . /mde/ --- On Tue, 6/15/10, MB digital.disc...@gmail.com wrote: From: MB digital.disc...@gmail.com Subject: Re: basic 2 virtual hosts configuration To: Tomcat Users List users@tomcat.apache.org Date: Tuesday, June 15, 2010, 10:21 PM Caldarale, Charles R said: Nothing, but you must do it correctly. Yes, I figured that much. :) You don't set the path attribute - in almost all cases it is illegal (and / is never correct, under any circumstances - read the doc). Interesting. Time for a reread. Engine name=Catalina defaultHost=kron Realm className=org.apache.catalina.realm.UserDatabaseRealm resourceName=UserDatabase / Host name=medpsy appBase=/home/webbplatser/medpsy.no / Host name=kron appBase=/home/webbplatser/kron.no / /Engine The above looks ok. Thanks Fragment context settings in /Catalina/kron/ROOT.xml (similar for the other site: docBase=/home/webbplatser/kron.no/ROOT path=/ Take out the docBase and path attributes; they're not allowed here. The path is derived from the name of the .xml file, and the webapp is located in the Host appBase, so docBase must not be used. This seems to be vital info I'll try and incorporate. Time for testing! Why have you declared the above? Where in the doc does it say you should do that? Actually Tomcat did that. Thanks for your response, Charles. Very helpful. Hassan Schroeder said In the documentation? http://tomcat.apache.org/tomcat-5.5-doc/virtual-hosting-howto.html Thanks for your response, Hassan. Perhaps I should have been more clear what I had done already. I've read that page, took my time, cleaned out my old install, reinstalled 5.5.28, updated and installed 5.5.29. I also have 3 books about Tomcat with similar instructions. Information about Tomcat often seem to me to be incomplete, not entirely relevant to what I want to set up - multiple hosts, standalone and so on - or is often way too detailed or just not based around real world examples, which makes it difficult to extract info. I have succeeded many times before setting up server with Tomcat 4. In contrast configuring Apache2 - with vhosts anyway - is a piece of cake to setup. Not the same cup of tea, but nevertheless. I really want to understand Tomcat in this regard as it's very difficult to run a java-based server unless you have a virtual server and this means - for me anyway - I have to set it up and administrate it as there's no budget and no people I know that I can ask as of now. In return for any help I receive, I'll write a guide for mere mortals, put it on the web and make it known here, so no pesky newbies have to ask about this more than necessarily. This setup is so basic it should just work. Folding up my sleeves. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: basic 2 virtual hosts configuration
You're right of course. I meant you don't copy over the manager web application separately from the ROOT. It's in $CATALINA_HOME/server/webapps/manager and the manager.xml file in $CATALINA_HOME/conf/Catalina/host has a docBase attribute. /mde/ --- On Wed, 6/16/10, Pid p...@pidster.com wrote: From: Pid p...@pidster.com Subject: Re: basic 2 virtual hosts configuration To: Tomcat Users List users@tomcat.apache.org Date: Wednesday, June 16, 2010, 2:58 AM On 16/06/2010 08:12, Mark Eggers wrote: MB, You can follow the instructions given for Tomcat 6 on this wiki page: http://wiki.apache.org/tomcat/TomcatDevelopmentVirtualHosts The only difference is that the Manager application for Tomcat 5.5.29 is contained in the ROOT application. Eh? I'm not sure you meant what that actually says. p This means that you will skip the following step. 3. Copy the manager application from $CATALINA_HOME/webapps to each of the virtual host webapp directories 1. For virtual host foo, this means copying manager to hosts/foo-host/webapps (full path depends on actual location to match the server.xml entry) 2. For virtual host bar, this means copying manager to hosts/bar-host/webapps (full path depends on actual location to match the server.xml entry) I just tested this on my 5.5.29 installation on Fedora 13 (Java 6.0.20). Works as advertised. just my two cents . . . /mde/ --- On Tue, 6/15/10, MB digital.disc...@gmail.com wrote: From: MB digital.disc...@gmail.com Subject: Re: basic 2 virtual hosts configuration To: Tomcat Users List users@tomcat.apache.org Date: Tuesday, June 15, 2010, 10:21 PM Caldarale, Charles R said: Nothing, but you must do it correctly. Yes, I figured that much. :) You don't set the path attribute - in almost all cases it is illegal (and / is never correct, under any circumstances - read the doc). Interesting. Time for a reread. Engine name=Catalina defaultHost=kron Realm className=org.apache.catalina.realm.UserDatabaseRealm resourceName=UserDatabase / Host name=medpsy appBase=/home/webbplatser/medpsy.no / Host name=kron appBase=/home/webbplatser/kron.no / /Engine The above looks ok. Thanks Fragment context settings in /Catalina/kron/ROOT.xml (similar for the other site: docBase=/home/webbplatser/kron.no/ROOT path=/ Take out the docBase and path attributes; they're not allowed here. The path is derived from the name of the .xml file, and the webapp is located in the Host appBase, so docBase must not be used. This seems to be vital info I'll try and incorporate. Time for testing! Why have you declared the above? Where in the doc does it say you should do that? Actually Tomcat did that. Thanks for your response, Charles. Very helpful. Hassan Schroeder said In the documentation? http://tomcat.apache.org/tomcat-5.5-doc/virtual-hosting-howto.html Thanks for your response, Hassan. Perhaps I should have been more clear what I had done already. I've read that page, took my time, cleaned out my old install, reinstalled 5.5.28, updated and installed 5.5.29. I also have 3 books about Tomcat with similar instructions. Information about Tomcat often seem to me to be incomplete, not entirely relevant to what I want to set up - multiple hosts, standalone and so on - or is often way too detailed or just not based around real world examples, which makes it difficult to extract info. I have succeeded many times before setting up server with Tomcat 4. In contrast configuring Apache2 - with vhosts anyway - is a piece of cake to setup. Not the same cup of tea, but nevertheless. I really want to understand Tomcat in this regard as it's very difficult to run a java-based server unless you have a virtual server and this means - for me anyway - I have to set it up and administrate it as there's no budget and no people I know that I can ask as of now. In return for any help I receive, I'll write a guide for mere mortals, put it on the web and make it known here, so no pesky newbies have to ask about this more than necessarily. This setup is so basic it should just work. Folding up my sleeves. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail
Re: tomcat.exe 6.0.18 to 6.0.26 stdout/stderr redirection
If you're running as a service, why don't you make use of --StdOutput and --StdError as documented here: http://tomcat.apache.org/tomcat-6.0-doc/windows-service-howto.html Also, if you're running as a service, the Tomcat Monitor allows you to change this at any point. There's a tab called Logging that allows you to set a bunch of parameters. /mde/ --- On Sun, 6/20/10, Bulkan bul...@gmail.com wrote: From: Bulkan bul...@gmail.com Subject: tomcat.exe 6.0.18 to 6.0.26 stdout/stderr redirection To: users@tomcat.apache.org Date: Sunday, June 20, 2010, 6:06 PM Hi All, Before we upgraded from Tomcat 6.0.18 to 6.0.26 I was able to redirect stdout/stderr of tomcat.exe using the following Python code; from subprocess import Popen logfile = open('tomcat.log', 'w') p = Popen(r'C:\Program Files\Apache Software Foundation\Tomcat 6.0\bin\tomcat6.exe', shell=True, stdout=logfile, stderr=logfile) but with 6.0.26, the above code fails to redirect the output to tomcat.log, all of the output goes to the console (cmd.exe). Has something changed in 6.0.26 (Windows) that would effect this behaviour ? Cheers --- Bulkan Evcimen - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Convert a certificate from IIS (.PFX) into a (.keystore) for Apache Tomcat v 6.x
Google is your friend? http://www.cb1inc.com/2007/04/30/converting-pfx-certificates-to-java-keystores/ Please note that I have not tried this. Your mileage may vary. /mde/ --- On Wed, 6/23/10, ian loyola ian_loy...@yahoo.com wrote: From: ian loyola ian_loy...@yahoo.com Subject: Convert a certificate from IIS (.PFX) into a (.keystore) for Apache Tomcat v 6.x To: users@tomcat.apache.org Date: Wednesday, June 23, 2010, 3:04 PM Dear colleagues, I'm running IIS version 6 and Apache Tomcat 6.x on a Windows 2003 enterprise server. I had to renew SSL certificates for both the IIS and Tomcat web server. I was told to raise a CSR from the IIS server and create a certificate. The certificate (.PFX) could then be converted into a (.keystore) file for Tomcat. Unfortunately, I'm struggling with this. Generating a new CSR is unfortunately not an option as it needs to be completed tomorrow. Could you please please assist me to convert a certificate from IIS (.PFX) into a (.keystore) for Apache Tomcat v 6.x? Thank you. Best regards, Ian - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: No members active in cluster group
A quick question: Does the Windows Server stop multicast packets? I was exploring clustering today on Fedora 13, and I had to modify my firewall rules to allow multicast. Here's a nice tool from an earlier thread about clustering. If you run this on your local machine you should see messages. See the thread: http://marc.info/?t=10831889571r=1w=4 And for the tool, see this particular mail message: http://marc.info/?l=tomcat-userm=108319193624084w=4 Another thing to look out for is broadcasting to 127.0.0.1. From the document at http://tomcat.apache.org/tomcat-6.0-doc/cluster-howto.html 3. The IP broadcasted is java.net.InetAddress.getLocalHost().getHostAddress() (make sure you don't broadcast 127.0.0.1, this is a common error) Hope this helps. . . . . just my two cents /mde/ - Original Message From: Andrew Bruno andrew.br...@gmail.com To: Tomcat Users List users@tomcat.apache.org Sent: Thu, July 15, 2010 5:39:28 PM Subject: Re: No members active in cluster group Are both instances running on the same host Yes, both running on same host. I will upgrade, and see how it goes. Thanks On Thu, Jul 15, 2010 at 8:31 PM, Rainer Jung rainer.j...@kippdata.de wrote: On 15.07.2010 10:08, Andrew Bruno wrote: Hello all, I am having problems in getting clustering to work in a windows server 2008 environment using tomcat 6.0.20 java 1.5 I get the No members active in cluster group message on both tomcats. The engine element on the first tomcat is: Engine name=Catalina defaultHost=localhost jvmRoute=1 Cluster className=org.apache.catalina.ha.tcp.SimpleTcpCluster channelSendOptions=4 Manager className=org.apache.catalina.ha.session.DeltaManager name=someapp expireSessionsOnShutdown=false notifyListenersOnReplication=true/ Channel className=org.apache.catalina.tribes.group.GroupChannel Membership className=org.apache.catalina.tribes.membership.McastService address=228.0.0.5 port=45564 frequency=500 dropTime=3000/ Receiver className=org.apache.catalina.tribes.transport.nio.NioReceiver address=111.111.111.148 port=4001 autoBind=100 selectorTimeout=5000 maxThreads=12/ Sender className=org.apache.catalina.tribes.transport.ReplicationTransmitter Transport className=org.apache.catalina.tribes.transport.nio.PooledParallelSender/ /Sender Interceptor className=org.apache.catalina.tribes.group.interceptors.TcpFailureDetector/ Interceptor className=org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor/ Interceptor className=org.apache.catalina.tribes.group.interceptors.ThroughputInterceptor/ /Channel Valve className=org.apache.catalina.ha.tcp.ReplicationValve filter=.*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.htm;.*\.html;.*\.css;.*\.txt;.*\.xls;.*\.sdf;.*\.xml;/ !-- only with jk_mod failover-- Valve className=org.apache.catalina.ha.session.JvmRouteBinderValve enabled=true sessionIdAttribute=takeoverSessionid / !-- only with jk_mod and jvmroutebindervalve-- ClusterListener className=org.apache.catalina.ha.session.JvmRouteSessionIDBinderListener/ ClusterListener className=org.apache.catalina.ha.session.ClusterSessionListener/ /Cluster Host name=localhost unpackWARs=false autoDeploy=false xmlValidation=false xmlNamespaceAware=false Alias111.111.111.154/Alias Aliassomeapp.com/Alias Valve className=org.apache.catalina.valves.AccessLogValve directory=E:\logs\websites\secure_app_01 prefix=default_access_log. suffix=.txt pattern='%h %l %u %t %r %s %b %{user-agent}i %{referer}i' resolveHosts=true/ Logger className=org.apache.catalina.logger.FileLogger directory=E:\logs\websites\secure_app_com_01 prefix=error_log. suffix=.txt timestamp=true/ Context path= reloadable=false distributable=true docBase=E:\web_secure_01\secure_app_com_01 workDir=E:\web_secure_01\secure_work_01 WatchedResourceWEB-INF/web.xml/WatchedResource Logger className=org.apache.catalina.logger.SystemOutLogger verbosity=4 timestamp=true/ /Context /Host
Re: Is FarmWarDeployer is working?
Shammi, I have something working for 3 Tomcat 6.0.29 nodes on Fedora 13 using Sun JRE/JDK 1.6.0_21. I've not tried undeploying a web application yet. Here's what I've found so far on Tomcat 6.0.29. 1. You have to place the Cluster node under the Host element. Tomcat 6.0.29 complains that the element Cluster/Deployer element is not understood at the Engine level. 2. One node needs to have watchEnabled=true, all other nodes watchEnabled=false 3. deployDir is the same as appBase This last is a guess, but it seemed logical (and works). Based on my reading of the scant documentation, the war file gets deployed there for Tomcat to run (hence the deployDir name). There is some noise in the documentation about deploying ROOT in this fashion, but I've not experimented with that yet. I've not read the javadoc (yet) nor looked through the source code (on my list of things to do). So basically, here's my Deployer configuration for a three node cluster running on one machine (fronted by Apache and load balanced via mod_jk). Deployment node: a. Change the [name] to fit your implementation or leave out the Alias elements. b. Change $CATALINA_BASE/name to be your absolute path to the directory Host name=localhost appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false Alias[a-host-name]/Alias Alias[another-host-name]/Alias !-- cluster must go here in order to use farm deployment -- Cluster className=org.apache.catalina.ha.tcp.SimpleTcpCluster Deployer className=org.apache.catalina.ha.deploy.FarmWarDeployer tempDir=$CATALINA_BASE/temp-dir/ deployDir=$CATALINA_BASE/webapps/ watchDir=$CATALINA_BASE/watch-dir/ watchEnabled=true/ /Cluster /Host Other nodes: a. Same notes apply - change [name] to suit your implementation or leave out Alias b. Replace $CATALINA_BASE with the absolute path to the directory Host name=localhost appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false Alias[a-host-name]/Alias Alias[another-host-name]/Alias !-- cluster at host level for farm deployment -- Cluster className=org.apache.catalina.ha.tcp.SimpleTcpCluster Deployer className=org.apache.catalina.ha.deploy.FarmWarDeployer tempDir=$CATALINA_BASE/temp-dir/ deployDir=$CATALINA_BASE/webapps/ watchDir=$CATALINA_BASE/watch-dir/ watchEnabled=false/ /Cluster /Host I haven't tried this on the subversion trunk, and I've seen some recent commits to the clustering components. Hopefully this will get you started. . . . . just my two cents /mde/ - Original Message From: Christopher Schultz ch...@christopherschultz.net To: Tomcat Users List users@tomcat.apache.org Sent: Fri, August 6, 2010 7:44:21 AM Subject: Re: Is FarmWarDeployer is working? -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Shammi, On 8/6/2010 5:28 AM, sha...@arosys.com wrote: I have created two instances of tomcat7 in the same machine. First time I am using FarmWarDeployer. I only knows that using this we can deploy our application in one node in the tomcat cluster rather than deploying in all the nodes. Unfortunately, there isn't much documentation on the FarmWarDeployer. Here's what I've been able to find: http://tomcat.apache.org/tomcat-7.0-doc/cluster-howto.html ...which gives a configuration example: Deployer className=org.apache.catalina.ha.deploy.FarmWarDeployer tempDir=/tmp/war-temp/ deployDir=/tmp/war-deploy/ watchDir=/tmp/war-listen/ watchEnabled=false/ It also says: The default tomcat cluster supports farmed deployment, ie, the cluster can deploy and undeploy applications on the other nodes. The state of this component is currently in flux but will be addressed soon. There was a change in the deployment algorithm between Tomcat 5.0 and 5.5 and at that point, the logic of this component changed to where the deploy dir has to match the webapps directory. For more info, Please visit the reference documentation I suspect the phrase the cluster in the first sentence really means one particular node in the cluster. The reference documentation mention at the end is currently blank :( There is also, of course, the javadoc: http://tomcat.apache.org/tomcat-7.0-doc/api/org/apache/catalina/ha/deploy/FarmWarDeployer.html The documentation seems all messed-up: The javadoc says deployDir - the directory where we watch for changes and applicationDir - the directory where we install applications but it's clear that the former is where the apps are installed, the latter is fictional, and the real watch directory is called watchDir. Then after some reading what I did is : I created /tmp/war-deploy , /tmp/war-app , /tmp/war-listen and /war-temp directories. Good. What is /tmp/war-app for? What does your Deployer element look like? I suspect something
Clustering within a single system
I apologize for the wall of text. I'm working through the clustering and farm deployment documentation for Tomcat 6 / Tomcat 7. To that end I've set up a 3 node cluster load balanced by an Apache web server on a single system. The environment and configuration particulars are at the end of the mail message. Problem summary: The application is a quick sample that does the following: 1. Form-based login 2. Some personal information that can be customized (session variable) 3. Random pet generated from a pet factory and a properties file (session variable) 4. Exit message on logout containing the chosen pet and the personalization info If I pre-deploy the distributable application to all three nodes, I get reasonable log entries, and the application works as expected. If I start up Tomcat and then deploy the application to the three nodes, I get error messages in the logs, and the application is not available until the last timeout for clustering has expired (default of 60 seconds). However, once this timeout has passed, clustering seems to work. I observe similar problems when using the farm deployer. The application does not seem to be available until it is deployed across the 3 nodes and the cluster timeout has passed. I have not tried these tests in a controlled fashion using Tomcat from subversion. So, how do I remove the errors from the logs? . . . . just my two cents. /mde/ Sequence of events which works cleanly: 1. Copy the RPets.war file to each of the three $CATALINA_BASE/webapps directories 2. Start up each Tomcat instance - wait 5 seconds between startups so ports can be chosen for clustering (I could configure these) 3. Test the application Log samples: 1. Cluster membership adds normally (logs from one node) INFO: Receiver Server Socket bound to:/127.0.0.1:4001 INFO: Replication member added: org.apache.catalina.tribes.membership.MemberImpl[tcp://{127, 0, 0, 1}:4000, {127, 0, 0, 1},4000, alive=6538,id={67 -53 75 3 -46 11 67 34 -67 -33 -126 -125 107 115 76 -17 }, payload={}, command={}, domain={}, ] INFO: Replication member added: org.apache.catalina.tribes.membership.MemberImpl[tcp://{127, 0, 0, 1}:4002, {127, 0, 0, 1},4002, alive=1013,id={62 -72 -97 73 10 97 74 -30 -109 -12 93 -125 114 -109 4 24 }, payload={}, command={}, domain={}, ] 2. Session replication information received normally (logs from one node) INFO: Deploying configuration descriptor RPets.xml INFO: Register manager /RPets to cluster element Host with name localhost INFO: Starting clustering manager at /RPets WARNING: Manager [/RPets], requesting session state from org.apache.catalina.tribes.membership.MemberImpl[tcp://{127, 0, 0, 1}:4000, {127, 0, 0, 1},4000, alive=9540, id={67 -53 75 3 -46 11 67 34 -67 -33 -126 -125 107 115 76 -17 }, payload={}, command={}, domain={}, ]. This operation will timeout if no session state has been received within 60 seconds. INFO: Manager [/RPets]; session state send at 8/7/10 11:30 AM received in 275 ms. Operation: The application works as expected. I can turn off the node that is being accessed, and after a brief pause the web browser will continue to display the results. All session variables are duplicated as expected. I do notice the following on shutdown: SEVERE: The web application [/RPets] appears to have started a thread named [pool-1-thread-1] but has failed to stop it. This is very likely to create a memory leak. This error is not present when running on a Tomcat instance without clustering enabled (web application is marked distributable, but no Cluster element is present). Sequence of events which causes the errors: 1. Start up each Tomcat instance - wait 5 seconds between startups so ports can be chosen for clustering (I could configure these) 2. Copy the RPets.war file to each of the three $CATALINA_BASE/webapps directories 3. Test the application Log samples: 1. Cluster membership adds normally (logs from one node) INFO: Replication member added: org.apache.catalina.tribes.membership.MemberImpl[tcp://{127, 0, 0, 1}:4000, {127, 0, 0, 1},4000, alive=6538,id={-33 84 107 57 -77 93 76 39 -85 92 -37 -74 71 26 38 -35 }, payload={}, command={}, domain={}, ] INFO: Replication member added: org.apache.catalina.tribes.membership.MemberImpl[tcp://{127, 0, 0, 1}:4002, {127, 0, 0, 1},4002, alive=1030,id={-121 38 109 -46 -48 66 77 -80 -70 -101 127 80 5 58 119 -70 }, payload={}, command={}, domain={}, ] 2. After copying the war file to $CATALINA_BASE/webapps (no delay to make sure application is deployed) INFO: Deploying web application archive RPets.war INFO: Register manager /RPets to cluster element Host with name localhost INFO: Starting clustering manager at /RPets WARNING: Manager [/RPets], requesting session state from org.apache.catalina.tribes.membership.MemberImpl[tcp://{127, 0, 0, 1}:4000, {127, 0, 0, 1},4000, alive=661430, id={-33 84 107 57 -77 93 76 39 -85 92 -37 -74 71 26 38 -35
Re: Cluster Logging
How about something like this: handlers = 1catalina.org.apache.juli.FileHandler, \ 2localhost.org.apache.juli.FileHandler, \ 3manager.org.apache.juli.FileHandler, \ 4host-manager.org.apache.juli.FileHandler, \ java.util.logging.ConsoleHandler, \ 5cluster.org.apache.juli.FileHandler 5cluster.org.apache.juli.FileHandler.level = FINE 5cluster.org.apache.juli.FileHandler.directory = ${catalina.base}/logs 5cluster.org.apache.juli.FileHandler.prefix = cluster. org.apache.catalina.tribes.MESSAGES.level = FINE org.apache.catalina.tribes.MESSAGES.handlers = 5cluster.org.apache.juli.FileHandler org.apache.catalina.tribes.level = FINE org.apache.catalina.tribes.handlers = 5cluster.org.apache.juli.FileHandler org.apache.catalina.ha.level = FINE org.apache.catalina.ha.handlers = 5cluster.org.apache.juli.FileHander Adjust logging levels accordingly. . . . just my two cents. /mde/ - Original Message From: Oscar Segarra Rey osega...@gencat.cat To: Tomcat Users List users@tomcat.apache.org Sent: Mon, August 9, 2010 2:44:35 AM Subject: Cluster Logging Hi, I would like to monitor cluster as it was in tomcat 5.5 with the clause doClusterLog in tomcat 6.0.24. I have added the following lines in logging.properties: org.apache.catalina.tribes.MESSAGES.level = FINE org.apache.catalina.tribes.level = FINE org.apache.catalina.ha.level = FINE And messages are written into catalina.out file. I would like to write cluster messages in a cluster.out file but in the official web I could not find how to. http://tomcat.apache.org/tomcat-6.0-doc/logging.html How can I achieve this objective ? Thanks in advance. Oscar Segarra Rey Àrea de tecnologies de la informació i les comunicacions Departament de la Presidència C/ Sant Honorat 1-3 - 08002 Barcelona 934024834 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Cluster Logging
Let me try that again since my copy/paste failed. # # add an extra handler to direct to a different file # handlers = 1catalina.org.apache.juli.FileHandler, \ 2localhost.org.apache.juli.FileHandler, \ 3manager.org.apache.juli.FileHandler, \ 4host-manager.org.apache.juli.FileHandler, \ java.util.logging.ConsoleHandler, \ 5cluster.org.apache.juli.FileHandler # # define the base level and where the file should go # handlers = 1catalina.org.apache.juli.FileHandler, 2localhost.org.apache.juli.FileHandler, 3manager.org.apache.juli.FileHandler, 4host-manager.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler,5cluster.org.apache.juli.FileHandler # # now the actual levels - adjust accordingly # org.apache.catalina.tribes.MESSAGES.level = INFO org.apache.catalina.tribes.MESSAGES.handlers = 5cluster.org.apache.juli.FileHandler org.apache.catalina.tribes.level = INFO org.apache.catalina.tribes.handlers = 5cluster.org.apache.juli.FileHandler org.apache.catalina.ha.level = INFO org.apache.catalina.ha.handlers = 5cluster.org.apache.juli.FileHander /mde/ - Original Message From: Oscar Segarra Rey osega...@gencat.cat To: Tomcat Users List users@tomcat.apache.org Sent: Mon, August 9, 2010 2:44:35 AM Subject: Cluster Logging Hi, I would like to monitor cluster as it was in tomcat 5.5 with the clause doClusterLog in tomcat 6.0.24. I have added the following lines in logging.properties: org.apache.catalina.tribes.MESSAGES.level = FINE org.apache.catalina.tribes.level = FINE org.apache.catalina.ha.level = FINE And messages are written into catalina.out file. I would like to write cluster messages in a cluster.out file but in the official web I could not find how to. http://tomcat.apache.org/tomcat-6.0-doc/logging.html How can I achieve this objective ? Thanks in advance. Oscar Segarra Rey Àrea de tecnologies de la informació i les comunicacions Departament de la Presidència C/ Sant Honorat 1-3 - 08002 Barcelona 934024834 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: DB connection error and broken images while changing webapp context path
Astghik, As has already been pointed out: 1. Don't put Context elements in server.xml - use either: a. META-INF/context.xml in your web application b. $CATALINA_HOME/conf/Catalina/[hostname]/[application].xml 2. Don't use docBase in your Context element. Tomcat will figure that out 3. Don't use subdirectories of one appBase as the appBase for another host - this will probably get you double deployment. If you want your application to be known as both http://localhost:8080/ and http://my.ip.com:8080/ then you can do the following: 1. Rename your war file ROOT.war. This is the name used for the root application 2. Add an Alias element to your original Host element - something like this: Host name=localhost appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false Aliasmy.ip.com/Alias /Host From your path statements, it looks like you're using the default Ubuntu-distributed Tomcat (and maybe OpenJDK)? This has led to some problems in the past. I recommend downloading the latest tar.gz of Tomcat 6 (6.0.29) from tomcat.apache.org, and the latest version of Java (1.6.0_21) from Oracle/Sun for your platform. If you're having trouble getting Hibernate to work with Tomcat, and especially Tomcat's database connection pooling, you might want to see the following Wiki article: http://wiki.apache.org/tomcat/TomcatHibernate If you really are interested in virtual hosts rather than just an Alias, then you might want to see the following Wiki article: http://wiki.apache.org/tomcat/TomcatDevelopmentVirtualHosts Once you get all of this digested, then post your information (Tomcat server version - complete with minor revision numbers, JRE version, OS, server.xml with no comments and sensitive info blanked out, web.xml from your application, hibernate.cfg.xml, Spring configuration files, and where your images are located in your web application structure) if you're still stuck. Hope this helps. . . . . just my two cents. /mde/ - Original Message From: Astghik mkrtch@mail.ru To: users@tomcat.apache.org Sent: Fri, August 13, 2010 4:03:43 AM Subject: DB connection error and broken images while changing webapp context path Hello All. I have Apache Tomcat 6 server running on Ubuntu 9.10. . I've changed my application context path http://myip:8080/myapp to http://myip:8080 by making changes in server.xml. Engine name=Catalina defaultHost=localhost Realm className=org.apache.catalina.realm.UserDatabaseRealm resourceName=UserDatabase/ Host name=localhost appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false Context path= docBase=myapp debug=0/ /Host Host name=www.myip.com appBase=/var/lib/tomcat6/webapps Context path= docBase=myapp/ /Host /Engine But I got another problem, all images (there are in /var/lib/tomcat6/webapps/myapp/img dir) are broken and An error occurred: org.springframework.dao.DataAccessResourceFailureE xception: could not execute query; nested exception is org.hibernate.exception.JDBCConnectionException: could not execute query exception is throwing. How to fix those problems? Regards, Astghik - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: JNDI: LDAPv3 with StartTLS
A couple of things come to mind: Could this be a remote firewall issue? If you have an LDAP client that can go against your server, that would answer that question. I did a quick search, and there are a lot of messages concerning Debian and java.net.SocketException: Network is unreachable messages. The underlying theme seems to be IPv6. Although I didn't see any IPv6 listings in your netstat command, you might try adding -Djava.net.preferIPv4Stack=true to JAVA_OPTS (make a file called setenv.sh in $CATALINA_HOME/bin and set it). Other than that, I'm just guessing at this point. . . . . just my two cents. /mde/ - Original Message From: Igor Galić i.ga...@brainsware.org To: Tomcat Users List users@tomcat.apache.org Sent: Sun, August 15, 2010 9:28:31 AM Subject: Re: JNDI: LDAPv3 with StartTLS This is getting out of hand... i.ga...@pheme /opt/tomcat6 % sudo netstat -nalpt | grep -w LISTEN|grep 80 tcp0 0 0.0.0.0:80880.0.0.0:* LISTEN 30503/traffic_manag tcp0 0 0.0.0.0:80910.0.0.0:* LISTEN 30513/traffic_serve tcp0 0 127.0.0.1:8000 0.0.0.0:* LISTEN 17112/httpd-prefork tcp0 0 127.0.0.1:8001 0.0.0.0:* LISTEN 16454/httpd-worker tcp0 0 0.0.0.0:80 0.0.0.0:* LISTEN 30503/traffic_manag tcp0 0 0.0.0.0:80810.0.0.0:* LISTEN 30503/traffic_manag tcp0 0 0.0.0.0:80830.0.0.0:* LISTEN 30503/traffic_manag tcp0 0 0.0.0.0:80840.0.0.0:* LISTEN 30513/traffic_serve i.ga...@pheme /opt/tomcat6 % java -version java version 1.6.0_21 Java(TM) SE Runtime Environment (build 1.6.0_21-b06) Java HotSpot(TM) 64-Bit Server VM (build 17.0-b16, mixed mode) i.ga...@pheme /opt/tomcat6 % sudo rm -rf logs/* i.ga...@pheme /opt/tomcat6 % sudo /etc/init.d/tomcat6 start Starting Tomcat6 Container: :Using CATALINA_BASE: /opt/tomcat6 Using CATALINA_HOME: /opt/tomcat6 Using CATALINA_TMPDIR: /opt/tomcat6/temp Using JRE_HOME:/usr/lib/jvm/java-6-sun/jre Using CLASSPATH: /opt/tomcat6/bin/bootstrap.jar i.ga...@pheme /opt/tomcat6 % less logs/catalina.out Aug 15, 2010 4:25:30 PM org.apache.coyote.http11.Http11Protocol init SEVERE: Error initializing endpoint java.net.SocketException: Invalid argument at java.net.PlainSocketImpl.socketBind(Native Method) at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:365) at java.net.ServerSocket.bind(ServerSocket.java:319) at java.net.ServerSocket.init(ServerSocket.java:185) at org.apache.tomcat.util.net.DefaultServerSocketFactory.createSocket(DefaultServerSocketFactory.java:56) at org.apache.tomcat.util.net.JIoEndpoint.init(JIoEndpoint.java:540) at org.apache.coyote.http11.Http11Protocol.init(Http11Protocol.java:176) at org.apache.catalina.connector.Connector.initialize(Connector.java:1014) at org.apache.catalina.core.StandardService.initialize(StandardService.java:680) at org.apache.catalina.core.StandardServer.initialize(StandardServer.java:795) at org.apache.catalina.startup.Catalina.load(Catalina.java:524) at org.apache.catalina.startup.Catalina.load(Catalina.java:548) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:261) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) Aug 15, 2010 4:25:30 PM org.apache.catalina.startup.Catalina load SEVERE: Catalina.start LifecycleException: Protocol handler initialization failed: java.net.SocketException: Invalid argument at org.apache.catalina.connector.Connector.initialize(Connector.java:1016) at org.apache.catalina.core.StandardService.initialize(StandardService.java:680) at org.apache.catalina.core.StandardServer.initialize(StandardServer.java:795) at org.apache.catalina.startup.Catalina.load(Catalina.java:524) at org.apache.catalina.startup.Catalina.load(Catalina.java:548) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:261) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) Aug 15, 2010 4:25:30 PM
Re: JNDI: LDAPv3 with StartTLS
Reading your original request, you're using an external certificate to go against your LDAP server, right? If so, you might try using Felix's code, and then adding authentication=EXTERNAL to the Realm configuration. Your JNDIRealm configuration would then end up looking like: Realm className=org.apache.catalina.realm.JNDIRealm connectionURL=ldap://mail.brainsware.org:389/; alternateURL=ldap://mail.esotericsystems.at:389; commonRole=admin connectionName=uid=whatever connectionPassword=securityisgreat. userBase=ou=people,dc=brainsware,dc=org userPattern=(uid={0})(postOfficeBox=internal_projects) startTLS=true authentication=EXTERNAL userSearch=(uid={0}) / That is, if I'm reading the StartTLS tutorial, Realm configuration docs, and org.apache.catalina.realm.JNDIRealm.java code correctly . . . Another approach to using Felix's code is to create a separate class, put it in a jar, and then add that jar to $CATALINA_HOME/lib. You'll have to add an MBeans descriptor as well. How to do all that is documented: (Realm) http://tomcat.apache.org/tomcat-6.0-doc/realm-howto.html#Overview (MBeans) http://tomcat.apache.org/tomcat-6.0-doc/mbeans-descriptor-howto.html That way you'll have a generic Tomcat instead of a patched version. . . . just my two cents /mde/ - Original Message From: Igor Galić i.ga...@brainsware.org To: Tomcat Users List users@tomcat.apache.org Sent: Sun, August 15, 2010 12:10:56 PM Subject: Re: JNDI: LDAPv3 with StartTLS If you are feeling lucky and are willing to compile tomcat yourself, you can try the attached diff. I haven't tested it, since I don't have an ldap server around at the moment. You have to extend the realm configuration with Realm ... startTLS=true ... / Hi Felix, thanks for quick work! I've checked out the 6.0 branch, applied the patch, compiled it and run it with + Realm className=org.apache.catalina.realm.JNDIRealm + connectionURL=ldap://mail.brainsware.org:389/; + alternateURL=ldap://mail.esotericsystems.at:389; + commonRole=admin connectionName=uid=whatever connectionPassword=securityisgreat. + userBase=ou=people,dc=brainsware,dc=org userPattern=(uid={0})(postOfficeBox=internal_projects) + startTLS=true + userSearch=(uid={0}) / (I have my config files in subversion, this is svn diff) But the logoutput: INFO: Starting Servlet Engine: Apache Tomcat/6.0.0-dev Aug 15, 2010 7:06:02 PM org.apache.catalina.realm.JNDIRealm open WARNING: Exception performing authentication javax.naming.AuthenticationNotSupportedException: [LDAP: error code 13 - confidentiality required] at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:3032) at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2987) at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2789) at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2703) at com.sun.jndi.ldap.LdapCtx.init(LdapCtx.java:293) at com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:175) at com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:193) at com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.java:136) at com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:66) at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667) at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288) at javax.naming.InitialContext.init(InitialContext.java:223) at javax.naming.InitialContext.init(InitialContext.java:197) at javax.naming.directory.InitialDirContext.init(InitialDirContext.java:82) at org.apache.catalina.realm.JNDIRealm.open(JNDIRealm.java:1981) at org.apache.catalina.realm.JNDIRealm.start(JNDIRealm.java:2086) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1037) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445) at org.apache.catalina.core.StandardService.start(StandardService.java:519) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:581) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414) And the wireshark scan: r...@iris ~ # tshark host 188.40.115.116 Running as user root and
Re: How can i tell how much of allocated heap is being used?
Would visualvm serve your purpose? https://visualvm.dev.java.net/ . . . . just my two cents. /mde/ - Original Message From: laredotornado laredotorn...@gmail.com To: users@tomcat.apache.org Sent: Wed, August 18, 2010 11:41:37 AM Subject: How can i tell how much of allocated heap is being used? Hi, I'm using Tomcat 6.0.26, Java 1.6 on Linux kernel 2.6.18-164.11.1.el5. I'm trying to figure out if there if we can figure out how much of our allocated heap memory is actually being used. Grateful for any thoughts you might have, - Dave - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Installation problem [newbie]
A couple of things: The list in general strips attachments, so your log did not make it through. The file httpd-2.2.16-win32-x86-openssl-0.9.8o.msi is for installing the Apache web server. The Apache web server is useful if you are planning to write PHP, Perl, Python, or Lisp/Scheme web sites. The file apache-tomcat-6.0.29.exe is the file for installing Apache Tomcat as a service on Windows. Tomcat is useful if you are planning to write Java web sites. If you run Tomcat on Windows as a service, the installer will figure everything out. The service installation is good enough for many uses. Documentation for service installation is here: http://tomcat.apache.org/tomcat-6.0-doc/setup.html#Windows Documentation for managing the service under Windows is here: http://tomcat.apache.org/tomcat-6.0-doc/windows-service-howto.html If you are going to actively develop Java web applications, then it's sometimes useful to install from the zip archive. Many IDEs use the batch files from the zip archive to start and stop Tomcat. Just unzip the archive in a directory that you have read/write access to. Add an environment variable called JAVA_HOME and point it to your installation of the Java JRE. On Windows the JRE is usually located in C:\Program Files\Java\jre6 (for the latest versions of Java). Now to run the unzipped version of Apache Tomcat, just open a DOS command window, navigate to the bin directory under where you unpacked the zip file. For example, if you unpacked the zip file in C:\, the bin subdirectory would be in C:\apache-tomcat-6.0.29\bin. Type startup (which will run startup.bat) to start Tomcat, and shutdown (which will run shutdown.bat) to stop Tomcat. To get your IDE to work with Tomcat, it's best to ask on the IDE mailing list (for example, NetBeans or Eclipse). On my XP system, I've installed both. I set the service startup to manual, and I point my IDE (NetBeans) to the zip file installation. . . . . just my two cents /mde/ From: Jonathan Camilleri camilleri@gmail.com To: Tomcat users@tomcat.apache.org Sent: Wed, August 18, 2010 11:17:59 AM Subject: Installation problem [newbie] I ran into an installation problem, and, hope you can help me out with it. Initially I tried running the installer (httpd-2.2.16-win32-x86-openssl-0.9.8o.msi), on my laptop which runs Windows XP, and, I was prompted for the following: Network Domain - laptop is a standalone pc and field is mandatory; is a workaround available? Server Name - is this the name of the computer? Administrator's Email address - no problem :) The instructions available online do not seem to be relevant for this installation file, and, I was told that I should try downloading from another location. So I downloaded Apache Tomcat 6.0.29, which I assumed is the latest stable version, and, I am following RUNNING.txt for the installation. Even though I think I created the Java variables (section 1), when I run startup.bat, an error is displayed. See tomcat.installation.command.log which is attached to this email. Any ideas, please? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: war not redeploying
Are you starting and stopping Tomcat under Cygwin? I've seen some interesting file locking problems (as well as the terminate batch job? question) when running Windows applications under Cygwin. How are you deploying your web application? Are you copying the new war file into $CATALINA_HOME/webapps, using the manager application, or deploying via an IDE? I'm on Linux at the moment, so I can't explore this. However, here are some things you might try. 1. Run everything under DOS. If you're a UNIX person, then this is not going to be as comfortable as running Cygwin, but it will remove some unintended consequences. Or as Konstantin suggested, run things on Linux. 2. Use the manager application for deployment. If you are looking at a command line mechanism for deploying applications to production, you might take a look at the Ant tasks. Documentation for the Ant tasks can be found here: http://tomcat.apache.org/tomcat-6.0-doc/manager-howto.html#Executing_Manager_Commands_With_Ant (sorry for the wrapped line) 3. Use the IDE in a development environment Both NetBeans and Eclipse allow you to deploy to a running Tomcat (and start / stop Tomcat) from within the IDE. In a development environment I find that much more convenient than opening a shell and executing commands. Some quick notes on your web application (which I don't think will affect its loading and unloading): 1. Debug is no longer a valid attribute for the Context element. 2. There appear to be some issues with with your Resource element describing your JDBC connection. 3. Some of the connection pool threads issues could be due to a JDBC driver. If you're using MySQL, make sure you have the latest JDBC driver. Versions before 5.1.11 did cause problems. . . . . just my two cents. /mde/ - Original Message From: Sean McEligot seanmc...@gmail.com To: Tomcat Users List users@tomcat.apache.org Sent: Wed, August 18, 2010 12:04:46 PM Subject: Re: war not redeploying On Wed, Aug 18, 2010 at 11:56 AM, Konstantin Kolinko knst.koli...@gmail.com wrote: 6.0.25 An odd version... I'm in the middle of purchasing springsource-tc. The version is actually springsource tomcat-6.0.25.A-RELEASE, but I don't think they change anything except they have multiple catalina.base servers for one catalina.home. I had the same problem on standard tomcat 6.0.20. shutdown; rm -rf webapps/appname work/* temp/*; startup. Do you run rm -rf on Windows? Yes. I'm using cygwin. Note, that there is also the following file: conf/Catalina/localhost/appname.xml What is its modification time? Is clock set up correctly on the machine? The clock is working.There isn't anything in conf/Catalina/localhost. The directory is empty. antiJARLocking=true antiResourceLocking=true It would be better to test on some Linux machine. You won't be using the above options on Solaris. Well, this is important in production, but also in development. Since the problem is sporadic and fails silently. There's been a few occasions where I think my code fix isn't working, only to find out the code was never deployed. That can be very frustrating. For now I'll reset the context.xml to Context since none of those options are helping me. Also different end-of-line handling, '/' vs '\', file names, filename case sensitivity may catch you. WatchedResourcebuild.txt/WatchedResource WatchedResource is used to reload a webapp (e.g. when editing web.xml), not to redeploy it. OK. I don't need WatchedResource then. I've removed it. By the way, please create or edit your webapp's META-INF/context.xml, not the default one. I've reset context.xml back to default except jdbc resources and access logging. Are there any messages in the logs? No. The logs are silent when I deploy. There were some errors on the last undeploy before it stopped working. See below. Are you using this webapps folder (e.g., Tomcat can be run with a different CATALINA_BASE). I'm sure because I've verified it when redeploy is working. Best regards, Konstantin Kolinko - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org Here's the logs from deploying and then undeploying the war. After this it does not redeploy and there are no message when I try to redeploy. 18-Aug-2010 14:16:22.796 INFO org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive blview.war 18-Aug-2010 14:16:24.546 WARNING org.apache.tomcat.jdbc.pool.ConnectionPool.init maxIdle is larger than maxActive, setting maxIdle to: 2 18-Aug-2010 14:16:24.562 WARNING org.apache.tomcat.jdbc.pool.ConnectionPool.init maxIdle is larger than maxActive, setting maxIdle to: 2 18-Aug-2010 14:16:24.562 WARNING org.apache.tomcat.jdbc.pool.ConnectionPool.init maxIdle is larger than maxActive, setting maxIdle to: 2 18-Aug-2010 14:16:24.562 WARNING
Re: Installation problem [newbie]
Please only reply to the list. I read the list regularly (and respond sporadically). I also get about 200 mail messages per day, and will probably miss mail messages from addresses I don't recognize. I will certainly not respond to addresses I don't recognize very quickly. Thanks. I'll make comments inline. Well, I've installed the webserver (1st file), however, no services are running, and, no page is running on http://127.0.0.1:8080 (IIS runs on port 80). Which 1st file? If you've installed the httpd-2.2.16-win32-x86-openssl-0.9.8o.msi file, that is not Tomcat. That is the Apache web server which much like IIS (I think it's much better than IIS, but that's my opinion). If you're going to install that, you'll need to switch your IIS server service to manual and shut it down. If you installed apache-tomcat-6.0.29.exe, then you should see the Tomcat Monitor application in your system tray. This can be used to start and stop Tomcat. Make sure you have administrator privileges, and that you've allowed Tomcat / Java in your firewall. When you first run Tomcat, Windows will prompt you for this. When I try to start up catalina, it says that it cannot find JAVA_HOME, but I am not sure why... *Microsoft Windows XP [Version 5.1.2600]* *(C) Copyright 1985-2001 Microsoft Corp.* * * *C:\Documents and Settings\Joncd %CATALINA_HOME%* * * *C:\Program Files\apache-tomcat-6.0.29dir* * Volume in drive C has no label.* * Volume Serial Number is D80F-8634* * * * Directory of C:\Program Files\apache-tomcat-6.0.29* * * *18/08/2010 19:18DIR .* *18/08/2010 19:18DIR ..* *18/08/2010 19:33DIR bin* *18/08/2010 18:47DIR conf* *18/08/2010 18:47DIR lib* *19/07/2010 14:5938,656 LICENSE* *18/08/2010 18:47DIR logs* *19/07/2010 14:59 573 NOTICE* *19/07/2010 14:59 8,669 RELEASE-NOTES* *19/07/2010 14:59 6,836 RUNNING.txt* *18/08/2010 18:47DIR temp* *18/08/2010 18:46DIR webapps* *18/08/2010 18:46DIR work* * 4 File(s) 54,734 bytes* * 9 Dir(s) 33,834,348,544 bytes free* * * *C:\Program Files\apache-tomcat-6.0.29cd bin* * * *C:\Program Files\apache-tomcat-6.0.29\binstartup.bat* *The JAVA_HOME environment variable is not defined correctly* *This environment variable is needed to run this program* *NB: JAVA_HOME should point to a JDK not a JRE* *C:\Program Files\apache-tomcat-6.0.29\binecho %JAVA_HOME%* *C:\Program Files\Java\jdk1.6.0_17\bin* * * *C:\Program Files\apache-tomcat-6.0.29\bin* The JAVA_HOME environment variable is indeed not defined correctly. You've pointed it to the bin subdirectory of the JDK installation. If you're using the JDK, then you need to point it to the root of the install (C:\Program Files\Java\jdk1.6.0_17). Also, see below on using the JRE and JDK. From the RUNNING.TXT file: (1.3) Set an environment variable named JRE_HOME to the pathname of the directory into which you installed the JRE, e.g. c:\jre5.0 or /usr/local/java/jre5.0. So, in most Windows/XP cases point JRE_HOME to C:\Program Files\Java\jre6 (for Java 1.6). From the CATALINA.BAT file: rem JAVA_HOME Must point at your Java Development rem Kit installation. rem Required to run the with the debug rem argument. rem rem JRE_HOMEMust point at your Java Runtime rem installation. rem Defaults to JAVA_HOME if empty. In other words, unless you're doing development work or running Tomcat with the debug argument, you do not need to install the JDK. If you're going to do development, then I recommend using the latest JDK (1.6.0_21). And see the note on fixing the JAVA_HOME environment variable above . . . . . . just my two cents /mde/ - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Installation problem [newbie]
If you want to run PHP, then either use IIS (which is already installed and running), or shut down IIS and run Apache HTTPD (which is not Tomcat). Tomcat can (sort of) run PHP, but it's problematic. If you are writing and running PHP, use Apache HTTPD. Tomcat is not a prerequisite for running PHP. . . . . just my two cents. /mde/ - Original Message From: Jonathan Camilleri camilleri@gmail.com To: Tomcat Users List users@tomcat.apache.org Sent: Wed, August 18, 2010 1:36:04 PM Subject: Re: Installation problem [newbie] I want to run PHP basically, and, Apache Tomcat is a pre-requisite. On 18 August 2010 22:07, Caldarale, Charles R chuck.caldar...@unisys.comwrote: From: Jonathan Camilleri [mailto:camilleri@gmail.com] Subject: Re: Installation problem [newbie] Well, I've installed the webserver (1st file) Let's get back to the basic question Pid asked originally: What are you trying to accomplish? Nothing that you've said so far gives anyone any idea what your goals are here. Do you want to run servlets and JSPs? Do you want to run PHP? Do you want something else? - 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. -- Jonathan Camilleri Mobile (MT): 00356 7982 7113 E-mail: camilleri@gmail.com Please consider your environmental responsibility before printing this e-mail. I usually reply to e-mails within 2 business days. If it's urgent, give me a call. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: [OT] Sessions mix-up on Tomcat 6.0.26 on Linux
Client side validation is for convenience and user feedback. Server side validation is still required. Nothing requires a user to use a browser, or to not use extension like Fiddle or Tamper to play with the information once it's passed your validation scripts. . . . just my two cents. /mde/ - Original Message From: Yawar Saeed Khan/ITG/Karachi yawar.sa...@mcb.com.pk To: Tomcat Users List users@tomcat.apache.org Sent: Thu, August 19, 2010 12:27:08 PM Subject: RE: [OT] Sessions mix-up on Tomcat 6.0.26 on Linux thanks for your constructive comments, as I mentioned that bad, bad, bad code is out. no longer in the application... your comments on my current code tells me that this code is not bad, but I should check out tomcat's container managed logins... right? plus I would like to mention that I have client side form validations (js) to stop query busters. From: Christopher Schultz [mailto:ch...@christopherschultz.net] Sent: Thu 19-Aug-10 11:01 PM To: Tomcat Users List Subject: Re: [OT] Sessions mix-up on Tomcat 6.0.26 on Linux -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Yawar, I'm marking this as off-topic for /your/ request. I just have some comments for you. Take them or leave them. On 8/19/2010 11:53 AM, Yawar Saeed Khan/ITG/Karachi wrote: Ok, let me share my source code with you... my index.jsp page has a html form which submits the form data to a servlet called loginmanager. this is the code inside doPost function; try { userbean user = new userbean(); // usebean is a class the has setter and getter functions for user attributes user.setUserId(request.getParameter(txt_userid)); user.setPassword(request.getParameter(txt_pass)); user = udac.login(user); //udac is a class that has data access functions, login function takes user object and checks its existence in db and sets isValid attribute for that user Not using Tomcat's container-managed login? Any particular reason why not? It's quite easy to configure and has the added benefit of being properly tested. if (user.isValid()){ HttpSession session = request.getSession(true); session.setAttribute(user_id,user.getUserId()); session.setAttribute(user_name,user.getName()); session.setAttribute(role_id,user.getRole()); session.setAttribute(role_desc, user.getRoleDesc()); session.setAttribute(last_login, user.getLastLogin()); Why not session.setAttribute(user, user)? response.sendRedirect(main.jsp); //logged-in page That should be: response.sendRedirect(request.getContextPath() + response.encodeRedirectURL(/main.jsp)); }else{ response.sendRedirect(index.jsp?user=+user.isValid()); //revert back to login page That should be: response.sendRedirect(request.getContextPath() + response.encodeRedirectURL(/main.jsp) + ?user= + java.net.URLEncoder.encode(user.isValid())); It always helps to format and encode things properly. } } finally { out.close(); } What is out? Previously i had tried a simple way; my index.jsp file called itself on form submit, below code was in index.jsp (no servlet etc); //after form is submitted String query = SELECT a.USER_ID,a.NAME, a.BRANCH_CODE, a.PASSWORD, a.LAST_LOGIN_DATE, a.ROLE_ID, b.ROLE_DESC FROM LOGIN_INFORMATION a, ROLES b WHERE a.ACTIVE = 'A' AND a.ROLE_ID = b.ROLE_ID ; query = query + AND LOWER(a.USER_ID) = LOWER('+ request.getParameter(txt_userid) + ') AND a.PASSWORD = '+ epass +'; boolean hasdata=false; java.sql.ResultSet rs = connection.executeQuery(query); Wow: this is a SQL injection attack just waiting to happen. What happens if I submit the txt_userid request parameter as ') OR 1; or, even better, '); DELETE FROM LOGIN_INFORMATION; or some other evil thing? I believe that certain JDBC drivers will not execute more than one query per executeQuery() call, but you can't really count on that. It's easy to use a PreparedStatement and just do it properly: poof! SQL injection attacks are a thing of the past (unless the driver is broken, but they test those things very well). Also, most SQL databases perform case-insensitive string comparisons, so your LOWER(a.USER_ID) = LOWER(...) can probably be simplified. Note that it also means you likely have case-insensitive passwords (though you haven't shown us what epass is -- is could have been hashed. while(rs.next()) { hasdata=true; session.setAttribute(user_id,rs.getString(USER_ID)); session.setAttribute(user_name,rs.getString(NAME)); session.setAttribute(branch_code,rs.getString(BRANCH_CODE));
Re: Best practices for deployment on cluster environment
I haven't tried this in production (yet) so your mileage may vary. In the cluster setup, there's a FarmDeployer element that can be used to deploy across the cluster. The host that does the deploying: Deployer className=org.apache.catalina.ha.deploy.FarmWarDeployer tempDir=${catalina.base}/temp-dir/ deployDir=${catalina.base}/webapps/ watchDir=${catalina.base}/watch-dir/ processDeployFrequency=4 watchEnabled=true/ And the hosts that get the web application: Deployer className=org.apache.catalina.ha.deploy.FarmWarDeployer tempDir=${catalina.base}/temp-dir/ deployDir=${catalina.base}/webapps/ watchDir=${catalina.base}/watch-dir/ processDeployFrequency=4 watchEnabled=false/ For large web applications and frequent deployments, this might generate a lot of network traffic. Also, it's not intuitive (to me) how processDeployFrequency works, but I need to look at the code. In any case, you might have the Tomcat doing the deploying not actually serving content. I found out that you can use ${variable.name} in configuration files, so it's now much easier to clone installations and just edit setenv.sh(bat) as appropriate. Hope this helps. . . . just my two cents. /mde/ - Original Message From: Pid p...@pidster.com To: Tomcat Users List users@tomcat.apache.org Sent: Thu, August 26, 2010 7:36:15 AM Subject: Re: Best practices for deployment on cluster environment On 25/08/2010 14:50, Fernando Morgenstern wrote: Hi, I have a Tomcat cluster environment with 4 servers. I was wondering that is the best way to deploy an application on 4 servers at the same time. At a first moment, i thought about having a script that would copy war files to all servers using rsync. Basically i upload the war file to the first server and them use this script to copy to other tomcat servers. Could you share your experience with this kind of environment? Is this the best way to deal with deployment? Scripting your deployment process is a Good Idea. It will also mean that it happens the same every time, according to whatever your scripted procedure is. Upload them separately to each server, check integrity and then run a local script to finish the process and deploy them to appBase do server restarts if needed. If you're deploying to production servers with auto-deployment enabled, make sure the upload occurs to a separate temp location, before copying it into the appBase. You could SCP files up to a location on the server, using a user account configured with a password-free key pair. SSH will let you limit a given key to specific commands, so the account could be configured solely for uploading the files then running the local deployment script. p - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: 7.02 on Windows XP: An instance of Tomcat7 is already running
Sometimes when I boot into Windows/XP I don't get some icons in the system tray. I've not seen this happen with the Tomcat monitor, but I have seen this happen with the Apache httpd monitor. What I do is bring up the process list, search for the offending process (would be tomcat7w.exe for you), kill it, and launch it again. You might have the monitor set to launch at start up (minimized), and then it doesn't appear in your system tray. . . . just my two cents /mde/ - Original Message From: Len Popp len.p...@gmail.com To: Tomcat Users List users@tomcat.apache.org Sent: Tue, August 31, 2010 5:04:00 PM Subject: Re: 7.02 on Windows XP: An instance of Tomcat7 is already running On Tue, Aug 31, 2010 at 19:49, Steven Woody narkewo...@gmail.com wrote: If launch Configure Tomcat: An instance of Tomcat7 is already running; If launch Monitor Tomcat: An instance of Tomcat7w is already running. Despite the different wording, the meaning is the same: The Monitor/Configure app is already running. There should be a little Apache icon in the taskbar notification area. In the process list, I can see there are two processes: tomcat7 and tomcat7w. tomcat7.exe is Tomcat itself, running in a Windows service wrapper. tomcat7w.exe is the Monitor/Configure app. -- Len - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Apache AJP to 4 TCs
Weird. I just updated my environment (on Fedora 13) to support 4 Tomcats and it worked as expected. I verified this by running my test application, watching traffic via jk-manager, and then shutting down (disabling) one mod_jk connection at a time. Clustering worked, farm deployment worked, and the application (such as it is) worked. Here are the particulars: OS: Fedora 13 JRE:1.6.0_21 (32 bit) Apache: 2.2.16 (comes with OS - not the latest) Tomcat: 6.0.29 mod_jk: 1.2.30 (compiled locally) My workers.properties file (without all the comments) worker.list=jk-status,jk-manager,lb worker.jk-status.type=status worker.jk-status.read_only=true worker.jk-manager.type=status worker.template.type=ajp13 worker.template.host=192.168.0.254 worker.template.socket_connect_timeout=5000 worker.template.socket_keepalive=true worker.template.ping_mode=A worker.template.ping_timeout=1 worker.template.connection_pool_minsize=0 worker.template.connection_pool_timeout=600 worker.template.reply_timeout=30 worker.template.recovery_options=3 worker.deimos.reference=worker.template worker.deimos.port=8019 worker.mars.reference=worker.template worker.mars.port=8029 worker.phobos.reference=worker.template worker.phobos.port=8039 worker.xerxes.reference=worker.template worker.xerxes.port=8049 worker.lb.type=lb worker.lb.error_escalation_time=0 worker.lb.max_reply_timeouts=10 worker.lb.balance_workers=deimos,mars,phobos,xerxes My uriworkermap.properties file is next. The RPets application is a random pet generator I use for testing clustering. /examples=lb /examples/*=lb /docs=lb /docs/*=lb /RPets=lb /RPets/*=lb mod_jk is added as an included file to httpd.conf. Here is my configuration. LoadModule jk_module modules/mod_jk.so IfModule jk_module JkWorkersFile conf.d/workers.properties JkLogFile logs/mod_jk.log JkLogLevel info JkShmFile /var/run/httpd/mod_jk.shm JkOptions +RejectUnsafeURI JkWatchdogInterval 60 Location /jk-status JkMount jk-status Order deny,allow Deny from all Allow from 127.0.0.1 /Location Location /jk-manager JkMount jk-manager Order deny,allow Deny from all Allow from 127.0.0.1 /Location JkMountFile conf.d/uriworkermap.properties /IfModule Here is one (of four) server.xml files stripped of comments and some miscellaneous global resources. I apologize for any line wrapping. Some of the package names are quite long. ?xml version='1.0' encoding='utf-8'? Server port=8015 shutdown=SHUTDOWN Listener className=org.apache.catalina.core.AprLifecycleListener SSLEngine=on / Listener className=org.apache.catalina.core.JasperListener / Listener className=org.apache.catalina.core.JreMemoryLeakPreventionListener / Listener className=org.apache.catalina.mbeans.ServerLifecycleListener / Listener className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener / GlobalNamingResources Resource name=UserDatabase auth=Container type=org.apache.catalina.UserDatabase description=User database that can be updated and saved factory=org.apache.catalina.users.MemoryUserDatabaseFactory pathname=conf/tomcat-users.xml / /GlobalNamingResources Service name=Catalina Connector port=8090 protocol=HTTP/1.1 connectionTimeout=2 redirectPort=8453/ Connector port=8019 protocol=AJP/1.3 redirectPort=8453/ Engine name=Catalina defaultHost=localhost jvmRoute=deimos Realm className=org.apache.catalina.realm.UserDatabaseRealm resourceName=UserDatabase/ Host name=localhost appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false Cluster className=org.apache.catalina.ha.tcp.SimpleTcpCluster channelSendOptions=6 Manager className=org.apache.catalina.ha.session.DeltaManager expireSessionsOnShutdown=false notifyListenersOnReplication=true/ Channel className=org.apache.catalina.tribes.group.GroupChannel Membership className=org.apache.catalina.tribes.membership.McastService address=228.0.0.4 port=45564 frequency=500 dropTime=3000/ Receiver className=org.apache.catalina.tribes.transport.nio.NioReceiver address=auto port=4000 selectorTimeout=100 maxThreads=6/ Sender className=org.apache.catalina.tribes.transport.ReplicationTransmitter Transport className=org.apache.catalina.tribes.transport.nio.PooledParallelSender/ /Sender Interceptor className=org.apache.catalina.tribes.group.interceptors.TcpFailureDetector/ Interceptor
Re: Apache AJP to 4 TCs
Thanks, but credit where credit is due. The basis for my configuration was taken from the examples in the source code. There are a lot of notes in the original source code configurations. Even if you don't compile it yourself (I do, since I'm mostly on Linux), the files are worth the read. Download the connector source from http://tomcat.apache.org/download-connectors.cgi, unzip the file, and take a look in the tomcat-connectors-1.2.30-src/conf directory. There are a lot of nice explanations tucked into the example configuration files. . . . . just my two cents. /mde/ - Original Message From: Andrew Bruno andrew.br...@gmail.com To: Tomcat Users List users@tomcat.apache.org Sent: Mon, September 13, 2010 12:09:30 AM Subject: Re: Apache AJP to 4 TCs I did a fresh install, and it all worked. Steps documented @ http://bruniglobal.blogspot.com/2010/09/load-balancing-4-tomcats-with-apache-22.html I then went back to my old install, and noticed that I didnt specific ServerName domain:80 I did that and it all worked.. weird. Anyway, thank you all for your help on this, I really liked Mark's worker.template approach :) and Chris' questions info. If there is anything I can improve in the process, as documented, please let me know. Cheers Andrew - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: To JAAS or not to JAAS
As an alternative, maybe you could write an ant script that would add the libraries, read values from a properties file to write the jaas.config file, and populate the database? Copying files with ant is easy, and http://db.apache.org/ddlutils/ makes it pretty easy to dump and recreate databases. Editing jaas.conf with property substitution might be a bit tricky, but possible if your authorization / authentication requirements aren't too complex. The Jetspeed Maven plugin does some similar work as well, but I've found it to be a bit invasive at times. . . . . just some random thoughts. /mde/ From: Gabriele Bulfon gbul...@sonicle.com To: Tomcat Users List users@tomcat.apache.org Sent: Mon, September 13, 2010 2:55:09 AM Subject: To JAAS or not to JAAS Hello, I have a web application written with JAAS authentication, using my own login modules. This is fine as long as the deployment is made by a system administrator who knows how to configure jaas.config and to place needed jars in the tomcat lib directory, following my instructions. Also, JAAS mode requires the sysadmin to prepare the backend db himself with a sql file of mine, and configure the context.xml with db informations. Now, I would like the same web app to be deployable in 2 ways, both with JAAS and without JAAS, to simplify deployment by less experienced deployer who will just put the war file inside webapp and access the application. During the first access I would like the application to understand that is not working in JAAS mode, check for a properties file inside the webapp, that when not existsant will trigger an installation sequence via web (to configure db access and so on). This will create this properties file that will be the reference configuration, substituting the context.xml / jaas config. My simple idea would be to have this war without the context.xml definitions, then have an init parameter of the application in web.xml to define Use Jaas = Yes/No that will let the webapp understand and do what I described. My question is: do I have a cleaner way to do this? Maybe I have some way to understand that my webapp is under JAAS control or not during application startup? Thanks for any help, Gabriele. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: How to solve To prevent a memory leak
See the following Wiki article on how to use Hibernate and Tomcat's pooling. http://wiki.apache.org/tomcat/TomcatHibernate As another person said, make sure you have a recently updated MySQL driver. I believe anything = 5.1.11 solves a threading issue that was reported on their (MySQL's) bug tracking database. . . . just my two cents. /mde/ - Original Message From: Alex devns...@gmail.com To: users@tomcat.apache.org Sent: Thu, September 16, 2010 7:04:38 AM Subject: Re: How to solve To prevent a memory leak Thank for your response! The MySql driver is in $TOMCAT/webapps/xxx/lib. I using Hibernate as OMR Mapper with Spring 3.0, here my hibernateApllicationContext.xml (partial) bean id=datasource class=com.mchange.v2.c3p0.ComboPooledDataSource destroy-method=close property name=driverClass value=${db.driverclass} / property name=jdbcUrl value=${db.jdbcurl} / property name=user value=${db.user} / property name=password value=${db.password} / property name=acquireIncrement value=1 / property name=idleConnectionTestPeriod value=300 / property name=initialPoolSize value=0 / property name=minPoolSize value=3 / property name=maxPoolSize value=10 / property name=maxIdleTime value=600 / property name=maxStatements value=50 / property name=preferredTestQuery value=Select 1/ property name=maxConnectionAge value=3600/ property name=acquireRetryAttempts value=60/ property name=testConnectionOnCheckout value=true/ /bean How can I search the ServletContext for specific objects? Alex Am 2010-09-16 15:43, schrieb Ognjen Blagojevic: On 16.9.2010 15:32, Alex wrote: I run an web application which uses spring, hibernate, apache-cxf and the quartz scheduler which is referenced by spring. The webapp work as it should, but on shutdown or restart the apache tomcat server I always get following output. The webapp is not stopped and I have to kill the process manually. How can I solve this? Are you using connection pooling provided by tomcat? Did you put MySQL driver to $TOMCAT/lib or $TOMCAT/webapps/xxx/lib? Or both? If you are using connection pooling keep your driver just in $TOMCAT/lib folder. If threads schedulerFactoryBeanERV_Worker-x, are created by Quartz, find how can you stop them, and to that with ContextListener you will register in web.xml. Also, read http://wiki.apache.org/tomcat/OutOfMemory. Regards, Ognjen - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Compiling Tomcat 6.0.x trunk
I just compiled Tomcat 7 trunk on linux (Fedora 13, 1.6.0_21, 32-bit) with ant 1.7.1 with no problems. . . . just my two cents. /mde/ - Original Message From: Caldarale, Charles R chuck.caldar...@unisys.com I seem to recall that Tomcat 7 now requires ant 1.8; I wonder if the 6.0 trunk does also? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Issues with Memory Leaks on Tomcat 6.0.28
I'll do some of this inline: WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'debug' to '0' did not find a matching property. Two things here: 1. Place your context in a META-INF/context.xml file in your web application, not in server.xml 2. Remove the debug attribute, since it hasn't been valid for a long time. WARNING: No rules found matching 'Server/Service/Engine/Host/Context/Logger'. I don't see a reference to a Logger in the Context documentation for 5.5, 6.0, 0r 7.0. If you're trying to log at the Context level, take a look at the documents for your version of Tomcat (which you've not mentioned) and add the appropriate Valve element. SEVERE: Error listenerStart This is the problem (as pointed out before). The code you're using in your Listener isn't working as expected. I suspect that you're trying to start up iBatis (now MyBatis), and that the code is failing. SEVERE: The web application [/Simon] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.threadlo...@3e0d1329]) and a value of type [com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl] (value [com.ibatis.sqlmap.engine.impl.sqlmapsessioni...@4c650892]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak. SEVERE: The web application [/Simon_WEB.war] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.threadlo...@23b17d49]) and a value of type [com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl] (value [com.ibatis.sqlmap.engine.impl.sqlmapsessioni...@599855ed]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak. This is fallout from your failed listener (as has been pointed out). When you write a listener class, you have both a contextInitialized(ServletContextEvent sce) and a contextDestroyed(ServletContextEvent sce) method. It looks like your contextInitialized method is failing, and you've not written a contextDestroyed method. You'll need to fix the first, and then write the second so that when the context is destroyed (like undeploying the application), you shut down all of your resources gracefully. I've not used iBatis, so I am not aware of how the listener should be written. I've done this for Hibernate. I'm also guessing that you're setting up iBatis to control the database pooling and access. You can let Tomcat manage the connection pool with iBatis. This may simplify your listener code somewhat. An iBatis thread concerning that can be found here: http://markmail.org/message/pocthjsiw4cdhohj#query:+page:1+mid:pocthjsiw4cdhohj+state:results So: 1. Fix your contextInitialized method 2. Write a contextDestroyed method 3. Configure iBatis to use Tomcat's database pooling (which may eliminate the need for 2) . . . . just my two cents. /mde/ - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat Consultant
Yep, PL/I was a great language. My first stunt was opening up partitioned dataset and treating it as sequential to play with the header. Yes, I had backups. I worked for a consulting organization for a while. I was at that time a network person, but the first thing they did was put me in as site lead for a 200+ node HP-UX site. I had touched HP-UX twice, being mostly a SunOS and DEC Ultrix (Berkeley UNIX) person. No crash course offered, just threw me into the pool and see if I could take a broken site / team and fix it. Fun times . . . /mde/ - Original Message From: michel compu...@videotron.ca To: Tomcat Users List users@tomcat.apache.org Sent: Fri, September 24, 2010 7:21:58 PM Subject: Re: Tomcat Consultant Just to mess with you, it's really PL/I ... It was a fantastic, leading edge language that should have had a much better future than it really did. - Original Message - From: Donald Winston satchwins...@yahoo.com To: Tomcat Users List users@tomcat.apache.org Sent: Friday, September 24, 2010 9:53 PM Subject: Re: Tomcat Consultant I was a PL-I expert. That's why I know it's spelled PL-I (roman numerals not arabic. I always thought this was funny) On Sep 24, 2010, at 9:49 PM, michel wrote: Don't know about you, but I was left really, really worried about actually being on a project under those conditions. Lots of room for doing a crash-and-burn ... Back when I started in the business in 1982 I had to learn PL-1, the best darned language that never managed to get a good market share. It was said that it took four years to really learn how to use it. These days all you need is a crash course to be an expert! - Original Message - From: Brian bbprefix-m...@yahoo.com To: 'Tomcat Users List' users@tomcat.apache.org Sent: Friday, September 24, 2010 9:42 PM Subject: RE: Tomcat Consultant That is true sometimes. I was hired by Arthur Andersen (RIP), they sent me to an SAP crash-course, the tipe of course that shows you zillions of Powerpoint slides and you get out of the course with tons of doubts. Then they sent me directly to a proyect, and I bet they billed a lot for my time. I was introduced as an experienced SAP consultant. -Original Message- From: michel [mailto:compu...@videotron.ca] Sent: Friday, September 24, 2010 07:35 PM To: Tomcat Users List Subject: Re: Tomcat Consultant I once worked for a consulting company that wasn't a big 5, but had some pretty good contact. They hired me out of Montreal on Friday, had me in Denver on Sunday and spending 2 weeks in a training center so I could become an instant 'expert' they could hire out for big $$$ on different projects. Then I spent 3 months at home while they tried to get some contacts, and then got canned when they couldn't, then the guys who hired me got canned ... I can't figure out how these companies can get away with this nonsense. - Original Message - From: Martin Gainty mgai...@hotmail.com To: Tomcat Users List users@tomcat.apache.org Sent: Friday, September 24, 2010 8:13 PM Subject: RE: Tomcat Consultant triple your budget when the big 5 consultant steps out a lamberghini in a 1000 brooks brothers suit add 25% to the rate if he looks younger than zuckerberg BTW: big 5 consultants only speak english or hindi..you'll need a hindi translator for spanish how about unisys??? Saludos Cordiales desde EEUU Martin Gainty __ No altere ni interrumpa por favor esta transmisión. Gracias Date: Fri, 24 Sep 2010 15:55:28 -0400 Subject: Re: Tomcat Consultant From: cerebrotecnolog...@gmail.com To: users@tomcat.apache.org I should have copyrights on my name. LOL On Fri, Sep 24, 2010 at 3:49 PM, Brian bbprefix-m...@yahoo.com wrote: -Original Message- From: Jorge Medina [mailto:cerebrotecnolog...@gmail.com] Sent: Friday, September 24, 2010 02:43 PM To: Tomcat Users List Subject: Re: Tomcat Consultant Hey, you don't need a Big-5 consulting company. Esto si que sonó gracioso. Aca en Peru, Arthur Andersen (QEPD) tenia a unos 3 socios, uno de los cuales se llamaba JORGE MEDINA. :-D You need a a couple of experts: a networking guy and a Tomcat guy. But anyway, I'm sure a Fortune 500 have the money to overpay one of the Big-5. Now, from my understanding, Tomcat is only a web app container while Websphere is an application server. Therefore, depending on your application you may not be able to migrate it to Tomcat, but rather to Glassfish. Glassfish is also an application server. -Jorge On Fri, Sep 24, 2010 at 1:57 PM, Christopher Schultz ch...@christopherschultz.net wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 To whom it may concern, On 9/24/2010 1:25 PM, tdelesio wrote: My fortune 500 company is testing a
Re: deploy a war file
You can, although you'll have to reconfigure Tomcat in order to do this. However, it sounds like you want to place your war file where Apache httpd can see it (after enabling the mod_userdir and configuring it). If you do this and serve that directory with Apache httpd, some very unpleasant things will happen. kc8pdr/WEB-INF, and kc8pdr/META-INF will be visible. If you are using a Resource element in context.xml (stored in kc8pdr/META-INF), any information (like user names and passwords) will be visible to the world. Although you can prevent this by doing some more configuration work in Apache httpd, this requires extra steps. JSP pages will come across as text and code, not HTML. Servlets will come across as binary files, which users will be asked to download. Apache httpd does not run JSP, servlets, or any other Java-based technology. If you want to serve Tomcat applications via Apache httpd, you'll have to connect the two with mod_proxy_http, mod_proxy_ajp, or mod_ajp. To get an understanding on how to use mod_ajp, go here: http://tomcat.apache.org/connectors-doc/ Doing this passes requests for your Java web application from Apache httpd to Tomcat. Tomcat is doing all the work, and depending on your requirements (not stated), Apache httpd will e contributing little more than complexity. If you are only serving Java web applications, then you might just be better off not running Apache httpd and switching Tomcat to port 80. Front Tomcat with Apache httpd when you're running additional applications (such as PHP, Python, or Perl), or have Apache httpd plugins that don't have counterparts in Tomcat. . . . . just my two cents. /mde/ - Original Message From: William Biggs kc8...@gmail.com To: users@tomcat.apache.org Sent: Sat, October 2, 2010 7:57:30 PM Subject: deploy a war file if I name a war file called kc8pdr.war and after I upload it to my tomcat and restart it it put it a folder called kc8pdr . How do I get it to do it in the public_html folder instead - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Configuring which Servlet is invoked
Chris, I'm going to leap into the middle of this discussion. Please feel free to discount what I'm going to say since I've just briefly glanced at the Roller 5.0 RC2 documentation. From what I understand, the intent is to have one Roller application running as the default web application (ROOT) on a Tomcat server, and have it be the default application for multiple blogger domains. From the Wiki page, Roller will handle multiple domains with one application by referring to a properties file, such as: # roller-custom.properties weblog.absoluteurl.photophys=http://photophys.com weblog.absoluteurl.alex=http://greenimp.me weblog.absoluteurl.linus=http://linusjohnson.com I'm guessing that somewhere in the Roller application these absolute URLs are mapped to internal URLs. Maybe this works like an internal mod_rewrite? I don't know, since I haven't looked at the code. Let's assume for a minute that Roller acts as if it has its own URL rewrite engine. If that's the case, then all Tomcat has to do is deliver the multiple URLs to the same application. In other words, photophys.com, greenimp.me, and linusjohnson.com should all be delivered to the ROOT web application of the default host, and Roller will figure out what to do from there. If that's the case, then what I think you need are aliases along with the default host definition. So using the above example, the following Host element can be constructed: Host name=localhost appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false Aliasphotophys.com/Alias Aliasgreenimp.me/Alias Aliaslinusjohnson.com/Alias /Host You'll have to set up all aliases to resolve to the same IP address that is your host. For testing, this can be done in the hosts file. In Linux it's /etc/hosts as long as your nsswitch.conf includes files for host resolution. In Windows/XP (don't know about other versions), it's in Windows\system32\drivers\etc. Hopefully Roller will do the correct thing internally. Fronting this with Apache httpd should not be too difficult if the above works. Basically, you'll use name-based virtual hosts with mod_jk (or mod_proxy_ajp) to map / and /* back to the same Tomcat server. Again, hopefully Roller will figure things out with the Alias elements. If I'm completely off base, please forgive the rambling. Again, I've not played with Roller (and this appears to be a release candidate), not looked at the source code, nor done more than skim one web page and the PDF docs. . . . just my two cents. /mde/ - Original Message From: Christopher Dodunski chrisfromsquir...@christopher.net.nz To: users@tomcat.apache.org Sent: Mon, October 11, 2010 9:20:48 PM Subject: Re: Configuring which Servlet is invoked Catalina logs contain some entries that may shine some light on the matter... SEVERE: Error starting static Resources java.lang.IllegalArgumentException: Document base /home/roller/application/optomus does not exist or is not a readable directory INFO: Container org.apache.catalina.core.ContainerBase.[Catalina].[blog.optomus.com].[/optomus] has not been started SEVERE: Error starting static Resources java.lang.IllegalArgumentException: Document base /home/roller/application/christopher does not exist or is not a readable directory INFO: Container org.apache.catalina.core.ContainerBase.[Catalina].[blog.optomus.com].[/christopher] has not been started SEVERE: Error starting static Resources java.lang.IllegalArgumentException: Document base /home/roller/application/host-manager does not exist or is not a readable directory INFO: Container org.apache.catalina.core.ContainerBase.[Catalina].[blog.optomus.com].[/host-manager] has not been started SEVERE: Error starting static Resources java.lang.IllegalArgumentException: Document base /home/roller/application/manager does not exist or is not a readable directory INFO: Container org.apache.catalina.core.ContainerBase.[Catalina].[blog.optomus.com].[/manager] has not been started Is it a Tomcat requirement that additional hosts (appBase) must each contain manager and host-manager? This appBase currently contains ROOT (Roller) only. The first two errors above make no sense to me. Chris. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Configuring which Servlet is invoked
Yep, you're right on the Alias of course. This is what happens when I try to follow a thread at 3 am. Yes, for testing only. Obviously host files will have no impact for other hosts. Sorry for the comments. /mde/ - Original Message From: Caldarale, Charles R chuck.caldar...@unisys.com To: Tomcat Users List users@tomcat.apache.org Sent: Tue, October 12, 2010 7:43:35 AM Subject: RE: Configuring which Servlet is invoked From: Mark Eggers [mailto:its_toas...@yahoo.com] Subject: Re: Configuring which Servlet is invoked If that's the case, then what I think you need are aliases along with the default host definition. Alias elements are *never* needed with the defaultHost; adding them may serve a documentation purpose, but not a functional one. Remember, all requests for domains that do not match a Host or Alias name are delivered to the defaultHost, so specifying any Alias elements for that one is a waste of time (and memory). You'll have to set up all aliases to resolve to the same IP address that is your host. Not quite accurate; by default, Tomcat listens on all IP addresses assigned to the box, so the domains can resolve to *any* IP address assigned to the server. For testing, this can be done in the hosts file. Only if the client is running on the same system as Tomcat. - 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 unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat memory leak error launching web app in NetBeans 6.9.1
I saw a mention of this on the Quartz forums. People there seem to think it's a race condition between Quartz's scheduler shutdown and Tomcat's thread memory leak reporting. I wrote a quick Quartz scheduler (1.8.3) application. It does the following: 1. Uses the supplied listener to put a scheduler factory in the servlet context (org.quartz.ee.servlet.QuartzInitializerListener) 2. Uses another listener to add a job that writes to a log file every 5 minutes 3. Uses the provided listener (org.quartz.ee.servlet.QuartzInitializerListener) to shut down all schedulers The supplied listener is configured via parameters to start the scheduler on startup, and shut down the scheduler on application termination. When I watch this using visualvm (1.3.1) on Tomcat 6.0.18 and 6.0.29, I see the four threads that are started by Quartz vanish when the application is undeployed. Tomcat reports the SEVERE error for some of these threads in catalina.out. I ran the test twice and I think that Tomcat reported different threads on each run (didn't save the log files). I also didn't look for any stray classes left after the application was undeployed. The supplied listener can be configured to not start or shut down the scheduler. Starting and shutting down the scheduler can then be managed by the second listener (that adds the job). I've not tried this yet. Finally, there are two ways to shut down the scheduler. The default (graceful) way waits for any pending jobs to complete. Calling shutdown(false) immediately terminates the scheduler. This doesn't seem to be configurable using the supplied listener, so the scheduler would have to be managed by the second listener. Environment: OS: Fedora 13 2.6.34.7-56.fc13.i686 Java:Oracle/Sun Java JRE/JDK 1.6.0_22 IDE: NetBeans 6.9.1 / Maven 2.2.1 Tomcat: 6.0.29 6.0.18 Quartz: 1.8.3 Monitor: VisualVM 1.3.1 (https://visualvm.dev.java.net/) If I have some time today, I'll try some variations. . . . . just my two cents. /mde/ - Original Message From: Martin O'Shea app...@dsl.pipex.com To: Tomcat Users List users@tomcat.apache.org Sent: Mon, October 18, 2010 5:52:08 AM Subject: RE: Tomcat memory leak error launching web app in NetBeans 6.9.1 You're probably correct and assuming this is to do with Quartz which it seems to be, are you aware of any similar cases or remedies? -Original Message- From: Christopher Schultz [mailto:ch...@christopherschultz.net] Sent: 18 Oct 2010 13 49 To: Tomcat Users List Subject: Re: Tomcat memory leak error launching web app in NetBeans 6.9.1 -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Martin, On 10/16/2010 11:11 AM, Martin O'Shea wrote: Definitely seems to be when the web application in question is terminated, rather than Tomcat itself. And all indications are the listener that handles the scheduler. And I've tried another similar application which gives messages of the same kind. And yet both apps have worked under other environments. Note that the leak detection has been added and improved in recent Tomcat versions. It's possible that this problem has always been there, you're just never been notified about it. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAky8QkkACgkQ9CaO5/Lv0PAwNACfVwsejeJhSe3CajEWqQraiXTf amwAoI8Kl+4V07E7Tv4Axn8ASiJRq8Pm =9dxR -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat memory leak error launching web app in NetBeans 6.9.1
That's what I've read and from the code it's the default. I'm hacking together a listener that rolls the entire chain from scratch rather than depending on the Quartz-supplied listener. I'll add some debugging logging and see what happens. I might also try just creating the SchedulerFactory first, then getting a scheduler, then starting the scheduler, and finally adding a job. - Original Message From: Pid p...@pidster.com To: Tomcat Users List users@tomcat.apache.org Sent: Mon, October 18, 2010 3:15:28 PM Subject: Re: Tomcat memory leak error launching web app in NetBeans 6.9.1 On 18/10/2010 23:02, Mark Thomas wrote: On 18/10/2010 16:56, Mark Thomas wrote: On 18/10/2010 12:05, Mark Eggers wrote: I saw a mention of this on the Quartz forums. People there seem to think it's a race condition between Quartz's scheduler shutdown and Tomcat's thread memory leak reporting. That is certainly possible. There was a reason I wrote the message This is very likely to create a memory leak. rather than There is a memory leak. Options to consider: - is there a way to perform a synchronous shutdown of the scheduler? - can you detect if the scheduler has not shutdown an loop (for a limited time) waiting for it to finish? Something that occurred to me just after I hit send. These threads really need to finish up *before* Tomcat shuts down the context. Tomcat does a bunch of clean-up stuff to prevent memory leaks and if application code is still running when the clean-up code runs the clean-up could easily fail. Calling scheduler.shutdown(true); /should/ cause it to block wait for existing jobs to finish. The Quartz supplied Listener does appear to do this: http://svn.terracotta.org/fisheye/browse/Quartz/trunk/quartz/src/main/java/org/quartz/ee/servlet/QuartzInitializerListener.java?r=HEAD p - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat memory leak error launching web app in NetBeans 6.9.1
Once again, I apologize for the wall of text. However, most of it is pretty quick and dirty code, so it should be easy to skim. I'm guessing the end result is harmless? It does seem like a race condition. Everything seems to work fine until shutdown. When DEBUG is set in logging, you get the following in catalina.out: Oct 18, 2010 4:12:38 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [/QSchedule] appears to have started a thread named [SampleScheduler_Worker-1] but has failed to stop it. This is very likely to create a memory leak. Oct 18, 2010 4:12:38 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [/QSchedule] appears to have started a thread named [SampleScheduler_Worker-2] but has failed to stop it. This is very likely to create a memory leak. Oct 18, 2010 4:12:38 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [/QSchedule] appears to have started a thread named [SampleScheduler_Worker-3] but has failed to stop it. This is very likely to create a memory leak. Oct 18, 2010 4:12:38 PM org.apache.catalina.loader.WebappClassLoader loadClass INFO: Illegal access: this web application instance has been stopped already. Could not load java.io.PrintStream. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact. java.lang.IllegalStateException at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1531) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491) at org.apache.log4j.helpers.LogLog.error(LogLog.java:142) at org.apache.log4j.helpers.PatternParser$DatePatternConverter.convert(PatternParser.java:447) at org.apache.log4j.helpers.PatternConverter.format(PatternConverter.java:64) at org.apache.log4j.PatternLayout.format(PatternLayout.java:503) at org.apache.log4j.WriterAppender.subAppend(WriterAppender.java:301) at org.apache.log4j.WriterAppender.append(WriterAppender.java:159) at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:230) at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:65) at org.apache.log4j.Category.callAppenders(Category.java:203) at org.apache.log4j.Category.forcedLog(Category.java:388) at org.apache.log4j.Category.log(Category.java:853) at org.slf4j.impl.Log4jLoggerAdapter.debug(Log4jLoggerAdapter.java:204) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:595) log4j:ERROR Error occured while converting date. java.lang.NullPointerException at java.lang.AbstractStringBuilder.append(Unknown Source) at java.lang.StringBuffer.append(Unknown Source) at org.apache.log4j.helpers.ISO8601DateFormat.format(ISO8601DateFormat.java:132) at java.text.DateFormat.format(Unknown Source) at org.apache.log4j.helpers.PatternParser$DatePatternConverter.convert(PatternParser.java:444) at org.apache.log4j.helpers.PatternConverter.format(PatternConverter.java:64) at org.apache.log4j.PatternLayout.format(PatternLayout.java:503) at org.apache.log4j.WriterAppender.subAppend(WriterAppender.java:301) at org.apache.log4j.WriterAppender.append(WriterAppender.java:159) at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:230) at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:65) at org.apache.log4j.Category.callAppenders(Category.java:203) at org.apache.log4j.Category.forcedLog(Category.java:388) at org.apache.log4j.Category.log(Category.java:853) at org.slf4j.impl.Log4jLoggerAdapter.debug(Log4jLoggerAdapter.java:204) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:595) log4j:ERROR Error occured while converting date. java.lang.NullPointerException at java.lang.AbstractStringBuilder.append(Unknown Source) at java.lang.StringBuffer.append(Unknown Source) at org.apache.log4j.helpers.ISO8601DateFormat.format(ISO8601DateFormat.java:132) at java.text.DateFormat.format(Unknown Source) at org.apache.log4j.helpers.PatternParser$DatePatternConverter.convert(PatternParser.java:444) at org.apache.log4j.helpers.PatternConverter.format(PatternConverter.java:64) at org.apache.log4j.PatternLayout.format(PatternLayout.java:503) at org.apache.log4j.WriterAppender.subAppend(WriterAppender.java:301) at org.apache.log4j.WriterAppender.append(WriterAppender.java:159) at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:230) at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:65) at org.apache.log4j.Category.callAppenders(Category.java:203) at org.apache.log4j.Category.forcedLog(Category.java:388) at org.apache.log4j.Category.log(Category.java:853) at org.slf4j.impl.Log4jLoggerAdapter.debug(Log4jLoggerAdapter.java:204)
Re: Is there a GOOD AJP-based cluster reference?
At the risk of violating your request (not to point you to the documentation), I'm going to point you at the documentation. In particular: manual/mod/mod_proxy.html#proxypassreverse (from the Apache httpd docs) This will rewrite response URLs. However, there is a caveat. It will not rewrite any absolute URLs within the documents served. So if you have /context/somewhere/someplace inside a particular page, this link will be returned intact and the user will not be able to reach it. Again according to the document, you'll need to look at Nick Kew's mod_proxy_html (http://apache.webthing.com/mod_proxy_html/). There appears to be a tutorial on reverse proxying at that location as well. You may find it far easier to just rename the war file to ROOT.war and be done with it. . . . . just my two cents /mde/ - Original Message From: Jeffrey Janner jeffrey.jan...@polydyne.com To: Tomcat Users List users@tomcat.apache.org Sent: Thu, November 4, 2010 6:56:20 AM Subject: Is there a GOOD AJP-based cluster reference? I've googled and not found anything very helpful, particularly nothing recent. I am trying to set up AJP load balancing using Apache 2.2.17 to Tomcat 6.0.29. I'd like to route root to the Tomcat named context (not root). From the docs I've read so far, I should be able to, but all the references in the returned html have the context name stuck at the beginning of the path, and I can't seem to get it to go away. I know I can just rename the context as ROOT, but I thought I'd try deploying it the way the dev team gives it to me. I've tried: ProxyPass / balancer://mycluster/context Proxy balancer=//mycluster BalancerMember ajp://hostname:8009 /Proxy and ProxyPass / balancer://mycluster Proxy balancer=//mycluster BalancerMember ajp://hostname:8009/context /Proxy Nothing seems to be working. Obviously, I'm not clear on some concept. Any help would be appreciated. Jeff p.s. Don't send me to the Tomcat Apache docs, I've read them. = Jeffrey W. Jannere-mail: jeffrey.jan...@polydyne.com mailto:jeffrey.jan...@polydyne.com PolyDyne Software Inc. web: http://www.polydyne.com/ http://www.polydyne.com/ 9390 Research Blvd. phone: (512) 343-9100 x8930 Building 1, Suite 400 fax: (512) 343-9297 Austin, TX 78759 = __ Confidentiality Notice: This Transmission (including any attachments) may contain information that is privileged, confidential, and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this transmission in error, please immediately reply to the sender or telephone (512) 343-9100 and delete this transmission from your system. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Secondary instance of Tomcat on single server does not process requests
From the RUNNING.txt you will need tomcat-juli.jar in $CATALINA_BASE/bin. That being said, I start up and shut down 4 Tomcat instances when I'm working on cluster issues. Here's a typical directory structure I use for each Tomcat that's a part of the cluster: deimos-host/ ├── bin │ ├── setenv.sh │ ├── shutdown.sh │ ├── startup.sh │ └── tomcat-juli.jar ├── conf │ ├── Catalina │ │ └── localhost │ │ ├── host-manager.xml │ │ ├── manager.xml │ ├── catalina.policy │ ├── catalina.properties │ ├── context.xml │ ├── logging.properties │ ├── server.xml │ ├── tomcat-users.xml │ └── web.xml ├── lib ├── logs ├── temp ├── temp-dir ├── watch-dir ├── webapps │ ├── docs │ ├── manager │ ├── ROOT └── work I've left out the actual web applications and permissions. Here's my startup.sh script for the above host. #!/bin/bash export CATALINA_BASE=/someplace/deimos-host export CATALINA_HOME=/reference-place/apache-tomcat-6.0.29 $CATALINA_HOME/bin/startup.sh The shutdown.sh script is similar. I have a bunch of environment variables in setenv.sh. They reference where log4j logs should go and enables JMX. Those aren't really important. Finally, I start the entire cluster with the following script. #!/bin/bash ( phobos-host/bin/startup.sh ) sleep 5 ( deimos-host/bin/startup.sh ) sleep 5 ( mars-host/bin/startup.sh ) sleep 5 ( xerxes-host/bin/startup.sh ) The cluster shutdown script is similar. There are a few things to note in the above script. The parentheses are necessary around each startup script. If you take a look at the stock startup.sh script in $CATALINA_HOME/bin, you'll find that the last line is: exec $PRGDIR/$EXECUTABLE start $@ exec replaces the current shell. So if you write a script that tries to start multiple Tomcats, the first time you run the stock startup.sh script, your shell gets replaced. I have sleep statements in my script since this is for a cluster and I don't define a port in the Receiver element of the cluster. This allows Tomcat to find open ports for cluster communication. . . . . just my two cents /mde/ - Original Message From: Ari King ari.brandeis.k...@gmail.com To: Tomcat Users List users@tomcat.apache.org Sent: Thu, November 4, 2010 11:21:58 AM Subject: Re: Secondary instance of Tomcat on single server does not process requests On Thu, Nov 4, 2010 at 1:09 PM, Konstantin Kolinko knst.koli...@gmail.comwrote: 2010/11/4 Ari King ari.brandeis.k...@gmail.com: |-- conf |-- server.xml |-- web.xml Those two files are not sufficient. Note, that the conf folder is read only from the second instance. (The files in CATALINA_HOME\conf are never read). Which other files are needed? I tried copying all the files from the conf directory of the base configuration, but that didn't resolve the issue either. Also, I have changed the shutdown port from 8005 to 8006. Any other ideas/suggestions? Thanks. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Is there a GOOD AJP-based cluster reference?
Interesting. I'll have to try something similar for my situation. What I'm trying to do is a bit of the reverse. I want hostname:80/tomcat-host/manager to end up at (tomcat-host) /manager for four different tomcat hosts. The forward stuff works fine, but the URLs coming back all drop the tomcat-host part. I guess reading some more documentation is in order. Glad you got it working without the reversproxy stuff. /mde/ - Original Message From: Jeffrey Janner jeffrey.jan...@polydyne.com To: Tomcat Users List users@tomcat.apache.org Sent: Thu, November 4, 2010 1:12:07 PM Subject: RE: Is there a GOOD AJP-based cluster reference? In looking at the JSPs, the dev team is coding all the paths inside a c:url construct, which is why the context string is getting prepended to every path in the document. What was throwing me off a bit was the default doc was just a redirect as: -- %...@page contentType=text/html pageEncoding=UTF-8% % response.sendRedirect(login); % -- The browser would show this as http://hostname/context/login. My interpretation of the docs had me thinking that the context would get stripped as well, but it wasn't. Thus the confusion. I have managed to get it working with the following: Proxy balancer://mycluster BalancerMember ajp://prtltest01:8009/Portal route=tomcat1 loadfactor=50 BalancerMember ajp://prtltest02:8009/Portal route=tomcat2 loadfactor=50 /Proxy ProxyPass /Portal/static ! ProxyPass /Portal balancer://mycluster stickysession=JSESSIONID|jsessionid scolonpathdelim=On ProxyPass / balancer://mycluster/ stickysession=JSESSIONID|jsessionid scolonpathdelim=On Notice I don't have any ProxyPassReverse lines. From reading the docs, I'm not sure they are needed for AJP proxying. I'm trying to keep the Tomcat side of things fairly simple -- pretty much deploy the war direct from dev -- to keep there from being too many steps that could get screwed up when I'm not around and someone else needs to deploy. The process will be documented, but some people refuse to read directions correctly. Plus, the apache server will someday host multiple apps under one host, so having it work with the context as non-root now means less work later. Then again, I bf'ed and didn't put the static stuff in the proper tree structure under the htdocs dir. I just put them there as I got them. (There is no static directory on the Tomcat side, it's virtual. The dev team is doing weird stuff with this new product.) Let me know if you see any problems with the above config. Jeff -Original Message- From: Mark Eggers [mailto:its_toas...@yahoo.com] Sent: Thursday, November 04, 2010 11:56 AM To: Tomcat Users List Subject: Re: Is there a GOOD AJP-based cluster reference? At the risk of violating your request (not to point you to the documentation), I'm going to point you at the documentation. In particular: manual/mod/mod_proxy.html#proxypassreverse (from the Apache httpd docs) This will rewrite response URLs. However, there is a caveat. It will not rewrite any absolute URLs within the documents served. So if you have /context/somewhere/someplace inside a particular page, this link will be returned intact and the user will not be able to reach it. Again according to the document, you'll need to look at Nick Kew's mod_proxy_html (http://apache.webthing.com/mod_proxy_html/). There appears to be a tutorial on reverse proxying at that location as well. You may find it far easier to just rename the war file to ROOT.war and be done with it. . . . . just my two cents /mde/ - Original Message From: Jeffrey Janner jeffrey.jan...@polydyne.com To: Tomcat Users List users@tomcat.apache.org Sent: Thu, November 4, 2010 6:56:20 AM Subject: Is there a GOOD AJP-based cluster reference? I've googled and not found anything very helpful, particularly nothing recent. I am trying to set up AJP load balancing using Apache 2.2.17 to Tomcat 6.0.29. I'd like to route root to the Tomcat named context (not root). From the docs I've read so far, I should be able to, but all the references in the returned html have the context name stuck at the beginning of the path, and I can't seem to get it to go away. I know I can just rename the context as ROOT, but I thought I'd try deploying it the way the dev team gives it to me. I've tried: ProxyPass / balancer://mycluster/context Proxy balancer=//mycluster BalancerMember ajp://hostname:8009 /Proxy and ProxyPass / balancer://mycluster Proxy balancer=//mycluster BalancerMember ajp://hostname:8009/context /Proxy Nothing seems to be working. Obviously, I'm not clear on some concept. Any help would be appreciated. Jeff p.s. Don't send me to the Tomcat Apache docs, I've read them
Re: how to setup HOME_PATH for Java and CATALINA_HOME
From this and other messages, it looks like you're running everything installed from the Fedora distribution. While I run Fedora (just upgraded to Fedora 14), I don't use any of the distribution-supplied packages for Java, Tomcat, or the IDE (my preference being NetBeans). To get the Oracle / Sun Java installed, just download the appropriate files from Oracle. If you use the RPM packages, you can then use the alternatives program to switch between the various implementations. A detailed discussion on Fedora's Java implementation can be found here: http://fedoraproject.org/wiki/Java Then you will need to either inject Oracle's Java into the path before the Fedora-supplied Java or use the alternatives program to configure and switch between Java packages. The latter is more in line with the OS, while the former is what I currently do. Here's one link on how to use the alternatives program: http://www.if-not-true-then-false.com/2010/install-sun-oracle-java-jdk-jre-6-on-fedora-centos-red-hat-rhel/ I took a brief look at the Fedora-supplied Tomcat. As with many other distributions, the software is split across multiple packages, and contains extraneous material. If you're doing development, it's far easier to download a copy of Tomcat from tomcat.apache.org, unpack it somewhere handy, and then run it. I maintain multiple copies of Tomcat in ~/Apache along with various modifications to run Solr, Jetspeed, OpenPortal, Pluto, some virtual hosts, and some clusters. No, I don't run all of these at once. Your other problem is when you start using log4j in your application and want to build the war file. Normally when you add a server to NetBeans or (I presume) Eclipse, the IDE will use the server-supplied jar files to resolve references. The IDE will base which jars to pull from the server based on the type of server you've defined for a particular project. The problem is that Tomcat (as others have pointed out) does not come with log4j by default. If Eclipse is using the default definition of Tomcat, then a log4j jar file will not be included in the build path since the default installation does not have it. If you are set on running your application with Fedora's Tomcat distribution, then you will have to include log4j in your Eclipse project, but have it not added to the war file. If you are using a stock version of Tomcat, then you will have to add log4j to your project for both compilation and creation of the war. Since I don't normally use Eclipse, I have no real idea how to do this. My personal preferences are: 1. Install Java JRE/SDK/Docs from Oracle Either alter the path or use alternatives to manage multiple Java versions 2. Install Tomcat from ASF into my home directory for development 3. Install IDE of choice from that vendor. This makes getting help from the various mailing lists (Java, IDE, Tomcat) much easier. The only downside is that you will have to manage updates for these components manually. However, at least Java can be managed via yum (just download the RPM packages from Oracle). . . . . just my two cents /mde/ - Original Message From: Salam Y. ELIAS salamli...@free.fr To: users@tomcat.apache.org Sent: Thu, November 18, 2010 1:46:54 AM Subject: how to setup HOME_PATH for Java and CATALINA_HOME I need to set up the environment variable JAVA_HOME and and CATALINA_HOME to start some web and Java EE, am little bit confused with conflicting information. When I run java -version ie get java version 1.6.0_18 OpenJDK Runtime Environment (IcedTea6 1.8.2) (fedora-43.1.8.2.fc13-x86_64) OpenJDK 64-Bit Server VM (build 14.0-b16, mixed mode) When I run which java I get /usr/bin/java[/QUOTE] checking my usr/share I see several directories java (full of files and directories) java-1.3.0 (1 jar in it) java-1.3.1 (empty) java-1.4.0 (empty) java-1.5.0 (empty) java-1.6.0 (empty) java-1.7.0 (empty) Issuing the echo %PATH gives the following /usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/salam/bin In eclipse helios 3.6, I see in preferences Java I have /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64 How one can check that he has Java EE setup correctly with Apache Tomcat 6 ? I have Apache Tomcat up and running and need to setup CATALINA_HOME. In the usr/share/java directory, I have a directory tomcat6 as well as a tomcat6 directory in /usr/share/. In Eclipse, when I try to add a server, eclipse doesnt see that I have a type of tomcat server. I have found so many articles on the web but no 2 articles are similar. I tried to browse Sun's Path setup tutorial but it seems it is not available anymore. Thanks for your help - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail:
Re: Windows Service Uninstall (was: Re: Problems installing Tomcat on Windows 2008)
Possibly Sysinternals? http://technet.microsoft.com/en-us/sysinternals/default.aspx See the Handle utility. Caveat - I'm not a Windows expert (or person). /mde/ - Original Message From: Thomas apache.org-li...@darkwhole.de To: users@tomcat.apache.org Sent: Tue, November 30, 2010 9:27:13 AM Subject: Windows Service Uninstall (was: Re: Problems installing Tomcat on Windows 2008) Hallo Konstantin, On 11/19/2010 06:14 PM, Konstantin Kolinko wrote: b) You cannot install the service twice with the same name. (The second and later attempts will fail with the same generic message as above). Try service.bat remove first. Verify that it is not listed as a service (in the Control Panel of Windows). (I had several times when uninstall did not complete until I rebooted). I came across this problem on different Windows versions: Deinstalling the service was successful, but the service is still listed under Control Panel - Services. Additionally running the windows command line tool sc [0], always gives a message like service is marked for deletion. One reason for this can be (as mentioned under [1]): a) Service still running during uninstallation b) Other processes with open handles to the service uninstallation, e.g.: - Service Wrapper Admin Windows (default: tomcat6w.exe) (often another User Session with the Service Wrapper Icon in System Tray) - Control Panel - Services open After closing all processes with an open handle the service gets deleted immediately, so no reboot is necessary. I'm not aware of an easy method to obtain a list of processes with an open handle. Maybe a windows expert can shed a light on this. [0] http://technet.microsoft.com/en-us/library/cc754599%28WS.10%29.aspx [1] http://technet.microsoft.com/en-us/library/cc742045%28WS.10%29.aspx Best regards, Thomas - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: automatic deployment without server.xml - bad request
Short answer: Please read (carefully), the following documentation: http://tomcat.apache.org/tomcat-6.0-doc/appdev/deployment.html Longer answer: 1. remove the docBase attribute from your Context Your docBase would only work if you have a directory $CATALINA_BASE/com.mycompany.myapp. 2. remove the path attribute from your Context Rename your WAR file to myapp.war. Tomcat will correctly infer the path 3. Place myapp.war in $CATALINA_BASE/webapps Tomcat (by default) will unpack and deploy your application 4. Remove the Manager node from your Context. The Manager node relates to managing HTTP Sessions. The Hibernate sessions relate to Hibernate units of work. 4a. Tomcat: http://tomcat.apache.org/tomcat-6.0-doc/config/manager.html 4b. Hibernate: http://community.jboss.org/wiki/sessionsandtransactions 5. Remove the Resource node from your Context. 6. Place the hibernate.cfg.xml file where it will be packaged in WEB-INF/classes. 6a. In a NetBeans project, place it in project-name/src/java 6b. In a Maven project, place it in project-name/src/main/resources 7. Use a ServletContextListener to get a Hibernate SessionFactory. Here's an example: http://community.jboss.org/wiki/UsingHibernatewithTomcat I do things a little differently, by creating a utility class, and then using that utility class in a listener. I can then attach logging and MBeans to the listener. . . . . just my two cent. /mde/ - Original Message From: Justin Case send_lotsa_spam_h...@yahoo.com To: users@tomcat.apache.org Sent: Wed, December 1, 2010 6:22:01 AM Subject: automatic deployment without server.xml - bad request Hello all, I'm on Tomcat 6.0.29 in Windows (XP or server 2003, same) and I'm trying to get an application to deploy automatically without putting it in server.xml - as the documentation strongly recommends. Just to note, if I put the context setting in server.xml like this all works fine. Host appBase=wtpwebapps autoDeploy=false deployOnStartup=false name=localhost unpackWARs=true xmlNamespaceAware=false xmlValidation=false Valve className=org.apache.catalina.valves.AccessLogValve directory=logs pattern=common prefix=access_log. resolveHosts=false suffix=.txt / Context docBase=com.mycompany.myapp path=/myapp reloadable=true override=true Manager pathname= / Resource name=hibernate/MySessionFactory auth=Container type=org.hibernate.SessionFactory factory=com.mycompany.myapp.HibernateSessionFactoryTomcatFactory configuration=hibernate.cfg.xml / /Context /Host If I remove the context from server.xml and place a context.xml in my app's META-INF, then enable the two deploy params, the deployment happens succesfully - that's what the console says at least. The application even starts ok, I can see the logging of my classes. BUT! Each request to the application will throw immediately a HTTP error 400 - bad request. Funny enough, this error will not even be logged anywhere, even when I enabled debug logging in Tomcat! (and got 100M of logs which I searched through). No record of the 400 whatsoever, while I can confirm the Host header IS there - I see it in Firebug (and with the other context it works anyway). What I see different is that the Tomcat's work directory, the work/Catalina/localhost/com.mycomp.myapp directory it created automatically at startup is and stays EMPTY. Now normally there should be the compiled JSP's right? So there's SOMETHING not ok about this automatic deployment, and I'm unable to figure out what it is. There was in May an interesting discussion thread on this list called Misunderstanding deployOnStartup actions, but that guy also ended up using server.xml so... I only see advice like your config is wrong to start with, which might be very true (otherwise one wouldn't be posting), but I wasn't able to see anywhere sampled a CORRECT config. Thanks A LOT for any hints/samples/links, JC - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Modifying logging levels logged in catalina.out at runtime
Hopefully you're not creating custom logging levels. Creating custom logging levels is the classic way to create classloader leaks. See the following as an example: http://blogs.sun.com/fkieviet/entry/classloader_leaks_the_dreaded_java You can create a logging.properties file and place it in WEB-INF/classes. You can then change this file, rebuild your application, and redeploy it without taking down Tomcat. You could also add a WatchedResource element to your Context and point it at WEB-INF/classes/logging.properties. When that file is changed, Tomcat will reload the application. See: http://tomcat.apache.org/tomcat-5.5-doc/config/context.html I'm not really sure you want to do the WatchedResource configuration in a production environment though . . . . . . . just my two cents. /mde/ - Original Message From: Jason Pyeron jpye...@pdinc.us To: Tomcat Users List users@tomcat.apache.org Sent: Wed, December 1, 2010 11:59:28 AM Subject: Modifying logging levels logged in catalina.out at runtime This may be slightly off-topic. I'll start off with I know how to do this from inside the webapp's code and how to do it by modifing properties files on the system at tomcat startup. But how can it be done from outside the webapp with out restarting tomcat? We are using java.util.logging on tomcat 5.5.23 using jdk 1.6.0_17. -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - - - Jason Pyeron PD Inc. http://www.pdinc.us - - Principal Consultant 10 West 24th Street #100- - +1 (443) 269-1555 x333Baltimore, Maryland 21218 - - - -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- This message is copyright PD Inc, subject to license 20080407P00. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Questions about installing APR
In RedHat-based Linux distributions (maybe in others), you'll need to install the development packages as well as the base packages. Look for: apr-devel apr-util-devel and install. Then you can do a configure with: ./configure --with-apr=/usr since the apr-1-config (at least that's what it's called on Fedora 14) is in /usr/bin. . . . . just my two cents. /mde/ - Original Message From: Aggarwal, Ajay ajay.aggar...@stratus.com To: Tomcat Users List users@tomcat.apache.org Sent: Thu, December 2, 2010 1:08:38 PM Subject: Questions about installing APR My OS is centos 5.5, which has APR 1.2.7 pre-installed on it. # rpm -qa | grep apr apr-1.2.7-11.el5_3.1 apr-util-1.2.7-11.el5 I am using Tomcat version 6.0.20 and I located tomcat-native.tar.gz under tomcat/bin folder. I extracted the contents and now I am in tomcat/bin/tomcat-native-1.1.16-src/jni/native directory. I have the configure script here. ./configure fails Error: configure: error: APR could not be located. Please use the --with-apr option. Not sure why I get above error since I have the apr RPM installed (version 1.2.7). I double check for these shared libraries under /usr/lib and they are all there ls /usr/lib/libapr* /usr/lib/libapr-1.so.0 /usr/lib/libapr-1.so.0.2.7 /usr/lib/libaprutil-1.so.0 /usr/lib/libaprutil-1.so.0.2.7 I tried ./configure --with-apr=/usr/lib , but that fails too Error: checking for APR... configure: error: the --with-apr parameter is incorrect. It must specify an install prefix, a build directory, or an apr-config file. So I downloaded APR version 1.4.2 and compiled and installed it with a different prefix=/tmp/myapr Now ./configure --with-apr=/tmp/myapr works fine and I see following line when I start tomcat Loaded APR based Apache Tomcat Native library 1.1.16. APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true]. But I have couple of questions: 1) Is it ok to compile JNI wrapper with APR 1.4.2, but run it with APR 1.2.7 (like I explained above)? 2) Is it ok to use ARP 1.2.7? Or is it strongly recommended to use the latest version, i.e. APR 1.4.2? -Ajay - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Place .ini conf file inside the war package.
Read about using properties files. They're typically called name.properties. Snippet of code that can be placed in a ServletContextListener. String resource = some.properties; InputStream in = this.getClass().getClassLoader().getResourceAsStream(resource); try { props.load(in); in.close(); } catch (IOException ex) { ex.printStackTrace(); // ugly } Note that this is not a complete ServletContextListener. Normally I create a separate class, have that class's constructor read the properties file, and then use the ServletContextListener to create a servlet context attribute with the information. You can use an init parameter to read the resource name from web.xml, and then pass that information to your class as an argument to the constructor. Catch exceptions (such as file not found) appropriately. The Apache commons configuration (mentioned in another message) provides a lot of nice tools for reading properties files. Place the some.properties file in src/main/resources of your Maven project. This will get it packed up in WEB-INF/classes of your war file once you run maven package. Read the javadoc on Class.getResourceAsStream() concerning how to locate the properties file. . . . . just my two cents. /mde/ - Original Message From: srd.pl srolek2...@yahoo.com To: users@tomcat.apache.org Sent: Sat, December 4, 2010 3:58:25 AM Subject: Place .ini conf file inside the war package. Hello, I have a quick question considering my rest webservice. I would like to place an .ini file with configuration parameters inside an war file, so that I can change them wile the app is deployed on tomcat without recompiling. Can any give an advice on how to do this? And how to open this file (what path) in my java code. I am using maven so an advice on how to write a special script in the pom.xml file would be great. -- View this message in context: http://old.nabble.com/Place-.ini-conf-file-inside-the-war-package.-tp30366628p30366628.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Questions about installing APR
man pkg-config From the description of pkg-config: The pkg-config program is used to retrieve information about installed libraries in the system. It is typically used to compile and link against one or more libraries. In short, you don't need to copy the .pc files over. . . . . just my two cents. /mde/ - Original Message From: Aggarwal, Ajay ajay.aggar...@stratus.com To: Tomcat Users List users@tomcat.apache.org Sent: Tue, December 7, 2010 6:57:19 AM Subject: RE: Questions about installing APR One more question. I was thinking of compiling it on a different machine (call it my build machine) and then copying the necessary files on to the target machines. These target machines are running the same (linux) OS as my build machine. But on my build machine I want to use --prefix=/build/export/mypath and then copy the necessary files to /usr/lib of the target machines. I see following files under /build/export/mypath/lib folder of my build machine. Do I need to copy everything to /usr/lib of target machines? Including pkgconfig folder? ./lib: libtcnative-1.a libtcnative-1.la* libtcnative-1.so@ libtcnative-1.so.0@ libtcnative-1.so.0.1.16* pkgconfig/ The reason I ask is because pkgconfig/tcnative-1.pc file contains paths relative to the prefix I used on my build machine. But this prefix is not relevant for target machines. What is the pkgconfig folder used for? -Ajay -Original Message- From: Aggarwal, Ajay [mailto:ajay.aggar...@stratus.com] Thanks for your help. That worked. -Original Message- From: Mark Eggers [mailto:its_toas...@yahoo.com] In RedHat-based Linux distributions (maybe in others), you'll need to install the development packages as well as the base packages. Look for: apr-devel apr-util-devel and install. Then you can do a configure with: ./configure --with-apr=/usr since the apr-1-config (at least that's what it's called on Fedora 14) is in /usr/bin. . . . . just my two cents. /mde/ - Original Message From: Aggarwal, Ajay ajay.aggar...@stratus.com My OS is centos 5.5, which has APR 1.2.7 pre-installed on it. # rpm -qa | grep apr apr-1.2.7-11.el5_3.1 apr-util-1.2.7-11.el5 I am using Tomcat version 6.0.20 and I located tomcat-native.tar.gz under tomcat/bin folder. I extracted the contents and now I am in tomcat/bin/tomcat-native-1.1.16-src/jni/native directory. I have the configure script here. ./configure fails Error: configure: error: APR could not be located. Please use the --with-apr option. Not sure why I get above error since I have the apr RPM installed (version 1.2.7). I double check for these shared libraries under /usr/lib and they are all there ls /usr/lib/libapr* /usr/lib/libapr-1.so.0 /usr/lib/libapr-1.so.0.2.7 /usr/lib/libaprutil-1.so.0 /usr/lib/libaprutil-1.so.0.2.7 I tried ./configure --with-apr=/usr/lib , but that fails too Error: checking for APR... configure: error: the --with-apr parameter is incorrect. It must specify an install prefix, a build directory, or an apr-config file. So I downloaded APR version 1.4.2 and compiled and installed it with a different prefix=/tmp/myapr Now ./configure --with-apr=/tmp/myapr works fine and I see following line when I start tomcat Loaded APR based Apache Tomcat Native library 1.1.16. APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true]. But I have couple of questions: 1) Is it ok to compile JNI wrapper with APR 1.4.2, but run it with APR 1.2.7 (like I explained above)? 2) Is it ok to use ARP 1.2.7? Or is it strongly recommended to use the latest version, i.e. APR 1.4.2? -Ajay - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: class not found in tomcat's JARs (in $CATALINA_HOME/lib)
Out of curiosity, couldn't you use the information in RUNNING.txt under Advanced Configuration - Multiple Tomcat Instances to meet your requirements? . . . just a thought. /mde/ - Original Message From: frank fr...@cloud.com Hi Experts: I have read class not found in FAQ and class loader howto of tomcat6, unfortunately, they don't resolve my problem. I set CATALINA_BASE and CATALINA_HOME to my directory like: CATALINA_BASE=/usr/share/mydir CATALINA_HOME=/usr/share/mydir then link subdirs (conf/, bin/ ...)of tomcat6 to $CATALINA_HOME, the lib/ points to /usr/share/tomcat6/lib. IMO, tomcat6-servlet-2.5-api.jar, tomcat6-jsp-2.1-api-6.0.26.jar, tomcat6-el-2.1-api-6.0.26.jar should be automatically be found since they are located at $CATALINA_HOME/lib/. In fact this doesn't work, I got errors (see paste at bottom). However, if I added full path of these JARs to classpath, things worked. I am puzzled, why common class loader doesn't get these files? thank you. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: HTTP status 404
Lava, Please read the following: http://tomcat.apache.org/tomcat-6.0-doc/appdev/deployment.html Pay particular attention to: http://tomcat.apache.org/tomcat-6.0-doc/appdev/deployment.html#Standard_Directory_Layout (please note the above link is line-wrapped) Here's an example. Each line level is a subdirectory. Comments are in parentheses. Static (top folder - application name) ├── (jsp, html, js, css, etc. - can have subdirectories) ├── META-INF (context.xml, not required - see Tomcat documentation) └── WEB-INF ├── classes (where the java classes you wrote go) ├── lib (where jar files - yours or third party libraries go) └── web.xml (deployment descriptor - read the standard) A minimal Tomcat 6 deployment descriptor for an application containing only static resources could be: ?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 display-nameStatic Application/display-name descriptionHTML, CSS, and JS application/description welcome-file-list welcome-fileindex.html/welcome-file /welcome-file-list /web-app (note again that the third / fourth line of the web-app element is line-wrapped) The index.html file would go under Static (Static-index.html). The web.xml file would go under Static-WEB-INF (Static-WEB-INF-web.xml). You would display this application by copying the entire directory structure to $CATALINA_HOME/webapps, starting Tomcat, and then browse to http://localhost:8080/Static/ (provided you have not changed the default server.xml. If you want to make a war file, then go to the parent directory and issue the following command from the command line: jar tf Static.war Static Please note that case is important. This will create Static.war which can then be deployed using Tomcat's manager application (or copying Static.war to $CATALINA_HOME/webapps). . . . . just my two cents. /mde/ - Original Message From: Lava Saleem lnsal...@ualr.edu To: Tomcat Users List users@tomcat.apache.org Sent: Wed, December 8, 2010 12:12:18 PM Subject: Re: HTTP status 404 Hi Chris Thanks for the reply Didn't you ask this same question the day before yesterday? Have you read all the replies and questions? No this one is a different question yes I have read the replies and went through the documentation What does all that mean? Are those file paths? Are they descriptions of how you have concatenated files together? It doesn't make any sense to me. yes those are the folder path as you may see, I have filename.htm with web.xml with META-INF with classes with lib in a folder called WEB-INF this folder is in a folder called filename, filename is in the webapp folder. What URL did you request? What resource did you expect it to serve? yes I have the url and I can't think of any resources needed thats why Iam asking the question Thanks Lava On Wed, Dec 8, 2010 at 2:47 PM, Christopher Schultz ch...@christopherschultz.net wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Lava, Didn't you ask this same question the day before yesterday? Have you read all the replies and questions? On 12/8/2010 2:39 PM, Lava Saleem wrote: I have a single page html file with java script embadded in it, I have created a war file for it and deployed it successfully but when I click on the page I get the below error, the structure of my war file is the following webapp -- filename -- WEB-INF-- filename.htm + web.xml + META-INF + classes + lib What does all that mean? Are those file paths? Are they descriptions of how you have concatenated files together? It doesn't make any sense to me. I did not modify the web.xml since I don't need the servlets do I need to modify anything? Maybe. HTTP status 404 description the requested resource (/filename/)is not available What URL did you request? What resource did you expect it to serve? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkz/4L4ACgkQ9CaO5/Lv0PAScgCePUhYj8pYL/9Vb3eNZDHncVa3 GAsAoLvpcJjFYd1vb6ufehd41FgB084q =SFt0 -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org -- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: deploy log4j
You don't say the following: Tomcat version JRE/JDK version Platform (OS and version) That being said, I use log4j (with or without Apache commons logging) for nearly every web application I run on Tomcat. Short answer: You don't manually read in your properties file with log4j. Read a tutorial on log4j for a more complete explanation. What follows below is an overview. Please refer to the log4j documentation, the log4j javadocs, and tutorials around the Internet for a more complete discussion. Code: In each class that you want to use logging, add the following: package foo; // replace with your package name import org.apache.log4j.Logger; public class MyFoo { // replace with your class name private static final Logger log = Logger.getLogger(MyFoo.class); // note 1 /* * rest of class including log.(message) where is a level */ } note 1: While it is traditional that one uses getLogger(MyFoo.class), which is shorthand for getLogger(clazz.getName()), you can also name your loggers with any legal string. See the javadoc for more information. Properties File: In your properties file, you'll need appenders as well individual lines for non-default logging levels for each logger name. ### direct messages to file foo.log ### log4j.appender.file=org.apache.log4j.FileAppender log4j.appender.file.File=${catalina.home}/logs/foo.log log4j.appender.file.layout=org.apache.log4j.PatternLayout log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n # default logging level log4j.rootLogger=warn, file # logging for foo.MyFoo - name matches the logger name log4j.logger.foo.MyFoo.type=info Since there is only a file listed in the appenders, then that's where the logging will go. Note that ${catalina.home} was used for logging. This should probably be ${catalina.base} just in case more than one copy of Tomcat is run from a base installation (see RUNNING.txt). This is a handy way of storing log files. If you're doing some in-IDE testing where ${catalina.home} or ${catalina.base} is not set, then hopefully your IDE will let you pass in a Java parameter. Just set -Dcatalina.home=some-place (or -Dcatalina.base=some-place) while testing. Application Structure: Properties file Package up the application so that log4j.properties gets placed in WEB-INF/classes/log4j.properties. Log4j looks for the properties file in the classpath. Placement in your IDE's project depends on how your IDE packages files. Log4j library Package up the application so that log4j-1.2.15.jar (or whatever version you are using) gets placed in WEB-INF/lib/log4j-1.2.15.jar. Placement in your IDE's project depends on how your IDE packages files. . . . . just my two cents. /mde/ - Original Message From: cpanon cpa...@yahoo.com To: Tomcat users@tomcat.apache.org Sent: Wed, December 8, 2010 8:23:46 PM Subject: deploy log4j Hello I have an app that work perfectly in my IDE(JBuilder05, yes I know but it work fine), but on deployment I believe it is not reading the log4j with this error: java.lang.NullPointerException at java.util.Properties$LineReader.readLine(Unknown Source) followed by log4j:WARN No appenders could be found for logger I am loading the prop file with this(that works in the IDE) java.util.Properties props = new java.util.Properties(); try { props.load(getClass().getResourceAsStream(/log4j.properties)); } catch (IOException ex) { } PropertyConfigurator.configure(props); //ver03_lfj.setLevel(Level.DEBUG); ver03_lfj.debug(yippie); - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: HTTP status 404
In the absence of a web.xml file with the following: welcome-file-list welcome-filefilename.htm/welcome-file /welcome-file-list You will have to navigate to: localhost:8080/filename/filename.htm In another message I posted a minimal web.xml file. Change index.html to filename.htm (if this is what you want your welcome file to be). Then navigating to: localhost:8080/filename/ will work. If you want to create a war file, do the following: 1. Change to the directory filename 2. jar cf ../filename.war . 3. cd .. 4. jar tf filename.war (should give you the complete structure) One way to use the war file: 1. Copy filename.war to $CATALINA_HOME/webapps If running, the default configuration of Tomcat will explode the war file and you will see a filename directory in $CATALINA_HOME/webapps along with filename.war. If you look inside that directory, you will see your web application structure. . . . . . just my two cents. /mde/ - Original Message From: Lava Saleem lnsal...@ualr.edu To: users users@tomcat.apache.org Sent: Thu, December 9, 2010 9:10:13 AM Subject: Re: HTTP status 404 Hello everyone, Thanks for the replies I really appreciate your feedback I have the structure as the following webapps | filename |- filename.htm *|-*WEB-INF |- web.xml |-META-INF |-context.xml after having this structure,I use the following command CATALINA_BASE/webapps/filename/ jar -cvf filename.war *.* then I deploy the file in the tomcat manager and I have the following error HTTP status 404 description the requested resource (/filename/)is not available I assumed that I don't need the java classes and lib in the WEB-INF since I'm only having single html file with java script, Do you think I need any ? if so how do I know which files I need ? I also extracted the filename.war just to see whats in there and I see only the filename.htm and the META-INF there is no WEB-INF it is disappearing Thanks Lava On Wed, Dec 8, 2010 at 4:35 PM, André Warnier a...@ice-sa.com wrote: Lava Saleem wrote: Hi everyone, I have a single page html file with java script embadded in it, I have created a war file for it and deployed it successfully but when I click on the page I get the below error, the structure of my war file is the following webapp -- filename -- WEB-INF-- filename.htm + web.xml + META-INF + classes + lib I did not modify the web.xml since I don't need the servlets do I need to modify anything? HTTP status 404 description the requested resource (/filename/)is not available Hi. Except the 404 error which your are getting, not much above makes any sense at all. So it is better to forget all that, and start new. You really have to learn to walk before you can run. First, consider the directory structure of a standard Tomcat installation : (CATALINA_HOME) (=CATALINA_BASE) | |- bin (tomcat programs and scripts) |- conf (configuration files) |- lib (global library files) |- logs (logfiles) |- webapps (* web applications *) |- ROOT (the special, top-level, default web application) |- app1 (a web application) |- app2 (another web application) |- ... |- lastapp (another web application) In the above, (CATALINA_HOME) represents the top directory of your Tomcat installation, the one under which the rest of Tomcat is found. For example, on your system it may be C:\tomcat or C:\program files\Apache Software Foundation\tomcat6.0 or /usr/share/tomcat6 or /usr/local/tomcat6 or whatever. The webapps sub-directory is what is important for you now. That is where you will put web applications, composed of static html pages (with or without javascript in them), JSP pages (special html pages with embedded Java code), java servlets (compiled java applications), etc.. The ROOT web application is special. It is the default application. When you use a URL like : http://yourserver.yourcompany.com/abc.html Tomcat is going to look for abc.html under the webapps/ROOT directory. The other subdirectories under webapps are each one separate web application. To access for example the application named app1, you will have to use a URL starting with http://yourserver.yourcompany.com/app1/; For example, if you place a html page named xyz.html in the subdirectory (CATALINA_HOME)/webapps/app1, then the URL to call it up will be http://yourserver.yourcompany.com/app1/xyz.html Under such a web application directory like ../webapps/app1, there is also a structure. It looks like this : (CATALINA_HOME) (=CATALINA_BASE) |- webapps (* dir, top of all web applications *) | |- app1 (dir, contains the web application named app1) - public files (html etc..) - WEB-INF (directory) |- files (private) |- web.xml (configuration file
Re: Not supported by Basic Datasource
From a quick glance it looks like you're mixing Hibernate-controlled database pooling with Tomcat-managed pooling. Read this and see if that helps. http://wiki.apache.org/tomcat/TomcatHibernate . . . . just my two cents. /mde/ - Original Message From: SOPANMISHRA sopan.mis...@gmail.com To: users@tomcat.apache.org Sent: Thu, December 9, 2010 9:33:02 AM Subject: Not supported by Basic Datasource jdk-1.6_13 Tomcat-6.0.26 Hibernate 3.2 I'm getting the error Not supported by BasicDataSource while running a project based on java-hibernate-tomcat server. The project works fine if I use the normal jdbc process. For configuring datasource I strictly followed the process mentioned in Tomcat reference docs in the link:- http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html ie I'm configuring the project specific hibernate.cfg.xml,web.xml(project specific) and context.xml(inside tomcat/conf). hib.cfg.xml ?xml version=1.0 encoding=UTF-8? !DOCTYPE hibernate-configuration PUBLIC -//Hibernate/Hibernate Configuration DTD 3.0//EN http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd; hibernate-configuration session-factory property name=hibernate.dialectorg.hibernate.dialect.Oracle10gDialect/property property name=hibernate.connection.datasourcejava:comp/env/jdbc/aardb/property property name=show_sqlfalse/property property name=connection.pool_size10/property property name=current_session_context_classthread/property mapping class=com.asas.assasa.asas. / /session-factory /hibernate-configuration web.xml resource-ref descriptionAAR DATABASE/description res-ref-namejdbc/aardb/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref context.xml Resource name=jdbc/aardb auth=Container type=javax.sql.DataSource driverClassName=oracle.jdbc.driver.OracleDriver url=jdbc:oracle:thin:@00.000.00.000:1521:DB1 schema= username= password=xxx maxActive=10 maxIdle=2 maxWait=5000 validationQuery=select 1 from dual / My StackTrace in my customized html that calls web service is as follows is as follows:- STATUS: 500 ?xml version='1.0' encoding='UTF-8'?S:Envelope xmlns:S=http://schemas.xmlsoap.org/soap/envelope/;S:BodyS:Fault xmlns:ns4=http://www.w3.org/2003/05/soap-envelope;faultcodeS:Server/faultcodefaultstringNot supported by BasicDataSource/faultstringdetailns2:ApplicationException xmlns:ns2=http://service.services.agentevaluation.care..com/;messageNot supported by BasicDataSource/message/ns2:ApplicationExceptionns2:exception xmlns:ns2=http://jax-ws.dev.java.net/; class=com..care.agentevaluation.exceptions.ApplicationException note=To disable this feature, set com.sun.xml.ws.fault.SOAPFaultBuilder.disableCaptureStackTrace system property to falsemessageNot supported by BasicDataSource/messagens2:stackTracens2:frame class=com..care.agentevaluation.business.manager. file=.java line=100 method=searchAgent/ns2:frame class=com..care.agentevaluation.services.service.ServiceMaster file=ServiceMaster.java line=78 method=searchAgent/ns2:frame class=sun.reflect.NativeMethodAccessorImpl file=NativeMethodAccessorImpl.java line=native method=invoke0/ns2:frame class=sun.reflect.NativeMethodAccessorImpl file=NativeMethodAccessorImpl.java line=39 method=invoke/ns2:frame class=sun.reflect.DelegatingMethodAccessorImpl file=DelegatingMethodAccessorImpl.java line=25 method=invoke/ns2:frame class=java.lang.reflect.Method file=Method.java line=597 method=invoke/ns2:frame class=com.sun.xml.ws.api.server.InstanceResolver$1 file=InstanceResolver.java line=246 method=invoke/ns2:frame class=com.sun.xml.ws.server.InvokerTube$2 file=InvokerTube.java line=146 method=invoke/ns2:frame class=com.sun.xml.ws.server.sei.EndpointMethodHandler file=EndpointMethodHandler.java line=257 method=invoke/ns2:frame class=com.sun.xml.ws.server.sei.SEIInvokerTube file=SEIInvokerTube.java line=93 method=processRequest/ns2:frame class=com.sun.xml.ws.api.pipe.Fiber file=Fiber.java line=598 method=__doRun/ns2:frame class=com.sun.xml.ws.api.pipe.Fiber file=Fiber.java line=557 method=_doRun/ns2:frame class=com.sun.xml.ws.api.pipe.Fiber file=Fiber.java line=542 method=doRun/ns2:frame class=com.sun.xml.ws.api.pipe.Fiber file=Fiber.java line=439 method=runSync/ns2:frame class=com.sun.xml.ws.server.WSEndpointImpl$2 file=WSEndpointImpl.java line=243 method=process/ns2:frame class=com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit file=HttpAdapter.java line=471 method=handle/ns2:frame class=com.sun.xml.ws.transport.http.HttpAdapter file=HttpAdapter.java line=244 method=handle/ns2:frame class=com.sun.xml.ws.transport.http.servlet.ServletAdapter file=ServletAdapter.java line=135 method=handle/ns2:frame class=com.sun.xml.ws.transport.http.servlet.WSServletDelegate file=WSServletDelegate.java line=129 method=doGet/ns2:frame class=com.sun.xml.ws.transport.http.servlet.WSServletDelegate
Re: deploy log4j
cpannon, I just wrote a very simple web application (2 JSP files, one servlet) and added log4j. I ran this on Linux and Windows/XP with both console and file logging. I don't have access to a Windows server platform (all UNIX or Linux) so I cannot test there. Note, I'm not running under a security manager, and on Windows/XP I'm running with an account that has administrator privileges (I know, I know). However, Tomcat is started using the local System account, so its privileges are more limited. I didn't get any errors. A portion of the log4j.properties file: ### direct log messages to stdout ### log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.Target=System.out log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n The above generates log messages to catalina.out on Linux and stdout_date.log (in %CATALINA_HOME%\logs) on Windows/XP. As Chris has pointed out, be careful where you put your log4j jar file. Since you're logging for a particular web application, place the log4j jar file in Application/WEB-INF/lib. I'm not sure what potential classloader issues you will run into if you place the log4j jar file in $CATALINA_HOME/lib. Definitely do not place the jar file in both $CATALINA_HOME/lib and Application/WEB-INF/lib. . . . . just my two cents. /mde/ - Original Message From: Christopher Schultz ch...@christopherschultz.net To: Tomcat Users List users@tomcat.apache.org Sent: Thu, December 9, 2010 12:11:26 PM Subject: Re: deploy log4j -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 cpannon, On 12/9/2010 1:55 PM, cpanon wrote: Specifically when I deploy TC6.0.29 JRE 6.0.22-b04 log4j.properties(in WEB-INF/classes/) Where is log4j.jar? on Win2KSrv, Win2003Srv, and WinXPP I get java.lang.ClassCastException: org.apache.catalina.util.DefaultAnnotationProcessor cannot be cast to org.apache.AnnotationProcessor What is the rest of the stack trace? This is the where the differences in the platforms affects the results with all of the above configs. 1. On Windows2K Server and Windows2003 Server it fails to find the properly configured and located log4j file 2. On WinXPP it works perfectly under production TC 6.0.29, finding the log4j file without error. You should probably not be using Class.getResourceAsStream, but instead ServletContext.getResourceAsStream. The latter will always load resources relative to the webapp instead of potentially randomly for whatever ClassLoader you happen to stumble across. Where is the code you originally posted running? In a ServletContextListener? Where is the class for that listener located? If you are playing games with .jar files and/or classes in the wrong place because you want to save disk space or something like that, you will end up with these weird kinds of errors, and you will probably end up with enormous memory leaks if you (hot) redeploy your webapp. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk0BN+4ACgkQ9CaO5/Lv0PDQ/QCeMlJ4/UR4drhlwuCVkrjpr3Vd e+8AoJBPGP5PciaW6x34ryk6yrhVQuQY =HaTr -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: HTTP status 404
Lava, I changed the index.htm to filename.htm then I navigated to localhost:8080/filename and it didn't work , I also copied the filename.war file to the webapps and nothing changed Odd, when I do this and type localhost:8080/Static, I get a 302 and redirected to localhost:8080/Static/ automatically. Then my welcome page (index.html) gets displayed. Hmm, as an aside maybe a 307 is more appropriate (but pre-HTTP 1.1 clients may not understand this, and who knows what IE does)? What is your complete web.xml? the filename pops up, on the manager side its says running but the session stays zero You don't get sessions for free. Sessions are different than connections. I don't know your background, but it sounds like some reading is in order. A book that seems to be helpful is Headfirst Servlets JSP. The second edition covers the servlet 2.5 specifications. You'll need to have a basic understanding of Java in order to use this book, but it does a good job of explaining a lot of material. The exercises are reasonable as well. . . . . just my two cents. /mde/ - Original Message From: Lava Saleem lnsal...@ualr.edu To: users users@tomcat.apache.org Sent: Thu, December 9, 2010 11:40:14 AM Subject: Re: HTTP status 404 Hi Mark, I have changed my web.xml file to the one you send me and added the welcome-file-list so I will not need to navigate to localhost:8080/filename/filename.htm, I changed the index.htm to filename.htmthen I navigated to localhost:8080/filename and it didn't work , I also copied the filename.war file to the webapps and nothing changed however after changing the web.xml file when I navigate to localhost:8080/filename/filename.htm the filename pops up, on the manager side its says running but the session stays zero so to be honest I'm kinda confuse is it working now ?if I changed the web.xml shouldn't be working on localhost:8080/filename/ ? Thanks Lava On Thu, Dec 9, 2010 at 1:15 PM, Mark Eggers its_toas...@yahoo.com wrote: In the absence of a web.xml file with the following: welcome-file-list welcome-filefilename.htm/welcome-file /welcome-file-list You will have to navigate to: localhost:8080/filename/filename.htm In another message I posted a minimal web.xml file. Change index.html to filename.htm (if this is what you want your welcome file to be). Then navigating to: localhost:8080/filename/ will work. If you want to create a war file, do the following: 1. Change to the directory filename 2. jar cf ../filename.war . 3. cd .. 4. jar tf filename.war (should give you the complete structure) One way to use the war file: 1. Copy filename.war to $CATALINA_HOME/webapps If running, the default configuration of Tomcat will explode the war file and you will see a filename directory in $CATALINA_HOME/webapps along with filename.war. If you look inside that directory, you will see your web application structure. . . . . . just my two cents. /mde/ - Original Message From: Lava Saleem lnsal...@ualr.edu To: users users@tomcat.apache.org Sent: Thu, December 9, 2010 9:10:13 AM Subject: Re: HTTP status 404 Hello everyone, Thanks for the replies I really appreciate your feedback I have the structure as the following webapps | filename |- filename.htm *|-*WEB-INF |- web.xml |-META-INF |-context.xml after having this structure,I use the following command CATALINA_BASE/webapps/filename/ jar -cvf filename.war *.* then I deploy the file in the tomcat manager and I have the following error HTTP status 404 description the requested resource (/filename/)is not available I assumed that I don't need the java classes and lib in the WEB-INF since I'm only having single html file with java script, Do you think I need any ? if so how do I know which files I need ? I also extracted the filename.war just to see whats in there and I see only the filename.htm and the META-INF there is no WEB-INF it is disappearing Thanks Lava On Wed, Dec 8, 2010 at 4:35 PM, André Warnier a...@ice-sa.com wrote: Lava Saleem wrote: Hi everyone, I have a single page html file with java script embadded in it, I have created a war file for it and deployed it successfully but when I click on the page I get the below error, the structure of my war file is the following webapp -- filename -- WEB-INF-- filename.htm + web.xml + META-INF + classes + lib I did not modify the web.xml since I don't need the servlets do I need to modify anything? HTTP status 404 description the requested resource (/filename/)is not available Hi. Except the 404 error which your are getting, not much above makes any sense at all. So it is better to forget all that, and start new. You really have to learn to walk before you can run. First, consider the directory structure of a standard Tomcat installation : (CATALINA_HOME
Re: deploy log4j
Quick question: Are you running under a security manager in any environment? The logs (most likely catalina.out or catalina.date.log) will have lots of messages if you've not modified the default $CATALINA_HOME/conf/catalina.policy file. For example, if I run my simple application that has its first logging instance in a servlet under the security manager using the default catalina.policy, I get as the first line of the error: javax.servlet.ServletException: Error instantiating servlet class simple.controller.SimpleLog If you are doing your first logging in a ServletContextListener, your application will likely not start at all. The configuration can get complicated quickly. There should be a policy that allows the appropriate log4j class to read its configuration file. There should be another policy that allows the appropriate log4j class to read/write in the log directory as well as the appropriate log files. Maybe someone on the list has already written the appropriate catalina.policy lines. If you're not running using the security manager, then please disregard the noise. . . . . just my two cents. /mde/ - Original Message From: cpanon cpa...@yahoo.com To: Tomcat Users List users@tomcat.apache.org Sent: Thu, December 9, 2010 6:43:39 PM Subject: Re: deploy log4j Hello I agree it should be simple and in the IDE it works fine. In simple production environment on Windows Servers it fails. In simple production environment on a WinXPP it works. It cant get any more discipline testing than that. Nothing changes other than the deployment OS. I am loading an applet and I can synthesize my location as codebase+WEB-INF/classes/log4j.properties but even the working IDE environment fails. I am doing a prop.load(getClass().getResourceAsStream(codebase+WEB-INF/classes/log4j.properties)). Now neither environment works. Ideas? From: Christopher Schultz ch...@christopherschultz.net To: Tomcat Users List users@tomcat.apache.org Sent: Thu, December 9, 2010 4:37:23 PM Subject: Re: deploy log4j -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Mark, On 12/9/2010 3:44 PM, Mark Eggers wrote: I didn't get any errors. Nor do we: we use log4j for application logging, have log4j.jar in WEB-INF/lib, have our log4j.properties in WEB-INF/classes/log4j.properties, and use the following code to configure our logging system: new PropertyConfigurator(); It couldn't be simpler than that if you ask me. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk0BTBMACgkQ9CaO5/Lv0PBiZgCfY2ajcRb5kgt5ODC4/hx8UaBW 48kAoK0a1Dq/wxwSsXsVrjNWBJwo0IXc =eyxa -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org