OSGi Karaf Spring Boot 2.1.4-Release Error - spring-boot

I am trying to build an OSGi Karaf app using Spring Boot 2.1.4 with Java 8, OSGi version 5.0.0 and Apache Karaf 4.1.3.
I have created the following project in GitHub which builds and runs fine when I use Spring Boot 1.5.9.
But when I change the Spring boot version from 1.5.9-RELEASE to 2.1.4-RELEASE and trying to do mvn clean install then I get the following errors from the maven-bundle-plugin
[WARNING] Bundle com.nemesis:osgi-spring-boot-demo-bundle:bundle:0.0.1-SNAPSHOT : Export com.nemesis.osgi.springboot, has 4, private references [com.nemesis.osgi.springboot.controller, org.springframework.context.annotation, org.springframework.boot, org.springframework.boot.autoconfigure],
[ERROR] Bundle com.nemesis:osgi-spring-boot-demo-bundle:bundle:0.0.1-SNAPSHOT : Exception: java.lang.ArrayIndexOutOfBoundsException: 19
[ERROR] Bundle com.nemesis:osgi-spring-boot-demo-bundle:bundle:0.0.1-SNAPSHOT : Invalid class file META-INF/versions/9/module-info.class (java.lang.ArrayIndexOutOfBoundsException: 19)
[ERROR] Bundle com.nemesis:osgi-spring-boot-demo-bundle:bundle:0.0.1-SNAPSHOT : Classes found in the wrong directory: {META-INF/versions/9/org/apache/logging/log4j/util/StackLocator.class=org.apache.logging.log4j.util.StackLocator, META-INF/versions/9/org/apache/logging/log4j/util/internal/DefaultObjectInputFilter.class=org.apache.logging.log4j.util.internal.DefaultObjectInputFilter, META-INF/versions/9/org/apache/logging/log4j/util/ProcessIdUtil.class=org.apache.logging.log4j.util.ProcessIdUtil}
[ERROR] Bundle com.nemesis:osgi-spring-boot-demo-bundle:bundle:0.0.1-SNAPSHOT : Exception: java.lang.ArrayIndexOutOfBoundsException: 19
[ERROR] Bundle com.nemesis:osgi-spring-boot-demo-bundle:bundle:0.0.1-SNAPSHOT : Invalid class file module-info.class (java.lang.ArrayIndexOutOfBoundsException: 19)
[ERROR] Bundle com.nemesis:osgi-spring-boot-demo-bundle:bundle:0.0.1-SNAPSHOT : Exception: java.lang.ArrayIndexOutOfBoundsException: 19
[ERROR] Bundle com.nemesis:osgi-spring-boot-demo-bundle:bundle:0.0.1-SNAPSHOT : Exception: java.lang.ArrayIndexOutOfBoundsException: 19
[ERROR] Bundle com.nemesis:osgi-spring-boot-demo-bundle:bundle:0.0.1-SNAPSHOT : Exception: java.lang.ArrayIndexOutOfBoundsException: 19
Any help is much appreciated.

I think the error is because the new spring boot bundles or dependencies are multi release jars that the maven bundle plugin version 3.3.0 can not yet handle.
Updating the maven bundle plugin version to 4.1.0 fixed the issue for me.
See this PR.

Related

Hudson Job not running

please help I am stucked. I can compile my project nicely with maven 3.1.0
mvn deploy -Pbuild-int
==> Build success
but if I try to setup a simple Hudson Job to do the same, I am failing all the time an I don`t know why. The error message is unfortunately for a beginner like me not helpful.
I am using a local VirtualSVNServer 2.6.0, a local Hudson Server 3.0.1 and JDK 1.7.0
SVN link and authentication works fine, tested it via providing URL to second browser window and provided details.
Any help is appreciated. Thanks in advance.
ERROR LOG of the Job
Gestartet durch Benutzer anonymous
Updating https://localhost/svn/e2etrace/branches/RB-1.2.0 revision: 19.07.2013 19:56:50 depth:infinity ignoreExternals: false
At revision 37
no change for https://localhost/svn/e2etrace/branches/RB-1.2.0 since the previous build
[INFO] Using Maven 3 installation: Maven 3.1.0
[INFO] Checking Maven 3 installation environment
[workspace] $ D:\maven\bin\mvn.bat --help
[INFO] Checking Maven 3 installation version
[INFO] Detected Maven 3 installation version: 3.1.0
[workspace] $ D:\maven\bin\mvn.bat deploy -Pbuilt-int -V -B -Dmaven.ext.class.path=C:\Users\Jonas\.hudson\maven\slavebundle\resources;C:\Users\Jonas\.hudson\maven\slavebundle\lib\maven3-eventspy-3.0.jar;C:\Users\Jonas\.hudson\war\webapp\WEB-INF\lib\hudson-remoting-3.0.0.jar -Dhudson.eventspy.port=54334 -f pom.xml
[DEBUG] Waiting for connection on port: 54334
Apache Maven 3.1.0 (893ca28a1da9d5f51ac03827af98bb730128f9f2; 2013-06-28 04:15:32+0200)
Maven home: D:\maven
Java version: 1.7.0_25, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.7.0_25\jre
Default locale: de_DE, platform encoding: Cp1252
OS name: "windows 8", version: "6.2", arch: "amd64", family: "windows"
[WARNING] Error injecting: org.hudsonci.maven.eventspy_30.DelegatingEventSpy
java.lang.NoClassDefFoundError: org/sonatype/guice/bean/reflect/ClassSpace
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2483)
at java.lang.Class.getDeclaredConstructors(Class.java:1891)
at com.google.inject.spi.InjectionPoint.forConstructorOf(InjectionPoint.java:245)
at com.google.inject.internal.ConstructorBindingImpl.create(ConstructorBindingImpl.java:99)
at com.google.inject.internal.InjectorImpl.createUninitializedBinding(InjectorImpl.java:653)
at com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:863)
at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:790)
at com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:278)
at com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:210)
at com.google.inject.internal.InjectorImpl.getProviderOrThrow(InjectorImpl.java:986)
at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:1019)
at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:982)
at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1032)
at org.eclipse.sisu.reflect.AbstractDeferredClass.get(AbstractDeferredClass.java:44)
at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:86)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:55)
at com.google.inject.internal.ProviderInternalFactory$1.call(ProviderInternalFactory.java:70)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:100)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:116)
at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:55)
at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:68)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:47)
at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1054)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at com.google.inject.Scopes$1$1.get(Scopes.java:59)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:997)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1054)
at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:993)
at org.eclipse.sisu.locators.LazyBeanEntry.getValue(LazyBeanEntry.java:82)
at org.eclipse.sisu.plexus.locators.LazyPlexusBean.getValue(LazyPlexusBean.java:52)
at org.eclipse.sisu.locators.EntryListAdapter$ValueIterator.next(EntryListAdapter.java:111)
at java.util.AbstractCollection.toArray(AbstractCollection.java:141)
at java.util.ArrayList.<init>(ArrayList.java:151)
at org.apache.maven.eventspy.internal.EventSpyDispatcher.setEventSpies(EventSpyDispatcher.java:48)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.eclipse.sisu.reflect.BeanPropertySetter.set(BeanPropertySetter.java:76)
at org.eclipse.sisu.plexus.binders.ProvidedPropertyBinding.injectProperty(ProvidedPropertyBinding.java:48)
at org.eclipse.sisu.inject.BeanInjector.injectMembers(BeanInjector.java:52)
at com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:128)
at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:118)
at com.google.inject.internal.ConstructorInjector.access$000(ConstructorInjector.java:32)
at com.google.inject.internal.ConstructorInjector$1.call(ConstructorInjector.java:92)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:100)
at org.eclipse.sisu.plexus.lifecycles.PlexusLifecycleManager.onProvision(PlexusLifecycleManager.java:134)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:109)
at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:55)
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:90)
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:269)
at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1054)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at com.google.inject.Scopes$1$1.get(Scopes.java:59)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:997)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1047)
at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:993)
at org.eclipse.sisu.locators.LazyBeanEntry.getValue(LazyBeanEntry.java:82)
at org.eclipse.sisu.plexus.locators.LazyPlexusBean.getValue(LazyPlexusBean.java:52)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:259)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:251)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:245)
at org.apache.maven.cli.MavenCli.container(MavenCli.java:420)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:208)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:414)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:357)
Caused by: java.lang.ClassNotFoundException: org.sonatype.guice.bean.reflect.ClassSpace
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230)
... 78 more
[ERROR] Error executing Maven.
[ERROR] com.google.inject.ProvisionException: Guice provision errors:
1) Error injecting: public void org.apache.maven.eventspy.internal.EventSpyDispatcher.setEventSpies(java.util.List)
at ClassRealm[maven.ext, parent: ClassRealm[plexus.core, parent: null]]
while locating org.apache.maven.eventspy.internal.EventSpyDispatcher
1 error
role: org.apache.maven.eventspy.internal.EventSpyDispatcher
roleHint:
[ERROR] Caused by: Guice provision errors:
1) Error injecting: public void org.apache.maven.eventspy.internal.EventSpyDispatcher.setEventSpies(java.util.List)
at ClassRealm[maven.ext, parent: ClassRealm[plexus.core, parent: null]]
while locating org.apache.maven.eventspy.internal.EventSpyDispatcher
1 error
[ERROR] Caused by: org/sonatype/guice/bean/reflect/ClassSpace
[ERROR] Caused by: org.sonatype.guice.bean.reflect.ClassSpace
[ERROR] Process did not initiate connection and appears to have died; exit code: 1
[ERROR] Failure: hudson.AbortException: Process did not initiate connection and appears to have died; exit code: 1
ERROR: Process did not initiate connection and appears to have died; exit code: 1
Finished: FAILURE
Maven Home variable was wrong. Sometimes thinks are so obvious. Be aware use / instead \ and I left out disk. Now it works.
I used the bundled (in the plugin it seems) maven 3 installation in favor to a manual installed one.
So I don't need to add a maven installation in the hudson configuration.

Packaging native image using graalvm and quarkus gave an error

Dears,
I am following the native image build tutorial by quarkus to create native graalvm but i am getting the below error :
Error: No main manifest attribute, in /home/docker/workspace/quarkus/quarkus-getting-started/target/quarkus-getting-started-1.0-SNAPSHOT-runner.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 15.056 s
[INFO] Finished at: 2019-03-14T11:26:12+04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.quarkus:quarkus-maven-plugin:0.11.0:native-image (default) on project quarkus-getting-started: Failed to generate a native image: Failed to build native image: Image generation failed -> [Help 1]
my environment :
OS : CentOS 7
Quarkus : 0.11.0
Java : Open JDK 1.8.0_181
GraalVM : 1.0.0-rc13
Using quarkus there is no main method in your app, but how to make it working using graal native image ?

Unable to build spring-cloud-contract

Attempting to build the latest https://github.com/spring-cloud/spring-cloud-contract repository.
forked repo from github
cloned fork to my local machine
mvn clean install -U
The error:
[ERROR] The build could not read 2 projects -> [Help 1] [ERROR] [ERROR] The project org.springframework.cloud:spring-cloud-contract-verifier:2.0.0.BUILD-SNAPSHOT (/Users/damienburke/workspace/oss/spring-cloud-contract/spring-cloud-contract-verifier/pom.xml) has 1 error [ERROR] 'dependencies.dependency.version' for javax.inject:javax.inject:jar is missing. # org.springframework.cloud:spring-cloud-contract-verifier:[unknown-version], /Users/damienburke/workspace/oss/spring-cloud-contract/spring-cloud-contract-verifier/pom.xml, line 43, column 15 [ERROR] [ERROR] The project org.springframework.cloud:spring-cloud-contract-maven-plugin:2.0.0.BUILD-SNAPSHOT (/Users/damienburke/workspace/oss/spring-cloud-contract/spring-cloud-contract-tools/spring-cloud-contract-maven-plugin/pom.xml) has 1 error [ERROR] 'dependencies.dependency.version' for javax.inject:javax.inject:jar is missing. # line 337, column 15 [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
I'm able to fix by adding this entry to spring-cloud-contract-parent pom.xml
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>${javax.inject.version}</version>
</dependency>
Seems like a bug?
I can file an issue (https://github.com/spring-cloud/spring-cloud-contract/issues/new) and submit a PR if so...
We've fixed this issue recently. Pull the Changes and try again

Failed to configure Identity Server 5.0.0 as API Key Manager

I followed document to configure Identity Server 5.0.0 as API(1.80) Key Manager - https://docs.wso2.com/display/CLUSTER420/Configuring+WSO2+Identity+Server+as+the+Key+Manager, and log displayed exceptions when startup after installed API Key Manager feature in Identity server. The exceptions are as following:
ERROR {org.wso2.carbon.registry.indexing.RegistryConfigLoader} - org.wso2.carbon.apimgt.impl.indexing.indexer.WSDLIndexer is not found in classpath. Please check whether the class is exported in your OSGI bundle. {org.wso2.carbon.registry.indexing.RegistryConfigLoader}
java.lang.ClassNotFoundException: org.wso2.carbon.apimgt.impl.indexing.indexer.WSDLIndexer
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:501)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at org.wso2.carbon.registry.indexing.RegistryConfigLoader.<init>(RegistryConfigLoader.java:132)
...
ERROR {org.wso2.carbon.registry.indexing.solr.SolrClient} - Could not instantiate Solr client {org.wso2.carbon.registry.indexing.solr.SolrClient}
java.lang.RuntimeException: java.io.FileNotFoundException: D:\wso2\wso2is-5.0.0\solr\data\index\_7.fnm (The system cannot find the file specified)
at org.apache.solr.core.SolrCore.getSearcher(SolrCore.java:1068)
at org.apache.solr.core.SolrCore.<init>(SolrCore.java:579)
at org.apache.solr.core.CoreContainer$Initializer.initialize(CoreContainer.java:137)
at org.wso2.carbon.registry.indexing.solr.SolrClient.<init>(SolrClient.java:90)
...
Can anyone help? I would be very gratefull.
I believe I have found the issue. When installing the Key Manager feature in this article and installing the WSO2 Identity Manager Service pack after the Key Manager, there are two files in the /repository/components/plugins directory:
org.wso2.carbon.registry.indexing_4.2.1.jar
org.wso2.carbon.registry.indexing_4.2.2.jar
I resolved this issue by removing the 4.2.1 jar version and leaving the 4.2.2 jar version. After doing so, no errors were encountered.

how to build wso2 from platform directory

I download code from github, and try to run "mvn compile" from platform, then I got following error:
D:\wso2\platform-master>mvn compile
Listening for transport dt_socket at address: 8000
[INFO] Scanning for projects...
[ERROR] The build could not read 4 projects -> [Help 1]
[ERROR]
[ERROR] The project org.wso2.carbon:carbon-dependents:4.2.0-SNAPSHOT (D:\wso2\platform-master\dependencies\pom.xml) has 1 error
[ERROR] Child module D:\wso2\platform-master\dependencies\commons\charon\2.0.0-SNAPSHOT of D:\wso2\platform-master\dependencies\pom.xml does not e
xist
[ERROR]
[ERROR] The project org.wso2.carbon:carbon-components:4.2.0-SNAPSHOT (D:\wso2\platform-master\components\pom.xml) has 1 error
[ERROR] Child module D:\wso2\platform-master\components\jaggery of D:\wso2\platform-master\components\pom.xml does not exist
[ERROR]
[ERROR] The project org.wso2.carbon:carbon-features:4.2.0-SNAPSHOT (D:\wso2\platform-master\features\pom.xml) has 1 error
[ERROR] Child module D:\wso2\platform-master\features\jaggery\features of D:\wso2\platform-master\features\pom.xml does not exist
[ERROR]
[ERROR] The project org.wso2.carbon:carbon-products:4.2.0-SNAPSHOT (D:\wso2\platform-master\products\pom.xml) has 1 error
[ERROR] Child module D:\wso2\platform-master\products\integration\security-verifier of D:\wso2\platform-master\products\pom.xml does not exist
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
When you say, you downloaded code from GitHub, I guess you cloned https://github.com/wso2/platform
WSO2 currently uses SVN as the main source repository and therefore I recommend you to use the SVN repository. Following has the current WSO2 Carbon code.
https://svn.wso2.org/repos/wso2/carbon/
Before checking out the code, please make sure you understand how the SVN repository is structured.
There are many resources on the web about building WSO2 Carbon from source. Please search on the web. Here is my answer given to a similar question about building from source.
FYI: WSO2 just released Carbon 4.2.0 and therefore we currently use the 4.2.0 branches.
https://svn.wso2.org/repos/wso2/carbon/kernel/branches/4.2.0
https://svn.wso2.org/repos/wso2/carbon/orbit/branches/4.2.0
https://svn.wso2.org/repos/wso2/carbon/platform/branches/4.2.0

Resources