Tomcat Custom Authenticator
Need some help or advice.. For Security reasons, We need to do logging for IP,username, etc(AUDIT). We need to log success and failed attempts. We don't want to modify the internal classes(unless it's impossible). We are using the FORM auth-method, we POST to j_security_check. We have our own custom realm that extends RealmBase. All that works fine. Until we try and report back to the browser why the authentication failed, to many attempts, account expired etc.. So my question is. Since the authentication occurs in the Realm/FormAuthenticator, Has anyone been able to successfully extend this class ( FormAuthenticator ), and implement this kind of concept? I have found some examples online, but I have not been able to make them work. thanks...
sym link to serve documents within web application.
Hey everyone, Has anyone ever tried to serve documents from within a tomcat webapp vai a sym link. We have everything setup in tomcat to allowLinking within a context. But I can not get my web app to serve documents via the link.. example below. web-app location - /apps/development/tomcat/webapps/testSiteA within testSiteA I create a sym link called Documents pointed to /src/data/storage/Documents. Now I can upload/write documents via the commons jars with the sym link fine.. everything works great. but if I try to view those via something like.. http://hostname:port/testSiteA/Documents/test123.doc. I keep getting a 404 for file not found. I've been looking around, and trying to set a different context resource in my web.xml, server.xml, etc.. in different configs, but no luck so far. anyone ever done this before?
Re: sym link to serve documents within web application.
Thanks David, we found my misconfiguration about 30 minutes after I posted.. But I'm glad you brought up the redeploying issue. I didn't even think about that. So I guess I'll be adding some documentation to that piece. Thanks for your replies.. Danny On Thu, Mar 6, 2008 at 4:47 PM, Christopher Schultz [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 David, Maffitt, David wrote: | We have a different problem with this. Tomcat will follow the link | and delete the contents of the linked-to directory when the app is | redeployed. We have to be sure that the link is deleted before | redeploying. Not a problem if one always deploys from a script but a | potential disaster if someone just drops the new war in webapps. | This is not the behavior we were expecting. Is this a bug or a | feature? :- I would file it as a bug, though you're likely to get a response like if it's not part of the webapp, what is it doing in there and your webapp should be completely self-contained, etc. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.8 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkfQdGsACgkQ9CaO5/Lv0PBU1gCgw1gZiyQYm9F+T7Vtw75tmybI 9vsAn0pwsUXEhqioPF20lWd06HpJlP77 =0Lg+ -END PGP SIGNATURE- - 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: Using MSAccess database for container authentication
didn't imply there was a need for additional jars. Just trying to make clear he needed the one the one with that class. . Also didn't mean to complicate it, just trying to help figure out where the issue was going. On 8/10/07, Christopher Schultz [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Daniel, Daniel Stephens wrote: Also, make sure that whatever jar file has this sun.jdbc.odbc.JdbcOdbcDriver class, is located in your tomcat common/lib. This is a standard class that comes with the Sun JRE. There is no need for any additional JAR files. As well as having a binding in your context.xml or web.xml like below. And have the datasource configured in the server.xml or equivalent(I think 5.5 sets up the Datasources a little different). but you'll need the following configured. The OP is using a JDBC realm, not configuring a DataSource. Don't complicate things, here. I would advise the OP to check online for how to connect Java to Access in general before adding Tomcat into the mix. Using MS Access requires you to setup an ODBC DataSource in Windows. Have you done that? Is it called Auth? The connection URL was jdbc:odbc:Auth, so it should be. I've never used Access with Java (or by itself, for that matter), but I've seen connection URLs like this, too: jdbc:odbc:;DRIVER=Microsoft Access Driver (*.mdb); DBQ=D:\\path_to_db\db.mdb;PWD=mypass This appears to define it's own data source instead of requiring you to create one in the control panel. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGvJzU9CaO5/Lv0PARAgg1AJ90pWZ/jhYheC/bCL/uG+bHZAxPNACdF4Xb PQqTPRSwxn24giPvVRwlzxQ= =We8r -END PGP SIGNATURE- - 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: Using MSAccess database for container authentication
Also, make sure that whatever jar file has this sun.jdbc.odbc.JdbcOdbcDriver class, is located in your tomcat common/lib. As well as having a binding in your context.xml or web.xml like below. And have the datasource configured in the server.xml or equivalent(I think 5.5 sets up the Datasources a little different). but you'll need the follwing configured.. datasurce: Resource name=jdbc/AccessDS type=javax.sql.DataSource/ ResourceParams name=jdbc/AccessDS parameternamefactory/namevalue org.apache.commons.dbcp.BasicDataSourceFactory/value/parameter parameternamemaxActive/namevalue10/value/parameter parameternamemaxIdle/namevalue8/value/parameter parameternameminIdle/namevalue5/value/parameter parameternamemaxWait/namevalue1000/value/parameter parameternameusername/namevalueusername/value/parameter parameternamepassword/namevaluepassword/value/parameter parameternamedriverClassName/namevalue sun.jdbc.odbc.JdbcOdbcDriver/value/parameter !-- This URL parameter may be different since it's jdbc.odbc -- parameternameurl/namevaluejdbc:oracle:thin:@host :port:sid/value/parameter !-- This URL parameter may be different since it's jdbc.odbc -- parameternameremoveAbandoned/namevaluetrue/value/parameter parameternameremoveAbandonedTimeout/namevalue10/value/parameter parameternamelogAbandoned/namevaluetrue/value/parameter /ResourceParams resourcelink: ResourceLink name=jdbc/AccessDS global=jdbc/AccessDS type= javax.sql.DataSource / this is meerly an example, you may have to search the web for the correct way to bind it. reference in web or context.xml resource-ref res-ref-namejdbc/AccessDS/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref On 8/10/07, Propes, Barry L [EMAIL PROTECTED] wrote: you did give it a DSN of some sort? Do you have the correct driver or MDAC update? -Original Message- From: remmons [mailto:[EMAIL PROTECTED] Sent: Friday, August 10, 2007 10:40 AM To: users@tomcat.apache.org Subject: Using MSAccess database for container authentication I am trying to use an MSAccess database for container authentication in Tomcat 5.5.23. When I start Tomcat, I get this message in the catalina.-MM-DD.log: Aug 10, 2007 10:50:30 AM org.apache.catalina.realm.JDBCRealm start SEVERE: Exception opening database connection java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source) at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source) at sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(Unknown Source) at sun.jdbc.odbc.JdbcOdbcConnection.initialize(Unknown Source) at sun.jdbc.odbc.JdbcOdbcDriver.connect(Unknown Source) at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:701) at org.apache.catalina.realm.JDBCRealm.start(JDBCRealm.java:769) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java :1006) at org.apache.catalina.core.StandardEngine.start( StandardEngine.java:443) at org.apache.catalina.core.StandardService.start( StandardService.java:448) at org.apache.catalina.core.StandardServer.start( StandardServer.java:700) at org.apache.catalina.startup.Catalina.start(Catalina.java:552) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433) Aug 10, 2007 10:50:30 AM org.apache.catalina.core.StandardHost start INFO: XML validation disabled I setup my realm in server.xml as follows: Realm className=org.apache.catalina.realm.JDBCRealm driverName=sun.jdbc.odbc.JdbcOdbcDriver connectionURL=jdbc:odbc:Auth userTable=User userNameCol=UserName userCredCol=Password userRoleTable=User_Role roleNameCol=RoleName / where Auth.mdb is the name of my MSAccess database. I configured Auth.mdb in my ODBC Data Source Administrator, and I am able to access it and display its tables from a Java application. I am using Tomcat 5.5.23. Has anyone used an MSAccess database via JDBC-ODBC for authentication in Tomcat? Can anyone tell me what I am doing wrong? -- View this message in context: http://www.nabble.com/Using-MSAccess-database-for-container-authentication-tf4249487.html#a12093749 Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To
Re: Error starting Tomcat 5.5 as a Windows service
Excellent! Glad to hear it worked out. On 7/6/07, Tony Fountain [EMAIL PROTECTED] wrote: Daniel, Thanks for the suggestion. That did the trick. The Tomcat application is now running as a windows service and everything is working. Odd situation though since I always thought that environment variables were recognized immediately (except for previously opened command windows). Lesson learned :). Thanks, Tony Fountain Benefit Concepts, Inc. (419) 244-9936 x9010 -Original Message- From: Daniel Stephens [mailto:[EMAIL PROTECTED] Sent: Thursday, July 05, 2007 4:32 PM To: Tomcat Users List Subject: Re: Error starting Tomcat 5.5 as a Windows service Make sure you have CATALINA_HOME pointed to your tomcat instance. make sure your java home is correct.. It sounds like it can't find the java home.. You did boot after the install right? If you added that environment variable to the system section, you'll need to boot to pick it up or open a new cmd prompt to re-read the environment. On 7/5/07, Tony Fountain [EMAIL PROTECTED] wrote: Hi, I am attempting to install Tomcat 5.5.23 as a Windows service on a Windows 2003 Server box. The steps I went through are as follows * Installed the JDK 1.5 Update 12 * Manually added the environment variable JAVA_HOME to C:\Program Files\Java\jdk1.5.0_12 (as a system variable, not user level) * Ran the windows installer package and selected the full install option. At this point I expected to be able to test the service can start and serve requests using examples installed with the installation but I am unable to. Anytime I try to start the Windows service the following error is logged: [2007-07-05 15:53:54] [1276 prunsrv.c] [debug] Procrun log initialized [2007-07-05 15:53:54] [info] Running Service... [2007-07-05 15:53:54] [1098 prunsrv.c] [debug] Inside ServiceMain... [2007-07-05 15:53:54] [info] Starting service... [2007-07-05 15:53:54] [400 javajni.c] [debug] Jvm Option[0] -Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 5.5 [2007-07-05 15:53:54] [400 javajni.c] [debug] Jvm Option[1] -Dcatalina.base=C:\Program Files\Apache Software Foundation\Tomcat 5.5 [2007-07-05 15:53:54] [400 javajni.c] [debug] Jvm Option[2] -Djava.endorsed.dirs=C:\Program Files\Apache Software Foundation\Tomcat 5.5\common\endorsed [2007-07-05 15:53:54] [400 javajni.c] [debug] Jvm Option[3] -Djava.io.tmpdir=C:\Program Files\Apache Software Foundation\Tomcat 5.5\temp [2007-07-05 15:53:54] [400 javajni.c] [debug] Jvm Option[4] -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager [2007-07-05 15:53:54] [400 javajni.c] [debug] Jvm Option[5] -Djava.util.logging.config.file=C:\Program Files\Apache Software Foundation\Tomcat 5.5\conf\logging.properties [2007-07-05 15:53:54] [400 javajni.c] [debug] Jvm Option[6] -Djava.class.path=C:\Program Files\Apache Software Foundation\Tomcat 5.5\bin\bootstrap.jar [2007-07-05 15:53:54] [400 javajni.c] [debug] Jvm Option[7] vfprintf [2007-07-05 15:53:54] [info] Error occurred during initialization of VM [2007-07-05 15:53:54] [info] java/lang/NoClassDefFoundError [2007-07-05 15:53:54] [info] : java/lang/Object I'm assuming it's a class path issue but being new to the world of Java, I'm not sure what could be missing out of a basic installation. I have performed some Google searches and even searched through some of the archives but was unable to find anything specific to this situation. Any pointers or a push in the right direction would be greatly appreciated. FYI - Even at the Windows command prompt, if I type java -version I receive this error: Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object Same error, different cause so I'm not completely sure if this is even related to the Tomcat installation, rather possibly some odd situation that was encountered when the JDK was installed. Thanks, Tony This Email has been scanned for all viruses by PAETEC Email Scanning Services, utilizing MessageLabs proprietary SkyScan infrastructure. For more information on a proactive anti-virus service working around the clock, around the globe, visit http://www.paetec.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: Error starting Tomcat 5.5 as a Windows service
Make sure you have CATALINA_HOME pointed to your tomcat instance. make sure your java home is correct.. It sounds like it can't find the java home.. You did boot after the install right? If you added that environment variable to the system section, you'll need to boot to pick it up or open a new cmd prompt to re-read the environment. On 7/5/07, Tony Fountain [EMAIL PROTECTED] wrote: Hi, I am attempting to install Tomcat 5.5.23 as a Windows service on a Windows 2003 Server box. The steps I went through are as follows * Installed the JDK 1.5 Update 12 * Manually added the environment variable JAVA_HOME to C:\Program Files\Java\jdk1.5.0_12 (as a system variable, not user level) * Ran the windows installer package and selected the full install option. At this point I expected to be able to test the service can start and serve requests using examples installed with the installation but I am unable to. Anytime I try to start the Windows service the following error is logged: [2007-07-05 15:53:54] [1276 prunsrv.c] [debug] Procrun log initialized [2007-07-05 15:53:54] [info] Running Service... [2007-07-05 15:53:54] [1098 prunsrv.c] [debug] Inside ServiceMain... [2007-07-05 15:53:54] [info] Starting service... [2007-07-05 15:53:54] [400 javajni.c] [debug] Jvm Option[0] -Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 5.5 [2007-07-05 15:53:54] [400 javajni.c] [debug] Jvm Option[1] -Dcatalina.base=C:\Program Files\Apache Software Foundation\Tomcat 5.5 [2007-07-05 15:53:54] [400 javajni.c] [debug] Jvm Option[2] -Djava.endorsed.dirs=C:\Program Files\Apache Software Foundation\Tomcat 5.5\common\endorsed [2007-07-05 15:53:54] [400 javajni.c] [debug] Jvm Option[3] -Djava.io.tmpdir=C:\Program Files\Apache Software Foundation\Tomcat 5.5\temp [2007-07-05 15:53:54] [400 javajni.c] [debug] Jvm Option[4] -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager [2007-07-05 15:53:54] [400 javajni.c] [debug] Jvm Option[5] -Djava.util.logging.config.file=C:\Program Files\Apache Software Foundation\Tomcat 5.5\conf\logging.properties [2007-07-05 15:53:54] [400 javajni.c] [debug] Jvm Option[6] -Djava.class.path=C:\Program Files\Apache Software Foundation\Tomcat 5.5\bin\bootstrap.jar [2007-07-05 15:53:54] [400 javajni.c] [debug] Jvm Option[7] vfprintf [2007-07-05 15:53:54] [info] Error occurred during initialization of VM [2007-07-05 15:53:54] [info] java/lang/NoClassDefFoundError [2007-07-05 15:53:54] [info] : java/lang/Object I'm assuming it's a class path issue but being new to the world of Java, I'm not sure what could be missing out of a basic installation. I have performed some Google searches and even searched through some of the archives but was unable to find anything specific to this situation. Any pointers or a push in the right direction would be greatly appreciated. FYI - Even at the Windows command prompt, if I type java -version I receive this error: Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object Same error, different cause so I'm not completely sure if this is even related to the Tomcat installation, rather possibly some odd situation that was encountered when the JDK was installed. Thanks, Tony
Re: Tomcat stopped logging
My fault, I assumed you were on solaris. That is odd. Is there any stack traces in the localhost log? On 5/29/07, Propes, Barry L [EMAIL PROTECTED] wrote: yeah, I didn't think there was, or that I'd had trouble with the number of files in the directory before. Would seem absurd. Might be on a different OS that Windows is picky that way. -Original Message- From: David kerber [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 29, 2007 1:00 PM To: Tomcat Users List Subject: Re: Tomcat stopped logging Propes, Barry L wrote: I'm not even close to that! I'm at about 4.7 MB! For the logs anyway...isn't that the directory to which you're referring? But one thing I do wonder about...seems as if someone had told me one time there was a finite amount of folders or items that could be in a Windows directory, like 256 for example. I currently have 253, but I haven't encountered this problem since a few weeks back. If there is a limit (and I don't think there is except for the root directory), it's huge; I have several NTFS directories with tens of thousands of files in them. d I did go ahead and zip up a bunch of old log files, but I don't think it was too big of an issue at the time. -Original Message- From: Daniel Stephens [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 29, 2007 12:17 PM To: Tomcat Users List Subject: Re: Tomcat stopped logging I can't remember off the top of my head but I think there is a 2GB limit(OS Level). but I'd have to try and find that, to be totally sure. On 5/29/07, Propes, Barry L [EMAIL PROTECTED] wrote: yeah, it did one day. It had logged up until about 11:45am one day, and then inexplicably stopped. Not sure why, because more errors did occur. I had a few logs, with one being catalina_log (prefix), the other being localhost_admin_log, another being localhost_DBTest_log, which catches most of my errors and then localhost_log. All of course stapled with a datestamp. -Original Message- From: Daniel Stephens [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 29, 2007 9:02 AM To: Tomcat Users List Subject: Re: Tomcat stopped logging apologize for coming in late if this was resolved... Are you saying Tomcat just stop's logging to the catalina.out? On 5/9/07, Propes, Barry L [EMAIL PROTECTED] wrote: Hello, I have a strange situation. Tomcat has stopped logging today on my prod. server. Not sure why. All of the app seems to be working just fine, but the key log file stopped generating new info. I have a scheduled task stop and restart Tomcat every morning around 6am, so as to dump bad threads if there are any. Usually it resumes just fine. Any idea as to why this would occur? Thanks! - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - 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 Connection pool
Yes post your web.xml where with your resource-ref tags. Looks like a typo in there. On 5/29/07, Ligade, Shailesh (Contr) (Mission Systems) [EMAIL PROTECTED] wrote: Greetings, I am running Tomcat 5.x, and I have many webapps deployed and working under tomcat. I want my connection pool to be used from any application. When I modify server.xml in conf directory to add my connection, listed below: Server port=8010 shutdown=SHUTDOWN Listener className=org.apache.catalina.mbeans.ServerLifecycleListener debug=0/ Listener className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener debug=0/ GlobalNamingResources Resource name=jdbc/orcl scope=Shareable auth=Container type=javax.sql.DataSource description=Employees Database for HR Applications/ ResourceParams name=jdbc/orcl parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter namedriverClassName/name valueoracle.jdbc.driver.OracleDriver/value /parameter parameter nameurl/name valuejdbc:oracle:thin:@158.114.68.201:1521:CSAPPDB/value /parameter parameter nameusername/name valueROAM_USER/value /parameter parameter namepassword/name valuengit1234/value /parameter . /ResourceParams /GlobalNamingResources Service name=Collaboration-Standalone Connector protocol=HTTP/1.1 enableLookups=true redirectPort=8443 acceptCount=100 connectionTimeout=2 disableUploadTimeout=true URIEncoding=UTF-8/ Connector protocol=AJP/1.3 port=8009 minProcessors=50 maxProcessors=150 enableLookups=true redirectPort=8443 acceptCount=130 URIEncoding=UTF-8/ Engine name=Standalone defaultHost=localhost debug=8 !-- uncomment to dump HTTP requests received Valve className=org.apache.catalina.valves.RequestDumperValve/ -- Host name=localhost appBase=webapps unpackWARs=true autoDeploy=true Valve className=org.apache.catalina.valves.AccessLogValve directory=log prefix=localhost_access_log. suffix=.txt pattern=common resolveHosts=false/ Context path= docBase=../WWW crossContext=true override=true debug=5 reloadable=true ResourceLink name=jdbc/orcl global=jdbc/orcl auth=Container type=javax.sql.DataSource/ /Context /Host /Engine /Service /Server And I get following error: javax.naming.NameNotFoundException: Name jdbc is not bound in this Context [May 29, 2007 7:47:06 AM (http-80-Processor4_214)]: at org.apache.naming.NamingContext.lookup(NamingContext.java:769) [May 29, 2007 7:47:06 AM (http-80-Processor4_214)]: at org.apache.naming.NamingContext.lookup(NamingContext.java:152) [May 29, 2007 7:47:06 AM (http-80-Processor4_214)]: at com.intraspect.reports.CustomerReport.getVBCSDBConnection(Unknown Source) [May 29, 2007 7:47:06 AM (http-80-Processor4_214)]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [May 29, 2007 7:47:06 AM (http-80-Processor4_214)]: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav a:39) [May 29, 2007 7:47:06 AM (http-80-Processor4_214)]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl.java:25) [May 29, 2007 7:47:06 AM (http-80-Processor4_214)]: at java.lang.reflect.Method.invoke(Method.java:585) Any idea, what I am doing wrong? - 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 stopped logging
apologize for coming in late if this was resolved... Are you saying Tomcat just stop's logging to the catalina.out? On 5/9/07, Propes, Barry L [EMAIL PROTECTED] wrote: Hello, I have a strange situation. Tomcat has stopped logging today on my prod. server. Not sure why. All of the app seems to be working just fine, but the key log file stopped generating new info. I have a scheduled task stop and restart Tomcat every morning around 6am, so as to dump bad threads if there are any. Usually it resumes just fine. Any idea as to why this would occur? Thanks!
Re: Tomcat stopped logging
I can't remember off the top of my head but I think there is a 2GB limit(OS Level). but I'd have to try and find that, to be totally sure. On 5/29/07, Propes, Barry L [EMAIL PROTECTED] wrote: yeah, it did one day. It had logged up until about 11:45am one day, and then inexplicably stopped. Not sure why, because more errors did occur. I had a few logs, with one being catalina_log (prefix), the other being localhost_admin_log, another being localhost_DBTest_log, which catches most of my errors and then localhost_log. All of course stapled with a datestamp. -Original Message- From: Daniel Stephens [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 29, 2007 9:02 AM To: Tomcat Users List Subject: Re: Tomcat stopped logging apologize for coming in late if this was resolved... Are you saying Tomcat just stop's logging to the catalina.out? On 5/9/07, Propes, Barry L [EMAIL PROTECTED] wrote: Hello, I have a strange situation. Tomcat has stopped logging today on my prod. server. Not sure why. All of the app seems to be working just fine, but the key log file stopped generating new info. I have a scheduled task stop and restart Tomcat every morning around 6am, so as to dump bad threads if there are any. Usually it resumes just fine. Any idea as to why this would occur? Thanks! - 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 Datbase Connection Pooling
it also contributes to the other parameters like removeAbandoned, etc.. If I remember right when the validation Query runs the evictor thread gets called and then abandoned connections are relieved.They all kinda work together. On 4/13/07, Venky Vasant [EMAIL PROTECTED] wrote: Thanks i had checked the document, i was specifically looking at the Validation query at an abstract database going down, network going down should need validation query to check if the connection object still good What might be other scenarios if any where a validation query is needed Regards Venkat - Original Message From: Rashmi Rubdi [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Wednesday, April 11, 2007 5:55:36 PM Subject: Re: Tomcat Datbase Connection Pooling Did you check this document? http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html There are some very good suggestions under: Preventing dB connection pool leaks Common Problems Also see: http://jakarta.apache.org/commons/dbcp/configuration.html -Rashmi - To start a new topic, 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
Re: connection pool
sorry if someone has already mentioned this, but you will probably have to add the testOnborrow Parameter. So that also means you have to use the ValidationQuery, etc... but it(the pool) should try to restablish a connection at that point. testOnBorrow will cause some more overhead, but it might resolve your problem. here's an example.. parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter namedriverClassName/name valueoracle.jdbc.driver.OracleDriver/value /parameter parameter nameurl/name valuejdbc:oracle:thin:@host:port:sid/value /parameter parameter nameusername/name valuejohn/value /parameter parameter namepassword/name valuedoe/value /parameter parameter namemaxActive/name value5/value /parameter parameter namemaxIdle/name value5/value /parameter parameter namemaxWait/name value-1/value /parameter parameter nameremoveAbandoned/name valuetrue/value /parameter parameter namevalidationQuery/name valueselect count(*) from dual/value /parameter parameter nametestOnBorrow/name valuetrue/value /parameter On 3/19/07, Gioia, Michael [EMAIL PROTECTED] wrote: Hi, I'm new to tomcat and have a problem with keeping up the connection to the database thru the connection pool. Almost every weekend the database gets bumped and the java app that were running needs to have tomcat restarted to reconnect to the database thru the connection pool. When we come in on Monday tomcat and the database are up and running, but the app will not connect to the database. Is there a way to reestablish the connection so our users don't have to wait until we come in on Monday to restart tomcat? Many Thanks, MG
Re: [OT] log4j, fileappender, owner, group, and umask
Ok cool.. I just had a round with our umask and groups being setup incorrectly. just a mess. On 3/6/07, stevethames [EMAIL PROTECTED] wrote: Thanks for the input, Dan. Actually, I am aware of how permissions. The question is how to set permissions, owner, group on a log file created by FileAppender when it actually creates the log file. For the moment, I have solved the problem by using a separate log file for tomcat. Daniel Stephens wrote: If they are all the same group, then I would suggest just setting the umask to 022 or 027.. But let me say I'm not a Unix admin and I'm not a 100% sure of all the down falls here. I do know that 022 will work I've done some things with my source code, and others in my group not able to write to it, but they needed to. I'm attaching this link, so you can check out some of that settings. Sorry if your already familiar with these Admin concepts.. http://snap.nlc.dcccd.edu/reference/sysadmin/julian/ch18/395-398.html On 3/2/07, stevethames [EMAIL PROTECTED] wrote: Hi Dan. Thanks for responding. Yes, that's true, the file is owned by the tomcat user. My mod_perl stuff runs under apache (the httpd user) and I have some Perl daemons that run as root. In Perl, using log4perl, I can set the owner, group, and umask of the log file for file creation. I have a reason for keeping the user IDs (apache, tomcat, root) as they are. So, what I've done is made them all part of the same group. Its the group and group permissions I need to set on the log file using FileAppender. Any thoughts? Daniel Stephens wrote: I would think if your using Tomcat as the Servlet container, The file itself would be owned by the account running Tomcat. Is this not the case? On 3/2/07, stevethames [EMAIL PROTECTED] wrote: I am using tomcat as a servlet server used by a mod_perl application running under apache. I have setup log4j and log4perl to that both tomcat and the Perl app can use the same log files. This all works fine. The problem I'm having is when tomcat creates the log file. Does anyone know how to set the log file owner, group, and permissions when FileAppender creates the log file? -- View this message in context: http://www.nabble.com/log4j%2C-fileappender%2C-owner%2C-group%2C-and-umask-tf3334405.html#a9272184 Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/log4j%2C-fileappender%2C-owner%2C-group%2C-and-umask-tf3334405.html#a9274733 Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/log4j%2C-fileappender%2C-owner%2C-group%2C-and-umask-tf3334405.html#a9335296 Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: SQLNestedException
1st. verifiy that the driver you need is in the Tomcat common lib. 2nd. verify your config in your server.xml and make sure your character case is correct. 3rd, double check your web.xml or context.xml to make sure your referencing your DataSource correctly, and finally post this and your class(or JSP ) code that is trying to get the connection. sounds like a configuration issue from this. On 3/4/07, Wojtek Kusch [EMAIL PROTECTED] wrote: Hi! I have a JSP-App and need a database connection (to the MS Access database unleashed). But, I get following exception: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' This is the context in conf\Catalina\localhost --- Context debug=1 reloadable=true Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_unleashed_ suffix=.log timestamp=false/ Resource name=jdbc/unleashed auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/unleashed parameter namedriverClassName/name valuesun.jdbc.odbc.JdbcOdbcDriver/value /parameter parameter nameurl/name valuejdbc:odbc:unleashed/value /parameter /ResourceParams /Context --- What's wrong? Thanks for help! Wojtek Kusch - 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: log4j, fileappender, owner, group, and umask
I would think if your using Tomcat as the Servlet container, The file itself would be owned by the account running Tomcat. Is this not the case? On 3/2/07, stevethames [EMAIL PROTECTED] wrote: I am using tomcat as a servlet server used by a mod_perl application running under apache. I have setup log4j and log4perl to that both tomcat and the Perl app can use the same log files. This all works fine. The problem I'm having is when tomcat creates the log file. Does anyone know how to set the log file owner, group, and permissions when FileAppender creates the log file? -- View this message in context: http://www.nabble.com/log4j%2C-fileappender%2C-owner%2C-group%2C-and-umask-tf3334405.html#a9272184 Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat Persistent Session Issues
Where is this class com.formos.toolkit.data.IPersis located? Is it in the WEB-INF/classes directory? or in a JAR? I guess I would want to first make sure the webapp classloaded loaded it up first. On 3/1/07, ddigmann [EMAIL PROTECTED] wrote: A note before I start: I have found quite a few people out there asking about this same question but have not found my solution. This might mean I have trouble with finding the correct search terms or something entirely different. The ultimate issue is that from time to time Tomcat (we are using v 5.0.28 ) throws an exception while starting which we think causes sessions to be lost for our various users every time we research Tomcat. This is an issue since we would like the users to not loose data and be required to restart whenever we need to restart the system. The exception is as follows: INFO: Starting Servlet Engine: Apache Tomcat/5.0.28 Mar 1, 2007 4:35:23 PM org.apache.catalina.core.StandardHost start INFO: XML validation disabled Mar 1, 2007 4:35:24 PM org.apache.catalina.session.StandardManager doLoad SEVERE: ClassNotFoundException while loading persisted sessions: java.lang.ClassNotFoundException: com.formos.toolkit.data.IPersistentDO java.lang.ClassNotFoundException: com.formos.toolkit.data.IPersistentDO at org.apache.catalina.loader.StandardClassLoader.loadClass( StandardClassLoader.java:854) at org.apache.catalina.loader.StandardClassLoader.loadClass( StandardClassLoader.java:721) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:242) at java.io.ObjectInputStream.resolveProxyClass(ObjectInputStream.java:646) at java.io.ObjectInputStream.readProxyDesc(ObjectInputStream.java:1494) at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1457) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1693) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1912) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1836) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1713) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299) at java.io.ObjectInputStream.readObject(ObjectInputStream.java :339) at org.apache.catalina.session.StandardSession.readObject( StandardSession.java:1342) at org.apache.catalina.session.StandardSession.readObjectData( StandardSession.java:885) at org.apache.catalina.session.StandardManager.doLoad(StandardManager.java :416) at org.apache.catalina.session.StandardManager.load(StandardManager.java:343) at org.apache.catalina.session.StandardManager.start(StandardManager.java :657) at org.apache.catalina.core.ContainerBase.setManager(ContainerBase.java:499) at org.apache.catalina.startup.ContextConfig.managerConfig(ContextConfig.java :315) at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:635) at org.apache.catalina.startup.ContextConfig.lifecycleEvent( ContextConfig.java:216) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent( LifecycleSupport.java:119) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4290) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083) at org.apache.catalina.core.StandardHost.start(StandardHost.java:789) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478) at org.apache.catalina.core.StandardService.start(StandardService.java:480) at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313) at org.apache.catalina.startup.Catalina.start(Catalina.java:556) 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:287) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425) Mar 1, 2007 4:35:25 PM org.apache.catalina.session.StandardManager start SEVERE: Exception loading sessions from persistent storage java.lang.ClassNotFoundException: com.formos.toolkit.data.IPersistentDO at org.apache.catalina.loader.StandardClassLoader.loadClass( StandardClassLoader.java:854) at org.apache.catalina.loader.StandardClassLoader.loadClass( StandardClassLoader.java:721) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at
Re: connection pool - DBCP error
Thats purely informational. On 2/27/07, Tim Lucia [EMAIL PROTECTED] wrote: -Original Message- From: Propes, Barry L [GCG-NAOT] [mailto:[EMAIL PROTECTED] Sent: Monday, February 26, 2007 4:48 PM To: Tomcat Users List Subject: connection pool - DBCP error AbandonedObjectPool is used ( [EMAIL PROTECTED]) LogAbandoned: true RemoveAbandoned: true RemoveAbandonedTimeout: 60 Isn't this just an informational message saying that abandoned objects will be detected? It appears on startup when I configure DBCP to evict abandoned connections... Tim - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]