OSGI resolution error - missing system.bundle - osgi

I'm suddenly getting the following weird resolution error:
[ERROR] Resolution failed. Capabilities satisfying the following requirements could not be found:
[<<INITIAL>>]
? osgi.identity: (osgi.identity=javafx-osgi)
? [javafx-osgi version=8.0.2]
? osgi.wiring.host: (osgi.wiring.host=system.bundle)
It appears that the system bundle (Apache Felix framework) is no longer being found... Oddly, this error just popped up today. I havent worked on this project for a week. But the last commit ran without a problem. If I revert to an earlier revision of the program, the problem remains...
We are using Java 1.8.0 161-b12; BND Tools 4.0.0 and Apache Felix Framework 1.8.
Our app.bndrun looks like this:
index: target/index.xml
-standalone: ${index}
-runrequires: osgi.identity;filter:='(osgi.identity=org.ops4j.pax.logging.pax-logging-service)', \
osgi.identity;filter:='(osgi.identity=javafx-osgi)', \
osgi.identity;filter:='(osgi.identity=com.foo.bar.command)',\
osgi.identity;filter:='(osgi.identity=com.foo.bar.testservice)', \
osgi.identity;filter:='(osgi.identity=com.foo.bar.main-screen)', \
osgi.identity;filter:='(osgi.identity=com.foo.bar.verify-screen)', \
osgi.identity;filter:='(osgi.identity=com.foo.bar.testclient)'
-runfw: org.apache.felix.framework;version='5.6.8'
-runee: JavaSE-1.8
-runbundles: \
com.foo.bar.testservice;version='[0.0.1,0.0.2)',\
org.apache.felix.scr;version='[2.1.0,2.1.1)',\
org.osgi.service.log;version='[1.4.0,1.4.1)',\
org.osgi.util.function;version='[1.1.0,1.1.1)',\
org.osgi.util.promise;version='[1.1.0,1.1.1)',\
org.osgi.util.pushstream;version='[1.0.0,1.0.1)',\
com.foo.bar.testclient;version='[0.0.1,0.0.2)',\
org.ops4j.pax.logging.pax-logging-api;version='[1.10.1,1.10.2)',\
org.ops4j.pax.logging.pax-logging-service;version='[1.10.1,1.10.2)',\
javafx-osgi;version='[8.0.2,8.0.3)',\
com.foo.bar.launcher;version='[0.0.1,0.0.2)',\
com.foo.bar.main-screen;version='[0.0.1,0.0.2)',\
com.foo.bar.ui-main;version='[0.0.1,0.0.2)',\
com.foo.bar.verify-screen;version='[0.0.1,0.0.2)',\
org.apache.felix.configadmin;version='[1.9.2,1.9.3)',\
com.foo.bar.launcher;version='[0.0.1,0.0.2)',\
com.foo.bar.command;version='[0.0.1,0.0.2)'
-runproperties: felix.cm.dir="${user.home}\\Documents\\Prog731\\config"
This is a small demo program with very few dependencies. As far as I can determine, neither our code nor any the external dependencies have changed. But the problem is reproducible on different development machines...
What could cause a resolution error such as this?
UPDATE:
We are using the latest development snapshots of the bndtools 4.x from the https://bndtools.ci.cloudbees.com repository. Might this be it?
UPDATE #2:
As Requested, the MANIFEST of javafx-osgi-8.0.2.jar:
Manifest-Version: 1.0
Export-Package: com.sun.javafx, com.sun.glass.ui, com.sun.javafx.anima
tion, com.sun.javafx.applet, com.sun.javafx.application, com.sun.java
fx.beans, com.sun.javafx.beans.event, com.sun.javafx.binding, com.sun
.javafx.charts, com.sun.javafx.collections, com.sun.javafx.css, com.s
un.javafx.css.converters, com.sun.javafx.css.parser, com.sun.javafx.c
ursor, com.sun.javafx.effect, com.sun.javafx.embed, com.sun.javafx.ev
ent, com.sun.javafx.font, com.sun.javafx.font.coretext, com.sun.javaf
x.font.directwrite, com.sun.javafx.font.freetype, com.sun.javafx.font
.t2k, com.sun.javafx.fxml, com.sun.javafx.fxml.builder, com.sun.javaf
x.fxml.expression, com.sun.javafx.geom, com.sun.javafx.geom.transform
, com.sun.javafx.geometry, com.sun.javafx.iio, com.sun.javafx.iio.bmp
, com.sun.javafx.iio.common, com.sun.javafx.iio.gif, com.sun.javafx.i
io.ios, com.sun.javafx.iio.jpeg, com.sun.javafx.iio.png, com.sun.java
fx.image, com.sun.javafx.image.impl, com.sun.javafx.jmx, com.sun.java
fx.logging, com.sun.javafx.media, com.sun.javafx.menu, com.sun.javafx
.perf, com.sun.javafx.print, com.sun.javafx.property, com.sun.javafx.
property.adapter, com.sun.javafx.robot, com.sun.javafx.robot.impl, co
m.sun.javafx.runtime, com.sun.javafx.runtime.async, com.sun.javafx.ru
ntime.eula, com.sun.javafx.scene, com.sun.javafx.scene.control, com.s
un.javafx.scene.control.behavior, com.sun.javafx.scene.control.skin,
com.sun.javafx.scene.control.skin.caspian, com.sun.javafx.scene.contr
ol.skin.caspian.images, com.sun.javafx.scene.control.skin.modena, com
.sun.javafx.scene.control.skin.resources, com.sun.javafx.scene.input,
com.sun.javafx.scene.layout, com.sun.javafx.scene.layout.region, com
.sun.javafx.scene.paint, com.sun.javafx.scene.shape, com.sun.javafx.s
cene.text, com.sun.javafx.scene.transform, com.sun.javafx.scene.trave
rsal, com.sun.javafx.scene.web, com.sun.javafx.scene.web.behavior, co
m.sun.javafx.scene.web.skin, com.sun.javafx.sg, com.sun.javafx.sg.pri
sm, com.sun.javafx.sg.prism.web, com.sun.javafx.stage, com.sun.javafx
.text, com.sun.javafx.tk, com.sun.javafx.tk.quantum, com.sun.javafx.u
til, com.sun.javafx.webkit, com.sun.javafx.webkit.drt, com.sun.javafx
.webkit.prism, com.sun.javafx.webkit.prism.resources, com.sun.javafx.
webkit.prism.theme, com.sun.javafx.webkit.theme, javafx, javafx.anima
tion, javafx.application, javafx.beans, javafx.beans.binding, javafx.
beans.property, javafx.beans.property.adapter, javafx.beans.value, ja
vafx.collections, javafx.collections.transformation, javafx.concurren
t, javafx.css, javafx.embed, javafx.embed.swing, javafx.event, javafx
.fxml, javafx.geometry, javafx.print, javafx.scene, javafx.scene.canv
as, javafx.scene.chart, javafx.scene.control, javafx.scene.control.ce
ll, javafx.scene.effect, javafx.scene.image, javafx.scene.input, java
fx.scene.layout, javafx.scene.media, javafx.scene.paint, javafx.scene
.shape, javafx.scene.text, javafx.scene.transform, javafx.scene.web,
javafx.stage, javafx.util, javafx.util.converter, com.sun.deploy.uito
olkit.impl.fx
Fragment-Host: system.bundle; extension:=framework
Bundle-ManifestVersion: 2
Bundle-Name: JavaFX 8 OSGi extension bundle
Bundle-License: The Apache License, Version 2.0
Bundle-SymbolicName: javafx-osgi
Bundle-Version: 8.0.2
UPDATE #3:
I think the javafx-osgi issue is not the real problem. I threw out all FX related stuff and ended up with an error saying "No OSGi framework has been added to the run path"?!

This seems to be a bug in the felix resolver:
Insights from the Bndtools bugtracker: https://github.com/bndtools/bndtools/issues/1877
Felix bugtracker: older issue with felix 5.4.0 and bndtools 3.4.0 ResolverImpl infinite loop
The above felix ticket has been open for over a year and there doesn't seem a solid understanding (yet) what the root cause is.
For those who hit the same roadblock: We ended up switchting to eclipse equinox.

Related

Starting a payara 5 has encountered

I have build a very simple project of hello world in
Payara 5 (5.181)
JSF 2.3
JDK 1.8
CDI 2.0
Maven
and encountered a problem
Unable to start server due following issues: Launch process failed with exit code 1
in console it throws an error of :
Error: Could not find or load main class server\payara5\glassfish.lib.grizzly-npn-bootstrap.jar
[PIC] Payara 5 Error
It seems that the Payara Tools for Eclipse suffer by several bugs that may cause this. In my case, the following workarounds helped:
The Payara installation path should not contain spaces (e.g. Program Files\Payara)
It seems that only Java 8 is supported at the time
Open the domain.xml configuration file for the domain you are trying to start (typically payara_install_path/glassfish/domains/domain1/config/domain1.xml) and search for "Xbootclasspath". You should find a couple of lines like
<jvm-options>[1.8.0|1.8.0u120]-Xbootclasspath/p:${com.sun.aas.installRoot}/lib/grizzly-npn-bootstrap-1.6.jar</jvm-options>
<jvm-options>[1.8.0u121|1.8.0u160]-Xbootclasspath/p:${com.sun.aas.installRoot}/lib/grizzly-npn-bootstrap-1.7.jar</jvm-options>
<jvm-options>[1.8.0u161|1.8.0u190]-Xbootclasspath/p:${com.sun.aas.installRoot}/lib/grizzly-npn-bootstrap-1.8.jar</jvm-options>
<jvm-options>[1.8.0u191|1.8.0u500]-Xbootclasspath/p:${com.sun.aas.installRoot}/lib/grizzly-npn-bootstrap-1.8.1.jar</jvm-options>
Depending of your installed Java version (try running java --version) and choose the appropriate line (most likely the last one). Remove the remaining lines and remove the [...] part at the beginning of the chosen line so you will get something like
<jvm-options>-Xbootclasspath/p:${com.sun.aas.installRoot}/lib/grizzly-npn-bootstrap-1.8.1.jar</jvm-options>
After this, the tools seem to start normally.
The Problem is with Java version. The grizzly-npn-bootstrap-1.8.1.jar Jar is placed in bootclasspath, thats why it requires proper java version to start payara server. So remove unnecessary bootstrap jar from domain.xml.
In Windows:
1) Go To ---C:\Users\xxxx\payara5\glassfish\domains\domain1\config\domain.xml
2) According to my java verson(java version "1.8.0_191") I deleted the following lines from domain.xml. So delete according to your java version.
<jvm-options>[1.8.0|1.8.0u120]-Xbootclasspath/p:${com.sun.aas.installRoot}/lib/grizzly-npn-bootstrap-1.6.jar</jvm-options>
<jvm-options>[1.8.0u121|1.8.0u160]-Xbootclasspath/p:${com.sun.aas.installRoot}/lib/grizzly-npn-bootstrap-1.7.jar</jvm-options>
<jvm-options>[1.8.0u161|1.8.0u190]-Xbootclasspath/p:${com.sun.aas.installRoot}/lib/grizzly-npn-bootstrap-1.8.jar</jvm-options>
3) Remove this [1.8.0u191|1.8.0u500] part from jvm-options & Edit the line in your domain.xml(w.r.t java -version) as shown below
<jvm-options>-Xbootclasspath/p:${com.sun.aas.installRoot}/lib/grizzly-npn-bootstrap-1.8.1.jar</jvm-options>
4) restart your server.
As Radkovo said, "The Payara installation path should not contain spaces (e.g. Program Files\Payara)", so I moved the Payara to the Documents folder.
Problem solved!

Eclipse Oxygen fails to run - org.eclipse.swt.SWTException: Invalid thread access

I have following problem: my eclipse Oxygen fails to run(error attached).
Everything is fine on fresh instalation, when I run it just after downloading (tested on 1a september and 2 december). However, when i restart my computer, eclipse won't start again unless i will reinstall it.
I have cleared both eclipse cache as same as my project (even fetched fresh version from repo), workspace and eclipse instalation place is also fresh.
I have read e.g. https://bugs.eclipse.org/bugs/show_bug.cgi?id=475392, https://bugs.eclipse.org/bugs/show_bug.cgi?id=514895 and other related posts, didn't help though.
Any idea? I am working on windows 10 64 bit, and JDK 9.0.1+11. My only plugin is BndTools 3.5, latest, project requires java 8 (current runtime jdk is 152).
Problem started on friday, 15 dec after running my project and resolving dependencies at example bnd project (http://enroute.osgi.org/tutorial_base/600-testing.html) at the same time. Couldn't run eclipse after that.
However, i did it before and didn't meet any problems (i mean opening example and running it). Also, I have cleared p2, mvn and bnd cache.
Below mentioned stack from eclipse .log:
!SESSION 2017-12-18 16:47:57.660 -----------------------------------------------
eclipse.buildId=4.7.2.M20171123-0800
java.version=9.0.1
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=pl_PL
Framework arguments: -product org.eclipse.epp.package.java.product
Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product
!ENTRY org.eclipse.osgi 4 0 2017-12-18 16:47:59.711
!MESSAGE Application error
!STACK 1
org.eclipse.swt.SWTException: Invalid thread access
at org.eclipse.swt.SWT.error(SWT.java:4533)
at org.eclipse.swt.SWT.error(SWT.java:4448)
at org.eclipse.swt.SWT.error(SWT.java:4419)
at org.eclipse.swt.widgets.Display.error(Display.java:1263)
at org.eclipse.swt.widgets.Display.checkDevice(Display.java:767)
at org.eclipse.swt.widgets.Display.addListener(Display.java:628)
at org.eclipse.ui.internal.ide.application.IDEWorkbenchAdvisor.<init>(IDEWorkbenchAdvisor.java:187)
at org.eclipse.ui.internal.ide.application.IDEWorkbenchAdvisor.<init>(IDEWorkbenchAdvisor.java:195)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
at org.eclipse.equinox.launcher.Main.run(Main.java:1499)
Diff between fresh and dirty instalation
Update
After flushing whole system, problem gone for a while, however came back again, so it eliminates OS influence in my opinion.
As Struarf mentioned in his answer, deletion of configuration/org.eclipse.osgi templorary solves problem.
Nevertheless, when i have installed oxygen 2, I noticed that this problem is much more rarer than before (actually now 2nd time for 2 weeks, whether before was with each possible occasion), so maybe it comes in a good way...
I've just commented on bug 477247. I'm getting a similar exception (on OSX). What allows me to start Eclipse without reinstalling is to delete the configuration/org.eclipse.osgi folder. It looked like a bundle cache, and deleting such caches has worked elsewhere for me. Hopefully this might also provide a clue for the devs.
You seem to hit bug 477247. Until now, Eclipse developers were not able to reproduce the issue, maybe you can help them by adding steps to reproduce to the bug, or any other useful details.

Test Case failures with a java.lang.ArrayIndexOutOfBoundsException: 28526 with JDK 8 and terracotta 3.4.0

I currently moved maven java code from jdk7 to jdk8 which uses terracotta and was working properly but after changing it to jdk8 , my test cases are getting failed. I am getting following error and I didn't get any clues through searching.
java.lang.ArrayIndexOutOfBoundsException: 28526
at com.tc.asm.ClassReader.readClass(ClassReader.java:2015)
at com.tc.asm.ClassReader.getClassName(ClassReader.java:229)
at com.tc.aspectwerkz.reflect.impl.asm.AsmClassInfo.getClassInfo(AsmClassInfo.java:305)
at com.tc.aspectwerkz.reflect.impl.asm.AsmClassInfo.createClassInfoFromStream(AsmClassInfo.java:717)
at com.tc.aspectwerkz.reflect.impl.asm.AsmClassInfo.getClassInfo(AsmClassInfo.java:256)
at com.tc.aspectwerkz.reflect.impl.asm.AsmClassInfo.getInterfaces(AsmClassInfo.java:558)
at com.tc.aspectwerkz.expression.regexp.TypePattern.matchInterfaces(TypePattern.java:147)
at com.tc.aspectwerkz.expression.regexp.TypePattern.matchInterfaces(TypePattern.java:147)
at com.tc.aspectwerkz.expression.regexp.TypePattern.matchSuperClasses(TypePattern.java:120)
at com.tc.aspectwerkz.expression.regexp.TypePattern.matchType(TypePattern.java:92)
at com.tc.aspectwerkz.expression.ExpressionVisitor.visit(ExpressionVisitor.java:437)
at com.tc.aspectwerkz.expression.ast.ASTClassPattern.jjtAccept(ASTClassPattern.java:24)
at com.tc.aspectwerkz.expression.ExpressionVisitor.visitAnnotatedNode(ExpressionVisitor.java:1016)
at com.tc.aspectwerkz.expression.ExpressionVisitor.visit(ExpressionVisitor.java:237)
at com.tc.aspectwerkz.expression.ast.ASTWithin.jjtAccept(ASTWithin.java:22)
at com.tc.aspectwerkz.expression.ExpressionVisitor.visit(ExpressionVisitor.java:100)
at com.tc.aspectwerkz.expression.ast.ASTExpression.jjtAccept(ASTExpression.java:22)
at com.tc.aspectwerkz.expression.ExpressionVisitor.visit(ExpressionVisitor.java:88)
at com.tc.aspectwerkz.expression.ExpressionVisitor.match(ExpressionVisitor.java:74)
at com.tc.object.config.ClassExpressionMatcherImpl.match(ClassExpressionMatcherImpl.java:24)
at com.tc.object.config.CompoundExpressionMatcher.match(CompoundExpressionMatcher.java:18)
at com.tc.object.config.StandardDSOClientConfigHelperImpl.shouldBeAdapted(StandardDSOClientConfigHelperImpl.java:1242)
at com.tc.object.bytecode.hook.impl.DefaultWeavingStrategy.transformInternal(DefaultWeavingStrategy.java:184)
at com.tc.object.bytecode.hook.impl.DefaultWeavingStrategy.transform(DefaultWeavingStrategy.java:134)
at com.tc.object.bytecode.hook.impl.DSOContextImpl.preProcess(DSOContextImpl.java:288)
at com.tc.object.bytecode.hook.impl.DSOContextImpl.transform(DSOContextImpl.java:392)
at org.terracotta.express.ClusteredStateLoader.transform(ClusteredStateLoader.java:124)
at org.terracotta.express.ClusteredStateLoader.loadClass(ClusteredStateLoader.java:83)
at org.terracotta.modules.ehcache.store.TerracottaClusteredInstanceFactory$1.call(TerracottaClusteredInstanceFactory.java:319)
at org.terracotta.modules.ehcache.store.TerracottaClusteredInstanceFactory$1.call(TerracottaClusteredInstanceFactory.java:317)
at org.terracotta.api.Terracotta.lookupOrCreateRoot(Terracotta.java:47)
at org.terracotta.modules.ehcache.store.TerracottaClusteredInstanceFactory.getStoreRoot(TerracottaClusteredInstanceFactory.java:316)
at org.terracotta.modules.ehcache.store.TerracottaClusteredInstanceFactory.getStoreMapForCacheManager(TerracottaClusteredInstanceFactory.java:77)
at org.terracotta.modules.ehcache.store.TerracottaClusteredInstanceFactory.getOrCreateStore(TerracottaClusteredInstanceFactory.java:68)
at org.terracotta.modules.ehcache.store.TerracottaClusteredInstanceFactory.createStore(TerracottaClusteredInstanceFactory.java:64)
at net.sf.ehcache.terracotta.StandaloneTerracottaClusteredInstanceFactory.createStore(StandaloneTerracottaClusteredInstanceFactory.java:40)
Thank you
As stated in one of the comments, Terracotta 3.4.0 is not Java 8 compatible and given the way the old Terracotta version worked, this is not a surprise.
You will have to update to a later version if you must have Java 8 support.
The exact version will depend on the usage you are making of Terracotta - if you need DSO support, you have to stick with the 3.7.x line.
For Ehcache support, it is recommended to upgraded to the latest version in the 4.3.x line.

Missing some spoon steps (plugins) at runtime (KarafLifecycleListener Error)

I am using open-source Pentaho distribution from github.com (version 6.1-SNAPSHOT).
In Spoon there are some step missing (e.g. There is no Mongodb input/output step listed) and I cant add dataservice to step (There are no errors, this option just isn't on the list).
I have reinstalled everything (removed .kettle and .pentaho directories as well as whole source and distribution) but it didn't help.
This is what I get at spoon startup:
16:05:50,304 INFO [KarafInstance]
* Karaf Instance Number: 1 at ~/pentaho-kettle/d
ist/./system/karaf//data1
Karaf Port:8801
OSGI Service Port:9050 *
Dec 23, 2015 4:05:51 PM org.apache.karaf.main.Main$KarafLockCallback
lockAquired
INFO: Lock acquired. Setting startlevel to 100
2015/12/23 16:05:53 - cfgbuilder - Warning: The configuration
parameter [org] is not supported by the default configuration builder
for scheme: sftp
Dec 23, 2015 4:05:58 PM
org.pentaho.caching.impl.PentahoCacheManagerFactory$RegistrationHandler$1
onSuccess INFO: New Caching Service registered
16:06:04,009 ERROR [KarafLifecycleListener] The Kettle Karaf Lifycycle
Listener failed to execute properly. Releasing lifecycle hold, but
some services may be unavailable.
I suspect that
ERROR [KarafLifecycleListener] The Kettle Karaf Lifycycle Listener
failed to execute properly. Releasing lifecycle hold, but some
services may be unavailable.
has something to do with it as missing plugins reside somewhere under karaf/ directory.
It was working just fine week ago.
I am using Ubuntu 15.04.
I will be grateful for any hints.
Greetings.
you are using a non stable release. this is the place where you can download the latest stable release http://sourceforge.net/projects/pentaho/
Agreed with jipipayo, For Pentaho CE version, download it from http://community.pentaho.com/ official instead of github. It is highly possible that the codes in github might be in unstable condition.
Also in case you have a missing plugin, try using the Pentaho Marketplace and download the required plugins.
Hope this helps :)

Apache Extras Cassandra-JDBC: Invalid method name: 'prepare_cql_query'

I'm using the Apache Extras project cassandra-jdbc ( http://code.google.com/a/apache-extras.org/p/cassandra-jdbc/ ) on version 1.1.1 along with the cassandra-thrift and cassandra-clientutil dependencies on version 1.1.1.
My Cassandra version is 1.0.10 though. I had to use the cassandra-jdbc on version 1.1.1 because the PreparedStatements were not available in earlier versions.
The problem I'm getting is:
org.apache.thrift.TApplicationException: Invalid method name: 'prepare_cql_query'
at org.apache.thrift.TApplicationException.read(TApplicationException.java:108)
at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:71)
at org.apache.cassandra.thrift.Cassandra$Client.recv_prepare_cql_query(Cassandra.java:1438)
I read somewhere else ( https://wso2.org/jira/browse/CARBON-13577 ) this might be solved by upgrading Cassandra to 1.1.0, but I'm using DataStax so I'm not sure I can upgrade it. Is there another way to get past this?
That is for the simple reason that prepared statements are not supported until Cassandra 1.1: https://issues.apache.org/jira/browse/CASSANDRA-2475

Resources