FileAppender

Help
2009-11-30
2013-04-26
  • Lawrence cheng

    Lawrence cheng - 2009-11-30

    when I try to use file appender,  I encountered an exception thrown by the 
    library .
    the stack trace is as follows:

    Exception in thread "main" java.lang.ClassCastException: com.sun.cdc.io.j2me.file.Protocol cannot be cast to javax.microedition.io.file.FileConnection
    at net.sf.microlog.midp.file.FileAppender.createFile(FileAppender.java:118)
    at net.sf.microlog.core.appender.AbstractFileAppender.open(AbstractFileAppender.java:72)
    at net.sf.microlog.core.Logger.open(Logger.java:511)
    at net.sf.microlog.core.Logger.log(Logger.java:261)
    at net.sf.microlog.core.Logger.info(Logger.java:361)
    at com.claridy.usb.LogTest.main(LogTest.java:59)

    please , is there anyone got an idea to fix it ?

     
  • Johan Karlsson

    Johan Karlsson - 2009-12-02

    Hi,

    Microlog is designed for CLDC in mind. I have not tried it on the CDC platform.

    But it should be possible to fix. However I do not have access to a CDC based device.

    Regards
    Johan

     
  • Johan Karlsson

    Johan Karlsson - 2009-12-02

    AFAIK CDC should be compatible with CLDC, but I do not know if this goes for JSR-75 (FileConnection). But CDC also has support for writing to a file using the Java SE APIs. Thus it would be rather simple to write a FileAppender that works for CDC.

    Regards
    Johan

     

Log in to post a comment.