java序列不存在错误_java.sql.SQLException: ORA-02289: 序列不存在 已解决!

2011-5-18 19:50:59 org.apache.catalina.core.AprLifecycleListener init

信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: G:\Program Files\MyEclipse 6.5\bin;F:\apache-tomcat-6.0.30\bin

2011-5-18 19:51:08 org.apache.coyote.http11.Http11Protocol init

信息: Initializing Coyote HTTP/1.1 on http-8080

2011-5-18 19:51:08 org.apache.catalina.startup.Catalina load

信息: Initialization processed in 13849 ms

2011-5-18 19:51:08 org.apache.catalina.core.StandardService start

信息: Starting service Catalina

2011-5-18 19:51:08 org.apache.catalina.core.StandardEngine start

信息: Starting Servlet Engine: Apache Tomcat/6.0.30

2011-5-18 19:51:08 org.apache.catalina.startup.HostConfig deployDescriptor

信息: Deploying configuration descriptor host-manager.xml

2011-5-18 19:51:10 org.apache.catalina.startup.HostConfig deployDescriptor

信息: Deploying configuration descriptor manager.xml

2011-5-18 19:51:11 org.apache.catalina.startup.HostConfig deployDirectory

信息: Deploying web application directory docs

2011-5-18 19:51:11 org.apache.catalina.startup.HostConfig deployDirectory

信息: Deploying web application directory examples

2011-5-18 19:51:15 org.apache.catalina.core.ApplicationContext log

信息: ContextListener: contextInitialized()

2011-5-18 19:51:15 org.apache.catalina.core.ApplicationContext log

信息: SessionListener: contextInitialized()

2011-5-18 19:51:15 org.apache.catalina.startup.HostConfig deployDirectory

信息: Deploying web application directory riverPro

2011-5-18 19:51:29 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.

2011-5-18 19:51:41 org.apache.catalina.startup.HostConfig deployDirectory

信息: Deploying web application directory ROOT

2011-5-18 19:51:41 org.apache.catalina.startup.HostConfig deployDirectory

信息: Deploying web application directory wbProject

2011-5-18 19:51:54 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.

2011-5-18 19:52:05 org.apache.coyote.http11.Http11Protocol start

信息: Starting Coyote HTTP/1.1 on http-8080

2011-5-18 19:52:05 org.apache.jk.common.ChannelSocket init

信息: JK: ajp13 listening on /0.0.0.0:8099

2011-5-18 19:52:05 org.apache.jk.server.JkMain start

信息: Jk running ID=0 time=0/47  config=null

2011-5-18 19:52:05 org.apache.catalina.startup.Catalina start

信息: Server startup in 57280 ms

2011-5-18 19:54:06 org.apache.catalina.core.StandardWrapperValve invoke

严重: Servlet.service() for servlet action threw exception

java.sql.SQLException: ORA-02289: 序列不存在

at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)

at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)

at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)

at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)

at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:216)

at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:799)

at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1038)

at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:839)

at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1133)

at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3285)

at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3329)

at org.hibernate.id.SequenceGenerator.generate(SequenceGenerator.java:75)

at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:98)

at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:186)

at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33)

at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:175)

at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27)

at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)

at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:535)

at org.hibernate.impl.SessionImpl.save(SessionImpl.java:523)

at org.hibernate.impl.SessionImpl.save(SessionImpl.java:519)

at org.springframework.orm.hibernate3.HibernateTemplate$12.doInHibernate(HibernateTemplate.java:635)

at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:372)

at org.springframework.orm.hibernate3.HibernateTemplate.save(HibernateTemplate.java:632)

at com.sr.dao.impl.UsersDaoImpl.save(UsersDaoImpl.java:44)

at com.sr.biz.impl.UsersBizImpl.save(UsersBizImpl.java:45)

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.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)

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 $Proxy1.save(Unknown Source)

at com.sr.struts.action.UserAction.doAddUser(UserAction.java:70)

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.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:270)

at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:187)

at org.springframework.web.struts.DelegatingActionProxy.execute(DelegatingActionProxy.java:110)

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:637)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

at com.sr.filter.ChineseFilter.doFilter(ChineseFilter.java:28)

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:859)

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(Unknown Source)

项目是Oracle+ssh项目

报以上错误是Oracle中的自增列问题(Oracle中是序列+触发器来实现自增列和sql中有点区别)

可这样修改:

首先:在你的映射文件中 也就是这个文件  你的 类名.hbm.xml  修改为

其次:打开doc命令 输入sqlplus回车   输入Oracle登录名回车   输入Oracle密码回车

最后:复制这段代码:

CREATE SEQUENCE SV_ID_sequence          -- 注:sv_id 就是你表中要自增的列INCREMENT BY 1

START WITH 1       -- 注:从1开始每次加1NOMAXVALUE

NOCYCLE

NOCACHE

order;

create or replace trigger tri_insert_SERVER       --注:server是你表名before insert on SERVER           -- 注:Server表名for each row

begin

select SV_ID_sequence.nextval into :new.SV_ID from dual;         -- 注:sv_id 同上end;

/

commit;

右键单击粘贴到doc命令窗口序列和触发器就创建成功回车完成。然后重新部署项目测试一下。。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值