Why can't I see any help in osgi console? - eclipse

When I type help in the osgi console of my application : nothing happens :(. SS gives me the bundle list, lb also, scr:list, the service list etc. But help : nothing !
Here is my conf (launch.bndrun) :
-runfw: org.eclipse.osgi;version='[3.16.100.v20201030-1916,3.16.200.v20210226-1447]'
-runee: JavaSE-1.8
-runprovidedcapabilities: ${native_capability}
-resolve.effective: auto
-runbundles: \
org.eclipse.paho.client.mqttv3;version='[1.2.5,1.2.6)',\
org.avm.device.api;version=snapshot,\
org.avm.device.afficheur;version=snapshot,\
org.avm.device.common;version=snapshot,\
org.avm.device.driver.afficheur;version=snapshot,\
org.avm.device.driver.girouette;version=snapshot,\
org.avm.device.girouette;version=snapshot,\
org.apache.servicemix.bundles.junit;version='[4.13.0,4.13.1)',\
org.avm.device.driver.gps;version=snapshot,\
org.avm.device.gps;version=snapshot,\
org.avm.device.comptage;version=snapshot,\
org.avm.device.driver.comptage;version=snapshot,\
org.avm.device.audio;version=snapshot,\
org.avm.device.driver.audio;version=snapshot,\
org.avm.device.driver.io;version=snapshot,\
org.avm.device.io;version=snapshot,\
org.avm.device.driver.modem;version=snapshot,\
org.avm.device.modem;version=snapshot,\
org.apache.felix.gogo.command;version='[1.1.2,1.1.3)',\
org.apache.felix.gogo.runtime;version='[1.1.4,1.1.5)',\
org.apache.felix.gogo.shell;version='[1.1.4,1.1.5)',\
org.apache.commons.commons-fileupload;version='[1.4.0,1.4.1)',\
org.apache.commons.commons-io;version='[2.8.0,2.8.1)',\
org.apache.felix.webconsole;version='[4.6.0,4.6.1)',\
org.apache.felix.http.jetty;version='[4.1.6,4.1.7)',\
org.apache.felix.http.servlet-api;version='[1.1.2,1.1.3)',\
org.apache.felix.scr;version='[2.1.24,2.1.25)',\
org.eclipse.equinox.cm;version='[1.5.0,1.5.1)',\
org.eclipse.equinox.console;version='[1.4.300,1.4.301)',\
org.eclipse.osgi.services;version='[3.10.0,3.10.1)',\
org.eclipse.osgi.util;version='[3.6.0,3.6.1)',\
org.eclipse.equinox.device;version='[1.1.100,1.1.101)'
-runrequires: \
bnd.identity;id='org.apache.servicemix.bundles.junit',\
bnd.identity;id='org.eclipse.osgi',\
bnd.identity;id='org.apache.felix.gogo.shell',\
osgi.identity;filter:='(osgi.identity=org.apache.felix.gogo.command)',\
bnd.identity;id='org.apache.felix.gogo.runtime',\
bnd.identity;id='org.eclipse.equinox.console',\
bnd.identity;id='org.eclipse.equinox.cm',\
bnd.identity;id='org.eclipse.paho.client.mqttv3',\
bnd.identity;id='org.apache.felix.scr',\
bnd.identity;id='org.apache.felix.webconsole',\
bnd.identity;id='org.apache.felix.http.jetty',\
bnd.identity;version='latest';id='org.avm.device.api',\
bnd.identity;version='latest';id='org.avm.device.common',\
bnd.identity;version='latest';id='org.avm.device.driver.afficheur',\
bnd.identity;version='latest';id='org.avm.device.driver.girouette',\
bnd.identity;version='latest';id='org.avm.device.driver.gps',\
bnd.identity;version='latest';id='org.avm.device.driver.comptage',\
bnd.identity;version='latest';id='org.avm.device.driver.audio',\
bnd.identity;version='latest';id='org.avm.device.driver.io',\
bnd.identity;version='latest';id='org.avm.device.driver.modem',\
bnd.identity;version='latest';id='org.avm.device.afficheur',\
bnd.identity;version='latest';id='org.avm.device.girouette',\
bnd.identity;version='latest';id='org.avm.device.gps',\
bnd.identity;version='latest';id='org.avm.device.comptage',\
bnd.identity;version='latest';id='org.avm.device.audio',\
bnd.identity;version='latest';id='org.avm.device.io',\
bnd.identity;version='latest';id='org.avm.device.modem',\
bnd.identity;id='org.apache.felix.http.servlet-api',\
bnd.identity;id='org.apache.commons.commons-fileupload',\
bnd.identity;id='org.eclipse.equinox.device'
-runproperties: \
osgi.console,\
logback.configurationFile=${fileuri;${.}/logback.xml}
I try to change -runfw with felix and but then I can't find a suitable bundle implementing org.osgi.service.device ; but help works in this case.
So to summerize either my application doesn't work or I can't have help.
It might be something obvious that I missed, but I don't see it (2 days, I'm on it !!).
Thanks for any advice.

If you have a problem like this, the approach is always to remove, remove, remove. You keep removing bundles until the problems is solved. The last step you did usually puts some light on why the help did not work. And if you end up with only the Gogo bundles, it is easy to diagnose for people like me.
I would start to remove first :
org.eclipse.equinox.console;version='[1.4.300,1.4.301)',\
You now seem to have 2 shells. Should still have help though. So it is not a full explanation.
I've written a replacement for org.apache.felix.gogo.command that includes a help. Maven coordinates:
biz.aQute:biz.aQute.gogo.commands.provider:1.7.0
It also includes many more commands. Source code is on github

Related

How does babel option ""auxiliaryCommentBefore" or "auxiliaryCommentAfter" work?

I installed Babel("babel-cli": "^6.26.0") and and made a .babelrc like
{
"auxiliaryCommentBefore": "testBefore",
"auxiliaryCommentAfter": "testAfter"
}
and also made a simple test.js like
var a = 5;
and finally run babel test.js.
It secceded but no comment above is attached..
My expectation is something like below.
testBefore
var a = 5;
testAfter
Is there anything required missing??
The honest answer to your question is "they don't" :D
The specific behavior of those two options are extremely under-defined and I would love to rip them out of Babel entirely, and I would except that I don't want to needlessly break existing users when they upgrade.
If you need to annotate some input code in a particular way, you should write your own Babel plugin to inject whatever you need instead.

regeneratorRuntime error with new au-cli

I'm trying to convert an existing project to use the aurelia cli and I've encountered an old problem. I'm getting a regeneratorRuntime is not defined error. I fixed this a while back in a previous version but either my memory is hazy or that knowledge doesn't apply to this version. Can anyone point me to a source or give me some advice on how to fix this with this version?
Thanks,
Ross
The solution that worked for me was to add the babel-polyfill to the vendor-bundle section of aurelia-project/aurelia.json, like this:
"name": "vendor-bundle.js",
"prepend": [
"node_modules/babel-polyfill/dist/polyfill.js",
"node_modules/bluebird/js/browser/bluebird.core.js",
"scripts/require.js"
]
I was able to get it. Once you get how the aurelia.json file works, it's not to difficult. Add this to aurelia.json:
{
"name": "regenerator-runtime",
"path": "../node_modules/regenerator-runtime",
"main": "runtime-module"
}
Then add this to main.js:
```
import regeneratorRuntime from 'regenerator-runtime';
window.regeneratorRuntime = regeneratorRuntime;
```
Thanks for everyone's suggestions.
A hackish solution for now (thanks to Roland Quast #rquast from https://gitter.im/aurelia):
You need to install and require babel-polyfill in your main.js file explicitly:
require('node_modules/babel-polyfill/dist/polyfill.js')

neo4jphp: Cannot instantiate abstract class Everyman\Neo4j\Transport

maybe a simple question but for me as starter with Neo4j a hurdle. I installed the neo4jphp with composer in the same directory as my application. Vendor-Subfolder has been created and the everyman/neo4j folder below is available. For a first test I used this code snippet from the examples:
spl_autoload_register(function ($className) {
$libPath = 'vendor\\';
$classFile = $className.'.php';
$classPath = $libPath.$classFile;
if (file_exists($classPath)) {
require($classPath);
}
});
require('vendor/autoload.php');
use everyman\Neo4j\Client,
everyman\Neo4j\Transport;
$client = new Client(new Transport('localhost', 7474));
print_r($client->getServerInfo());
I always stumple upon the error
Fatal error: Cannot instantiate abstract class Everyman\Neo4j\Transport
Googling brought me to a comment from Josh Adell stating
You can't instantiate Everyman\Neo4j\Transport, since it is an abstract class. You must instantiate Everyman\Neo4j\Transport\Curl or Everyman\Neo4j\Transport\Stream depending on your needs
So I thought I just need to alter the use-statements to
use everyman\Neo4j\Client,
everyman\Neo4j\Transport\Curl;
but this doesnt work, debugging shows, that the autoloader only get "Transport.php" instead of "everyman\Neo4j\Transport\Curl.php". For "Client.php" its still working ("vendor\everyman\Neo4j\Client.php") so I am guessing that the use-statement is wrong or the code is not able to handle an additional subfolder-structure.
Using
require('phar://neo4jphp.phar');
works fine but I read that this is deprecated and should be replaced by composer / autoload.
Anyone has a hint what to change or had the same problem?
Thanks for your time,
Balael
Curl is the default transport. You only need to instantiate your own Transport object if you want to use Stream instead of Curl. If you really want to instantiate your own Curl Transport, the easiest change to your existing code is to modify the use statement to be:
use everyman\Neo4j\Client,
everyman\Neo4j\Transport\Curl as Transport;
Also, you don't need to register your own autoload function if you are using the Composer package. vendor/autoload.php does that for you.
Thanks Josh, I was trying but it seems I still stuck somewhere. I am fine with using the default CURL - so I shrinked the code down to
require('vendor/autoload.php');
use everyman\Neo4j\Client;
$client = new Everyman\Neo4j\Client('localhost', 7474);
print_r($client->getServerInfo());`
The folder structure is main (here are the files and the composer.json with the content
{
"require": {
"everyman/Neo4j": "dev-master"
}
}
and in the subfolder "vendor" we have the "autoload.php" and the subfolder everyman with the related content. When I run the file I come out with
Fatal error: Class 'Everyman\Neo4j\Client' not found
which does not happen when I have the autoloadfunction. I guess I made a mistake somewehere - can you give me a hint?
Thanks a lot, B
Hmmm... I was just trying around and it seems the Transport CLASS is not needed in the use-statement and the class instantiation. This seems to work:
require('vendor/autoload.php');
use everyman\Neo4j\Client;
$client = new Client();
print_r($client->getServerInfo());
also valid for having a dedicated server/port:
$client = new Everyman\Neo4j\Client('localhost', 7474);
If you have more input I would be happy to learn more - thanks, all input & thoughts are very appreciated.
Balael

GetExportedValues<MyType> returns nothing, I can see the parts

I have a strange MEF problem, I tested this in a test project and it all seems to work pretty well but for some reason not working in the real project
This is the exporting code
public void RegisterComponents()
{
_registrationBuilder = new RegistrationBuilder();
_registrationBuilder
.ForTypesDerivedFrom(typeof(MyType))
.SetCreationPolicy(CreationPolicy.NonShared)
.Export();
var catalog = new AggregateCatalog();
catalog.Catalogs.Add(new AssemblyCatalog(typeof(MyType).Assembly, _registrationBuilder));
var directoryCatalog = new DirectoryCatalog(PathToMyTypeDerived, _registrationBuilder);
catalog.Catalogs.Add(directoryCatalog);
_compositionContainer = new CompositionContainer(catalog);
_compositionContainer.ComposeParts();
var exports = _compositionContainer.GetExportedValues<MyType>();
Console.WriteLine("{0} exports in AppDomain {1}", exports.Count(), AppDomain.CurrentDomain.FriendlyName);
}
exports count is 0 :( Any ideas why?
IN the log file I have many of this
System.ComponentModel.Composition Information: 6 : The ComposablePartDefinition 'SomeOthertype' was ignored because it contains no exports.
Though I would think this is ok because I wasn' interested in exporting 'someOtherType'
UPDATE: I found this link but after debuging over it I am not wiser but maybe I m not following up properly.
Thanks for any pointers
Cheers
I just had the same problem and this article helped me a lot.
It describes different reasons why a resolve can fail. One of the more important ones is that the dependency of a dependency of the type you want to resolve is not registered.
What helped me a lot was the the trace output that gets written to the Output window when you debug your application. It describes exactly the reasons why a type couldn't be resolved.
Even with this output. you might need to dig a little bit, because I only got one level deep.
Example:
I wanted to resolve type A and I got a message like this:
System.ComponentModel.Composition Warning: 1 : The ComposablePartDefinition 'Namespace.A' has been rejected. The composition remains unchanged. The changes were rejected because of the following error(s): The composition produced multiple composition errors, with 1 root causes. The root causes are provided below. Review the CompositionException.Errors property for more detailed information.
1) No exports were found that match the constraint:
ContractName Namespace.IB
RequiredTypeIdentity Namespace.IB
Resulting in: Cannot set import 'Namespace.A..ctor (Parameter="b", ContractName="namespace.IB")' on part 'Namespace A'.
Element: Namespace.A..ctor (Parameter="b", ContractName="Namespace.IB") --> Namespace.A --> AssemblyCatalog (Assembly="assembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=...")
But I clearly saw a part for Namespace.IB. So, in the debugger, I tried to resolve that one. And I got another trace output. This time it told me that my implementation of Namespace.IB couldn't be resolved because for one of its imports there was a missing export, so basically the same message as above, just with different types. And this time, I didn't find a part for that missing import. Now I knew, which type was the real problem and figure out, why no registration happened for it.

Enterprise Library Logging tracelistener extension issue with resolving ILogFormatter

I have been sitting with a problem for quite a while now and I just can't seem to find what I'm missing.
I have written a custom trace listener component for Enterprise Library 5.0 for the Logging application block which works but the configured ILogFormatter just won't resolve and so I always end up with the basic string text when it gets handled by my component.
I saw in the enterprise library source code that they use the "Container.ResolvedIfNotNull()" method. It doesn't seem to work for me. I need it to write out a custom formatted string for my component to use. You know, not just the message but the timestamp, machinename, threadId, etc.
Does anyone have any ideas on how to fix this?
Thanks in advance.
Like I've mentioned on this site: http://entlib.codeplex.com/discussions/261749
When you create your CreationExpression in the TraceListener data class make sure you have a flat constructor definition. To put it in other words, don't return:
() => new MyTraceListener(new TraceListenerConfig(..., Container.ResolvedIfNotNull<ILogFormatter>(), ...));
just have it in the constructor of the MyTraceListener:
() => new MyTraceListener(..., Container.ResolvedIfNotNull<ILogFormatter>(), ...);