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 Olson
http://www.intertech.com/blog
On Mar 30, 8:23 pm, lineman78 <[email protected]> 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 <[email protected]> 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 [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.