I'm working in a web project that uses a XText grammar but every time I run it on Apache Tomcat I find the same error
java.lang.ClassNotFoundException: co.edu.uniandes.enar.picture.Model at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1324) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1177) at co.edu.uniandes.picture.webpicture.servlet.util.UploadDownloadFileServlet.doPost(UploadDownloadFileServlet.java:75) at javax.servlet.http.HttpServlet.service(HttpServlet.java:644) at javax.servlet.http.HttpServlet.service(HttpServlet.java:725) ...
I already did the steps mentioned in http://www.eclipse.org/forums/index.php/t/489925/ to generate the Jar file but again it does not work
Thanks in advance
Solved
//new org.eclipse.emf.mwe.utils.StandaloneSetup().setPlatformUri("../"); ->Leave it in comments
Injector injector = new co.edu.uniandes.enar.PictureStandaloneSetup().createInjectorAndDoEMFRegistration(); XtextResourceSet resourceSet = injector.getInstance(XtextResourceSet.class); resourceSet.addLoadOption(XtextResource.OPTION_RESOLVE_ALL, Boolean.TRUE); Resource resource = resourceSet.getResource(URI.createURI(path), true); Model model = (ModelImpl) resource.getContents().get(0);
There you go the model is loaded in the web project but it tends to consume a lot of memory :(