You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use

ssh框架。

 

javax.servlet.ServletException: JDBC exception on Hibernate data access; nested exception is org.hibernate.exception.SQLGrammarException: could not insert: [com.formbean.SendmtMessage]
	org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:523)
	org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
	org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
	org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
	org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	sun.reflect.GeneratedMethodAccessor49.invoke(Unknown Source)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	java.lang.reflect.Method.invoke(Method.java:592)
	org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:244)
	java.security.AccessController.doPrivileged(Native Method)
	javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
	org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:276)
	org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162)
	java.security.AccessController.doPrivileged(Native Method)
	com.tool.EncodingFilter.doFilter(EncodingFilter.java:33)
	sun.reflect.GeneratedMethodAccessor96.invoke(Unknown Source)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	java.lang.reflect.Method.invoke(Method.java:592)
	org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:244)
	java.security.AccessController.doPrivileged(Native Method)
	javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
	org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:276)
	org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:218)
org.springframework.orm.hibernate3.HibernateJdbcException: JDBC exception on Hibernate data access; nested exception is org.hibernate.exception.SQLGrammarException: could not insert: [com.formbean.SendmtMessage]
	org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:634)
	org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:408)
	org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:367)
	org.springframework.orm.hibernate3.HibernateTemplate.merge(HibernateTemplate.java:752)
	com.formbean.SendmtMessageDAO.save(SendmtMessageDAO.java:55)
	com.action.SendMtMessage.sendmtmessageadd(SendMtMessage.java:2051)
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	java.lang.reflect.Method.invoke(Method.java:592)
	org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:274)
	org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:194)
	org.springframework.web.struts.DelegatingActionProxy.execute(DelegatingActionProxy.java:106)
	org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
	org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
	org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
	org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	sun.reflect.GeneratedMethodAccessor49.invoke(Unknown Source)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	java.lang.reflect.Method.invoke(Method.java:592)
	org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:244)
	java.security.AccessController.doPrivileged(Native Method)
	javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
	org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:276)
	org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162)
	java.security.AccessController.doPrivileged(Native Method)
	com.tool.EncodingFilter.doFilter(EncodingFilter.java:33)
	sun.reflect.GeneratedMethodAccessor96.invoke(Unknown Source)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	java.lang.reflect.Method.invoke(Method.java:592)
	org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:244)
	java.security.AccessController.doPrivileged(Native Method)
	javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
	org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:276)
	org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:218)

 

root cause

org.hibernate.exception.SQLGrammarException: could not insert: [com.formbean.SendmtMessage]
	org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
	org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
	org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:1986)
	org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2405)
	org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:37)
	org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
	org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:269)
	org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:167)
	org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:101)
	org.hibernate.event.def.DefaultMergeEventListener.entityIsTransient(DefaultMergeEventListener.java:166)
	org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:103)
	org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:52)
	org.hibernate.impl.SessionImpl.fireMerge(SessionImpl.java:672)
	org.hibernate.impl.SessionImpl.merge(SessionImpl.java:656)
	org.hibernate.impl.SessionImpl.merge(SessionImpl.java:660)
	org.springframework.orm.hibernate3.HibernateTemplate$23.doInHibernate(HibernateTemplate.java:755)
	org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:362)
	org.springframework.orm.hibernate3.HibernateTemplate.merge(HibernateTemplate.java:752)
	com.formbean.SendmtMessageDAO.save(SendmtMessageDAO.java:55)
	com.action.SendMtMessage.sendmtmessageadd(SendMtMessage.java:2051)
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	java.lang.reflect.Method.invoke(Method.java:592)
	org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:274)
	org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:194)
	org.springframework.web.struts.DelegatingActionProxy.execute(DelegatingActionProxy.java:106)
	org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
	org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
	org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
	org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	sun.reflect.GeneratedMethodAccessor49.invoke(Unknown Source)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	java.lang.reflect.Method.invoke(Method.java:592)
	org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:244)
	java.security.AccessController.doPrivileged(Native Method)
	javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
	org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:276)
	org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162)
	java.security.AccessController.doPrivileged(Native Method)
	com.tool.EncodingFilter.doFilter(EncodingFilter.java:33)
	sun.reflect.GeneratedMethodAccessor96.invoke(Unknown Source)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	java.lang.reflect.Method.invoke(Method.java:592)
	org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:244)
	java.security.AccessController.doPrivileged(Native Method)
	javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
	org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:276)
	org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:218)

 

root cause

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 'select scope_identity()' at line 1
	com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1027)
	com.mysql.jdbc.SQLError.createSQLException(SQLError.java:957)
	com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3376)
	com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3308)
	com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1837)
	com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1961)
	com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2543)
	com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1737)
	com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:998)
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	java.lang.reflect.Method.invoke(Method.java:592)
	org.logicalcobwebs.proxool.ProxyStatement.invoke(ProxyStatement.java:68)
	org.logicalcobwebs.cglib.proxy.Proxy$ProxyImpl$$EnhancerByCGLIB$$a3b42221.execute(<generated>)
	org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:1953)
	org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2405)
	org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:37)
	org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
	org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:269)
	org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:167)
	org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:101)
	org.hibernate.event.def.DefaultMergeEventListener.entityIsTransient(DefaultMergeEventListener.java:166)
	org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:103)
	org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:52)
	org.hibernate.impl.SessionImpl.fireMerge(SessionImpl.java:672)
	org.hibernate.impl.SessionImpl.merge(SessionImpl.java:656)
	org.hibernate.impl.SessionImpl.merge(SessionImpl.java:660)
	org.springframework.orm.hibernate3.HibernateTemplate$23.doInHibernate(HibernateTemplate.java:755)
	org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:362)
	org.springframework.orm.hibernate3.HibernateTemplate.merge(HibernateTemplate.java:752)
	com.formbean.SendmtMessageDAO.save(SendmtMessageDAO.java:55)
	com.action.SendMtMessage.sendmtmessageadd(SendMtMessage.java:2051)
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	java.lang.reflect.Method.invoke(Method.java:592)
	org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:274)
	org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:194)
	org.springframework.web.struts.DelegatingActionProxy.execute(DelegatingActionProxy.java:106)
	org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
	org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
	org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
	org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	sun.reflect.GeneratedMethodAccessor49.invoke(Unknown Source)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	java.lang.reflect.Method.invoke(Method.java:592)
	org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:244)
	java.security.AccessController.doPrivileged(Native Method)
	javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
	org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:276)
	org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162)
	java.security.AccessController.doPrivileged(Native Method)
	com.tool.EncodingFilter.doFilter(EncodingFilter.java:33)
	sun.reflect.GeneratedMethodAccessor96.invoke(Unknown Source)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	java.lang.reflect.Method.invoke(Method.java:592)
	org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:244)
	java.security.AccessController.doPrivileged(Native Method)
	javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
	org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:276)
	org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:218)
感觉是版本的问题,本机没问题,服务器上报异常,原因正在查找中。
没能解决,去掉了Action注入就好了。

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值