Six Stars

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 Smiley Happy

  • Data Integration
Tags (2)
1 ACCEPTED SOLUTION

Accepted Solutions
Six Stars

Re: Cannot connect to access DB - NullPointerException

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.

24 REPLIES
Moderator

Re: Cannot connect to access DB - NullPointerException

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

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Six Stars

Re: Cannot connect to access DB - NullPointerException

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
Six Stars

Re: Cannot connect to access DB - NullPointerException

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.

Six Stars

Re: Cannot connect to access DB - NullPointerException

@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

Moderator

Re: Cannot connect to access DB - NullPointerException

Hi,

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

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Six Stars

Re: Cannot connect to access DB - NullPointerException

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.

Moderator

Re: Cannot connect to access DB - NullPointerException

Hi,

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

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Six Stars

Re: Cannot connect to access DB - NullPointerException

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
Six Stars

Re: Cannot connect to access DB - NullPointerException

@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.

Six Stars

Re: Cannot connect to access DB - NullPointerException

What version of Access was used to create the database? There is a known issue with the Jet format on older versions of Access: you can read about it here:

 

http://netdat.ru/accdb/

 

David

Six Stars

Re: Cannot connect to access DB - NullPointerException

@DVSCHWAB I'm using Access 2007 to read my database but it seems like it was created with Access 97. I guess the real problem is coming from this.

Moderator

Re: Cannot connect to access DB - NullPointerException

Hi,

Have you tried to use other Access DB to see if the DB connection is Ok with you?

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Six Stars

Re: Cannot connect to access DB - NullPointerException

@xdshi

 

Sabrina,

I just created a test database with Access 2007 and used tAccessInput -> tLogRow and the connection works fine.

The problem might very well be the access version of the database I need to use then. The problem is that I can't duplicate or update the database I need to use. Unfortunately, I really have to use this Access 97 database.

Moderator

Re: Cannot connect to access DB - NullPointerException

Hi,

What's talend build version you are using?

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Six Stars

Re: Cannot connect to access DB - NullPointerException

@xdshi

I'm using TOS DI v6.4.0

Moderator

Re: Cannot connect to access DB - NullPointerException

Hi,

Please take a look at this document about:TalendHelpCenter: Supported systems, databases and business applications by Talend components for 6.4

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Six Stars

Re: Cannot connect to access DB - NullPointerException

@xdshi

I just looked  at the document you linked. Does it mean I definitely can't use Talend to move my data from access 97 database?

Moderator

Re: Cannot connect to access DB - NullPointerException

Hi,

In the documentation we provide a list of databases that are supported, in the sense that we do provide an SLA and technical support for them. This doesn't mean other (non-listed) databases will not work but simply we won't necessarily be equipped to help you with any issue you may face with them.

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Six Stars

Re: Cannot connect to access DB - NullPointerException

@xdshi

So you can't help me with my issue?

Moderator

Re: Cannot connect to access DB - NullPointerException

Hi,

We will make an investigation on your issue and then come back to you as soon as we can.

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Six Stars

Re: Cannot connect to access DB - NullPointerException

Ok, I'm looking forward to hear from you.

 

Thank you.

Six Stars

Re: Cannot connect to access DB - NullPointerException

@xdshi

 

Any update about the issue?

Moderator

Re: Cannot connect to access DB - NullPointerException

Hi,

So far, we cannot find a solution for Access 97. Can you export your data from Access 97 to Access 2003 or 2010?

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Six Stars

Re: Cannot connect to access DB - NullPointerException

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.