log4j- org.hibernate.exception.GenericJDBCException

问题描述

org.hibernate.exception.GenericJDBCException

log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "AWT-EventQueue-0" org.hibernate.exception.GenericJDBCException: Cannot open connection
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:426)
at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:140)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1551)
at org.hibernate.loader.Loader.doQuery(Loader.java:673)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
at org.hibernate.loader.Loader.doList(Loader.java:2217)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2108)
at org.hibernate.loader.Loader.list(Loader.java:2103)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:340)
at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1122)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
at com.mwq.hibernate.BaseDao.queryList(BaseDao.java:31)
at com.mwq.hibernate.Dao.queryManagerOfNatural(Dao.java:141)
at com.mwq.frame.LandFrame.(LandFrame.java:100)
at com.mwq.PersonnelManage.land(PersonnelManage.java:32)
at com.mwq.PersonnelManage$1.run(PersonnelManage.java:26)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by: java.sql.SQLException: Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
The Connection descriptor used by the client was:
127.0.0.1:1521:DBSQL

at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:261)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:387)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:414)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:154)
at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:110)
at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:423)
... 26 more

解决方案

org.hibernate.exception.GenericJDBCException JDBC......
答案就在这里:org.hibernate.exception.GenericJDBCException

解决方案二:

检查jdbc连接配置参数是否正确。

解决方案三:

数据库连接配置是否正确啊

时间: 2025-01-01 07:30:31

log4j- org.hibernate.exception.GenericJDBCException的相关文章

hibernate save-hibernate执行保存对象时出现异常:org.hibernate.exception.GenericJDBCException

问题描述 hibernate执行保存对象时出现异常:org.hibernate.exception.GenericJDBCException hibernate执行保存对象时出现异常:org.hibernate.exception.GenericJDBCException: could not insert: [com.hibernate.domain.User] Caused by: java.sql.SQLException: Field 'user_id' doesn't have a d

hibernate发生GenericJDBCException: could not insert collection

问题描述 程序大概如下FileItemfileItem=(FileItem)fileItr.next();//System.out.println(item.getString());if(!fileItem.isFormField()){Stringname=fileItem.getName();try{Filefile=newFile(saveDir+name);//上传的文件Documentdocument=newDocument();document.setDocLocation(sav

ssh开发- org.hibernate.exception.SQLGrammarException: could not insert:

问题描述 org.hibernate.exception.SQLGrammarException: could not insert: 用的框架 Struts2+Hibernate3+Spring3 数据库为:SQLServer2005 环境是:Myeclipse8.5 服务器为:apache-tomcat-8.0.0-RC1 问题:在我尝试通过struts2 action向数据库插入数据是出现异常. 异常信息如下: Struts Problem Report Struts has detect

java-org.hibernate.exception.SQLGrammarException: could not execute query

问题描述 org.hibernate.exception.SQLGrammarException: could not execute query 大神们,看看这maven项目的异常,登陆成功之后,就显示json返回格式异常,query也不能查找了 :[DEBUG] 10:51:35[120906] [ http-5555-3] [000-] [] [AccessControlAdvice] com.wisetop.wtp.core.svc.ServiceException: 按id查找应用系统

org.hibernate.exception.SQLGrammarException: could not execute query

问题描述 StrutsProblemReportStrutshasdetectedanunhandledexception:Messages:ORA-00932:???????:??NUMBER,????BINARYcouldnotexecutequeryFile:oracle/jdbc/driver/SQLStateMapping.javaLinenumber:91-----------------------------------------------------------------

请教:org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch ...

问题描述 org.hibernate.exception.SQLGrammarException:CouldnotexecuteJDBCbatchupdateatorg.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)atorg.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)atorg.hiber

org.hibernate.exception.DataException

问题描述 org.hibernate.exception.DataException org.hibernate.exception.DataException:could not load an entity[com...实体类#类中的一个字段],有哪位大神知道帮忙分析下这个错误的原因 解决方案 org.hibernate.exception.ConstraintViolationExceptionnested exception is org.hibernate.exception.Data

org.hibernate.exception.JDBCConnectionException: could not load an entity:

问题描述 javax.servlet.ServletException:org.hibernate.exception.JDBCConnectionException:couldnotloadanentity:[cn.sdau.wxxyjw.domain.Announce#4]org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:515)org.apache.struts2.dispatcher.Filter

1对1主键关联, 使用jpa映射, 添加记录时报org.hibernate.exception.ConstraintViolationException

问题描述 实体代码:package entity;import javax.persistence.CascadeType;import javax.persistence.Entity;import javax.persistence.GeneratedValue;import javax.persistence.Id;import javax.persistence.OneToOne;import javax.persistence.PrimaryKeyJoinColumn;import j