hibernate+struts连接数据库报错WARN: SQL Error: 102, SQLState: S0001怎么解决?

请问一下这种是哪里出问题了,数据库在test driver那里可以连接上,映射文件是直接生成的没有改动过,这个错到底是哪里产生的啊……QAQ
5月 09, 2019 4:17:27 下午 org.hibernate.hql.internal.QueryTranslatorFactoryInitiator initiateService
INFO: HHH000397: Using ASTQueryTranslatorFactory
5月 09, 2019 4:17:27 下午 org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions
WARN: SQL Error: 102, SQLState: S0001
5月 09, 2019 4:17:27 下午 org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions
ERROR: “@P0”附近有语法错误。
5月 09, 2019 4:17:27 下午 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet [jsp] in context with path [/bookstore] threw exception [org.hibernate.exception.SQLGrammarException: could not extract ResultSet] with root cause
com.microsoft.sqlserver.jdbc.SQLServerException: “@P0”附近有语法错误。
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:217)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1655)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:440)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:385)
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7505)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:2445)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:191)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:166)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeQuery(SQLServerPreparedStatement.java:297)
at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:70)
at org.hibernate.loader.Loader.getResultSet(Loader.java:2115)
at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1898)
at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1874)
at org.hibernate.loader.Loader.doQuery(Loader.java:919)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:336)
at org.hibernate.loader.Loader.doList(Loader.java:2610)
at org.hibernate.loader.Loader.doList(Loader.java:2593)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2422)
at org.hibernate.loader.Loader.list(Loader.java:2417)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:501)
at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:371)
at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:216)
at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1339)
at org.hibernate.internal.QueryImpl.list(QueryImpl.java:87)
at org.apache.jsp.MyJsp_jsp._jspService(MyJsp_jsp.java:187)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:476)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:385)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:329)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:200)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:834)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1415)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.base/java.lang.Thread.run(Thread.java:844)

3个回答

能贴下你的配置文件看看吗

这不是连接问题,数据已经连上了,应该是你的sql语句有问题

QueryTranslatorImpl.java:371 这个是你自己写的类吧 371行是啥 贴出来看看

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
hibernate+struts连接数据库报错WARN: SQL Error: 102, SQLState: S0001怎么解决?

请问一下这种是哪里出问题了,数据库在test driver那里可以连接上,映射文件是直接生成的没有改动过,这个错到底是哪里产生的啊……QAQ 5月 09, 2019 4:17:27 下午 org.hibernate.hql.internal.QueryTranslatorFactoryInitiator initiateService INFO: HHH000397: Using ASTQueryTranslatorFactory 5月 09, 2019 4:17:27 下午 org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions WARN: SQL Error: 102, SQLState: S0001 5月 09, 2019 4:17:27 下午 org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions ERROR: “@P0”附近有语法错误。 5月 09, 2019 4:17:27 下午 org.apache.catalina.core.StandardWrapperValve invoke 严重: Servlet.service() for servlet [jsp] in context with path [/bookstore] threw exception [org.hibernate.exception.SQLGrammarException: could not extract ResultSet] with root cause com.microsoft.sqlserver.jdbc.SQLServerException: “@P0”附近有语法错误。 at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:217) at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1655) at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:440) at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:385) at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7505) at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:2445) at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:191) at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:166) at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeQuery(SQLServerPreparedStatement.java:297) at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:70) at org.hibernate.loader.Loader.getResultSet(Loader.java:2115) at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1898) at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1874) at org.hibernate.loader.Loader.doQuery(Loader.java:919) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:336) at org.hibernate.loader.Loader.doList(Loader.java:2610) at org.hibernate.loader.Loader.doList(Loader.java:2593) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2422) at org.hibernate.loader.Loader.list(Loader.java:2417) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:501) at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:371) at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:216) at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1339) at org.hibernate.internal.QueryImpl.list(QueryImpl.java:87) at org.apache.jsp.MyJsp_jsp._jspService(MyJsp_jsp.java:187) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:476) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:385) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:329) at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:200) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:834) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1415) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.base/java.lang.Thread.run(Thread.java:844)

Hibernate 报错:SQL Error: 923, SQLState: 42000

今天在写注册界面时,添加用户数据报错: # WARN[org.hibernate.util.JDBCExceptionReporter] - SQL Error: 923, SQLState: 42000 # ERROR [org.hibernate.util.JDBCExceptionReporter] - ORA-00923: 未找到要求的 FROM 关键字 抛出的异常为: ## org.springframework.dao.InvalidDataAccessResourceUsageException: could not retrieve GUID; nested exception is org.hibernate.exception.SQLGrammarException: could not retrieve GUID org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:630) org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412) org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:424) org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374) org.springframework.orm.hibernate3.HibernateTemplate.save(HibernateTemplate.java:694) com.is.clut.dao.support.hibernate.EntityDaoHibernateImpl.add(EntityDaoHibernateImpl.java:21) com.is.clut.service.support.EntityServiceImpl.add(EntityServiceImpl.java:34) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:606) org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) com.sun.proxy.$Proxy6.add(Unknown Source) com.is.clut.web.action.system.RegistAction.regist(RegistAction.java:49) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:606) com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:441) com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:280) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:243) com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:165) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:252) org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:179) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:130) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:165) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:179) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52) org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488) org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:395) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) 查了好半天,不知道是什么问题。小白刚开始ibernate学习Hibernate,求大神帮助。

SQL Error: 17008, SQLState: null

每次程序运行一段时间以后,就报此错 08-08-17 09:55:29 WARN JDBCExceptionReporter:71 - SQL Error: 17008, SQLState: null 08-08-17 09:55:29 ERROR JDBCExceptionReporter:72 - 关闭的连接 08-08-17 09:55:29 WARN JDBCExceptionReporter:71 - SQL Error: 17008, SQLState: null 08-08-17 09:55:29 ERROR JDBCExceptionReporter:72 - 关闭的连接 org.hibernate.exception.GenericJDBCException: could not execute query Caused by: java.sql.SQLException: 关闭的连接 我的的struts2 +hibernate3 dao是 public Userinfo checkUserinfo(String name, String pwd) { Session session = HibernateSessionFactory.getSession(); Transaction ta = session.beginTransaction(); Userinfo userinfo = (Userinfo) session.createCriteria(Userinfo.class) .add(Expression.eq("userinfoName", name)).add( Expression.eq("userinfoPassword", pwd)).uniqueResult(); ta.commit(); HibernateSessionFactory.closeSession(); return userinfo; } [b]问题补充:[/b] package com.shop.hibernate.util; import org.hibernate.HibernateException; import org.hibernate.Session; import org.hibernate.cfg.Configuration; /** * Configures and provides access to Hibernate sessions, tied to the * current thread of execution. Follows the Thread Local Session * pattern, see {@link http://hibernate.org/42.html }. */ public class HibernateSessionFactory { /** * Location of hibernate.cfg.xml file. * Location should be on the classpath as Hibernate uses * #resourceAsStream style lookup for its configuration file. * The default classpath location of the hibernate config file is * in the default package. Use #setConfigFile() to update * the location of the configuration file for the current session. */ private static String CONFIG_FILE_LOCATION = "/hibernate.cfg.xml"; private static final ThreadLocal<Session> threadLocal = new ThreadLocal<Session>(); private static Configuration configuration = new Configuration(); private static org.hibernate.SessionFactory sessionFactory; private static String configFile = CONFIG_FILE_LOCATION; static { try { configuration.configure(configFile); sessionFactory = configuration.buildSessionFactory(); } catch (Exception e) { System.err .println("%%%% Error Creating SessionFactory %%%%"); e.printStackTrace(); } } private HibernateSessionFactory() { } /** * Returns the ThreadLocal Session instance. Lazy initialize * the <code>SessionFactory</code> if needed. * * @return Session * @throws HibernateException */ public static Session getSession() throws HibernateException { Session session = (Session) threadLocal.get(); if (session == null || !session.isOpen()) { if (sessionFactory == null) { rebuildSessionFactory(); } session = (sessionFactory != null) ? sessionFactory.openSession() : null; threadLocal.set(session); } return session; } /** * Rebuild hibernate session factory * */ public static void rebuildSessionFactory() { try { configuration.configure(configFile); sessionFactory = configuration.buildSessionFactory(); } catch (Exception e) { System.err .println("%%%% Error Creating SessionFactory %%%%"); e.printStackTrace(); } } /** * Close the single hibernate session instance. * * @throws HibernateException */ public static void closeSession() throws HibernateException { Session session = (Session) threadLocal.get(); threadLocal.set(null); if (session != null) { session.close(); } } /** * return session factory * */ public static org.hibernate.SessionFactory getSessionFactory() { return sessionFactory; } /** * return session factory * * session factory will be rebuilded in the next call */ public static void setConfigFile(String configFile) { HibernateSessionFactory.configFile = configFile; sessionFactory = null; } /** * return hibernate configuration * */ public static Configuration getConfiguration() { return configuration; } } 这是自动生成的 [b]问题补充:[/b] ------------------------------------------------------ Caused by: java.sql.SQLException: 关闭的连接 at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134) at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179) at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269) at oracle.jdbc.driver.OracleConnection.privatePrepareStatement(OracleConnection.java:895) at oracle.jdbc.driver.OracleConnection.prepareStatement(OracleConnection.java:802) at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:396) at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:334) at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:88) at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1162) at org.hibernate.loader.Loader.doQuery(Loader.java:390) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:218) at org.hibernate.loader.Loader.doList(Loader.java:1593) ... 122 more

紧急求救,在线等,hibernate插入更新数据报错

各位好: hibernate报错麻烦各位看一下,在本地和测试环境都没有问题。提到生产上后,就一直报这个错 2016-05-07 12:16:08:WARN http-8888-3 org.hibernate.util.JDBCExceptionReporter - SQL Error: 1, SQLState: 23000 2016-05-07 12:16:08:ERROR http-8888-3 org.hibernate.util.JDBCExceptionReporter - ORA-00001: unique constraint (POSBOSS.SYS_C00134274) violated 2016-05-07 12:16:08:WARN http-8888-3 org.hibernate.util.JDBCExceptionReporter - SQL Error: 1, SQLState: 23000 2016-05-07 12:16:08:ERROR http-8888-3 org.hibernate.util.JDBCExceptionReporter - ORA-00001: unique constraint (POSBOSS.SYS_C00134274) violated 2016-05-07 12:16:08:ERROR http-8888-3 org.hibernate.event.def.AbstractFlushingEventListener - Could not synchronize database state with session org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:202) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:235) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:139) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:297) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:985) at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:333) at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106) at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:655) at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:732) at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:701) at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:321) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy45.getShrTranFlow(Unknown Source) at com.hkrt.app.offlinepos.action.ShaFeeAction.agentShaTranFlowRun(ShaFeeAction.java:172) 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:597) at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:450) at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:289) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:252) at com.hkrt.app.offlinepos.interceptor.ActionParamInterceptor.intercept(ActionParamInterceptor.java:28) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.hkrt.app.offlinepos.interceptor.AuthorityInterceptor.intercept(AuthorityInterceptor.java:77) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:167) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:265) at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:239) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:239) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:191) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:73) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:91) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:252) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:161) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:193) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:189) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54) at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:563) at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77) at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.hkrt.app.offlinepos.interceptor.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:127) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:662) Caused by: java.sql.BatchUpdateException: ORA-00001: unique constraint (POSBOSS.SYS_C00134274) violated at oracle.jdbc.dbaccess.DBError.throwBatchUpdateException(DBError.java:458) at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:3907) at org.apache.commons.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:294)

No suitable driver found for jdbc:mysql

信息: Initializing Spring root WebApplicationContext [2019-03-29 16:25:12]-[localhost-startStop-1- WARN]-[org.hibernate.util.JDBCExceptionReporter-logExceptions(100)]: SQL Error: 0, SQLState: 08001 [2019-03-29 16:25:12]-[localhost-startStop-1-ERROR]-[org.hibernate.util.JDBCExceptionReporter-logExceptions(101)]: No suitable driver found for jdbc:mysql://localhost:3306/piccweixin [2019-03-29 16:25:12]-[localhost-startStop-1- WARN]-[org.hibernate.cfg.SettingsFactory-buildSettings(144)]: Could not obtain connection metadata java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/piccweixin at java.sql.DriverManager.getConnection(DriverManager.java:596) at java.sql.DriverManager.getConnection(DriverManager.java:187) at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriverManager(DriverManagerDataSource.java:174) at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriver(DriverManagerDataSource.java:165) at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnectionFromDriver(AbstractDriverBasedDataSource.java:149) at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnection(AbstractDriverBasedDataSource.java:119) at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:82) at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:111) at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2101) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1325) at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:814) at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:732) at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409) at java.security.AccessController.doPrivileged(Native Method) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:423) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5181) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5704) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1018) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:994) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1296) at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:2039) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) [2019-03-29 16:25:15]-[localhost-startStop-1- WARN]-[org.hibernate.util.JDBCExceptionReporter-logExceptions(100)]: SQL Error: 0, SQLState: 08001 [2019-03-29 16:25:15]-[localhost-startStop-1-ERROR]-[org.hibernate.util.JDBCExceptionReporter-logExceptions(101)]: No suitable driver found for jdbc:mysql://localhost:3306/piccweixin [2019-03-29 16:25:15]-[localhost-startStop-1- WARN]-[org.hibernate.util.JDBCExceptionReporter-logExceptions(100)]: SQL Error: 0, SQLState: 08001 [2019-03-29 16:25:15]-[localhost-startStop-1-ERROR]-[org.hibernate.util.JDBCExceptionReporter-logExceptions(101)]: No suitable driver found for jdbc:mysql://localhost:3306/piccweixin [2019-03-29 16:25:15]-[localhost-startStop-1- WARN]-[org.apache.struts.util.PropertyMessageResources-loadLocale(352)]: Resource org/apache/struts/action/ActionResources_zh_CN.properties Not Found. [2019-03-29 16:25:15]-[localhost-startStop-1- WARN]-[org.apache.struts.util.PropertyMessageResources-loadLocale(352)]: Resource org/apache/struts/action/ActionResources_zh.properties Not Found. 三月 29, 2019 4:25:15 下午 org.apache.catalina.core.ApplicationContext log 严重: action: null org.springframework.dao.DataAccessResourceFailureException: Cannot open connection; nested exception is org.hibernate.exception.JDBCConnectionException: Cannot open connection at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:627) at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412) at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:424) at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:339) at com.triman.dao.impl.HibernateTemplate.findByExample(HibernateTemplate.java:27) at com.triman.dao.impl.GenericDAOImpl.findByExample(GenericDAOImpl.java:38) at com.triman.service.impl.GenericServiceImpl.findByExample(GenericServiceImpl.java:60) at com.triman.service.impl.GenericServiceImpl.findByExample(GenericServiceImpl.java:54) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at com.sun.proxy.$Proxy8.findByExample(Unknown Source) at com.triman.struts.StrutsConfigPlugin.loadResource(StrutsConfigPlugin.java:180) at com.triman.struts.StrutsConfigPlugin.init(StrutsConfigPlugin.java:69) at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:871) at org.apache.struts.action.ActionServlet.init(ActionServlet.java:359) at javax.servlet.GenericServlet.init(GenericServlet.java:158) at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1230) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1174) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1066) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5433) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5731) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1018) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:994) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1296) at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:2039) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) Caused by: org.hibernate.exception.JDBCConnectionException: Cannot open connection at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:97) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:52) at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:449) at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167) at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:161) at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1573) at org.hibernate.loader.Loader.doQuery(Loader.java:696) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259) at org.hibernate.loader.Loader.doList(Loader.java:2228) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2125) at org.hibernate.loader.Loader.list(Loader.java:2120) at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:118) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1596) at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:306) at com.triman.dao.impl.HibernateTemplate$1.doInHibernate(HibernateTemplate.java:41) at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:419) ... 39 more Caused by: java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/piccweixin at java.sql.DriverManager.getConnection(DriverManager.java:596) at java.sql.DriverManager.getConnection(DriverManager.java:187) at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriverManager(DriverManagerDataSource.java:174) at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriver(DriverManagerDataSource.java:165) at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnectionFromDriver(AbstractDriverBasedDataSource.java:149) at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnection(AbstractDriverBasedDataSource.java:119) at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:82) at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446) ... 52 more 三月 29, 2019 4:25:15 下午 org.apache.catalina.core.ApplicationContext log 信息: Marking servlet action as unavailable 三月 29, 2019 4:25:15 下午 org.apache.catalina.core.StandardContext loadOnStartup 严重: Servlet [action] in web application [/piccweixin] threw load() exception javax.servlet.UnavailableException at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:880) at org.apache.struts.action.ActionServlet.init(ActionServlet.java:359) at javax.servlet.GenericServlet.init(GenericServlet.java:158) at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1230) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1174) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1066) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5433) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5731) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1018) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:994) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1296) at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:2039) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) ``` ```

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.<init>(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

JPA 实现修改的时候有问题(Could not execute JDBC batch updat)

我先从数据库查一条记录,修改的时候调用以下save方法 public String save() { if (StringUtils.isNotBlank(this.id)) { this.model = (T) this.manager.get(this.id); } if (null != this.model) { this.model = (T) this.manager.save(this.model); this.addActionMessage("save entity sucessfully!"); } else { this.addActionError("entity to save is null!"); return Action.INPUT; } return Action.SUCCESS; } [color=red]后台报错[/color] 56828 [http-8080-1] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 1062, SQLState: 23000 56828 [http-8080-1] ERROR org.hibernate.util.JDBCExceptionReporter - Duplicate entry '2009062316522976530' for key 'PRIMARY' 56828 [http-8080-1] ERROR org.hibernate.event.def.AbstractFlushingEventListener - Could not synchronize database state with session org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:94) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:266) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:167) [b]问题补充:[/b] [color=red]save调用这个方法[/color] public T save(T object) { Assert.notNull(object, "entity不能为空"); if (null == object.getId()) { object.setId(String.valueOf(PKgen.getInstance().nextPK())); } return this.jpaTemplate.merge(object); } [b]问题补充:[/b] 118235 [http-8080-6] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 1062, SQLState: 23000 118235 [http-8080-6] ERROR org.hibernate.util.JDBCExceptionReporter - Duplicate entry '2009062316522976530' for key 'PRIMARY' 118235 [http-8080-6] ERROR org.hibernate.event.def.AbstractFlushingEventListener - Could not synchronize database state with session org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:94) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:266) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:167) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1027) at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:365) at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:137) at org.hibernate.ejb.TransactionImpl.commit(TransactionImpl.java:54) at org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:456) at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:732) at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:701) at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:321) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy22.save(Unknown Source) at com.ruling.base.web.struts2.action.BaseCRUDAction.save(BaseCRUDAction.java:64) 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:597) at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:440) at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:279) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242) at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:163) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:249) at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:148) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:93) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:128) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(ProfilingActivationInterceptor.java:104) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:148) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:128) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52) at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:468) at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:395) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:112) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:619) Caused by: java.sql.BatchUpdateException: Duplicate entry '2009062316522976530' for key 'PRIMARY' at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:1666) at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1082) at org.apache.commons.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:297) at org.apache.commons.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:297) at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70) at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:268) ... 85 more [ERROR] 2009-06-23 18:59:55,687 [freemarker.log.Log4JLoggerFactory$Log4JLogger.error(Log4JLoggerFactory.java:96)] Method public java.lang.String org.hibernate.exception.NestableRuntimeException.getMessage(int) threw an exception when invoked on org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update The problematic instruction: ---------- ==> ${msg[0]} [on line 68, column 29 in org/apache/struts2/dispatcher/error.ftl] ---------- Java backtrace for programmers: ---------- freemarker.template.TemplateModelException: Method public java.lang.String org.hibernate.exception.NestableRuntimeException.getMessage(int) threw an exception when invoked on org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:136) at freemarker.ext.beans.SimpleMethodModel.get(SimpleMethodModel.java:146) at freemarker.core.DynamicKeyName.dealWithNumericalKey(DynamicKeyName.java:111) at freemarker.core.DynamicKeyName._getAsTemplateModel(DynamicKeyName.java:90) at freemarker.core.Expression.getAsTemplateModel(Expression.java:89) at freemarker.core.Expression.getStringValue(Expression.java:93) at freemarker.core.DollarVariable.accept(DollarVariable.java:76) at freemarker.core.Environment.visit(Environment.java:196) at freemarker.core.MixedContent.accept(MixedContent.java:92) at freemarker.core.Environment.visit(Environment.java:196) at freemarker.core.IfBlock.accept(IfBlock.java:82) at freemarker.core.Environment.visit(Environment.java:196) at freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:172) at freemarker.core.Environment.visit(Environment.java:351) at freemarker.core.IteratorBlock.accept(IteratorBlock.java:95) at freemarker.core.Environment.visit(Environment.java:196) at freemarker.core.MixedContent.accept(MixedContent.java:92) at freemarker.core.Environment.visit(Environment.java:196) at freemarker.core.IfBlock.accept(IfBlock.java:82) at freemarker.core.Environment.visit(Environment.java:196) at freemarker.core.MixedContent.accept(MixedContent.java:92) at freemarker.core.Environment.visit(Environment.java:196) at freemarker.core.Environment.process(Environment.java:176) at freemarker.template.Template.process(Template.java:232) at org.apache.struts2.dispatcher.Dispatcher.sendError(Dispatcher.java:703) at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:485) at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:395) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:112) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:619) Caused by: java.lang.NullPointerException at freemarker.ext.beans.BeansWrapper.unwrapArguments(BeansWrapper.java:573) at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:109) ... 42 more 2009-6-23 18:59:55 org.apache.catalina.core.StandardWrapperValve invoke 严重: Servlet.service() for servlet default threw exception java.lang.IllegalStateException at org.apache.catalina.connector.ResponseFacade.sendError(ResponseFacade.java:407) at org.apache.struts2.dispatcher.Dispatcher.sendError(Dispatcher.java:707) at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:485) at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:395) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:112) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:619) [b]问题补充:[/b] if (StringUtils.isNotBlank(this.id)) { this.model = (T) this.manager.get(this.id); } [color=red]这里我已删除了,才报错[/color] [b]问题补充:[/b] ywbanm: [color=red]我是先get出来 在修改属性 再merge [/color] 后台老是报这个错误::::::::: [color=red]WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 1062, SQLState: 23000 783391 [http-8080-5] ERROR org.hibernate.util.JDBCExceptionReporter - Duplicate entry '2009062323162784330' for key 'PRIMARY' 783391 [http-8080-5] ERROR org.hibernate.event.def.AbstractFlushingEventListener - Could not synchronize database state with session org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update[/color] 能有什么办法解决吗 [b]问题补充:[/b] sql 语句 为:insert 怎样做才变成update 问题补充: [DEBUG] 2009-06-26 13:26:28,640 [org.springframework.transaction.interceptor.AbstractFallbackTransactionAttributeSource.getTransactionAttribute(AbstractFallbackTransactionAttributeSource.java:107)] Adding transactional method [save] with attribute [PROPAGATION_REQUIRED,ISOLATION_DEFAULT] Hibernate: insert into T_MODULE (DATECREATED, DATEMODIFED, DELETED, NAME, REMARK, OPTLOCK, HREF, HREFTARGET, LEAF, LEVEL, PARENTID, QTIP, TEXT, UIPROVIDER, DESCRIPTION, MODULENAME, URL, ID) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) 114829 [http-8080-6] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 1062, SQLState: 23000 114829 [http-8080-6] ERROR org.hibernate.util.JDBCExceptionReporter - Duplicate entry '2009062611061317130' for key 'PRIMARY' 114829 [http-8080-6] ERROR org.hibernate.event.def.AbstractFlushingEventListener - Could not synchronize database state with session org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:94) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)

idea 搭建ssh框架,配置的数据库ip地址为远程ip,结果请求了本地IP地址,什么原因

用idea整合ssh框架,spring管理hibernate配置文件,数据库配置ip地址为远程服务的IP地址,结果jdbc连接时请求了本地ip地址,具体异常日志如下:09-Jul-2017 09:36:10.193 WARN [RMI TCP Connection(3)-127.0.0.1] org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService HHH000342: Could not obtain connection to query metadata : Access denied for user 'root '@'1.180.235.69' (using password: YES) 09-Jul-2017 09:39:34.591 WARN [http-nio-8080-exec-2] org.hibernate.engine.jdbc.spi.SqlExceptionHelper.logExceptions SQL Error: 1045, SQLState: 28000 09-Jul-2017 09:39:34.592 ERROR [http-nio-8080-exec-2] org.hibernate.engine.jdbc.spi.SqlExceptionHelper.logExceptions Access denied for user 'root '@'1.180.235.69' (using password: YES) 09-Jul-2017 09:39:34.598 严重 [http-nio-8080-exec-2] org.apache.struts2.dispatcher.DefaultDispatcherErrorHandler.error Exception occurred during processing request: org.hibernate.exception.GenericJDBCException: Unable to acquire JDBC Connection javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Unable to acquire JDBC Connection at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:147) at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:155) at org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1419) at cn.hz.area.dao.TestDao.save(TestDao.java:16) at cn.hz.area.service.TestService.save(TestService.java:16) at cn.hz.area.action.TestAction.execute(TestAction.java:16) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) 。。。什么原因!好几天时间找不到问题原因。spring配置hibernate信息如下![图片说明](https://img-ask.csdn.net/upload/201707/09/1499564518_832713.png)

struts2+hibernate+spring+proxool性能问题

项目已经跑了2个多月了,今天突然出现不能访问的问题。 第一开始是访问一直刷不出页面,但是tomcat控制台却一下一下的在执行,(很慢的执行,很久才输出一条hibernate的语句) 之后将所有的应用重启了一次, 依然访问不了网站。 一直让他持续连接就会给我报错。 [code="java"] 2009-09-24 11:47:12 [org.logicalcobwebs.proxool.BESTVDB]-[WARN] #0008 was active for 1939871 milliseconds and has been removed automaticaly. The Thread responsible was named 'http-8080-Processor45', and the last SQL it performed is 'select iptvaction0_.action_id as action1_, iptvaction0_.uid as uid11_, iptvaction0_.username as username11_, iptvaction0_.con as con11_, iptvaction0_.cat as cat11_, iptvaction0_.friend_id as friend6_11_, iptvaction0_.friendname as friendname11_, iptvaction0_.code as code11_, iptvaction0_.state_id as state9_11_, iptvaction0_.remark as remark11_, iptvaction0_.datetime as datetime11_, iptvaction0_.allowed as allowed11_, iptvaction0_.visable as visable11_, iptvaction0_.action_place as action14_11_ from iptv_action iptvaction0_ where iptvaction0_.uid in (select iptvmyfrie1_.friendid from iptv_myfriends iptvmyfrie1_ where iptvmyfrie1_.uid=723) order by iptvaction0_.datetime desc limit 3; '. 2009-09-24 11:47:12 [org.hibernate.transaction.JDBCTransaction]-[ERROR] Could not toggle autocommit com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed. at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at com.mysql.jdbc.Util.handleNewInstance(Util.java:406) at com.mysql.jdbc.Util.getInstance(Util.java:381) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:985) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:957) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:927) at com.mysql.jdbc.ConnectionImpl.checkClosed(ConnectionImpl.java:1113) at com.mysql.jdbc.ConnectionImpl.setAutoCommit(ConnectionImpl.java:4790) at sun.reflect.GeneratedMethodAccessor126.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.logicalcobwebs.proxool.WrappedConnection.invoke(WrappedConnection.java:162) at org.logicalcobwebs.proxool.WrappedConnection.intercept(WrappedConnection.java:87) at com.mysql.jdbc.Connection$$EnhancerByProxool$$6a89ac94.setAutoCommit(<generated>) at org.hibernate.transaction.JDBCTransaction.toggleAutoCommit(JDBCTransaction.java:174) at org.hibernate.transaction.JDBCTransaction.commitAndResetAutoCommit(JDBCTransaction.java:122) at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:95) at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:578) at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:662) at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:632) [/code] [code="java"] javax.servlet.ServletException: Could not open Hibernate Session for transaction; nested exception is org.hibernate.TransactionException: JDBC begin failed: org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:515) org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419) org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:99) org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75) root cause org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is org.hibernate.TransactionException: JDBC begin failed: org.springframework.orm.hibernate3.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:541) org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:350) root cause org.hibernate.TransactionException: JDBC begin failed: org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:58) org.hibernate.transaction.JDBCTransactionFactory.beginTransaction(JDBCTransactionFactory.java:24) org.hibernate.jdbc.JDBCContext.beginTransaction(JDBCContext.java:271) org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1079) org.springframework.orm.hibernate3.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:510) root cause java.sql.SQLException: Couldn't perform the operation getAutoCommit: You can't perform any operations on this connection. It has been automatically closed by Proxool for some reason (see logs). org.logicalcobwebs.proxool.WrappedConnection.invoke(WrappedConnection.java:207) org.logicalcobwebs.proxool.WrappedConnection.intercept(WrappedConnection.java:87) com.mysql.jdbc.ConnectionProperties$$EnhancerByProxool$$9313bf3c.getAutoCommit(<generated>) org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:49) org.hibernate.transaction.JDBCTransactionFactory.beginTransaction(JDBCTransactionFactory.java:24) org.hibernate.jdbc.JDBCContext.beginTransaction(JDBCContext.java:271) [/code] 异常信息大概如上所示。 找不到头绪。 不知道该如何下手去优化?还是? 我该如何做? 这是我的第一个项目。还希望各位前辈给出指点!谢谢!

could not execute query是什么原因导致的啊?

There is no Action mapped for namespace / and action name LoginAction_login. - [unknown location] at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:177) at org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:61) at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39) at com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:47) at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:458) at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77) at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:619) Hibernate: select administra0_.id as id0_, administra0_.administrator_id as administ6_0_, administra0_.email as email0_, administra0_.name as name0_, administra0_.password as password0_, administra0_.realname as realname0_ from Administrator administra0_ where 1=1 and ( lower(administra0_.name) like 'admin' ) and administra0_.password='123456' 17:26:22,465 WARN org.hibernate.util.JDBCExceptionReporter:100 - SQL Error: 1054, SQLState: 42S22 17:26:22,466 ERROR org.hibernate.util.JDBCExceptionReporter:101 - Unknown column 'administra0_.administrator_id' in 'field list' 在控制台出现以下语句是什么意思 Hibernate: select administra0_.id as id0_, administra0_.administrator_id as administ6_0_, administra0_.email as email0_, administra0_.name as name0_, administra0_.password as password0_, administra0_.realname as realname0_ from Administrator administra0_ where 1=1 20:48:32,118 WARN org.hibernate.util.JDBCExceptionReporter:100 - SQL Error: 1054, SQLState: 42S22 20:48:32,126 ERROR org.hibernate.util.JDBCExceptionReporter:101 - Unknown column 'administra0_.administrator_id' in 'field list' Hibernate: select administra0_.id as id0_, administra0_.administrator_id as administ6_0_, administra0_.email as email0_, administra0_.name as name0_, administra0_.password as password0_, administra0_.realname as realname0_ from Administrator administra0_ where 1=1 20:48:37,948 WARN org.hibernate.util.JDBCExceptionReporter:100 - SQL Error: 1054, SQLState: 42S22 20:48:37,949 ERROR org.hibernate.util.JDBCExceptionReporter:101 - Unknown column 'administra0_.administrator_id' in 'field list'

SSH项目删除用户时出错Cannot delete or update

# struts2:2.3.20 # spring:4.1.5 # hibernate:4.3.8 ## 用户与订单一对多的关系,数据库中订单表有用户这个外键。在用户映射文件中已设置cascade="delete" ## ## 项目启动无错误,在后台管理用户页面删除用户时报如下错误: 16:35:30,957 WARN SqlExceptionHelper:144 - SQL Error: 1451, SQLState: 23000 16:35:30,959 ERROR SqlExceptionHelper:146 - Cannot delete or update a parent row: a foreign key constraint fails (`mall`.`orderitem`, CONSTRAINT `FK_hth7ctygtqa5ov7kutghwa1ni` FOREIGN KEY (`uid`) REFERENCES `orders` (`oid`)) 16:35:30,961 INFO AbstractBatchImpl:208 - HHH000010: On release of batch it still contained JDBC statements 16:35:31,165 ERROR DefaultDispatcherErrorHandler:42 - Exception occurred during processing request: could not execute statement; SQL [n/a]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement org.springframework.dao.DataIntegrityViolationException: could not execute statement; SQL [n/a]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement at org.springframework.orm.hibernate4.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:163) at org.springframework.orm.hibernate4.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:730) at org.springframework.orm.hibernate4.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:592) at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:757) at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:726) at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:521) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:291) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:653) at com.lonini.mall.user.service.UserService$$EnhancerBySpringCGLIB$$3596b2ab.deleteUser(<generated>) at com.lonini.mall.user.adminaction.UserAdminAction.delete(UserAdminAction.java:55) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ...... Caused by: org.hibernate.exception.ConstraintViolationException: could not execute statement at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:129) at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:126) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:112) at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:211) ...... Caused by: com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Cannot delete or update a parent row: a foreign key constraint fails (`mall`.`orderitem`, CONSTRAINT `FK_hth7ctygtqa5ov7kutghwa1ni` FOREIGN KEY (`uid`) REFERENCES `orders` (`oid`)) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:931) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723) at com.mysql.jdbc.Connection.execSQL(Connection.java:3283) ...... order实体: ![order实体](https://img-ask.csdn.net/upload/201506/05/1433495761_123196.jpg) order关系映射: ![order关系映射](https://img-ask.csdn.net/upload/201506/05/1433494844_663178.jpg) user实体: ![user实体](https://img-ask.csdn.net/upload/201506/05/1433494875_943639.jpg) user关系映射: ![user关系映射](https://img-ask.csdn.net/upload/201506/05/1433494947_333542.jpg) 删除用户的JSP页面: ![删除用户的JSP页面](https://img-ask.csdn.net/upload/201506/05/1433494972_750482.jpg) 删除用户的action方法: ![删除用户的action方法](https://img-ask.csdn.net/upload/201506/05/1433495000_125389.jpg) 删除用户的Service层: ![删除用户的Service层](https://img-ask.csdn.net/upload/201506/05/1433494970_267564.jpg) 删除用户的Dao层: ![删除用户的Dao层](https://img-ask.csdn.net/upload/201506/05/1433495048_299389.jpg) 删除用户的struts2配置: ![删除用户的struts2配置](https://img-ask.csdn.net/upload/201506/05/1433495023_750724.jpg) 删除用户的spring配置(action): ![删除用户的spring配置(action)](https://img-ask.csdn.net/upload/201506/05/1433495106_936985.jpg)

SSH总报Orders表不存在

[b]小弟使用struts2.1.6+Spring2.5+hibernate3.3做了一个项目,在本地Windows上正常,由于项目要在Linux上运行,日志总报以下错误:[/b] :cry: [code="java"] 2009-11-16 10:03:11,307 WARN [org.hibernate.util.JDBCExceptionReporter] - SQL Error: 1146, SQLState: 42S02 2009-11-16 10:03:11,308 ERROR [org.hibernate.util.JDBCExceptionReporter] - Table 'shop.Orders' doesn't exist 2009-11-16 10:03:11,308 ERROR [com.shop.common.dao.implay.BaseDAOImplay] - 查询出错了!! org.hibernate.exception.SQLGrammarException: could not execute query at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:90) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.loader.Loader.doList(Loader.java:2235) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2129) at org.hibernate.loader.Loader.list(Loader.java:2124) at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:312) at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1723) at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:165) at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:175) at com.shop.common.dao.implay.BaseDAOImplay$4.doInHibernate(BaseDAOImplay.java:285) at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:419) at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:339) at com.shop.common.dao.implay.BaseDAOImplay.findSQL(BaseDAOImplay.java:275) at com.shop.order.dao.implay.OrdersDAOImplay.findOrderStatusNumDAO(OrdersDAOImplay.java:112) at com.shop.order.service.implay.OrderServiceImplay.findOrderStatusNumService(OrderServiceImplay.java:62) 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:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89) Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'shop.Orders' doesn't exist at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at com.mysql.jdbc.Util.handleNewInstance(Util.java:406) at com.mysql.jdbc.Util.getInstance(Util.java:381) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1030) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3515) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3447) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1951) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2101) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2554) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1761) at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1912) at sun.reflect.GeneratedMethodAccessor145.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.logicalcobwebs.proxool.ProxyStatement.invoke(ProxyStatement.java:100) at org.logicalcobwebs.proxool.ProxyStatement.intercept(ProxyStatement.java:57) at $java.sql.Wrapper$$EnhancerByProxool$$19d445f0.executeQuery(<generated>) at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:208) at org.hibernate.loader.Loader.getResultSet(Loader.java:1812) at org.hibernate.loader.Loader.doQuery(Loader.java:697) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259) at org.hibernate.loader.Loader.doList(Loader.java:2232) ... 104 more [/code] [b]但是数据都能查询出来,原来名字起的是order,后来与SQL的关键字冲突,就在后面加了个s,现在变成数据能查出来,就是这个错误,而且在本地Windows上正常,Linux不正常,请大侠们指点一下.[/b] [b]问题补充:[/b] [color=orange][b]我把数据库中的改成大小的. 它提示我 Table 'shop.orders' doesn't exist 刚好和开始的不一样了,并且查询不到结果.. 报的错误是一样的.. 这个问题大家遇到过吗?虽然结果能查询出来,但是它老报找不到表,好烦人的.[/b][/color]

HTTP Status 500 – Internal Server Error – The server encountered an unexpected condition

各位前辈,我初学JAVA的 我根据一位热心群友的建议,将stuts.xml的namespace="/qiantai",改为namespace="/"; 今天遇到这么个情况:window端myeclipse做的一个工程,用的是jdk7+tomcat8. 500HTTP Status 500 – Internal Server Error Type Exception Report Description The server encountered an unexpected condition that prevented it from fulfilling the request. Exception java.lang.reflect.InvocationTargetException sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ........ Root Cause java.lang.NoSuchMethodError: org.hibernate.SessionFactory.openSession()Lorg/hibernate/classic/Session; ............... Note The full stack trace of the root cause is available in the server logs. 初入门,各位前辈帮忙一下! 我试过用用jdk7+tomcat7.jdk7+tomcat8.jdk8+tomcat8. 都是<struts2.1+spring3.1+.hibernate4.1>此版本的项目都是一样不行;但是我用<struts2.1+spring2.0+.hibernate3.1>此版本重做个源代码基本相同的项目,居然是正常的! 帮下新手,请问如何在更高级的SSH框架下,不出现“HTTP Status 500 – Internal Server Error”错误呢?

初学hibernate,简单地用了一下SSH2,出现一种难明的错误

用《开发者突击》里面的初步搭建SSH2的代码,连接sqlserver2005,出现下面提示: Hibernate: select user0_.ID as ID, user0_.username as username0_, user0_.password as password0_, user0_.email as email0_ from user user0_ where user0_.username=? WARN - SQL Error: 156, SQLState: S0001 ERROR - 关键字 'user' 附近有语法错误。 2010-12-28 22:22:11 org.apache.catalina.core.StandardWrapperValve invoke 严重: Servlet.service() for servlet default threw exception com.microsoft.sqlserver.jdbc.SQLServerException: 关键字 'user' 附近有语法错误。 数据库中我建了表 user,属性有id username password email。 applicationContext 代码如下: [code="xml"] <!-- 配置数据源 --> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"> <property name="driverClassName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"> </property> <property name="url" value="jdbc:sqlserver://localhost:1433;databaseName=DeviceManagement;"> </property> <property name="username" value="sa"></property> <property name="password" value="123456"></property> </bean> <!-- 配置Hibernate --> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource"> <ref bean="dataSource" /> </property> <property name="mappingResources"> <list> <value>com/demo/hibernate/beans/User.hbm.xml</value> </list> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect"> org.hibernate.dialect.SQLServerDialect </prop> <prop key="hibernate.show_sql">true</prop> </props> </property> </bean> <!-- 配置事务 --> <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory"> <ref local="sessionFactory" /> </property> </bean> <!-- 定义DAO --> <bean id="userDAO" class="com.demo.hibernate.dao.UserDAO"> <property name="sessionFactory"> <ref local="sessionFactory" /> </property> </bean> <!-- 定义DAO代理 --> <bean id="UserDAOProxy" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"> <property name="transactionManager"> <ref bean="transactionManager" /> </property> <property name="target"> <ref local="userDAO" /> </property> <property name="transactionAttributes"> <props> <prop key="insert*">PROPAGATION_REQUIRED</prop> <prop key="*">PROPAGATION_REQUIRED,readOnly</prop> </props> </property> </bean> <!-- 定义Struts配置 --> <bean name="loginAction" class="com.demo.struts2.actions.LoginAction"> <property name="userDAO"> <ref local="userDAO" /> </property> </bean> <bean name="logoutAction" class="com.demo.struts2.actions.LogoutAction"> <property name="userDAO"> <ref local="userDAO" /> </property> </bean> <bean name="registerAction" class="com.demo.struts2.actions.RegisterAction"> <property name="userDAO"> <ref local="userDAO" /> </property> </bean> <!-- 配置拦截器 --> <bean name="logger" class="com.demo.spring.aop.LoggingInterceptor" /> <!-- 配置拦截器代理 --> <bean name="loggingAutoProxy" class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator"> <property name="beanNames"> <list> <value>/login</value> <value>/register</value> </list> </property> <property name="interceptorNames"> <list> <value>logger</value> </list> </property> </bean> [/code] [size=x-large]提示错误行在UserDao里面, [/size]UserDao [code="java"] package com.demo.hibernate.dao; import java.util.ArrayList; import java.util.List; import org.hibernate.HibernateException; import org.hibernate.Query; import org.hibernate.Session; import org.hibernate.criterion.Restrictions; import org.springframework.orm.hibernate3.HibernateCallback; import org.springframework.orm.hibernate3.support.HibernateDaoSupport; import com.demo.hibernate.beans.User; public class UserDAO extends HibernateDaoSupport implements IUserDAO { // 验证用户名和密码 public boolean isValid(final String username, final String password) { System.out.println("UserDao检验是否有效"); System.err.println("username:"+username+",password:"+password); List list = (List) getHibernateTemplate().execute(new HibernateCallback() { public Object doInHibernate(Session session) throws HibernateException { /////////////////////////////////////这里报错/////////////////////////////// List result = session.createCriteria(User.class).add( Restrictions.eq("username", username)).add( Restrictions.eq("password", password)).list(); return result; } }); if (list.size() > 0) { return true; } else { return false; } } // 判断某个用户是否存在,只需用用户名查询就可以 public boolean isExist(final String username) { System.err.println("UserDao进行查询"); List list = (List) getHibernateTemplate().execute(new HibernateCallback() { public Object doInHibernate(Session session) throws HibernateException { List result = session.createCriteria(User.class).add( Restrictions.eq("username", username)).list(); return result; } }); if (list.size() > 0) { return true; } else { return false; } } //插入新的用户对象到数据库 public void insertUser(User user) { System.err.println("UserDao插入数据"); getHibernateTemplate().saveOrUpdate(user); } //从数据库中取得用户对象 public User getUser(String userid) { System.err.println("UserDao取得对象"); return (User) getHibernateTemplate().get(User.class, new Integer(userid)); } //取得用户所有详细信息 public List getUsers() { System.err.println("UserDao取得数据"); return getHibernateTemplate().find("from User"); } //删除某个用户的所有信息 public void deleteUser(String userid) { System.err.println("UserDao删除某个用户的所有信息"); Object p = getHibernateTemplate().load(User.class, new Integer(userid)); getHibernateTemplate().delete(p); } } [/code] 请问这是为什么呢?

求助!!!http500的问题

主要的问题是希望有高手能解答一下,谢谢了。最好能快一点和通俗一点。 <!-- 配置数据源 -使用c3p0连接池 --> <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close"> <property name="driverClass" value="com.mysql.jdbc.Driver" /><!-- 数据库驱动 --> <property name="jdbcUrl" value="jdbc:mysql://127.0.0.1:3306/depot" /> <!-- 连接URL --> <property name="user" value="root" /> <!-- 数据库用户名 --> <property name="password" value="123456" /> <!-- 数据库密码 --> <!-- c3p0连接池参数配置 --> <property name="initialPoolSize" value="3" /><!-- 初始化连接数 --> <property name="minPoolSize" value="2" /><!-- 最小连接数 --> <property name="maxPoolSize" value="10" /><!-- 连接池中保留的最大连接数 --> <property name="maxIdleTime" value="28000" /><!-- 连接的过期时间(秒) --> <property name="idleConnectionTestPeriod" value="3600" /><!-- 检查连接池中的空闲连接间隔时间(秒) --> </bean> 这是数据库连接 数据库的url是 jdbc:mysql://127.0.0.1:3306/Mysql 报错的全部信息在这里。 HTTP Status 500 - Could not open Hibernate Session for transaction; nested exception is org.hibernate.exception.GenericJDBCException: Unable to acquire JDBC Connection 。 type Exception report message Could not open Hibernate Session for transaction; nested exception is org.hibernate.exception.GenericJDBCException: Unable to acquire JDBC Connection description The server encountered an internal error that prevented it from fulfilling this request. exception org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is org.hibernate.exception.GenericJDBCException: Unable to acquire JDBC Connection org.springframework.orm.hibernate5.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:542) org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:373) org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:447) org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:277) org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:656) com.service.UserService$$EnhancerBySpringCGLIB$$49abd10c.getUser(<generated>) com.action.UserAction.login(UserAction.java:42) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:498) ognl.OgnlRuntime.invokeMethod(OgnlRuntime.java:894) ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:1539) ognl.ObjectMethodAccessor.callMethod(ObjectMethodAccessor.java:68) com.opensymphony.xwork2.ognl.accessor.XWorkMethodAccessor.callMethodWithDebugInfo(XWorkMethodAccessor.java:96) com.opensymphony.xwork2.ognl.accessor.XWorkMethodAccessor.callMethod(XWorkMethodAccessor.java:88) ognl.OgnlRuntime.callMethod(OgnlRuntime.java:1615) ognl.ASTMethod.getValueBody(ASTMethod.java:91) ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:212) ognl.SimpleNode.getValue(SimpleNode.java:258) ognl.Ognl.getValue(Ognl.java:467) ognl.Ognl.getValue(Ognl.java:431) com.opensymphony.xwork2.ognl.OgnlUtil$3.execute(OgnlUtil.java:351) com.opensymphony.xwork2.ognl.OgnlUtil.compileAndExecuteMethod(OgnlUtil.java:403) com.opensymphony.xwork2.ognl.OgnlUtil.callMethod(OgnlUtil.java:349) com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:436) com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:291) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:252) org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:253) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:177) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:260) org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:73) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.doIntercept(ConversionErrorInterceptor.java:139) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:133) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:133) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:192) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:69) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) org.apache.struts2.interceptor.DateTextFieldInterceptor.intercept(DateTextFieldInterceptor.java:115) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:88) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:246) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:99) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:139) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:155) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:174) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) org.apache.struts2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:120) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:171) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:195) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:193) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) org.apache.struts2.factory.StrutsActionProxy.execute(StrutsActionProxy.java:54) org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:564) org.apache.struts2.dispatcher.ExecuteOperations.executeAction(ExecuteOperations.java:81) org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:143) root cause org.hibernate.exception.GenericJDBCException: Unable to acquire JDBC Connection org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:47) org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:111) org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:97) org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.acquireConnectionIfNeeded(LogicalConnectionManagedImpl.java:102) org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.getPhysicalConnection(LogicalConnectionManagedImpl.java:129) org.hibernate.internal.SessionImpl.connection(SessionImpl.java:514) org.springframework.orm.hibernate5.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:448) org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:373) org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:447) org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:277) org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:656) com.service.UserService$$EnhancerBySpringCGLIB$$49abd10c.getUser(<generated>) com.action.UserAction.login(UserAction.java:42) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:498) ognl.OgnlRuntime.invokeMethod(OgnlRuntime.java:894) ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:1539) ognl.ObjectMethodAccessor.callMethod(ObjectMethodAccessor.java:68) com.opensymphony.xwork2.ognl.accessor.XWorkMethodAccessor.callMethodWithDebugInfo(XWorkMethodAccessor.java:96) com.opensymphony.xwork2.ognl.accessor.XWorkMethodAccessor.callMethod(XWorkMethodAccessor.java:88) ognl.OgnlRuntime.callMethod(OgnlRuntime.java:1615) ognl.ASTMethod.getValueBody(ASTMethod.java:91) ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:212) ognl.SimpleNode.getValue(SimpleNode.java:258) ognl.Ognl.getValue(Ognl.java:467) ognl.Ognl.getValue(Ognl.java:431) com.opensymphony.xwork2.ognl.OgnlUtil$3.execute(OgnlUtil.java:351) com.opensymphony.xwork2.ognl.OgnlUtil.compileAndExecuteMethod(OgnlUtil.java:403) com.opensymphony.xwork2.ognl.OgnlUtil.callMethod(OgnlUtil.java:349) com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:436) com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:291) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:252) org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:253) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:177) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:260) org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:73) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.doIntercept(ConversionErrorInterceptor.java:139) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:133) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:133) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:192) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:69) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) org.apache.struts2.interceptor.DateTextFieldInterceptor.intercept(DateTextFieldInterceptor.java:115) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:88) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:246) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:99) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:139) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:155) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:174) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) org.apache.struts2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:120) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:171) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:195) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:193) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) org.apache.struts2.factory.StrutsActionProxy.execute(StrutsActionProxy.java:54) org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:564) org.apache.struts2.dispatcher.ExecuteOperations.executeAction(ExecuteOperations.java:81) org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:143) root cause java.sql.SQLException: Connections could not be acquired from the underlying database! com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:118) com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:692) com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:140) org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:122) org.hibernate.internal.NonContextualJdbcConnectionAccess.obtainConnection(NonContextualJdbcConnectionAccess.java:35) org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.acquireConnectionIfNeeded(LogicalConnectionManagedImpl.java:99) org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.getPhysicalConnection(LogicalConnectionManagedImpl.java:129) org.hibernate.internal.SessionImpl.connection(SessionImpl.java:514) org.springframework.orm.hibernate5.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:448) org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:373) org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:447) org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:277) org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:656) com.service.UserService$$EnhancerBySpringCGLIB$$49abd10c.getUser(<generated>) com.action.UserAction.login(UserAction.java:42) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:498) ognl.OgnlRuntime.invokeMethod(OgnlRuntime.java:894) ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:1539) ognl.ObjectMethodAccessor.callMethod(ObjectMethodAccessor.java:68) com.opensymphony.xwork2.ognl.accessor.XWorkMethodAccessor.callMethodWithDebugInfo(XWorkMethodAccessor.java:96) com.opensymphony.xwork2.ognl.accessor.XWorkMethodAccessor.callMethod(XWorkMethodAccessor.java:88) ognl.OgnlRuntime.callMethod(OgnlRuntime.java:1615) ognl.ASTMethod.getValueBody(ASTMethod.java:91) ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:212) ognl.SimpleNode.getValue(SimpleNode.java:258) ognl.Ognl.getValue(Ognl.java:467) ognl.Ognl.getValue(Ognl.java:431) com.opensymphony.xwork2.ognl.OgnlUtil$3.execute(OgnlUtil.java:351) com.opensymphony.xwork2.ognl.OgnlUtil.compileAndExecuteMethod(OgnlUtil.java:403) com.opensymphony.xwork2.ognl.OgnlUtil.callMethod(OgnlUtil.java:349) com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:436) com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:291) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:252) org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:253) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:177) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:260) org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:73) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.doIntercept(ConversionErrorInterceptor.java:139) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:133) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:133) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:192) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:69) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) org.apache.struts2.interceptor.DateTextFieldInterceptor.intercept(DateTextFieldInterceptor.java:115) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:88) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:246) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:99) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:139) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:155) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:174) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) org.apache.struts2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:120) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:171) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:195) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:193) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) org.apache.struts2.factory.StrutsActionProxy.execute(StrutsActionProxy.java:54) org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:564) org.apache.struts2.dispatcher.ExecuteOperations.executeAction(ExecuteOperations.java:81) org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:143) root cause com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source. com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1469) com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:644) com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:554) com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutAndMarkConnectionInUse(C3P0PooledConnectionPool.java:758) com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:685) com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:140) org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:122) org.hibernate.internal.NonContextualJdbcConnectionAccess.obtainConnection(NonContextualJdbcConnectionAccess.java:35) org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.acquireConnectionIfNeeded(LogicalConnectionManagedImpl.java:99) org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.getPhysicalConnection(LogicalConnectionManagedImpl.java:129) org.hibernate.internal.SessionImpl.connection(SessionImpl.java:514) org.springframework.orm.hibernate5.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:448) org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:373) org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:447) org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:277) org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:656) com.service.UserService$$EnhancerBySpringCGLIB$$49abd10c.getUser(<generated>) com.action.UserAction.login(UserAction.java:42) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:498) ognl.OgnlRuntime.invokeMethod(OgnlRuntime.java:894) ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:1539) ognl.ObjectMethodAccessor.callMethod(ObjectMethodAccessor.java:68) com.opensymphony.xwork2.ognl.accessor.XWorkMethodAccessor.callMethodWithDebugInfo(XWorkMethodAccessor.java:96) com.opensymphony.xwork2.ognl.accessor.XWorkMethodAccessor.callMethod(XWorkMethodAccessor.java:88) ognl.OgnlRuntime.callMethod(OgnlRuntime.java:1615) ognl.ASTMethod.getValueBody(ASTMethod.java:91) ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:212) ognl.SimpleNode.getValue(SimpleNode.java:258) ognl.Ognl.getValue(Ognl.java:467) ognl.Ognl.getValue(Ognl.java:431) com.opensymphony.xwork2.ognl.OgnlUtil$3.execute(OgnlUtil.java:351) com.opensymphony.xwork2.ognl.OgnlUtil.compileAndExecuteMethod(OgnlUtil.java:403) com.opensymphony.xwork2.ognl.OgnlUtil.callMethod(OgnlUtil.java:349) com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:436) com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:291) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:252) org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:253) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:177) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:260) org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:73) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.doIntercept(ConversionErrorInterceptor.java:139) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:133) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:133) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:192) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:69) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) org.apache.struts2.interceptor.DateTextFieldInterceptor.intercept(DateTextFieldInterceptor.java:115) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:88) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:246) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:99) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:139) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:155) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:174) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) org.apache.struts2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:120) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:171) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:195) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:193) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247) org.apache.struts2.factory.StrutsActionProxy.execute(StrutsActionProxy.java:54) org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:564) org.apache.struts2.dispatcher.ExecuteOperations.executeAction(ExecuteOperations.java:81) org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:143) root cause java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support. com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:127) com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:95) com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:87) com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:61) com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:71) com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:76) com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:862) com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:444) com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:230) com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:226) com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:175) com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:220) com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:206) com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:203) com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1138) com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1125) com.mchange.v2.resourcepool.BasicResourcePool.access$700(BasicResourcePool.java:44) com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1870) com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:696) root cause com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support. sun.reflect.GeneratedConstructorAccessor45.newInstance(Unknown Source) sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) java.lang.reflect.Constructor.newInstance(Constructor.java:423) com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:59) com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:83) com.mysql.cj.util.TimeUtil.getCanonicalTimezone(TimeUtil.java:128) com.mysql.cj.protocol.a.NativeProtocol.configureTimezone(NativeProtocol.java:2201) com.mysql.cj.protocol.a.NativeProtocol.initServerSession(NativeProtocol.java:2225) com.mysql.cj.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:1391) com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:993) com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:852) com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:444) com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:230) com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:226) com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:175) com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:220) com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:206) com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:203) com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1138) com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1125) com.mchange.v2.resourcepool.BasicResourcePool.access$700(BasicResourcePool.java:44) com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1870) com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:696) note The full stack trace of the root cause is available in the Apache Tomcat/8.5.9 logs. 是从论坛上下下来的求助挺紧的26号上午就要用 是一个有关jsp和mysql数据库的仓储管理系统我用的是myeclipsi2017 和mysql8.0 tomcat8.5

无法执行sql 语句 怎么回事啊?

我的项目是用struts hibernate 还有spring 组合的 可是当我执行这个事务的时候 我的sql 语句无法执行 [code="java"] public User findByEmail(String name , String password){ String hql = "from com.buat.model.User"; Query query =this.getSession().createSQLQuery(hql); List<User> list = query.list(); //这里无法执行 User user = list.get(0); return user ; } [/code] [b][color=red]这是我的控制台所报的错误[/color] [/b] 严重: Servlet.service() for servlet action threw exception com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from com.buat.model.User' at line 1 at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2870) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1573) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665) at com.mysql.jdbc.Connection.execSQL(Connection.java:3124) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1149) at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1262) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:92) at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186) at org.hibernate.loader.Loader.getResultSet(Loader.java:1668) at org.hibernate.loader.Loader.doQuery(Loader.java:662) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224) at org.hibernate.loader.Loader.doList(Loader.java:2144) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2028) at org.hibernate.loader.Loader.list(Loader.java:2023) at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:289) at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1695) at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:142) at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:150) at com.buat.service.UserManager.findByEmail(UserManager.java:20) at com.buat.service.UserManager$$FastClassByCGLIB$$3c143d2e.invoke(<generated>) at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149) at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:714) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:162) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185) at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:652) at com.buat.service.UserManager$$EnhancerByCGLIB$$684b62ee.findByEmail(<generated>) at com.buat.action.BookAction.validatorUser(BookAction.java:73) 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.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:270) at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:187) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432) at javax.servlet.http.HttpServlet.service(HttpServlet.java:710) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:78) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:595) 2009-04-16 19:14:28,531 ERROR [/springside/bookManager.do] - <org.hibernate.exception.SQLGrammarException: could not execute query> javax.servlet.ServletException: org.hibernate.exception.SQLGrammarException: could not execute query at org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:535) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:433) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432) at javax.servlet.http.HttpServlet.service(HttpServlet.java:710) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:78) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:595) Caused by: org.hibernate.exception.SQLGrammarException: could not execute query at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.loader.Loader.doList(Loader.java:2147) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2028) at org.hibernate.loader.Loader.list(Loader.java:2023) at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:289) at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1695) at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:142) at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:150) at com.buat.service.UserManager.findByEmail(UserManager.java:20) at com.buat.service.UserManager$$FastClassByCGLIB$$3c143d2e.invoke(<generated>) at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149) at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:714) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:162) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185) at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:652) at com.buat.service.UserManager$$EnhancerByCGLIB$$684b62ee.findByEmail(<generated>) at com.buat.action.BookAction.validatorUser(BookAction.java:73) 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.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:270) at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:187) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431) ... 25 more Caused by: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from com.buat.model.User' at line 1 at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2870) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1573) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665) at com.mysql.jdbc.Connection.execSQL(Connection.java:3124) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1149) at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1262) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:92) at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186) at org.hibernate.loader.Loader.getResultSet(Loader.java:1668) at org.hibernate.loader.Loader.doQuery(Loader.java:662) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224) at org.hibernate.loader.Loader.doList(Loader.java:2144) ... 48 more [b]问题补充:[/b] 我的项目是用struts hibernate 还有spring 组合的 可是当我执行这个事务的时候 我的sql 语句无法执行 [code="java"] public User findByEmail(String name , String password){ String hql = "from com.buat.model.User"; Query query =this.getSession().createSQLQuery(hql); List<User> list = query.list(); //这里无法执行 User user = list.get(0); return user ; } [/code] [b][color=red]这是我的控制台所报的错误[/color] [/b] Hibernate: from com.buat.model.User 2009-04-16 19:28:05,709 WARN [org.hibernate.util.JDBCExceptionReporter] - <SQL Error: 1064, SQLState: 42000> 2009-04-16 19:28:05,712 ERROR [org.hibernate.util.JDBCExceptionReporter] - <You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from com.buat.model.User' at line 1> [b]问题补充:[/b] 你也没有给我解决的方案啊 、、、、

Struts2+Spring+hibernate问题

信息: HTMLManager: start: Starting web application at '/Lianxi' 2009-8-17 23:04:26 org.apache.catalina.loader.WebappClassLoader validateJarFile 信息: validateJarFile(C:\Program Files\Tomcat 6.0\webapps\Lianxi\WEB-INF\lib\servlet-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class 2009-8-17 23:04:26 org.apache.catalina.loader.WebappClassLoader validateJarFile 信息: validateJarFile(C:\Program Files\Tomcat 6.0\webapps\Lianxi\WEB-INF\lib\servlet.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class 2009-8-17 23:04:30 org.apache.catalina.core.ApplicationContext log 信息: Initializing Spring root WebApplicationContext log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader). log4j:WARN Please initialize the log4j system properly. 2009-8-17 23:04:32 org.apache.catalina.core.StandardContext listenerStart 严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 2 in XML document from ServletContext resource [/WEB-INF/applicationContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'beans'. Caused by: org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'beans'. at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source) at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source) at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.DOMParser.parse(Unknown Source) at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source) at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:76) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:351) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:303) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:280) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:131) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:147) at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124) at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92) at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:101) at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:389) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:324) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:244) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:187) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3830) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4337) at org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:1237) at org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServlet.java:591) at org.apache.catalina.manager.HTMLManagerServlet.doGet(HTMLManagerServlet.java:128) at javax.servlet.http.HttpServlet.service(HttpServlet.java:690) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Unknown Source) 2009-8-17 23:04:32 org.apache.catalina.core.StandardContext start 严重: Error listenerStart 2009-8-17 23:04:32 org.apache.catalina.core.StandardContext start 严重: Context [/Lianxi] startup failed due to previous errors 2009-8-17 23:04:32 org.apache.catalina.core.ApplicationContext log 信息: Closing Spring root WebApplicationContext 2009-8-17 23:04:33 org.apache.catalina.core.ApplicationContext log 信息: HTMLManager: list: Listing contexts for virtual host 'localhost' [b]问题补充:[/b] <?xml version="1.0" encoding="UTF-8"?> <beans> xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"> <property name="driverClassName" value="com.microsoft.jdbc.sqlserver.SQLServerDriver"> </property> <property name="url" value="jdbc:microsoft:sqlserver://localhost:1433"> </property> <property name="username" value="sa"></property> <property name="password" value="sa"></property> </bean> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource"> <ref bean="dataSource" /> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect"> org.hibernate.dialect.SQLServerDialect </prop> </props> </property> <property name="mappingResources"> <list> <value>com/ljw/vo/Liuyan.hbm.xml</value></list> </property></bean> <bean id="hibernateTransactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory"> <ref local="sessionFactory" /> </property> </bean> <!-- ============================== baseTransactionProxyBean =========================== --> <bean id="baseTransactionProxyBean" lazy-init="true" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"> <property name="transactionManager"> <ref bean="hibernateTransactionManager" /> </property> <property name="transactionAttributes"> <props> <prop key="*">PROPAGATION_REQUIRED</prop> </props> </property> </bean> <!-- ============================== dbDao =========================== --> <bean id="dbDaoTarget" class="com.ljw.dao.imp.DbDaoImple"> <property name="sessionFactory"> <ref local="sessionFactory" /> </property> </bean> <bean id="dbDao" parent="baseTransactionProxyBean"> <property name="target"> <ref local="dbDaoTarget" /> </property> </bean> <bean id="ServiceImp" class="com.ljw.service.imp.ServiceImp" abstract="false" lazy-init="default" autowire="default" dependency-check="default"> <property name="dbDao"> <ref bean="dbDao"></ref> </property> </bean> </beans> [b]问题补充:[/b] 加载配置 :cry: :cry: :cry: 还是不对啊! [b]问题补充:[/b] 2009-8-18 16:19:00 org.apache.catalina.core.AprLifecycleListener init 信息: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\MyEclipse 6.5\bin;C:\Program Files\Tomcat 6.0\bin 2009-8-18 16:19:00 org.apache.coyote.http11.Http11Protocol init 信息: Initializing Coyote HTTP/1.1 on http-8080 2009-8-18 16:19:00 org.apache.catalina.startup.Catalina load 信息: Initialization processed in 917 ms 2009-8-18 16:19:00 org.apache.catalina.core.StandardService start 信息: Starting service Catalina 2009-8-18 16:19:00 org.apache.catalina.core.StandardEngine start 信息: Starting Servlet Engine: Apache Tomcat/6.0.14 2009-8-18 16:19:01 org.apache.catalina.loader.WebappClassLoader validateJarFile 信息: validateJarFile(C:\Program Files\Tomcat 6.0\webapps\Lianxi\WEB-INF\lib\servlet-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class 2009-8-18 16:19:01 org.apache.catalina.loader.WebappClassLoader validateJarFile 信息: validateJarFile(C:\Program Files\Tomcat 6.0\webapps\Lianxi\WEB-INF\lib\servlet.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class 2009-8-18 16:19:05 org.apache.catalina.core.ApplicationContext log 信息: Initializing Spring root WebApplicationContext log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader). log4j:WARN Please initialize the log4j system properly. 2009-8-18 16:19:11 org.apache.catalina.core.StandardContext listenerStart 严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit(IILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V Caused by: java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit(IILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V at net.sf.cglib.core.ClassEmitter.begin_class(ClassEmitter.java:77) at net.sf.cglib.core.KeyFactory$Generator.generateClass(KeyFactory.java:173) at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25) at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:216) at net.sf.cglib.core.KeyFactory$Generator.create(KeyFactory.java:145) at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:117) at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:108) at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:104) at net.sf.cglib.proxy.Enhancer.<clinit>(Enhancer.java:69) at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:117) at org.hibernate.proxy.pojo.cglib.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:43) at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:162) at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:135) at org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:55) at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.<init>(EntityEntityModeToTuplizerMapping.java:56) at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:295) at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:434) at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:109) at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55) at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294) at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:805) at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:745) at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:134) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1202) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1172) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:428) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:284) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:244) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:187) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3830) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4337) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920) at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053) at org.apache.catalina.core.StandardHost.start(StandardHost.java:719) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:566) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) 2009-8-18 16:19:11 org.apache.catalina.core.StandardContext start 严重: Error listenerStart 2009-8-18 16:19:11 org.apache.catalina.core.StandardContext start 严重: Context [/Lianxi] startup failed due to previous errors 2009-8-18 16:19:11 org.apache.catalina.core.ApplicationContext log 信息: Closing Spring root WebApplicationContext log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader). log4j:WARN Please initialize the log4j system properly. 2009-8-18 16:19:16 org.apache.catalina.core.ApplicationContext log 信息: Loading Spring root WebApplicationContext 2009-8-18 16:19:23 org.apache.coyote.http11.Http11Protocol start 信息: Starting Coyote HTTP/1.1 on http-8080 2009-8-18 16:19:23 org.apache.jk.common.ChannelSocket init 信息: JK: ajp13 listening on /0.0.0.0:8009 2009-8-18 16:19:23 org.apache.jk.server.JkMain start 信息: Jk running ID=0 time=0/63 config=null 2009-8-18 16:19:23 org.apache.catalina.startup.Catalina start 信息: Server startup in 23255 ms 先谢谢您了 [b]问题补充:[/b] 朋友咱还是加QQ吧! 123698108 [b]问题补充:[/b] :idea: :idea: :idea: :idea: 2009-8-18 17:13:43 org.apache.catalina.core.AprLifecycleListener init 信息: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\MyEclipse 6.5\bin;C:\Program Files\Tomcat 6.0\bin 2009-8-18 17:13:43 org.apache.coyote.http11.Http11Protocol init 信息: Initializing Coyote HTTP/1.1 on http-8080 2009-8-18 17:13:43 org.apache.catalina.startup.Catalina load 信息: Initialization processed in 962 ms 2009-8-18 17:13:43 org.apache.catalina.core.StandardService start 信息: Starting service Catalina 2009-8-18 17:13:43 org.apache.catalina.core.StandardEngine start 信息: Starting Servlet Engine: Apache Tomcat/6.0.14 2009-8-18 17:13:44 org.apache.catalina.loader.WebappClassLoader validateJarFile 信息: validateJarFile(C:\Program Files\Tomcat 6.0\webapps\Lianxi\WEB-INF\lib\servlet-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class 2009-8-18 17:13:44 org.apache.catalina.loader.WebappClassLoader validateJarFile 信息: validateJarFile(C:\Program Files\Tomcat 6.0\webapps\Lianxi\WEB-INF\lib\servlet.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader). log4j:WARN Please initialize the log4j system properly. 2009-8-18 17:13:46 org.apache.catalina.core.ApplicationContext log 信息: Loading Spring root WebApplicationContext log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader). log4j:WARN Please initialize the log4j system properly. 2009-8-18 17:13:58 org.apache.catalina.core.ApplicationContext log 信息: Loading Spring root WebApplicationContext 2009-8-18 17:14:05 org.apache.coyote.http11.Http11Protocol start 信息: Starting Coyote HTTP/1.1 on http-8080 2009-8-18 17:14:05 org.apache.jk.common.ChannelSocket init 信息: JK: ajp13 listening on /0.0.0.0:8009 2009-8-18 17:14:05 org.apache.jk.server.JkMain start 信息: Jk running ID=0 time=0/46 config=null 2009-8-18 17:14:05 org.apache.catalina.startup.Catalina start 信息: Server startup in 22427 ms [b]问题补充:[/b] [size=large]我加您好友可以吗[/size]

HQL 问题 !!!

HQL支持 insert into 表名1 select * from 表名2 吗 [b]问题补充:[/b] 这个是继承了org.springframework.orm.hibernate3.support.HibernateDaoSupport类 —————————————————————————————————————— s = this.getSession(); String hql = "insert into Articles select a.artiId,a.artiName,a.artiSpec,a.artiModel,a.artiMarkPrice,a.artiAssociatorPrice,a.artiInfo,a.artiFlag," + "ac.artiClassName,ab.artiBrandName,ap.artiPhotoPath " + "from Article a,Articlass ac,Artibrand ab,Artiphoto ap" + " where a.artiClassId = ac.artiClassId and a.artiBrandId = ab.artiBrandId and a.artiPhotoId = ap.artiPhotoId"; t = s.beginTransaction(); s.createQuery(hql).executeUpdate(); t.commit(); 出现问题 —————————————————————————————————— org.hibernate.hql.ast.QuerySyntaxException: expecting OPEN, found 'select' near line 1, column 22 [insert into Articles select a.artiId,a.artiName,a.artiSpec,a.artiModel,a.artiMarkPrice,a.artiAssociatorPrice,a.artiInfo,a.artiFlag,ac.artiClassName,ab.artiBrandName,ap.artiPhotoPath from com.articleweb.model.Article a,com.articleweb.model.Articlass ac,com.articleweb.model.Artibrand ab,com.articleweb.model.Artiphoto ap where a.artiClassId = ac.artiClassId and a.artiBrandId = ab.artiBrandId and a.artiPhotoId = ap.artiPhotoId] at org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:59) at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:244) at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:155) at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:109) at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:75) at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:54) at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:71) at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133) at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112) at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1583) at com.articleweb.model.control.ArticleControl.insertArticles(ArticleControl.java:27) at com.articleweb.struts.action.ArticlesAction.showarti(ArticlesAction.java:47) 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:597) at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280) at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216) at org.springframework.web.struts.DelegatingActionProxy.execute(DelegatingActionProxy.java:106) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507) at javax.servlet.http.HttpServlet.service(HttpServlet.java:690) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689) at java.lang.Thread.run(Thread.java:619) [b]问题补充:[/b] 我是在MYSQL数据上 用SQL 试过之后才到HQL用的。 既然HQL支持的就不应该有这样的问题吧。查出来的结果结构和要导入的表结果是相同的。 [b]问题补充:[/b] Hibernate 3.1 数据库绝对支持这个方法 我试用过后才到HQL里运用的。 [b]问题补充:[/b] 要是可以用SQL的问题就不存在了。郁闷中。 [b]问题补充:[/b] 楼上的高手不是说HQL支持这个语法的吗 [b]问题补充:[/b] 这个跟关联查询有关系吗?字段和表名我都是按类对象来写的。 就是不行。 无奈了。 快背熟了 没错别字 还是不行 [b]问题补充:[/b] insert into Articles select a.artiId,a.artiName,a.artiSpec,a.artiModel,a.artiMarkPrice,a.artiAssociatorPrice,a.artiInfo,a.artiFlag," + "ac.artiClassName,ab.artiBrandName,ap.artiPhotoPath " + "from Article a,Articlass ac,Artibrand ab,Artiphoto ap" + " where a.artiClassId = ac.artiClassId and a.artiBrandId = ab.artiBrandId and a.artiPhotoId = ap.artiPhotoId [b]问题补充:[/b] String hql = "insert into Articles(artiId,artiName,artiSpec,artiModel,artiMarkPrice,artiAssociatorPrice,artiInfo,artiFlag,artiClassName,artiBrandName,artiPhotoPath)" + " select a.artiId,a.artiName,a.artiSpec,a.artiModel,a.artiMarkPrice,a.artiAssociatorPrice,a.artiInfo,a.artiFlag," + "ac.artiClassName,ab.artiBrandName,ap.artiPhotoPath " + "from Article a,Articlass ac,Artibrand ab,Artiphoto ap" + " where a.artiClassId = ac.artiClassId and a.artiBrandId = ab.artiBrandId and a.artiPhotoId = ap.artiPhotoId"; [b]问题补充:[/b] 异常变了 —————————————————————————————————————— org.hibernate.exception.ConstraintViolationException: could not execute update query at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.hql.ast.exec.BasicExecutor.execute(BasicExecutor.java:84) at org.hibernate.hql.ast.QueryTranslatorImpl.executeUpdate(QueryTranslatorImpl.java:334) at org.hibernate.engine.query.HQLQueryPlan.performExecuteUpdate(HQLQueryPlan.java:209) at org.hibernate.impl.SessionImpl.executeUpdate(SessionImpl.java:1126) at org.hibernate.impl.QueryImpl.executeUpdate(QueryImpl.java:94) at com.articleweb.model.control.ArticleControl.insertArticles(ArticleControl.java:28) at com.articleweb.struts.action.ArticlesAction.showarti(ArticlesAction.java:47) 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:597) at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280) at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216) at org.springframework.web.struts.DelegatingActionProxy.execute(DelegatingActionProxy.java:106) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507) at javax.servlet.http.HttpServlet.service(HttpServlet.java:690) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689) at java.lang.Thread.run(Thread.java:619) Caused by: java.sql.SQLException: Duplicate entry '1' for key 1 at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2921) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1570) at com.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1085) at com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:670) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1159) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1076) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1061) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102) at org.hibernate.hql.ast.exec.BasicExecutor.execute(BasicExecutor.java:75) ... 33 more 16:58:21,437 DEBUG JDBCTransaction:152 - rollback 16:58:21,437 DEBUG JDBCTransaction:193 - re-enabling autocommit 16:58:21,437 DEBUG JDBCTransaction:163 - rolled back JDBC Connection 16:58:21,437 DEBUG QueryTranslatorImpl:236 - parse() - HQL: from com.articleweb.model.Articles 16:58:21,437 DEBUG ErrorCounter:68 - throwQueryException() : no errors 16:58:21,437 DEBUG HqlSqlBaseWalker:111 - select << begin [level=1, statement=select] 16:58:21,437 DEBUG FromElement:104 - FromClause{level=1} : com.articleweb.model.Articles (no alias) -> articles0_ 16:58:21,437 DEBUG HqlSqlBaseWalker:117 - select : finishing up [level=1, statement=select] 16:58:21,437 DEBUG HqlSqlWalker:511 - processQuery() : ( SELECT ( FromClause{level=1} myweb.articles articles0_ ) ) 16:58:21,453 DEBUG HqlSqlWalker:713 - Derived SELECT clause created. 16:58:21,453 DEBUG JoinProcessor:128 - Using FROM fragment [myweb.articles articles0_] 16:58:21,453 DEBUG HqlSqlBaseWalker:123 - select >> end [level=1, statement=select] 16:58:21,453 DEBUG ErrorCounter:68 - throwQueryException() : no errors 16:58:21,453 DEBUG QueryTranslatorImpl:206 - HQL: from com.articleweb.model.Articles 16:58:21,453 DEBUG QueryTranslatorImpl:207 - SQL: select articles0_.ArtiID as ArtiID11_, articles0_.ArtiName as ArtiName11_, articles0_.ArtiSpec as ArtiSpec11_, articles0_.ArtiModel as ArtiModel11_, articles0_.ArtiMarkPrice as ArtiMark5_11_, articles0_.ArtiAssociatorPrice as ArtiAsso6_11_, articles0_.ArtiInfo as ArtiInfo11_, articles0_.ArtiFlag as ArtiFlag11_, articles0_.ArtiClassName as ArtiClas9_11_, articles0_.ArtiBrandName as ArtiBra10_11_, articles0_.ArtiPhotoPath as ArtiPho11_11_ from myweb.articles articles0_ 16:58:21,453 DEBUG ErrorCounter:68 - throwQueryException() : no errors [b]问题补充:[/b] 详细异常 ————————————————————————————————————————16:58:20,703 DEBUG JDBCTransaction:54 - begin 16:58:20,718 DEBUG JDBCTransaction:59 - current autocommit status: true 16:58:20,718 DEBUG JDBCTransaction:62 - disabling autocommit 16:58:20,890 DEBUG QueryTranslatorImpl:236 - parse() - HQL: insert into Articles(artiId,artiName,artiSpec,artiModel,artiMarkPrice,artiAssociatorPrice,artiInfo,artiFlag,artiClassName,artiBrandName,artiPhotoPath) select a.artiId,a.artiName,a.artiSpec,a.artiModel,a.artiMarkPrice,a.artiAssociatorPrice,a.artiInfo,a.artiFlag,ac.artiClassName,ab.artiBrandName,ap.artiPhotoPath from com.articleweb.model.Article a,com.articleweb.model.Articlass ac,com.articleweb.model.Artibrand ab,com.articleweb.model.Artiphoto ap where a.artiClassId = ac.artiClassId and a.artiBrandId = ab.artiBrandId and a.artiPhotoId = ap.artiPhotoId 16:58:20,906 DEBUG ErrorCounter:68 - throwQueryException() : no errors 16:58:21,015 DEBUG HqlSqlBaseWalker:111 - insert << begin [level=1, statement=insert] 16:58:21,062 DEBUG HqlSqlBaseWalker:111 - select << begin [level=2, statement=insert] 16:58:21,109 DEBUG FromElement:104 - FromClause{level=1} : com.articleweb.model.Article (a) -> article0_ 16:58:21,109 DEBUG FromElement:104 - FromClause{level=1} : com.articleweb.model.Articlass (ac) -> articlass1_ 16:58:21,109 DEBUG FromElement:104 - FromClause{level=1} : com.articleweb.model.Artibrand (ab) -> artibrand2_ 16:58:21,125 DEBUG FromElement:104 - FromClause{level=1} : com.articleweb.model.Artiphoto (ap) -> artiphoto3_ 16:58:21,125 DEBUG FromReferenceNode:51 - Resolved : a -> ArtiId 16:58:21,125 DEBUG DotNode:541 - getDataType() : artiId -> org.hibernate.type.IntegerType@e1cfa7 16:58:21,125 DEBUG FromReferenceNode:51 - Resolved : a.artiId -> article0_.ArtiId 16:58:21,125 DEBUG FromReferenceNode:51 - Resolved : a -> ArtiId 16:58:21,125 DEBUG DotNode:541 - getDataType() : artiName -> org.hibernate.type.StringType@10811b5 16:58:21,125 DEBUG FromReferenceNode:51 - Resolved : a.artiName -> article0_.ArtiName 16:58:21,125 DEBUG FromReferenceNode:51 - Resolved : a -> ArtiId 16:58:21,125 DEBUG DotNode:541 - getDataType() : artiSpec -> org.hibernate.type.StringType@10811b5 16:58:21,125 DEBUG FromReferenceNode:51 - Resolved : a.artiSpec -> article0_.ArtiSpec 16:58:21,156 DEBUG FromReferenceNode:51 - Resolved : a -> ArtiId 16:58:21,156 DEBUG DotNode:541 - getDataType() : artiModel -> org.hibernate.type.StringType@10811b5 16:58:21,156 DEBUG FromReferenceNode:51 - Resolved : a.artiModel -> article0_.ArtiModel 16:58:21,156 DEBUG FromReferenceNode:51 - Resolved : a -> ArtiId 16:58:21,156 DEBUG DotNode:541 - getDataType() : artiMarkPrice -> org.hibernate.type.FloatType@1af5853 16:58:21,156 DEBUG FromReferenceNode:51 - Resolved : a.artiMarkPrice -> article0_.ArtiMarkPrice 16:58:21,156 DEBUG FromReferenceNode:51 - Resolved : a -> ArtiId 16:58:21,156 DEBUG DotNode:541 - getDataType() : artiAssociatorPrice -> org.hibernate.type.FloatType@1af5853 16:58:21,156 DEBUG FromReferenceNode:51 - Resolved : a.artiAssociatorPrice -> article0_.ArtiAssociatorPrice 16:58:21,171 DEBUG FromReferenceNode:51 - Resolved : a -> ArtiId 16:58:21,171 DEBUG DotNode:541 - getDataType() : artiInfo -> org.hibernate.type.StringType@10811b5 16:58:21,171 DEBUG FromReferenceNode:51 - Resolved : a.artiInfo -> article0_.ArtiInfo 16:58:21,171 DEBUG FromReferenceNode:51 - Resolved : a -> ArtiId 16:58:21,171 DEBUG DotNode:541 - getDataType() : artiFlag -> org.hibernate.type.IntegerType@e1cfa7 16:58:21,171 DEBUG FromReferenceNode:51 - Resolved : a.artiFlag -> article0_.ArtiFlag 16:58:21,171 DEBUG FromReferenceNode:51 - Resolved : ac -> ArtiClassId 16:58:21,171 DEBUG DotNode:541 - getDataType() : artiClassName -> org.hibernate.type.StringType@10811b5 16:58:21,171 DEBUG FromReferenceNode:51 - Resolved : ac.artiClassName -> articlass1_.ArtiClassName 16:58:21,171 DEBUG FromReferenceNode:51 - Resolved : ab -> ArtiBrandId 16:58:21,171 DEBUG DotNode:541 - getDataType() : artiBrandName -> org.hibernate.type.StringType@10811b5 16:58:21,171 DEBUG FromReferenceNode:51 - Resolved : ab.artiBrandName -> artibrand2_.ArtiBrandName 16:58:21,171 DEBUG FromReferenceNode:51 - Resolved : ap -> ArtiPhotoId 16:58:21,171 DEBUG DotNode:541 - getDataType() : artiPhotoPath -> org.hibernate.type.StringType@10811b5 16:58:21,171 DEBUG FromReferenceNode:51 - Resolved : ap.artiPhotoPath -> artiphoto3_.ArtiPhotoPath 16:58:21,218 DEBUG FromReferenceNode:51 - Resolved : a -> ArtiId 16:58:21,218 DEBUG DotNode:541 - getDataType() : artiClassId -> org.hibernate.type.IntegerType@e1cfa7 16:58:21,218 DEBUG FromReferenceNode:51 - Resolved : a.artiClassId -> article0_.ArtiClassId 16:58:21,218 DEBUG FromReferenceNode:51 - Resolved : ac -> ArtiClassId 16:58:21,218 DEBUG DotNode:541 - getDataType() : artiClassId -> org.hibernate.type.IntegerType@e1cfa7 16:58:21,218 DEBUG FromReferenceNode:51 - Resolved : ac.artiClassId -> articlass1_.ArtiClassId 16:58:21,218 DEBUG FromReferenceNode:51 - Resolved : a -> ArtiId 16:58:21,218 DEBUG DotNode:541 - getDataType() : artiBrandId -> org.hibernate.type.IntegerType@e1cfa7 16:58:21,218 DEBUG FromReferenceNode:51 - Resolved : a.artiBrandId -> article0_.ArtiBrandId 16:58:21,218 DEBUG FromReferenceNode:51 - Resolved : ab -> ArtiBrandId 16:58:21,218 DEBUG DotNode:541 - getDataType() : artiBrandId -> org.hibernate.type.IntegerType@e1cfa7 16:58:21,218 DEBUG FromReferenceNode:51 - Resolved : ab.artiBrandId -> artibrand2_.ArtiBrandId 16:58:21,218 DEBUG FromReferenceNode:51 - Resolved : a -> ArtiId 16:58:21,218 DEBUG DotNode:541 - getDataType() : artiPhotoId -> org.hibernate.type.IntegerType@e1cfa7 16:58:21,234 DEBUG FromReferenceNode:51 - Resolved : a.artiPhotoId -> article0_.ArtiPhotoId 16:58:21,234 DEBUG FromReferenceNode:51 - Resolved : ap -> ArtiPhotoId 16:58:21,234 DEBUG DotNode:541 - getDataType() : artiPhotoId -> org.hibernate.type.IntegerType@e1cfa7 16:58:21,234 DEBUG FromReferenceNode:51 - Resolved : ap.artiPhotoId -> artiphoto3_.ArtiPhotoId 16:58:21,234 DEBUG HqlSqlBaseWalker:117 - select : finishing up [level=2, statement=insert] 16:58:21,234 DEBUG HqlSqlWalker:511 - processQuery() : ( SELECT ( {select clause} ( article0_.ArtiId ArtiId artiId ) ( article0_.ArtiName ArtiId artiName ) ( article0_.ArtiSpec ArtiId artiSpec ) ( article0_.ArtiModel ArtiId artiModel ) ( article0_.ArtiMarkPrice ArtiId artiMarkPrice ) ( article0_.ArtiAssociatorPrice ArtiId artiAssociatorPrice ) ( article0_.ArtiInfo ArtiId artiInfo ) ( article0_.ArtiFlag ArtiId artiFlag ) ( articlass1_.ArtiClassName ArtiClassId artiClassName ) ( artibrand2_.ArtiBrandName ArtiBrandId artiBrandName ) ( artiphoto3_.ArtiPhotoPath ArtiPhotoId artiPhotoPath ) ) ( FromClause{level=1} myweb.article article0_ myweb.articlass articlass1_ myweb.artibrand artibrand2_ myweb.artiphoto artiphoto3_ ) ( where ( and ( and ( = ( article0_.ArtiClassId ArtiId artiClassId ) ( articlass1_.ArtiClassId ArtiClassId artiClassId ) ) ( = ( article0_.ArtiBrandId ArtiId artiBrandId ) ( artibrand2_.ArtiBrandId ArtiBrandId artiBrandId ) ) ) ( = ( article0_.ArtiPhotoId ArtiId artiPhotoId ) ( artiphoto3_.ArtiPhotoId ArtiPhotoId artiPhotoId ) ) ) ) ) 16:58:21,281 DEBUG JoinProcessor:128 - Using FROM fragment [myweb.artiphoto artiphoto3_] 16:58:21,281 DEBUG JoinProcessor:128 - Using FROM fragment [myweb.artibrand artibrand2_] 16:58:21,281 DEBUG JoinProcessor:128 - Using FROM fragment [myweb.articlass articlass1_] 16:58:21,281 DEBUG JoinProcessor:128 - Using FROM fragment [myweb.article article0_] 16:58:21,281 DEBUG HqlSqlBaseWalker:123 - select >> end [level=2, statement=insert] 16:58:21,281 DEBUG HqlSqlBaseWalker:117 - insert : finishing up [level=1, statement=insert] 16:58:21,281 DEBUG HqlSqlBaseWalker:123 - insert >> end [level=1, statement=insert] 16:58:21,281 DEBUG ErrorCounter:68 - throwQueryException() : no errors 16:58:21,328 DEBUG ErrorCounter:68 - throwQueryException() : no errors 16:58:21,437 WARN JDBCExceptionReporter:71 - SQL Error: 1062, SQLState: 23000 16:58:21,437 ERROR JDBCExceptionReporter:72 - Duplicate entry '1' for key 1 org.hibernate.exception.ConstraintViolationException: could not execute update query at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.hql.ast.exec.BasicExecutor.execute(BasicExecutor.java:84) at org.hibernate.hql.ast.QueryTranslatorImpl.executeUpdate(QueryTranslatorImpl.java:334) at org.hibernate.engine.query.HQLQueryPlan.performExecuteUpdate(HQLQueryPlan.java:209) at org.hibernate.impl.SessionImpl.executeUpdate(SessionImpl.java:1126) at org.hibernate.impl.QueryImpl.executeUpdate(QueryImpl.java:94) at com.articleweb.model.control.ArticleControl.insertArticles(ArticleControl.java:28) at com.articleweb.struts.action.ArticlesAction.showarti(ArticlesAction.java:47) 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:597) at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280) at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216) at org.springframework.web.struts.DelegatingActionProxy.execute(DelegatingActionProxy.java:106) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507) at javax.servlet.http.HttpServlet.service(HttpServlet.java:690) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689) at java.lang.Thread.run(Thread.java:619) Caused by: java.sql.SQLException: Duplicate entry '1' for key 1 at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2921) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1570) at com.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1085) at com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:670) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1159) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1076) at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1061) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102) at org.hibernate.hql.ast.exec.BasicExecutor.execute(BasicExecutor.java:75) ... 33 more 16:58:21,437 DEBUG JDBCTransaction:152 - rollback 16:58:21,437 DEBUG JDBCTransaction:193 - re-enabling autocommit 16:58:21,437 DEBUG JDBCTransaction:163 - rolled back JDBC Connection 16:58:21,437 DEBUG QueryTranslatorImpl:236 - parse() - HQL: from com.articleweb.model.Articles 16:58:21,437 DEBUG ErrorCounter:68 - throwQueryException() : no errors 16:58:21,437 DEBUG HqlSqlBaseWalker:111 - select << begin [level=1, statement=select] 16:58:21,437 DEBUG FromElement:104 - FromClause{level=1} : com.articleweb.model.Articles (no alias) -> articles0_ 16:58:21,437 DEBUG HqlSqlBaseWalker:117 - select : finishing up [level=1, statement=select] 16:58:21,437 DEBUG HqlSqlWalker:511 - processQuery() : ( SELECT ( FromClause{level=1} myweb.articles articles0_ ) ) 16:58:21,453 DEBUG HqlSqlWalker:713 - Derived SELECT clause created. 16:58:21,453 DEBUG JoinProcessor:128 - Using FROM fragment [myweb.articles articles0_] 16:58:21,453 DEBUG HqlSqlBaseWalker:123 - select >> end [level=1, statement=select] 16:58:21,453 DEBUG ErrorCounter:68 - throwQueryException() : no errors 16:58:21,453 DEBUG QueryTranslatorImpl:206 - HQL: from com.articleweb.model.Articles 16:58:21,453 DEBUG QueryTranslatorImpl:207 - SQL: select articles0_.ArtiID as ArtiID11_, articles0_.ArtiName as ArtiName11_, articles0_.ArtiSpec as ArtiSpec11_, articles0_.ArtiModel as ArtiModel11_, articles0_.ArtiMarkPrice as ArtiMark5_11_, articles0_.ArtiAssociatorPrice as ArtiAsso6_11_, articles0_.ArtiInfo as ArtiInfo11_, articles0_.ArtiFlag as ArtiFlag11_, articles0_.ArtiClassName as ArtiClas9_11_, articles0_.ArtiBrandName as ArtiBra10_11_, articles0_.ArtiPhotoPath as ArtiPho11_11_ from myweb.articles articles0_ 16:58:21,453 DEBUG ErrorCounter:68 - throwQueryException() : no errors

ssh配置error

tomcat启动时包了这样的错误 <br />ERROR [org.springframework.web.context.ContextLoader] - &lt;context initialization="" failed=""&gt; <br />org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/applicationContext.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/applicationContext.xml] <br />at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:349) <br />at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310) <br />at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143) <br />at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178) <br />at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149) <br />at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124) <br />at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92) <br />at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123) <br />at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:423) <br />at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:353) <br />at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255) <br />at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199) <br />at org.springframework.web.context.ContextLoaderServlet.init(ContextLoaderServlet.java:81) <br />at javax.servlet.GenericServlet.init(GenericServlet.java:211) <br />at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1029) <br />at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:862) <br />at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4013) <br />at org.apache.catalina.core.StandardContext.start(StandardContext.java:4357) <br />at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823) <br />at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807) <br />at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595) <br />at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:277) <br />at org.apache.catalina.core.StandardHost.install(StandardHost.java:832) <br />at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:701) <br />at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:432) <br />at org.apache.catalina.startup.HostConfig.start(HostConfig.java:983) <br />at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349) <br />at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) <br />at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091) <br />at org.apache.catalina.core.StandardHost.start(StandardHost.java:789) <br />at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083) <br />at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478) <br />at org.apache.catalina.core.StandardService.start(StandardService.java:480) <br />at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313) <br />at org.apache.catalina.startup.Catalina.start(Catalina.java:556) <br />at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) <br />at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) <br />at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) <br />at java.lang.reflect.Method.invoke(Method.java:585) <br />at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287) <br />at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425) <br />Caused by: java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/applicationContext.xml] <br />at org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:116) <br />at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336) <br />... 40 more <br />2008-09-15 11:13:02,694 INFO [org.apache.struts.action.ActionServlet] - &lt;loading chain="" catalog="" from="" jar:file:="" c:="" program%20files="" apache%20software%20foundation="" tomcat%205.0="" webapps="" mzntdemo="" web-inf="" lib="" struts-core-1.3.8.jar!="" org="" apache="" struts="" chain="" chain-config.xml=""&gt; <br />2008-09-15 11:13:03,882 INFO [org.springframework.web.struts.ContextLoaderPlugIn] - &lt;contextloaderplugin for="" struts="" actionservlet="" 'action,="" module="" '':="" initialization="" started=""&gt; <br />2008-09-15 11:13:03,898 ERROR [org.springframework.web.struts.ContextLoaderPlugIn] - &lt;context initialization="" failed=""&gt; <br />org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/applicationContext.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/applicationContext.xml] <br />at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:349) <br />at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310) <br />at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143) <br />at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178) <br />at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149) <br />at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124) <br />at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92) <br />at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123) <br />at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:423) <br />at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:353) <br />at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255) <br />at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199) <br />at org.springframework.web.context.ContextLoaderServlet.init(ContextLoaderServlet.java:81) <br />at javax.servlet.GenericServlet.init(GenericServlet.java:211) <br />at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1029) <br />at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:862) <br />at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4013) <br />at org.apache.catalina.core.StandardContext.start(StandardContext.java:4357) <br />at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823) <br />at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807) <br />at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595) <br />at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:277) <br />at org.apache.catalina.core.StandardHost.install(StandardHost.java:832) <br />at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:701) <br />at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:432) <br />at org.apache.catalina.startup.HostConfig.start(HostConfig.java:983) <br />at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349) <br />at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) <br />at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091) <br />at org.apache.catalina.core.StandardHost.start(StandardHost.java:789) <br />at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083) <br />at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478) <br />at org.apache.catalina.core.StandardService.start(StandardService.java:480) <br />at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313) <br />at org.apache.catalina.startup.Catalina.start(Catalina.java:556) <br />at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) <br />at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) <br />at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) <br />at java.lang.reflect.Method.invoke(Method.java:585) <br />at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287) <br />at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425) <br />Caused by: java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/applicationContext.xml] <br />at org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:116) <br />at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336) <br />... 40 more <br />我的applicationContext.xml是这样配置的 <br />&lt;bean id="dataSource" &lt;br=""&gt;class="org.springframework.jndi.JndiObjectFactoryBean"&gt; <br />&lt;property name="jndiName" value="java:comp/env/jdbc/mldn"&gt;&lt;/property&gt; <br />&lt;/bean&gt; <br />&lt;bean id="sessionFactory" &lt;br=""&gt;class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"&gt; <br />&lt;property name="dataSource"&gt; <br />&lt;ref bean="dataSource"&gt; <br />&lt;/property&gt; <br />&lt;property name="hibernateProperties"&gt; <br />&lt;props&gt; <br />&lt;prop key="hibernate.dialect"&gt; <br />org.hibernate.dialect.MySQLDialect <br />&lt;/prop&gt; <br />&lt;prop key="hibernate.show_sql"&gt;true&lt;/prop&gt; <br />&lt;prop key="hibernate.autocommit"&gt;true&lt;/prop&gt; <br />&lt;/props&gt; <br />&lt;/property&gt; <br />&lt;property name="mappingResources"&gt; <br />&lt;list&gt; <br />&lt;value&gt;com/db/mznt/vo/TUser.hbm.xml&lt;/value&gt; <br />&lt;/list&gt; <br />&lt;/property&gt; <br />&lt;/bean&gt; <br />&lt;bean id="hibernateTemplate" &lt;br=""&gt;class="org.springframework.orm.hibernate3.HibernateTemplate"&gt; <br />&lt;property name="sessionFactory"&gt; <br />&lt;ref bean="sessionFactory"&gt; <br />&lt;/property&gt; <br />&lt;/bean&gt; <br />&lt;bean id="t_userdao" class="com.db.mznt.dao.t_userDAO" &lt;br=""&gt;abstract="true"&gt; <br />&lt;/bean&gt; <br />&lt;bean id="t_userdaoimpl" class="com.db.mznt.daoimpl.t_userDAOImpl" &lt;br=""&gt;parent="t_userdao"&gt; <br />&lt;property name="hibernateTemplate"&gt; <br />&lt;ref bean="hibernateTemplate"&gt; <br />&lt;/property&gt; <br />&lt;/bean&gt; <br />&lt;bean name="/jsp/user" &lt;br=""&gt;class="com.db.mznt.struts.action.UserAction"&gt; <br />&lt;property name="t_userdao"&gt; <br />&lt;ref bean="t_userdaoimpl"&gt; <br />&lt;/property&gt; <br />&lt;/bean&gt; <br />&lt;/beans&gt;<br /><strong>问题补充:</strong><br />我在web.xml中是这样啊应该没错啊 <br />&lt;context-param&gt; <br /> &lt;param-name&gt;contxtConfigLocation&lt;/param-name&gt; <br /> &lt;param-value&gt; <br /> /WEB-INF/classes/applicationContext.xml <br /> &lt;/param-value&gt; <br /> &lt;/context-param&gt; <br /> &lt;servlet&gt; <br /> &lt;servlet-name&gt;context&lt;/servlet-name&gt; <br /> &lt;servlet-class&gt; <br /> org.springframework.web.context.ContextLoaderServlet <br /> &lt;/servlet-class&gt; <br /> &lt;load-on-startup&gt;1&lt;/load-on-startup&gt; <br /> &lt;/servlet&gt;<br /><strong>问题补充:</strong><br />做了和原来一样错误<br /><strong>问题补充:</strong><br />我是这样写的啊 <br />&lt;param-value&gt;/WEB-INF/classes/applicationContext.xml&lt;/param-value&gt;<br /><strong>问题补充:</strong><br />我是这样写的没错啊 <br />但不知道为什么报错时说我写的是/WEB-INF/applicationContext.xml <br />其实我一直是这样写的 <br />&lt;context-param&gt; <br /> &lt;param-name&gt;contxtConfigLocation&lt;/param-name&gt; <br /> &lt;param-value&gt; <br /> /WEB-INF/classes/applicationContext.xml <br /> &lt;/param-value&gt; <br /> &lt;/context-param&gt; <br /> &lt;servlet&gt; <br /> &lt;servlet-name&gt;context&lt;/servlet-name&gt; <br /> &lt;servlet-class&gt; <br /> org.springframework.web.context.ContextLoaderServlet <br /> &lt;/servlet-class&gt; <br /> &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;<br /><strong>问题补充:</strong><br />我是按你说的那样做的 <br />就是包的这个错误 <br />不知道是不是其他别的地方的错误<br /><strong>问题补充:</strong><br />按你说的做了 <br />结果是 <br />ERROR [org.springframework.web.context.ContextLoader] - &lt;context initialization="" failed=""&gt; <br />org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 5 in XML document from ServletContext resource [/WEB-INF/applicationContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException: Document root element "bean", must match DOCTYPE root "beans". <br /> at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:404) <br /> at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342) <br /> at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310) <br /> at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143) <br /> at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178) <br /> at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149) <br /> at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124) <br /> at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92) <br /> at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123) <br /> at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:423) <br /> at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:353) <br /> at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255) <br /> at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199) <br /> at org.springframework.web.context.ContextLoaderServlet.init(ContextLoaderServlet.java:81) <br /> at javax.servlet.GenericServlet.init(GenericServlet.java:211) <br /> at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1029) <br /> at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:862) <br /> at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4013) <br /> at org.apache.catalina.core.StandardContext.start(StandardContext.java:4357) <br /> at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823) <br /> at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807) <br /> at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595) <br /> at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:277) <br /> at org.apache.catalina.core.StandardHost.install(StandardHost.java:832) <br /> at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:701) <br /> at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:432) <br /> at org.apache.catalina.startup.HostConfig.start(HostConfig.java:983) <br /> at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349) <br /> at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) <br /> at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091) <br /> at org.apache.catalina.core.StandardHost.start(StandardHost.java:789) <br /> at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083) <br /> at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478) <br /> at org.apache.catalina.core.StandardService.start(StandardService.java:480) <br /> at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313) <br /> at org.apache.catalina.startup.Catalina.start(Catalina.java:556) <br /> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) <br /> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) <br /> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) <br /> at java.lang.reflect.Method.invoke(Method.java:585) <br /> at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287) <br /> at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425) <br />Caused by: org.xml.sax.SAXParseException: Document root element "bean", must match DOCTYPE root "beans". <br /> at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) <br /> at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source) <br /> at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) <br /> at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) <br /> at org.apache.xerces.impl.dtd.XMLDTDValidator.rootElementSpecified(Unknown Source) <br /> at org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(Unknown Source) <br /> at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source) <br /> at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source) <br /> at org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElementHook(Unknown Source) <br /> at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) <br /> at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) <br /> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) <br /> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) <br /> at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) <br /> at org.apache.xerces.parsers.DOMParser.parse(Unknown Source) <br /> at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source) <br /> at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75) <br /> at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:396) <br /> ... 41 more <br />2008-09-15 16:19:03,468 INFO [org.apache.struts.action.ActionServlet] - &lt;loading chain="" catalog="" from="" jar:file:="" c:="" program%20files="" apache%20software%20foundation="" tomcat%205.0="" webapps="" mzntdemo="" web-inf="" lib="" struts-core-1.3.8.jar!="" org="" apache="" struts="" chain="" chain-config.xml=""&gt; <br />2008-09-15 16:19:04,625 INFO [org.springframework.web.struts.ContextLoaderPlugIn] - &lt;contextloaderplugin for="" struts="" actionservlet="" 'action,="" module="" '':="" initialization="" started=""&gt; <br />2008-09-15 16:19:04,640 ERROR [org.springframework.web.struts.ContextLoaderPlugIn] - &lt;context initialization="" failed=""&gt; <br />org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 5 in XML document from ServletContext resource [/WEB-INF/applicationContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException: Document root element "bean", must match DOCTYPE root "beans". <br /> at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:404) <br /> at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342) <br /> at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310) <br /> at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143) <br /> at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178) <br /> at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149) <br /> at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124) <br /> at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92) <br /> at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123) <br /> at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:423) <br /> at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:353) <br /> at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255) <br /> at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199) <br /> at org.springframework.web.context.ContextLoaderServlet.init(ContextLoaderServlet.java:81) <br /> at javax.servlet.GenericServlet.init(GenericServlet.java:211) <br /> at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1029) <br /> at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:862) <br /> at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4013) <br /> at org.apache.catalina.core.StandardContext.start(StandardContext.java:4357) <br /> at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823) <br /> at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807) <br /> at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595) <br /> at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:277) <br /> at org.apache.catalina.core.StandardHost.install(StandardHost.java:832) <br /> at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:701) <br /> at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:432) <br /> at org.apache.catalina.startup.HostConfig.start(HostConfig.java:983) <br /> at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349) <br /> at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) <br /> at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091) <br /> at org.apache.catalina.core.StandardHost.start(StandardHost.java:789) <br /> at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083) <br /> at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478) <br /> at org.apache.catalina.core.StandardService.start(StandardService.java:480) <br /> at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313) <br /> at org.apache.catalina.startup.Catalina.start(Catalina.java:556) <br /> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) <br /> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) <br /> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) <br /> at java.lang.reflect.Method.invoke(Method.java:585) <br /> at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287) <br /> at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425) <br />Caused by: org.xml.sax.SAXParseException: Document root element "bean", must match DOCTYPE root "beans". <br /> at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) <br /> at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source) <br /> at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) <br /> at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) <br /> at org.apache.xerces.impl.dtd.XMLDTDValidator.rootElementSpecified(Unknown Source) <br /> at org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(Unknown Source) <br /> at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source) <br /> at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source) <br /> at org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElementHook(Unknown Source) <br /> at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) <br /> at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) <br /> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) <br /> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) <br /> at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) <br /> at org.apache.xerces.parsers.DOMParser.parse(Unknown Source) <br /> at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source) <br /> at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75) <br /> at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:396) <br /> ... 41 more <br />2008-09-15 16:19:04,656 WARN [org.apache.struts.util.PropertyMessageResources] - &lt; Resource org/apache/struts/action/ActionResources_zh_CN.properties Not Found.&gt; <br />2008-09-15 16:19:04,656 WARN [org.apache.struts.util.PropertyMessageResources] - &lt; Resource org/apache/struts/action/ActionResources_zh.properties Not Found.&gt; <br />2008-9-15 16:19:04 org.apache.catalina.core.StandardHostDeployer install<br /><strong>问题补充:</strong><br />全部是meeclipse自动运行配置的我只补充了部分内容<br /><strong>问题补充:</strong><br />我配置了问题任然存在<br /><strong>问题补充:</strong><br />刚才这个beans的问题是我刚才该了东西该错了<br /><strong>问题补充:</strong><br />这是现在的错误 <br />ERROR [org.springframework.web.context.ContextLoader] - &lt;context initialization="" failed=""&gt; <br />org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/applicationContext.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/applicationContext.xml] <br /> at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:349) <br /> at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310) <br /> at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143) <br /> at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178) <br /> at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149) <br /> at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124) <br /> at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92) <br /> at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123) <br /> at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:423) <br /> at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:353) <br /> at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255) <br /> at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199) <br /> at org.springframework.web.context.ContextLoaderServlet.init(ContextLoaderServlet.java:81) <br /> at javax.servlet.GenericServlet.init(GenericServlet.java:211) <br /> at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1029) <br /> at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:862) <br /> at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4013) <br /> at org.apache.catalina.core.StandardContext.start(StandardContext.java:4357) <br /> at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823) <br /> at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807) <br /> at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595) <br /> at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:277) <br /> at org.apache.catalina.core.StandardHost.install(StandardHost.java:832) <br /> at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:701) <br /> at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:432) <br /> at org.apache.catalina.startup.HostConfig.start(HostConfig.java:983) <br /> at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349) <br /> at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) <br /> at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091) <br /> at org.apache.catalina.core.StandardHost.start(StandardHost.java:789) <br /> at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083) <br /> at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478) <br /> at org.apache.catalina.core.StandardService.start(StandardService.java:480) <br /> at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313) <br /> at org.apache.catalina.startup.Catalina.start(Catalina.java:556) <br /> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) <br /> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) <br /> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) <br /> at java.lang.reflect.Method.invoke(Method.java:585) <br /> at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287) <br /> at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425) <br />Caused by: java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/applicationContext.xml] <br /> at org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:116) <br /> at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336) <br /> ... 40 more <br />2008-09-15 16:43:26,453 INFO [org.apache.struts.action.ActionServlet] - &lt;loading chain="" catalog="" from="" jar:file:="" c:="" program%20files="" apache%20software%20foundation="" tomcat%205.0="" webapps="" mzntdemo="" web-inf="" lib="" struts-core-1.3.8.jar!="" org="" apache="" struts="" chain="" chain-config.xml=""&gt; <br />2008-09-15 16:43:27,921 INFO [org.springframework.web.struts.ContextLoaderPlugIn] - &lt;contextloaderplugin for="" struts="" actionservlet="" 'action,="" module="" '':="" initialization="" started=""&gt; <br />2008-09-15 16:43:27,937 ERROR [org.springframework.web.struts.ContextLoaderPlugIn] - &lt;context initialization="" failed=""&gt; <br />org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/applicationContext.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/applicationContext.xml] <br /> at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:349) <br /> at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310) <br /> at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143) <br /> at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178) <br /> at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149) <br /> at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124) <br /> at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92) <br /> at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123) <br /> at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:423) <br /> at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:353) <br /> at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255) <br /> at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199) <br /> at org.springframework.web.context.ContextLoaderServlet.init(ContextLoaderServlet.java:81) <br /> at javax.servlet.GenericServlet.init(GenericServlet.java:211) <br /> at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1029) <br /> at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:862) <br /> at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4013) <br /> at org.apache.catalina.core.StandardContext.start(StandardContext.java:4357) <br /> at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823) <br /> at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807) <br /> at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595) <br /> at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:277) <br /> at org.apache.catalina.core.StandardHost.install(StandardHost.java:832) <br /> at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:701) <br /> at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:432) <br /> at org.apache.catalina.startup.HostConfig.start(HostConfig.java:983) <br /> at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349) <br /> at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) <br /> at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091) <br /> at org.apache.catalina.core.StandardHost.start(StandardHost.java:789) <br /> at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083) <br /> at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478) <br /> at org.apache.catalina.core.StandardService.start(StandardService.java:480) <br /> at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313) <br /> at org.apache.catalina.startup.Catalina.start(Catalina.java:556) <br /> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) <br /> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) <br /> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) <br /> at java.lang.reflect.Method.invoke(Method.java:585) <br /> at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287) <br /> at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425) <br />Caused by: java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/applicationContext.xml] <br /> at org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:116) <br /> at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336) <br /> ... 40 more <br />2008-09-15 16:43:27,937 WARN [org.apache.struts.util.PropertyMessageResources] - &lt; Resource org/apache/struts/action/ActionResources_zh_CN.properties Not Found.&gt; <br />2008-09-15 16:43:27,937 WARN [org.apache.struts.util.PropertyMessageResources] - &lt; Resource org/apache/struts/action/ActionResources_zh.properties Not Found.&gt; <br />2008-9-15 16:43:27 org.apache.catalina.core.StandardHostDeployer install<br /><strong>问题补充:</strong><br />这是我的web.xml <br /> <br />&lt;web-app xmlns="http://java.sun.com/xml/ns/j2ee" &lt;br=""&gt; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4" <br /> xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"&gt; <br /> &lt;filter&gt; <br /> &lt;filter-name&gt;encoding&lt;/filter-name&gt; <br /> &lt;filter-class&gt;com.db.mznt.filter.EncodingFilter&lt;/filter-class&gt; <br /> &lt;init-param&gt; <br /> &lt;param-name&gt;charset&lt;/param-name&gt; <br /> &lt;param-value&gt;utf-8&lt;/param-value&gt; <br /> &lt;/init-param&gt; <br /> &lt;/filter&gt; <br /> &lt;filter-mapping&gt; <br /> &lt;filter-name&gt;encoding&lt;/filter-name&gt; <br /> &lt;url-pattern&gt;/*&lt;/url-pattern&gt; <br /> &lt;/filter-mapping&gt; <br /> &lt;context-param&gt; <br /> &lt;param-name&gt;contxtConfigLocation&lt;/param-name&gt; <br /> &lt;param-value&gt; <br /> /WEB-INF/classes/applicationContext.xml <br /> &lt;/param-value&gt; <br /> &lt;/context-param&gt; <br /> &lt;context-param&gt; <br /> &lt;param-name&gt;log4jConfigLocation&lt;/param-name&gt; <br /> &lt;param-value&gt;/WEB-INF/classes/log4j.properties&lt;/param-value&gt; <br /> &lt;/context-param&gt; <br /> &lt;servlet&gt; <br /> &lt;servlet-name&gt;context&lt;/servlet-name&gt; <br /> &lt;servlet-class&gt; <br /> org.springframework.web.context.ContextLoaderServlet <br /> &lt;/servlet-class&gt; <br /> &lt;load-on-startup&gt;1&lt;/load-on-startup&gt; <br /> &lt;/servlet&gt; <br /> &lt;servlet&gt; <br /> &lt;servlet-name&gt;action&lt;/servlet-name&gt; <br /> &lt;servlet-class&gt; <br /> org.apache.struts.action.ActionServlet <br /> &lt;/servlet-class&gt; <br /> &lt;init-param&gt; <br /> &lt;param-name&gt;config&lt;/param-name&gt; <br /> &lt;param-value&gt;/WEB-INF/struts-config.xml&lt;/param-value&gt; <br /> &lt;/init-param&gt; <br /> &lt;init-param&gt; <br /> &lt;param-name&gt;debug&lt;/param-name&gt; <br /> &lt;param-value&gt;3&lt;/param-value&gt; <br /> &lt;/init-param&gt; <br /> &lt;init-param&gt; <br /> &lt;param-name&gt;detail&lt;/param-name&gt; <br /> &lt;param-value&gt;3&lt;/param-value&gt; <br /> &lt;/init-param&gt; <br /> &lt;load-on-startup&gt;0&lt;/load-on-startup&gt; <br /> &lt;/servlet&gt; <br /> &lt;servlet-mapping&gt; <br /> &lt;servlet-name&gt;action&lt;/servlet-name&gt; <br /> &lt;url-pattern&gt;*.do&lt;/url-pattern&gt; <br /> &lt;/servlet-mapping&gt; <br /> &lt;welcome-file-list&gt; <br /> &lt;welcome-file&gt;jsp/register.jsp&lt;/welcome-file&gt; <br /> &lt;/welcome-file-list&gt; <br />&lt;/web-app&gt; <br /> <br /><br /><strong>问题补充:</strong><br />这是我的applicationContext.xml <br /> <br />&lt;beans xmlns="http://www.springframework.org/schema/beans" &lt;br=""&gt; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <br /> xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"&gt; <br /> <br /> <br /> &lt;bean id="dataSource" &lt;br=""&gt; class="org.springframework.jndi.JndiObjectFactoryBean"&gt; <br /> &lt;property name="jndiName" value="java:comp/env/jdbc/mldn"&gt;&lt;/property&gt; <br /> &lt;/bean&gt; <br /> &lt;bean id="sessionFactory" &lt;br=""&gt; class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"&gt; <br /> &lt;property name="dataSource"&gt; <br /> &lt;ref bean="dataSource"&gt; <br /> &lt;/property&gt; <br /> &lt;property name="hibernateProperties"&gt; <br /> &lt;props&gt; <br /> &lt;prop key="hibernate.dialect"&gt; <br /> org.hibernate.dialect.MySQLDialect <br /> &lt;/prop&gt; <br /> &lt;prop key="hibernate.show_sql"&gt;true&lt;/prop&gt; <br /> &lt;prop key="hibernate.connection.autocommit"&gt;true&lt;/prop&gt; <br /> &lt;/props&gt; <br /> &lt;/property&gt; <br /> &lt;property name="mappingResources"&gt; <br /> &lt;list&gt; <br /> &lt;value&gt;com/db/mznt/vo/TUser.hbm.xml&lt;/value&gt; <br /> &lt;/list&gt; <br /> &lt;/property&gt; <br /> &lt;/bean&gt; <br /> &lt;bean id="hibernateTemplate" &lt;br=""&gt; class="org.springframework.orm.hibernate3.HibernateTemplate"&gt; <br /> &lt;property name="sessionFactory"&gt; <br /> &lt;ref bean="sessionFactory"&gt; <br /> &lt;/property&gt; <br /> &lt;/bean&gt; <br /> &lt;bean id="t_userdao" class="com.db.mznt.dao.t_userDAO" &lt;br=""&gt; abstract="true"&gt; <br /> &lt;/bean&gt; <br /> &lt;bean id="t_userdaoimpl" class="com.db.mznt.daoimpl.t_userDAOImpl" &lt;br=""&gt; parent="t_userdao"&gt; <br /> &lt;property name="hibernateTemplate"&gt; <br /> &lt;ref bean="hibernateTemplate"&gt; <br /> &lt;/property&gt; <br /> &lt;/bean&gt; <br /> &lt;bean name="/jsp/user" &lt;br=""&gt; class="com.db.mznt.struts.action.UserAction"&gt; <br /> &lt;property name="t_userdao"&gt; <br /> &lt;ref bean="t_userdaoimpl"&gt; <br /> &lt;/property&gt; <br /> &lt;/bean&gt; <br />&lt;/beans&gt;<br /><strong>问题补充:</strong><br />这是我的struts-config.xml <br /> <br /> <br /> <br />&lt;struts-config&gt; <br /> &lt;form-beans&gt; <br /> &lt;form-bean name="userForm" &lt;br=""&gt; type="com.db.mznt.struts.form.UserForm" /&gt; <br /> <br /> &lt;/form-beans&gt; <br /> <br /> &lt;global-exceptions&gt; <br /> &lt;global-forwards&gt; <br /> &lt;action-mappings&gt; <br /> &lt;action attribute="userForm" input="/jsp/errors.jsp" &lt;br=""&gt; name="userForm" parameter="status" path="/jsp/user" scope="request" <br /> type="com.db.mznt.struts.action.UserAction"&gt; <br /> &lt;forward name="registersuccess" &lt;br=""&gt; path="/jsp/registerSuccess.jsp"&gt; <br /> &lt;/forward&gt; <br /> &lt;forward name="registerfalure" path="/jsp/register.jsp"&gt;&lt;/forward&gt; <br /> &lt;/action&gt; <br /> <br /> &lt;/action-mappings&gt; <br /> <br /> &lt;controller &lt;br=""&gt; processorClass="org.springframework.web.struts.DelegatingRequestProcessor"&gt; <br /> &lt;/controller&gt; <br /> &lt;message-resources &lt;br=""&gt; parameter="com.db.mznt.struts.ApplicationResources" /&gt; <br /> &lt;plug-in &lt;br=""&gt; className="org.springframework.web.struts.ContextLoaderPlugIn"&gt; <br /> &lt;set-property property="contxtConfigLocation" &lt;br=""&gt; value="/WEB-INF/classes/applicationContext.xml" /&gt; <br /> &lt;/plug-in&gt; <br /> <br />&lt;/struts-config&gt; <br /> <br /><br /><strong>问题补充:</strong><br />改了还是包那个错<br /><strong>问题补充:</strong><br />都该了<br /><strong>问题补充:</strong><br />先在错误编程了 <br />ERROR [org.springframework.web.context.ContextLoader] - &lt;context initialization="" failed=""&gt; <br />org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: Name jdbc is not bound in this Context <br /> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1336)<br /><strong>问题补充:</strong><br />我这样写的好像还是有点问题 <br /> <br />&lt;context path="/mldn"&gt; <br /> &lt;resource name="java:comp/env/jdbc/mldn" type="javax.sql.DataSource" &lt;br=""&gt; username="root" password="ads" driverClassName="com.mysql.jdbc.Driver" <br /> url="jdbc:mysql://localhost:3306/mldn" maxActive="4" maxIdle="2" /&gt; <br />&lt;/context&gt; <br /><br /><strong>问题补充:</strong><br />改后怎么还是包这个错 <br />ERROR [org.springframework.web.context.ContextLoader] - &lt;context initialization="" failed=""&gt; <br />org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: Name jdbc is not bound in this Context<br /><strong>问题补充:</strong><br />applicationContext.xml中我用的是 <br />&lt;bean id="dataSource" &lt;br=""&gt; class="org.springframework.jndi.JndiObjectFactoryBean"&gt; <br /> &lt;property name="jndiName" value="java:comp/env/jdbc/mldn"&gt;&lt;/property&gt; <br /> &lt;/bean&gt;<br /><strong>问题补充:</strong><br />现在的问题是 <br />ERROR [org.hibernate.util.JDBCExceptionReporter] - &lt;cannot create="" jdbc="" driver="" of="" class="" ''="" for="" connect="" url="" 'null'=""&gt; <br />2008-09-15 20:37:40,015 WARN [org.hibernate.cfg.SettingsFactory] - &lt;could not="" obtain="" connection="" metadata=""&gt; <br />org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'<br /><strong>问题补充:</strong><br />这个问题一直没解决了 <br />ERROR [org.hibernate.util.JDBCExceptionReporter] - &lt;cannot create="" jdbc="" driver="" of="" class="" ''="" for="" connect="" url="" 'null'=""&gt; <br />2008-09-15 21:56:56,687 WARN [org.hibernate.cfg.SettingsFactory] - &lt;could not="" obtain="" connection="" metadata=""&gt; <br />org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'<br /><strong>问题补充:</strong><br />放进去了的,任然报这个错误。都快郁闷死了<br /><strong>问题补充:</strong><br />好的,谢谢你 <br />sxwave@163.com<br /><strong>问题补充:</strong><br />昨天的问题出在我tomcat中没有配置,但配置好后现在出现了个新问题。问题是 <br />ERROR [org.springframework.web.context.ContextLoader] - &lt;context initialization="" failed=""&gt; <br />org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/classes/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit(IILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V

一条HQL语句引起的异常

表结构: CREATE TABLE IF NOT EXISTS tb_cases( id int(11) NOT NULL auto_increment, cdate date default NULL, title varchar(50) default NULL, cont text, imgpath varchar(80) default NULL, apply text, PRIMARY KEY (id) )ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; Hibernate映射文件: <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <hibernate-mapping> <class name="com.base.hibernate.po.Cases" table="tb_cases"> <id name="id" type="java.lang.Integer"> <column name="id" /> <generator class="native" /> </id> <property name="cdate" type="java.util.Date"> <column name="cdate" length="10" /> </property> <property name="title" type="java.lang.String"> <column name="title" length="50" /> </property> <property name="content" type="java.lang.String"> <column name="cont" /> </property> <property name="imgpath" type="java.lang.String"> <column name="imgpath" length="50" /> </property> <property name="apply" type="java.lang.String"> <column name="apply" /> </property> </class> </hibernate-mapping> HQL语句: String FIND_CASENUM = " from Cases order by cdate desc "; 实现方法: public List<Cases> getCasesNum(final int showPage, final int pageSize){ return getHibernateTemplate().executeFind(new HibernateCallback() { public Object doInHibernate(final Session session) { Query query = session.createQuery(FIND_CASENUM); query.setFirstResult((showPage - 1) * pageSize); query.setMaxResults(pageSize); List<Cases> casesList = query.list(); if(null == casesList || casesList.isEmpty()){ casesList = null; } return casesList; } }); } 抛出异常: Hibernate: select top 4 cases0_.id as id1_, cases0_.cdate as cdate1_, cases0_.title as title1_, cases0_.cont as cont1_, cases0_.imgpath as imgpath1_, cases0_.apply as apply1_ from tb_cases cases0_ order by cases0_.cdate desc 2009-07-08 13:06:22,281 [org.hibernate.util.JDBCExceptionReporter]-[WARN] SQL Error: 1064, SQLState: 42000 2009-07-08 13:06:22,281 [org.hibernate.util.JDBCExceptionReporter]-[ERROR] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '4 cases0_.id as id1_, cases0_.cdate as cdate1_, cases0_.title as title1_, cases0' at line 1 2009-07-08 13:06:26,812 [org.apache.struts.action.RequestProcessor]-[WARN] Unhandled Exception thrown: class org.springframework.dao.InvalidDataAccessResourceUsageException 2009-07-08 13:06:26,812 [org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/bianyaqi].[action]]-[ERROR] Servlet.service() for servlet action threw exception org.hibernate.exception.SQLGrammarException: could not execute query at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.loader.Loader.doList(Loader.java:2223) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104) at org.hibernate.loader.Loader.list(Loader.java:2099) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378) at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338) at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79) at com.base.hibernate.dao.impl.CasesDaoImpl$1.doInHibernate(CasesDaoImpl.java:65) at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:372) at org.springframework.orm.hibernate3.HibernateTemplate.executeFind(HibernateTemplate.java:342) at com.base.hibernate.dao.impl.CasesDaoImpl.getCasesNum(CasesDaoImpl.java:60) at com.base.spring.service.impl.CasesServiceImpl.getCasesNum(CasesServiceImpl.java:66) 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:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:139) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy1.getCasesNum(Unknown Source) at com.base.struts.action.IndexAction.execute(IndexAction.java:130) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414) at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at com.base.common.filter.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:123) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at com.base.common.filter.ForceNoCacheFilter.doFilter(ForceNoCacheFilter.java:36) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Thread.java:619) Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '4 cases0_.id as id1_, cases0_.cdate as cdate1_, cases0_.title as title1_, cases0' at line 1 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at com.mysql.jdbc.Util.handleNewInstance(Util.java:406) at com.mysql.jdbc.Util.getInstance(Util.java:381) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1030) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3491) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3423) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1936) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2060) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2542) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1734) at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1885) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:93) at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186) at org.hibernate.loader.Loader.getResultSet(Loader.java:1787) at org.hibernate.loader.Loader.doQuery(Loader.java:674) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236) at org.hibernate.loader.Loader.doList(Loader.java:2220) ... 54 more 怀疑是HQL语句有什么错误,但愣是没找出来 映射文件与表中的字段名也检查过了,没什么问题啊! 查看了好久也没找出到底什么地方的错误 还请各们朋友们帮下忙看下到底怎么回事! 补充: 如果将HQL语句改成 from Product 问题依旧 但在Mysql数据库中使用 select id,cdate,title,cont,imgpath,apply from tb_cases; 语句没有任何错误!

2019 AI开发者大会

2019 AI开发者大会(AI ProCon 2019)是由中国IT社区CSDN主办的AI技术与产业年度盛会。多年经验淬炼,如今蓄势待发:2019年9月6-7日,大会将有近百位中美顶尖AI专家、知名企业代表以及千余名AI开发者齐聚北京,进行技术解读和产业论证。我们不空谈口号,只谈技术,诚挚邀请AI业内人士一起共铸人工智能新篇章!

实现简单的文件系统

实验内容: 通过对具体的文件存储空间的管理、文件的物理结构、目录结构和文件操作的实现,加深对文件系统内部功能和实现过程的理解。 要求: 1.在内存中开辟一个虚拟磁盘空间作为文件存储器,在其上实现一个简

MIPS单周期CPU-组成原理实验-华中科技大学

使用logisim布线完成的MIPS单周期CPU,可支持28条指令。跑马灯的代码已经装入了寄存器,可以直接开启时钟运行。

2019数学建模A题高压油管的压力控制 省一论文即代码

2019数学建模A题高压油管的压力控制省一完整论文即详细C++和Matlab代码,希望对同学们有所帮助

基于QT和OpenCV的五子棋实现源码

一个简单的五子棋应用,基于QT和OpenCV的实现源码,通过相邻棋子判断是否获胜,不包含人工智能算法,适合新手入门

Git 实用技巧

这几年越来越多的开发团队使用了Git,掌握Git的使用已经越来越重要,已经是一个开发者必备的一项技能;但很多人在刚开始学习Git的时候会遇到很多疑问,比如之前使用过SVN的开发者想不通Git提交代码为什么需要先commit然后再去push,而不是一条命令一次性搞定; 更多的开发者对Git已经入门,不过在遇到一些代码冲突、需要恢复Git代码时候就不知所措,这个时候哪些对 Git掌握得比较好的少数人,就像团队中的神一样,在队友遇到 Git 相关的问题的时候用各种流利的操作来帮助队友于水火。 我去年刚加入新团队,发现一些同事对Git的常规操作没太大问题,但对Git的理解还是比较生疏,比如说分支和分支之间的关联关系、合并代码时候的冲突解决、提交代码前未拉取新代码导致冲突问题的处理等,我在协助处理这些问题的时候也记录各种问题的解决办法,希望整理后通过教程帮助到更多对Git操作进阶的开发者。 本期教程学习方法分为“掌握基础——稳步进阶——熟悉协作”三个层次。从掌握基础的 Git的推送和拉取开始,以案例进行演示,分析每一个步骤的操作方式和原理,从理解Git 工具的操作到学会代码存储结构、演示不同场景下Git遇到问题的不同处理方案。循序渐进让同学们掌握Git工具在团队协作中的整体协作流程。 在教程中会通过大量案例进行分析,案例会模拟在工作中遇到的问题,从最基础的代码提交和拉取、代码冲突解决、代码仓库的数据维护、Git服务端搭建等。为了让同学们容易理解,对Git简单易懂,文章中详细记录了详细的操作步骤,提供大量演示截图和解析。在教程的最后部分,会从提升团队整体效率的角度对Git工具进行讲解,包括规范操作、Gitlab的搭建、钩子事件的应用等。 为了让同学们可以利用碎片化时间来灵活学习,在教程文章中大程度降低了上下文的依赖,让大家可以在工作之余进行学习与实战,并同时掌握里面涉及的Git不常见操作的相关知识,理解Git工具在工作遇到的问题解决思路和方法,相信一定会对大家的前端技能进阶大有帮助。

实用主义学Python(小白也容易上手的Python实用案例)

原价169,限时立减100元! 系统掌握Python核心语法16点,轻松应对工作中80%以上的Python使用场景! 69元=72讲+源码+社群答疑+讲师社群分享会&nbsp; 【哪些人适合学习这门课程?】 1)大学生,平时只学习了Python理论,并未接触Python实战问题; 2)对Python实用技能掌握薄弱的人,自动化、爬虫、数据分析能让你快速提高工作效率; 3)想学习新技术,如:人工智能、机器学习、深度学习等,这门课程是你的必修课程; 4)想修炼更好的编程内功,优秀的工程师肯定不能只会一门语言,Python语言功能强大、使用高效、简单易学。 【超实用技能】 从零开始 自动生成工作周报 职场升级 豆瓣电影数据爬取 实用案例 奥运冠军数据分析 自动化办公:通过Python自动化分析Excel数据并自动操作Word文档,最终获得一份基于Excel表格的数据分析报告。 豆瓣电影爬虫:通过Python自动爬取豆瓣电影信息并将电影图片保存到本地。 奥运会数据分析实战 简介:通过Python分析120年间奥运会的数据,从不同角度入手分析,从而得出一些有趣的结论。 【超人气老师】 二两 中国人工智能协会高级会员 生成对抗神经网络研究者 《深入浅出生成对抗网络:原理剖析与TensorFlow实现》一书作者 阿里云大学云学院导师 前大型游戏公司后端工程师 【超丰富实用案例】 0)图片背景去除案例 1)自动生成工作周报案例 2)豆瓣电影数据爬取案例 3)奥运会数据分析案例 4)自动处理邮件案例 5)github信息爬取/更新提醒案例 6)B站百大UP信息爬取与分析案例 7)构建自己的论文网站案例

深度学习原理+项目实战+算法详解+主流框架(套餐)

深度学习系列课程从深度学习基础知识点开始讲解一步步进入神经网络的世界再到卷积和递归神经网络,详解各大经典网络架构。实战部分选择当下最火爆深度学习框架PyTorch与Tensorflow/Keras,全程实战演示框架核心使用与建模方法。项目实战部分选择计算机视觉与自然语言处理领域经典项目,从零开始详解算法原理,debug模式逐行代码解读。适合准备就业和转行的同学们加入学习! 建议按照下列课程顺序来进行学习 (1)掌握深度学习必备经典网络架构 (2)深度框架实战方法 (3)计算机视觉与自然语言处理项目实战。(按照课程排列顺序即可)

C/C++跨平台研发从基础到高阶实战系列套餐

一 专题从基础的C语言核心到c++ 和stl完成基础强化; 二 再到数据结构,设计模式完成专业计算机技能强化; 三 通过跨平台网络编程,linux编程,qt界面编程,mfc编程,windows编程,c++与lua联合编程来完成应用强化 四 最后通过基于ffmpeg的音视频播放器,直播推流,屏幕录像,

三个项目玩转深度学习(附1G源码)

从事大数据与人工智能开发与实践约十年,钱老师亲自见证了大数据行业的发展与人工智能的从冷到热。事实证明,计算机技术的发展,算力突破,海量数据,机器人技术等,开启了第四次工业革命的序章。深度学习图像分类一直是人工智能的经典任务,是智慧零售、安防、无人驾驶等机器视觉应用领域的核心技术之一,掌握图像分类技术是机器视觉学习的重中之重。针对现有线上学习的特点与实际需求,我们开发了人工智能案例实战系列课程。打造:以项目案例实践为驱动的课程学习方式,覆盖了智能零售,智慧交通等常见领域,通过基础学习、项目案例实践、社群答疑,三维立体的方式,打造最好的学习效果。

Java基础知识面试题(2020最新版)

文章目录Java概述何为编程什么是Javajdk1.5之后的三大版本JVM、JRE和JDK的关系什么是跨平台性?原理是什么Java语言有哪些特点什么是字节码?采用字节码的最大好处是什么什么是Java程序的主类?应用程序和小程序的主类有何不同?Java应用程序与小程序之间有那些差别?Java和C++的区别Oracle JDK 和 OpenJDK 的对比基础语法数据类型Java有哪些数据类型switc...

Python界面版学生管理系统

前不久上传了一个控制台版本的学生管理系统,这个是Python界面版学生管理系统,这个是使用pycharm开发的一个有界面的学生管理系统,基本的增删改查,里面又演示视频和完整代码,有需要的伙伴可以自行下

Vue.js 2.0之全家桶系列视频课程

基于新的Vue.js 2.3版本, 目前新全的Vue.js教学视频,让你少走弯路,直达技术前沿! 1. 包含Vue.js全家桶(vue.js、vue-router、axios、vuex、vue-cli、webpack、ElementUI等) 2. 采用笔记+代码案例的形式讲解,通俗易懂

linux“开发工具三剑客”速成攻略

工欲善其事,必先利其器。Vim+Git+Makefile是Linux环境下嵌入式开发常用的工具。本专题主要面向初次接触Linux的新手,熟练掌握工作中常用的工具,在以后的学习和工作中提高效率。

JAVA初级工程师面试36问(完结)

第三十一问: 说一下线程中sleep()和wait()区别? 1 . sleep()是让正在执行的线程主动让出CPU,当时间到了,在回到自己的线程让程序运行。但是它并没有释放同步资源锁只是让出。 2.wait()是让当前线程暂时退让出同步资源锁,让其他线程来获取到这个同步资源在调用notify()方法,才会让其解除wait状态,再次参与抢资源。 3. sleep()方法可以在任何地方使用,而wait()只能在同步方法或同步块使用。 ...

java jdk 8 帮助文档 中文 文档 chm 谷歌翻译

JDK1.8 API 中文谷歌翻译版 java帮助文档 JDK API java 帮助文档 谷歌翻译 JDK1.8 API 中文 谷歌翻译版 java帮助文档 Java最新帮助文档 本帮助文档是使用谷

我以为我对Mysql事务很熟,直到我遇到了阿里面试官

太惨了,面试又被吊打

智鼎(附答案).zip

并不是完整题库,但是有智鼎在线2019年9、10、11三个月的试题,有十七套以上题目,普通的网申行测题足以对付,可以在做题时自己总结一些规律,都不是很难

Visual Assist X 破解补丁

vs a's'sixt插件 支持vs2008-vs2019 亲测可以破解,希望可以帮助到大家

150讲轻松搞定Python网络爬虫

【为什么学爬虫?】 &nbsp; &nbsp; &nbsp; &nbsp;1、爬虫入手容易,但是深入较难,如何写出高效率的爬虫,如何写出灵活性高可扩展的爬虫都是一项技术活。另外在爬虫过程中,经常容易遇到被反爬虫,比如字体反爬、IP识别、验证码等,如何层层攻克难点拿到想要的数据,这门课程,你都能学到! &nbsp; &nbsp; &nbsp; &nbsp;2、如果是作为一个其他行业的开发者,比如app开发,web开发,学习爬虫能让你加强对技术的认知,能够开发出更加安全的软件和网站 【课程设计】 一个完整的爬虫程序,无论大小,总体来说可以分成三个步骤,分别是: 网络请求:模拟浏览器的行为从网上抓取数据。 数据解析:将请求下来的数据进行过滤,提取我们想要的数据。 数据存储:将提取到的数据存储到硬盘或者内存中。比如用mysql数据库或者redis等。 那么本课程也是按照这几个步骤循序渐进的进行讲解,带领学生完整的掌握每个步骤的技术。另外,因为爬虫的多样性,在爬取的过程中可能会发生被反爬、效率低下等。因此我们又增加了两个章节用来提高爬虫程序的灵活性,分别是: 爬虫进阶:包括IP代理,多线程爬虫,图形验证码识别、JS加密解密、动态网页爬虫、字体反爬识别等。 Scrapy和分布式爬虫:Scrapy框架、Scrapy-redis组件、分布式爬虫等。 通过爬虫进阶的知识点我们能应付大量的反爬网站,而Scrapy框架作为一个专业的爬虫框架,使用他可以快速提高我们编写爬虫程序的效率和速度。另外如果一台机器不能满足你的需求,我们可以用分布式爬虫让多台机器帮助你快速爬取数据。 &nbsp; 从基础爬虫到商业化应用爬虫,本套课程满足您的所有需求! 【课程服务】 专属付费社群+每周三讨论会+1v1答疑

JavaWEB商城项目(包括数据库)

功能描述:包括用户的登录注册,以及个人资料的修改.商品的分类展示,详情,加入购物车,生成订单,到银行支付等!另外还有收货地址的和我的收藏等常用操作.环境(JDK 1.7 ,mysql 5.5,Ecli

Python数据挖掘简易入门

&nbsp; &nbsp; &nbsp; &nbsp; 本课程为Python数据挖掘方向的入门课程,课程主要以真实数据为基础,详细介绍数据挖掘入门的流程和使用Python实现pandas与numpy在数据挖掘方向的运用,并深入学习如何运用scikit-learn调用常用的数据挖掘算法解决数据挖掘问题,为进一步深入学习数据挖掘打下扎实的基础。

一学即懂的计算机视觉(第一季)

图像处理和计算机视觉的课程大家已经看过很多,但总有“听不透”,“用不了”的感觉。课程致力于创建人人都能听的懂的计算机视觉,通过生动、细腻的讲解配合实战演练,让学生真正学懂、用会。 【超实用课程内容】 课程内容分为三篇,包括视觉系统构成,图像处理基础,特征提取与描述,运动跟踪,位姿估计,三维重构等内容。课程理论与实战结合,注重教学内容的可视化和工程实践,为人工智能视觉研发及算法工程师等相关高薪职位就业打下坚实基础。 【课程如何观看?】 PC端:https://edu.csdn.net/course/detail/26281 移动端:CSDN 学院APP(注意不是CSDN APP哦) 本课程为录播课,课程2年有效观看时长,但是大家可以抓紧时间学习后一起讨论哦~ 【学员专享增值服务】 源码开放 课件、课程案例代码完全开放给你,你可以根据所学知识,自行修改、优化 下载方式:电脑登录https://edu.csdn.net/course/detail/26281,点击右下方课程资料、代码、课件等打包下载

软件测试2小时入门

本课程内容系统、全面、简洁、通俗易懂,通过2个多小时的介绍,让大家对软件测试有个系统的理解和认识,具备基本的软件测试理论基础。 主要内容分为5个部分: 1 软件测试概述,了解测试是什么、测试的对象、原则、流程、方法、模型;&nbsp; 2.常用的黑盒测试用例设计方法及示例演示;&nbsp; 3 常用白盒测试用例设计方法及示例演示;&nbsp; 4.自动化测试优缺点、使用范围及示例‘;&nbsp; 5.测试经验谈。

初级玩转Linux+Ubuntu(嵌入式开发基础课程)

课程主要面向嵌入式Linux初学者、工程师、学生 主要从一下几方面进行讲解: 1.linux学习路线、基本命令、高级命令 2.shell、vi及vim入门讲解 3.软件安装下载、NFS、Samba、FTP等服务器配置及使用

2019 Python开发者日-培训

本次活动将秉承“只讲技术,拒绝空谈”的理念,邀请十余位身处一线的Python技术专家,重点围绕Web开发、自动化运维、数据分析、人工智能等技术模块,分享真实生产环境中使用Python应对IT挑战的真知灼见。此外,针对不同层次的开发者,大会还安排了深度培训实操环节,为开发者们带来更多深度实战的机会。

快速入门Android开发 视频 教程 android studio

这是一门快速入门Android开发课程,顾名思义是让大家能快速入门Android开发。 学完能让你学会如下知识点: Android的发展历程 搭建Java开发环境 搭建Android开发环境 Android Studio基础使用方法 Android Studio创建项目 项目运行到模拟器 项目运行到真实手机 Android中常用控件 排查开发中的错误 Android中请求网络 常用Android开发命令 快速入门Gradle构建系统 项目实战:看美图 常用Android Studio使用技巧 项目签名打包 如何上架市场

机器学习初学者必会的案例精讲

通过六个实际的编码项目,带领同学入门人工智能。这些项目涉及机器学习(回归,分类,聚类),深度学习(神经网络),底层数学算法,Weka数据挖掘,利用Git开源项目实战等。

4小时玩转微信小程序——基础入门与微信支付实战

这是一个门针对零基础学员学习微信小程序开发的视频教学课程。课程采用腾讯官方文档作为教程的唯一技术资料来源。杜绝网络上质量良莠不齐的资料给学员学习带来的障碍。 视频课程按照开发工具的下载、安装、使用、程序结构、视图层、逻辑层、微信小程序等几个部分组织课程,详细讲解整个小程序的开发过程

相关热词 c#中如何设置提交按钮 c#帮助怎么用 c# 读取合并单元格的值 c#带阻程序 c# 替换span内容 c# rpc c#控制台点阵字输出 c#do while循环 c#调用dll多线程 c#找出两个集合不同的
立即提问