This forum is so cool,
waiting for answer so long!

解决方案 »

  1.   

    private static final Logger fLogger =Logger.getLogger(ExerciseSerializable.class.getPackage().getName());你的这个日志器用的是log4j的啊 ,那你在import包的时候为什么用的是java.util.logging.*;???????????????????????????
      

  2.   

    还有就是把Logger.getLogger(ExerciseSerializable.class.getPackage().getName());
    改成Logger.getLogger(ExerciseSerializable.class.getName());
    就可以了!
      

  3.   

    把把Logger.getLogger(ExerciseSerializable.class.getPackage().getName());
    改成Logger.getLogger(ExerciseSerializable.class.getName());
    时,出现下面异常:
    还有这个源程序你可以在http://java.about.com/gi/dynamic/offsite.htm?zi=1/XJ&sdn=java&zu=http%3A%2F%2Fwww.javapractices.com%2Findex.cjp
    得到,,再就谢谢你的热心帮助!
    D:\zjh>java ExerciseSerializable
    Exception in thread "main" java.lang.NoClassDefFoundError: ExerciseSerializable
    (wrong name: zjh/ExerciseSerializable)
            at java.lang.ClassLoader.defineClass0(Native Method)
            at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
            at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
    3)
            at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
            at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
            at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
            at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
            at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)D:\zjh>
      

  4.   

    这是jdk1.5.chm说的
    --》/*(((private static final Logger fLogger =Logger.getLogger(ExerciseSerializable.class.getPackage().getName());你的这个日志器用的是log4j的啊 ,那你在import包的时候为什么用的是java.util.logging.*;???????????????????????????
    )))*/
    java.util.logging 
    Class Logger
    java.lang.Object
      java.util.logging.Loggerpublic static Logger getLogger(String name)
    Find or create a logger for a named subsystem. If a logger has already been created with the given name it is returned. Otherwise a new logger is created. 
    If a new logger is created its log level will be configured based on the LogManager configuration and it will configured to also send logging output to its parent's handlers. It will be registered in the LogManager global namespace. 
    Parameters:
    name - A name for the logger. This should be a dot-separated name and should normally be based on the package name or class name of the subsystem, such as java.net or javax.swing