Four Stars

Job works in Studio (6.4.1) but fails from windows cmd line.

Hi, I have a Talend job which uses tJDBCConnection that works fine in Studio. When I build it and run the windows executable from command line, it fails with the below error. Seems to be some compatibility issue with java. Could someone guide how to troubleshoot the issue. Appreciate your help.

 

Error:

Establishing JDBC connection to the source database....
[FATAL]: imas_datalake.tretrievedatadict_0_1.tRetrieveDataDict - tJDBCConnection_1 null
java.lang.NullPointerException
at oracle.net.jndi.JndiAttrs.getAttrs(JndiAttrs.java:207)
at oracle.net.resolver.AddrResolution.<init>(AddrResolution.java:205)
at oracle.net.ns.NSProtocol.connect(NSProtocol.java:223)
at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1140)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:340)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:553)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:254)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:528)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at routines.system.SharedDBConnectionLog4j.getConnection(SharedDBConnectionLog4j.java:88)
at routines.system.SharedDBConnectionLog4j.getDBConnection(SharedDBConnectionLog4j.java:166)
at imas_datalake.tretrievedatadict_0_1.tRetrieveDataDict.tJDBCConnection_1Process(tRetrieveDataDict.java:4132)
at imas_datalake.tretrievedatadict_0_1.tRetrieveDataDict.tFileInputDelimited_1Process(tRetrieveDataDict.java:395
0)

 

Some related settings:

talend_job_settings.jpgTalend Job Settings and java version

2 REPLIES
Nine Stars

Re: Job works in Studio (6.4.1) but fails from windows cmd line.

A suggestion to look after:
Make sure windows points to the jdk and not the JRE, environment vars :
JAVA_HOME
CLASSPATH
PATH

Althoug do you point out to use context variables? when you build your job (to run it outside of Talend) it uses your default context. Make sure your context vars are set properly.
To mee it doesn't look like a java version issue.

Cheers!
Moderator

Re: Job works in Studio (6.4.1) but fails from windows cmd line.

Hello,

Please make sure the export is working well.

Before building your job, could you please go to Window > Preferences, select Talend > Import/Export, and then select the "Add classpath jar in exported jobs" check box to wrap the Jars in a classpath.jar file added to the built 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.