Thursday, March 31, 2011

Re: GWT 2.2 + JPA problem?

Ok, but the error is relationate with netbeans IDE, no gwt. You can make a simple jar with only entity class. This jar define the xml and is used by the war and the ejb project. Best modularizate.

Juan

2011/3/31 ngspk <ngspkinga@gmail.com>
I tried but Netbeans 6.9.1. said that I can not create gwt module in a
non-gwt project.

I solved this way: I deleted my ejb project and I create my session
bean and entity class in the gwt project. (And I added the EclipseLink
(JPA 2.0) library to the classpath because of the annotations.) And of
course added the entity source in the module file. And it is working.

Thanks for the help! :)

On Mar 31, 3:33 pm, Juan Pablo Gardella <gardellajuanpa...@gmail.com>
wrote:
> If you want use it in client side, you must define a module in the ejb
> module and in the war proyect, use it. For example:
>
> ejb
> -> MyModule.gwt.xml: In this file, you put the package where you have the
> entities
>
> war
> -> MyWar.gwt.xml: There you inherit for MyModule.gwt.xml to gwt compile can
> find the sources of your entities.
>
> Seehttp://code.google.com/webtoolkit/doc/latest/DevGuideOrganizingProjec...
>
> <http://code.google.com/webtoolkit/doc/latest/DevGuideOrganizingProjec...>
> Juan
>
> 2011/3/31 ngspk <ngspki...@gmail.com>
>
>
>
>
>
>
>
> > It is in another project (EJB Module Project).
>
> > On Mar 31, 1:28 pm, Juan Pablo Gardella <gardellajuanpa...@gmail.com>
> > wrote:
> > > What is the package of entity.User ? Are you put in client package?
>
> > > Juan
>
> > > 2011/3/30 zoejules <ngspki...@gmail.com>
>
> > > > I am working with GWT 2.2, JPA, Java EE 6 Web, glassfish v3. My
> > > > problem is that I receive the following error if I use my entity in an
> > > > RPC call: "No source code is available for type entity.User; did you
> > > > forget to inherit a required module?"
>
> > > > First I tought the problem was the annotation, but then I read that
> > > > from GWT 2.0 version should be working if "The class is annotated with
> > > > a JPA javax.persistence.Entity annotation". Is this mean that I don't
> > > > have to have the entity class in the client?
>
> > > > Ummm, I think I just write here everything what I think is important.
> > > > I have the GWT project with the following packages:
>
> > > > org.ecommunity
> > > > org.ecommunity.client (and org.ecommunity.client.view)
> > > > org.ecommunity.server -> and here is just a service impl.:
> > > > public class ECommunityServiceImpl extends RemoteServiceServlet
> > > > implements ECommunityService  {
> > > >    @EJB
> > > >    ECommunitySB bean;
>
> > > >    @Override
> > > >    public User loginService(String username) {
> > > >        return bean.getUserByUsername(username);
> > > >    }
> > > > }
> > > > My Main.gwt.xml looks like this:
>
> > > > <module>
> > > >    <inherits name="com.google.gwt.user.User"/>
> > > >    <inherits name='com.google.gwt.user.theme.standard.Standard'/>
> > > >    <entry-point class="org.ecommunity.client.MainEntryPoint"/>
> > > >    <source path="client"/>
> > > > </module>
>
> > > > And I have an EJB Module Project with the following packages: entity
> > > > (in here is my User entity class) and a sessionbean (with my
> > > > sessionbean).
>
> > > > What is the problem? Do I miss something?
>
> > > > --
> > > > You received this message because you are subscribed to the Google
> > Groups
> > > > "Google Web Toolkit" group.
> > > > To post to this group, send email to
> > google-web-toolkit@googlegroups.com.
> > > > To unsubscribe from this group, send email to
> > > > google-web-toolkit+unsubscribe@googlegroups.com.
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/google-web-toolkit?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google Web Toolkit" group.
> > To post to this group, send email to google-web-toolkit@googlegroups.com.
> > To unsubscribe from this group, send email to
> > google-web-toolkit+unsubscribe@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/google-web-toolkit?hl=en.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.


--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment