Eclipse plugin: Run As -> Web Application

15 views
Skip to first unread message

pgraham

unread,
Aug 5, 2009, 10:54:33 AM8/5/09
to Google Web Toolkit
Hi all,

I'm having some problems running my gwt projects in hosted mode using
the Run As -> Web Application option from within eclipse.

For starters, I'm running eclipse 3.5 with the maven plugin as well as
the google plugin.

The first problem I have is the following exception:

Exception in thread "main" java.lang.UnsatisfiedLinkError: Can't load
library: $M2_REPO/com/google/gwt/gwt-dev-linux/1.7.0/libswt-pi-
gtk-3235.so
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1650)
at java.lang.Runtime.load0(Runtime.java:769)
at java.lang.System.load(System.java:968)
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:132)
at org.eclipse.swt.internal.Callback.<clinit>(Callback.java:36)
at org.eclipse.swt.widgets.Display.createDisplay(Display.java:807)
at org.eclipse.swt.widgets.Display.create(Display.java:781)
at org.eclipse.swt.graphics.Device.<init>(Device.java:145)
at org.eclipse.swt.widgets.Display.<init>(Display.java:452)
at org.eclipse.swt.widgets.Display.<init>(Display.java:443)
at org.eclipse.swt.widgets.Display.getDefault(Display.java:1522)
at com.google.gwt.dev.SwtHostedModeBase.<init>(SwtHostedModeBase.java:
93)
at com.google.gwt.dev.HostedMode.<init>(HostedMode.java:271)
at com.google.gwt.dev.HostedMode.main(HostedMode.java:230)

* The actual error message has the full path to the file instead of
$M2_REPO but changing the path to the repository in my maven
settings.xml file changes the path of the error message.

I can fix this problem by putting the file it can't find from a gwt
download to the path it's looking for, but I don't understand why it's
even looking for the file there in the first place since it's part of
the gwt sdk that I have configured for my project.

NOTE: Once I put the libswt-pi-gtk-3235.so file where it's being
looked for, I also have to do the same thing with mozilla-hosted-
browswer.conf, mozilla-1.7.12 (directory), libswt-gtk-3235.so, libswt-
mozilla-gtk-3235.so and libgwt-ll.so

Any help on this would be appreciated,
Thanks

Philip

Keith Platfoot

unread,
Aug 5, 2009, 1:26:11 PM8/5/09
to Google-We...@googlegroups.com
Hi Philip,

The Google Eclipse Plugin is not entirely compatible with Maven, so I suspect the interaction between the two plugins may be the source of your troubles.  Is it possible to create another GWT project which does not use the Maven plugin, and see if you run into similar problems?  Let me know what you find.

Keith

Philip Graham

unread,
Aug 5, 2009, 3:34:50 PM8/5/09
to Google-We...@googlegroups.com
Hi Keith,

I've copied one of my projects and stripped it down to the bare
minimum, removed it's pom file, imported it as a normal Java project
and set it up to use GWT. When I try and run I get a similar error:

Exception in thread "main" java.lang.UnsatisfiedLinkError: Can't load
library: $PROJECT_HOME/war/WEB-INF/lib/libswt-pi-gtk-3235.so
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1650)
at java.lang.Runtime.load0(Runtime.java:769)
at java.lang.System.load(System.java:968)
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:132)
at org.eclipse.swt.internal.gtk.OS.<clinit>(OS.java:22)
at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:63)
at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:54)
at org.eclipse.swt.widgets.Display.<clinit>(Display.java:126)
at com.google.gwt.dev.SwtHostedModeBase.<clinit>(SwtHostedModeBase.java:82)
(*$PROJECT_HOME displays as the actual path to where the project is on
my filesystem)

If I copy the files I described in my original message into
$PROJECT_HOME/war/WEB-INF/lib/ then it runs ok.

This is not a huge deal since I can get things running but I
appreciate any help you can give as it is a little bit annoying.

Thanks,
Philip

Keith Platfoot

unread,
Aug 6, 2009, 1:50:43 PM8/6/09
to Google-We...@googlegroups.com
Hi Philip,

Hm, ok.  I'm not sure, but it's possible that your project may have some classpath configuration issues that are causing this.  Would you be able to send me your .classpath file (located in the project's root directory)?  I can take a look and see if anything appears problematic.  Alternatively, if you like you could actually send the entire project and I can try to see if I can reproduce the error here.

Keith

Philip Graham

unread,
Sep 30, 2009, 11:35:35 AM9/30/09
to Google-We...@googlegroups.com
Hi Keith,

I know it's been a while but I just got it working by manually placing
the required files in the repository. I've recently discovered a
slightly better solution that I thought I'd share.

1. Edit runtime configuration and click on the classpath path
2. Click 'Bootstrap entries' then 'Advanced...'
3. Choose 'Add library' and click 'OK'
4. Choose 'Google Web Toolkit' and click 'Next'
5. Choose 'Use default SDK (GWT - 1.x.x) and click 'Finish'

This gets me past the error I was having :)

Unfortunately I'm not finished there as I am now receiving errors with
regards to slf4j. I can get past these errors by manually adding the
appropriate jars to the classpath, however these jars are already part
of my maven dependencies. So I tried to do something similar to what
I described above:

Step 1 - 3 are the same
4. Choose 'Maven Managed Dependencies' and click 'Next'

This is where I run into a problem. This brings me a screen with the
following text:

Use _Maven Project Settings_ to configure Maven dependency resolution.

'Maven project setting' looks like a link but clicking it does nothing.

I know this is probably not a problem that you can help with but I was
wondering if maybe you could point me in the right direction.

Cheers,
Philip
Reply all
Reply to author
Forward
0 new messages