0 Replies Latest reply on Oct 6, 2006 5:35 PM by Laurent Duperval

    Using NTEventLogAppender with JBoss

    Laurent Duperval Newbie

      Hi,

      I have a requirement to use the Windows Event log to log certain events when JBoss deploys.

      In my log4j.xml, I have:

      <appender name="NTLOG" class="org.apache.log4j.nt.NTEventLogAppender">
       <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
       <param name="SomeSource" value="TME UI"/>
       <layout class="org.apache.log4j.PatternLayout">
       <param name="ConversionPattern" value="%p [%c] - [%d] %m%n"/>
       </layout>
       </appender>
      
      <category name="org.jboss.naming.NamingService">
       <priority value="ERROR" />
       <appender-ref ref="NTLOG"/>
       </category>
      
       <category name="org.jboss.web.WebService">
       <priority value="ERROR" />
       <appender-ref ref="NTLOG"/>
       </category>
      
       <category name="org.jboss.system.server.Server">
       <priority value="ERROR" />
       <appender-ref ref="NTLOG"/>
       </category>
      
       <category name="org.jboss.invocation.jrmp.server.JRMPInvoker">
       <priority value="ERROR" />
       <appender-ref ref="NTLOG"/>
       </category>
      
       <category name="org.jboss.deployment.MainDeployer">
       <priority value="ERROR" />
       <appender-ref ref="NTLOG"/>
       </category>
      
       <category name="org.jboss.ejb.EJBDeployer">
       <priority value="ERROR" />
       <appender-ref ref="NTLOG"/>
       </category>
      
       <category name="org.jboss.deployment.EARDeployer">
       <priority value="ERROR" />
       <appender-ref ref="NTLOG"/>
       </category>
      
      
      


      However, when I start JBoss, I get nothing in the event logger, but I will get this in server.log:

      2006-10-06 17:20:32,562 ERROR [org.jboss.naming.NamingService] Starting failed jboss:service=Naming
      
      java.rmi.server.ExportException: Port already in use: 1098; nested exception is:
       java.net.BindException: Address already in use: JVM_Bind
      
       at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:243)
      
       at sun.rmi.transport.tcp.TCPTransport.exportObject(TCPTransport.java:178)
      
       at sun.rmi.transport.tcp.TCPEndpoint.exportObject(TCPEndpoint.java:382)
      
       at sun.rmi.transport.LiveRef.exportObject(LiveRef.java:116)
      
       at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:145)
      
       at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:129)
      
       at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:275)
      
       at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:206)
      
       at org.jnp.server.Main.initJnpInvoker(Main.java:364)
      
       at org.jnp.server.Main.start(Main.java:238)
      
       at org.jboss.naming.NamingService.startService(NamingService.java:163)
      
       at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:271)
      
       at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:221)
      
       at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
      
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      
       at java.lang.reflect.Method.invoke(Method.java:324)
      
       at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
      
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:61)
      
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:53)
      
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:185)
      
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
      
       at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:837)
      
       at $Proxy0.start(Unknown Source)
      
       at org.jboss.system.ServiceController.start(ServiceController.java:367)
      
       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:324)
      
       at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
      
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:61)
      
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:53)
      
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:185)
      
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
      
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
      
       at $Proxy4.start(Unknown Source)
      
       at org.jboss.deployment.SARDeployer.start(SARDeployer.java:251)
      
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:836)
      
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:645)
      
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:608)
      
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:592)
      
       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:324)
      
       at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
      
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:61)
      
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:53)
      
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:185)
      
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
      
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
      
       at $Proxy5.deploy(Unknown Source)
      
       at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:407)
      
       at org.jboss.system.server.ServerImpl.start(ServerImpl.java:311)
      
       at org.jboss.Main.boot(Main.java:145)
      
       at org.jboss.Main$1.run(Main.java:399)
      
       at java.lang.Thread.run(Thread.java:534)
      
      Caused by: java.net.BindException: Address already in use: JVM_Bind
      
       at java.net.PlainSocketImpl.socketBind(Native Method)
      
       at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:331)
      
       at java.net.ServerSocket.bind(ServerSocket.java:318)
      
       at java.net.ServerSocket.<init>(ServerSocket.java:185)
      
       at org.jboss.net.sockets.DefaultSocketFactory.createServerSocket(DefaultSocketFactory.java:157)
      
       at sun.rmi.transport.tcp.TCPEndpoint.newServerSocket(TCPEndpoint.java:615)
      
       at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:231)
      
       ... 58 more
      
      


      What am I doing wrong? Why doesn't this event get sent to the event log viewer?

      Thanks,

      L