You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/08/18 02:35:14 UTC

[GitHub] [shardingsphere] oh-debug opened a new issue #6904: About configuring Oracle single data source

oh-debug opened a new issue #6904:
URL: https://github.com/apache/shardingsphere/issues/6904


   Version 4.1.0 used by shardingsphere, configure Oracle single data source error: invalid character. The same configuration can run normally using mysql
   ![TIM截图20200818102812](https://user-images.githubusercontent.com/53429744/90463442-8a6ee700-e13d-11ea-914a-a9e7c245f490.png)
   ------------The above is the configuration of mysql。
   ![TIM截图20200818103120](https://user-images.githubusercontent.com/53429744/90463630-01a47b00-e13e-11ea-9201-f37585e9d146.png)
   ------------The above is the Oracle configuration。
   
   -----------------------Here is the error message--------------------------
   
   Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
   2020-08-18 10:31:00.619 ERROR 5276 --- [           main] o.s.boot.SpringApplication               : Application run failed
   
   org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'shardingDataSource' defined in class path resource [org/apache/shardingsphere/shardingjdbc/spring/boot/SpringBootConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.sql.DataSource]: Factory method 'shardingDataSource' threw exception; nested exception is java.sql.SQLSyntaxErrorException: ORA-00911: 无效字符
   
   	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:625) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
   	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:455) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
   	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1288) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
   	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1127) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
   	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:538) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
   	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:498) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
   	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
   	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
   	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
   	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
   	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:846) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
   	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:863) ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE]
   	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546) ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE]
   	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140) ~[spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE]
   	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775) [spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE]
   	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE]
   	at org.springframework.boot.SpringApplication.run(SpringApplication.java:316) [spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE]
   	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260) [spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE]
   	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248) [spring-boot-2.1.0.RELEASE.jar:2.1.0.RELEASE]
   	at com.qsy.Application.main(Application.java:10) [classes/:na]
   Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.sql.DataSource]: Factory method 'shardingDataSource' threw exception; nested exception is java.sql.SQLSyntaxErrorException: ORA-00911: 无效字符
   
   	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
   	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:620) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
   	... 19 common frames omitted
   Caused by: java.sql.SQLSyntaxErrorException: ORA-00911: 无效字符
   
   	at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:440) ~[oracledriver-11.2.0.2.jar:11.2.0.2.0]
   	at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396) ~[oracledriver-11.2.0.2.jar:11.2.0.2.0]
   	at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:837) ~[oracledriver-11.2.0.2.jar:11.2.0.2.0]
   	at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:445) ~[oracledriver-11.2.0.2.jar:11.2.0.2.0]
   	at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:191) ~[oracledriver-11.2.0.2.jar:11.2.0.2.0]
   	at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:523) ~[oracledriver-11.2.0.2.jar:11.2.0.2.0]
   	at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:193) ~[oracledriver-11.2.0.2.jar:11.2.0.2.0]
   	at oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:852) ~[oracledriver-11.2.0.2.jar:11.2.0.2.0]
   	at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1153) ~[oracledriver-11.2.0.2.jar:11.2.0.2.0]
   	at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1275) ~[oracledriver-11.2.0.2.jar:11.2.0.2.0]
   	at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1477) ~[oracledriver-11.2.0.2.jar:11.2.0.2.0]
   	at oracle.jdbc.driver.OracleStatementWrapper.executeQuery(OracleStatementWrapper.java:392) ~[oracledriver-11.2.0.2.jar:11.2.0.2.0]
   	at com.alibaba.druid.pool.DruidPooledStatement.executeQuery(DruidPooledStatement.java:230) ~[druid-1.1.8.jar:1.1.8]
   	at org.apache.shardingsphere.sql.parser.binder.metadata.column.ColumnMetaDataLoader.load(ColumnMetaDataLoader.java:75) ~[shardingsphere-sql-parser-binder-4.1.0.jar:4.1.0]
   	at org.apache.shardingsphere.sql.parser.binder.metadata.schema.SchemaMetaDataLoader.load(SchemaMetaDataLoader.java:84) ~[shardingsphere-sql-parser-binder-4.1.0.jar:4.1.0]
   	at org.apache.shardingsphere.sql.parser.binder.metadata.schema.SchemaMetaDataLoader.load(SchemaMetaDataLoader.java:76) ~[shardingsphere-sql-parser-binder-4.1.0.jar:4.1.0]
   	at org.apache.shardingsphere.core.metadata.ShardingMetaDataLoader.loadDefaultSchemaMetaData(ShardingMetaDataLoader.java:142) ~[sharding-core-common-4.1.0.jar:4.1.0]
   	at org.apache.shardingsphere.core.metadata.ShardingMetaDataLoader.load(ShardingMetaDataLoader.java:126) ~[sharding-core-common-4.1.0.jar:4.1.0]
   	at org.apache.shardingsphere.shardingjdbc.jdbc.core.context.ShardingRuntimeContext.loadSchemaMetaData(ShardingRuntimeContext.java:65) ~[sharding-jdbc-core-4.1.0.jar:4.1.0]
   	at org.apache.shardingsphere.shardingjdbc.jdbc.core.context.MultipleDataSourcesRuntimeContext.createMetaData(MultipleDataSourcesRuntimeContext.java:57) ~[sharding-jdbc-core-4.1.0.jar:4.1.0]
   	at org.apache.shardingsphere.shardingjdbc.jdbc.core.context.MultipleDataSourcesRuntimeContext.<init>(MultipleDataSourcesRuntimeContext.java:51) ~[sharding-jdbc-core-4.1.0.jar:4.1.0]
   	at org.apache.shardingsphere.shardingjdbc.jdbc.core.context.ShardingRuntimeContext.<init>(ShardingRuntimeContext.java:49) ~[sharding-jdbc-core-4.1.0.jar:4.1.0]
   	at org.apache.shardingsphere.shardingjdbc.jdbc.core.datasource.ShardingDataSource.<init>(ShardingDataSource.java:54) ~[sharding-jdbc-core-4.1.0.jar:4.1.0]
   	at org.apache.shardingsphere.shardingjdbc.api.ShardingDataSourceFactory.createDataSource(ShardingDataSourceFactory.java:48) ~[sharding-jdbc-core-4.1.0.jar:4.1.0]
   	at org.apache.shardingsphere.shardingjdbc.spring.boot.SpringBootConfiguration.shardingDataSource(SpringBootConfiguration.java:103) ~[sharding-jdbc-spring-boot-starter-4.1.0.jar:4.1.0]
   	at org.apache.shardingsphere.shardingjdbc.spring.boot.SpringBootConfiguration$$EnhancerBySpringCGLIB$$6402f2e9.CGLIB$shardingDataSource$1(<generated>) ~[sharding-jdbc-spring-boot-starter-4.1.0.jar:4.1.0]
   	at org.apache.shardingsphere.shardingjdbc.spring.boot.SpringBootConfiguration$$EnhancerBySpringCGLIB$$6402f2e9$$FastClassBySpringCGLIB$$9c5c9c85.invoke(<generated>) ~[sharding-jdbc-spring-boot-starter-4.1.0.jar:4.1.0]
   	at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244) ~[spring-core-5.1.2.RELEASE.jar:5.1.2.RELEASE]
   	at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:363) ~[spring-context-5.1.2.RELEASE.jar:5.1.2.RELEASE]
   	at org.apache.shardingsphere.shardingjdbc.spring.boot.SpringBootConfiguration$$EnhancerBySpringCGLIB$$6402f2e9.shardingDataSource(<generated>) ~[sharding-jdbc-spring-boot-starter-4.1.0.jar:4.1.0]
   	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_201]
   	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_201]
   	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_201]
   	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_201]
   	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.1.2.RELEASE.jar:5.1.2.RELEASE]
   	... 20 common frames omitted
   
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] oh-debug commented on issue #6904: About configuring Oracle single data source

Posted by GitBox <gi...@apache.org>.
oh-debug commented on issue #6904:
URL: https://github.com/apache/shardingsphere/issues/6904#issuecomment-675230362


   Okay, let me take a closer look. Thank you


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] tristaZero commented on issue #6904: About configuring Oracle single data source

Posted by GitBox <gi...@apache.org>.
tristaZero commented on issue #6904:
URL: https://github.com/apache/shardingsphere/issues/6904#issuecomment-675228412


   Hi @oh-debug 
   Since your log did not show any detailed info for ShardingSphere, I can not locate this issue. Besides, my feeling is that there is something wrong with your configuration.
   So, I suggest you check your configuration carefully and provide more detailed info next.
   
   Thanks,
   Trista


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] kimmking commented on issue #6904: About configuring Oracle single data source

Posted by GitBox <gi...@apache.org>.
kimmking commented on issue #6904:
URL: https://github.com/apache/shardingsphere/issues/6904#issuecomment-679875016


   Hi, @oh-debug the logic sql and actual sql is important for tuning.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] terrymanu commented on issue #6904: About configuring Oracle single data source

Posted by GitBox <gi...@apache.org>.
terrymanu commented on issue #6904:
URL: https://github.com/apache/shardingsphere/issues/6904#issuecomment-680620328


   Closed because of no response anymore


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] tristaZero commented on issue #6904: About configuring Oracle single data source

Posted by GitBox <gi...@apache.org>.
tristaZero commented on issue #6904:
URL: https://github.com/apache/shardingsphere/issues/6904#issuecomment-680468832


   Hi @oh-debug
   
   I am sorry to say there is not any feedback from you above **7 days**. This is the last day for your comment.
   
   Best,
   Trista


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] oh-debug removed a comment on issue #6904: About configuring Oracle single data source

Posted by GitBox <gi...@apache.org>.
oh-debug removed a comment on issue #6904:
URL: https://github.com/apache/shardingsphere/issues/6904#issuecomment-675230265


   Okay, let me take a closer look. Thank you


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] terrymanu closed issue #6904: About configuring Oracle single data source

Posted by GitBox <gi...@apache.org>.
terrymanu closed issue #6904:
URL: https://github.com/apache/shardingsphere/issues/6904


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] oh-debug commented on issue #6904: About configuring Oracle single data source

Posted by GitBox <gi...@apache.org>.
oh-debug commented on issue #6904:
URL: https://github.com/apache/shardingsphere/issues/6904#issuecomment-675230265


   Okay, let me take a closer look. Thank you


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] tristaZero commented on issue #6904: About configuring Oracle single data source

Posted by GitBox <gi...@apache.org>.
tristaZero commented on issue #6904:
URL: https://github.com/apache/shardingsphere/issues/6904#issuecomment-675885379


   Hi @oh-debug 
   1. Could you provide a more detailed log? I can not get the helpful info from your previous log.
   2. When did the exception come out? At the start, or SQL execution?
   3. Is it possible for you to debug somehow?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] oh-debug commented on issue #6904: About configuring Oracle single data source

Posted by GitBox <gi...@apache.org>.
oh-debug commented on issue #6904:
URL: https://github.com/apache/shardingsphere/issues/6904#issuecomment-675295780


   I updated the configuration and it ran successfully with multiple data sources. The configuration is as follows:
   
   spring:
     shardingsphere:
       datasource:
         names: ds0,ds1
         ds0:
           type: com.alibaba.druid.pool.DruidDataSource
           driver-class-name: oracle.jdbc.driver.OracleDriver
           url: jdbc:oracle:thin:@//192.168.1.145:1521/orcl
           username: qsy_zc
           password: qsy2019
         ds1:
           type: com.alibaba.druid.pool.DruidDataSource
           driver-class-name: oracle.jdbc.driver.OracleDriver
           url: jdbc:oracle:thin:@//192.168.1.145:1521/orcl
           username: qsy
           password: qsy
       sharding:
         tables:
           t_bus_dynamic_data:
             actual-data-nodes: ds$->{0..1}.t_bus_dynamic_data_$->{0..1}
             database-strategy:
               standard:
                 sharding-column: site_code
                 precise-algorithm-class-name: com.qsy.pojo.MyCodeSharding
             table-strategy:
               standard:
                 sharding-column: id_
                 precise-algorithm-class-name: com.qsy.pojo.MySharding
   
   
   --------------------------------------------split line---------------------------------------------------------
   
   When the configuration is modified to a single data source, an error will be reported,The configuration is as follows:
   
   spring:
     shardingsphere:
       datasource:
         names: ds0
         ds0:
           type: com.alibaba.druid.pool.DruidDataSource
           driver-class-name: oracle.jdbc.driver.OracleDriver
           url: jdbc:oracle:thin:@//192.168.1.145:1521/orcl
           username: qsy_zc
           password: qsy2019
       sharding:
         tables:
           t_bus_dynamic_data:
             actual-data-nodes: ds0.t_bus_dynamic_data_$->{0..1}
             table-strategy:
               standard:
                 sharding-column: id_
                 precise-algorithm-class-name: com.qsy.pojo.MySharding
   
   
   With the same configuration, when the link is changed to mysql, there is no problem and it can run normally.The configuration is as follows:
   
   spring:
     shardingsphere:
       datasource:
         names: ds0
         ds0:
           type: com.alibaba.druid.pool.DruidDataSource
           driver-class-name: com.mysql.jdbc.Driver
           url: jdbc:mysql://192.168.1.129:3306/qsy_zc?serverTimezone=Asia/Shanghai&useSSL=false
           username: root
           password: root
       sharding:
         tables:
           t_bus_dynamic_data:
             actual-data-nodes: ds0.t_bus_dynamic_data_$->{0..1}
             table-strategy:
               standard:
                 sharding-column: id_
                 precise-algorithm-class-name: com.qsy.pojo.MySharding
   
   
   **Please help me to see if it is my configuration problem or other reasons. This problem has troubled me for a long time. Thank you**
   
   
   
   
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] oh-debug closed issue #6904: About configuring Oracle single data source

Posted by GitBox <gi...@apache.org>.
oh-debug closed issue #6904:
URL: https://github.com/apache/shardingsphere/issues/6904


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] oh-debug commented on issue #6904: About configuring Oracle single data source

Posted by GitBox <gi...@apache.org>.
oh-debug commented on issue #6904:
URL: https://github.com/apache/shardingsphere/issues/6904#issuecomment-675220737


   It is normal to configure Oracle multiple data sources, but the same problem will occur when multiple data sources are switched to single data sources.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org