Log4j and Tomcat-problem

Hi all,
First I tried to add some logging to my simple Java code with a xml configuration file and it worked fine.
Now I am trying to add logging to the whole java application in the same way which runs in tomcat and face with the foll problem.Tomcat is not able to find the configuration file.I tried to place the xml file in all feasible locations in tomcat and also tried to add in classpath but in vain.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
Java Code(Which gets called in startup by another code)
Java Code
public class PublisherPoll implements Runnable {
public static Logger logger = Logger.getLoggerPublisherPoll.class);//***********log4j
public static Logger getLoggerInstance(){   //***********log4j
     return logger;
static{
DOMConfigurator.configure("sudarson.xml");//**********its telling it cant find/open this xml file
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error(during starting tomcat)
log4j:ERROR Could not open [sudarson.xml].
java.io.FileNotFoundException: sudarson.xml (The system cannot find the file sp
cified)
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.xml.DOMConfigurator.doConfigure(DOMConfigurator.jav
:583)
at org.apache.log4j.xml.DOMConfigurator.configure(DOMConfigurator.java:
87)
at SerenaStartupServlet.init(SerenaStartupServlet.java:44)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper
java:1091)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:9
5)

DOMConfigurator.configure("sudarson.xml");//**********its telling it cant find/open this xml fileWhat does "sudarson.xml" mean to you? To me, it means a file name relative to the current directory. What do you think the current directory is when you're running this in Tomcat?
You need to research the APIs more fully, to figure out how to give it a resource name relative to the application's classpath, and put that file in said classpath.
If I were you, I would try to avoid explicitly calling DOMConfigurator.configure altogether, and just pass the appropriate Log4J system property to the commandline that starts up Tomcat. Let Log4J worry about loading the file, given the property. If I recall correctly, the system property name is "log4j.configuration", which defaults to "log4j.properties" if unspecified. Also, rather than have each application running in Tomcat have their own log4j configuration file name, I'd name them something more universal, like "log4j.xml" - then if you deploy multiple apps in Tomcat, they can all load their own log4j.xml file, as long as (again) you corrected the "log4j.configuration" system property.

Similar Messages

  • Oc4j and tomcat problem ....very urgent..pl respond

    Hi.Avi and all
    here we r working with oc4j as ejb container and tomcat as webcontainer.as of now we r in oc4j as both webserver and appsrver.in this case my application is running successfully.but just week days we have decide to use tomcat as webserver and 0c4j as appserver.this is my client requirement.when we r working with thses two iam keeping my web files in tomcat and iamtrying to acess ejb's deployed on oc4j.in this scenarion iam struggling with ejb handle of stateful session bean.
    here is the exact prob iam facing:
    We have got the EJBHandle for EjboBJECT. We have placed the Handle in session and while retrieving EJBObject from it the container is throwing OrionRemoteException.
    -----THIS IS STACK TRACE OF MY ERROR----$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
    $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
    $$$$$$$$$$$$$$$$$$$$$$$$$ BEFORE ezc.client.EzcPurchaseUtilManager$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
    FW >>>>> In the prepareParams.....[Session handle EzUserHome: 1]
    09/05/2002 - 22:12:15 :: ******************** session test in the utilmanager ***********
    09/05/2002 - 22:12:15 :: EzSession: ezc.session.EzSession@2942da handle is: [Session handle EzUserHome: 1]
    ****************** Exception com.evermind.server.rmi.OrionRemoteException: The EJBHome could not be found at location 'EzUserHome'class com.evermind.server.rmi.OrionRemoteException
    Exception com.evermind.server.rmi.OrionRemoteException: The EJBHome could not be found at location 'EzUserHome'class com.evermind.server.rmi.OrionRemoteException
    $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
    $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
    $$$$$$$$$$$$$$$$$$$$$$$$$ BEFORE ezc.client.EzcPurchaseUtilManager$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
    FW >>>>> In the prepareParams.....[Session handle EzUserHome: 1]
    09/05/2002 - 22:12:15 :: ******************** session test in the utilmanager ***********
    09/05/2002 - 22:12:15 :: EzSession: ezc.session.EzSession@2942da handle is: [Session handle EzUserHome: 1]
    ****************** Exception com.evermind.server.rmi.OrionRemoteException: The EJBHome could not be found at location 'EzUserHome'class com.evermind.server.rmi.OrionRemoteException
    Exception com.evermind.server.rmi.OrionRemoteException: The EJBHome could not be found at location 'EzUserHome'class com.evermind.server.rmi.OrionRemoteException
    Can anyone write to me on this.
    thx..
    Vasu

    Hi,
    I tried this on OC4J 9.0.3 production ( http://otn.oracle.com ) and Tomcat 4.0.1 (Catalina). I have a SF session bean deployed on OC4J, a web app deployed on tomcat. web.xml has ejb references added.
    The code in first JSP is like this..
    java.util.Properties prop = System.getProperties();
    prop.put(Context.INITIAL_CONTEXT_FACTORY,
    "com.evermind.server.rmi.RMIInitialContextFactory");
    prop.put(Context.PROVIDER_URL, "ormi://localhost:23891/current-workspace-app");
    prop.put(Context.SECURITY_PRINCIPAL, "admin");
    prop.put(Context.SECURITY_CREDENTIALS, "welcome");
    Context ctx = new InitialContext(prop);
    HealthCareServiceHome h = HealthCareServiceHome)PortableRemoteObject.narrow(ctx.lookup("HealthCareService"),HealthCareServiceHome.class);;
    HealthCareService js = h.create();
    Handle eh = js.getHandle();
    session.setAttribute("Eh",eh);
    and in a second JSP, I access this stateful session bean like this...
    Handle eh= (Handle)session.getAttribute("Eh");
    HealthCareService s = (HealthCareService)eh.getEJBObject();
    // do something on this instance. Everything works fine
    I dont know what versions of tomcat/oc4j you are using, may be an upgrade will help?
    Thanks,
    Neelesh
    OTN Team @ IDC

  • JSP and Tomcat Problem

    Folks,
    My apologies if this is off-topic for this forum, but I've been having this problem using Tomcat and JSP. I'm fairly new to Java.
    Basically, I'm writing a webapp that uses servlets and JSP together. The servlet and backend classes all compile fine. Now, basic frontend page is called Console.jsp, and one of the commands that it runs is <%@ page import="DJUser">
    Here's the problem: Console.jsp is in $CATALINA_HOME/webapp/
    DJUser (and the rest of the classes I'm using) are in $CATALINA_HOME/webapp/WEB-INF/classes
    When I attempt to run Console.jsp I get this error:
    exception
    org.apache.jasper.JasperException: Unable to compile class for JSP
    Generated servlet error:
    The import DJUser cannot be resolved
    An error occurred at line: 9 in the jsp file: /Console.jsp
    Generated servlet error:
    DJUser cannot be resolved to a type
    An error occurred at line: 11 in the jsp file: /Console.jsp
    Generated servlet error:
    user cannot be resolved
    An error occurred at line: 11 in the jsp file: /Console.jsp
    Generated servlet error:
    DJUser cannot be resolved to a type
         org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
         org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
         org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:409)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:288)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    The ROOT CAUSE is listed as:
    java.lang.ClassNotFoundException: org.apache.jsp.Console_jsp
         java.net.URLClassLoader$1.run(URLClassLoader.java:200)
         java.security.AccessController.doPrivileged(Native Method)
         java.net.URLClassLoader.findClass(URLClassLoader.java:188)
         org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:133)
         org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:65)
         org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:596)
         org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:137)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:305)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    I'm running Tomcat 5.5.12 on Mac OS X 10.4. Could this be a permissions issue somehow? For right now (testing purposes only) I have tomcat running under my (non root) account.
    I've been scouring the web for a while, and I can't really find anything on this. I'd appreciate any help you could give me.
    Thanks!
    Dylan

    Put the DJUser java file in a package (say com.myClasses) and recompile. Then put the DJUser class file under the WEB-INF/classes directory in the proper package structure (WEB-INF/classes/com/myClasses/DJUser). Stop and restart the server to pick up the new classes. Make sure to change the jsp import statement ( <%@ page import="com.myClasses.DJUser">)

  • Log4j And Tomcat

    Hi,
    I'm trying to get log4j to work with tomcat, but for some reason none of the logs get written to the logfile.
    I have a logfile containing:
         <appender name="apachelog" class="org.apache.log4j.FileAppender">
              <param name="File" value="${catalina.home}/logs/junk.log"/>
              <layout class="org.apache.log4j.PatternLayout">
                   <param name="ConversionPattern" value="%d %-5p (%F:%L) - %m%n"/>
              </layout>
         </appender>
         <logger name="org.apache.jk.common.ChannelSocket">
                <level value="info"/>
                <appender-ref ref="apachelog"/>
         </logger> 
    ...Except the tricky thing is that though I don't have access to the source code for this jk.common class, I'm getting a ton of "INFO" logs from it, and I don't want them showing up on the console.
    I've tried adding a line logger = Logger.getLogger("org.apache.jk.common.ChannelSocket") in my classes, but that doesn't work. In fact, under tomcat, I can't even get logging working for my other classes!
    The logfile is getting picked up by tomcat (If it isn't configured properly, tomcat gives me errors on startup). The specified log folder is empty, and the output still goes to the console.
    Can someone please help?
    Thanks.

    It doesn't seem to work unless I actually call getLogger() & then call info manuallyI don't follow. What doesn't work? Your code always needs to call getLogger("somename") followed by logger.info("Some message"); in order to log an INFO message.
    If only there was some way to associate a logger with a class during runtimeLogger's aren't directly associated with classes at all. Every logger has a name and by convension the name is the same as class that creates / uses it..
    Logger.getLogger("com.somepackage.anotherpackage.MyClass");could be replaced with
    Logger.getLogger("debugLogger");The reason for using the fully qualified class name is so that you can turn on/off logging by package or by class, e.g.
    <logger name="com.somepackage">
        <priority value="OFF"/>
    </logger>Turns off all logging for every logger with a name that starts with "com.somepackage". The fact that just happens to be a package name is irrelevant.
    I appreciate your help so far, but I'm really stumped as to why1)Logging happens to the console instead of the logfile
    2)It bypasses the logger.info() method somehow
    Tomcat uses commons logging, which in most cases uses Log4J behind the scenes. Is it possible you've instead managed to enable the logging that comes with J2SE? Download the Tomcat source, put a break point at the line that reads log.info( "connection timeout reached"); and see where it takes you when you step through.

  • Communication problem between NetBeans and Tomcat

    hi!
    i got a quite mysterious problem. here is what happens:
    - i start NetBeans 5.5.1 (the first time)
    - i want to debug my JSF-Project, the Debugger starts
    - After a few seconds the debugger waits for tomcat (it sais: "Waiting for Tomcat...") and tomcat starts
    - Again after a few seconds the tomcat-debugger-output sais "Tomcat startet in 3333 ms".
    okay.
    when i enter http://localhost:8084/ in my browser i get the tomcat homepage, so the server has definitely started! But nothing happens in NetBeans and nothing happens with my project....
    In the lower-right corner i see this blue working-bar that sais "deploying project" but nothing happens. The Project-Debugger-Output still sais "Waiting for Tomcat..." but nothing happens...
    And after something around 3 minutes (i guess it's a timeout) i get the error "Starting of Tomcat failed." But is HAS started, i can login to the Administration-Area in my browser!
    so i guess there is a communication problem between netbeans an tomcat. Netbeans waits for a message from tomcat but tomcat doesn't send it..or netbeans doesn't understand it.
    But the story goes on:
    When i press the debug-button a second time it takes only a few seconds till i get the message: "Tomcat server port 8084 already in use". OF COURSE! Because Tomcat has already startet and can't be stoped by NetBeans.
    i'm trying to solve this problem for 4 days now, so i would be very happy if anyone has an idea where to start/continue the search...
    thanks,
    flo.
    some system-info:
    - windows vista business 32-bit
    - no firewall is running
    - AntiVir Personal Edition IS running
    - Yahoo Widgets Engine IS running
    - no other software is running
    and finally the tomcat-log:
    Using CATALINA_BASE: C:\Users\Administrator\.netbeans\5.5.1\apache-tomcat-5.5.17_base
    Using CATALINA_HOME: C:\Program Files\NetBeans\enterprise3\apache-tomcat-5.5.17
    Using CATALINA_TMPDIR: C:\Users\Administrator\.netbeans\5.5.1\apache-tomcat-5.5.17_base\temp
    Using JRE_HOME: C:\Program Files\Java\jdk1.5.0_12
    Listening for transport dt_shmem at address: tomcat_shared_memory_id
    21.09.2007 18:27:50 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
    INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.5.0_12\bin;.;C:\Windows\system32;C:\Windows;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\ThinkPad\ConnectUtilities;C:\Program Files\Common Files\Teleca Shared;C:\Program Files\Common Files\Adobe\AGL;C:\Program Files\MySQL\MySQL Server 5.0\bin;C:\Program Files\cvsnt;
    21.09.2007 18:27:50 org.apache.coyote.http11.Http11BaseProtocol init
    INFO: Initializing Coyote HTTP/1.1 on http-8084
    21.09.2007 18:27:50 org.apache.catalina.startup.Catalina load
    INFO: Initialization processed in 1862 ms
    21.09.2007 18:27:50 org.apache.catalina.core.StandardService start
    INFO: Starting service Catalina
    21.09.2007 18:27:50 org.apache.catalina.core.StandardEngine start
    INFO: Starting Servlet Engine: Apache Tomcat/5.5.17
    21.09.2007 18:27:50 org.apache.catalina.core.StandardHost start
    INFO: XML validation disabled
    21.09.2007 18:27:53 org.apache.coyote.http11.Http11BaseProtocol start
    INFO: Starting Coyote HTTP/1.1 on http-8084
    21.09.2007 18:27:54 org.apache.jk.common.ChannelSocket init
    INFO: JK: ajp13 listening on /0.0.0.0:8009
    21.09.2007 18:27:54 org.apache.jk.server.JkMain start
    INFO: Jk running ID=0 time=0/31 config=null
    21.09.2007 18:27:54 org.apache.catalina.storeconfig.StoreLoader load
    INFO: Find registry server-registry.xml at classpath resource
    21.09.2007 18:27:54 org.apache.catalina.startup.Catalina start
    INFO: Server startup in 3626 ms

    As i wrote before, the same problem occured for me. I have found a solution which is : Go to tools menu and then select options . In the proxy info, select No Proxy.
    I hope this help you

  • Problem launching a jsp page with eclipse and tomcat

    Hi,
    I have just started using eclipse and tomcat for creating dynamic web pages. I tried to launch a jsp page after starting the tomcat server with the URL: http://locahost:8080/HelloWorld/, an error page was displayed as below:
    HTTP Status 404 -/
    type Status report
    message /_
    description The requested resource (-) is not available
    Apache Tomcat/5.5.17
    I didn't get any error at the console and when i just typed http://localhost, a pop up menu saying that the connection was refused when attempting to contact localhost.
    I'm not sure what is the problem here. Could it be the permssion to the localhost is not granted by the system as the eclipse IDE is running using linux?
    Hope someone can help.
    Thanks.

    http://www-128.ibm.com/developerworks/library/os-ectom/

  • Right problem with apache and tomcat

    Bonjour;
    I use a user login "apache" to stop/start Apache and tomcat. Because never launching apache et tomcat as root.
    But I have the following problem with apache (file error.log) :
    [Tue May  6 17:26:22 2003] [error] Connection "warpConnection" cannot connect
    [Tue May  6 17:26:22 2003] [error] Cannot open connection "warpConnection"
    [Tue May  6 17:27:01 2003] [error] Re-Trying to deploy connections
    As root the error msg does'nt exists (lost)
    Best regards;
    A+;

    Run it from the shell to see whats wrong:
    # httpd

  • Authentication problem with JWS and TOMCAT

    Hi everyone !
    I have a problem with Java Web Start (1.0.1) and Tomcat (4.0.4).
    I'm trying to call my application via Web server Tomcat with restricting access.
    My configuration is the following :
    The deployment descriptor web.xml is:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <mime-mapping>
    <extension>jar</extension>
    <mime-type>application/java-archive</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>java</extension>
    <mime-type>text/plain</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>jnlp</extension>
    <mime-type>application/x-java-jnlp-file</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>JNLP</extension>
    <mime-type>application/x-java-jnlp-file</mime-type>
    </mime-mapping>
    <!-- Define a Security Constraint on this Application -->
    <security-constraint>
    <web-resource-collection>
    <web-resource-name>Entire Application</web-resource-name>
    <url-pattern>/*</url-pattern>
    </web-resource-collection>
    <auth-constraint>
    <!-- NOTE: This role is not present in the default users file -->
    <role-name>standard</role-name>
    </auth-constraint>
    </security-constraint>
    <!-- Define the Login Configuration for this Application -->
    <login-config>
    <auth-method>BASIC</auth-method>
    <realm-name>MY APPL</realm-name>
    </login-config>
    </web-app>
    And jnlp File is:
    <jnlp
    spec="1.0+"
    codebase="http://host:8080/Official/"
    href="Application.jnlp">
    <information>
    <title>Application release 0.10</title>
    <vendor> XXXX </vendor>
    <homepage href="/"/>
    <description>Application</description>
    <description kind="short">My Application</description>
    <icon href="Icon.gif"/>
    </information>
    <security>
    <all-permissions/>
    </security>
    <resources>
    <j2se version="1.3"/>
    <jar href="Jar1.jar"/>
    <jar href="Jar2.jar"/>
    <jar href="Jar3.jar"/>
    <jar href="Jar4.jar"/>
    <jar href="Jar5.jar"/>
    <jar href="Jar6.jar"/>
    <jar href="Jar7.jar"/>
    <jar href="Jar8.jar"/>
    <jar href="Jar9.jar"/>
    <jar href="Jar10.jar"/>
    <jar href="MyApplication.jar"/>
    </resources>
    <application-desc main-class="com.xxxx.tool.cm.MyApplication"/>
    </jnlp>
    With the above configuration the Java Web Start not work.
    I'm expecting the message box for insert username and password instead it returns the messagge error :
    An error occurred while launching/running the application.
    Vendor: XXXX
    Category: Download Error
    Unable to load resource: http://host:8080/Official/Application.jnlp
    The Exception error is:
    JNLPException[category: Download Error : Exception: java.lang.NullPointerException : LaunchDesc: null ]
         at com.sun.javaws.cache.DownloadProtocol.doDownload(Unknown Source)
         at com.sun.javaws.cache.DownloadProtocol.isLaunchFileUpdateAvailable(Unknown Source)
         at com.sun.javaws.LaunchDownload.getUpdatedLaunchDesc(Unknown Source)
         at com.sun.javaws.Launcher.downloadResources(Unknown Source)
         at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
         at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
         at com.sun.javaws.Launcher.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    I have tried to remove the restrict access in the deployment descriptor (web.xml) and java Web Start WORKS !!!!!!
    I'll appreciate any idea or hint!
    Thanks in advance

    Check this out
    http://forum.java.sun.com/thread.jsp?forum=38&thread=456250
    Mad Einstein

  • Performance problems when running PostgreSQL on ZFS and tomcat

    Hi all,
    I need help with some analysis and problem solution related to the below case.
    The long story:
    I'm running into some massive performance problems on two 8-way HP ProLiant DL385 G5 severs with 14 GB ram and a ZFS storage pool in raidz configuration. The servers are running Solaris 10 x86 10/09.
    The configuration between the two is pretty much the same and the problem therefore seems generic for the setup.
    Within a non-global zone I’m running a tomcat application (an institutional repository) connecting via localhost to a Postgresql database (the OS provided version). The processor load is typically not very high as seen below:
    NPROC USERNAME  SWAP   RSS MEMORY      TIME  CPU                            
        49 postgres  749M  669M   4,7%   7:14:38  13%
         1 jboss    2519M 2536M    18%  50:36:40 5,9%We are not 100% sure why we run into performance problems, but when it happens we experience that the application slows down and swaps out (according to below). When it settles everything seems to turn back to normal. When the problem is acute the application is totally unresponsive.
    NPROC USERNAME  SWAP   RSS MEMORY      TIME  CPU
        1 jboss    3104M  913M   6,4%   0:22:48 0,1%
    #sar -g 5 5
    SunOS vbn-back 5.10 Generic_142901-03 i86pc    05/28/2010
    07:49:08  pgout/s ppgout/s pgfree/s pgscan/s %ufs_ipf
    07:49:13    27.67   316.01   318.58 14854.15     0.00
    07:49:18    61.58   664.75   668.51 43377.43     0.00
    07:49:23   122.02  1214.09  1222.22 32618.65     0.00
    07:49:28   121.19  1052.28  1065.94  5000.59     0.00
    07:49:33    54.37   572.82   583.33  2553.77     0.00
    Average     77.34   763.71   771.43 19680.67     0.00Making more memory available to tomcat seemed to worsen the problem or at least didn’t prove to have any positive effect.
    My suspicion is currently focused on PostgreSQL. Turning off fsync boosted performance and made the problem less often to appear.
    An unofficial performance evaluation on the database with “vacuum analyze” took 19 minutes on the server and only 1 minute on a desktop pc. This is horrific when taking the hardware into consideration.
    The short story:
    I’m trying different steps but running out of ideas. We’ve read that the database block size and file system block size should match. PostgreSQL is 8 Kb and ZFS is 128 Kb. I didn’t find much information on the matter so if any can help please recommend how to make this change…
    Any other recommendations and ideas we could follow? We know from other installations that the above setup runs without a single problem on Linux on much smaller hardware without specific tuning. What makes Solaris in this configuration so darn slow?
    Any help appreciated and I will try to provide additional information on request if needed…
    Thanks in advance,
    Kasper

    raidz isnt a good match for databases. Databases tend to require good write performance for which mirroring works better.
    Adding a pair of SSD's as a ZIL would probably also help, but chances are its not an option for you..
    You can change the record size by "zfs set recordsize=8k <dataset>"
    It will only take effect for newly written data. Not existing data.

  • Installing Log4J in Tomcat and using JDBC to log errors

    Has anyone figured out how to install Log4J in Tomcat and use the Log4J JDBC functionality?
    I have log4j.jar in CATALINA_HOME/common/lib.
    I also have log4j.properties is in CATALINA_HOME/common/classes
    Then when I start Tomcat I get the following error:
    [main] DEBUG org.apache.commons.digester.Digester - addRuleSet() with no namespace URI
    is it something to do w/ the log4j.properties file? do i have to use a xml format or is it ok to use .properties format?
    -Karthik

    I would say you have something wrong in your log4j properties file.
    properties format is fine, but I suspect something in there is not quite right.
    Try starting with a simple example one, see if it works, and then try adding your own config based on that one.
    Good luck,
    evnafets

  • Simple setup problems with JSTL and Tomcat

    Hi all, I'm having some problems getting JSTL to work the 1st time. JSTL setup seems to be a common problem for relative newbies, but having read previous threads, I still haven't been able to solve my problem so hopefully someone can help:
    the jstl.jar and standard.jar are in my WEB-INF/lib directory, so I don't think it's a classpath problem.
    My jsp page has the following at the top:
    <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>Later, I reference a bean var with :
    <c:out value="My var is : ${var.property}"/>In my web.xml I have:
      <taglib>
       <taglib-uri>http://java.sun.com/jstl/core</taglib-uri>
       <taglib-location>/WEB-INF/lib/jstl.jar</taglib-location>
      </taglib>And I've placed the actual tld (c.tld) in the WEB-INF directory.
    On startup I get the error when compiling the JSP:
    No such tag out in the tag library imported with prefix c
    Can anyone help here?
    Thanks in advance,
    Mike

    I think this note from the JSTL mailing list by Shawn Bayern, one of the lead developers of Jakarta JSTL and the author of "JSTL In Action", will clarify it:
    http://www.mail-archive.com/[email protected]/msg04587.html
    Don't put that <taglib> in your web.xml. All the books tell you to do it, but Shawn Bayern has the right answer. The URI should be the one that's in the TLD JAR .tld files.
    I use JSTL and Tomcat 4.1.24 without the <taglib>, and it works fine. - MOD

  • Log4j and jsf

    I added log4j in my application. It is working and I can see my log.debug statements in the console. The problem is that I can see more than I want. My application uses jsf and Tomcat and I see many jsf debugs and I do not know what to change in my log4j.properties so as not to view them. My log4j.properties is the following:
    log4j.rootLogger=debugLog, stdout
    # CONSOLE appender
    log4j.appender.stdout=org.apache.log4j.ConsoleAppender
    log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
    log4j.appender.stdout.layout.ConversionPattern=%d{HH:mm:ss} %-5p %m%n
    log4j.appender.debugLog=org.apache.log4j.DailyRollingFileAppender
    log4j.appender.debugLog.Threshold=debug
    log4j.appender.debugLog.layout=org.apache.log4j.PatternLayout
    log4j.category.com.corejsf = debugLog
    I tried to add something like the following
    log4j.category.com.sun.faces = WARN
    log4j.additivity.com.sun.faces=falsebut nothing changed.Any suggestions??

    This is a log4j properties file problem. I'm not used to using the .properties file notation. I'm used to the XML notation for log4j.
    Here's how I'd do it in XML:
    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
    <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'>
            <!--
                    Set up the appender
            -->
            <appender name="Appender" class="org.apache.log4j.ConsoleAppender">
                    <param name="Append" value="true"/>
                    <layout class="org.apache.log4j.PatternLayout">
                            <param name="ConversionPattern" value="%d{HH:mm:ss} %-5p %m%n"/>
                    </layout>
            </appender>
            <logger name="my.java.package" additivity="false">
                    <level value="debug" />
                    <appender-ref ref="Appender" />
            </logger>
            <logger name="another.package.for.debug.level" additivity="false">
                    <level value="debug" />
                    <appender-ref ref="Appender" />
            </logger>
            <!--
                    Omitting the JSF package altogether should remove the undesired
                    DEBUG messages from it. However, if not, uncomment the following
                    lines.
            -->
            <!-- <logger name="javax.faces" additivity="false">
                    <level value="INFO" />
                    <appender-ref ref="Appender" />
            </logger> -->
            <root>
               <priority value ="debug" />
               <appender-ref ref="Appender" />
            </root>
    </log4j:configuration>This example will print to console only. If you want to print to a file instead, use the following lines (replaces the appender tags from the above example).
            <appender name="Appender" class="org.apache.log4j.DailyRollingFileAppender">
                    <param name="File" value="filePath/FileName.log"/>
                    <param name="DatePattern" value="'.'yyy-MM-dd"/>
                    <param name="Append" value="true"/>
                    <layout class="org.apache.log4j.PatternLayout">
                            <param name="ConversionPattern" value="%d{HH:mm:ss} %-5p %m%n"/>
                    </layout>
            </appender>I don't know how you'd get both the console and the file appender working at the same time.
    If you want further advice, or If you want advice on the .properties method of doing things, I suggest finding a log4j forum. The people there will undoubtedly have more experience and knowledge than us JSF nerds. =)
    I assure you though, JSF is compatible with log4j. The log4j properties file just needs to be set up properly (more challenging than it should be, if you ask me).
    CowKing

  • Log4j in tomcat

    Hi people,
    I'm developing a project in strut framework and I trying to write logs with log4j and I haven't problem to write it in console but when I try to write it in file log, surpprise! don't work.
    I'd like to know:
    Are there any special configuration when we work in web enviroment.?
    I'm working with struts 1.1 and tomcat 5.0.25., in windows 2000
    Where is the correct place for the file? and How I must to refer it in the log4j.properties?
    Do I need any special authorization to write it?
    I modified web.xml in this way
    <init-param>
         <param-name>FileLog</param-name>
    <param-value>/log/logfile.log</param-value>
    </init-param>
    <init-param>
         <param-name>log4j-init-conf</param-name>
    <param-value>log4j.properties</param-value>
    </init-param>
    And refer to the file in log4j.properties in this way
    log4j.appender.fileout.File=C://aplicacionesJ2EE/jakarta-tomcat-5.0.25/MyLogEjem/logfile.log
    I'd like to know why it don't work
    Thank you very much.

    Where is the correct place for the file? and How I must to refer it in the log4j.properties?Anywhere outside the web application. Example from my web application:
    log4j.appender.standard.file=C:/Something/Log/standard.log
    If you just put log4j.properties in your web application's WEB-INF/classes directory then log4j will work automatically.

  • NetBeans 5.0 and Tomcat 4.1

    Hello,
    I'm using NetBeans 5.0 and I have been using the Bundled Tomcat version 5.5.9 for my servlet container and everything's been great. Now that I'm ready to push my application up to a web host, I found that my host (lunarpages) runs with Tomcat 4.1 which uses version 2.3 of the servlet container. Tomcat 5.5 uses servlet container 2.4.
    So I downloaded Tomcat 4.1 (which has 2.3) and I don't know how to properly tell Netbeans to use it. When I open Server Manager and select 'Add Server', I can't just tell NetBeans to point to my Tomcat 4.1 directory. It wants me to select from a dropdown list of servers and Tomcat 4.1 isn't in the list.
    I tried to fake NetBeans out by selecting the 'Tomcat 5' server and pointing to my Tomcat 4.1 directory but I'm getting the following message when I try to run:
    FAIL - Unknown command /deploy
    C:\workspace\myApp\nbproject\build-impl.xml:425: Deployment error:
    Can anyone point me in the right direction on how to get Tomcat 4.1 running with NetBeans 5.0?
    Thanks,
    Eric

    I found that my host (lunarpages) runs with Tomcat 4.1 which uses version 2.3 of the servlet containerPlease read the post before answering, the reasoning is crystal clear.
    I don't have a concrete answer to this problem, but I do have a suggestion.
    1) You can add your own tomcat server to netbeans. Under the runtime tab you will find servers, if you right click this you can add a server. Use this to manually configure your own server
    2) as for the servlet spec problem, when creating a web project setting the java EE version to 1.3 might solve the problem... I can't tell this for sure because I've never done it.

  • Image will not change on the Browser...Saving on the Tomcat Problem...HELP

    Hi,
    I worte a Servlet project using JBuilder 7 and TOmcat 4. THis is basically what i am doing...
    I am getting an image from database and saving it to a folder in tomcat and then displaying it on a browser.
    This application is used by multiple users...
    I am saving the Image in Tom-cat...C:\JBuilder7\jakarta-tomcat-4.0.3\webapps\examples\Image1.jpeg
    I am also displaying the image from that folder. The problem is when i run the application,
    I am seeing the same Image on the screen..Its creating the different Image file, but the image is the same.
    If i do a refresh on the page then it displays the new saved Image...
    Also, If i save the image on my local and then display it from my local it changes the images as I
    click on a Image list...
    Following is how it works when i save it and display it from my local, but if i run my application from
    another computer i am not able to see any of the images....Because its on my local.
         fos = new FileOutputStream("C:/Image1.jpeg");
         <img src="file:///C|/Image1.jpeg" height="855" name="myimage" align="middle" style="position:absolute;">;
    And this is how i am doing when i am saving to the tomcat....I am able to display it on another computer
    but would not change the image...
    fos = new FileOutputStream("../webapps/examples/Image1.jpeg");
    <img src="../Image1.jpeg" height="855" name="myimage" align="middle" style="position:absolute;">;
    Can some one please tell me what could be the Problem....
    Any help will be greatly appreciated....Thanks...

    The browser caches images so that it doesn't have to always download the same image for different pages.
    You could:
    1: Save the new image with a different name and dynamically change the name in the html.
    2: Try setting the response headers to prevent the browser from caching the images.
    response.setHeader("Pragma", "no-cache");
    response.setHeader("Cache-Control", "no-cache");
    response.setDateHeader("Expires", 0);

Maybe you are looking for

  • Bt openzone/FON connection issue

    Ok so I often use this specific btopenzone wifi hotspot, used it for a couple hours every now and again for ages. Hit a problem now though my laptoop no longer connects to it. it sees it i click connect but it just keeps coming up no internet connect

  • Configuration error while creating index in KM

    Hi KM Expets, I am getting the following error while creating a new index via System Adminstration > System Configuration > Knowledge Management > Index Adminstration. Index could not be created; creating index failed: Invalid entry in configuration:

  • Problems converting Word documents to  PDF

    I am having trouble converting Word documents to PDF files. Whenever I try to convert the file, I receive the following error message: Missing PDFMaker files. Do you want to run the installer in repair mode? When I run the installer in repair mode, I

  • Retouch button wont work

    i click on the retouch button but when i move it over the writing i want to erase, nothing happens

  • How transfer the source code to customer JDI system

    HI Exprts, we have typical requirement of transferring the source code from our JDi system to Customer JDI system. We have created one track,in that we have 30-40 DCS.now we want to continue the further development at customer place.for that we want