try to remove the <source path='server'/> of the gwt.xml file and add the jars in the war/lib folder
2012/6/2 jmbz84 <[email protected]> > [image: Boxbe] <https://www.boxbe.com/overview> > [email protected] is not on your Guest > List<https://www.boxbe.com/approved-list>| Approve > sender <https://www.boxbe.com/anno?tc=11494804866_698207912> | Approve > domain <https://www.boxbe.com/anno?tc=11494804866_698207912&dom> > > I'm trying to create a simple DB connection using JPA. It works fine > but when I try to Throw an Exception to the client I get the error: > > [ERROR] [browsereditor] - Line 210: No source code is available for > type javax.persistence.EntityExistsException; did you forget to > inherit a required module? > [ERROR] [browsereditor] - Line 212: No source code is available for > type javax.persistence.EntityNotFoundException; did you forget to > inherit a required module? > > I get no error in development mode and it compiles fine, but when the > app module is loaded there is where I get the error. > > I have the required imports in server/Composer and client/Presenter > classes > > import javax.persistence.EntityExistsException; > import javax.persistence.EntityNotFoundException; > > > I also added the following jars to the classpath and build path: > > javax.persistence.jar > jpa-annotations-source.jar (http://code.google.com/p/google-web- > toolkit/issues/detail?id=1830#c14) > > > I also tried adding to gwt.xml > > <source path='client'/> > <source path='shared'/> > <source path='server'/> > > Any ideas on how to tell eclipse where to find the source code?? > > Thanks > > Here is the code: > > //Create composer from Composer.class in server > > public static Composer createComposer(String name) > throws EntityExistsException { > Composer comp = new Composer(); > comp.setName(name); > comp.setId(1); > > EntityManager entityManager = entityManager(); > entityManager.getTransaction().begin(); > entityManager.persist(comp); > entityManager.getTransaction().commit(); > entityManager.close(); > > return comp; > } > ///fire Request from createComposer(above) in Presenter.class > > req.fire(new Receiver<ComposerProxy>() { > > public void onSuccess(ComposerProxy arg0) { > > ComposerProxy comp; > comp = arg0; > } > > public void onFailure(Throwable caught) > throws Throwable { > // Convenient way to find out which > exception > // was thrown. > try { > throw caught; > } catch (EntityExistsException e) { > > } catch (EntityNotFoundException e) { > > } > }}); > }}); > > > [ERROR] [browsereditor] - Line 210: No source code is available for > type javax.persistence.EntityExistsException; did you forget to > inherit a required module? > [ERROR] [browsereditor] - Line 212: No source code is available for > type javax.persistence.EntityNotFoundException; did you forget to > inherit a required module? > > -- > You received this message because you are subscribed to the Google Groups > "Google Web Toolkit" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/google-web-toolkit?hl=en. > > > -- Akram MONCER Etudiant à l' ENSI Tel: (+216)27753866 CV: http://akram.moncer.netcv.com/ -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
