This forum is so cool,
waiting for answer so long!
waiting for answer so long!
解决方案 »
- java HashMap的hashcode
- float 2.0 double 2.0 int 2 long 2 那个是错误的?
- valuelist的计算问题
- JAVA_HOME should point to a JDK not a JRE???
- 对于这样一种问题,是公司要我加班的理由吗? 凭什么要我加班! 大家给点建议。。。
- 请高手帮忙看是一下是不是内存问题..
- jbpm问题
- WSDL中配置27个字段,在JavaBean中只有20个字段,这样通信是否可以?
- hibernate中,怎么用Criteria做没设关联的多表查询
- 本人新人,求解答关于excel导出问题
- linux 下 tomcat 起动后为何终端显示不了异常信息!!!
- windows xp下ant怎么设置???
改成Logger.getLogger(ExerciseSerializable.class.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>
--》/*(((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