Standalone project error: couldn't find resource on classpath [message #1061683] |
Mon, 03 June 2013 09:29  |
Eclipse User |
|
|
|
I created a project with the default Xtext language,
Model:
greetings+=Greeting*;
Greeting:
'Hello' name=ID '!';
and, after running the MWE2 Workflow, copied all java files into my standalone project, preserving the original directory hierarchy, and tried to execute the following Main:
import static org.junit.Assert.assertEquals;
import org.antlr.runtime.RecognitionException;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.xtext.resource.XtextResource;
import org.eclipse.xtext.resource.XtextResourceSet;
import com.google.inject.Injector;
import org.xtext.example.SimpleDSLStandaloneSetup;
public class Main {
public static void main(String[] args) {
Injector injector = new SimpleDSLStandaloneSetup().createInjectorAndDoEMFRegistration();
XtextResourceSet resourceSet = injector.getInstance(XtextResourceSet.class);
resourceSet.addLoadOption(XtextResource.OPTION_RESOLVE_ALL, Boolean.TRUE);
Resource resource = resourceSet.getResource(URI.createFileURI("src/test.sdsl"), true);
}
}
I get an error which states that
Exception in thread "main" com.google.inject.ProvisionException: Guice provision errors:
1) Error injecting constructor, org.eclipse.emf.common.util.WrappedException: org.eclipse.xtext.resource.ClasspathUriResolutionException: java.lang.IllegalStateException: Couldn't find resource on classpath. URI was 'classpath:/org/xtext/example/SimpleDSL.xmi'
(...)
I am trying to execute with the following command:
java -cp "classes:lib/*:src" Main
And my project hierarchy contains all java files in src/, all jars in lib/ and all .class files in classes/.
What am I missing?
[Updated on: Mon, 03 June 2013 09:40] by Moderator
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04040 seconds