SWT seems to think I'm running on Linux and not a Mac ???

46 views
Skip to first unread message

Rob Tanner

unread,
Apr 22, 2009, 3:06:25 PM4/22/09
to Google Web Toolkit
Hi,

I've been going back and forth with Instantiations tech support over
their GET Designer Eclipse plugin. When I try and execute a GWT
application in Eclipse that I built with the Designer, I get an
Exception immediately. The error is: Exception in thread "main"
java.lang.UnsatisfiedLinkError: no swt-pi-gtk-3062 in
java.library.path.

Instantiation's support says that for some reason, GWT's SWT really
does think I'm running on Linux.

I'm using gwt-mac-1.5.3 (the Designer on the Mac doesn't yet support
1.6.4 according to Instantiation support) and I also have the current
Google plugin from Google's Eclipse update site installed. My system
is a MacBook Pro with 10.5.6 installed. Does this problem at all
sound familiar?

Thanks,
Rob

Jeff Chimene

unread,
Apr 22, 2009, 4:00:48 PM4/22/09
to Google-We...@googlegroups.com

I'll stake a stab at this, maybe we can isolate the problem...

o Is this your first project w/ GWT in this environment?
If so, please try establishing a baseline by installing and running
the StockWatcher example

o Is SWT the Standard Widget Toolkit?
The sentence "GWT's SWT really does think I'm running on Linux"
implies ownership of SWT by GWT. Isn't SWT a separate library?

Rob Tanner

unread,
Apr 22, 2009, 7:15:27 PM4/22/09
to Google Web Toolkit
Yes. This is my first project.

I went through the first step of of the project: Creating a GWT
application. When I created it, a message popped up in the Eclipse
console:

Encountered a problem: Unexpected exception
Please see the logs [/tmp/enhance40780.log] for further information.

The contents of the log file:

java.lang.RuntimeException: Unexpected exception
at com.google.appengine.tools.enhancer.Enhancer.execute
(Enhancer.java:59)
at com.google.appengine.tools.enhancer.Enhance.<init>
(Enhance.java:60)
at com.google.appengine.tools.enhancer.Enhance.main
(Enhance.java:41)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.google.appengine.tools.enhancer.Enhancer.execute
(Enhancer.java:57)
... 2 more
Caused by: javax.xml.parsers.FactoryConfigurationError: Provider
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl not found
at javax.xml.parsers.DocumentBuilderFactory.newInstance
(DocumentBuilderFactory.java:104)
at org.datanucleus.plugin.PluginParser.parsePluginElements
(PluginParser.java:257)
at
org.datanucleus.plugin.NonManagedPluginRegistry.registerExtensions
(NonManagedPluginRegistry.java:233)
at
org.datanucleus.plugin.NonManagedPluginRegistry.registerExtensionPoints
(NonManagedPluginRegistry.java:159)
at org.datanucleus.plugin.PluginManager.registerExtensionPoints
(PluginManager.java:82)
at org.datanucleus.OMFContext.<init>(OMFContext.java:164)
at org.datanucleus.enhancer.DataNucleusEnhancer.<init>
(DataNucleusEnhancer.java:153)
at org.datanucleus.enhancer.DataNucleusEnhancer.main
(DataNucleusEnhancer.java:1138)
... 7 more


Step 2, Testing the default project components, resulted in nothing
being displayed (although the Eclipse console flickered). Assuming
that something got logged about the problem somewhere, do you know
where that somewhere would be?

With regard to SWT, I believe that's exactly correct. There are 4
jnilibs in the toolkit with swt in their name and I presume they
implement at least part of the Software Widget Toolkit. They are
clearly carbon and not gtk which makes sense because I'm running on a
Mac, not Linux. But the error I get using the GWT Designer is no swt-
pi-gtk-3062 in java.library.path. Also, I don't believe the Designer
even looks at the GWT Eclipse plugin. The one must-be-set preference
in the Designer configuration is where in the file system to find the
toolkit.

Message has been deleted

Jeff Chimene

unread,
Apr 22, 2009, 8:35:57 PM4/22/09
to Google-We...@googlegroups.com

Sorry, my previous post (deleted) referenced GWT 1.6

Nevertheless, please set Eclipse aside for the moment and try compiling
any of the samples/

For example, inside the samples/DynaTable/ you should find the
DynaTable-compile and DynaTable-shell scripts. Please try one of the
samples/* *-compile or the *-shell scripts.


> The contents of the log file:
>
> java.lang.RuntimeException: Unexpected exception
> at com.google.appengine.tools.enhancer.Enhancer.execute
>
>

<SNIP>

I have to admit that I don't understand the log. But, it reinforces my
desire to verify the integrity of your GWT installation.

> Step 2, Testing the default project components, resulted in nothing
> being displayed (although the Eclipse console flickered). Assuming
> that something got logged about the problem somewhere, do you know
> where that somewhere would be?
>
> With regard to SWT, I believe that's exactly correct. There are 4
> jnilibs in the toolkit with swt in their name and I presume they
> implement at least part of the Software Widget Toolkit. They are
> clearly carbon and not gtk which makes sense because I'm running on a
> Mac, not Linux. But the error I get using the GWT Designer is no swt-
> pi-gtk-3062 in java.library.path. Also, I don't believe the Designer
> even looks at the GWT Eclipse plugin. The one must-be-set preference
> in the Designer configuration is where in the file system to find the
> toolkit.
>
>

That is a problem. For example, a listing of my 1.5.3 directory shows:
/usr/local/lib/gwt-linux-1.5.3$ ls libswt* -c1
libswt-gtk-3235.so
libswt-mozilla17-profile-gcc3-gtk-3235.so
libswt-mozilla17-profile-gtk-3235.so
libswt-mozilla-gcc3-gtk-3235.so
libswt-mozilla-gtk-3235.so
libswt-pi-gtk-3235.so

So, I can see where Tech Support draws their conclusion. Can you check
the corresponding GWT directory on your installation?


Salvador Diaz

unread,
Apr 23, 2009, 4:13:57 AM4/23/09
to Google Web Toolkit
That stack trace is related to the app engine sdk, are you sure you
want to use it ?

To further explain the problem: I've seen the same exception in a post
a couple of days ago here, the poster eventually found out that he
needed a xerces jar in his classpath and that solved the issue (look
at the cause of the exception at the bottom of the snippet below)

Hope it helps,

Salvador

Rob Tanner

unread,
Apr 23, 2009, 1:25:02 PM4/23/09
to Google Web Toolkit
Just for grins, I decided to try building StockWatcher from the
command line (or did you suggest that -- I don't remember). And guess
what, the output of ant build was:

Buildfile: build.xml

libs:

javac:
[mkdir] Created dir: /Users/rtanner/Java/StockWatcher/StockWatcher/
war/WEB-INF/classes
[javac] Compiling 4 source files to /Users/rtanner/Java/
StockWatcher/StockWatcher/war/WEB-INF/classes
[copy] Copying 1 file to /Users/rtanner/Java/StockWatcher/
StockWatcher/war/WEB-INF/classes

hosted:
[java] Exception in thread "main" java.lang.UnsatisfiedLinkError:
no swt-pi-gtk-3062 in java.library.path
[java] at java.lang.ClassLoader.loadLibrary(ClassLoader.java:
1753)
[java] at java.lang.Runtime.loadLibrary0(Runtime.java:822)
[java] at java.lang.System.loadLibrary(System.java:993)
[java] at org.eclipse.swt.internal.Library.loadLibrary
(Library.java:100)
[java] at org.eclipse.swt.internal.gtk.OS.<clinit>(OS.java:
19)
[java] at org.eclipse.swt.internal.Converter.wcsToMbcs
(Converter.java:63)
[java] at org.eclipse.swt.internal.Converter.wcsToMbcs
(Converter.java:54)
[java] at org.eclipse.swt.widgets.Display.<clinit>
(Display.java:118)
[java] at com.google.gwt.dev.SwtHostedModeBase.<clinit>
(SwtHostedModeBase.java:82)

BUILD FAILED
/Users/rtanner/Java/StockWatcher/StockWatcher/build.xml:48: Java
returned: 1

Total time: 3 seconds

I got the same stack trace when I tried to build the DynaTable example
with ant hosted.

The other thing you asked was about the SWT libs. The gwt-mac-1.6.4
distro has:

libswt-agl-carbon-3235.jnilib
libswt-carbon-3235.jnilib
libswt-pi-carbon-3235.jnilib
libswt-webkit-carbon-3235.jnilib

None are .so shared objects and they are carbon, not gtk.

I am more and more convinced that Instantiations is right when they
say that the toolkit things it's running on Linux because the gtk
libraries are for use with Linux and not on the Mac. Do you know if
there is a URL or email address to report a bug? I don't find one on
the GWT homepage.

Thanks,
Rob

Rob Tanner

unread,
Apr 23, 2009, 1:27:29 PM4/23/09
to Google Web Toolkit
No reason to use the app engine sdk one way or the other. What I'm
really trying to figure out is why GWT for Macs appears to be trying
to use Linux GTK libraries instead of Mac Carbon libraries.

-- Rob

Rajeev Dayal

unread,
Apr 23, 2009, 1:36:23 PM4/23/09
to Google-We...@googlegroups.com
What version of the JDK are you using on your Mac? Are you using Java 1.6 or Java 1.5?

Rob Tanner

unread,
Apr 23, 2009, 2:02:39 PM4/23/09
to Google Web Toolkit


On Apr 23, 10:36 am, Rajeev Dayal <rda...@google.com> wrote:
> What version of the JDK are you using on your Mac? Are you using Java 1.6 or
> Java 1.5?
>
I'm defaulted to 1.5 and I presume all I need to do is change the Home
pointer to switch to 1.6 if that's the actual problem.

Rob Tanner

unread,
Apr 23, 2009, 2:25:10 PM4/23/09
to Google Web Toolkit


On Apr 23, 10:36 am, Rajeev Dayal <rda...@google.com> wrote:
> What version of the JDK are you using on your Mac? Are you using Java 1.6 or
> Java 1.5?
>
Actually, switching to 1.6 is simply a prefrence so I tried it. ant
hosted still fails with the same error.

Rajeev Dayal

unread,
Apr 23, 2009, 4:33:00 PM4/23/09
to Google-We...@googlegroups.com
If you're on a Mac and you're using GWT, you must use JDK 1.5. To make sure that ant is actually using your 1.5 JDK, can you set the JAVA_HOME environment variable to point to the 1.5 JDK, and try re-running ant hosted?

Rob Tanner

unread,
Apr 23, 2009, 4:55:50 PM4/23/09
to Google Web Toolkit


On Apr 23, 1:33 pm, Rajeev Dayal <rda...@google.com> wrote:
> If you're on a Mac and you're using GWT, you must use JDK 1.5. To make sure
> that ant is actually using your 1.5 JDK, can you set the JAVA_HOME
> environment variable to point to the 1.5 JDK, and try re-running ant hosted?
>
Through varios symlinks, I was already using 1.5. But just to be
sure, I took your suggestion and set JAVA_HOME to /System/Library/
Frameworks/JavaVM.framework/Versions/1.5.0/Home. Alas, same error.
The question in my mind is why does ant hosted complain about not
being able find swt-pi-gtk-3062 since this is a Mac and it doesn't use
gtk. Shouldn't it be looking for a carbon library. And yes, I'm
using gwt-mac-1.6.4.

-- Rob

Jeff Chimene

unread,
Apr 23, 2009, 5:46:39 PM4/23/09
to Google-We...@googlegroups.com

So, how did we get to build.xml (a GWT 1.6 artifact)?

It's good that we've eliminated Eclipse, GWT Eclipse Plugin, Instantiations.

Are you running 1.5 or 1.6 (or both)? I'm wondering if you installed
Linux GWT when you installed the GWT Eclipse plugin.

Jason Essington

unread,
Apr 23, 2009, 5:47:19 PM4/23/09
to Google-We...@googlegroups.com
It seems to me that somewhere along the way you managed to get a linux version of GWT into your classpath. how did you install your plugins? did you somehow manage to get a linux version rather than an OS X version? 

-jason

On Apr 23, 2009, at 2:55 PM, Rob Tanner wrote:

On Apr 23, 1:33 pm, Rajeev Dayal <rda...@google.com> wrote:
If you're on a Mac and you're using GWT, you must use JDK 1.5. To make sure
that ant is actually using your 1.5 JDK, can you set the JAVA_HOME
environment variable to point to the 1.5 JDK, and try re-running ant hosted?

Rob Tanner

unread,
Apr 23, 2009, 7:09:23 PM4/23/09
to Google Web Toolkit
I originally downloaded and unzipped gwt-mac-1.6.4 and only later
found out that GWT Designer can't work with it, and so I downloaded
and unzipped gwt-mac-1.5.3. As far as the GWT Eclipse plugin, that's
an entity unto itself and I don't know what GWT it installed within
the bowels of Eclipse. In the preferences, I set the GWT home (I'm
presuming that preference is for the plugin) to the gwt-mac-1.5.3
directory. I have at no time intentionally downloaded a linux version
unless, of course, it was bundled with something and I was unaware of
it.

Can you give me the name of a specific file that might be in the Linux
distro and I can do a find to see if I can find it.

-- Rob

Jeff Chimene

unread,
Apr 23, 2009, 7:25:52 PM4/23/09
to Google-We...@googlegroups.com
Google distributes 1.6 with the GEP.


> Can you give me the name of a specific file that might be in the Linux
> distro and I can do a find to see if I can find it.
>

The GWT libraries &c are in the eclipse/plugins directory.

Look for (and I shouldn't have been in such a hurry to delete the 1.6
post as it had the full Linux path) something along the lines of

/usr/local/bin/eclipse/plugins/com.google.gwt.eclipse.sdkbundle.linux_1.6.4.v200904062334

$ ls
/usr/local/bin/eclipse/plugins/com.google.gwt.eclipse.sdkbundle.linux_1.6.4.v200904062334/gwt-linux-1.6.4
-c1
webAppCreator
samples
mozilla-1.7.12
mozilla-hosted-browser.conf
release_notes.html
gwt-user.jar
i18nCreator
index.html
junitCreator
libgwt-ll.so
libswt-gtk-3235.so
libswt-mozilla17-profile-gcc3-gtk-3235.so
libswt-mozilla17-profile-gtk-3235.so
libswt-mozilla-gcc3-gtk-3235.so
libswt-mozilla-gtk-3235.so
libswt-pi-gtk-3235.so
gwt-dev-linux.jar
gwt-module.dtd
gwt-servlet.jar
gwt-api-checker.jar
gwt-benchmark-viewer.war
about.html
about.txt
benchmarkViewer
COPYING
COPYING.html
doc

> -- Rob
>
> >
>

Rob Tanner

unread,
Apr 23, 2009, 7:57:41 PM4/23/09
to Google Web Toolkit
Ran the following commands and got the following results:

cd /
find . -name "com.google.gwt.eclipse*"
./Library/Genuitec/Common/features/
com.google.gwt.eclipse.sdkbundle.e34.feature_1.6.4.v200904062334
./Library/Genuitec/Common/plugins/
com.google.gwt.eclipse.core_1.0.0.v200904062334.jar
./Library/Genuitec/Common/plugins/
com.google.gwt.eclipse.sdkbundle.macosx_1.6.4.v200904062334
find . -name "libswt-pi-gtk*"
<nothing returned>

This does not make sense.

Jeff Chimene

unread,
Apr 23, 2009, 9:11:25 PM4/23/09
to Google-We...@googlegroups.com
>> The GWT libraries&c are in the eclipse/plugins directory.
No, it does make sense. Remember that the original error is that the
Linux SWT library isn't found. I'd expect the null set above.

It seems that GWT 1.6 is there by virtue of Genuitec's MyEclipse.

It also seems that you have the GEP.

Please search for "gwt-user.jar" The search above only looked for
Eclipse-specific stuff. It's possible that there's another GWT 1.6
installation lurking.

At this point I'm torn between removing MyEclipse or removing just the
GWT and GEP. Do you understand enough about Eclipse to install/remove
plugins? If not, I'd nuke MyEclipse.

My advice is to get to a working GWT 1.6 that's independent of
MyEclipse. See http://code.google.com/webtoolkit/versions.html

You don't need MyEclipse's bundled version of GWT that comes with the GEP.

Once you've verified that there are no other unexpected GWT
installations, and either installed a standalone version of GWT1.6 or
verified that MyEclipse is correct and complete, prove the installation
by building the samples,

I want to see a successful build of the samples. This will bolster your
confidence and prepare you for the MyEclipse/Instantions debugging.

I know this bites the big one, but there's too much stuff all at once.

Rob Tanner

unread,
Apr 24, 2009, 12:05:57 AM4/24/09
to Google Web Toolkit
> MyEclipse. Seehttp://code.google.com/webtoolkit/versions.html
>
> You don't need MyEclipse's bundled version of GWT that comes with the GEP.
>
> Once you've verified that there are no other unexpected GWT
> installations, and either installed a standalone version of GWT1.6 or
> verified that MyEclipse is correct and complete, prove the installation
> by building the samples,
>
> I want to see a successful build of the samples. This will bolster your
> confidence and prepare you for the MyEclipse/Instantions debugging.
>
> I know this bites the big one, but there's too much stuff all at once.

As far as the origin of the GWT 1.6, you're right and your wrong. I
did download and unzip both a 1.6.4 and then 1.5.3 when I found out
that GWT Designer for the Mac doesn't yet support 1.6.4. But when I
did a global find for gt-user.jar as you suggested, there is another
complete kit in the Eclipse plugins directory.

I removed the plugin but that apparently does not result in actually
deleting the files. At this point can I simply remove the directory
com.google.gwt.eclipse.sdkbundle.macosx_1.6.4.v200904062334 and
everything beneath it without causing a problem in Eclipse? That
would leave me with only a single 1.6.4 and a 1.5.3, which are the two
I specifically downloaded from the Google site (http://code.google.com/
webtoolkit/versions.html). But I don't want to delete the file
structure until I know whether Eclipse still knows about it at some
level and if so, how to fix that.

Thanks,
Rob

Jeff Chimene

unread,
Apr 24, 2009, 11:37:33 AM4/24/09
to Google-We...@googlegroups.com

When you download "raw" 1.6 or 1.5, they have nothing to do with
eclipse. So, I'm somewhat confused, and we may be getting closer to
resolving the problem. Did you download those files from
http://code.google.com/webtoolkit/versions.html? If not, please
remove/rename (see the note below) in the eclipse directory. Then
install GWT 1.5 from the webtoolkit site. This should put GWT 1.5 into
some directory like "/usr/local/lib" (or however you manage your
system). It should have absolutely nothing to do with eclipse. You can
tell instantiations to refer to a non-eclipse path for the GWT library
location.

I don't know instantiations. If it provides a work-alike for GEP,
remove GEP (since we prefer instatiations over GEP if instantiations
is a super-set of GEP).

To use instantiations, you should remove all traces of GWT 1.6. I say
this knowing full well that it's possible to point instantiations at
GWT1.5. However, to get things up-and-running, you should start with a
clean slate, in an environment that will move you to using
instantiations with as few distractions as possible.

>
> I removed the plugin but that apparently does not result in actually
> deleting the files.  At this point can I simply remove the directory
> com.google.gwt.eclipse.sdkbundle.macosx_1.6.4.v200904062334 and
> everything beneath it without causing a problem in Eclipse?  That
> would leave me with only a single 1.6.4 and a 1.5.3, which are the two
> I specifically downloaded from the Google site (http://code.google.com/
> webtoolkit/versions.html).  But I don't want to delete the file
> structure until I know whether Eclipse still knows about it at some
> level and if so, how to fix that.

I don't know what eclipse will do. I think some of it depends on how
you installed eclipse, and since you're on OSX, that's unfamiliar
territory for me. On my box, I upgrade/install as root, and work in
eclipse in a regular user account.

I also know that eclipse records information in a user-private directory.

All that being said: when I encounter problems like this (esp. w/
eclipse which is such a pita to configure) I rename the offending
directory. This rename effectively deletes the file, but leaves it
available to recover when eclipse goes belly-up. E.g. rename it to
"com.google.gwt.eclipse.sdkbundle.macosx_1.6.4.v200904062334.delete.me"

I still think that because of the reliance on instantions, you should
forget about GWT 1.6 for now. See the above comment. Concentrate on
getting a successful build of the 1.5 samples in a pristine
environment. Leaving 1.6 out there means an additional step of
verifying that installation.

Rob Tanner

unread,
Apr 24, 2009, 5:42:17 PM4/24/09
to Google Web Toolkit


On Apr 24, 8:37 am, Jeff Chimene <jchim...@gmail.com> wrote:
> resolving the problem. Did you download those files fromhttp://code.google.com/webtoolkit/versions.html?If not, please
Jeff,

Thanks for all your help and suggestions. Renaming the directory
worked fine and Eclipse came right up and I also removed the gwt-
mac-1.6.4 directory. The amples that come with gwt-mac-1.5.3 don't
include a build.xml file for ant. Instead you run the included shell
script. Still had the same problem. Here's the stack trace again and
my first clue:

Exception in thread "main" java.lang.UnsatisfiedLinkError: no swt-pi-
gtk-3062 in
java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1753)
at java.lang.Runtime.loadLibrary0(Runtime.java:822)
at java.lang.System.loadLibrary(System.java:993)
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:
100)
at org.eclipse.swt.internal.gtk.OS.<clinit>(OS.java:19)
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:118)
at com.google.gwt.dev.GWTShell.<clinit>(GWTShell.java:301)

Where did those org.eclipse.swt.... calls come from. Eclipse was
totally out of the picture. I unset the CLASSPATH and that didn't
solve it. Finally found the culprit. In lib/ext there were two swt
jarfiles, and they were gtk (meaning they were for linux). Why and
when they got there is a mystery. I removed them and it now all
works. The Instantiations GWT Designer is still having a problem not
being able to instantiate a widget class. I'm going to trash the
tutorial application and rebuild it. Now that all the conflicting
pieces are out, it will probably work as advertised this time.

Thanks,
Rob

Jeff Chimene

unread,
Apr 24, 2009, 6:11:38 PM4/24/09
to Google-We...@googlegroups.com

Congratulations, Rob!

At this point, you should be able to work w/ Instantiations tech
support. You now have correct and complete understanding of what's what
and where on your system.

I'm sure I speak for the rest of the list when I say that we look
forward to seeing what you can do w/ Instantiations.

Cheers,
jec

Reply all
Reply to author
Forward
0 new messages