This question keeps coming up - maybe it should go on the FAQ for GWT.  With
like giant flashing arrows pointing to what you have to keep in mind when
developing GWT.

GWT is a client-side library (with some syntactic sugar for communicating
with a server backend more easily).  Although you write Java, it's
javascript.  That should explain to you why GWT won't compile your code -
because those classes aren't on the classpath & they're not modules (and you
really can't include them because it's highly likely they use stuff
Javascript doesn't support).

Here's my recommendation.  Create a POJO wrapper you use on the server that
implements those methods.  When you communicate between the client & server,
you pass the raw POJO, but the server always wraps the POJO in a richer
class that has the more advanced functionality you need.

On Mon, Mar 16, 2009 at 7:21 PM, Ian Petersen <[email protected]> wrote:

>
> On Mon, Mar 16, 2009 at 4:07 PM, Anti <[email protected]> wrote:
> > I just created hibernate POJOs for three new tables using weblogic
> > workshop, all these 3 classes have this:
> >
> > import org.apache.commons.lang.builder.EqualsBuilder;
> > import org.apache.commons.lang.builder.HashCodeBuilder;
> > import org.apache.commons.lang.builder.ToStringBuilder;
> >
> >
> > That makes my build to fail (it wasn´t failing before this change):
> >
> >     [java]    [ERROR] Errors in 'file:/C:/CAPWL/src/org/eagle/cap/
> > common/pojo/CapChecksheetItemsLu.java'
> >     [java]       [ERROR] Line 84: No source code is available for
> > type org.apache.commons.lang.builder.EqualsBuilder; did you forget to
> > inherit a required module?
> >     [java]       [ERROR] Line 90: No source code is available for
> > type org.apache.commons.lang.builder.HashCodeBuilder; did you forget
> > to inherit a required module?
> >     [java]       [ERROR] Line 96: No source code is available for
> > type org.apache.commons.lang.builder.ToStringBuilder; did you forget
> > to inherit a required module?
> >
> >
> > The section of build.xml where the error happens is:
> >
> >        <target name="gwtbuildcap">
> >                <java classname="com.google.gwt.dev.GWTCompiler" dir="."
> > description="Generate static GWT files for the CAP module" fork="true"
> > failonerror="true" maxmemory="512m">
> >                        <classpath>
> >                                <path refid="gwt.classpath" />
> >                        </classpath>
> >                        <arg value="-out" />
> >                        <arg value="WebContent" />
> >                        <arg line="-style OBFUSCATE"/>
> >                        <arg value="${gwt.entry.point.CapMain}" />
> >                </java>
> >        </target>
> >
> > So it seems that those imports (necessary for the equal method so I can
> > ´t jus remove them) are spoiling the whole thing...comments and help
> > are highly appreciated.
>
> You have two choices: port
> org.apache.commons.lang.builder.EqualsBuilder,
> org.apache.commons.lang.builder.HashCodeBuilder, and
> org.apache.commons.lang.builder.ToStringBuilder to GWT or stop using
> them.  I'd recommend the second choice (not using them).
>
> Ian
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to