Muovendo i primi passi con GWT in ambiente Ubuntu (nel mio caso la versione 9.10), molto probabilmente incontrerete il seguent errore quando proverete ad eseguire la vostra applicazione in hosted mode:
** Unable to load Mozilla for hosted mode **
java.lang.UnsatisfiedLinkError: /home/hellz/projects/gwt-linux-1.5.3
/mozilla-1.7.12/libxpcom.so: libstdc++.so.5:
cannot open shared object file: No such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1778)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1674)
at java.lang.Runtime.load0(Runtime.java:770)
at java.lang.System.load(System.java:1005)
at com.google.gwt.dev.shell.moz.MozillaInstall.load(MozillaInstall.java:190)
at com.google.gwt.dev.BootStrapPlatform.init(BootStrapPlatform.java:49)
at com.google.gwt.dev.GWTShell.main(GWTShell.java:354)
Come reagire? In sostanza, manca una libreria, ovvero libstdc++.so.5. Per installarla, basta lanciare:
sudo apt-get install libstdc++5
Potrebbe a questo punto verificarsi il seguente errore:
Package libstdc++5 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package libstdc++5 has no installation candidate
Questo significa che la libreria va scaricata ed installata manualmente:
# change directory to /tmp directory:
cd /tmp/ # download deb package:
wget -c http://lug.mtu.edu/ubuntu/pool/main/g/gcc-3.3/libstdc++5_3.3.6-10_i386.deb # unpack deb package to get library file
dpkg -x libstdc++5_3.3.6-10_i386.deb libstdc++5 # copy library file to /usr/lib directory
sudo cp libstdc++5/usr/lib/libstdc++.so.5.0.7 /usr/lib # change directory to /usr/lib directory
cd /usr/lib # create a link to library
sudo ln -s libstdc++.so.5.0.7 libstdc++.so.5
A questo punto, l'applicazione dovrebbe essere eseguibile in hosted mode.
Se perĂ² decidiamo di avviare la compilazione, il seguente errore potrebbe verificarsi in hosted mode:
[ERROR] Unable to find a default external web browser
[WARN] Try setting the environment variable GWT_EXTERNAL_BROWSER to
your web browser executable before launching the GWT shell
In tal caso, non dobbiamo fare altro che inserire la seguente riga in fondo al file ~/.bashrc:
export GWT_EXTERNAL_BROWSER=/usr/bin/firefox
No comments:
Post a Comment