Error while trying to run a simple job

One Star

Error while trying to run a simple job

Hi,
I'm using the latest version of talend and I'm trying to do something simple:
Read an XML file which matches a schema, and print its rows with tLogRow.
I'm new to talend, and just to mention I've already managed to run a job with talend (which takes rows from DB and puts them out to a file).
I've attached my job image.
Unfortunately, I'm getting the following error when trying to run the job:
"
Execution failed : Failed to generate code.

Job FileRequest ended at 15:39 20/04/2014.
"
One Star

Re: Error while trying to run a simple job

Forgot to mention:
1. I'm using jre7 within the talend open studio. (Though I have jre8 installed).
2. One more question:
How can I receive any file with XML extension ? (In tFileInputXML component I have to write a name of xml file).
Moderator

Re: Error while trying to run a simple job

Hi,
What's your XML file structure? Could you please paste it 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.
One Star

Re: Error while trying to run a simple job

I have a feeling the problem is more deeper than that.. but here:
XML Schema:
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="Root">
<xs:complexType>
<xs:sequence>
<xs:element name='row' type='ActorType' minOccurs='0' maxOccurs='unbounded' />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="ActorType">
<xs:sequence minOccurs="0">
<xs:element name="actorid" type="xs:string"/>
<xs:element name="name" type="xs:string"/>
<xs:element name="pdf" type="xs:base64Binary"/>
</xs:sequence>
</xs:complexType>
</xs:schema>

XML File Input:
<?xml version="1.0" encoding="ISO-8859-15"?>
<root>
<row>
<actorid>1</actorid>
<name>PENELOPE</name>
<pdf>JVBERi0xLjQKJcfsj6IKNSAwIG9iago8PC9MZW5ndGggNiAwIFIvRmlsdGVyIC9GbGF0ZURlY29kZT4+CnN0cmVhbQp4nOVdW5Nc</pdf>
</row>
<row>
<actorid>2</actorid>
<name>DANIEL</name>
<pdf>JVBERi0xLjQKJcfsj6IKNSAwIG9iago8PC9MZW5ndGggNiAwIFIvRmlsdGVyIC9GbGF0ZURlY29kZT4+CnN0cmVhbQp4nOVdW5Nc</pdf>
</row>
</root>
One Star

Re: Error while trying to run a simple job

Still stuck. Any help ?
One Star

Re: Error while trying to run a simple job

what version of talend are you using ? and location where you have installed it?
what version of java are you using? your OS?
i just solved this issue and i might be able to help you with that if you provide me above information
One Star

Re: Error while trying to run a simple job

Talend Version: 5.4.1
OS: Windows 7
Location: Talend library on my windows desktop
JAVA: I've installed JRE 8.0, but currently using 7.0 on my talend open studio
One Star

Re: Error while trying to run a simple job

Yes, it appears JDK 1.8 does not play nice with Talend 5.3/5.4. If you still have this issue, install 1.8 and install 1.7 (restart your system between uninstall and install to force registry updates).
Moderator

Re: Error while trying to run a simple job

Hi,
Are there two JDK 1.8 and 1.7 in your PC? If so, could you please check your path variable to make sure JDK 1.7 value is set in front?
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: Error while trying to run a simple job

Hi,
Sabrina, i've already checked the environment path (You can see in the image i've attached).
Maybe I should uninstall JDK 8.0 ? (Although everything is configured to JDK 7.0?)
Four Stars

Re: Error while trying to run a simple job

Hi,
I think the problem is with input schema for pdf data type. Also you don't have schema for pdf in your job. Can you try creating a schema in repository and test the job.
<xs:element name="pdf" type="xs:base64Binary"/>
I used string for PDF, it works fine.
Thanks
Vaibhav
One Star

Re: Error while trying to run a simple job

Hi,
Don't think it is the problem because at first that schema and file didn't have any pdf and I still got that error.
Four Stars

Re: Error while trying to run a simple job

Have you created a schema in repository for your xml input file?? Whether it displays data correctly in the preview?
Vaibhav
One Star

Re: Error while trying to run a simple job

Hi,
I'm getting : "Failed to generate code" on the preview of the schema.
I've attached the printed screen.
I've changed the encoding of the input file to UTF-8, and also chose UTF-8 encoding after xml file selection.
One Star

Re: Error while trying to run a simple job

Any help ?
One Star

Re: Error while trying to run a simple job

ohadtest1 - what jdk are you using? Failed to generate code seems to indicate you have an environment setup issue...
If you're using jdk 1.8, you need to downgrade to 1.7
See http://www.talendforge.org/forum/viewtopic.php?pid=133934#p133934
and read the responses that follow...
One Star

Re: Error while trying to run a simple job

PROBLEM SOLVED!
Pay attention that even if you change "JAVA_HOME", java still can run from 1.8 library.
So make sure you write in command line: "java -version" to check what is the version that Talend works with.
After uninstalling JAVA 8, everything works fine. Changing paths isn't enough!
Moderator

Re: Error while trying to run a simple job

Hi,
Great it is fixed. Could you please mark this topic as resolved?
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.