List Info

Thread: a problem when launching a browser in sipcomm




a problem when launching a browser in sipcomm
user name
2007-09-16 21:06:39
Hi,
I got a problem when I try to launch a browser in sipcomm.
Here is a part of my code:
 if (osName.startsWith("Mac OS")) {
            Class fileMgr =
Class.forName("com.apple.eio.FileManager");
            Method openURL =
fileMgr.getDeclaredMethod("openURL",
               new Class[] {String.class});
            openURL.invoke(null, new Object[] );
}

Here is the error infor I got:
BrowserLaunch exception: *** Class
'com.apple.eio.FileManager' was not
found because bundle 35 does not import 'com.apple.eio' even
though
bundle 0 does export it. Additionally, the class is also
available
from the system class loader. There are two fixes: 1) Add an
import
for 'com.apple.eio' to bundle 35; imports are necessary for
each class
directly touched by bundle code or indirectly touched, such
as super
classes if their methods are used. 2) Add package
'com.apple.eio' to
the 'org.osgi.framework.bootdelegation' property; a library
or VM bug
can cause classes to be loaded by the wrong class loader.
The first
approach is preferable for preserving modularity. ***

It is strange, coz com.apple.eio is included in the
felix.client.run.properties already?
what is the bundle??

Could anyone answer this question? Plz cc to my gmail as
well.
TIA

-- 
BR
NIE PIN
TMLHUT, Helsinki, Finland
ANTDNIST, Gaithersburg, USA
Ph: +1 (301)975-6049

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribesip-communicator.dev.java.net
For additional commands, e-mail: dev-helpsip-communicator.dev.java.net


a problem when launching a browser in sipcomm
user name
2007-09-18 00:43:21
Hi!

> I got a problem when I try to launch a browser in
sipcomm.
> Here is a part of my code:
>  if (osName.startsWith("Mac OS")) {
>             Class fileMgr = 
> Class.forName("com.apple.eio.FileManager");
>             Method openURL =
fileMgr.getDeclaredMethod("openURL",
>                new Class[] {String.class});
>             openURL.invoke(null, new Object[] );
> }
> 
> Here is the error infor I got:
> BrowserLaunch exception: *** Class
'com.apple.eio.FileManager' was not
> found because bundle 35 does not import 'com.apple.eio'
even though
> bundle 0 does export it. Additionally, the class is
also available
> from the system class loader. There are two fixes: 1)
Add an import
> for 'com.apple.eio' to bundle 35; imports are necessary
for each class
> directly touched by bundle code or indirectly touched,
such as super
> classes if their methods are used. 2) Add package
'com.apple.eio' to
> the 'org.osgi.framework.bootdelegation' property; a
library or VM bug
> can cause classes to be loaded by the wrong class
loader. The first
> approach is preferable for preserving modularity. ***
> 
> It is strange, coz com.apple.eio is included in the
> felix.client.run.properties already?
> what is the bundle??

With the OSGI framework, not only do you have to export the
class
com.apple.eio.FileManager from the system classpath by
adding it to the
org.osgi.framework.system.packages property in the
felix.client.run.properties, you also have to add it to the
import property
of the bundle in which you are using the class. The bundles
are packaged in
the jar files which are generated in the sc-bundles dir.
Their properties
are set in the *.manifest.mf files in the src/../impl/..
directories. So for
example, if you've added your code to the GUI bundle, you
have to add the
com.apple.eio.FileManager class to the Import-Package entry
in
src/../impl/gui/swing.ui.manifest.mf.

I hope this helps.
Regards
Michael Koch
Re: a problem when launching a browser in sipcomm
user name
2007-09-18 10:19:28
Hi,
Thanks for your reply.
I found the tricky and solved the problem already. Still, very appreciate your help.

BR

niepin

On 9/18/07, Koch Michael < MKochrowa.de">MKochrowa.de&gt; wrote:
Hi!

> I got a problem when I try to launch a browser in sipcomm.
> Here is a part of my code:
>  ;if (osName.startsWith(&quot;Mac OS")) {
>&nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; Class fileMgr =
> Class.forName("com.apple.eio.FileManager");
> &nbsp;   ; &nbsp; &nbsp; &nbsp;  Method openURL = fileMgr.getDeclaredMethod(&quot;openURL&quot;,
>&nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; new Class[] {String.class});
>  ; &nbsp; &nbsp; &nbsp; &nbsp;   openURL.invoke(null, new Object[] );
&gt; }
>
>; Here is the error infor I got:
>; BrowserLaunch exception: *** Class 'com.apple.eio.FileManager&#39; was not
> found because bundle 35 does not import 'com.apple.eio9; even though
>; bundle 0 does export it. Additionally, the class is also available
> from the system class loader. There are two fixes: 1) Add an import
>; for 'com.apple.eio9; to bundle 35; imports are necessary for each class
> directly touched by bundle code or indirectly touched, such as super
&gt; classes if their methods are used. 2) Add package 'com.apple.eio9; to
> the 'org.osgi.framework.bootdelegation' property; a library or VM bug
> can cause classes to be loaded by the wrong class loader. The first
&gt; approach is preferable for preserving modularity. ***
>
&gt; It is strange, coz com.apple.eio is included in the
> felix.client.run.properties already?
&gt; what is the bundle??

With the OSGI framework, not only do you have to export the class
com.apple.eio.FileManager from the system classpath by adding it to the
org.osgi.framework.system.packages property in the
felix.client.run.properties, you also have to add it to the import property
of the bundle in which you are using the class. The bundles are packaged in
the jar files which are generated in the sc-bundles dir. Their properties
are set in the *.manifest.mf files in the src/../impl/.. directories. So for
example, if you've added your code to the GUI bundle, you have to add the
com.apple.eio.FileManager class to the Import-Package entry in
src/../impl/gui/swing.ui.manifest.mf.

I hope this helps.
Regards
Michael Koch




--
BR
NIE PIN
TMLHUT, Helsinki, Finland
ANTDNIST, Gaithersburg, USA
Ph: +1 (301)975-6049
[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )