Hi, Does it work with -Pequinox? I think the exception you see in org.apache.felix.framework.ext.ClassPathExtenderFactory is expected and doesn't cause the problems, but I am unsure why the substrate.lib example isn't working for you. The unresolved bundle exception is benign. It is just the example pulling in the org.osgi.service.component.annotations which is unresolvable. The other exceptions from org.apache.felix.framework.URLHandlers are again expected. Karl has looked at ways to avoid these errors, but I don't think he found a way to stop them from being thrown in the output/log. To be honest the substrate.lib example is not something I think we should promote though. It requires a lot of manual configuration and requires the bundles compiled in the image also be available in a "lib/" folder for resource lookup. The maven example is much better because it auto configures things like the reflection necessary for Declarative Services and BundleActivators and it indexes all the resources into the image so you don't need a lib/ folder to hold the bundles.
Unfortunately I updated to Big Sur on my Mac this week and now Graal is completely non-functional. Not sure how long it will take me to get to a working state with Graal again. Tom. On Thu, Feb 11, 2021 at 5:56 PM Pierre De Rop <[email protected]> wrote: > Hi Tom, > > Maybe I did something wrong, but it seems I can't run the > substrate.lib/target/atomos example. > > So, I'm using this graalvm version: > > openjdk version "11.0.10" 2021-01-19 > OpenJDK Runtime Environment GraalVM CE 21.0.0 (build > 11.0.10+8-jvmci-21.0-b06) > OpenJDK 64-Bit Server VM GraalVM CE 21.0.0 (build 11.0.10+8-jvmci-21.0-b06, > mixed mode, sharing) > > > Now, I have built the whole project using this command, as per your README > from [1]. > > ./mvnw clean install -Psubstrate -Pfelix > > > So, after a while, everything is built, but when I'm trying to launch the > following executable: > > ./atomos.examples/atomos.examples.substrate.lib/target/atomos > > then I'm getting this exception: > > java.lang.reflect.InvocationTargetException > at java.lang.reflect.Method.invoke(Method.java:566) > at > > org.apache.felix.framework.util.SecureAction.getAccessor(SecureAction.java:1139) > > at > > org.apache.felix.framework.util.SecureAction.setAccesssible(SecureAction.java:998) > > at > > org.apache.felix.framework.ext.ClassPathExtenderFactory$DefaultClassLoaderExtender.<clinit>(ClassPathExtenderFactory.java:79) > > at > > com.oracle.svm.core.classinitialization.ClassInitializationInfo.invokeClassInitializer(ClassInitializationInfo.java:375) > > at > > com.oracle.svm.core.classinitialization.ClassInitializationInfo.initialize(ClassInitializationInfo.java:295) > > at > > org.apache.felix.framework.ExtensionManager.<clinit>(ExtensionManager.java:152) > > at > > com.oracle.svm.core.classinitialization.ClassInitializationInfo.invokeClassInitializer(ClassInitializationInfo.java:375) > > at > > com.oracle.svm.core.classinitialization.ClassInitializationInfo.initialize(ClassInitializationInfo.java:295) > > at > > org.apache.felix.framework.Felix.initializeFrameworkProperties(Felix.java:4881) > > at org.apache.felix.framework.Felix.<init>(Felix.java:405) > at > > org.apache.felix.framework.FrameworkFactory.newFramework(FrameworkFactory.java:36) > > at > > org.apache.felix.atomos.impl.base.AtomosBase.newFramework(AtomosBase.java:423) > > at org.apache.felix.atomos.Atomos.main(Atomos.java:228) > Caused by: com.oracle.svm.core.jdk.UnsupportedFeatureError: Defining new > classes at run time is not supported. All classes need to be known at image > build time. > at > com.oracle.svm.core.util.VMError.unsupportedFeature(VMError.java:87) > at jdk.internal.misc.Unsafe.defineAnonymousClass(Unsafe.java:246) > at sun.misc.Unsafe.defineAnonymousClass(Unsafe.java:830) > ... 14 more > com.oracle.svm.core.jdk.UnsupportedFeatureError: Setting a custom > URLStreamHandlerFactory. > at > com.oracle.svm.core.util.VMError.unsupportedFeature(VMError.java:87) > at java.net.URL.setURLStreamHandlerFactory(URL.java:77) > at > org.apache.felix.framework.URLHandlers.<init>(URLHandlers.java:243) > at > > org.apache.felix.framework.URLHandlers.registerFrameworkInstance(URLHandlers.java:633) > > at > > org.apache.felix.framework.URLHandlersActivator.start(URLHandlersActivator.java:69) > > at > > org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:825) > > at > > org.apache.felix.framework.Felix$SystemBundleActivator.start(Felix.java:5173) > > at > > org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:825) > > at org.apache.felix.framework.Felix.init(Felix.java:899) > at org.apache.felix.framework.Felix.init(Felix.java:648) > at org.apache.felix.framework.Felix.start(Felix.java:1111) > at org.apache.felix.atomos.Atomos.main(Atomos.java:229) > > And, I don't get the gogo prompt and I can't hit the gogo web console from > http://localhost:8080/system/console/bundles > > Did I wrongly build the projects ? maybe it's because I'm using the > latest GraalVM > CE 21.0.0 version while in your README file it is mentioned that GraalVM CE > 20.2.0 is required ? Notice that I'm getting the same issue when using the > -Pjava8 option. I hope I'm not raising a false alarm ? > > Now, the other atomos.examples.substrate.maven works, but at startup, I > however noticed some exceptions: > > > ./atomos.examples/atomos.examples.substrate.maven/target/native_image_build/bin/org.apache.felix.atomos.examples.substrate.maven > > java.lang.reflect.InvocationTargetException > at java.lang.reflect.Method.invoke(Method.java:566) > at > > org.apache.felix.framework.util.SecureAction.getAccessor(SecureAction.java:1139) > > at > > org.apache.felix.framework.util.SecureAction.setAccesssible(SecureAction.java:998) > > at > > org.apache.felix.framework.ext.ClassPathExtenderFactory$DefaultClassLoaderExtender.<clinit>(ClassPathExtenderFactory.java:79) > > at > > com.oracle.svm.core.classinitialization.ClassInitializationInfo.invokeClassInitializer(ClassInitializationInfo.java:375) > > at > > com.oracle.svm.core.classinitialization.ClassInitializationInfo.initialize(ClassInitializationInfo.java:295) > > at > > org.apache.felix.framework.ExtensionManager.<clinit>(ExtensionManager.java:152) > > at > > com.oracle.svm.core.classinitialization.ClassInitializationInfo.invokeClassInitializer(ClassInitializationInfo.java:375) > > at > > com.oracle.svm.core.classinitialization.ClassInitializationInfo.initialize(ClassInitializationInfo.java:295) > > at > > org.apache.felix.framework.Felix.initializeFrameworkProperties(Felix.java:4881) > > at org.apache.felix.framework.Felix.<init>(Felix.java:405) > at > > org.apache.felix.framework.FrameworkFactory.newFramework(FrameworkFactory.java:36) > > at > > org.apache.felix.atomos.impl.base.AtomosBase.newFramework(AtomosBase.java:423) > > at org.apache.felix.atomos.Atomos.main(Atomos.java:228) > Caused by: com.oracle.svm.core.jdk.UnsupportedFeatureError: Defining new > classes at run time is not supported. All classes need to be known at image > build time. > at > com.oracle.svm.core.util.VMError.unsupportedFeature(VMError.java:87) > at jdk.internal.misc.Unsafe.defineAnonymousClass(Unsafe.java:246) > at sun.misc.Unsafe.defineAnonymousClass(Unsafe.java:830) > ... 14 more > com.oracle.svm.core.jdk.UnsupportedFeatureError: Setting a custom > URLStreamHandlerFactory. > at > com.oracle.svm.core.util.VMError.unsupportedFeature(VMError.java:87) > at java.net.URL.setURLStreamHandlerFactory(URL.java:77) > at > org.apache.felix.framework.URLHandlers.<init>(URLHandlers.java:243) > at > > org.apache.felix.framework.URLHandlers.registerFrameworkInstance(URLHandlers.java:633) > > at > > org.apache.felix.framework.URLHandlersActivator.start(URLHandlersActivator.java:69) > > at > > org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:825) > > at > > org.apache.felix.framework.Felix$SystemBundleActivator.start(Felix.java:5173) > > at > > org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:825) > > at org.apache.felix.framework.Felix.init(Felix.java:899) > at org.apache.felix.framework.Felix.init(Felix.java:648) > at org.apache.felix.framework.Felix.start(Felix.java:1111) > at org.apache.felix.atomos.Atomos.main(Atomos.java:229) > Registered Echo service from activator. > 2021-02-12 00:48:55.120:INFO:oejs.Server:FelixStartLevel: > jetty-9.4.30.v20200611; built: 2020-06-11T12:34:51.929Z; git: > 271836e4c1f4612f12b7bb13ef5a92a927634b0d; jvm 11.0.10 > resource:gosh_profile: ERROR: java.lang.IllegalArgumentException: Cannot > coerce addcommand(Token, BundleContextImpl) to any of [] > g! 2021-02-12 00:48:55.123:INFO:oejs.session:FelixStartLevel: > DefaultSessionIdManager workerName=node0 > 2021-02-12 00:48:55.123:INFO:oejs.session:FelixStartLevel: No > SessionScavenger set, using defaults > 2021-02-12 00:48:55.123:INFO:oejs.session:FelixStartLevel: node0 Scavenging > every 600000ms > 2021-02-12 00:48:55.123:INFO:oejsh.ContextHandler:FelixStartLevel: Started > o.e.j.s.ServletContextHandler@6384780a{/,null,AVAILABLE} > 2021-02-12 00:48:55.123:INFO:oejs.Server:FelixStartLevel: Started @124ms > 2021-02-12 00:48:55.123:INFO:oejs.session:FelixStartLevel: node0 Scavenging > every 600000ms > 2021-02-12 00:48:55.124:INFO:oejs.AbstractConnector:FelixStartLevel: > Started ServerConnector@507b669c{HTTP/1.1, (http/1.1)}{0.0.0.0:8080} > [INFO] Started Jetty 9.4.30.v20200611 at port(s) HTTP:8080 on context path > / [minThreads=8,maxThreads=200,acceptors=1,selectors=2] > [INFO] Apachde Felix Http Whiteboard Service started > Activated: org.apache.felix.atomos.tests.testbundles.service.impl.EchoImpl > Echo service found: impl.activator hello > Activated: org.apache.felix.atomos.tests.testbundles.service.user.EchoUser > Activated via constructor: > org.apache.felix.atomos.tests.testbundles.service.user.EchoUser2 > ERROR: Bundle org.osgi.service.component.annotations [25] Error starting > atomos:boot:org.osgi.service.component.annotations > (org.osgi.framework.BundleException: Unable to resolve org.osgi.se > rvice.component.annotations [25](R 25.0): missing requirement > [org.osgi.service.component.annotations [25](R 25.0)] osgi.unresolvable; > (&(must.not.resolve=*)(!(must.not.resolve=*))) Unresolv > ed requirements: [[org.osgi.service.component.annotations [25](R 25.0)] > osgi.unresolvable; (&(must.not.resolve=*)(!(must.not.resolve=*)))]) > org.osgi.framework.BundleException: Unable to resolve > org.osgi.service.component.annotations [25](R 25.0): missing requirement > [org.osgi.service.component.annotations [25](R 25.0)] osgi.unre > solvable; (&(must.not.resolve=*)(!(must.not.resolve=*))) Unresolved > requirements: [[org.osgi.service.component.annotations [25](R 25.0)] > osgi.unresolvable; (&(must.not.resolve=*)(!(must.not. > resolve=*)))]Unable to resolve connected bundle: Unable to resolve > org.osgi.service.component.annotations [25](R 25.0): missing requirement > [org.osgi.service.component.annotations [25](R 25. > 0)] osgi.unresolvable; (&(must.not.resolve=*)(!(must.not.resolve=*))) > Unresolved requirements: [[org.osgi.service.component.annotations [25](R > 25.0)] osgi.unresolvable; (&(must.not.resolve=* > )(!(must.not.resolve=*)))] > > at > org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4398) > at org.apache.felix.framework.Felix.startBundle(Felix.java:2308) > at > org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1566) > at > > org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308) > > at java.lang.Thread.run(Thread.java:834) > at > > com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:519) > > at > > com.oracle.svm.core.posix.thread.PosixJavaThreads.pthreadStartRoutine(PosixJavaThreads.java:192) > > > > Despite of the exceptions, the substrate.maven example works fine: I can > get the gogo prompt and the webconsole also works. > > [1] > > https://github.com/apache/felix-atomos/blob/master/atomos.examples/SUBSTRATE.md > > thanks; > > regards > /pierre > > > > On Tue, Feb 9, 2021 at 7:38 PM Thomas Watson <[email protected]> wrote: > > > Hi, > > > > I did publish the new snapshots of atomos to > > https://repository.apache.org/content/repositories/snapshots in case you > > want to try them from there. I also updated my simplistic example of gogo > > w/ atomos at https://github.com/tjwatson/atomos-examples > > > > Tom > > > > On Tue, Feb 9, 2021 at 7:14 AM Jean-Baptiste Onofre <[email protected]> > > wrote: > > > > > Thanks Tom for the reminder ! > > > > > > I should have time to test by the end of the week. > > > > > > Regards > > > JB > > > > > > > Le 9 févr. 2021 à 02:01, Thomas Watson <[email protected]> a écrit : > > > > > > > > Hi, > > > > > > > > I would like to give you a chance to provide feedback before calling > a > > > vote > > > > for a 1.0 release of Atomos. I've done a few modifications over the > > past > > > > week or so and have improved the project readme to make it easier to > > > > understand what Atomos is and how to use it: > > > > > > > > https://github.com/apache/felix-atomos > > > > > > > > Please let me know what you think and provide any improvements that > you > > > > think may be needed before we call for a 1.0 release. > > > > > > > > Thanks > > > > > > > > Tom > > > > > > > > >
