You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by bu...@apache.org on 2010/05/10 07:08:50 UTC

DO NOT REPLY [Bug 49265] log4j - java.io.OptionalDataException

https://issues.apache.org/bugzilla/show_bug.cgi?id=49265

Curt Arnold <ca...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         OS/Version|                            |All

--- Comment #1 from Curt Arnold <ca...@apache.org> 2010-05-10 01:08:43 EDT ---
There are a lot of different things going on in this entry.  The user mailing
list is the right place for usage questions.  It does not (yet) describe a
log4j bug in sufficient detail for somebody to reproduce and fix an issue.  I
expect you may have more questions, but put those in a post to the user list.

The following things appear to be happening in your stack trace:

1) util.gen.IO.fetchObject() attempts to deserialize some object and fails. 
This is something in the application that you are trying to run and does not
appear to involve log4j.

java.io.OptionalDataException
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1340)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
at util.gen.IO.fetchObject(IO.java:953)
at trans.main.LoadIntervalOligoInfo.run(LoadIntervalOligoInfo.java:44)
at trans.main.LoadIntervalOligoInfo.main(LoadIntervalOligoInfo.java:192)

I'm guessing there is some incompatibility or error with some data file that
you are trying to read.  Perhaps the file was written by a different version of
your program or using a later version of the JDK.

2) Your app makes a log request (likely due to the first failure), but no
logging configuration file can be found so log4j emits its standard response in
the situation:

log4j:WARN No appenders could be found for logger (util.gen.IO).
log4j:WARN Please initialize the log4j system properly.

3) Your app outputs:

Indexing intervals by chromosome and start position

4) Your app throws a NullPointerException (possibly due to trying to use the
object that failed to deserialize)

Exception in thread "main" java.lang.NullPointerException
at trans.main.LoadIntervalOligoInfo.run(LoadIntervalOligoInfo.java:49)
at trans.main.LoadIntervalOligoInfo.main(LoadIntervalOligoInfo.java:192) 


While it won't fix the underlying problem with the app, you may get better
diagnostics if you provide log4j a configuration file.  log4j will look for
log4j.properties or log4j.xml in the classpath which could be something as
simple as:

log4j.rootLogger=INFO, A1
log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=org.apache.log4j.SimpleLayout

Otherwise, if you have the source just peek into your code at util/gen/IO.java
at line 953 and after

--

I just did a "mvn test" with log4j 1.2.16 on Mac OS/X 10.6.3 using Java
1.6.0_17 which completed successfully.   CoreTestSuite contains a lot of
different tests, so trying to figure that what is failing really requires
knowing what test failed and seeing all the other stuff that was reported.  It
is unlikely related to the problem you are experiencing with your program, but
if you could provide more info, we can see if we can reproduce it.  Some tests
are a little timing sensitive and fail one time out of ten or so.   Could you
check if the test always fails.


--

Please give the URL or file path to the "installation manual".  Not sure what
you are referencing and perhaps it is obsolete.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org