Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

osgi: removed com.eclipsesource.json from Import-Packages #3749

Merged
merged 1 commit into from Oct 13, 2014

Conversation

mcaserta
Copy link
Contributor

@mcaserta mcaserta commented Oct 1, 2014

com.eclipsesource.json should not appear in the list of
imported packages since it is relocated by the maven
shade plugin as com.hazelcast.com.eclipsesource.json

com.eclipsesource.json should not appear in the list of
imported packages since it is relocated by the maven
shade plugin as com.hazelcast.com.eclipsesource.json
@devOpsHazelcast
Copy link
Collaborator

verify

@pveentjer
Copy link
Contributor

@noctarius can you have a look at this since you know a lot about OSGI.

@mcaserta
Copy link
Contributor Author

mcaserta commented Oct 2, 2014

The reason for this is, actually, if you want to install the hazelcast bundle in an OSGi container, you need to (this is karaf for instance):

$ osgi:install -s mvn:com.eclipsesource.minimal-json/minimal-json/0.9.1
$ osgi:install -s mvn:com.hazelcast/hazelcast/3.3.1

I suppose this happens because the maven bundle plugin runs before the maven shade plugin, therefore it senses the dependency on the com.eclipsesource.json package and adds it to the imported packages. In reality, the dependency isn't needed because the shade plugin later incorporates the com.eclipsesource.json bytecode into the hazelcast jar, also rewriting the hazelcast bytecode to reference the shaded com.hazelcast.com.eclipsesource.json stuff.

Once the dependency is removed, the hazelcast bundle is self contained and can be installed like this:

$ osgi:install -s mvn:com.hazelcast/hazelcast/3.3.1

@mdogan
Copy link
Contributor

mdogan commented Oct 13, 2014

verify

mdogan added a commit that referenced this pull request Oct 13, 2014
osgi: removed com.eclipsesource.json from Import-Packages
@mdogan mdogan merged commit 0af62f6 into hazelcast:master Oct 13, 2014
@thomasmodeneis
Copy link

On fuse 6.1 when I run:

JBossFuse:karaf@root> osgi:install -s mvn:com.hazelcast/hazelcast/3.5.3

I get into the same error reported, (detail: I've enabled javax.script on etc/jre.properties for both 1.6 and 1.7) but either removing or not I run into the same error.

2015-11-12 14:17:01,309 | INFO  | l Console Thread | Console                          | ?                                   ? | 17 - org.apache.karaf.shell.console - 2.3.0.redhat-611412 | Exception caught while executing command
org.apache.karaf.shell.console.MultiException: Error installing bundles:
    Unable to start bundle mvn:com.hazelcast/hazelcast/3.5.3: Activator start error in bundle com.hazelcast [358].
    at org.apache.karaf.shell.console.MultiException.throwIf(MultiException.java:91)[17:org.apache.karaf.shell.console:2.3.0.redhat-611412]
    at org.apache.karaf.shell.osgi.InstallBundle.doExecute(InstallBundle.java:70)[39:org.apache.karaf.shell.osgi:2.3.0.redhat-611412]
    at org.apache.karaf.shell.console.OsgiCommandSupport.execute(OsgiCommandSupport.java:39)[17:org.apache.karaf.shell.console:2.3.0.redhat-611412]
    at org.apache.felix.gogo.commands.basic.AbstractCommand.execute(AbstractCommand.java:35)[17:org.apache.karaf.shell.console:2.3.0.redhat-611412]
    at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:78)[19:org.apache.felix.gogo.runtime:0.11.0.redhat-611412]
    at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:477)[19:org.apache.felix.gogo.runtime:0.11.0.redhat-611412]
    at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:403)[19:org.apache.felix.gogo.runtime:0.11.0.redhat-611412]
    at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[19:org.apache.felix.gogo.runtime:0.11.0.redhat-611412]
    at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)[19:org.apache.felix.gogo.runtime:0.11.0.redhat-611412]
    at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)[19:org.apache.felix.gogo.runtime:0.11.0.redhat-611412]
    at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89)[19:org.apache.felix.gogo.runtime:0.11.0.redhat-611412]
    at org.apache.karaf.shell.console.jline.Console.run(Console.java:189)[17:org.apache.karaf.shell.console:2.3.0.redhat-611412]
    at org.apache.karaf.shell.console.jline.DelayedStarted.run(DelayedStarted.java:61)[17:org.apache.karaf.shell.console:2.3.0.redhat-611412]
Caused by: java.lang.Exception: Unable to start bundle mvn:com.hazelcast/hazelcast/3.5.3: Activator start error in bundle com.hazelcast [358].
    at org.apache.karaf.shell.osgi.InstallBundle.doExecute(InstallBundle.java:53)[39:org.apache.karaf.shell.osgi:2.3.0.redhat-611412]
    ... 11 more
Caused by: org.osgi.framework.BundleException: Activator start error in bundle com.hazelcast [358].
    at org.apache.felix.framework.Felix.doActivateBundle(Felix.java:2437)[org.apache.felix.framework-4.0.3.redhat-611412.jar:]
    at org.apache.felix.framework.Felix$7.call(Felix.java:2325)[org.apache.felix.framework-4.0.3.redhat-611412.jar:]
    at org.apache.felix.framework.Felix$6.call(Felix.java:2208)[org.apache.felix.framework-4.0.3.redhat-611412.jar:]
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)[:1.7.0_79]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_79]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_79]
    at java.lang.Thread.run(Thread.java:745)[:1.7.0_79]
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.7.0_79]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:1.7.0_79]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_79]
    at java.lang.reflect.Method.invoke(Method.java:606)[:1.7.0_79]
    at com.hazelcast.internal.osgi.Activator.activateJavaxScripting(Activator.java:70)[358:com.hazelcast:3.5.3]
    at com.hazelcast.internal.osgi.Activator.start(Activator.java:46)[358:com.hazelcast:3.5.3]
    at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:645)[org.apache.felix.framework-4.0.3.redhat-611412.jar:]
    at org.apache.felix.framework.Felix.doActivateBundle(Felix.java:2387)[org.apache.felix.framework-4.0.3.redhat-611412.jar:]
    ... 6 more
Caused by: java.lang.NoSuchMethodError: javax.script.ScriptEngineManager.setBindings(Ljavax/script/Bindings;)V
    at com.hazelcast.internal.osgi.OSGiScriptEngineManager.createScriptEngineManager(OSGiScriptEngineManager.java:262)
    at com.hazelcast.internal.osgi.OSGiScriptEngineManager.findManagers(OSGiScriptEngineManager.java:235)
    at com.hazelcast.internal.osgi.OSGiScriptEngineManager.<init>(OSGiScriptEngineManager.java:87)
    at com.hazelcast.internal.osgi.ScriptEngineActivator.registerOsgiScriptEngineManager(ScriptEngineActivator.java:44)
    ... 14 more

@mmedenjak mmedenjak added the Source: Community PR or issue was opened by a community user label Apr 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[OLD]Team: Integration Source: Community PR or issue was opened by a community user Type: Defect
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants