I'm working on a custom widget that depends on an external API (
Informa ). When I try to run in Hosted mode the shell can't find any
of the classes that are in the informa jar. I tried putting the new
jar in the classpath of the eclipse launch configuration but it didn't
help.
I get a whole bunch of errors like this:
[ERROR] Errors in
'C:\projects\strickla\wush\smiledeeza\MyDeeza\trunk\src\mil\disa\dp\feedsample\rss\FeedWidget.java'
[ERROR] Line 15: The import de cannot be resolved
"de" is the top level package of the classes in the jar...the full
package of one of the classes I'm importing in FeedWidget is:
de.nava.informa.impl.basic.Item
What do I need to do in order to get the shell to have access to any
third party jars? This has to be a common thing that many people need
to do, right?
I have it compiling and running but the page is just blank...goign to
try debugging now that it'll actually load and display the module.
>From http://gwt.components.googlepages.com/, what you need to do is:
Create a new file called User.gwt.xml in com.gwt.components package.
Place the following lines in it:
<module>
<inherits name="com.google.gwt.core.Core"/>
</module>
Then add <inherits name="com.gwt.components.User"/> to your module
configuration file.
Of course, the values depend on the packages you're trying to import.
Hope this helps,
Aaron Watkins
----------------------
My Site: http://www.goannatravel.com
Am I supposed to just create an arbitrary package called
com.gwt.components in my own project?
Here's my situation as specific as I would like it to be.
I have a class that extends EntryPoint. It is
mil.disa.dp.gizmo.feedsample.FeedSample
I would like to be able to use the class FeedManager. It is from
de.nava.informa.utils
If I try to do this I get the error:
"[ERROR] Line 11: The import de cannot be resolved"
What do I have to do in order to use this third party jar in my own
EntryPoint module? Is the only way to do this by using an RPC Servlet,
creating a FeedServiceImpl, FeedService, and FeedServiceAsync and
making asynchronous calls to the FeedServiceImpl? This becomes awfully
inconvenient when I want to make simple calls like
feedManager.hasFeed(String feedURI)
before I add a new feed ( or not ). I don't want to have to wait for
asynchronous calls to come back before I make branching logic decisions
in my control logic.
If that is the case it seems awfully complicated and unnecessary when
the FeedManager has nothing to do with what is displayed on the page,
only with managing data for the display behind the scenes.
1) the source for de.nava.informa.utils is in the classpath when
running GWTShell and GWTCompiler
2) the source for de.nava.informa.utils is JRE 1.4 compatible
3) the source for de.nava.informa.utils does not use JRE classes other
than those listed in the documentation
http://code.google.com/webtoolkit/documentation/jre.html
4a) your entrypoint class is in a directory named "client" which is a
child of the module xml file's the parent directory
- or -
4b) your module xml file specifies the source directory for your
entrypoint class (I believe it must be in a descendent directory of the
module).
-= Mat
Here's something: I can simply include the import statement for the
aforementioned FeedManager, but not actually use the class at all and I
get the same error. So wouldn't that seem like it can't even find the
class to import, meaning that somehow the jar isn't on the classpath of
the GWTShell?
I'm running in eclipse and I have configured a launch target for the
GWTShell and it does include the informa.jar in the classpath so I
don't know if or why that wouldn't be working.
The GWT compiler needs you to tell it explicitly where to find source.
Try this:
Create a de/nava/informa/Utils.gwt.xml that contains this:
<module>
<inherits name="com.google.gwt.user.User"/>
<source path="utils"/>
</module>
Add this line to your main app's .gwt.xml file:
<inherits name="de.nava.informa.Utils"/>
Now the GWT compiler will "see" the other package when you go to
compile your app.
As other people have mentioned though, if you're bringing in an
existing (non-GWT) codebase, it is extremely likely that it won't just
work out of the box. But this should get you started.
Scott
Sorry for the late reply - I've been away for the weekend.
Also, sorry if my suggestion was a bit vague - it wasn't meant to be an
exact solution to your particular problem - just a description of what
needs to be done.
I won't bother clearing the air though - Scott's instructions are
better!
Aaron