| 
| nsIWebBrowser webBrowser = (nsIWebBrowser)browser.getWebBrowser() NULL on 3.5M6 [message #335423] | Tue, 07 April 2009 13:28  |  | 
| Eclipse User  |  |  |  |  | Originally posted by: chlache.talita.org 
 I am working on an Mozilla Html Editor.
 On Eclipse 3.4.1 (nsIWebBrowser)browser.getWebBrowser() works with no problems.
 After moving to 3.5M6 (nsIWebBrowser)browser.getWebBrowser() always returns null, even though
 the Mozilla Browser has completely loaded.
 The Error seems to occcur when SWT.Browser calls ClassForName("org.mozilla.xpcom"), which returns null.
 
 When I run the same Code as a Snippet in 3.5M6 (as in Snippet267) the call works fine though.
 
 Is this a Bug? Thanks for any help.
 
 Andreas
 |  |  |  | 
|  | 
| 
| Re: nsIWebBrowser webBrowser = (nsIWebBrowser)browser.getWebBrowser() NULL on 3.5M6 [message #335436 is a reply to message #335424] | Wed, 08 April 2009 08:00   |  | 
| Eclipse User  |  |  |  |  | org.eclipse.swt.browser.Mozilla can't load org.mozilla.xpcom.Mozilla because "DynamicImport-Package: org.mozilla.xpcom" is missing in the
 MANIFEST.MF file.
 There isn't a problem when using SWT out of OSGi (Snippet267, for instance).
 The problem is fixed in the Eclipse trunk.
 
 Snjeza
 
 Andreas Chlache wrote:
 > Andreas Chlache wrote:
 >> I am working on an Mozilla Html Editor.
 >> On Eclipse 3.4.1 (nsIWebBrowser)browser.getWebBrowser() works with no
 >> problems.
 >> After moving to 3.5M6 (nsIWebBrowser)browser.getWebBrowser() always
 >> returns null, even though
 >> the Mozilla Browser has completely loaded.
 >> The Error seems to occcur when SWT.Browser calls
 >> ClassForName("org.mozilla.xpcom"), which returns null.
 >>
 >> When I run the same Code as a Snippet in 3.5M6 (as in Snippet267) the
 >> call works fine though.
 >>
 >> Is this a Bug? Thanks for any help.
 >>
 >> Andreas
 >
 > As a test i put some of the SWT.Mozilla initialization code in my plugin:
 >
 >         try {
 >             Class clazz = Class.forName ("org.mozilla.xpcom.Mozilla");
 > //$NON-NLS-1$
 >             Method method = clazz.getMethod ("getInstance", new
 > Class[0]); //$NON-NLS-1$
 >             Object mozilla = method.invoke (null, new Object[0]);
 >             method = clazz.getMethod ("getComponentManager", new
 > Class[0]); //$NON-NLS-1$
 >             try {
 >                 method.invoke (mozilla, new Object[0]);
 >             } catch (InvocationTargetException e) {
 >             }
 >         } catch (ClassNotFoundException e) {
 >             /* JavaXPCOM is not on the classpath */
 >         } catch (NoSuchMethodException e) {
 >             /* the JavaXPCOM on the classpath does not implement
 > initialize() */
 >         } catch (IllegalArgumentException e) {
 >         } catch (IllegalAccessException e) {
 >         } catch (InvocationTargetException e) {
 >         }
 >
 > and it works perfectly, only to immediately fail when calling
 >
 > browser = new Browser(parent, SWT.MOZILLA | SWT.BORDER);
 >
 > in the SWT plugin. Class.forName returning NULL.
 >
 > How is that possible?
 |  |  |  | 
| 
| Re: nsIWebBrowser webBrowser = (nsIWebBrowser)browser.getWebBrowser() NULL on 3.5M6 [message #335437 is a reply to message #335436] | Wed, 08 April 2009 08:20  |  | 
| Eclipse User  |  |  |  |  | Originally posted by: chlache.talita.org 
 Snjezana Peco wrote:
 > org.eclipse.swt.browser.Mozilla can't load org.mozilla.xpcom.Mozilla
 > because "DynamicImport-Package: org.mozilla.xpcom" is missing in the
 > MANIFEST.MF file.
 > There isn't a problem when using SWT out of OSGi (Snippet267, for
 > instance).
 > The problem is fixed in the Eclipse trunk.
 >
 > Snjeza
 >
 
 Thanks a lot for this information. I owe you one.
 
 I will update and I hope that it will work.
 
 Andreas
 |  |  |  | 
Powered by 
FUDForum. Page generated in 0.03556 seconds