Four Stars

About that Job fails on Linux Server but works fine on Talend app

Hi Forum,

 

Could you help me to solve the following problem ?
Jobs created in the past Talend version 5.X / java 7 were corrected in Talend 6.2.1 / java 8 and the jobs exported on the server of Linux OS / java 8 were executed, and the following error occurred in the component of tSendMail.
I thought that there was a problem with connecting to SMTP, but when I run it on Talend's app, no error occurs.

 

Exception in component tSendMail_9
javax.mail.MessagingException: [EOF]
at com.sun.mail.smtp.SMTPTransport.issueCommand(SMTPTransport.java:1363
at com.sun.mail.smtp.SMTPTransport.helo(SMTPTransport.java:838)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:35)
at javax.mail.Service.connect(Service.java:297)
at javax.mail.Service.connect(Service.java:156)
at javax.mail.Service.connect(Service.java:105)
at javax.mail.Transport.send0(Transport.java:168)
at javax.mail.Transport.send(Transport.java:98)
at XXXXX.tSendMail_9Process(XXXXX.java:2369)
at XXXXX.runJobInTOS(XXXXX.java:27401)
at XXXXX.main(XXXXX.java:27213)

  • Data Integration
22 REPLIES
Moderator

Re: About that Job fails on Linux Server but works fine on Talend app

Hi,

Did you export your job as job script file and run .sh file in your linux server out of studio?

Java not embedded in Talend. Make sure you have the same java version on your linux server.

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.
Four Stars

Re: About that Job fails on Linux Server but works fine on Talend app

Hi Sabrina,

 

Thank you for your reply.

 

First of all, I tested on my machine with the following environment and method.
Under the following circumstances, jobs worked normally.

・The OS of my machine is Windows 10
・Java is the latest version for Windows 10 (1.8.131)
・Talend's application is running on my machine
・CSV file is stored on a Windows server different from my machine
・I read CSV file from Windows server at Talend of my machine and exported it to another server

 

Since the above worked normally, I exported the job from Talend.

At this time, I selected "all" at Shell Launcher as shown in the attached screen.

 

Next, I put the exported job (jar file, library, sh file) on the Linux server.

Java is as follows.

· Linux server java is the latest java version for Linux (1.8.131)

 

And when I run the sh file on Linux, an error occurs in tSendMail_9.

For example, when exporting a job with Talend, I exported it on a Windows 10 machine, but I guess it might be necessary to export it on a Linux OS machine.

 

Could you give me some advice ?

 

java.jpgbuild.jpg

 

 

Four Stars

Re: About that Job fails on Linux Server but works fine on Talend app

Hi forum,

The problem has not been solved yet.
Could you advise me?
Moderator

Re: About that Job fails on Linux Server but works fine on Talend app

Hello,

Can you run your exported job .bat file firstly outof studio on your Window OS through CMD with no error? Did you set context value in your tSendMail 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.
Four Stars

Re: About that Job fails on Linux Server but works fine on Talend app

Hi Sabrina,

Thank you for your reply.

 

I tried what you said.

 

>Can you run your exported job .bat file firstly outof studio on your Window OS through CMD with no error?

⇒ I ran my exported job .bat file out of studio on my Window OS through CMD.
  It worked normally, and I could receive mails through tSendMail.

 

>Did you set context value in your tSendMail component?

⇒ I set context value in my tSendMail component.

Moderator

Re: About that Job fails on Linux Server but works fine on Talend app

Hi,

Would you mind posting your tsendmail component setting screenshot into forum?

Have you tried to use parameter directly without using context value in tSendMail component to see if it works?

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.
Four Stars

Re: About that Job fails on Linux Server but works fine on Talend app

Hi,

Ensure that the hostname entries of both the Linux & mail server are made into /etc/hosts file of Linux machine.

 

Thanks & Regards
Ashok Karnam
Four Stars

Re: About that Job fails on Linux Server but works fine on Talend app

Hi Sabrina,

 

Thank you for your reply.

 

>Would you mind posting your tsendmail component setting screenshot into forum?

⇒ Please refer to the screen capture below.
  Appropriate values are set for the context in the screen capture.
  
  -context.mail_to
  -context.mail_from
  -context.mail_senderName
  -context.mail_header
  -context.Customer
  -Username

 

tSendMail_9_screenshot_capture.jpg

 

>Have you tried to use parameter directly without using context value in tSendMail component to see if it works?

⇒ I'll try today or tomorrow.

 

Four Stars

Re: About that Job fails on Linux Server but works fine on Talend app

Hi Karnam,

 

Thank you for your reply.

 

>Ensure that the hostname entries of both the Linux & mail server are made into /etc/hosts file of Linux machine.

⇒ As a result of checking, only the host name of the Linux server was registered in the host file.
  However, as to whether or not registration of the host name of the mail server is necessary, the following two points are unknown.

  Do you know anything about it ?

   1. What mail should be registered in the host name by using Gmail ?
    I think it's "smtp.gmail.com".
   2. tSendmail is working normally on Java 1.7 Linux server and this time I upgraded Java to 1.8, so I thought I didn't have to register the host name of the mail server
     Is it necessary to register ?

Four Stars

Re: About that Job fails on Linux Server but works fine on Talend app

Hi Sabrina,

>Have you tried to use parameter directly without using context value in tSendMail component to see if it works?

⇒ I tried on Linux server and on my Windows 10 machine.
  In the former case, an error occurred.
  The content of the error is the same as what I posted.
  In the latter case, processing was completed normally.


Do you have anything to understand from the above ?

Four Stars

Re: About that Job fails on Linux Server but works fine on Talend app

Hi Sabrina and forum,

 

The problem has not been solved yet.
Could you advise me?

Moderator

Re: About that Job fails on Linux Server but works fine on Talend app

Hello,

What's linux OS  version you are using? Did you install the same jdk 1.8 on your linux server?

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.
Four Stars

Re: About that Job fails on Linux Server but works fine on Talend app

Hi Sabrina,

 

Thank you for your reply.

 

Linux OS verstion is CentOS release 6.9 (Final).

Java version is jdk-8u131-linux-x64.rpm.

The same java version for Windows OS is on my machine.

Four Stars

Re: About that Job fails on Linux Server but works fine on Talend app

Hi Sabrina,

 

I will contact you as my survey has advanced.

 

When I changed the directory path of the shell to the root path, the error of tSendmail ceased and the following error occurred this time.

 Error: Could not find or load main class

 

After reviewing Talend's past topics, I found the following topics.

 https://www.talendforge.org/forum/viewtopic.php?id=34879&p=1

 

And I found the following your comment (2014-03-13 08:11:23) in the above topic.

 "Make sure your jdk environment is totally correct.(java -version classpath=.;%JAVA_HOME%\jre\lib\rt.jar;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jarSmiley Wink."

 

So I checked it with my Linux server and got the following contents.

 java version "1.8.0_131"
 Java(TM) SE Runtime Environment (build 1.8.0_131-b13)
 Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)
 -bash: fg: %JAVA_HOME%jrelibrt.jar: no such job
 -bash: fg: %JAVA_HOME%libdt.jar: no such job
 -bash: fg: %JAVA_HOME%libtools.jar: no such job

 

The above content was the same in shanshan's comment (2014-09-13 11:40:18) on the topic of the previous.
And you answered the following.

 "Here is a response in your another topic:http://www.talendforge.org/forum/viewtopic.php?id=38274"

 

I checked the URL.
And you answered (2014-09-15 03:26:06) the following again.

 "Did you follow up document https://help.talend.com/#/display/TalendOpenStudioforDataIntegrationInstallationandUpgradeGuide54EN/... to set the environment variable?"

 

But the link above was expired.
Could you tell me the correct link ?

Moderator

Re: About that Job fails on Linux Server but works fine on Talend app

Hello,

The document  you mentioned is about installation requirement.

According to your current build version, you can check the installation requirement to see if you are on a compatible platform from https://help.talend.com/#/home.

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.
Four Stars

Re: About that Job fails on Linux Server but works fine on Talend app

Hi Karnam,

 

As a premise, the job relays Gmail and sends mail via tSendmail.

As you said, I informed the administrator of the Linux server as such, but the administrator answers as follows.

"Since the IP of Gmail server is changed dynamically, he does not know to what extent to add to the host file."

 

Do you have any idea ?

Four Stars

Re: About that Job fails on Linux Server but works fine on Talend app

Hi Sabrina,

 

Thank you for your reply.

I have one more question.

 

Could you answer me ?

 

What is the following java command you indicated in the answer to confirm ?

java -version  classpath=.;%JAVA_HOME%\jre\lib\rt.jar;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;

Moderator

Re: About that Job fails on Linux Server but works fine on Talend app

Hello,

Could you please take a look at this document about:Setting up the Java environment variable on Linux?

Actually, you can execute java -version in command prompt to make sure that  your java is set totally correct in your computer.

 

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.
Four Stars

Re: About that Job fails on Linux Server but works fine on Talend app

Hi Sabrina,

 

Thank you very much for replying to the questions many times.
I will continue to investigate.

Moderator

Re: About that Job fails on Linux Server but works fine on Talend app

Hi,

Feel free to post your issue here.

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.
Four Stars

Re: About that Job fails on Linux Server but works fine on Talend app

Hi Sabrina,

 

I confirmed the operation requirement that you told me.
As for that, I have the following three questions.
As a prerequisite, as I have written here until now, I will run a job exported by Talend on Windows OS on a Linux OS that uses only as a job server.

 

(1) Is it necessary to install Talend on a Linux server that is a job server ?
(2) Is it necessary to set environment variables such as JAVA_HOME on the Linux server which is the job server ?
(3) Exported jobs are exported as Standalone jobs in Talend on Windows OS, but is it necessary to recompile on Linux server ?

 

I appreciate your answer.

Moderator

Re: About that Job fails on Linux Server but works fine on Talend app

Hello,

Talend Jobs support cross-platform execution. You can develop your Job on one machine, export the Job script, and then move it to another machine to execute without any additional configuration(no need to install talend studio on linux) excepts the JDK installation.

Due to the archive generated contains all java lib dependencies,  your jobs and a shell script, the java environment(JDK installation) is needed.

With your community solution, do you need job server?

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.