Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

osgi.enroute.gogo.shell.provider errors on Windows #73

Open
swimmesberger opened this issue Nov 29, 2016 · 7 comments
Open

osgi.enroute.gogo.shell.provider errors on Windows #73

swimmesberger opened this issue Nov 29, 2016 · 7 comments

Comments

@swimmesberger
Copy link
Contributor

I have observed on Windows 7 and Windows 10 that using osgi.enroute.gogo.shell.provider gives Exception in thread "OSGi enRoute Gogo Shell" java.lang.UnsatisfiedLinkError: Could not load library. Reasons: [no jansi in java.library.path]
at org.fusesource.hawtjni.runtime.Library.doLoad(Library.java:182)
at org.fusesource.hawtjni.runtime.Library.load(Library.java:140)
at org.fusesource.jansi.internal.CLibrary.(CLibrary.java:42)
at org.fusesource.jansi.AnsiConsole.wrapOutputStream(AnsiConsole.java:48)
at org.fusesource.jansi.AnsiConsole.(AnsiConsole.java:38)
at jline.AnsiWindowsTerminal.detectAnsiSupport(AnsiWindowsTerminal.java:57)
at jline.AnsiWindowsTerminal.(AnsiWindowsTerminal.java:27)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at jline.TerminalFactory.getFlavor(TerminalFactory.java:211)
at jline.TerminalFactory.create(TerminalFactory.java:102)
at jline.TerminalFactory.get(TerminalFactory.java:186)
at jline.TerminalFactory.get(TerminalFactory.java:192)
at osgi.enroute.gogo.shell.provider.Shell$1.run(Shell.java:153)
at java.lang.Thread.run(Unknown Source)

Also referenced here: osgi/osgi.enroute#17
This should actually be the correct place for this issue.

@swimmesberger
Copy link
Contributor Author

swimmesberger commented Nov 29, 2016

There seems to be an additional issue with enroute shell on Windows when running from eclipse. (running with cmd.exe seems to work fine). The console prints out the motd and the prompt "G!" but does not accept any input. The problem seems to be in jline (jline/jline2#245). I have posted some additional info about jline internals in the referenced issue above so the only way to fix enroute shell on windows in eclipse is using the "-Djline.terminal=jline.UnsupportedTerminal" JVM argument. Maybe we can add a fix by detecting such an environment (windows && eclipse) and programmatically set the system property for jline.

@pkriens
Copy link
Member

pkriens commented Nov 29, 2016 via email

@swimmesberger
Copy link
Contributor Author

swimmesberger commented Nov 30, 2016

Using the "org.apache.felix:org.apache.felix.gogo.jline:1.0.0" bundle on Windows 10:
Running in Eclipse results in the following exception:

java.io.IOException: Could not get the screen info: T h e o p e r a t i o n c o m p l e t e d s u c c e s s f u l l y .
at org.fusesource.jansi.WindowsAnsiOutputStream.getConsoleInfo(WindowsAnsiOutputStream.java:105)
	at org.fusesource.jansi.WindowsAnsiOutputStream.<init>(WindowsAnsiOutputStream.java:98)
	at org.jline.terminal.impl.jansi.JansiWinSysTerminal.<init>(JansiWinSysTerminal.java:32)
	at org.jline.terminal.TerminalBuilder.doBuild(TerminalBuilder.java:146)
	at org.jline.terminal.TerminalBuilder.build(TerminalBuilder.java:109)
	at org.apache.felix.gogo.jline.Activator.doStartShell(Activator.java:136)
	at org.apache.felix.gogo.jline.Activator.lambda$startShell$0(Activator.java:106)
	at java.lang.Thread.run(Thread.java:745)

Running in cmd.exe works with autocomplete and all that stuff but executing a command results in a empty line printed out without any result for most of the commands. e.g. scr:list gives me the expected result but context:bundles, system:nanotime, ... just prints out a empty line without a result.

Running in powershell is kind of similar but instead of an empty line I just get the prompt again without any output.

Using the "org.apache.felix:org.apache.felix.gogo.shell:1.0.0" bundle works as expected running in eclipse, cmd and powershell (but without all the neat stuff jline brings e.g. autocomplete, coloring etc...)

So currently the gogo:shell seems to be the only one which works correctly on Windows and therefore seems to be the best bet on Windows unfortunately.

pkriens added a commit that referenced this issue Dec 14, 2016
Include jansi native libaries in osgi.enroute.gogo.shell.provider bundle
@oliver-brm
Copy link

Hi,
I'm afrait, I cannot continue with the tutorial because of this. Sorry, I do not know how to try the new Gogo shell from Felix. I tried to modify the -runbundles but that doesn't do the trick...

@pkriens
Copy link
Member

pkriens commented Feb 6, 2017 via email

@oliver-brm
Copy link

I'm afraid it still is an issue on Windows... I started over from a fresh workspace and had also the local Maven repository completely deleted. I'm using version 2.0.0 of the osgi.enroute.* bundles (so far, this is the most recent version in the osgi-snapshots repository).

My -runbundles are:

org.apache.felix.configadmin;version='[1.8.8,1.8.9)',\
org.apache.felix.gogo.runtime;version='[0.16.2,0.16.3)',\
org.apache.felix.log;version='[1.0.1,1.0.2)',\
org.apache.felix.scr;version='[2.0.2,2.0.3)',\
org.eclipse.equinox.metatype;version='[1.4.100,1.4.101)',\
org.osgi.service.metatype;version='[1.3.0,1.3.1)',\
osgi.enroute.examples.eval.simple.provider;version='[1.0.0,1.0.1)',\
osgi.enroute.gogo.shell.provider;version='[2.0.0,2.0.1)'

So far, this all seems completely aligned with the Maven tutorial. Still, it won't run on Windows. Ubuntu is fine, though! 🥇

I'm thinking about some kind of Continuous Integration that can automatically test this for Windows, too. Is there something like this already set up or would that be of interest for the enRoute project?

Kind regards
Oliver Marienfeld

@pkriens
Copy link
Member

pkriens commented Mar 6, 2017

Can you provide a PR?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants