Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[geclipse-dev] JSDL job description creation

Hi All,

I am trying to create a simple jsdl job description with the following code:

          IWorkspace ws = ResourcesPlugin.getWorkspace();
          System.out.println(ws.getRoot().getLocationURI().toString());
          IWorkspaceRoot swRoot = ws.getRoot();
          IProject project = swRoot.getProject( "myproject" );

          if ( ! project.exists() ) {
              project.create( null );
          }

          project.open( null );

          IFile file = project.getFile( "myjsld.jsdl" );

if(!file.exists()) { file.create(new InputStream(){

                  @Override
                  public int read() throws IOException {
                      return -1;
                  }
                                 }, IResource.REPLACE, null );
          }

          JSDLJobDescription jsdl = new JSDLJobDescription( file );
          jsdl.create(new JSDLJobDescriptionCreator());
          jsdl.createRoot();
          jsdl.addJobDescription();
          jsdl.addApplication();
          jsdl.setApplicationName("/bin/date");
          jsdl.save(file);

          System.out.println(jsdl.getJSDLString());

But I get the following exception:

java.io.FileNotFoundException: /myproject/myjsld.jsdl (No such file or directory)
  at java.io.FileInputStream.open(Native Method)
  at java.io.FileInputStream.<init>(FileInputStream.java:106)
at eu.geclipse.jsdl.JSDLJobDescription.getJSDLString(JSDLJobDescription.java:250) at fr.cemagref.simexplorer.ide.osgi.processors.JobLauncherProcessor.process(JobLauncherProcessor.java:209) at fr.cemagref.simexplorer.ide.core.processors.modular.ProcessorsList.process(ProcessorsList.java:54) at fr.cemagref.simexplorer.ide.core.IDEModularApplication.run(IDEModularApplication.java:41) at fr.cemagref.simexplorer.service.loader.EFSSimulationLoaderImpl.run(EFSSimulationLoaderImpl.java:26) at fr.cemagref.simexplorer.service.application.SimExplorer.start(SimExplorer.java:49) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:169) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
  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:508)
  at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
  at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
  at org.eclipse.equinox.launcher.Main.main(Main.java:1148)

At the end of the process the jsdl file has been written:

<?xml version="1.0" encoding="UTF-8"?>
<jsdl:JobDefinition xmlns:jsdl="http://schemas.ggf.org/jsdl/2005/11/jsdl";>
<jsdl:JobDescription>
  <jsdl:Application>
    <jsdl:ApplicationName>/bin/date</jsdl:ApplicationName>
  </jsdl:Application>
</jsdl:JobDescription>
</jsdl:JobDefinition>


Did I miss something?


Romain



Back to the top