Where to beging with secure mail
Can anyone tell me how to get my app, which uses java mail to get a secure session with my smtp resource as defined in my context file. Resource name=mail/Session auth=Container type=javax.mail.Session/ ResourceParams name=mail/Session parameternamemail.smtp.host/name value192.168.100.24/value/parameter parameternamemail.smtp.socketFactory.class/name valuejavax.net.ssl.SSLSocketFactory/value/parameter parameternamemail.smtp.socketFactory.fallback/name valuefalse/value/parameter parameternamemail.smtp.socketFactory.port/name value465/value/parameter /ResourceParams I get an error that my smtp is not communicating via SSL. Its an IIS box, but ill also need to do this on linux running sendmail in the near future. What I dont understand is the key generation process and how to configure ssl on the mail side. Any help or ref docs would be a great help. THanks -B
RE: Tomcat 5.5 and SQL Server
I also had the same problem with that driver. JTDS is a much much better driver. Also look at your connection pooling software, using the commons DBCP is also a little shady. I switched to c3p0 and all the connection problems disappeared. Furthermore with c3p0 when the sql server reboots c3p0 is smart enough to reestablish connections. -B -Original Message- From: Woodchuck [mailto:[EMAIL PROTECTED] Sent: Monday, July 11, 2005 1:23 PM To: Tomcat Users List Subject: Re: Tomcat 5.5 and SQL Server also, make sure your SQL Server is patched up with the latest SQL Server service pack. woodchuck --- Tim Funk [EMAIL PROTECTED] wrote: FWIW .. there is a new version of the SQLServer JDBC driver from Microsoft. -Tim Mitchell Teixeira wrote: Hi - I've heard nothing but bad things about the Microsoft JDBC driver for SQL Server. I don't have any suggestions how to fix your problem in-place, just a suggestion to switch drivers. I've been using this JTDS open souce JDBC driver, suggested by our vendor and it is very stable: http://jtds.sourceforge.net/ It was super easy to install and configure. I hope it will help you! Regards, MitchellT --- Anderson, M. Paul [EMAIL PROTECTED] wrote: I am running Tomcat 5.5 with SQL Server on a separate machine. I am getting the following error at random times: Java.lang.Exception: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Connection rest by peer: socket write error. I have been unable to determine a trigger for this error - it just seems to happen randomly. When it occurs, no user can then log in to the application - I must reboot the SQL server machine to get a connection to be made for subsequent logins. Has anyone seen this and can point me to a solution? Thanks, Paul - 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] Sell on Yahoo! Auctions - no fees. Bid on great items. http://auctions.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Turning off port 8080 but still need to access to admin pages
You could leave 8080 on .. But restrict access to it via firewall. -Original Message- From: Scott Heitkamp [mailto:[EMAIL PROTECTED] Sent: Thursday, June 09, 2005 4:32 PM To: tomcat-user@jakarta.apache.org Subject: Turning off port 8080 but still need to access to admin pages I need to turn off port 8080, so that you can only access Tomcat by going through port 8009 using Apache. Once I turn off port 8080, I no longer have a way of getting to the admin pages for Tomcat. Is there a way around this? - Discover Yahoo! Find restaurants, movies, travel more fun for the weekend. Check it out! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How do I change the error page being served while tomcat is starting up?
From what it sounds like you have apache running as a proxy to tomcat. If thats the case, Add the following to your apache config file httpd.conf change ErrorDocument 503 /your_file.html ErrorDocument 200 /your_file.html -B -Original Message- From: j r [mailto:[EMAIL PROTECTED] Sent: Monday, June 06, 2005 5:40 PM To: tomcat-user@jakarta.apache.org Subject: How do I change the error page being served while tomcat is starting up? When I start tomcat, it takes approximately 1 minute to complete its startup process. If apache is up during that period, the following page gets served: Service Temporarily Unavailable The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later. Apache Server at server name Port 80 For obvious reasons, I removed the server name and apache version. I do not want either of these displayed to the customer. How can I changed those? I have tried to put the following in web.xml to no avail: error-page error-code404/error-code location/errors/joey.html/location /error-page error-page error-code500/error-code location/errors/joey.html/location /error-page Any Ideas? -jr - 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]
Beginner Load Balancing w/ apache
Hi , Im hoping someone can give me some pretty detailed instructions on how to load balance 2 tomcat servers with 1 apache web server in front. I wanted to use mod_jk. First question, is , is this the best way to load balance? Second question. Where do i start. Im having trouble finding clear instrcution on how to get mod_jk working with apache. Can anyone help? I know tomcat pretty well, but am new to load balancing with apache, so the more detail the better.. thanks -B
Getting Tomcat to start my connection pool on startup.
Can anyone tell me how to get tomcat to see my connection pool (DBCP) when tomcat starts? I'm running struts if that helps. I have a Jndi resource set up that i can call from my code. But the pool starts the first time i ask for a connection from the factory. I'd rather it start on startup. Can someone help and excuse the newbie question. Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE:[RESOLVED] log4j.properties not found in tomcat
Thanks for the repliess. My issue was that I needed to set a system wide environment variable called log4j.configuration and set its value to log4j.properties, the name of my config file for log4j. This was in the log4j documentation but I guess i skimmed over that part. Log4j is a application completely separate from web container, hence the need for a system wide var. Definately liking log4j more and more. My file was located in my /webapps/myappuri/WEB-INF/classes/ So the answer turns out that log4j looks for a system env var log4j.configuration and looks in your webapps class path for it. Additionally I set up tomcat to use my log4j file as well by makin a file called commons-logging.properties in /webapps/myappuri/WEB-INF/classes/ whos only line was: org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger Note that commons-logging.jar needs to be in your /webapps/myappuri/WEB-INF/lib/ dir for this to work. Thanks -B -Original Message- From: Jacob Kjome [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 22, 2005 12:30 AM To: Tomcat Users List Subject: Re: log4j.properties not found in tomcat You have to understand that any relative path is going to be resolved relative to the location where the JVM started. If you started Tomcat via the service rather than the batch files, then the VM would be run, by default, from C:\winnt\System32. So, when you supplied -Dlog4j.configuration=log4j.properties, you got exactly what should be expected if log4j.properties were located in c:\winnt\System32. Same goes for relatively defined paths to log files defined for FileAppenders in log4j.properties. BTW, can you post your error? FileNotFoundExceptions aren't thrown when Log4j can't find its config file. You'd get a simple error saying as much. The FileNotFoundExceptions are usually thrown when you specify a file for a FileAppender in a directory that doesn't exist. Log4j makes no attempt to create directories if they don't exist already. This is the correct and safe thing to do. It is your responsibility to make sure the directory exists before Log4j attempts to use it. Jake At 11:09 PM 2/21/2005 -0500, you wrote: Where do you put log4j.properties currently? -Michael Greer On Feb 21, 2005, at 5:02 PM, Brian McGovern wrote: I have a wierd problem. Tomcat on W2k barks FileNotFound Exceptions for the log4j.properties file when i execute a servlet that instantiates log4j. Strangely enough the actual file that i create and log to with log4j.properties file logs out just fine even though stdout.log said that it couldn't find my log4j.properties file. Only time i don't get an error is when i put log4j.properites in my winnt/system32 directory. But this doesnt make sense to me. I supply -Dlog4j.configuration=log4j.properties to Java at startup and still get the same error. I also tried the FULL path to my log4j.properties in the -D option. Instantiated like this across my app. private static final Logger zLogger = Logger.getLogger(MyClassName.class); Can anyone tell me where I went wrong. thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [RESOLVED] log4j.properties not found in tomcat
(Http11Processor.java:799) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683) at java.lang.Thread.run(Unknown Source) log4j:ERROR Ignoring configuration file [log4j.properties]. AbandonedObjectPool is used ([EMAIL PROTECTED]) LogAbandoned: true RemoveAbandoned: true RemoveAbandonedTimeout: 60 -Original Message- From: Brian McGovern [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 22, 2005 8:24 AM To: Tomcat Users List Subject: RE:[RESOLVED] log4j.properties not found in tomcat Thanks for the repliess. My issue was that I needed to set a system wide environment variable called log4j.configuration and set its value to log4j.properties, the name of my config file for log4j. This was in the log4j documentation but I guess i skimmed over that part. Log4j is a application completely separate from web container, hence the need for a system wide var. Definately liking log4j more and more. My file was located in my /webapps/myappuri/WEB-INF/classes/ So the answer turns out that log4j looks for a system env var log4j.configuration and looks in your webapps class path for it. Additionally I set up tomcat to use my log4j file as well by makin a file called commons-logging.properties in /webapps/myappuri/WEB-INF/classes/ whos only line was: org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger Note that commons-logging.jar needs to be in your /webapps/myappuri/WEB-INF/lib/ dir for this to work. Thanks -B -Original Message- From: Jacob Kjome [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 22, 2005 12:30 AM To: Tomcat Users List Subject: Re: log4j.properties not found in tomcat You have to understand that any relative path is going to be resolved relative to the location where the JVM started. If you started Tomcat via the service rather than the batch files, then the VM would be run, by default, from C:\winnt\System32. So, when you supplied -Dlog4j.configuration=log4j.properties, you got exactly what should be expected if log4j.properties were located in c:\winnt\System32. Same goes for relatively defined paths to log files defined for FileAppenders in log4j.properties. BTW, can you post your error? FileNotFoundExceptions aren't thrown when Log4j can't find its config file. You'd get a simple error saying as much. The FileNotFoundExceptions are usually thrown when you specify a file for a FileAppender in a directory that doesn't exist. Log4j makes no attempt to create directories if they don't exist already. This is the correct and safe thing to do. It is your responsibility to make sure the directory exists before Log4j attempts to use it. Jake At 11:09 PM 2/21/2005 -0500, you wrote: Where do you put log4j.properties currently? -Michael Greer On Feb 21, 2005, at 5:02 PM, Brian McGovern wrote: I have a wierd problem. Tomcat on W2k barks FileNotFound Exceptions for the log4j.properties file when i execute a servlet that instantiates log4j. Strangely enough the actual file that i create and log to with log4j.properties file logs out just fine even though stdout.log said that it couldn't find my log4j.properties file. Only time i don't get an error is when i put log4j.properites in my winnt/system32 directory. But this doesnt make sense to me. I supply -Dlog4j.configuration=log4j.properties to Java at startup and still get the same error. I also tried the FULL path to my log4j.properties in the -D option. Instantiated like this across my app. private static final Logger zLogger = Logger.getLogger(MyClassName.class); Can anyone tell me where I went wrong. thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [RESOLVED] log4j.properties not found in tomcat
Then theres something else going on. I didnt set log4j.configuration when i started, i just had my log4j.jar in my WEB-INF/lib/ and my log4j.properties in my /WEB-INF/classes/ However i still got that file not found exception. I think its gotta either the way im calling it or the properties file itself. I say this because ive now tried on 2 machines 2 OS's and same thing happened. It MAKES me define a system wide log4j.configuration. This cannot be right. Makes the whole use of log4j pointless and non portable. At any rate, ive got that wacky system-wide var defined and it supresses errors, just doesnt work the way i want. Calling like this: private static final Logger zLogger = Logger.getLogger(RepsMainController.class); zLogger.debug(something logged here); log4j.properties like this: log4j.rootLogger=DEBUG, nycbbuilderlog log4j.appender.nycbbuilderlog=org.apache.log4j.RollingFileAppender log4j.appender.nycbbuilderlog.File=${catalina.home}/logs/catalina.out log4j.appender.nycbbuilderlog.MaxFileSize=1KB log4j.appender.nycbbuilderlog.MaxBackupIndex=2 log4j.appender.nycbbuilderlog.layout=org.apache.log4j.PatternLayout log4j.appender.nycbbuilderlog.layout.ConversionPattern=%5p [EMAIL PROTECTED]:mm:ss,SSS}] - %m%n -Original Message- From: Jacob Kjome [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 22, 2005 3:01 PM To: Tomcat Users List Subject: RE:[RESOLVED] log4j.properties not found in tomcat Quoting Brian McGovern [EMAIL PROTECTED]: Thanks for the repliess. My issue was that I needed to set a system wide environment variable called log4j.configuration and set its value to log4j.properties, the name of my config file for log4j. This was in the log4j documentation but I guess i skimmed over that part. Log4j is a application completely separate from web container, hence the need for a system wide var. Definately liking log4j more and more. My file was located in my /webapps/myappuri/WEB-INF/classes/ So the answer turns out that log4j looks for a system env var log4j.configuration and looks in your webapps class path for it. No, I'm pretty sure this is not the case. log4j.configuration does not need to be specified. If it is, I believe it is assumed to be a file location. If relatively defined, it is resolved relative to the location that the JVM started. If not defined, Log4j looks in the classloader. Actually, I haven't checked, but it may fall back to the classloader if it can't find the log4j config file in the location specified by the system property. You'll have to verify that. Additionally I set up tomcat to use my log4j file as well by makin a file called commons-logging.properties in /webapps/myappuri/WEB-INF/classes/ whos only line was: org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger Note that commons-logging.jar needs to be in your /webapps/myappuri/WEB-INF/lib/ dir for this to work. If you want Log4j to be a system-wide service, you should really add log4j.jar and commons-logging.jar to CATALINA_HOME/common/lib and add log4j.properties to CATALINA_HOME/common/classes. There is no need for the commons-logging.properties file in that case. And it is kludgy to provide server-level properties inside a webapp. BTW, do you have log4j.jar in your WEB-INF/lib? If so, you are simply logging for your webapp alone, not system-wide. Jake Thanks -B -Original Message- From: Jacob Kjome [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 22, 2005 12:30 AM To: Tomcat Users List Subject: Re: log4j.properties not found in tomcat You have to understand that any relative path is going to be resolved relative to the location where the JVM started. If you started Tomcat via the service rather than the batch files, then the VM would be run, by default, from C:\winnt\System32. So, when you supplied -Dlog4j.configuration=log4j.properties, you got exactly what should be expected if log4j.properties were located in c:\winnt\System32. Same goes for relatively defined paths to log files defined for FileAppenders in log4j.properties. BTW, can you post your error? FileNotFoundExceptions aren't thrown when Log4j can't find its config file. You'd get a simple error saying as much. The FileNotFoundExceptions are usually thrown when you specify a file for a FileAppender in a directory that doesn't exist. Log4j makes no attempt to create directories if they don't exist already. This is the correct and safe thing to do. It is your responsibility to make sure the directory exists before Log4j attempts to use it. Jake At 11:09 PM 2/21/2005 -0500, you wrote: Where do you put log4j.properties currently? -Michael Greer On Feb 21, 2005, at 5:02 PM, Brian McGovern wrote: I have a wierd problem. Tomcat on W2k barks FileNotFound Exceptions for the log4j.properties file when i execute a servlet that instantiates log4j. Strangely enough the actual file that i
log4j.properties not found in tomcat
I have a wierd problem. Tomcat on W2k barks FileNotFound Exceptions for the log4j.properties file when i execute a servlet that instantiates log4j. Strangely enough the actual file that i create and log to with log4j.properties file logs out just fine even though stdout.log said that it couldn't find my log4j.properties file. Only time i don't get an error is when i put log4j.properites in my winnt/system32 directory. But this doesnt make sense to me. I supply -Dlog4j.configuration=log4j.properties to Java at startup and still get the same error. I also tried the FULL path to my log4j.properties in the -D option. Instantiated like this across my app. private static final Logger zLogger = Logger.getLogger(MyClassName.class); Can anyone tell me where I went wrong. thanks
log4j in tomcat erroring -- dont know why
Hi. I've got tomcat up and running and have a log4j.properties file in my WEB-INF\classes directory. My servlets and jsps run fine. No errors. Stdout.log shows this on servlet execution and i have no idea why because the log4j log file is being populated just fine even though my stdout says its not. ANY ideas? thanks log4j:ERROR Could not read configuration file [log4j.properties]. java.io.FileNotFoundException: log4j.properties (The system cannot find the file specified) java.io.FileNotFoundException: log4j.properties (The system cannot find the file specified) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.init(FileInputStream.java:106) at java.io.FileInputStream.init(FileInputStream.java:66) at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:297) at org.apache.log4j.PropertyConfigurator.configure(PropertyConfigurator.java:315) at com.imediainc.nycballet.nycbbuilder.dataaccess.DBConnection.getConnection(Unknown Source) at com.imediainc.nycballet.nycbbuilder.dataaccess.NYCBData.getAllReps(Unknown Source) at com.imediainc.nycballet.nycbbuilder.control.RepsMainController.execute(Unknown Source) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:397) at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:704) at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:474) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:409) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312) at org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:670) at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:637) at org.apache.jsp.reps.index_jsp._jspService(index_jsp.java:43) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
RE: log4j in tomcat erroring -- dont know why
No Im not. I thought i didnt need to if i wanted to grab the root loggers props which look in WEB-INF/classes. And again, my log4j file as defined in my properties file is logging just fine. -B -Original Message- From: Edmon Begoli [mailto:[EMAIL PROTECTED] Sent: Friday, February 18, 2005 5:51 PM To: Tomcat Users List Subject: Re: log4j in tomcat erroring -- dont know why Brian, Are you calling PropertyConfigurator explicitly anywhere in your code? Brian McGovern wrote: Hi. I've got tomcat up and running and have a log4j.properties file in my WEB-INF\classes directory. My servlets and jsps run fine. No errors. Stdout.log shows this on servlet execution and i have no idea why because the log4j log file is being populated just fine even though my stdout says its not. ANY ideas? thanks log4j:ERROR Could not read configuration file [log4j.properties]. java.io.FileNotFoundException: log4j.properties (The system cannot find the file specified) java.io.FileNotFoundException: log4j.properties (The system cannot find the file specified) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.init(FileInputStream.java:106) at java.io.FileInputStream.init(FileInputStream.java:66) at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:297) at org.apache.log4j.PropertyConfigurator.configure(PropertyConfigurator.java:315) at com.imediainc.nycballet.nycbbuilder.dataaccess.DBConnection.getConnection(Unknown Source) at com.imediainc.nycballet.nycbbuilder.dataaccess.NYCBData.getAllReps(Unknown Source) at com.imediainc.nycballet.nycbbuilder.control.RepsMainController.execute(Unknown Source) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:397) at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:704) at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:474) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:409) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312) at org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:670) at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:637) at org.apache.jsp.reps.index_jsp._jspService(index_jsp.java:43) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Setting default tomcat logger 5.0.28
Im looking to do the exact same thing. I tried adding a file named commons-logging.properties to my classes directory that contains the following line. org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger This doesn't do what I read it would do. I still have output to stdout.log. - B -Original Message- From: Ian Wootten [mailto:[EMAIL PROTECTED] Sent: Thursday, February 17, 2005 11:38 AM To: Tomcat Users List Subject: Re: Setting default tomcat logger 5.0.28 I've managed to make some headway with this problem. I've moved my log4j.properties file over into the axis/web-inf/classes directory, and this catches all axis output, but what I want to know is how to direct all output to log4j. So, that initial startup stdout and stderr output to log4j. Is this possible? Thanks Ian Ian Wootten wrote: I'm having a right job trying to configure the default logger within tomcat. I want to use log4j and set it at a DEBUG level. I've added all the commons-logging.jar and log4j.jar packages to the classpath, but every time I declare the properties file I wish to use prior to these, it doesn't seem as if the log4j.properties file I want to be read is. The output remains the same. I've also tried to remedy this using the same method within the tomcatw.exe app, as I read that tomcat doesn't read the default CLASSPATH environment variables used by Windows XP and creates its own. This still yields no joy. Also with this app I have tried specifying the log4j.configuration=/file /property using the line -Dlog4j.configuration=C:\src\logging\log4jservice\log4j.properties under the java options. Still the file does not seem to be found. Currently my properties file lies in a different directory foo/bar/log4j.properties which I specify in the classpath, but as I say it doesn't seem to be picked up. I've even placed it under CATALINA_HOME/common/lib with the jar files in CATALINA_HOME/common/classes, under the reference of the Tomcat 5.5 version, hoping this might work..it doesn't. (Incidentally, I can't use Tomcat 5.5 due to restrictions on the software I'm going to generate). Log4J works fine standalone, I've built a number of apps with it, just not under tomcat it would seem. Can anyone make any suggestions? Thanks, Ian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: log4j best practices
Im not able to get the class name and line number spittin out in the logs for classes where i call the logger. But for jakarta, and struts classes I am. What am i doing wrong. In Class Named DBConnection: --private static final Logger zLogger = Logger.getLogger(DBConnection.class.getName()); log4j.properties file snippet: log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n The corresponding log: ERROR [http-8080-Processor25] (?:?) - org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory ([Microsoft][SQLServer 2000 Driver Where did i go wrong? -Original Message- From: Brian McGovern [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 16, 2005 4:57 PM To: Tomcat Users List Subject: RE: log4j best practices Oh man. they were in winnt system32 the whole time. UGH. You were right. Thanks Jake! -Original Message- From: Jacob Kjome [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 16, 2005 4:28 PM To: Tomcat Users List Subject: RE: log4j best practices Since you define your log files relatively, they will end up relative to the directory where the JVM was started from. I you use Tomcat scripts, then it will be in CATALINA_HOME/bin. If you use the Tomcat service, then the files will end up in c:\winnt\System32 (unless you changed the base directory from which the service starts the JVM. I suggest you use... log4j.appender.stdout.File=${catalina.home}/logs/catalina.out Tomcat creates the catalina.home system property at startup. You can use it to reference Tomcat's home directory and then put the file anywhere you want relative to that. Jake Quoting Brian McGovern [EMAIL PROTECTED]: Thats the same approach im using. I have a commons-logging.properties and a log4j.properties file in my WEB-INF\classes directory. But I only get the same loggin as before in stdout.log Im using Win2k as OS. Where do my defined log files go? Im confused. Everything compiles. I have this line in my classes: private static final Logger zLogger = Logger.getLogger(MYCLASSNAME.CLASS); Logging like this: zLogger.debug(New Session Was Created); commons-logging.properties file has 1 line. org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger log4j.properties file is here: log4j.rootLogger=DEBUG, stdout, nycbbuilder_log log4j.appender.stdout=org.apache.log4j.RollingFileAppender log4j.appender.stdout.File=catalina.out log4j.appender.stdout.MaxFileSize=100KB log4j.appender.stdout.MaxBackupIndex=2 log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n log4j.appender.nycbbuilder_log=org.apache.log4j.RollingFileAppender log4j.appender.nycbbuilder_log.File=nycbbuilder.log log4j.appender.nycbbuilder_log.MaxFileSize=100KB log4j.appender.nycbbuilder_log.MaxBackupIndex=2 log4j.appender.nycbbuilder_log.layout=org.apache.log4j.PatternLayout log4j.appender.nycbbuilder_log.layout.ConversionPattern=%d{ABSOLUTE} - %p %c - %m%n -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 16, 2005 1:52 PM To: Tomcat Users List Subject: Re: log4j best practices I just implemented this over the weekend. Still not totally sure what I am doing, but I do have all my classes outputting to a log file I have specified. I went with a simple approach creating a reference to a Logger object in each class (I have an external properties file supplying all the config options). My problem is everything ends up in one giant file and it is hard to interpret. I am now thinking about having each class create and configure a logger object and write to its own file. One log per class. The good thing is it is log4j is easy to set up and start logging with. Here is the tutorial I got started with: http://www.developer.com/open/article.php/10930_3097221_1 HTH Luke Hi everyone Im looking for some tips on implementing a logging system in tomcat. Ive got log4j installed and am about to write code but im just looking for some tips before i get started. My idea is to write a central logger class for my app that imports the log4j package and supplys static methods to my app but I don't know if thats a bad idea? thanks -B - 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
log4j best practices
Hi everyone Im looking for some tips on implementing a logging system in tomcat. Ive got log4j installed and am about to write code but im just looking for some tips before i get started. My idea is to write a central logger class for my app that imports the log4j package and supplys static methods to my app but I don't know if thats a bad idea? thanks -B
RE: log4j best practices
Thats the same approach im using. I have a commons-logging.properties and a log4j.properties file in my WEB-INF\classes directory. But I only get the same loggin as before in stdout.log Im using Win2k as OS. Where do my defined log files go? Im confused. Everything compiles. I have this line in my classes: private static final Logger zLogger = Logger.getLogger(MYCLASSNAME.CLASS); Logging like this: zLogger.debug(New Session Was Created); commons-logging.properties file has 1 line. org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger log4j.properties file is here: log4j.rootLogger=DEBUG, stdout, nycbbuilder_log log4j.appender.stdout=org.apache.log4j.RollingFileAppender log4j.appender.stdout.File=catalina.out log4j.appender.stdout.MaxFileSize=100KB log4j.appender.stdout.MaxBackupIndex=2 log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n log4j.appender.nycbbuilder_log=org.apache.log4j.RollingFileAppender log4j.appender.nycbbuilder_log.File=nycbbuilder.log log4j.appender.nycbbuilder_log.MaxFileSize=100KB log4j.appender.nycbbuilder_log.MaxBackupIndex=2 log4j.appender.nycbbuilder_log.layout=org.apache.log4j.PatternLayout log4j.appender.nycbbuilder_log.layout.ConversionPattern=%d{ABSOLUTE} - %p %c - %m%n -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 16, 2005 1:52 PM To: Tomcat Users List Subject: Re: log4j best practices I just implemented this over the weekend. Still not totally sure what I am doing, but I do have all my classes outputting to a log file I have specified. I went with a simple approach creating a reference to a Logger object in each class (I have an external properties file supplying all the config options). My problem is everything ends up in one giant file and it is hard to interpret. I am now thinking about having each class create and configure a logger object and write to its own file. One log per class. The good thing is it is log4j is easy to set up and start logging with. Here is the tutorial I got started with: http://www.developer.com/open/article.php/10930_3097221_1 HTH Luke Hi everyone Im looking for some tips on implementing a logging system in tomcat. Ive got log4j installed and am about to write code but im just looking for some tips before i get started. My idea is to write a central logger class for my app that imports the log4j package and supplys static methods to my app but I don't know if thats a bad idea? thanks -B - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: log4j best practices
Oh man. they were in winnt system32 the whole time. UGH. You were right. Thanks Jake! -Original Message- From: Jacob Kjome [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 16, 2005 4:28 PM To: Tomcat Users List Subject: RE: log4j best practices Since you define your log files relatively, they will end up relative to the directory where the JVM was started from. I you use Tomcat scripts, then it will be in CATALINA_HOME/bin. If you use the Tomcat service, then the files will end up in c:\winnt\System32 (unless you changed the base directory from which the service starts the JVM. I suggest you use... log4j.appender.stdout.File=${catalina.home}/logs/catalina.out Tomcat creates the catalina.home system property at startup. You can use it to reference Tomcat's home directory and then put the file anywhere you want relative to that. Jake Quoting Brian McGovern [EMAIL PROTECTED]: Thats the same approach im using. I have a commons-logging.properties and a log4j.properties file in my WEB-INF\classes directory. But I only get the same loggin as before in stdout.log Im using Win2k as OS. Where do my defined log files go? Im confused. Everything compiles. I have this line in my classes: private static final Logger zLogger = Logger.getLogger(MYCLASSNAME.CLASS); Logging like this: zLogger.debug(New Session Was Created); commons-logging.properties file has 1 line. org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger log4j.properties file is here: log4j.rootLogger=DEBUG, stdout, nycbbuilder_log log4j.appender.stdout=org.apache.log4j.RollingFileAppender log4j.appender.stdout.File=catalina.out log4j.appender.stdout.MaxFileSize=100KB log4j.appender.stdout.MaxBackupIndex=2 log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n log4j.appender.nycbbuilder_log=org.apache.log4j.RollingFileAppender log4j.appender.nycbbuilder_log.File=nycbbuilder.log log4j.appender.nycbbuilder_log.MaxFileSize=100KB log4j.appender.nycbbuilder_log.MaxBackupIndex=2 log4j.appender.nycbbuilder_log.layout=org.apache.log4j.PatternLayout log4j.appender.nycbbuilder_log.layout.ConversionPattern=%d{ABSOLUTE} - %p %c - %m%n -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 16, 2005 1:52 PM To: Tomcat Users List Subject: Re: log4j best practices I just implemented this over the weekend. Still not totally sure what I am doing, but I do have all my classes outputting to a log file I have specified. I went with a simple approach creating a reference to a Logger object in each class (I have an external properties file supplying all the config options). My problem is everything ends up in one giant file and it is hard to interpret. I am now thinking about having each class create and configure a logger object and write to its own file. One log per class. The good thing is it is log4j is easy to set up and start logging with. Here is the tutorial I got started with: http://www.developer.com/open/article.php/10930_3097221_1 HTH Luke Hi everyone Im looking for some tips on implementing a logging system in tomcat. Ive got log4j installed and am about to write code but im just looking for some tips before i get started. My idea is to write a central logger class for my app that imports the log4j package and supplys static methods to my app but I don't know if thats a bad idea? thanks -B - 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]
org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory.doesModernCompilerExist(CompilerAdapterFactory.java:143)
Hello, I recently installed tomcat 5.0.28 and java 1.4.2_06. I get the default app and can execute servlets, but if i execute any jsp that is NOT defined in the jsp-examples web app, i get the error above. Full stack trace below: I have no idea what is causing this. Please help. type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: Unable to compile class for JSP org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:520) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) root cause java.lang.NullPointerException org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory.doesModernCompilerExist(CompilerAdapterFactory.java:143) org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory.getCompiler(CompilerAdapterFactory.java:97) org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:929) org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:758) org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:382) org.apache.jasper.compiler.Compiler.compile(Compiler.java:472) org.apache.jasper.compiler.Compiler.compile(Compiler.java:451) org.apache.jasper.compiler.Compiler.compile(Compiler.java:439) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.
No jsp compiles
I just installed tomcat 5.0.28 and java 1.4.2_06 on redhat and no JSP compiles, with the following error: Even jsp with one line in them Any ideas? org.apache.jasper.JasperException: Unable to compile class for JSP org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:520) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) root cause java.lang.NullPointerException org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory.doesModernCompilerExist(CompilerAdapterFactory.java:143) org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory.getCompiler(CompilerAdapterFactory.java:97) org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:929) org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:758) org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:382) org.apache.jasper.compiler.Compiler.compile(Compiler.java:472) org.apache.jasper.compiler.Compiler.compile(Compiler.java:451) org.apache.jasper.compiler.Compiler.compile(Compiler.java:439) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
RE: No jsp compiles
Follow Up: in case anyone had the same issue. It was my installation of tomcat. I blew away old instance, downloaded binaries again and this time JSP's compiled fine. My guess is that the original tar ball was either a result of an incomplete download or was just simply the wrong one. Who knows. -Original Message- From: Brian McGovern [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 08, 2005 12:53 PM To: Tomcat Users List Subject: No jsp compiles I just installed tomcat 5.0.28 and java 1.4.2_06 on redhat and no JSP compiles, with the following error: Even jsp with one line in them Any ideas? org.apache.jasper.JasperException: Unable to compile class for JSP org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:520) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) root cause java.lang.NullPointerException org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory.doesModernCompilerExist(CompilerAdapterFactory.java:143) org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory.getCompiler(CompilerAdapterFactory.java:97) org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:929) org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:758) org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:382) org.apache.jasper.compiler.Compiler.compile(Compiler.java:472) org.apache.jasper.compiler.Compiler.compile(Compiler.java:451) org.apache.jasper.compiler.Compiler.compile(Compiler.java:439) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]