Hello everyone, Today i want to generate an XML file from a JSON. I already generate XML files but I here I want to generate a particular one, this is an XML in google format. Like this: <entry> <g:id>114778689</g:id> <g:title>My PRODUCT</g:title> </entry> My problem is the colon because on STUDIO it is prohibit to add a colon( : ) in an XML tag. Has anyone had a solution to work this in mapping? Actual, the only solution is to make a replacement after file generation (not good). Thank's for your help !
... View more

Hi everyone, I want to add a line break after each tag like this: <Products> <Product>1 </ product> <Product>2 </ product> <Product>3 </ product> <Product>4 </ product> </ Products> But today even if I inform the terminator I have this: <products><product>1</ product>2<product>3</ product></products> Do you have an idea to do this in the XML structure Thank you for your help !
... View more

Hello Eric, If I add a filter in my loop, there is only 1 element with initiator and terminator. So my final file is not correct. With a filter I have: "ID";"LOOP_VALUE";"TEXT" "1";"ABC" "2";"Value Exemple";"CDE" "3";"EFG" "4";"GHI" instead of: "ID";"LOOP_VALUE";"TEXT" "1";"";"ABC" "2";"Value Exemple";"CDE" "3";"";"EFG" "4";"";"GHI"
... View more

Hi, Today I have a JSON file that I want to convert to CSV (via tHMap component) but I have a problem with empty values in loop, which creates offsets in my file. Here the longpagesummary may not exist and in this case, Talend doesn't create Initiator/Terminator (separator ; ) so i have a file which not correct. In example, i want Initiator/Terminator in line 6 in case where the field doesn't exist. Thank's for your help !
... View more

Hi, Since 2 days I have a problem with the tHMap component, I can't generate my jobs (even minimalist) as soon as it includes a tHMap. I use a Nexus, so I publish my work and on TIS I get the version. The problem is when I run my job I have the following error that tells me that the file does not exist then that if: : com.oaklandsw.base.AppRuntimeImpl - addProjectWithLocation: projectName: FLUX_20170215_113113 URL: zip:/FLUX_20170215_113113?file:/home/pmtalend/opt/Talend-flux/jobserver/agent/TalendJobServersFiles/repository/FLUX_test_tHMap_20170215_113315_BmKsw/test_tHMap/__tdm/FLUX_20170215_113113.zip version: null force: 2 2238 ERROR .oaklandsw.base.AppRuntimeImpl - java.lang.IllegalArgumentException: Cannot access project at zip:/FLUX_20170215_113113?file:/home/pmtalend/opt/Talend-flux/jobserver/agent/TalendJobServersFiles/repository/FLUX_test_tHMap_20170215_113315_BmKsw/test_tHMap/__tdm/FLUX_20170215_113113.zip : com.oaklandsw.base.AppRuntimeImpl - java.lang.IllegalArgumentException: Cannot access project at zip:/FLUX_20170215_113113?file:/home/pmtalend/opt/Talend-flux/jobserver/agent/TalendJobServersFiles/repository/FLUX_test_tHMap_20170215_113315_BmKsw/test_tHMap/__tdm/FLUX_20170215_113113.zip : flux.test_thmap_0_1.test_tHMap - tHMap_2 java.lang.IllegalArgumentException: Cannot access project at zip:/FLUX_20170215_113113?file:/home/pmtalend/opt/Talend-flux/jobserver/agent/TalendJobServersFiles/repository/FLUX_test_tHMap_20170215_113315_BmKsw/test_tHMap/__tdm/FLUX_20170215_113113.zip Exception in component tHMap_1 java.io.IOException: org.eclipse.core.runtime.CoreException: Error processing changed links in project description file. at com.oaklandsw.base.AppRuntimeImpl.addProjectWithLocation(AppRuntimeImpl.java:765) at com.oaklandsw.base.AppRuntimeImpl.addProjectArchive(AppRuntimeImpl.java:1004) at com.oaklandsw.base.AppRuntimeImpl.addProjectUri(AppRuntimeImpl.java:896) at flux.test_thmap_0_1.test_tHMap.tFileInputRaw_1Process(test_tHMap.java:997) at flux.test_thmap_0_1.test_tHMap.runJobInTOS(test_tHMap.java:2494) at flux.test_thmap_0_1.test_tHMap.main(test_tHMap.java:2301) Caused by: org.eclipse.core.runtime.CoreException: Error processing changed links in project description file. at org.eclipse.core.internal.resources.Project.open(Project.java:1135) at org.eclipse.core.internal.resources.Project.open(Project.java:1180) at com.oaklandsw.base.AppRuntimeImpl.addProjectWithLocation(AppRuntimeImpl.java:728) ... 5 more Exception in component tHMap_2 java.io.IOException: java.lang.IllegalArgumentException: Cannot access project at zip:/FLUX_20170215_113113?file:/home/pmtalend/opt/Talend-flux/jobserver/agent/TalendJobServersFiles/repository/FLUX_test_tHMap_20170215_113315_BmKsw/test_tHMap/__tdm/FLUX_20170215_113113.zip at com.oaklandsw.base.AppRuntimeImpl.addProjectWithLocation(AppRuntimeImpl.java:765) at com.oaklandsw.base.AppRuntimeImpl.addProjectArchive(AppRuntimeImpl.java:1004) at com.oaklandsw.base.AppRuntimeImpl.addProjectUri(AppRuntimeImpl.java:896) at flux.test_thmap_0_1.test_tHMap.tFileInputRaw_2Process(test_tHMap.java:1905) at flux.test_thmap_0_1.test_tHMap.runJobInTOS(test_tHMap.java:2503) at flux.test_thmap_0_1.test_tHMap.main(test_tHMap.java:2301) Caused by: java.lang.IllegalArgumentException: Cannot access project at zip:/FLUX_20170215_113113?file:/home/pmtalend/opt/Talend-flux/jobserver/agent/TalendJobServersFiles/repository/FLUX_test_tHMap_20170215_113315_BmKsw/test_tHMap/__tdm/FLUX_20170215_113113.zip at com.oaklandsw.base.AppRuntimeImpl.addProjectWithLocation(AppRuntimeImpl.java:751) Have you a idea for this ? Thank's for you help !
... View more

Hi Eric and thank's for your reply, The problem is with the "Constant" function in the mapping. There are others character as "&" -> "&amp;" I have to build urls with this character, it's strange that it is not possible. If I have to do post mapping replacements on millions of lines, the performance will be declining. Someone would have another solution? Thank's!
... View more

Hi everyone, I created a mapping with tHMap component for create an XML file from a JSON file. My XML file is correctly generated but I don't know how to add the CDATA ("<!]>") in some tags. I tried to add a constant(function) in my Map in left/rigth data but Talend replaces the character "<" by "&gt;" Also, I tried to add CDATA in the initiator/terminator but visibly it only works for the flat files. How do I add this CDATA to my fields? Thank's all for your help !
... View more

Thank's for reply, I used a RegEx for determine category to use. category_1: category_2: category_3: However, when I click on "Test Run", I have the bug: "Exception during test run: Thread Expr in$/Root/hits/hits/_source/category enclosing node: out$/Root/RequiredRecord/souscategorie_value != out$/Root/RequiredRecord/souscategorie2_value" I specify that I use this function in several Maps. On the other Map (1 only), everything is ok. There is a problem with json structure?
... View more

Hi hnie, Thank's for your answer, the expected ouput is the lowest value in category 1, category 2 in the second and last (the longuest value) in category 3. Today i resolve the first problem which was the XML structure. Now the field is set as below: In my Map, I loop on "category" and I recovers only one that interested me as below: However I think there is a simpler method to get the right values, no? There is a function for compare values length? Thank's for you help.
... View more

Hi, I use a mapping (component tHMap) to transform data from a JSON to XML. However, I do not know how to retrieve the first, second (or more) values of a JSON array. My first step would be to just get the first item and place it in the first tag category_1. Ditto for the next elements. "category" field into my JSON file: "category": Here is the structure that I want to generate: <categories> <category_1>test</category_1> <category_1>test_talend_2</category_1> <category_1>test_talend</category_1> </categories> Here is my mapping (Map): I think we should to use a Loop function but i dont know how to use it: Properties of "category" in JSON structure: My second step is to sort the values by string length. Exemple: <categories> <category_1>test</category_1> <category_1>test_talend</category_1> <category_1>test_talend_2</category_1> </categories> Is there a function for this in DataMapper? Thks all.
... View more

Hello, I try to use the component tOracleBulkExec but I always have the following message : Exception in component tOracleBulkExec_1 java.io.IOException: Cannot run program "sqlldr": java.io.IOException: error=2, No such file or directory at java.lang.ProcessBuilder.start(ProcessBuilder.java:460) at java.lang.Runtime.exec(Runtime.java:593) at java.lang.Runtime.exec(Runtime.java:431) at java.lang.Runtime.exec(Runtime.java:369) at sis.toraclebulk_0_1.tOraclebulk.tOracleBulkExec_1Process(tOraclebulk.java:406) at sis.toraclebulk_0_1.tOraclebulk.runJobInTOS(tOraclebulk.java:789) at sis.toraclebulk_0_1.tOraclebulk.main(tOraclebulk.java:620) Caused by: java.io.IOException: java.io.IOException: error=2, No such file or directory at java.lang.UNIXProcess.<init>(UNIXProcess.java:148) at java.lang.ProcessImpl.start(ProcessImpl.java:65) at java.lang.ProcessBuilder.start(ProcessBuilder.java:453) ... 6 more I execute my job on a unix server from the TAC. A oracle client is present on this server. I have tested sqlldr directly on commande line on this server and it's worked. The variables $ORACLE_HOME and $PATH exists : $ echo $ORACLE_HOME /home/oracle/product/9.2.0 $ echo $PATH /usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/data/pmtalend/bin:/home/oracle/product/9.2.0/bin:/data/pmtalend/bin:/appli/jdk/bin:/appli/mysql/bin/ So I don't how can I resolve the problem. Can you help me please ? My version of the studio, commandline and TAC is : v5.0.1 (Talend Enterprise Data Integration Professional Edition) Thank you, Carole
... View more

Hello, I need to use the library "commons-lang3" and more specically the function "unescapeHtml4". So I use a tLibraryLoad and a tjava. In the tjava I just have "System.out.println(unescapeHtml4("<Français>"));" But I have the message error : "La méthode unescapeHtml4(String) est indéfinie pour le type test_library" So I've tried with another method : I use the "User Libraries Preferences". I add the .jar in this window I use just a tjava with : String test = "<Français>"; System.out.println(org.apache.commons.lang3.StringEscapeUtils.unescapeHtml3(test)); But I have the message error : connecting to socket on port 3463 connected Exception in thread "main" java.lang.Error: java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringEscapeUtils at sis.test_library_0_1.test_library.tJava_1Process(test_library.java:1313) at sis.test_library_0_1.test_library.runJobInTOS(test_library.java:1506) at sis.test_library_0_1.test_library.main(test_library.java:1359) Caused by: java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringEscapeUtils at sis.test_library_0_1.test_library.tJava_1Process(test_library.java:1275) ... 2 more disconnected Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang3.StringEscapeUtils at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 3 more How can I use an external library ? (I've take the library "commons-lang3-3.1-bin.zip" on this website http://commons.apache.org/lang/download_lang.cgi) Thank you, Carole
... View more

Hi Pedro, I think I haven't been clear enough. I don't want using redirection or pipe. I just want use a simple linux command, like : "cd /repository...". Maybe the tsystem doesn't work for the Linux environnement, no ? Thank you, Carole
... View more

Hello We developp ours jobs on Windows. After, there are deployed on the TAC. The servers (TAC + JobServer) are under Linux. In our jobs, we used the "tsystem" component with simple Linux command such as "cd /data/directory/; ls -l". When the job is launched from the TAC, we have this error : ### Job STARTED at 2012/06/05 15:57:09 (jobId=20120605_155703_xuPgv, jobExecutionId=20120605155709_xcPO7) ### Exception in component tSystem_1 java.io.IOException: Cannot run program "cd": java.io.IOException: error=2, No such file or directory at java.lang.ProcessBuilder.start(ProcessBuilder.java:460) at java.lang.Runtime.exec(Runtime.java:593) at java.lang.Runtime.exec(Runtime.java:431) at java.lang.Runtime.exec(Runtime.java:369) at test_cab.exec_fils_0_1.Exec_Fils.tSystem_1Process(Exec_Fils.java:643) at test_cab.exec_fils_0_1.Exec_Fils.runJobInTOS(Exec_Fils.java:1206) at test_cab.exec_fils_0_1.Exec_Fils.main(Exec_Fils.java:1077) Caused by: java.io.IOException: java.io.IOException: error=2, No such file or directory at java.lang.UNIXProcess.<init>(UNIXProcess.java:148) at java.lang.ProcessImpl.start(ProcessImpl.java:65) at java.lang.ProcessBuilder.start(ProcessBuilder.java:453) ... 6 more ### Job ENDED WITH ERROR at 2012/06/05 15:57:09 (jobId=20120605_155703_xuPgv, jobExecutionId=20120605155709_xcPO7) ### After that, we modify this job but with a workstation on Linux. The execution on the workstation, make the same error. After deploy on TAC and execution on JobServer we have the same issue : ### Job STARTED at 2012/06/05 14:57:39 (jobId=20120605_145626_Y6WtB, jobExecutionId=20120605145739_FvR6r) ### Exception in component tSystem_1 java.io.IOException: Cannot run program "cd": java.io.IOException: error=2, No such file or directory at java.lang.ProcessBuilder.start(ProcessBuilder.java:460) at java.lang.Runtime.exec(Runtime.java:593) at java.lang.Runtime.exec(Runtime.java:431) at java.lang.Runtime.exec(Runtime.java:369) at test_cab.exec_fils_0_1.Exec_Fils.tSystem_1Process(Exec_Fils.java:643) at test_cab.exec_fils_0_1.Exec_Fils.runJobInTOS(Exec_Fils.java:1206) at test_cab.exec_fils_0_1.Exec_Fils.main(Exec_Fils.java:1077) Caused by: java.io.IOException: java.io.IOException: error=2, No such file or directory at java.lang.UNIXProcess.<init>(UNIXProcess.java:148) at java.lang.ProcessImpl.start(ProcessImpl.java:65) at java.lang.ProcessBuilder.start(ProcessBuilder.java:453) ... 6 more ### Job ENDED WITH ERROR at 2012/06/05 14:57:40 (jobId=20120605_145626_Y6WtB, jobExecutionId=20120605145739_FvR6r) ### How doing the system call under Linux ? Regards, Carole
... View more

:-S it doesn't work yet. I have this error : Unexpected value "suffix=pm" found while processing -jcp That's strange, I don't find any example of the same case in Talend documentation... Do you think it's a bug ? Thank you for your help, Carole
... View more

Hi Pedro, It doesn't work with this syntax. I have the same error : "Unexpected new1=pm while processing" (I've changed the name of my second context variable. new1 become suffix) Best Regards, Carole
... View more

Hello, I'm trying to using the commandline deployJobToServer. My goal is to be able from a job to deploy another job on another server. After I will launch them on this another servers with a specific context. So I'm trying to use this command on my job (cf : deploy_ssh) : "./Talend-Studio-linux-gtk-x86_64 -nosplash -application org.talend.commandline.CommandLine deployJobToServer test_deploy ?es Doris -jv Latest -jc Default ?jactc" I have this error : FAILED at Mon Jun 04 10:46:00 CEST 2012 exception : org.talend.commandline.client.command.CommandStatusWrapException: java.lang.IllegalStateException: should be logged on a repository at org.talend.commandline.command.CommandProcessor.checkLogged(CommandProcessor.java:233) at org.talend.commandline.command.CommandProcessor.beforeDeployJobToServer(CommandProcessor.java:444) at org.talend.commandline.command.CommandProcessor.deployJobToServer(CommandProcessor.java:434) at org.talend.commandline.command.ExtensionCommandSwitch.caseDeployJobToServerCommand(ExtensionCommandSwitch.java:129) at org.talend.commandline.client.command.extension.AbstractExtensionCommandSwitch.doSwitch(AbstractExtensionCommandSwitch.java:49) at org.talend.commandline.command.CommandProcessorSwitch.caseExtensionCommand(CommandProcessorSwitch.java:159) at org.talend.commandline.client.util.CommandAbstractSwitch.doSwitch(CommandAbstractSwitch.java:70) at org.talend.commandline.command.CommandConsumer.executeCommand(CommandConsumer.java:52) at org.talend.commandline.command.CommandConsumer.execute(CommandConsumer.java:33) at org.talend.commandline.cli.CommandLineHandler.process(CommandLineHandler.java:239) at org.talend.commandline.cli.CommandLineHandler.execute(CommandLineHandler.java:173) at org.talend.commandline.cli.CommandLineHandler.execute(CommandLineHandler.java:162) at org.talend.commandline.mode.NormalCommandLine.start(NormalCommandLine.java:32) at org.talend.commandline.CommandLineApplication.start(CommandLineApplication.java:92) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574) at org.eclipse.equinox.launcher.Main.run(Main.java:1407) at org.eclipse.equinox.launcher.Main.main(Main.java:1383) The job is present on another server. Cf deploy_job_conductor. Do you know what options I must used to succeed ? Thank you for your help, Carole
... View more

Hi Pedro, Thank you for your answer. Do you know how do I handle the case where the precessus not responding ? How to get into error if there is no return of commands executed after x minutes? Kind regards, Carole
... View more

Hello, I have a problem with the component tssh. I'm using this component to send a file to an API. (I don't use the tRest component because we can't indicate a file to upload. We only can use the content of a variable. That's too long to put the whole file content in a variable). So I used my tssh with only one command line simple : "curl -d @"+((String)globalMap.get("CurrentFile"))+".tmp "+context.api_url (After the tssh component I use a row on a tjavaFlex. The outputs of tssh are the global variable) I try with and without timeOut on the component. In the two cases, it's arrived that the process java freeze while the curl was ended. This case seems arrived when the response of the api is superior at 5 minutes. I saw the curl process disappeared but my process java blocked. So I have two problem : - The timeOut of tssh component seem didn't work - The tssh looses the connection with his child process and seem wait a signal to wake up How can I resolve this problems ? (I use TOS 5.0.1 in java) Thank you, Carole
... View more

Hi, I still have errors of compilation. It's certainly due to the using of joblet. In my tmap, i had put : too_long.field_too_long(row1.Column1,tLogCatcher_1,globalMap,resumeUtil); tLogCatcher_1Process(globalMap) Is it good ? Have I to don't use joblet for the log ? Regards, Carole
... View more

Hi Pedro, Thank you for the answer. I put it in my routine but I have declarations problem. resumeUtil : can't be resolved tLogCatcher_1 : can't be resolved globalMap : can't be resolved as a variable globalMap : can't be resolved globalMap : can't be resolved globalMap : can't be resolved The routine doesn't have a lot of code. I verify the length of a field and I reset it with empty value if it's > 4000. I want to log when I reset the field. Regards, Carole
... View more

Hi, I want to log into a java routine. I work with the enterprise edition an my job is in java. I have a joblet which create the file log with a specific schema (Cf log.png). How can I write a message in my java routine like a twarn component ? Thank you, Carole
... View more