Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npe occurs when sharding-raw-jdbc-example is in SHARDING_READWRITE_SPLITTING type #10583

Closed
totalo opened this issue May 31, 2021 · 2 comments
Closed

Comments

@totalo
Copy link
Member

totalo commented May 31, 2021

Bug Report

Which version of ShardingSphere did you use?

5.0.0-RC1-SNAPSHOT

Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?

ShardingSphere-JDBC

Expected behavior

Complete the example as normal

Actual behavior

npe

Exception in thread "main" java.lang.NullPointerException
	at org.apache.shardingsphere.driver.jdbc.adapter.executor.ForceExecuteTemplate.execute(ForceExecuteTemplate.java:42)
	at org.apache.shardingsphere.driver.jdbc.adapter.AbstractResultSetAdapter.close(AbstractResultSetAdapter.java:82)
	at org.apache.shardingsphere.example.core.jdbc.repository.OrderRepositoryImpl.getOrders(OrderRepositoryImpl.java:114)
	at org.apache.shardingsphere.example.core.jdbc.repository.OrderRepositoryImpl.selectAll(OrderRepositoryImpl.java:98)
	at org.apache.shardingsphere.example.core.jdbc.service.OrderServiceImpl.printData(OrderServiceImpl.java:148)
	at org.apache.shardingsphere.example.core.jdbc.service.OrderServiceImpl.processSuccess(OrderServiceImpl.java:95)
	at org.apache.shardingsphere.example.core.api.ExampleExecuteTemplate.run(ExampleExecuteTemplate.java:29)
	at org.apache.shardingsphere.example.sharding.raw.jdbc.JavaConfigurationExampleMain.main(JavaConfigurationExampleMain.java:42)

Reason analyze (If you can)

resultSet is null , When he shuts down, an exception occurs

Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.

Example codes for reproduce this issue (such as a github link).

@RaigorJiang
Copy link
Contributor

image

I tested this scenario and there was no exception.
If any table does not exist in databases, it may cause the problem described by @totalo

@totalo
Copy link
Member Author

totalo commented Jun 7, 2021

Sorry, this is my configuration problem

@totalo totalo closed this as completed Jun 7, 2021
@terrymanu terrymanu removed this from the 5.0.0-beta milestone Jun 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants