I think the 2 of us are answering different questions.  I believe the
problem he is having is that the GWT compiler is not allowing him to
use objects from a previous Java project he had done(I am assuming it
has some algorithms or POJOs that he doesn't want to replicate).  The
GWT compiler won't allow you to reference these objects even if they
are in the classpath because they are not part of an included module.
Your responses assume his problem is a classpath problem, but eclipse
would be yelling at you for that one, not just the compiler.  Also,
Lucas I forgot to mention, my approach will still not work if the
source(*.java) files are not in your classpath as the GWT compiler
requires the uncompiled source.

On Mar 30, 9:33 pm, Neil <neiltol...@gmail.com> wrote:
> In our projects, we just use our source code path directly.
>
> When launching the project in DevMode from within Eclipse, the launch
> config's classpath contains both the "default classpath" plus the /src
> directory.
>
> When compiling the project in Ant, we reference the source path
> directly in the gwt Compiler call:
>       <java classname="com.google.gwt.dev.Compiler" fork="true"
> maxmemory="512M" failonerror="true" >
>          <arg line="-war ${temp.war}" />
>          <arg value="com.x.ModuleName" />
>          <classpath>
>             <path location="src" />
>             <path location="${temp.classes}"/>
>          </classpath>
>       </java>
>
> Basically, the GWT Compiler needs both the compiled code and the
> source code to successfully compile the module.
>
> Hope that helps.
>
> Neil Olsonhttp://www.intertech.com/blog
>
> On Mar 30, 8:23 pm, lineman78 <linema...@gmail.com> wrote:
>
> > You cannot use source code from a java project in GWT directly.  All
> > GWT code must be in the client path of a module.  i.e.
> > sura.ticketcheck.bo.Instancia is not part of a GWT module.  There is
> > one workaround I have gotten to work(only once, so no guarantee).
>
> > 1) Create a file BoModule.gwt.xml in your source folder under the
> > following path: sura/ticketcheck
> > 2) Put the following text into the file:
> >     <?xml version="1.0" encoding="UTF-8"?>
> >     <!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit
> > 2.0.3//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.0.3/
> > distro-source/core/src/gwt-module.dtd">
> >     <module>
> >         <inherits name="com.google.gwt.user.User" />
> >         <source path="bo" />
> >     </module>
> > 3) In your src/ticketcheckGWT/xxx.gwt.xml put <inherits
> > name="sura.ticketcheck.BoModule"/>
>
> > Essentially what you are doing is tricking the GWT compiler into
> > thinking that sura.ticketcheck has a module who's source is in the
> > folder 'bo'.  This should work as long as all files within package
> > sura.ticketcheck.bo don't import outside of that package except
> > standard java objects that are available through the
> > com.google.gwt.user.User module.  I have run into this several times
> > and sometimes you just have to rewrite(copy and paste) stuff into a
> > GWT project.
>
> > On Mar 30, 1:25 pm, Lucas Rios <lucasri...@gmail.com> wrote:
>
> > > Hi everybody
>
> > > I'm trying to use a Java project in GWT but I have had some problems 
> > > because
> > > I can't compile the GWT project.
>
> > > I have done this:
>
> > > 1.Make a xxx.gwt.xml in the java project.
> > > 2. Add a external JAR (java project) in the java build path of the GWT
> > > project. In Projects and libraries tabs.
> > > 3. Reference a xxx.gwt.xml in GWT projects (gwt.xml)
> > > 4. And last compile the GWT project... showing me those errors
>
> > > Compiling module ticketcheckGWT.Ticketcheck_GWT
> > >    Validating newly compiled units
> > >       [ERROR] Errors in
> > > 'file:/D:/Sura_desarrollo/Ticketcheck%20GWT/src/ticketcheckGWT/client/Ticketcheck_GWT.java'
> > >          [ERROR] Line 488: No source code is available for type
> > > sura.ticketcheck.bo.Instancia; did you forget to inherit a required 
> > > module?
> > >       [ERROR] Errors in
> > > 'file:/D:/Sura_desarrollo/Ticketcheck%20GWT/src/ticketcheckGWT/client/ServiciosTicketcheck.java'
> > >          [ERROR] Line 13: No source code is available for type
> > > sura.ticketcheck.bo.Instancia; did you forget to inherit a required 
> > > module?
> > >       [ERROR] Errors in
> > > 'file:/D:/Sura_desarrollo/Ticketcheck%20GWT/src/ticketcheckGWT/client/ServiciosTicketcheckAsync.java'
> > >          [ERROR] Line 12: No source code is available for type
> > > sura.ticketcheck.bo.Instancia; did you forget to inherit a required 
> > > module?
> > >       [ERROR] Errors in
> > > 'jar:file:/D:/Lucas%20Ríos/GWT/gwanted/gwanted-core.jar!/org/gwanted/gwt/core/client/logger/TimeLoggerImpl.java'
> > >          [ERROR] Line 92: Parameter 'widgetLoadTime': type 'long' is not
> > > safe to access in JSNI code
> > >          For additional info see:
> > > file:/D:/Escritorio/eclipse-jee-galileo-win32/eclipse/plugins/com.google.gwt.eclipse.sdkbundle.2.0.1_2.0.1.v201002021445/gwt-2.0.1/doc/helpInfo/longJsniRestriction.html
> > >    Finding entry point classes
> > >       [ERROR] Unable to find type 'ticketcheckGWT.client.Ticketcheck_GWT'
> > >          [ERROR] Hint: Previous compiler errors may have made this type
> > > unavailable
> > >          [ERROR] Hint: Check the inheritance chain from your module; it 
> > > may
> > > not be inheriting a required module or a module may not be adding its 
> > > source
> > > path entries properly
>
> > > If somebody know how I can solve it.... please help me
>
> > > Thank for all
>
> > > Regards
>
> > > LucasRR

-- 
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-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to