问题描述
这是什么情况啊?c:helloworldbuild.xml:71:java.lang.NoClassDefFoundError:org/slf4joryatorg.hibernate.tool.hbm2ddl.SchemaExport.<clinit>(SchemaExp)atorg.hibernate.tool.ant.Hbm2DDLExporterTask.execute(Hbm2DDLk.java:45)atorg.hibernate.tool.ant.HibernateToolTask.execute(Hibernateva:171)atorg.apache.tools.ant.UnknownElement.execute(UnknownElementatsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodatsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcjava:62)atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingsorImpl.java:43)atjava.lang.reflect.Method.invoke(Method.java:483)atorg.apache.tools.ant.dispatch.DispatchUtils.execute(Dispata:106)atorg.apache.tools.ant.Task.perform(Task.java:348)atorg.apache.tools.ant.Target.execute(Target.java:435)atorg.apache.tools.ant.Target.performTasks(Target.java:456)atorg.apache.tools.ant.Project.executeSortedTargets(Project.atorg.apache.tools.ant.Project.executeTarget(Project.java:13atorg.apache.tools.ant.helper.DefaultExecutor.executeTargetscutor.java:41)atorg.apache.tools.ant.Project.executeTargets(Project.java:1atorg.apache.tools.ant.Main.runBuild(Main.java:851)atorg.apache.tools.ant.Main.startAnt(Main.java:235)atorg.apache.tools.ant.launch.Launcher.run(Launcher.java:280atorg.apache.tools.ant.launch.Launcher.main(Launcher.java:10Causedby:java.lang.ClassNotFoundException:org.slf4j.LoggerFactoryatjava.net.URLClassLoader$1.run(URLClassLoader.java:372)atjava.net.URLClassLoader$1.run(URLClassLoader.java:361)atjava.security.AccessController.doPrivileged(NativeMethod)atjava.net.URLClassLoader.findClass(URLClassLoader.java:360)atjava.lang.ClassLoader.loadClass(ClassLoader.java:424)atjava.lang.ClassLoader.loadClass(ClassLoader.java:357)...20more<!--Exportthedatabaseschema--><targetname="schemaexport"depends="compile,copymetafiles"description="ExportsageneratedschematoDBandfile"><hibernatetooldestdir="${basedir}"><classpathpath="${build.dir}"/><configurationconfigurationfile="${build.dir}/hibernate.cfg.xml"/><hbm2ddldrop="true"create="true"export="true"outputfilename="${proj.shortname}-ddl.sql"delimiter=";"format="true"/></hibernatetool></target>
解决方案
解决方案二:
项目有没有缺少slf4j-api.jar和slf4j-log4j12.jar这两个jar包