2 Replies Latest reply on Dec 11, 2006 5:35 AM by Martin Connolly

    wstools and Log4J

    Martin Connolly Newbie

      Hi,
      I recently switched over from using Axis to wstools for my webservice. A C# client connects to the JBoss WS. The Web Service starts up fine but when I attempt to call any method from the C# GUI I get the following exception:

      EJBException in method: public abstract boolean com.systemejb.MyManagementEndPoint.MyMethod(java.lang.String) throws java.rmi.RemoteException, causedBy:
      java.lang.reflect.UndeclaredThrowableException
      at org.jboss.ejb.plugins.AbstractInstancePool.get(AbstractInstancePool.java:204)

      According to the logger this is caused by:

      java.lang.StackOverflowError
      at org.apache.log4j.CategoryKey.equals(CategoryKey.java:33)
      at java.util.Hashtable.get(Hashtable.java:339)
      at org.apache.log4j.Hierarchy.getLogger(Hierarchy.java:259)
      at org.apache.log4j.Hierarchy.getLogger(Hierarchy.java:233)
      at org.apache.log4j.LogManager.getLogger(LogManager.java:179)
      at org.apache.log4j.Logger.getLogger(Logger.java:94)

      When I run wstools in my ant script I also get the following warnings:

      wstools:
      [wstools] log4j:WARN No appenders could be found for logger (org.jboss.ws.tools.WSTools).
      [wstools] log4j:WARN Please initialize the log4j system properly.

      I have checked the log4j.xml file and the appenders are enabled. I am unsure whether the issues are related. If anyone could help shed some light on these issues I'd appreciate it.

      Thanks

      MC

        • 1. Re: wstools and Log4J
          Sam Griffith Jr. Newbie

          Martin,

          I'm not sure about the C# calls failure, but as far as the log appender, you can put the following log4j code in a log4j.xml file in your WS build dir so it gets packaged up with your WS when deployed and it'll be used as the appender. You don't have an appender defined for the WSTools so this one will serve as a default. I'll try and look into a more correct way to define the logger for WSTools when it's being invoked but in the mean time this should help get rid of that message.

          <?xml version="1.0" encoding="UTF-8"?>
          <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
          <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
          
          <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
          <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
          <param name="Target" value="System.out"/>
          <param name="Threshold" value="INFO"/>
          
          <layout class="org.apache.log4j.PatternLayout">
          <!-- The default pattern: Date Priority [Category] Message\n -->
          <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
          </layout>
          </appender>
          
          
          <root>
          <appender-ref ref="CONSOLE"/>
          </root>
          
          
          </log4j:configuration>
          


          • 2. Re: wstools and Log4J
            Martin Connolly Newbie

            thanks Sam. Will try this out.

            MC