[resolved] java.lang.NullPointerException when using tMSSqlOutput

One Star

[resolved] java.lang.NullPointerException when using tMSSqlOutput

Hey folks,
I am very new to Talend, and this is the problem that I've been seeing for a few days when using the Talend Open Studio for Big Data. My scenario is very simple, just insert some sample data into either a tMSSQLOutput or tTeradataOutput component, and I always receive the following error:
Starting job delimited_to_sql_local at 12:20 03/06/2013.

Exception in component tMSSqlOutput_1
java.lang.NullPointerException
at jlin_bd.delimited_to_sql_local_0_1.delimited_to_sql_local.tFileInputDelimited_1Process(delimited_to_sql_local.java:719)
at jlin_bd.delimited_to_sql_local_0_1.delimited_to_sql_local.runJobInTOS(delimited_to_sql_local.java:1365)
at jlin_bd.delimited_to_sql_local_0_1.delimited_to_sql_local.main(delimited_to_sql_local.java:1233)
connecting to socket on port 4082
connected
disconnected
The problem seems to stem from the following code (line 719):
java.sql.PreparedStatement pstmt_tTeradataOutput_1 = conn_tTeradataOutput_1
.prepareStatement(insert_tTeradataOutput_1);
Sounds like due to whatever reason conn_tTeradataOutput_1 is null?
I don't have any issues using the tMSSqlInput though..
Thank you in advance!
Best,
James
Moderator

Re: [resolved] java.lang.NullPointerException when using tMSSqlOutput

Hi,
My scenario is very simple, just insert some sample data into either a tMSSQLOutput or tTeradataOutput component, and I always receive the following error

Could you please give us the screenshot of our job work flow? Which components are you using to achieve your goal? Did you use any tMSSQLconnection or tTeradataconnection? Screenshots will be highly appreciated.
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.
One Star

Re: [resolved] java.lang.NullPointerException when using tMSSqlOutput

Thank you for the response Smiley Happy
I've attached screenshot of the job designer and the mssqlconnection.
I also want to you let you know that I have a job which just select data from table 1 and insert into table 2 on the same remote sql server. In this case no exception is thrown and the job completed successfully, but if I check the end result, there is no row inserted into table2.
One Star

Re: [resolved] java.lang.NullPointerException when using tMSSqlOutput

images:
Moderator

Re: [resolved] java.lang.NullPointerException when using tMSSqlOutput

Hi,
For you issue1, I have seen there is no Teradata component in your work flow, but the error info "java.sql.PreparedStatement pstmt_tTeradataOutput_1 = conn_tTeradataOutput_1
.prepareStatement(insert_tTeradataOutput_1);
" means something wrong with your tTeradataOutput.
I suspect you used tTeradataOutput and removed it?
Save your job and restart it to see if this issue repro again?
In addition, component tMSSqlConnection need a connector(such as, OnSubjobOk) with other component
See the online component reference with scenario tMSSqlConnection
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.
One Star

Re: [resolved] java.lang.NullPointerException when using tMSSqlOutput

Sabrina,
Finally I figured it out with your help!
The issue is I misunderstood the meaning of the tMSSQLConnection component. I thought it was just for setting up a connection so that I don't have to specify it again in the input or output components, and I just needed to select it from the existing connection dropdown...
Now if I uncheck the using existing connection checkbox, fill in the connection in each output/input tool, my jobs run successfully. Thanks a lot!
Moderator

Re: [resolved] java.lang.NullPointerException when using tMSSqlOutput

Hi,
It is a great. Thanks for your feedback.
I also want to you let you know that I have a job which just select data from table 1 and insert into table 2 on the same remote sql server. In this case no exception is thrown and the job completed successfully, but if I check the end result, there is no row inserted into table2.

It has been fixed too?
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.
One Star

Re: [resolved] java.lang.NullPointerException when using tMSSqlOutput

Hi,
It is a great. Thanks for your feedback.
I also want to you let you know that I have a job which just select data from table 1 and insert into table 2 on the same remote sql server. In this case no exception is thrown and the job completed successfully, but if I check the end result, there is no row inserted into table2.

It has been fixed too?
Best regards
Sabrina

Yes Smiley Happy
Moderator

Re: [resolved] java.lang.NullPointerException when using tMSSqlOutput

Hi,
It's a good job. Feel free post your issue on forum.
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.