Closed Angular-Angel closed 2 years ago
Hi. This plugin has not been updated in a long time, unfortunately, so it can't run with newer versions of Gradle (which keeps changing, causing this kind of problem).
I do want to get back to this project at some point, but I can't promist I will fix this soon. If you have time to submit a PR, i would be happy to help merge a fix.
Actually , looking at the errors, it seems more related to Java 11? I never tried to run this on JDK11. I think that should be easy to fix.
@Angular-Angel I have been able to get things running by upgrading all dependencies.
Try something like this and it should work:
plugins {
id 'com.athaydes.osgi-run'
}
repositories {
mavenCentral()
}
def GOGO_BUNDLES = [
'org.apache.felix:org.apache.felix.gogo.runtime:1.1.4',
'org.apache.felix:org.apache.felix.gogo.shell:1.1.4',
'org.apache.felix:org.apache.felix.gogo.command:1.1.2',
].collect { [ dependency: it, transitive: false ] }.asImmutable()
runOsgi {
osgiMain = "org.apache.felix:org.apache.felix.main:7.0.1"
bundles = GOGO_BUNDLES
}
The error you reported about the annotations missing could be fixed with this (if running on Felix):
runOsgi {
osgiMain = "org.apache.felix:org.apache.felix.main:7.0.1"
bundles = GOGO_BUNDLES
config += [ 'org.osgi.framework.system.packages.extra': 'javax.annotation' ]
}
I will try to publish an updated version of the plugin, but as lots of things have changed recently, it's not a trivial amount of work.
Hmm, gotcha. I'll try and figure something out on monday, will get back to you then!
I am pushing some code on the dev
branch. I think I got both Felix and Equinox working again, but have to enable all test projects still to be sure.
Please try the dev
branch to see if everything works for you.
I published version 2.0 of the plugins, built against Gradle 7.4.
It's already on Maven Central and should be soon in the Gradle Plugin Repository.
Let me know if you run into problems.
Okay, so it looks like it works now? Except when I use the 'runOsgi' task, it gives me:
Feb 14, 2022 12:13:34 PM org.jline.utils.Log logr
WARNING: Unable to create a system terminal, creating a dumb terminal (enable debug logging for more information)
And then when I try the various commands in terminal, it doesn't seem to respond? But if I run 'stop 0' then a couple seconds later it will give some kind of error and shut down, so maybe it's getting the commands and responding to them, but just not giving me any output from them? :/
I found this other issue with the same error message, which was fixed by this commit, which updated the version of jline and added jansi, so maybe that's the issue? Though, I tried doing this on my end via adding those dependencies and it didn't change anything, even when I excluded any versions from osgi-run. :/
Edit: Oh, also, the text of that error I eventually get on telling it to 'exit' or 'stop 0':
Exception in thread "Thread-410" java.io.IOException: Stream closed
at java.base/java.io.BufferedInputStream.getBufIfOpen(BufferedInputStream.java:168)
at java.base/java.io.BufferedInputStream.read1(BufferedInputStream.java:289)
at java.base/java.io.BufferedInputStream.read(BufferedInputStream.java:343)
at java.base/java.io.FilterInputStream.read(FilterInputStream.java:106)
at java_io_FilterInputStream$read.call(Unknown Source)
at com.athaydes.gradle.osgi.RunOsgiTask$_consume_closure1.doCall(RunOsgiTask.groovy:90)
at com.athaydes.gradle.osgi.RunOsgiTask$_consume_closure1.doCall(RunOsgiTask.groovy)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:107)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:274)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1035)
at groovy.lang.Closure.call(Closure.java:412)
at groovy.lang.Closure.call(Closure.java:406)
at groovy.lang.Closure.run(Closure.java:493)
at java.base/java.lang.Thread.run(Thread.java:833)
Oh, should I make a new issue for this?
Please try running it like this:
./gradlew createOsgi
chmod +x build/osgi/run.sh
build/osgi/run.sh
It seems like your terminal was not detected when running the run task... so try running it directly as shown above.
If you still have issues, send me the contents of your osgi/bundle
directory.
Also, what OS are you using? And what terminal?
Huh, yeah, okay, it works like that. I'm using Xubuntu 20.04 (focal), running the thing via netbeans. Works fine when I run it via xfce4-terminal. So, it must be a problem due to netbeans, good to know. :/
Huh, wait though. When I do './gradlew runOsgi' in xfce4-terminal, I get the same issue. So it's not just netbeans. :/
I created a new issue: https://github.com/renatoathaydes/osgi-run/issues/71
When I try, I get the following errors:
This is without adding any bundle to the project, and only using the default osgiRuntime.