Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Cannot connect to access DB - NullPointerException

Hello,

I'm trying to move data from an Access database to a Microsoft SQL server database. I created my connection to the Access database. When I verify the connection, it tells me it works fine. But when I'm running my Job, I'm getting the following error:

Exception in component tAccessInput_1 (myDB)
java.lang.NullPointerException
	at java.util.Hashtable.put(Unknown Source)
	at cftmc.myJob_0_1.myDB.tAccessInput_1Process(myDB.java:1168)
	at cftmc.myJob_0_1.myDB.runJobInTOS(myDB.java:2050)
	at cftmc.myJob_0_1.myDB.main(myDB.java:1753)

Any help?

 

Thank you 0683p000009MACn.png

Labels (4)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi,

 

Unfortunately I have to use that Access 97 database and I can't convert it. I guess I'm gonna use a PHP script instead of Talend then.

 

Thanks anyway.

View solution in original post

25 Replies
Anonymous
Not applicable
Author

Hello,

Did you use tAccessConnection component in your work flow? Is there any connector(onsubjobOK or oncomponentOk) between tAccessConnection and your tAccessInput component?

Best regards

Sabrina

Anonymous
Not applicable
Author

A null pointer means that the compiler is trying to reference an object that hasn't been instantiated yet. The stack trace you posted tells you that the error is at line 1168 of your Java code: try opening the Code editor and see what objects are referred to in that area. Also, look for any errors earlier in the code that may cause an initialization failure (all errors will be marked with a red block on the right-hand side of the editor).

Good luck!

David
Anonymous
Not applicable
Author

Hi Sabrina,

First, thanks for your answer. I tried with a tAccessConnection and a onsubjobOK connector already (I mean I had tAccessConnection > OnsubjobOK > MyJob) but it didn't change anything.

Anonymous
Not applicable
Author

@DVSCHWAB

I looked at the code and I can't see what is going wrong. I don't have any red block, only a bunch of warnings.

 

Thanks anyway for your time

Anonymous
Not applicable
Author

Hi,

Would you mind posting your work flow screenshot on forum which will be helpful for us understand your job?

Best regards

Sabrina

Anonymous
Not applicable
Author

Hi,

I attached a picture of my job. As you can see it's a really simple one, there isn't any data transformation or anything.


2017-07-19_08-34-30.png
Anonymous
Not applicable
Author

Hi,

Can you extract your data from Access DB successfully by using tAccessInput-->tLogRow?

Best regards

Sabrina

Anonymous
Not applicable
Author

If you can connect successfully, the error is probably in the query itself. Can you run a "SELECT * FROM <TABLE> and see if it works? Your query is a bit long, and I've had issues with Talend parsing queries that take up multiple lines (even though it should matter). Also, just to rule it out, check that you have enclosed your query in double-quotes.

If none of this works, I might be able to look at the Java code near the error and figure out what is happening, if you can post that.

David
Anonymous
Not applicable
Author

@xdshi Using tAccessInput --> tLogRow doesn't work but I'm getting a new error:

Exception in component tAccessInput_1 (test)
net.ucanaccess.jdbc.UcanaccessSQLException: jet format 'VERSION_3' does not support writing for C:\Users\Admin\Documents\Théo\CFTMC\Data\dataself.mdb
	at net.ucanaccess.jdbc.UcanaccessDriver.connect(UcanaccessDriver.java:247)
	at java.sql.DriverManager.getConnection(Unknown Source)
	at java.sql.DriverManager.getConnection(Unknown Source)
	at cftmc2.test_0_1.test.tAccessInput_1Process(test.java:1109)
	at cftmc2.test_0_1.test.runJobInTOS(test.java:1919)
	at cftmc2.test_0_1.test.main(test.java:1685)
Caused by: java.io.IOException: jet format 'VERSION_3' does not support writing for C:\Users\Admin\Documents\Théo\CFTMC\Data\dataself.mdb
	at com.healthmarketscience.jackcess.impl.DatabaseImpl.open(DatabaseImpl.java:381)
	at com.healthmarketscience.jackcess.DatabaseBuilder.open(DatabaseBuilder.java:248)
	at org.talend.ucanaccess.encrypt.CryptCodecOpener.open(CryptCodecOpener.java:18)
	at net.ucanaccess.jdbc.DBReference.<init>(DBReference.java:158)
	at net.ucanaccess.jdbc.DBReferenceSingleton.loadReference(DBReferenceSingleton.java:57)
	at net.ucanaccess.jdbc.UcanaccessDriver.connect(UcanaccessDriver.java:103)
	... 5 more

@DVSCHWAB I tried your suggestion but unfortunately it's not working. If you wan't to see the code, I don't know which lines I should provide since I can't see any error in my code.