tAS400Input Error : No X11 DISPLAY variable was set

Four Stars

tAS400Input Error : No X11 DISPLAY variable was set

Hello,
I'm having a wierd problem in a tAS400Input component : when I run it in AIX, using a headless server, calling the jar from the shell, I get the following error in the logs :
"Exception in component tAS400Input_1
java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an operation which requires it."
Inside the component is a simple SQL SELECT, with a java variable outside of the quotes, and simple SQL functions, but I highly doubt the SQL has to do with the error.
In the stacktrace, you can see that at the top, a few function calls after DriverManager, there is a java.awt.GraphicsEnvironment.CheckHeadless(), which is wierd because you shouldn't need GUI for SQL SELECT.
Here's the full stacktrace :
http://pastebin.com/raw/3g7XmDMS
Does anyone know why this is happening and how to fix it ?
Many thanks in advance.
One Star

Re: tAS400Input Error : No X11 DISPLAY variable was set

Hi,
Try to add -Djava.awt.headless=true on the command line which launch the job or set DISPLAY environment variable to the value ":0.0" in the .sh script file you use to activate th job.
Hope this helps,
TRF
Four Stars

Re: tAS400Input Error : No X11 DISPLAY variable was set

Thanks for the quick reply, I'll try both, but I'll probably have to come back in a few days to update this and tell you if it worked because the error only happens in an integration environment and I cannot have the team run it any time I want Smiley Happy
One Star

Re: tAS400Input Error : No X11 DISPLAY variable was set

OK, let me know what happened
Four Stars

Re: tAS400Input Error : No X11 DISPLAY variable was set

I think I understood why Java called GUI libs, I noticed I had a problem in my context variables : the tAS400Input was in repository mode, and used context variables which were not set anymore. In Talend Open Studio, when you run it with an empty context, a pop-up appears and asks for user/pwd, but this behaviour cannot work in a headless setting.
Here's the pop-up :
https://image.noelshack.com/fichiers/2017/05/1485788439-signondbms.jpg
I think my problem is solved, I'll come back again if this doesn't work.
It's amazing how I've struggled to try and find an answer myself for days and I've only just thought of this minutes after posting this topic :-/
One Star

Re: tAS400Input Error : No X11 DISPLAY variable was set

In context tab, be carefull to uncheck the checkbox next to the value for each context where you don't want to ask the user to provide a value.
TRF