Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » SWT Browser doesnt load applets in Linux(SWT Browser doesnt load applets in Linux)
SWT Browser doesnt load applets in Linux [message #484047] Fri, 04 September 2009 05:09 Go to next message
ratish  is currently offline ratish Friend
Messages: 6
Registered: September 2009
Junior Member
I am creating an Eclipse RCP application having embedded SWT Browser

In Windows the application with embedded browser loads applet. I followed the settings mentioned in http://www.eclipse.org/swt/faq.php#browserapplets and the settings work perfectly fine.

In Linux, the corresponding settings dont.

The following error is seen on console when trying to load applets:
LoadPlugin: failed to initialize shared library libXt.so [libXt.so: cannot open shared object file: No such file or directory]
LoadPlugin: failed to initialize shared library libXext.so [libXext.so: cannot open shared object file: No such file or directory]
LoadPlugin: failed to initialize shared library /usr/java/jre1.6.0_10/plugin/i386/ns7/libjavaplugin_oji.so [/usr/java/jre1.6.0_10/plugin/i386/ns7/libjavaplugin_oji.so: undefined symbol: _ZTVN10__cxxabiv121__vmi_class_type_infoE]

Few details of Configuration:
OS: Red Hat Enterprise Linux 4.6
Browser: Firefox/1.5.0.12
Eclipse version: 3.5 Galileo
JRE version: 1.6 u10

Further details:
The SWT Browser loads htmls without applets
When viewing the html with applet on Firefox browser directly, the applets load

Investigation done:
As required in http://www.eclipse.org/swt/faq.php#browserapplets I have set
MOZ_PLUGIN_PATH to /usr/lib/mozilla/plugins
MOZILLA_FIVE_HOME to /usr/lib/firefox1.5.0.12

As required in http://plugindoc.mozdev.org/linux.html for detecting plugins for mozilla, I have made a symbolic link to libjavaplugin_oji.so in Mozilla Plugins directory. I use the copy located in the plugin/i386/ns7 directory of JRE folder

Any help/ tip provided in solving this issue will be highly appreciated
Re: SWT Browser doesnt load applets in Linux [message #485235 is a reply to message #484047] Thu, 10 September 2009 20:51 Go to previous messageGo to next message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
Hi,

This works for me on RHEL4 with the following:

MOZILLA_FIVE_HOME=/usr/lib/firefox-1.0
LD_LIBRARY_PATH=/usr/lib/firefox-1.0 (note that you didn't have this
variable set, perhaps this is the difference)
MOZ_PLUGIN_PATH=~/jre160_04/plugin/i386/ns7

Also note that you shouldn't generally need to set MOZILLA_FIVE_HOME and
LD_LIBRARY_PATH anymore. If there's a xulrunner installed on your machine
then it should be magically detected, and even if there isn't, the eclipse
launcher should detect an available firefox in /usr/lib/firefox-1.5.0.12 and
set MOZILLA_FIVE_HOME and LD_LIBRARY_PATH accordingly. The case where
setting these variables is more common is when running a stand-alone swt app
that doesn't use the eclipse launcher to start, on an old linux that doesn't
ship with xulrunner.

HTH,
Grant


"ratish" <ratish_puduppully@yahoo.com> wrote in message
news:h7q7fi$bsb$1@build.eclipse.org...
> I am creating an Eclipse RCP application having embedded SWT Browser
>
> In Windows the application with embedded browser loads applet. I followed
the settings mentioned in http://www.eclipse.org/swt/faq.php#browserapplets
and the settings work perfectly fine.
>
> In Linux, the corresponding settings dont.
>
> The following error is seen on console when trying to load applets:
> LoadPlugin: failed to initialize shared library libXt.so [libXt.so: cannot
open shared object file: No such file or directory]
> LoadPlugin: failed to initialize shared library libXext.so [libXext.so:
cannot open shared object file: No such file or directory]
> LoadPlugin: failed to initialize shared library
/usr/java/jre1.6.0_10/plugin/i386/ns7/libjavaplugin_oji.so
[/usr/java/jre1.6.0_10/plugin/i386/ns7/libjavaplugin_oji.so: undefined
symbol: _ZTVN10__cxxabiv121__vmi_class_type_infoE]
>
> Few details of Configuration:
> OS: Red Hat Enterprise Linux 4.6
> Browser: Firefox/1.5.0.12
> Eclipse version: 3.5 Galileo
> JRE version: 1.6 u10
>
> Further details:
> The SWT Browser loads htmls without applets
> When viewing the html with applet on Firefox browser directly, the applets
load
>
> Investigation done:
> As required in http://www.eclipse.org/swt/faq.php#browserapplets I have
set
> MOZ_PLUGIN_PATH to /usr/lib/mozilla/plugins
> MOZILLA_FIVE_HOME to /usr/lib/firefox1.5.0.12
>
> As required in http://plugindoc.mozdev.org/linux.html for detecting
plugins for mozilla, I have made a symbolic link to libjavaplugin_oji.so in
Mozilla Plugins directory. I use the copy located in the plugin/i386/ns7
directory of JRE folder
>
> Any help/ tip provided in solving this issue will be highly appreciated
Re: SWT Browser doesnt load applets in Linux [message #497016 is a reply to message #485235] Thu, 12 November 2009 09:33 Go to previous messageGo to next message
ratish  is currently offline ratish Friend
Messages: 6
Registered: September 2009
Junior Member
Thanks for the reply, Grant

I tried with the settings you mentioned viz:
setting LD_LIBRARY_PATH.

But I am still not able to load applets on Linux.

The below errors were resolved:
LoadPlugin: failed to initialize shared library libXt.so [libXt.so: cannot open shared object file: No such file or directory]
LoadPlugin: failed to initialize shared library libXext.so [libXext.so: cannot open shared object file: No such file or directory]

They were resolved by setting it in Path variable.

But the below error still remains:

LoadPlugin: failed to initialize shared library /usr/java/jre1.6.0_10/plugin/i386/ns7/libjavaplugin_oji.so [/usr/java/jre1.6.0_10/plugin/i386/ns7/libjavaplugin_oji.so: undefined symbol: _ZTVN10__cxxabiv121__vmi_class_type_infoE]

Because of which applets dont load on Linux still

Help provided in resolving the issue will be greatly appreciated
Re: SWT Browser doesnt load applets in Linux [message #498016 is a reply to message #497016] Fri, 13 November 2009 17:05 Go to previous messageGo to next message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
Hi,

Googling for this indicates that a lot of apps with no connection to swt
also see this problem. Since this works for me it's difficult to
investigate, but based on some of the discussions, here are a couple of
guesses you can try:

1. You mentioned setting MOZ_PLUGIN_PATH to /usr/lib/mozilla/plugins . On
my RHEL4 this directory contains a libjavaplugin_oji.so which I think came
with the OS. Can you instead set MOZ_PLUGIN_PATH to your jre's
plugin/i386/ns7 directory?

2. This missing symbol is apparently supposed to be in
/usr/lib/libstdc++.so.6 . Does setting environment variable LD_PRELOAD to
this help?

Another thing you can try, though it would not ultimately determine the
problem you're seeing, is to download a xulrunner and use it instead. Since
xulrunner has its own library loading mechanism it does not run into these
confused library situations as often. If you try this then don't set
MOZILLA_FIVE_HOME or LD_LIBRARY_PATH, but DO still set MOZ_PLUGIN_PATH.
Register it with your OS with "./xulrunner --register-global", and the
Browser should automatically find it at runtime. To ensure that xulrunner
is registered and being detected you can use
http://www.eclipse.org/swt/faq.php#printmozillapath .

HTH,
Grant


"ratish" <ratish_puduppully@yahoo.com> wrote in message
news:hdgkoj$m0b$1@build.eclipse.org...
> Thanks for the reply, Grant
>
> I tried with the settings you mentioned viz:
> setting LD_LIBRARY_PATH.
>
> But I am still not able to load applets on Linux.
>
> The below errors were resolved:
> LoadPlugin: failed to initialize shared library libXt.so [libXt.so: cannot
open shared object file: No such file or directory]
> LoadPlugin: failed to initialize shared library libXext.so [libXext.so:
cannot open shared object file: No such file or directory]
>
> They were resolved by setting it in Path variable.
>
> But the below error still remains:
>
> LoadPlugin: failed to initialize shared library
/usr/java/jre1.6.0_10/plugin/i386/ns7/libjavaplugin_oji.so
[/usr/java/jre1.6.0_10/plugin/i386/ns7/libjavaplugin_oji.so: undefined
symbol: _ZTVN10__cxxabiv121__vmi_class_type_infoE]
>
> Because of which applets dont load on Linux still
>
> Help provided in resolving the issue will be greatly appreciated
>
Re: SWT Browser doesnt load applets in Linux [message #506079 is a reply to message #498016] Wed, 06 January 2010 02:08 Go to previous message
Eclipse UserFriend
Originally posted by: jccanova.gmail.com

Hi,

1 - In matter of fact the previous answer is not totally precise. If you you
a xulrunner outside a xulrunner plugin you will not be able to get the
Mozilla instance , because it will sit on SWT plugin classloader, not in
your plugin (if you are using OSGI-Equinox). IF you are uring a standalone
application then you will have no problems because the swt-jar will be in
your main thread contextclassloader.


I made some research on what happens inside the SWT.Mozilla.

The things doesn~t happen by magic.

The mozilla browser (xulrunner , firefox) are loaded using a loadLibrary
function(swt internal).
if your libraries arent located in the System libraries (even using
LD_LIBRARY_PATH) you can load them manually. in fact SWT has a internal
loadlibrary function to solve this issues.


Take a look on MozillaZine , MDC and XulPlanet, there is a lot of good (but
never enough) information about it.
Also you should pay attention that the XulRunner plugin is out dated (1.8 is
firefox 2) is you are uding a RCP application or plugin.
for this case my sugestion is create a plugin for xulrunner 1.9.1x (firefox
3.5) which is quite simple,

its just a osgi plugin with a bin path in the build.properties just like
bellow.

bin.includes = META-INF/,xulrunner/


then you override the System property
(org.eclipse.swt.browser.XULRunnerPath), this came from SWT faq

package org.eclipse.swt.browser;

import java.io.*;
import java.net.*;
import org.eclipse.core.runtime.*;
import org.osgi.framework.Bundle;

public class XULRunnerInitializer {
static {
Bundle bundle = Platform.getBundle("Mozilla_Xul_Runner");
//$NON-NLS-1$
if (bundle != null) {
URL resourceUrl = bundle.getResource("xulrunner"); //$NON-NLS-1$
if (resourceUrl != null) {
try {
URL fileUrl = FileLocator.toFileURL(resourceUrl);
File file = new File(fileUrl.toURI());
System.setProperty("org.eclipse.swt.browser.XULRunnerPath",file.getAbsolutePath());
//$NON-NLS-1$
} catch (IOException e) {
throw new RuntimeException (e);
} catch (URISyntaxException e) {
throw new RuntimeException (e);
}
}
}
}
}

And finally you can override the SWT Browser (Mozilla) configuration just
instantiating and configuring all you need before the SWT control being
initialized (because the control instantiate the Mozilla singleton).

to do that you just create a intance and call the initemb... method from the
mozilla class.

Doing this the SWT control check that exists already a mozilla
configured....

and finally take a look at this post....

http://stanislavvitvitskiy.blogspot.com/2009/04/calling-java -from-xul-applications.html

was the best info that i found googleing...

regards.



"Grant Gayed" <grant_gayed@ca.ibm.com> wrote in message
news:hdk3lh$ul1$1@build.eclipse.org...
> Hi,
>
> Googling for this indicates that a lot of apps with no connection to swt
> also see this problem. Since this works for me it's difficult to
> investigate, but based on some of the discussions, here are a couple of
> guesses you can try:
>
> 1. You mentioned setting MOZ_PLUGIN_PATH to /usr/lib/mozilla/plugins . On
> my RHEL4 this directory contains a libjavaplugin_oji.so which I think came
> with the OS. Can you instead set MOZ_PLUGIN_PATH to your jre's
> plugin/i386/ns7 directory?
>
> 2. This missing symbol is apparently supposed to be in
> /usr/lib/libstdc++.so.6 . Does setting environment variable LD_PRELOAD to
> this help?
>
> Another thing you can try, though it would not ultimately determine the
> problem you're seeing, is to download a xulrunner and use it instead.
> Since
> xulrunner has its own library loading mechanism it does not run into these
> confused library situations as often. If you try this then don't set
> MOZILLA_FIVE_HOME or LD_LIBRARY_PATH, but DO still set MOZ_PLUGIN_PATH.
> Register it with your OS with "./xulrunner --register-global", and the
> Browser should automatically find it at runtime. To ensure that xulrunner
> is registered and being detected you can use
> http://www.eclipse.org/swt/faq.php#printmozillapath .
>
> HTH,
> Grant
>
>
> "ratish" <ratish_puduppully@yahoo.com> wrote in message
> news:hdgkoj$m0b$1@build.eclipse.org...
>> Thanks for the reply, Grant
>>
>> I tried with the settings you mentioned viz:
>> setting LD_LIBRARY_PATH.
>>
>> But I am still not able to load applets on Linux.
>>
>> The below errors were resolved:
>> LoadPlugin: failed to initialize shared library libXt.so [libXt.so:
>> cannot
> open shared object file: No such file or directory]
>> LoadPlugin: failed to initialize shared library libXext.so [libXext.so:
> cannot open shared object file: No such file or directory]
>>
>> They were resolved by setting it in Path variable.
>>
>> But the below error still remains:
>>
>> LoadPlugin: failed to initialize shared library
> /usr/java/jre1.6.0_10/plugin/i386/ns7/libjavaplugin_oji.so
> [/usr/java/jre1.6.0_10/plugin/i386/ns7/libjavaplugin_oji.so: undefined
> symbol: _ZTVN10__cxxabiv121__vmi_class_type_infoE]
>>
>> Because of which applets dont load on Linux still
>>
>> Help provided in resolving the issue will be greatly appreciated
>>
>
>
Previous Topic:Re: SWT printing capabilities
Next Topic:SWT StyledText under MacOS printing problem
Goto Forum:
  


Current Time: Sat Dec 07 21:20:09 GMT 2024

Powered by FUDForum. Page generated in 0.03697 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top