I developed a program which reads xmls from another db system and fills tables in my database with the data from those xmls. It works fine in EDT Eclipse environment using debug or run facility. Now I want to export the program outside the Eclipse to start it from command line. Is it posible and how? I can't find out the procedure to do this.
Later I want this program to start automaticaly every day at the same time on the production machine.
(I also tried to make the same program in RBD but I was more successful with EDT, surprisingly).
This is information I got from EDT Project Home page:
EGL supports creation of batch-style Java programs that can be run from command line, offering the ability to perform post-processing on a database, report generation, and more.
We don't yet have deployment support for batch programs, but there's a couple ways you can get the environment working outside the IDE.
1. Deploy your DD file into a web project, then copy the resulting *-bnd.xml files from the target Web project's Java source folder (typically found underneath 'Java Resources') into the 'src' folder of the project containing your program.
2. Create a file "rununit.properties" in the toplevel of the project's 'src' folder and give it settings such as:
Where 'myPackage.myProgram' is the qualified name of your program, and 'myDD' is the name of the descriptor you deployed. This sets up the default DD file when your binding does not specify a specific file to use.
As for getting the program to run automatically each day, which operating system is the production machine? If Linux/Unix you can set up a cron job to take care of this.
2.) I copied everything from bin directory to some-directory outside, also bin\xxxx-bnd.xml and bin\rununit.properties.
3.) I had to rename xxxx-bnd.xml to xxxx.egldd-bnd.xml !!
4.) Copied com.ibm.icu_4.4.2.v20110208.jar and org.eclipse.edt.runtime.java_0.8.0.v201203151558.jar to some-directory\bin
5.) Made some runit.bat file which I can include in windows scheduller or run manualy:
Glad you got it working, but I wonder about #3 where you had to rename the bind file. This should not be necessary; it makes me think your rununit.properties entry listed the full file name, which might explain this. The entry does not expect the file extension, so for file 'myDD.egldd' deployment would create the file 'myDD-bnd.xml' and an entry in rununit.properties "egl.application.property.file.myProgram=myDD" (not "...=myDD.egldd").
I followed the instructions in this topic but I was not able to run the test program I wrote. It seems to have trouble in finding resources. The execution of la.bat immediately ends with the following statements:
C:\Documents and Settings\donati\Desktop\testegl>java -cp "C:\Documents and Sett
Donati\Eclipse\EDT\workspace\sqljdbc4.jar;C:\Documents and Settings\donati\Deskt
and Settings\donati\Desktop\testegl\lib\com.ibm.icu_4.4.2.v20110823.jar" it.err
Exception in thread "main" java.lang.NullPointerException
For investigating purposes, I tried browsing EDT source files from Eclipse CVS, but most are missing, especially those in resources.* packages, and the source of eglx.lang.SysLib does not contain any getResource function. I browsed from ":pserver:firstname.lastname@example.org:/cvsroot/tools" as said in "wiki.eclipse.org/EDT:Developer%27s_Guide_to_Getting_Started_on_EDT" .
I'm attaching the folder where I exported the project, the only missing files are org.eclipse.edt.runtime.java_0.8.0.v201204041632.jar and com.ibm.icu_4.4.2.v20110823.jar, too big to attach.
after downloading 0.8.1M2, I have new troubles in finding SQL resources. It's all ok if I run my program in EDT, but deploying like I did with 0.8.0 (and then worked) leads to a new exception I can't fix.
I'm attaching the output and the folder where I exported the project.
It looks like you need to update your classpath for the Java process. We did some refactoring for the extensibility of the Java runtime, and now there are multiple jar files containing different components. You can see the current list of required jars for a release by expanding the "EDT Java runtime" container in Project Explorer, located underneath one of your EGL projects. The new plug-ins that you should add to your classpath are:
Okay, for that new message it sounds like you need to regenerate your EGL source (there were breaking runtime changes in this milestone, this is a pre-1.0 product so a lot of APIs are still being worked on and will be frozen in the 1.0 release). When you view the source in the IDE you're going to see some new validation errors. In the case of the latest error message, you need to change the code from "SysLib.getResource()" to "Resources.getResource()". There might be other validation errors too; if so you can list them here and I'd be happy to help you make the appropriate updates.
A project clean of all three projects involved fixed the problem. I had already done conversions from SysLib.getResource() to Resources.getResource, but most of my binding are done implicitly with @Resource annotation.
Thank you once more, Justin