Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    log4j xml

    When we deploy a war file containing smartclient, we get the following error message:

    === SmartClient Init: log4j.isc.config.xml not found in CLASSPATH. Assuming log4j configuration for com.isomorphic is located in some other log4j configuration file.

    I have put the file log4j.isc.config.xml under WEB-INF/classes. Still getting this error message. How to prevent this?

    File contents is empty (because we configure logging dynamically elsewhere).

    #2
    The code involved is literally just:

    Code:
                URL configURL = Loader.getResource("log4j.isc.config.xml");
                if (configURL == null) {
                    System.out.println("=== SmartClient Init: log4j.isc.config.xml not found in CLASSPATH."
                                       +" Assuming log4j configuration for com.isomorphic is located in"
                                       +" some other log4j configuration file.");
    So either the file is not actually on your classpath or the empty file is being regarded as not present by the JVM. If the latter is the problem, you can put together a valid Log4J definition that does not change any settings.

    Comment


      #3
      The file is not empty, it contains the following:

      <?xml version="1.0" encoding="UTF-8"?>
      <configuration>
      </configuration>

      It is located inside the war file under folder WEB-INF/classes

      I don't know what Loader.getResource("log4j.isc.config.xml"); does but apparently it doesn't pickup the file from classpath of a war file. It is trivial to reproduce on your side. Just package some smartclient app into a war file.

      Comment


        #4
        "Loader" is Log4j's Loader. We do use this pattern with .wars, multiple times a day. It really looks like you have some kind of classpath problem.

        Comment


          #5
          That might be some classloading problem of Weblogic, indeed. But, I really think that you shouldn't be giving any warnings when the file is not found. Most applications embedding smartclient will configure logging in one central place and shouldn't have to bother with smartclient-specific file. We do it dynamically, for example, based on settings outside of war file. Configuring logging in a file inside a war is not dynamic enough - you need to redeploy to change logging settings.

          Comment


            #6
            We agree that it's not dynamic enough, that's why we have a web-based tool to allow an admin to flip log categories on and off on the fly. The log4..xml file is just defaults. We need to keep the warning because people routinely skip pieces of the installation instructions and this warning makes one such problem more visible, so please troubleshoot your classpath problem, no changes are planned in this area.

            Comment


              #7
              log4j jars are part of weblogic itself, and since they use different classloader (at least under weblogic), they cannot use the resource from WEB-INF/classes.

              That means, I cannot do anything under weblogic short of repackaging weblogic jars. There should be a flag to disable this warning.

              Comment


                #8
                This hasn't been our experience (with WebLogic). But if it were true it would mean that WebLogic has crippled Log4j, and we can't reasonably be expected to remove a warning that correctly reports this and has no functional impact, sorry.

                Comment

                Working...
                X