连接mysql发生以下错误,请问是怎么回事?谢谢了!

发布于 2021-11-12 13:01:00 字数 1078 浏览 810 评论 9

数据库连接测试如下

DLOG4J snoop


 Database

  • Database: MySQL 5.0.15-nt
  • Driver: MySQL-AB JDBC Driver (mysql-connector-java-5.0.4 ( $Date: 2006-10-19 17:47:48 +0200 (Thu, 19 Oct 2006) $, $Revision: 5908 $ ))
  • Username: root@localhost
  • URL: jdbc:mysql://localhost:3306/dlog
访问页面错误信息如下:
org.hibernate.MappingException: Unknown entity: com.liusoft.dlog4j.beans.SiteBean
	at org.hibernate.impl.SessionFactoryImpl.getEntityPersister(Unknown Source)
	at org.hibernate.event.def.DefaultLoadEventListener.onLoad(Unknown Source)
	at org.hibernate.impl.SessionImpl.fireLoad(Unknown Source)
	at org.hibernate.impl.SessionImpl.get(Unknown Source)
	at org.hibernate.impl.SessionImpl.get(Unknown Source)
	at com.liusoft.dlog4j.dao.DAO.getBean(DAO.java:147)
	at com.liusoft.dlog4j.dao.SiteDAO.getSiteByID(SiteDAO.java:73)
	at com.liusoft.dlog4j.velocity.DLOG_VelocityTool.site(DLOG_VelocityTool.java:395)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(9

深巷少女 2021-11-16 06:25:01
java.lang.NullPointerException
	at com.liusoft.dlog4j.dao.DAO.getBean(DAO.java:145)
	at com.liusoft.dlog4j.dao.SiteDAO.getSiteByID(SiteDAO.java:115)
	at com.liusoft.dlog4j.velocity.DLOG_VelocityTool.site(DLOG_VelocityTool.java:395)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:267)
	at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:197)
	at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:175)
	at org.apache.velocity.runtime.parser.node.ASTReference.value(ASTReference.java:327)
	at org.apache.velocity.runtime.parser.node.ASTExpression.value(ASTExpression.java:51)
	at org.apache.velocity.runtime.parser.node.ASTSetDirective.render(ASTSetDirective.java:95)
	at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:55)
	at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:70)
	at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:230)
	at org.apache.velocity.runtime.directive.Parse.render(Parse.java:181)
	at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:114)
	at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:230)
	at org.apache.velocity.runtime.directive.Parse.render(Parse.java:181)
	at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:114)
	at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:55)
	at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:230)
	at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:89)
	at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:230)
	at org.apache.velocity.runtime.directive.VelocimacroProxy.render(VelocimacroProxy.java:172)
	at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:114)
	at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:230)
	at org.apache.velocity.runtime.directive.Parse.render(Parse.java:181)
	at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:114)
	at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:55)
	at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:230)
	at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:89)
	at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:230)
	at org.apache.velocity.Template.merge(Template.java:256)
	at org.apache.velocity.tools.view.servlet.VelocityLayoutServlet.mergeTemplate(Unknown Source)
	at org.apache.velocity.tools.view.servlet.VelocityViewServlet.doRequest(Unknown Source)
	at com.liusoft.dlog4j.servlet.DLOG_VelocityServlet.doRequest(DLOG_VelocityServlet.java:100)
	at org.apache.velocity.tools.view.servlet.VelocityViewServlet.doGet(Unknown Source)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:284)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
	at com.liusoft.dlog4j.servlet.DLOG_HibernateFilter.doFilter(DLOG_HibernateFilter.java:73)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:233)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
	at com.liusoft.dlog4j.servlet.GZIPFilter.doFilter(GZIPFilter.java:60)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:233)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
	at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:245)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:199)
	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:195)
	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164)
	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:156)
	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
	at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:211)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:805)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:696)
	at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:605)
	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:677)
	at java.lang.Thread.run(Thread.java:595)
帮我看看是什么原因.
拥有 2021-11-16 06:25:01

错误不少啊

温柔少女心 2021-11-16 06:25:01

hibernate好久没接触了....想代码了

静谧 2021-11-16 06:24:58

at com.liusoft.dlog4j.dao.DAO.getBean(DAO.java:147)
at com.liusoft.dlog4j.dao.SiteDAO.getSiteByID(SiteDAO.java:73)
at com.liusoft.dlog4j.velocity.DLOG_VelocityTool.site(DLOG_VelocityTool.java:395)

这个看看 at com.liusoft.dlog4j.dao.DAO.getBean(DAO.java:147)

醉生梦死 2021-11-16 06:24:49

你是启动时错还是运行时错?

是用eclipse运行的吗

吃颗糖壮壮胆 2021-11-16 06:24:49

 SESSION FACTORY中的MAPPING RESOURCE没定义吧

勿忘初心 2021-11-16 06:24:17

引用来自“红薯”的帖子

目录:classescomliusoftdlog4jhbm

猫性小仙女 2021-11-16 06:20:11

引用来自“红薯”的帖子

检查一下那些hbm文件有没有拷贝到 classes 目录下相应的路径?

清欢 2021-11-12 23:04:00

检查一下那些hbm文件有没有拷贝到 classes 目录下相应的路径?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文