Details
-
Question
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
transaction-jdbc-1.0.0
-
None
Description
Hi all,
I'm using tx-control-local [version 1.0.0] combined with jdbc-local [version 1.0.0] into apche felix enviroment.
I have followed all instructions written into Apache Aries tutorial:
- Find and install a JDBC Service implementation for your chosen database --> I'm using SQL Server
- Create a factory configuration using the factory pid org.apache.aries.tx.control.jdbc.local --> My configuration looks like this:
osgi.jdbc.driver.class=com.microsoft.sqlserver.jdbc.SQLServerDriver
url=jdbc:sqlserver://localhost:1433;databaseName=2017_TEST;user=osgiuser;password=osgiuser;
dataSourceName=test
So, in my apache felix enviroment I can see that JDBC Local bundle create a new service under JDBCConnectionProvider interface with all properties shown up. Also Local Transaction control register its own service correctly.
But here comes problems, when I install my test bundle that perform a simple read query seems that, when it receives JDBCConnectionProvider and try to get SQL Connection through these instructions, it return a null connection:
@Reference() void setProvider(JDBCConnectionProvider provider) { conn = provider.getResource(control); }
So when it tries to create SQLStatement it gave me this error:
java.lang.NullPointerException
I don't know if I have missed some steps, but I can't solve this problem. I report below all checks I have done:
- JDBC URL is correct, I was able to connect with a simple Java Program that perform JDBC Connection
- User ha all privileges to access to database
Can someone help me?
Thanks.