×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    May 2013
    Posts
    8

    Exclamation Problem while integrating a 3rd party logger 'microlog' for 'Nokia Asha 501'

    Hi,

    I want to prepare textual log file on real device while testing my application in actual device. I found one link with suggestion to use microlog but when i am integrating the code i got the following error :
    Referenced Link : http://developer.nokia.com/Community...log_in_Java_ME




    java.lang.NoClassDefFoundError: net/sf/microlog/core/LoggerFactory
    com.nokia.example.HelloWorldMIDlet.<clinit>(HelloWorldMIDlet.java:16)
    java.lang.Class.invoke_clinit(), bci=0
    java.lang.Class.initialize(), bci=125
    java.lang.Class.forName(), bci=0
    com.sun.midp.main.CldcMIDletLoader.newInstance(), bci=1
    com.sun.midp.midlet.MIDletStateHandler.createMIDlet(), bci=63
    com.sun.midp.midlet.MIDletStateHandler.createAndRegisterMIDlet(), bci=17
    com.sun.midp.midlet.MIDletStateHandler.startSuite(), bci=24
    com.sun.midp.main.AbstractMIDletSuiteLoader.startSuite(), bci=38
    com.sun.midp.main.CldcMIDletSuiteLoader.startSuite(), bci=5
    com.sun.midp.main.AbstractMIDletSuiteLoader.runMIDletSuite(), bci=151
    com.sun.midp.main.AppIsolateMIDletSuiteLoader.main(), bci=26
    I am using Nokia Asha SDK 1.0. Following are my codes.

    HelloWorldMIDlet.java

    HTML Code:
    package com.nokia.example;
    
    import javax.microedition.midlet.MIDlet;
    import javax.microedition.lcdui.*;
     
    import net.sf.microlog.core.Logger;
    import net.sf.microlog.core.LoggerFactory;
    import net.sf.microlog.core.PropertyConfigurator;
     
    public class HelloWorldMIDlet extends MIDlet implements CommandListener {
    	private Form form;
    	private Command exitCommand;
    	private Command logCommand;
     
        	// A logger instance for this class
        	private static final Logger log = LoggerFactory.getLogger(HelloWorldMIDlet.class);
     
    	protected void startApp()  {
            	// Configure Microlog for using FileAppender
            	PropertyConfigurator.configure("/microlog_file.properties");
     
            	log.info("FileAppender set!");		
     
    		log.info("Starting app...");
    		form = new Form("Hello, world!");
    		logCommand = new Command("Log", Command.SCREEN, 1);
    		exitCommand = new Command("Exit", Command.EXIT, 1);
    		form.setCommandListener(this);
    		form.addCommand(logCommand);
    		form.addCommand(exitCommand);
    		Display.getDisplay(this).setCurrent(form);
    	}
     
    	protected void destroyApp(boolean arg0)  {
    		log.info("Closing app...");
    		LoggerFactory.shutdown();
    	}
     
    	protected void pauseApp() {}
     
    	public void commandAction(Command c, Displayable d) {
    		if (c == logCommand) {
    			// logging into a file must be done in a separate Thread in Nokia Asha 501.
    			new Thread() {
    				public void run() {
    					log.info("Logging...");					
    				}
    			}.start();
    		}
    		if (c == exitCommand) this.notifyDestroyed();
    	}
    }
    and I have saved the
    microlog_file.properties
    file in /res folder of my project with following contents :

    # This is a simple Microlog configuration file
    microlog.level=DEBUG
    microlog.appender=FileAppender
    microlog.appender.FileAppender.filename=MemoryCard/micrologtestlog.txt
    microlog.formatter=net.sf.microlog.core.format.PatternFormatter
    microlog.formatter.PatternFormatter.pattern=[%P] %c %d (%r): %m %T
    any clue to fix the problem ?


    Thanks
    Last edited by Ekagga Technologies; 2013-10-04 at 15:40.

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,567

    Re: Problem while integrating a 3rd party logger 'microlog' for 'Nokia Asha 501'

    The error/exception message itself is missing, could you share it too?

  3. #3
    Registered User
    Join Date
    May 2013
    Posts
    8

    Re: Problem while integrating a 3rd party logger 'microlog' for 'Nokia Asha 501'

    Hi Wizard,

    Sorry,

    I have't noticed while posting. Now I have edited my post and added the error message. It was

    java.lang.NoClassDefFoundError: net/sf/microlog/core/LoggerFactory
    Regard
    Ekagga

Similar Threads

  1. Replies: 0
    Last Post: 2013-09-22, 13:12
  2. Problem in integrating zxing to j2me for nokia mobile paltform
    By nayal_genext in forum Mobile Java Tools & SDKs
    Replies: 11
    Last Post: 2012-05-31, 13:12
  3. Problem with Hook logger
    By yanamaddinaveen in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2012-04-12, 16:36

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •