LOG4J in serialized Thread

Hi,
I've made a class ClientServer which extends Thread implements Remote, Serializable.
Inside, i've got this attribute : private transient static Logger LOG = Logger.getLogger(ClientServer.class);I've made another class ClientPartenaire which extends UnicastRemoteObject implements Remote
Inside, i've got this attribute : private transient static Logger LOG = Logger.getLogger(ClientPartenaire.class);Then, I've generated stubs for both classes.
Thus, I try to serialize it while using RMI server.
When I do
Naming.rebind("server", new ClientPartenaire ())everything works well
but when I do
Naming.rebind("server", new ClientServer("demeter"));I get this stacktrace : java.rmi.ServerError: Error occurred in server thread; nested exception is:
     java.lang.NoClassDefFoundError: Lorg/apache/log4j/Logger;
     at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:382)
     at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:240)
     at sun.rmi.transport.Transport$1.run(Transport.java:153)
     at java.security.AccessController.doPrivileged(Native Method)
     at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
     at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
     at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
     at java.lang.Thread.run(Thread.java:595)
     at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
     at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
     at sun.rmi.server.UnicastRef.invoke(Unknown Source)
     at sun.rmi.registry.RegistryImpl_Stub.bind(Unknown Source)
     at java.rmi.Naming.bind(Unknown Source)
     at i2.application.demeter.client.RunClient.main(RunClient.java:61)
Caused by: java.lang.NoClassDefFoundError: Lorg/apache/log4j/Logger;
     at java.lang.Class.getDeclaredFields0(Native Method)
     at java.lang.Class.privateGetDeclaredFields(Class.java:2232)
     at java.lang.Class.getDeclaredField(Class.java:1852)
     at java.io.ObjectStreamClass.getDeclaredSUID(ObjectStreamClass.java:1555)
     at java.io.ObjectStreamClass.access$600(ObjectStreamClass.java:47)
     at java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:381)
     at java.security.AccessController.doPrivileged(Native Method)
     at java.io.ObjectStreamClass.<init>(ObjectStreamClass.java:373)
     at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:268)
     at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:504)If I comment all lines using attribute LOG and delete attribute LOG, keeping the import for Logger class, I get this error again. Then, if I delete the import, the error disapears !
Any idea why do I get this error ?
Thanks a lot for your help :)

Thanks for your kind words. On second thoughts, I do
have a doubt regarding threads. In the above program
[or for that matter any program using Threads], is
there some way I can ensure that all the threads
start at the same time? No. All threads can't start at the same time.
My concern is more towards
the fact that I want execution of the next step [in
this case, the System.out.println saying "hello"] to
continue only after all threads have been executed.
I feel that in the approach I have used, there are
chances of a thread finishing before I reach the
join() portion of the code.Does it matter if the thread has finished before you call join? It only means that join will return immediately.
Kaj

Similar Messages

  • What exactly is the main thread?

    please consider this code:
    public class Foo {
        public static void main(String[] args) {
              ((Foo) Thread.currentThread()).bar(); // <--- error. see stack trace below.
        public void bar() {
            System.out.println("--bar()--");
    }stack trace: Exception in thread "main" java.lang.ClassCastException: java.lang.Thread cannot be cast to testingarea.Foo
    So what does this say about the main entry thread? is it an instance of "Foo"? or an instance of java.lang.Thread? If an instance of "Foo" why can't I invoke an instance method on the return value of "Thread.currentThread()"? If the main thread is an instance of java.lang.Thread, then where is the:
    "public void run();" method?
    While I can't think of any practical usage of this knowledge yet, but I'd still like to know. Thanks.
    Edited by: outekko on Mar 17, 2010 6:38 PM

    joshg_75 wrote:
    You should always refer to the javadoc for infomation of a method and its usage. In this case, refer to the javadoc of the Thread class.
    http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Thread.html
    I suggest you also read up on usage of threads.Can you please share a little of your expertise in threads?
    Remember this is the "New To Java" forum, and I am just a beginner as you discovered. Any help from experts would be embraced. Before you became a thread expert, you must have started somewhere. I don't need immediate assistance, but whenever you get the time, why not cut/paste this into your IDE and take a look.
    public class Main {
      static ObjectOutputStream oos;
      static ObjectInputStream ois;
      public static void main(String[] args) {
        try {
          PipedInputStream pin = new PipedInputStream();
          PipedOutputStream pout = new PipedOutputStream(pin);
          oos = new ObjectOutputStream(pout);
          ois = new ObjectInputStream(pin);
          new OutThread().start();
          for(;;) {
            Thread t = (Thread) ois.readObject();
            t.start();
        } catch (Exception e) { e.printStackTrace(); }
          public static class OutThread extends Thread implements Serializable {
            public void run() {
              System.out.println("OutThread::run--> id# " + this.getId());
              try { Thread.sleep(1030); } catch (InterruptedException e) {  }
              try {
                oos.writeObject(this);
                hangAround();
              } catch (Exception e) { e.printStackTrace(); }
            public void hangAround() {
              for (;;) {
                System.out.println("_____waiting around... id# " + this.getId());
                try { Thread.sleep(5030); } catch (InterruptedException e) {  }
    }Not only do I appear to serialize instances of threads, the threads are actually running . So, does a live thread have private, non-transient, "state" that needs to be persisted? If so, why does serialization work? If not, why not write in the API that java.lang.Thread implements Serializable ? Whatever understanding (if any) I had of threads has melted to nothing. I am struggling with your field of expertise; please help me get back on track. Any assistance embraced.
    ps. don't offer friendly criticism by scolding my design of serialized threads. My only goal is to see if I can do it (and learn something along the way).

  • Problem in connect to a store

    I use JavaMail1.3.2 to connect a pop3 store and receive mails. It seemed works OK in first 1 or 8 hours, and after, the process will halt at store.connect step or store.isConnected step,
    For example:
    while(true){
    Log4J.getLogger().debug("Try to connect "+ userName + "'s store!");
    while(!store.isConnected()){
    try{
    Log4J.getLogger().debug("Connect "+ userName + " store...");
    store.connect();
    Log4J.getLogger().debug("Connect to MailBox:"+ userName + " store OK!");
    folder = store.getFolder(folderName);
    Log4J.getLogger().debug("Got "+ userName + "'s folder OK!");
    }catch(Exception e){
    Log4J.getLogger().error("Connect to Mailbox:"+ userName + " store error:" + e.getMessage());
    try {
    Log4J.getLogger().info("Waite " + frequency/60000 + "minutes!");
    Thread.sleep(frequency);
    } catch (InterruptedException e1) {
    Log4J.getLogger().error("Thread error:"+e1.getMessage());
    try {
    Log4J.getLogger().debug("Try to open "+ userName + "'s folder!");

    While running some time, log will stop at �Try to connect username�s store� and no exception or other information output.
    I've set           pro.put("mail.pop3.connectiontimeout",timeoutVal);
              pro.put("mail.pop3.timeout",timeoutVal);
    and seemed it doesn't work.
    Please help me, How does this happen and how to solve it? Thank you very much!

    Hello,
    I get exactly the same issue in my app :
    I have a mail receiver class that looks like that :
    public static Message[] receiveMessages()
              Message[] msgs = new Message[0];
              try
                   log.info("Checking mail on "+CommProperties.getInstance().getPopHost()+"...");
                   if(null==folder||!store.isConnected())
                        log.debug("Folder is null or store is not connected, reinitialization");
                        // -- Try to get hold of the default folder --
                        folder = getStore().getDefaultFolder();
                        if (folder == null) throw new Exception("No default folder");
                        log.debug("Getting INBOX");
                        // -- ...and its INBOX --
                        folder = folder.getFolder("INBOX");
                        if (folder == null) throw new Exception("No POP3 INBOX");
                   log.debug("Open folder for R/W");
                   // -- Open the folder for read-write --
                   folder.open(Folder.READ_WRITE);
                   log.debug("Getting messages");
                   // -- Get the message wrappers and process them --
                   msgs = folder.getMessages();
                   if(msgs.length==0)
                        log.debug("...No new mail in INBOX");
                   log.debug("End");
              catch (Exception ex)
                   log.error("Error while retrieving messages",ex);
              return msgs;
    public static Store getStore() {
              if(null==store || !store.isConnected())
                   try
                        if(store!=null)
                             log.debug("Store not connected : closing");
                             store.close();
                        log.debug("Getting pop3 Store");
                        store = getSession().getStore("pop3");
                        log.debug("Connectting pop3 Store");
                        store.connect(CommProperties.getInstance().getPopHost(), CommProperties.getInstance().getPopUsername(), CommProperties.getInstance().getPopPassword());
                   catch(Exception ex)
                        log.error("Error while getting store",ex);
              return store;
    In this case one session and folder are created. The class detects when a disconnection appears and is able to reconnect.
    This method is called using a jboss service set to run one time a minute.
    When deployed, the receive process runs up to 15 days without interruption. I see in the logs that sometimes, folder gets disconnected and is then reconnected without problem.
    However, after 15 days (sometimes more, sometimes less), the app suddenly freezes after 'log.info("Checking mail on "+CommProperties.getInstance().getPopHost()+"...");'
    So the freeze is due to the "store.isConnected()" not responding...
    Unfortunately, i haven't got any solution. I tried several connect processes (connect/disconnect folder and session each time, reconnect folder each time...) but nothing seems to impact the issue.
    So, guys, any help is very welcome! :-)
    Thanks
    Stephane

  • ExtendService issue

    Hi,
    We're running Coherence 3.5.3 and our setup looks like this:
    2 x storage disabled extend nodes
    7 x storage enabled nodes
    1 x jmx storage nodes
    After a restart of the extend services we intermittently get these errors from the clients that access the cluster via the extend nodes:
    2011-09-13 17:46:13,070 INFO [Logger@1196438616 3.5.3/465] Coherence ( Log4j.CDB:3) - (thread=DefaultPool-2: JSTaskRunnerPlugin$WorkerRunner, member=n/a): Restarting NamedCache: OurCache
    With the root stack cause being:
    Caused by: com.tangosol.net.messaging.ConnectionException: could not establish a Socket connection to one of the remote addresses specified in the "remote-addresses" configuration element; make sure this element contains an address and port of a running TcpAcceptor
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.peer.initiator.TcpInitiator.instantiateConnection(TcpInitiator.CDB:51)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.peer.Initiator.ensureConnection(Initiator.CDB:11)
         at com.tangosol.coherence.component.net.extend.remoteService.RemoteCacheService.openChannel(RemoteCacheService.CDB:5)
         at com.tangosol.coherence.component.net.extend.RemoteService.ensureChannel(RemoteService.CDB:6)
         at com.tangosol.coherence.component.net.extend.remoteService.RemoteCacheService.createRemoteNamedCache(RemoteCacheService.CDB:12)
         at com.tangosol.coherence.component.net.extend.remoteService.RemoteCacheService.ensureCache(RemoteCacheService.CDB:39)
    How ever some incoming connections to the cluster via the extend services are ok. Eventually when the client services keep trying they get a connection and everything is fine. This is until the service is restarted again and connections lost.
    So within 150ms the same task is able to connect at the next attempt (this attempt triggered by me, not Coherence retry):
    2011-09-13 17:46:13,101 INFO [Logger@1196438616 3.5.3/465] Coherence ( Log4j.CDB:3) - (thread=DefaultPool-2: JSTaskRunnerPlugin$WorkerRunner, member=n/a): Connected to 1.2.3.4:1234
    Does anyone have any idea why this might be happening?
    Richard
    Edited by: 885027 on Sep 13, 2011 2:09 PM

    Yes they are on the same server. Two separate services running on different ports. The config for the extend looks like this:
    <proxy-scheme>
    <service-name>ExtendTcpProxyService</service-name>
    <thread-count>200</thread-count>
    <acceptor-config>
    <tcp-acceptor>
    <local-address>
    <port system-property="tangosol.coherence.extend.port">1234</port>
    <reusable>true</reusable>
    </local-address>
    </tcp-acceptor>
    </acceptor-config>
    <autostart>true</autostart>
    </proxy-scheme>
    Richard

  • Open Serial Driver VI runs in user interface thread - why?

    I know the serial port compatibility functions are "phased out" and you should use the newer VISA functions - but why on earth is the open serial driver VI set to run in the user interface thread?  If you happen to use these compatibility VIs your serial communication will be blocked by e.g. a user that opens the calendar view of a date and time control...- and the only reason for that is that that particular VI is running in the user interface.
    Change the thread of that VI - and the serial communication runs as it should, so why is it that that particular VI, unlike all the other VIs in that library, is configured that way?
    MTO

    The S/N dialog is part of the process model.
    For the Sequential Model (SequentialModel.seq), the default S/N dialog in found in the 'PreUUT' sub-sequence and implemented as a DLL call.
    The PreUUT sub-sequence of the SequentialModel is a callback, so you can override it in your own test sequence.
    Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
    If you don't hate time zones, you're not a real programmer.
    "You are what you don't automate"
    Inplaceness is synonymous with insidiousness

  • Log4J - Unable to get Thread number in log4j

    Hi
    Please post me the log4j config file used in Sun One Application server 7.0. I am unable to retrive the thread number in logs using my existing log config file.
    existing log line sample :
    Aug 01 17:48:52 DEBUG [service-j2ee]
    Thanks in advance.
    Vishnu Deevi

    Hi Sadasivam,
        Could you explain me how did you resolved this.
    BR
    Raju

  • Threaded program takes more time than running serially!

    Hello All
    Ive converted my program into a threaded application so as to improve speed. However i found that after converting the execution time is more than it was when the program was non threaded. Im not having any synchronised methods. Any idea what could be the reason ?
    Thanx in advance.

    First, if you are doing I/O, then maybe that's what's taking the time and not the threads. One question that hasn't been asked about your problem:
    How much is the time difference? If it takes like 10 seconds to run the one and 10 minutes to run the threaded version, then that's a big difference. But if it is like 10 seconds vs 11 seconds, I think you should reconsider if it matters so much.
    One analogy that comes to mind about multiple threads vs. sequential code is this:
    With sequentially run code, all the code segments are lined up in order and they all go thru the door one after the other. As one goes thru they all move up closer, thus they know who's going first.
    With multi-threaded code, all the code segments sorta pile up around the door in a big crowd. Some push go thru one at a time while others let them (priority), while other times 2 go for the door at the same time and there might be a few moments of "oh, after you", "no, after you", "oh no, I insist, after you" before one goes thru. So that could introduce some delay.

  • Threaded program takes more time than executing serially!

    Hello All
    Ive converted my program into a threaded application so as to improve speed. However i found that after converting the execution time is more than it was when the program was non threaded. Im not having any synchronised methods. Any idea what could be the reason ?
    Thanx in advance.

    Putting aside fstreams amusing comment, I suspect your
    theads are never yielding (they are sitting in a tight
    loop, thus taking all available procesor power). Try
    adding Thread.sleep(0) at som point in the loop.No. If you just want to encourage one thread to give another thread a turn, use yield, not sleep.
    Note, though, that this may not help your situation. As was pointed out, on a single CPU machine, the only way a multithreaded program will run faster (by which I mean total wall-clock time start to finish) than its single-threaded equivalent is if the 1-thread version spends a lot of time waiting for IO when it could be doing something else. (If it's waiting for IO, but that IO is needed for the big number crunching, then putting the crunching in another thread won't make things any faster.)
    On the other hand, if by "faster" you're referring to a more responsive GUI, then, yes, in general you might expect better GUI response be putting non-GUI stuff in a different thread, but there's no guarantee. Depending on what the other thread does, how much work your GUI has to do, how your VM's scheduler works, how you've split up the work, etc., it may not be any better.
    I know that's not very specific, but neither was your question.

  • Serializing/deserializing a thread

    I have a class
    class A implements Serializable,Runnableand i create some objects out of it.
    First of all, does it matter whether i serialize them and write them to a file, while the threads are running?
    When i deserialize them, are they in the running state?
    Thanks

    First of all, does it matter whether i serialize them
    and write them to a file, while the threads are
    running?Depends on whether the operation makes any sense.
    When i deserialize them, are they in the running state?No.

  • Serializing org.apache.log4j.Level

    Hi,
    I'm working with Log4j and I have to serialize an org.apache.log4j.Level that has not an empty constructor but only more static instaces.
    Is there a workaround to do this ?
    Or How can I use the static instance ?
    Thanks,
    Bye Luigia

    this is my XML file
    <java version="1.5.0_08" class="java.beans.XMLDecoder">
    <object class="org.apache.log4j.net.SyslogAppender">
    <void property="name">
    <string>my.syslog</string>
    </void>
    <void property="SyslogHost">
    <string>localhost</string>
    </void>
    <void property="Facility">
    <string>local0</string>
    </void>
    How can I specify the "Threshold" Property of the SyslogAppender at "INFO" or int value?
    The threshold is a org.apache.log4j.Level.

  • Please help me with this error message on my lost Crashed Thread:  1  Dispatch queue: NSOperationQueue Serial Queue  Exception Type:  EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000

    I was organizing my contatcs when suddenly it disappeared and got this error message.

    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Console in the icon grid.
    Step 1
    For this step, the title of the Console window should be All Messages. If it isn't, select
              SYSTEM LOG QUERIES ▹ All Messages
    from the log list on the left. If you don't see that list, select
              View ▹ Show Log List
    from the menu bar at the top of the screen.
    In the top right corner of the Console window, there's a search box labeled Filter. Initially the words "String Matching" are shown in that box. Enter the name of the crashed application or process. For example, if iTunes crashed, you would enter "iTunes" (without the quotes.)
    Each message in the log begins with the date and time when it was entered. Select the messages from the time of the last crash, if any. Copy them to the Clipboard by pressing the key combination command-C. Paste into a reply to this message by pressing command-V.
    ☞ The log contains a vast amount of information, almost all of which is irrelevant to solving any particular problem. When posting a log extract, be selective. A few dozen lines are almost always more than enough.
    Please don't indiscriminately dump thousands of lines from the log into this discussion.
    Please don't post screenshots of log messages—post the text.
    ☞ Some private information, such as your name, may appear in the log. Anonymize before posting.
    Step 2
    In the Console window, select
              DIAGNOSTIC AND USAGE INFORMATION ▹ User Diagnostic Reports
    (not Diagnostic and Usage Messages) from the log list on the left. There is a disclosure triangle to the left of the list item. If the triangle is pointing to the right, click it so that it points down. You'll see a list of crash reports. The name of each report starts with the name of the process, and ends with ".crash". Select the most recent report related to the process in question. The contents of the report will appear on the right. Use copy and paste to post the entire contents—the text, not a screenshot.
    I know the report is long, maybe several hundred lines. Please post all of it anyway.
    If you don't see any reports listed, but you know there was a crash, you may have chosen Diagnostic and Usage Messages from the log list. Choose DIAGNOSTIC AND USAGE INFORMATION instead.
    In the interest of privacy, I suggest that, before posting, you edit out the “Anonymous UUID,” a long string of letters, numbers, and dashes in the header of the report, if it’s present (it may not be.)
    Please don’t post other kinds of diagnostic report—they're very long and rarely helpful.

  • Java - log4j - java.io.OptionalDataException

    I'm running 10.6.3 w/ the latest Java install. I'm trying to get a genomics program to work - I didn't use to have problems with it, but now I keep getting this message. I've spent hours messing with the CLASSPATH and other random things, but none of it helps. If I do a simple hello world program - it works. I downloaded the latest log4j - when I use the installation manual's suggested test program, the compiler lists 6 errors just trying to compile it. Does anyone know what is going on? Of course, when I look at sun.com, they state the following for java.io.OptionalDataException:
    "public class OptionalDataException. extends ObjectStreamException
    Exception indicating the failure of an object read operation due to unread primitive data, or the end of data belonging to a serialized object in the stream. This exception may be thrown in two cases:
    An attempt was made to read an object when the next element in the stream is primitive data. In this case, the OptionalDataException's length field is set to the number of bytes of primitive data immediately readable from the stream, and the eof field is set to false.
    An attempt was made to read past the end of data consumable by a class-defined readObject or readExternal method. In this case, the OptionalDataException's eof field is set to true, and the length field is set to 0. "
    Well that's not very helpful to a total java newbie like myself. It seems like there are many things screwed up on my system since even though I downloaded log4j, and then also installed the jakarta-log4j port through macports, neither of these things resolved the issue.
    Please help!
    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)
    log4j:WARN No appenders could be found for logger (util.gen.IO).
    log4j:WARN Please initialize the log4j system properly.
    Indexing intervals by chromosome and start position
    Exception in thread "main" java.lang.NullPointerException
    at trans.main.LoadIntervalOligoInfo.run(LoadIntervalOligoInfo.java:49)
    at trans.main.LoadIntervalOligoInfo.main(LoadIntervalOligoInfo.java:192)

    But here's my guess anyway, given their source:
    You didn't invoke the program in such a way as to provide an "i" argument to LoadIntervalOligoInfo. (You may be invoking the program via a shell script that may obscure this.)
    Either that, or you gave an invalid argument, or the file is corrupted.
    Then in the run() method of LoadIntervalOligoInfo, it tries to read an array of "intervals" from that file.
    The read failed, giving the first part of the error message you see. As part of handling that error, it tried to use log4j, but it wasn't configured properly, thus giving the log4j message you see. (it writes that error to standard error) This happened in util.gen.IO, which you can see from this error message:
    log4j:WARN No appenders could be found for logger (util.gen.IO).Then, even though there was an error, processing continued on. Back in LoadInterfalOligoInfo, it tried to read from the "intervals" array, but the array was null because of the above error in util.gen.IO. That produced a NullPointerException, resulting in the rest of the error message you posted.
    What you can do:
    1) configure log4j to report errors from util.gen.IO. This will give you some more debug info.
    2) try to determine if the intervals file you're reading from is corrupted. I have no idea how you'd do that.
    3) ask the maintainers of this software for help.
    Their code is a little clumsy. It does some odd things. Clearly written by smart people who are not normally computer programmers.

  • Snow Leopard & log4j

    I'm running Mac OS 10.6.3 w/ the latest Java install. I'm trying to get a genomics program to work - I didn't use to have problems with it, but now I keep getting this message. I've spent hours messing with the CLASSPATH and other random things, but none of it helps. If I do a simple hello world program - it works. I downloaded the latest log4j - when I use the installation manual's suggested test program, the compiler lists 6 errors just trying to compile it. Does anyone know what is going on? Of course, when I look at sun.com, they state the following for java.io.OptionalDataException:
    Exception indicating the failure of an object read operation due to unread primitive data, or the end of data belonging to a serialized object in the stream. This exception may be thrown in two cases: An attempt was made to read an object when the next element in the stream is primitive data. In this case, the OptionalDataException's length field is set to the number of bytes of primitive data immediately readable from the stream, and the eof field is set to false.
    An attempt was made to read past the end of data consumable by a class-defined readObject or readExternal method. In this case, the OptionalDataException's eof field is set to true, and the length field is set to 0. "
    Well that's not very helpful to a total java newbie like myself. I had a hard enough time learning perl - and I really don't need java, I just want to run this program, get my results, and move on. It seems like there are many things screwed up on my system since even though I downloaded log4j, and then also installed the jakarta-log4j port through macports, neither of these things resolved the issue. I tried to install log4j through maven, but that didn't work - I did $ mvn package --> it goes through but fails at the end when it's running the org.apache.log4j.CoreTestSuite: [ERROR] BUILD ERROR
    [INFO] ------------------------------------------------------------------------
    [INFO] An Ant BuildException has occured: The following error occurred while executing this line:
    /Downloads/apache-log4j-1.2.16/tests/build.xml:187: Test org.apache.log4j.CoreTestSuite failed
    Please help!
    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)
    log4j:WARN No appenders could be found for logger (util.gen.IO).
    log4j:WARN Please initialize the log4j system properly.
    Indexing intervals by chromosome and start position
    Exception in thread "main" java.lang.NullPointerException
    at trans.main.LoadIntervalOligoInfo.run(LoadIntervalOligoInfo.java:49)
    at trans.main.LoadIntervalOligoInfo.main(LoadIntervalOligoInfo.java:192)

    But here's my guess anyway, given their source:
    You didn't invoke the program in such a way as to provide an "i" argument to LoadIntervalOligoInfo. (You may be invoking the program via a shell script that may obscure this.)
    Either that, or you gave an invalid argument, or the file is corrupted.
    Then in the run() method of LoadIntervalOligoInfo, it tries to read an array of "intervals" from that file.
    The read failed, giving the first part of the error message you see. As part of handling that error, it tried to use log4j, but it wasn't configured properly, thus giving the log4j message you see. (it writes that error to standard error) This happened in util.gen.IO, which you can see from this error message:
    log4j:WARN No appenders could be found for logger (util.gen.IO).Then, even though there was an error, processing continued on. Back in LoadInterfalOligoInfo, it tried to read from the "intervals" array, but the array was null because of the above error in util.gen.IO. That produced a NullPointerException, resulting in the rest of the error message you posted.
    What you can do:
    1) configure log4j to report errors from util.gen.IO. This will give you some more debug info.
    2) try to determine if the intervals file you're reading from is corrupted. I have no idea how you'd do that.
    3) ask the maintainers of this software for help.
    Their code is a little clumsy. It does some odd things. Clearly written by smart people who are not normally computer programmers.

  • Issue with Log4j

    hi i'm using Log4j for logging. And using xml layout for logging.
    I wants to display these log files using xslt.
    But the messages are logged in to the xml file as follows
    <log4j:event logger="etisbew.logger.InitWebApplicationServlet" timestamp="1180506072784" level="INFO" thread="main">
    <log4j:message><![CDATA[[Etisbew] initialization started]]></log4j:message>
    </log4j:event>
    <log4j:event logger="etisbew.logger.InitWebApplicationServlet" timestamp="1180506072784" level="INFO" thread="main">
    <log4j:message><![CDATA[0[Etisbew] initialization finished]]></log4j:message>
    </log4j:event>
    This is not containing the root element and namespace log4j defined.
    It leads to transformation error saying that not well formed.
    How can manage it from the Log4j side.
    Thank you,
    Raj

    First, it's not returned as an interface, it's returned as a serialized object. What the client thinks it is is not relevant, and neither is either the return type or any cast in your return statement. What matters is the object you are returning.
    Second, if any of the object's methods has a Logger object as a parameter or return value, the class definition depends on Logger and requires Logger.class to be loadable otherwise the class can't be loaded.

  • How many computers can you authorize with one serial number?

    Hey guys.
    I'm thinking about buying a 2nd Mac, but I'm just curious how many total computers you have authorize Logic studio on at one time (my guess would be 3 but I hope more).
    Please let me know if you can.
    Thanks,
    Nathan

    I'll copy my post from the other thread:
    I don't know for the others but in my retail package ((not upgrade) I found two serial numbers. Though I haven't got time yet to try the second serial number on my MacBook, my logic says that with two different serials I could run both macs simultaneously and be on the network. But, my logic fails so often so it's better to shut my mouth, install Logic on MacBook and come back here again.

Maybe you are looking for