How to use Forign Java Project Classes in GWT Project

5 views
Skip to first unread message

Pints

unread,
Aug 2, 2007, 1:49:33 AM8/2/07
to Google Web Toolkit
Hi all,

I have a project with 3-4 java projects
com.my.company.persistence
com.my.company.management
com.my.company.util

and 1 GWT project with xyz.gwt.xml

com.my.company.uisrc


Now one of my foreign java project has Hibernate POJO which i want to
use in GWT RPC. I tried using <source> in xyz.gwt.xml which allowed me
to use those java files which were in same GWT project may be in
different package.

But i want to use the classes at client side from different Java
Project i tried giving the entry like

<module>

<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User'/>

<!-- Specify the app entry point class. -->
<entry-point class='com.dexterra.ui.client.PortalApplication'/>

<source path="com.my.company.persistence"/>

<servlet class="com.dexterra.ui.server.PortalManagerImpl"
path="/PortalManager"/>
</module>

Any help would be appreciated.

Thanks a ton

Pints

unread,
Aug 2, 2007, 2:11:24 AM8/2/07
to Google Web Toolkit
A thought ....do i have to create a <something>.gwt.xml in all my java
projects then use them in my GWT project in a traditional way...

i am simply confused with so many thoughts coming in my mind. :-) and
doing RnD

HELP PLEASE!

mP

unread,
Aug 2, 2007, 4:37:58 AM8/2/07
to Google Web Toolkit
LIke all java code you need to add the *.jar file to your classpath.
Your application's gwt.xml needs an inherit statement that includes
the module name of the included jar.

Pints

unread,
Aug 2, 2007, 5:49:56 AM8/2/07
to Google Web Toolkit
As i understand say my normal java project jar is persistence.jar
which will be in the classpath.

> Your application's gwt.xml needs an inherit statement that includes
> the module name of the included jar.

Now since i have to inherit that in my GWT module that means my
persistence project should also contain some persistence.gwt.xml. If
yes then don't we have any other option because my persistence project
is already existing one for other purposes and i want to avoid doint
any GWT stuff in that.

Please confirm.

thanks.

> > > Thanks a ton- Hide quoted text -
>
> - Show quoted text -

Pints

unread,
Aug 2, 2007, 12:39:22 PM8/2/07
to Google Web Toolkit
Please confirm included jar will be encapsulating only java files or i
have to create and include some gwt.xml also in that... i tried doing
but it gives Module (parent one) cannot be loaded.

If the included java project whose class i want to use will have to
have some gwt.xml then what contents will it have....will it be empty?

<module>

</module>


In my ParentApp.gwt.xml which is the mai GWT module i gave

<module>

<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User'/>

<inherits name='com.mycompany.persistence.MyClass'/>

<!-- Specify the app entry point class. -->

<entry-point class='com.mycompany.ui.client.PortalApplication'/>
<servlet class="com.mycompany.ui.server.PortalManagerImpl" path="/
PortalManager"/>
</module>


MyClass is in 'com.mycompany.persistence' it can be simple class or
shud implement serializable at any cost. Tried both. Then placed my
persistence.jar in build path of eclipse and the classpath of launch.

I am not using Myapp.shell.cmd.

thanks in advance for help


On Aug 2, 1:37 pm, mP <miroslav.poko...@gmail.com> wrote:

Reply all
Reply to author
Forward
0 new messages