shardingsphere icon indicating copy to clipboard operation
shardingsphere copied to clipboard

how can i use encryptor and sharding in the same time

Open EvanDylan opened this issue 7 years ago • 1 comments

Question

For English only, other languages will not accept.

Before asking a question, make sure you have:

Please pay attention on issues you submitted, because we maybe need more details. If no response more than 7 days and we cannot reproduce it on current information, we will close it.

i try use encryptor and sharding in the same time,it's look like conflict each other. the execption message blow

Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.sql.DataSource]: Factory method 'dataSource' threw exception; nested exception is java.sql.SQLFeatureNotSupportedException: getCatalog
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:622)
	... 70 common frames omitted
Caused by: java.sql.SQLFeatureNotSupportedException: getCatalog
	at org.apache.shardingsphere.shardingjdbc.jdbc.unsupported.AbstractUnsupportedOperationConnection.getCatalog(AbstractUnsupportedOperationConnection.java:91)
	at org.apache.shardingsphere.shardingjdbc.jdbc.core.datasource.EncryptDataSource.isTableExist(EncryptDataSource.java:88)
	at org.apache.shardingsphere.shardingjdbc.jdbc.core.datasource.EncryptDataSource.createEncryptTableMetaData(EncryptDataSource.java:79)
	at org.apache.shardingsphere.shardingjdbc.jdbc.core.datasource.EncryptDataSource.<init>(EncryptDataSource.java:71)
	at org.apache.shardingsphere.shardingjdbc.api.EncryptDataSourceFactory.createDataSource(EncryptDataSourceFactory.java:43)
	at org.apache.shardingsphere.samples.config.ShardingConfig.dataSource(ShardingConfig.java:70)
	at org.apache.shardingsphere.samples.config.ShardingConfig$$EnhancerBySpringCGLIB$$8816e7e7.CGLIB$dataSource$0(<generated>)
	at org.apache.shardingsphere.samples.config.ShardingConfig$$EnhancerBySpringCGLIB$$8816e7e7$$FastClassBySpringCGLIB$$839386bc.invoke(<generated>)
	at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244)
	at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:363)
	at org.apache.shardingsphere.samples.config.ShardingConfig$$EnhancerBySpringCGLIB$$8816e7e7.dataSource(<generated>)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
	... 71 common frames omitted

EvanDylan avatar Apr 29 '19 02:04 EvanDylan

Caused by: java.sql.SQLFeatureNotSupportedException: getCatalog

Error message display that you use supported operation getCatalog. It is not relationship with encrypt or sharding

terrymanu avatar Apr 29 '19 03:04 terrymanu