Note: I've narrowed the problem down, and rewritten the question
I am trying to use Infinispan (in the guise of JBoss Data Grid) in Karaf (in the guise of JBoss Fuse) and hitting a wall when it comes to the protostream dependency. I wonder if anyone out there can tell me what I'm doing wrong.
I have boiled my problem down to a sample project here: https://github.com/batwad/infinispan-fuse-example
The project contains a blueprint which declares two beans: a factory for creating an Infinispan RemoteCache and a bean produced by the factory for accessing the default cache. There's also an example entity with protostream annotations and a feature file to install it.
When the feature is installed it looks good:
karaf#root> features:install -v infinispan-osgi-test
Installing feature infinispan-osgi-test 0.0.1-SNAPSHOT
Installing feature infinispan-client-hotrod-with-query 8.4.0.Final-redhat-2
Installing feature infinispan-client-hotrod 8.4.0.Final-redhat-2
Installing feature infinispan-commons 8.4.0.Final-redhat-2
Installing bundle mvn:org.infinispan/infinispan-commons/8.4.0.Final-redhat-2
Installing bundle mvn:org.jboss.logging/jboss-logging/3.3.0.Final-redhat-1
Installing bundle mvn:org.jboss.marshalling/jboss-marshalling-osgi/1.4.10.Final-redhat-3
Installing bundle mvn:org.apache.logging.log4j/log4j-api/2.0
Installing bundle mvn:org.infinispan/infinispan-client-hotrod/8.4.0.Final-redhat-2
Found installed bundle: org.apache.commons.pool [215]
Installing bundle mvn:org.infinispan/infinispan-remote-query-client/8.4.0.Final-redhat-2
Installing bundle mvn:org.infinispan/infinispan-query-dsl/8.4.0.Final-redhat-2
Installing bundle mvn:org.infinispan.protostream/protostream/4.0.0.CR1
Installing bundle mvn:com.example/infinispan-osgi-test/0.0.1-SNAPSHOT
Installing feature jms-condition-shell_0_0_0 2.4.0.redhat-630187
Found installed bundle: org.apache.karaf.jms.command [245]
Installing feature karaf-condition-scr_0_0_0 2.4.0.redhat-630187
Found installed bundle: org.apache.karaf.shell.scr [183]
Found installed bundle: org.apache.karaf.management.mbeans.scr [184]
Installing feature scr-condition-shell_0_0_0 2.4.0.redhat-630187
Found installed bundle: org.apache.karaf.shell.scr [183]
Installing feature scr-condition-management_0_0_0 2.4.0.redhat-630187
Found installed bundle: org.apache.karaf.management.mbeans.scr [184]
Installing feature deployer-condition-aries_blueprint_0_0_0 2.4.0.redhat-630187
Found installed bundle: org.apache.karaf.deployer.blueprint [37]
Installing feature deployer-condition-spring_0_0_0 2.4.0.redhat-630187
Found installed bundle: org.apache.karaf.deployer.spring [162]
Installing feature transaction-condition-aries_blueprint_0_0_0 1.3.0
Found installed bundle: org.apache.aries.transaction.blueprint [198]
Installing feature jaas-condition-shell_0_0_0 2.4.0.redhat-630187
Found installed bundle: org.apache.karaf.jaas.command [45]
Installing feature camel-core-condition-shell_0_0_0 2.17.0.redhat-630187
Found installed bundle: org.apache.camel.camel-commands-core [235]
Found installed bundle: org.apache.camel.karaf.camel-karaf-commands [236]
But if you check the bundle state:
karaf#root> osgi:list
[ 297] [Active ] [ ] [ ] [ 80] Infinispan Hot Rod Client (8.4.0.Final-redhat-2)
[ 298] [Active ] [ ] [ ] [ 80] Infinispan Remote Query Client (8.4.0.Final-redhat-2)
[ 299] [Active ] [ ] [ ] [ 80] Infinispan Query DSL API (8.4.0.Final-redhat-2)
[ 300] [Active ] [ ] [ ] [ 80] ProtoStream - core (4.0.0.CR1)
[ 301] [Active ] [Failure ] [ ] [ 80] Infinispan Fuse test (0.0.1.SNAPSHOT)
Dig in to the logs:
20:00:07,414 | INFO | pool-17-thread-1 | RemoteCacheManager | 294 - org.jboss.logging.jboss-logging - 3.3.0.Final-redhat-1 | ISPN004021: Infinispan version: 8.4.0.Final-redhat-2
20:00:07,537 | WARN | pool-17-thread-1 | BeanRecipe | 23 - org.apache.aries.blueprint.core - 1.4.5 | Object to be destroyed is not an instance of UnwrapperedBeanHolder, type: null
20:00:07,538 | ERROR | pool-17-thread-1 | BlueprintContainerImpl | 23 - org.apache.aries.blueprint.core - 1.4.5 | Unable to start blueprint container for bundle com.example.infinispan-osgi-test/0.0.1.SNAPSHOT
org.osgi.service.blueprint.container.ComponentDefinitionException: Error when instantiating bean defaultCache of class org.infinispan.client.hotrod.RemoteCache
at org.apache.aries.blueprint.container.BeanRecipe.wrapAsCompDefEx(BeanRecipe.java:361)[23:org.apache.aries.blueprint.core:1.4.5]
at org.apache.aries.blueprint.container.BeanRecipe.getInstanceFromFactory(BeanRecipe.java:297)[23:org.apache.aries.blueprint.core:1.4.5]
at org.apache.aries.blueprint.container.BeanRecipe.getInstance(BeanRecipe.java:278)[23:org.apache.aries.blueprint.core:1.4.5]
at org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:830)[23:org.apache.aries.blueprint.core:1.4.5]
at org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:811)[23:org.apache.aries.blueprint.core:1.4.5]
at org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:79)[23:org.apache.aries.blueprint.core:1.4.5]
at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_152]
at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:88)[23:org.apache.aries.blueprint.core:1.4.5]
at org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:247)[23:org.apache.aries.blueprint.core:1.4.5]
at org.apache.aries.blueprint.container.BlueprintRepository.createAll(BlueprintRepository.java:183)[23:org.apache.aries.blueprint.core:1.4.5]
at org.apache.aries.blueprint.container.BlueprintContainerImpl.instantiateEagerComponents(BlueprintContainerImpl.java:688)[23:org.apache.aries.blueprint.core:1.4.5]
at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:383)[23:org.apache.aries.blueprint.core:1.4.5]
at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:270)[23:org.apache.aries.blueprint.core:1.4.5]
at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:294)[23:org.apache.aries.blueprint.core:1.4.5]
at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:263)[23:org.apache.aries.blueprint.core:1.4.5]
at org.apache.aries.blueprint.container.BlueprintExtender.modifiedBundle(BlueprintExtender.java:253)[23:org.apache.aries.blueprint.core:1.4.5]
at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:500)[17:org.apache.aries.util:1.1.0]
at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:433)[17:org.apache.aries.util:1.1.0]
at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$AbstractTracked.track(BundleHookBundleTracker.java:725)[17:org.apache.aries.util:1.1.0]
at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.bundleChanged(BundleHookBundleTracker.java:463)[17:org.apache.aries.util:1.1.0]
at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$BundleEventHook.event(BundleHookBundleTracker.java:422)[17:org.apache.aries.util:1.1.0]
at org.apache.felix.framework.util.SecureAction.invokeBundleEventHook(SecureAction.java:1127)[org.apache.felix.framework-4.4.1.jar:]
at org.apache.felix.framework.util.EventDispatcher.createWhitelistFromHooks(EventDispatcher.java:696)[org.apache.felix.framework-4.4.1.jar:]
at org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:484)[org.apache.felix.framework-4.4.1.jar:]
at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4429)[org.apache.felix.framework-4.4.1.jar:]
at org.apache.felix.framework.Felix.startBundle(Felix.java:2100)[org.apache.felix.framework-4.4.1.jar:]
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:976)[org.apache.felix.framework-4.4.1.jar:]
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:963)[org.apache.felix.framework-4.4.1.jar:]
at org.apache.karaf.features.internal.FeaturesServiceImpl.doInstallFeatures(FeaturesServiceImpl.java:546)[10:org.apache.karaf.features.core:2.4.0.redhat-630187]
at org.apache.karaf.features.internal.FeaturesServiceImpl$1.call(FeaturesServiceImpl.java:432)[10:org.apache.karaf.features.core:2.4.0.redhat-630187]
at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_152]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)[:1.8.0_152]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)[:1.8.0_152]
at java.lang.Thread.run(Thread.java:748)[:1.8.0_152]
Caused by: org.infinispan.protostream.annotations.ProtoSchemaBuilderException: Failed to generate marshaller implementation class
at org.infinispan.protostream.annotations.impl.ProtoSchemaGenerator.generateAndRegister(ProtoSchemaGenerator.java:112)
at org.infinispan.protostream.annotations.ProtoSchemaBuilder.build(ProtoSchemaBuilder.java:189)
at com.example.CacheFactory.getCache(CacheFactory.java:36)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.8.0_152]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[:1.8.0_152]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.8.0_152]
at java.lang.reflect.Method.invoke(Method.java:498)[:1.8.0_152]
at org.apache.aries.blueprint.utils.ReflectionUtils.invoke(ReflectionUtils.java:299)[23:org.apache.aries.blueprint.core:1.4.5]
at org.apache.aries.blueprint.container.BeanRecipe.invoke(BeanRecipe.java:980)[23:org.apache.aries.blueprint.core:1.4.5]
at org.apache.aries.blueprint.container.BeanRecipe.getInstanceFromFactory(BeanRecipe.java:295)[23:org.apache.aries.blueprint.core:1.4.5]
... 32 more
Caused by: protostream.javassist.CannotCompileException: by java.lang.NoClassDefFoundError: org/infinispan/protostream/RawProtobufMarshaller
at protostream.javassist.ClassPool.toClass(ClassPool.java:1170)
at protostream.javassist.ClassPool.toClass(ClassPool.java:1113)
at protostream.javassist.ClassPool.toClass(ClassPool.java:1071)
at protostream.javassist.CtClass.toClass(CtClass.java:1264)
at org.infinispan.protostream.annotations.impl.MarshallerCodeGenerator.generateMessageMarshaller(MarshallerCodeGenerator.java:215)
at org.infinispan.protostream.annotations.impl.ProtoSchemaGenerator.generateMarshallers(ProtoSchemaGenerator.java:145)
at org.infinispan.protostream.annotations.impl.ProtoSchemaGenerator.generateAndRegister(ProtoSchemaGenerator.java:110)
... 42 more
Caused by: java.lang.NoClassDefFoundError: org/infinispan/protostream/RawProtobufMarshaller
at java.lang.ClassLoader.defineClass1(Native Method)[:1.8.0_152]
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)[:1.8.0_152]
at java.lang.ClassLoader.defineClass(ClassLoader.java:642)[:1.8.0_152]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.8.0_152]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[:1.8.0_152]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.8.0_152]
at java.lang.reflect.Method.invoke(Method.java:498)[:1.8.0_152]
at protostream.javassist.ClassPool.toClass2(ClassPool.java:1183)
at protostream.javassist.ClassPool.toClass(ClassPool.java:1164)
... 48 more
Caused by: java.lang.ClassNotFoundException: org.infinispan.protostream.RawProtobufMarshaller
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)[:1.8.0_152]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)[:1.8.0_152]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338)[:1.8.0_152]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)[:1.8.0_152]
... 57 more
So protostream isn't on the classpath, but the bundle is installed and the manifest imports it. What gives?
Turns out this was actually a bug in protostream. Support from Red Hat got this fixed.
See https://issues.jboss.org/browse/IPROTO-38 for details.
Related
I am using IntelliJ on Mac OS Mojave and having an issue loading maven projects in the IDE
I updated my IntelliJ to latest version i.e. 2018.2 community edition
Updated my JDK to 11.0.1
updated maven to 3.5.4
Now I am not able to see maven projects in my IDE and my IDE keeps on showing me "Unable to import" error in the events logs window. Strangely I can compile the project using mvn commands from terminal but cant see the maven projects in IDE window.
error screen shot
I also tried to check the logs which has following in it. I have made sure that Java version used by IntelliJ is version 11. I also tried clearing the idea folder as suggested for other similar questions but that did not help either
Settings
018-10-31 00:45:28,583 [ 119986] INFO - tartup.impl.StartupManagerImpl - Activity run in 109ms on UI thread
2018-10-31 00:45:29,001 [ 120404] INFO - j.ide.ui.OptionsTopHitProvider - 233 ms spent on EDT to cache options in project
2018-10-31 00:45:29,585 [ 120988] WARN - ution.rmi.RemoteProcessSupport - Unrecognized option: -d64
2018-10-31 00:45:29,585 [ 120988] WARN - ution.rmi.RemoteProcessSupport - Error: Could not create the Java Virtual Machine.
2018-10-31 00:45:29,585 [ 120988] WARN - ution.rmi.RemoteProcessSupport - Error: A fatal exception has occurred. Program will exit.
2018-10-31 00:45:29,630 [ 121033] WARN - ution.rmi.RemoteProcessSupport - Unrecognized option: -d64
2018-10-31 00:45:29,630 [ 121033] WARN - ution.rmi.RemoteProcessSupport - Error: Could not create the Java Virtual Machine.
2018-10-31 00:45:29,630 [ 121033] WARN - ution.rmi.RemoteProcessSupport - Error: A fatal exception has occurred. Program will exit.
2018-10-31 00:45:29,632 [ 121035] ERROR - #org.jetbrains.idea.maven - Cannot reconnect.
java.lang.RuntimeException: Cannot reconnect.
at org.jetbrains.idea.maven.server.RemoteObjectWrapper.perform(RemoteObjectWrapper.java:82)
at org.jetbrains.idea.maven.server.MavenServerManager.applyProfiles(MavenServerManager.java:526)
at org.jetbrains.idea.maven.project.MavenProjectReader.applyProfiles(MavenProjectReader.java:394)
at org.jetbrains.idea.maven.project.MavenProjectReader.doReadProjectModel(MavenProjectReader.java:103)
at org.jetbrains.idea.maven.project.MavenProjectReader.readProject(MavenProjectReader.java:62)
at org.jetbrains.idea.maven.project.MavenProject.read(MavenProject.java:655)
at org.jetbrains.idea.maven.project.MavenProjectsTree.doUpdate(MavenProjectsTree.java:555)
at org.jetbrains.idea.maven.project.MavenProjectsTree.doAdd(MavenProjectsTree.java:500)
at org.jetbrains.idea.maven.project.MavenProjectsTree.update(MavenProjectsTree.java:461)
at org.jetbrains.idea.maven.project.MavenProjectsTree.updateAll(MavenProjectsTree.java:432)
at org.jetbrains.idea.maven.project.MavenProjectsProcessorReadingTask.perform(MavenProjectsProcessorReadingTask.java:60)
at org.jetbrains.idea.maven.project.MavenProjectsProcessor.doProcessPendingTasks(MavenProjectsProcessor.java:132)
at org.jetbrains.idea.maven.project.MavenProjectsProcessor.access$000(MavenProjectsProcessor.java:32)
at org.jetbrains.idea.maven.project.MavenProjectsProcessor$2.run(MavenProjectsProcessor.java:107)
at org.jetbrains.idea.maven.utils.MavenUtil.lambda$runInBackground$5(MavenUtil.java:449)
at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:314)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.rmi.RemoteException: Cannot start maven service; nested exception is:
com.intellij.execution.ExecutionException: Unrecognized option: -d64
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
at org.jetbrains.idea.maven.server.MavenServerManager.create(MavenServerManager.java:161)
at org.jetbrains.idea.maven.server.MavenServerManager.create(MavenServerManager.java:66)
at org.jetbrains.idea.maven.server.RemoteObjectWrapper.getOrCreateWrappee(RemoteObjectWrapper.java:41)
at org.jetbrains.idea.maven.server.MavenServerManager.lambda$applyProfiles$3(MavenServerManager.java:526)
at org.jetbrains.idea.maven.server.RemoteObjectWrapper.perform(RemoteObjectWrapper.java:76)
... 20 more
Caused by: com.intellij.execution.ExecutionException: Unrecognized option: -d64
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
at com.intellij.execution.rmi.RemoteProcessSupport.acquire(RemoteProcessSupport.java:159)
at org.jetbrains.idea.maven.server.MavenServerManager.create(MavenServerManager.java:158)
... 24 more
2018-10-31 00:45:29,633 [ 121036] ERROR - #org.jetbrains.idea.maven - IntelliJ IDEA 2018.2.5 Build #IC-182.4892.20
2018-10-31 00:45:29,633 [ 121036] ERROR - #org.jetbrains.idea.maven - JDK: 1.8.0_152-release
2018-10-31 00:45:29,633 [ 121036] ERROR - #org.jetbrains.idea.maven - VM: OpenJDK 64-Bit Server VM
2018-10-31 00:45:29,633 [ 121036] ERROR - #org.jetbrains.idea.maven - Vendor: JetBrains s.r.o
2018-10-31 00:45:29,633 [ 121036] ERROR - #org.jetbrains.idea.maven - OS: Mac OS X
2018-10-31 00:45:29,633 [ 121036] ERROR - #org.jetbrains.idea.maven - Last Action: EditorBackSpace
Finally, I managed to solve it by uninstalling IntelliJ, deleting all the setting from current and previous versions of IntelliJ ( Users//Library/ Preferences) and then reinstalling it again
Before that , I tried all the following as suggested in various posts that did not help much in my case
Cleaning up .idea folder
setting up PATH variables correctly
Using maven from installed directory instead of bundled option
Most important part was cleaning up the old settings and a simple reinstall did not work for me.
What I am not sure still is that what was causing "Invalid options -d64" error from those settings. But finally now I can try out latest Java, Maven and IntelliJ
Thanks.
It's a known issue with JDK 10/11: https://youtrack.jetbrains.com/issue/IDEA-195143. Bug is fixed in 2018.3
It seems you are running Maven with an unrecognized option, -d64, and that's causing that error. Check your Maven settings in IntelliJ.
I'm trying to deploy the tmp1 branch of the Spring example application (A Spring Boot 1.3.4 application using JSP and having WAR packaging) to Pivotal Cloud Foundry, using STS Boot Dashboard. I have created a manifest.yml file, looking as below:
---
applications:
- name: np-spring-tutorial
buildpack: https://github.com/cloudfoundry/java-buildpack.git
path: target/spring-tutorial-0.0.1-SNAPSHOT.war
env:
application_url: http://np-spring-tutorial.cfapps.io
timeout: 180
The application gets deployed and seems to be running well; I'm able to view the pages. However, when starting it gives :SLF4J: Class path contains multiple SLF4J bindings" error. Here is the log:
[9 May, 2016 11:18:31 AM - Boot Dashboard] - Creating application: np-spring-tutorial
[9 May, 2016 11:18:38 AM - Boot Dashboard] - Verifying that the application was created successfully: np-spring-tutorial
Updated app with guid 7a95bd52-1c14-461b-a6df-59aeb7ba285a ({"environment_json"=>"PRIVATE DATA HIDDEN"})
[9 May, 2016 11:19:08 AM - Boot Dashboard] - Generating archive for application: np-spring-tutorial
[9 May, 2016 11:19:08 AM - Boot Dashboard] - Uploading archive to Cloud Foundry for application: np-spring-tutorial
[9 May, 2016 11:19:57 AM - Boot Dashboard] - Archive uploaded to Cloud Foundry for application: np-spring-tutorial
[9 May, 2016 11:20:02 AM - Boot Dashboard] - Starting application: np-spring-tutorial
[9 May, 2016 11:20:09 AM - Boot Dashboard] - Checking if the application is running. Please wait...
Updated app with guid 7a95bd52-1c14-461b-a6df-59aeb7ba285a ({"state"=>"STARTED"})
Creating container
Successfully created container
Downloading app package...
Downloaded app package (45.5M)
Staging...
-----> Java Buildpack Version: 78c3d0a | https://github.com/cloudfoundry/java-buildpack.git#78c3d0a
-----> Downloading Open Jdk JRE 1.8.0_91-unlimited-crypto from https://download.run.pivotal.io/openjdk/trusty/x86_64/openjdk-1.8.0_91-unlimited-crypto.tar.gz (1.9s)
Expanding Open Jdk JRE to .java-buildpack/open_jdk_jre (1.1s)
-----> Downloading Open JDK Like Memory Calculator 2.0.2_RELEASE from https://download.run.pivotal.io/memory-calculator/trusty/x86_64/memory-calculator-2.0.2_RELEASE.tar.gz (0.0s)
Memory Settings: -Xss1M -Xmx768M -XX:MaxMetaspaceSize=104857K -Xms768M -XX:MetaspaceSize=104857K
-----> Downloading Container Customizer 1.0.0_RELEASE from https://download.run.pivotal.io/container-customizer/container-customizer-1.0.0_RELEASE.jar (0.0s)
Exit status 0
Staging complete
Uploading droplet, build artifacts cache...
Uploading build artifacts cache...
Uploading droplet...
Uploaded build artifacts cache (45.4M)
Uploaded droplet (91.1M)
Creating container
Successfully created container
Starting health monitoring of container
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/vcap/app/WEB-INF/lib/logback-classic-1.1.3.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/vcap/app/WEB-INF/lib/logback-classic-1.1.7.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
Failed to instantiate [ch.qos.logback.classic.LoggerContext]
Reported exception:
java.lang.AbstractMethodError: ch.qos.logback.classic.pattern.EnsureExceptionHandling.process(Lch/qos/logback/core/Context;Lch/qos/logback/core/pattern/Converter;)V
at ch.qos.logback.core.pattern.PatternLayoutBase.start(PatternLayoutBase.java:85)
at ch.qos.logback.classic.encoder.PatternLayoutEncoder.start(PatternLayoutEncoder.java:28)
at ch.qos.logback.classic.BasicConfigurator.configure(BasicConfigurator.java:50)
at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:164)
at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:85)
at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55)
at org.slf4j.LoggerFactory.bind(LoggerFactory.java:140)
at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:119)
at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:328)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:280)
at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:155)
at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:132)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:273)
at org.springframework.boot.SpringApplication.<clinit>(SpringApplication.java:191)
at com.naturalprogrammer.spring.tutorial.NpSpringTutorialApplication.main(NpSpringTutorialApplication.java:14)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:54)
at java.lang.Thread.run(Thread.java:745)
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
Exception in thread "main" java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:62)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:54)
... 1 more
Caused by: java.lang.AbstractMethodError: ch.qos.logback.classic.pattern.EnsureExceptionHandling.process(Lch/qos/logback/core/Context;Lch/qos/logback/core/pattern/Converter;)V
at ch.qos.logback.core.pattern.PatternLayoutBase.start(PatternLayoutBase.java:85)
at ch.qos.logback.classic.encoder.PatternLayoutEncoder.start(PatternLayoutEncoder.java:28)
at org.springframework.boot.logging.logback.LogbackConfigurator.start(LogbackConfigurator.java:112)
at org.springframework.boot.logging.logback.DefaultLogbackConfiguration.consoleAppender(DefaultLogbackConfiguration.java:121)
at org.springframework.boot.logging.logback.DefaultLogbackConfiguration.apply(DefaultLogbackConfiguration.java:78)
at org.springframework.boot.logging.logback.LogbackLoggingSystem.loadDefaults(LogbackLoggingSystem.java:124)
at org.springframework.boot.logging.AbstractLoggingSystem.initializeWithConventions(AbstractLoggingSystem.java:74)
at org.springframework.boot.logging.AbstractLoggingSystem.initialize(AbstractLoggingSystem.java:49)
at org.springframework.boot.logging.logback.LogbackLoggingSystem.initialize(LogbackLoggingSystem.java:106)
at org.springframework.boot.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:262)
at org.springframework.boot.logging.LoggingApplicationListener.initialize(LoggingApplicationListener.java:233)
at org.springframework.boot.logging.LoggingApplicationListener.onApplicationEnvironmentPreparedEvent(LoggingApplicationListener.java:200)
at org.springframework.boot.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:176)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:163)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:136)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:119)
at org.springframework.boot.context.event.EventPublishingRunListener.publishEvent(EventPublishingRunListener.java:111)
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:65)
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54)
at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:330)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1191)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1180)
at com.naturalprogrammer.spring.tutorial.NpSpringTutorialApplication.main(NpSpringTutorialApplication.java:14)
... 6 more
Exit status 0
Exit status 0
App instance exited with guid 7a95bd52-1c14-461b-a6df-59aeb7ba285a payload: {"instance"=>"3c98e26d-7714-45b8-6152-df1ae08c2025", "index"=>0, "reason"=>"CRASHED", "exit_description"=>"2 error(s) occurred:\n\n* 2 error(s) occurred:\n\n* Codependent step exited\n* cancelled\n* cancelled", "crash_count"=>1, "crash_timestamp"=>1462773044776529510, "version"=>"8cf24bda-13e6-49a6-8b52-906440c1b780"}
Creating container
Successfully created container
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/vcap/app/WEB-INF/lib/logback-classic-1.1.3.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/vcap/app/WEB-INF/lib/logback-classic-1.1.7.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v1.3.4.RELEASE)
2016-05-09 05:50:52.875 INFO 29 --- [ main] pertySourceApplicationContextInitializer : Adding 'cloud' PropertySource to ApplicationContext
2016-05-09 05:50:52.963 INFO 29 --- [ main] nfigurationApplicationContextInitializer : Adding cloud service auto-reconfiguration to ApplicationContext
2016-05-09 05:50:52.978 INFO 29 --- [ main] c.n.s.t.NpSpringTutorialApplication : Starting NpSpringTutorialApplication on ip3ju5q5j6m with PID 29 (/home/vcap/app/WEB-INF/classes started by vcap in /home/vcap/app)
...
2016-05-09 05:51:07.749 INFO 29 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2016-05-09 05:51:08.376 INFO 29 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
Container became healthy
2016-05-09 05:51:08.720 INFO 29 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8080 (http)
2016-05-09 05:51:10.014 INFO 29 --- [ main] c.n.s.t.NpSpringTutorialApplication : Started NpSpringTutorialApplication in 18.612 seconds (JVM running for 19.599)
[9 May, 2016 11:21:22 AM - Boot Dashboard] - Application appears to have started - np-spring-tutorial
Any idea how to fix this? (This question has originated from this one)
Update
As recommended by Gemini, checking the WAR, I indeed see two logback-classic-x.x.x.jars:
However, looking at the maven dependency tree, I see only the 1.1.7 version of logback, as below:
So, what could be going wrong? Maybe the spring-boot-maven-plugin is doing something?
There should be only one implementation of slf4j in your classpath. Please check your project dependencies and remove one of them.
From what you've posted, there are two jars jar:file:/home/vcap/app/WEB-INF/lib/logback-classic-1.1.3.jar and jar:file:/home/vcap/app/WEB-INF/lib/logback-classic-1.1.7.jar in your application, which should be mistake.
You can just keep one of them and remove the one you don't want to use, for example, keep the newer and remove the older. It should be fine.
If you are using maven to management your dependencies, you can check the full dependencies and make sure there is only one of them exist(exclude the one you do not want to use). If they are added manually, you can manually remove it and repackage your application. It'll work.
I have to load ElasticSearch plugins with the offline instructions but it looks like I am getting a permissions error even when I open up permissions to the files completely and running as root! I've removed and reinstalled as well but this error is consistent.
[root#ip-10-94-146-130 bin]# ./plugin install file:///home/jmblnvr/shield/license-2.1.0.zip
-> Installing from file:/home/jmblnvr/shield/license-2.1.0.zip...
Trying file:/home/jmblnvr/shield/license-2.1.0.zip ...
Downloading .DONE
Verifying file:/home/jmblnvr/shield/license-2.1.0.zip checksums if available ...
NOTE: Unable to verify checksum for downloaded plugin (unable to find .sha1 or .md5 file to verify)
Installed license into /usr/share/elasticsearch/plugins/license
[root#ip-10-94-146-130 bin]# service elasticsearch restart
Stopping elasticsearch: [FAILED]
Starting elasticsearch: Exception in thread "main" java.lang.IllegalStateException: Unable to initialize plugins
Likely root cause: java.nio.file.AccessDeniedException: /usr/share/elasticsearch/plugins/license/plugin-descriptor.properties
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)
at java.nio.file.Files.newByteChannel(Files.java:361)
at java.nio.file.Files.newByteChannel(Files.java:407)
at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:384)
at java.nio.file.Files.newInputStream(Files.java:152)
at org.elasticsearch.plugins.PluginInfo.readFromProperties(PluginInfo.java:86)
at org.elasticsearch.plugins.PluginsService.getPluginBundles(PluginsService.java:302)
at org.elasticsearch.plugins.PluginsService.<init>(PluginsService.java:108)
at org.elasticsearch.node.Node.<init>(Node.java:148)
at org.elasticsearch.node.Node.<init>(Node.java:129)
at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:145)
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:178)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:285)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)
Refer to the log for complete error details.
[FAILED]
From /var/log:
[root#ip-10-94-146-130 elasticsearch]# cat elasticsearch.log
[2015-12-15 11:44:24,525][INFO ][node ] [Valtorr] stopping ...
[2015-12-15 11:44:24,639][INFO ][node ] [Valtorr] stopped
[2015-12-15 11:44:24,641][INFO ][node ] [Valtorr] closing ...
[2015-12-15 11:44:24,647][INFO ][node ] [Valtorr] closed
[2015-12-15 11:44:26,097][WARN ][bootstrap ] unable to install syscall filter: seccomp unavailable: CONFIG_SECCOMP not compiled into kernel, CONFIG_SECCOMP and CONFIG_SECCOMP_FILTER are needed
[2015-12-15 11:44:26,314][INFO ][node ] [Agon] version[2.1.0], pid[21703], build[72cd1f1/2015-11-18T22:40:03Z]
[2015-12-15 11:44:26,314][INFO ][node ] [Agon] initializing ...
[2015-12-15 11:44:26,318][ERROR][bootstrap ] Exception
java.lang.IllegalStateException: Unable to initialize plugins
at org.elasticsearch.plugins.PluginsService.<init>(PluginsService.java:111)
at org.elasticsearch.node.Node.<init>(Node.java:148)
at org.elasticsearch.node.Node.<init>(Node.java:129)
at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:145)
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:178)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:285)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)
Caused by: java.nio.file.AccessDeniedException: /usr/share/elasticsearch/plugins/license/plugin-descriptor.properties
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)
at java.nio.file.Files.newByteChannel(Files.java:361)
at java.nio.file.Files.newByteChannel(Files.java:407)
at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:384)
at java.nio.file.Files.newInputStream(Files.java:152)
at org.elasticsearch.plugins.PluginInfo.readFromProperties(PluginInfo.java:86)
at org.elasticsearch.plugins.PluginsService.getPluginBundles(PluginsService.java:302)
at org.elasticsearch.plugins.PluginsService.<init>(PluginsService.java:108)
... 6 more
I was having the same sort of exception but after installing and while loading x-pack plugin on Elasticsearch 5.2.1:
Caused by: java.nio.file.AccessDeniedException: /usr/share/elasticsearch/plugins/x-pack/plugin-descriptor.properties
In my case, I started by adding elasticsearch user to the root group:
usermod -aG root elasticsearch
Afterwards, it was only necessary to modify the ownership of the plugins folder:
chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/plugins/
Thanks to Val, simple solution is after installing plugins you need to quickly change ownership/groups if you are using the RPM install of Elastic:
chown -R root:elasticsearch /usr/share/elasticsearch
I am working with my colleagues on our first Grails web app project. From the begining I am struggling with some strange issue. I am using Spring Tool Suite, Java JDK 1.7.0_45 and grails 2.2.4.
I simply import existing project to STS and then Run-As -> Grails Command (run-app) and I got this error instead of working app(my colleagues doesnt have this error but use the same existing project):
| Loading Grails 2.2.4
| Configuring classpath.
| Environment set to development.....
| Packaging Grails application.....
| Running Grails application
| Error 2013-11-18 12:03:39,505 [localhost-startStop-1] ERROR core.StandardContext - Error initializing resources: The alias mapping '/plugins/famfamfam-1.0.1=C:\Users\Sebastian\(some path)\ProjectName\target\plugins\famfamfam-1.0.1\.\web-app' is not valid
| Error 2013-11-18 12:03:39,585 [localhost-startStop-1] ERROR core.StandardContext - Error getConfigured
| Error 2013-11-18 12:03:39,586 [localhost-startStop-1] ERROR core.StandardContext - Context [/ProjectName] startup failed due to previous errors
| Server running. Browse to http://localhost:8080/ProjectName
Looking forward for any help!
I'm using sonar 3.4.1, I've done jdbc configuration on sonar.properties, but when I want to start the server, I'm having this error :
| 2013-10-07 15:30:24.061:INFO::Logging to org.sonar.application.FilteredLogger#4ee1d5ea via org.sonar.application.FilteredLogger
| 2013-10-07 15:30:24.146:INFO::jetty-6.1.25
| 2013-10-07 15:30:24.448:INFO::NO JSP Support for /, did not find org.apache.jasper.servlet.JspServlet
| JRuby limited openssl loaded. http://jruby.org/openssl
| gem install jruby-openssl for full support.
| 2013-10-07 15:30:45.912:INFO::Started SelectChannelConnector#0.0.0.0:9000
In the sonar log i have this exception :
2013.10.07 14:21:23 ERROR o.s.c.p.Database Can not connect to database. Please check connectivity and settings (see the properties prefixed by 'sonar.jdbc.').
org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'oracle.jdbc.OracleDriver'
at org.apache.commons.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1429) ~[commons-dbcp-1.3.jar:1.3]
at