Spring Batch应用启动失败:entityManagerFactory创建异常求助
我基于Spring Batch官方教程修改的项目启动失败,报错信息如下:
Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
2024-04-06T15:13:19.755+03:30 ERROR 18348 --- [TestLoadData] [ main] o.s.boot.SpringApplication : Application run failedorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: null
application.yml配置内容
server: port: 8081 spring: profiles: active: dev application: name: TestLoadData jpa: hibernate: ddl-auto: none show-sql: true database-platform: org.hibernate.dialect.Oracle12cDialect datasource: driver-class-name: oracle.jdbc.driver.OracleDriver hikari: connection-timeout: 60000 maximum-pool-size: 10 task: scheduling: pool: size: 3 servlet: multipart: max-file-size: 50MB max-request-size: 50MB trx: minutes: 1 #profiles --- #development spring: config: activate: on-profile: dev datasource: url: jdbc:oracle:thin:@//192.168.253.98:1521/xe username: dev_user password: d3vl0pm3ntD13 hikari: maximum-pool-size: 10 jpa: defer-datasource-initialization: true properties: hibernate: format_sql: true show-sql: true batch: job: enabled: true jdbc: initialize-schema: always
错误根源
完整控制台日志显示,问题出在Oracle驱动ojdbc8-23.3.0.23.09.jar的oracle.net.ns.SessionAtts类初始化过程中,抛出了java.util.regex.PatternSyntaxException,原因是正则表达式[A-z0-9,_]{۸}里使用了全角阿拉伯数字8(۸),导致非法重复的正则语法错误。
内容的提问来源于stack exchange,提问作者M. Dabbaghian

