It looks like you are still running with Felix on the modulepath rather
than the classpath. This is the giveaway from the output you showed:

'module java.base does not "opens java.net" to module
org.apache.felix.framework
        at org.apache.felix.framework@6.0.2'

In other words, Java thinks that Felix is a module.

Put Felix on the classpath and it should work.

Regards,
Neil


On Mon, Feb 18, 2019 at 6:23 PM Chuck Davis <cjgun...@gmail.com> wrote:

> Didn't make any difference.  Still getting the following exception with
> felix.jar on the classpath:
>
> chuck@linux-hk84:~> ./startJFXFelix
> The framework class is: org.apache.felix.framework.Felix
>                    <-- my class output
> loaded bundle: org.apache.felix.framework which is bundle number: 0
>                <-- my class output
> Exception in thread "main" java.lang.ExceptionInInitializerError
>         at org.apache.felix.framework@6.0.2
>
> /org.apache.felix.framework.URLHandlers.createURLStreamHandler(URLHandlers.java:513)
>         at java.base/java.net.URL.getURLStreamHandler(URL.java:1415)
>         at java.base/java.net.URL.<init>(URL.java:633)
>         at org.apache.felix.framework@6.0.2
>
> /org.apache.felix.framework.util.SecureAction.createURL(SecureAction.java:256)
>         at org.apache.felix.framework@6.0.2
>
> /org.apache.felix.framework.cache.JarRevision.initialize(JarRevision.java:148)
>         at org.apache.felix.framework@6.0.2
> /org.apache.felix.framework.cache.JarRevision.<init>(JarRevision.java:76)
>         at org.apache.felix.framework@6.0.2
>
> /org.apache.felix.framework.cache.BundleArchive.createRevisionFromLocation(BundleArchive.java:799)
>         at org.apache.felix.framework@6.0.2
>
> /org.apache.felix.framework.cache.BundleArchive.reviseInternal(BundleArchive.java:480)
>         at org.apache.felix.framework@6.0.2
>
> /org.apache.felix.framework.cache.BundleArchive.<init>(BundleArchive.java:148)
>         at org.apache.felix.framework@6.0.2
> /org.apache.felix.framework.cache.BundleCache.create(BundleCache.java:462)
>         at org.apache.felix.framework@6.0.2
> /org.apache.felix.framework.Felix.installBundle(Felix.java:3227)
>         at org.apache.felix.framework@6.0.2
>
> /org.apache.felix.framework.BundleContextImpl.installBundle(BundleContextImpl.java:147)
>         at org.apache.felix.framework@6.0.2
>
> /org.apache.felix.framework.BundleContextImpl.installBundle(BundleContextImpl.java:120)
>         at
> JFXFelix/com.yakridge.jfxfelix.JFXMain.someNewMethod(JFXMain.java:65)
>         at JFXFelix/com.yakridge.jfxfelix.JFXMain.main(JFXMain.java:30)
> Caused by: java.lang.RuntimeException: Unable to make protected boolean
> java.net.URLStreamHandler.equals(java.net.URL,java.net.URL) accessible:
> module java.base does not "opens java.net" to module
> org.apache.felix.framework
>         at org.apache.felix.framework@6.0.2
>
> /org.apache.felix.framework.URLHandlersStreamHandlerProxy.<clinit>(URLHandlersStreamHandlerProxy.java:104)
>         ... 15 more
> Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make
> protected boolean
> java.net.URLStreamHandler.equals(java.net.URL,java.net.URL) accessible:
> module java.base does not "opens java.net" to module
> org.apache.felix.framework
>         at
>
> java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:340)
>         at
>
> java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:280)
>         at
> java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:198)
>         at
> java.base/java.lang.reflect.Method.setAccessible(Method.java:192)
>         at org.apache.felix.framework@6.0.2
>
> /org.apache.felix.framework.util.SecureAction.setAccesssible(SecureAction.java:871)
>         at org.apache.felix.framework@6.0.2
>
> /org.apache.felix.framework.URLHandlersStreamHandlerProxy.<clinit>(URLHandlersStreamHandlerProxy.java:79)
>         ... 15 more
>
>
> On Mon, Feb 18, 2019 at 9:39 AM Karl Pauls <karlpa...@gmail.com> wrote:
>
> > right, as I said, you need to put the felix jar on the classpath - then
> it
> > should work.
> >
> > regards,
> >
> > Karl
> >
> > On Monday, February 18, 2019, Chuck Davis <cjgun...@gmail.com> wrote:
> >
> > > I start my main class with the following bash script:
> > >
> > > java --module-path
> > > /sata2/modules:/sata2/modules/felix:/sata2/Downloads/javafx/
> > > javafx-sdk-11.0.1/lib
> > > --add-modules=ALL-MODULE-PATH com.yakridge.jfxfelix.JFXMain
> > > If I comment out all the Felix stuff the program runs fine.  My main
> > class
> > > is on the classpath.  The felix bundles are in /sata2/modules
> directory.
> > >
> > >
> > > On Mon, Feb 18, 2019 at 8:00 AM Karl Pauls <karlpa...@gmail.com>
> wrote:
> > >
> > > > How do you start this main class (and/or, are you embedding felix in
> a
> > > > module)?
> > > >
> > > > You need to be on the classpath and not on the module path to work.
> > > >
> > > > regards,
> > > >
> > > > Karl
> > > >
> > > >
> > >
> >
> >
> > --
> > Karl Pauls
> > karlpa...@gmail.com
> >
>

Reply via email to