Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8077087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:24:11+00:00 2026-06-05T15:24:11+00:00

I’ve got a java server launched from a jar that uses log4j (RollingFile and

  • 0

I’ve got a java server launched from a jar that uses log4j (RollingFile and Console appender). Alone: no problem it works.
I’ve got a JBoss server using log4j (default install). Everything is ok when it runs alone.

When I start my Java server first and the JBoss, no problem either.

However when launching JBoss first and THEN launch the java server, the last doesn’t log anything and JBoss sends me this :
ERROR [ServerThread] Failed to initialize

java.io.EOFException
        at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2297)
        at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2766)
        at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:797)
        at java.io.ObjectInputStream.<init>(ObjectInputStream.java:297)
        at org.jboss.invocation.pooled.interfaces.OptimizedObjectInputStream.<init>(OptimizedObjectInputStream.java:147)
        at org.jboss.invocation.pooled.server.ServerThread.dorun(ServerThread.java:265)
        at org.jboss.invocation.pooled.server.ServerThread.run(ServerThread.java:156)
log4j:WARN Detected problem with connection: java.net.SocketException: Broken pipe

Is there possible conflict between two servers using LOG4J ? I didn’t find anything on the net.

Thanks

ADDENDUM

  • JBoss and the Java server are in different directories
  • JBoss and the Java server don’t share any port (8080/8433–> JBoss and 20400–>Java)
  • JBoss and the Java server have their own log4jxxxx.jar in their own library folder
  • Java Log4j version : log4j-1.2.16.jar (I also tried 1.2.17)
  • JBoss version : jboss-5.1.0.GA
  • Both write in different files

Here are the config files : (Basically console & appender file only)

Java

      <!--  mocutil import -->
        <appender name="mocutilImport" class="org.apache.log4j.RollingFileAppender">
                <param name="Threshold" value="INFO" />
                <param name="File" value="log/mocutilImport.log" />
                <param name="MaxFileSize" value="5000KB" />
            <!-- Keep five backup file -->
            <param name="MaxBackupIndex" value="5"/>
                <layout class="org.apache.log4j.PatternLayout">
                        <param name="ConversionPattern" value="%d %-5p - %m%n" />
                </layout>
        </appender>
        <appender name="NectarMotrServer" class="org.apache.log4j.RollingFileAppender">
                <param name="Threshold" value="INFO" />
                <param name="File" value="log/NectarMotrServer.log" />
                <param name="MaxFileSize" value="5000KB" />
            <!-- Keep five backup file -->
            <param name="MaxBackupIndex" value="5"/>
                <layout class="org.apache.log4j.PatternLayout">
                        <param name="ConversionPattern" value="%d %-5p - %m%n" />
                </layout>
        </appender>
        <appender name="NectarMotrServerDev" class="org.apache.log4j.RollingFileAppender">
                <param name="Threshold" value="DEBUG" />
                <param name="File" value="log/NectarMotrServerDev.log" />
                <param name="MaxFileSize" value="5000KB" />
            <!-- Keep five backup file -->
            <param name="MaxBackupIndex" value="5"/>
                <layout class="org.apache.log4j.PatternLayout">
                        <param name="ConversionPattern" value="%d %c{1} [%t] %p - %m%n" />
                </layout>
        </appender>
    <!--  Default  -->
        <appender name="console" class="org.apache.log4j.ConsoleAppender">
                <param name="Threshold" value="TRACE" />
           <param name="Target" value="System.out"/>
           <layout class="org.apache.log4j.PatternLayout">
             <param name="ConversionPattern" value="[%d] %c{1} - %m%n" />
           </layout>
         </appender>
    <category name="fr.edf.nectar">
            <appender-ref ref="NectarmotrServer"/>
            <appender-ref ref="NectarmotrServerDev"/>
            <appender-ref ref="console"/>
    </category>
    <category name="fr.edf.nectar.interfaces.motr.imports.mocutil">
            <appender-ref ref="mocutilImport"/>
    </category>

     <root>
        <priority value="ALL"/>
     </root>

JBOSS (I removed commented appenders)

   <!-- ======================= -->
   <!-- Setup the Root category -->
   <!-- ======================= -->
   <appender name="FILE" class="org.jboss.logging.appender.DailyRollingFileAppender">
      <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
      <param name="File" value="${jboss.server.log.dir}/server.log"/>
      <param name="Append" value="true"/>
      <!-- In AS 5.0.x the server log threshold was set by a system
           property. In 5.1 and later we are instead using the system
           property to set the priority on the root logger (see <root/> below)
      <param name="Threshold" value="${jboss.server.log.threshold}"/>
      -->

      <!-- Rollover at midnight each day -->
      <param name="DatePattern" value="'.'yyyy-MM-dd"/>

      <!-- Rollover at the top of each hour
      <param name="DatePattern" value="'.'yyyy-MM-dd-HH"/>
      -->

      <layout class="org.apache.log4j.PatternLayout">
         <!-- The default pattern: Date Priority [Category] (Thread) Message\n -->
         <param name="ConversionPattern" value="%d %-5p [%c] (%t) %m%n"/>

         <!-- The full pattern: Date MS Priority [Category] (Thread:NDC) Message\n
         <param name="ConversionPattern" value="%d %-5r %-5p [%c] (%t:%x) %m%n"/>
          -->
      </layout>
   </appender>
   <!-- ============================== -->
   <!-- Append messages to the console -->
   <!-- ============================== -->

   <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>
      <!--
         Set the root logger priority via a system property. Note this is parsed by log4j,
         so the full JBoss system property format is not supported; e.g.
         setting a default via ${jboss.server.log.threshold:WARN} will not work.
       -->
      <priority value="${jboss.server.log.threshold}"/>
      <appender-ref ref="CONSOLE"/>
      <appender-ref ref="FILE"/>
   </root>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T15:24:13+00:00Added an answer on June 5, 2026 at 3:24 pm

    Here is what happened (Thanks to David Oliván Ubieto for his help):

    In the Java server, we’re using a Php/Java bridge, looking at its class I found :

    Util.Logger()
          Use chainsaw, if available or a default logger.
    

    Refering to David Chainsaw might be a problem, and it does because it uses the port 4445 which is the same as JBoss invoker, type=pooled service (Source).

    So what happen I think is that launching the server, the bridge library try connecting to 4445 to see if chainsaw is present. It detects something and decide to use 4445 as Logging port resulting in no log for Java, meanwhile JBoss receives strange messages on 4445 and throw an Exception.

    Launching Java first, will result in the lib using my Log4j configuration and JBoss working as expected.

    To correct everything I modified .../jboss-5.1.0.GA/server/default/conf/bindingservice.beans/META-INF/bindings-jboss-beans.xml like this :

    ...
            <!-- Pooled invoker -->
            <bean class="org.jboss.services.binding.ServiceBindingMetadata">
               <property name="serviceName">jboss:service=invoker,type=pooled</property>
               <property name="port">[PORT OTHER THAN 4445]</property>
               <property name="description">Socket for the legacy Pooled invoker</property>
            </bean>
    
    ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am currently running into a problem where an element is coming back from
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
I am doing a simple coin flipping experiment for class that involves flipping a
I have a text area in my form which accepts all possible characters from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.