xautlx / s2jh

A Java/J2EE development framework for enterprise system based on Struts/Spring/JPA/Hibernate and jquery/bootstrap
GNU Lesser General Public License v3.0
321 stars 242 forks source link

oracle环境下 服务器启动会 定时任务出错 java.sql.SQLException: 无法识别区域设置 #65

Open xiaolongyuan opened 10 years ago

xiaolongyuan commented 10 years ago

信息: Deploying web application directory D:\developtools\springsource\vfabric-tc-server-developer-2.9.5.SR1\base-instance\webapps\manager Jun 16, 2014 3:49:46 PM org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory D:\developtools\springsource\vfabric-tc-server-developer-2.9.5.SR1\base-instance\webapps\ROOT Jun 16, 2014 3:49:46 PM org.apache.coyote.AbstractProtocol start 信息: Starting ProtocolHandler ["http-bio-8080"] Jun 16, 2014 3:49:46 PM org.apache.catalina.startup.Catalina start 信息: Server startup in 14941 ms 15:49:55.655 INFO l.s.schedule.ExtSchedulerFactoryBean[666] - Starting Quartz Scheduler now, after delay of 10 seconds
15:49:55.656 DEBUG jdbc.sqlonly[232] - org.quartz.impl.jdbcjobstore.StdRowLockSemaphore.executeSQL(StdRowLockSemaphore.java:96)

  1. SELECT * FROM QRTZ_LOCKS WHERE SCHED_NAME = 'quartzClusterScheduler' AND LOCK_NAME = 'STATE_ACCESS' FOR UPDATE
    15:49:55.658 DEBUG jdbc.sqlonly[232] - org.quartz.impl.jdbcjobstore.StdRowLockSemaphore.executeSQL(StdRowLockSemaphore.java:108)
  2. INSERT INTO QRTZ_LOCKS(SCHED_NAME, LOCK_NAME) VALUES ('quartzClusterScheduler', 'STATE_ACCESS')

15:49:55.662 DEBUG jdbc.sqlonly[232] - org.quartz.impl.jdbcjobstore.StdJDBCDelegate.selectFiredTriggerInstanceNames(StdJDBCDelegate.java:2883)

  1. SELECT DISTINCT INSTANCE_NAME FROM QRTZ_FIRED_TRIGGERS WHERE SCHED_NAME = 'quartzClusterScheduler'

15:49:55.783 ERROR c.alibaba.druid.pool.DruidDataSource[1656] - create connection error
java.sql.SQLException: 无法识别区域设置 at oracle.jdbc.driver.T4CTTIoauthenticate.setSessionFields(T4CTTIoauthenticate.java:1059) ~[ojdbc6-11.2.0.3.jar:11.2.0.3.0] at oracle.jdbc.driver.T4CTTIoauthenticate.(T4CTTIoauthenticate.java:232) ~[ojdbc6-11.2.0.3.jar:11.2.0.3.0] at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:415) ~[ojdbc6-11.2.0.3.jar:11.2.0.3.0] at oracle.jdbc.driver.PhysicalConnection.(PhysicalConnection.java:557) ~[ojdbc6-11.2.0.3.jar:11.2.0.3.0] at oracle.jdbc.driver.T4CConnection.(T4CConnection.java:233) ~[ojdbc6-11.2.0.3.jar:11.2.0.3.0] at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:29) ~[ojdbc6-11.2.0.3.jar:11.2.0.3.0] at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:556) ~[ojdbc6-11.2.0.3.jar:11.2.0.3.0] at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:148) ~[druid-1.0.6.jar:1.0.6] at com.alibaba.druid.filter.stat.StatFilter.connection_connect(StatFilter.java:211) ~[druid-1.0.6.jar:1.0.6] at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:142) ~[druid-1.0.6.jar:1.0.6] at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1360) ~[druid-1.0.6.jar:1.0.6] at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1414) ~[druid-1.0.6.jar:1.0.6] at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1654) ~[druid-1.0.6.jar:1.0.6] 15:50:15.655 INFO l.s.schedule.ExtSchedulerFactoryBean[666] - Starting Quartz Scheduler now, after delay of 30 seconds

java.sql.SQLException: Locale not recognized

xiaolongyuan commented 10 years ago
  1. Statement.execute(insert INTO tbl_sys_pub_post (created_by, version, expire_time, html_content, html_title, publish_time, read_user_count, id) values ('admin', 0, NULL, 'https://github.com/xautlx/s2jh/', '欢迎使用S2JH企业Web应用开发框架', '2013-08-01 00:00:00', NULL, '402880c5405d76f701405e11ae9b0002')) insert INTO tbl_sys_pub_post (created_by, version, expire_time, html_content, html_title, publish_time, read_user_count, id) values ('admin', 0, NULL, 'https://github.com/xautlx/s2jh/', '欢迎使用S2JH企业Web应用开发框架', '2013-08-01 00:00:00', NULL, '402880c5405d76f701405e11ae9b0002')
    java.sql.SQLDataException: ORA-01843: 无效的月份

orecle 需要用日期函数转换 TO_TIMESTAMP('2014-06-16 07:59:53.508000000', 'YYYY-MM-DD HH24:MI:SS.FF')

xiaolongyuan commented 10 years ago

数据库表对应的 注解也未生成 image

xiaolongyuan commented 10 years ago

image 登录框偏了

xautlx commented 10 years ago

hibernate的hbm2ddl好像无法生成数据库注释

xiaolongyuan commented 10 years ago

不支持的啊?

xautlx commented 10 years ago

登录界面已经调整为左侧了。右侧一般企业习惯放置系统形象宣传图片

xiaolongyuan commented 10 years ago

java.sql.SQLException: 无法识别区域设置 java.sql.SQLException: Locale not recognized 这个是怎么回事呢?

xautlx commented 10 years ago

至于时区问题请先自行找找解决方案,我暂时没有安装oracle环境

xiaolongyuan commented 10 years ago

谢谢!

xiaolongyuan commented 10 years ago

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor#0': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in file [D:\developtools\springsource\vfabric-tc-server-developer-2.9.5.SR1\base-instance\wtpwebapps\prototype\WEB-INF\classes\context\spring-context.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [context/context-profiles.xml]: Cannot resolve reference to bean 'dataSourceSpied' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSourceSpied' defined in class path resource [context/context-profiles.xml]: Invocation of init method failed; nested exception is java.sql.SQLException: Locale not recognized

Error creating bean with name 'dataSourceSpied' defined in class path resource [context/context-profiles.xml]: Invocation of init method failed; nested exception is java.sql.SQLException: Locale not recognized

xiaolongyuan commented 10 years ago

我想 这个会不会是应为 这个 image 产生的呢?Asia/Shanghai 每当执行定时任务时 就会抛出 上述BUG

xautlx commented 10 years ago

我把ApplicationContextPostListener中默认时区设置去掉了,可以再试试看看是否还有此异常,具体可以查看文件修改记录。