Issues with spring cloud cli [NoSuchMethodError: org.springframework.cloud.launcher.cli.LauncherCommand] - spring-boot

I have spring boot of version
Spring CLI v2.1.0.RELEASE
And installed spring cloud of version
spring install org.springframework.cloud:spring-cloud-cli:2.0.0.RELEASE
It got installed properly, but not able to do any cloud cli commands, I'm running in to below exception
Exception in thread "main" 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:48)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
Caused by: java.lang.NoSuchMethodError: org.springframework.cloud.launcher.cli.LauncherCommand$LauncherOptionHandler.option(Ljava/util/Collection;Ljava/lang/String;)Ljoptsimple/OptionSpecBuilder;
at org.springframework.cloud.launcher.cli.LauncherCommand$LauncherOptionHandler.options(LauncherCommand.java:89)
at org.springframework.boot.cli.command.options.OptionHandler.getParser(OptionHandler.java:68)
at org.springframework.boot.cli.command.options.OptionHandler.getHelp(OptionHandler.java:99)
at org.springframework.boot.cli.command.OptionParsingCommand.getHelp(OptionParsingCommand.java:44)
at org.springframework.boot.cli.command.core.HelpCommand.run(HelpCommand.java:105)
at org.springframework.boot.cli.command.CommandRunner.run(CommandRunner.java:219)
at org.springframework.boot.cli.command.CommandRunner.runAndHandleErrors(CommandRunner.java:171)
at org.springframework.boot.cli.SpringCli.main(SpringCli.java:63)
... 8 more
Can any one help me to find out right/working version to be used.

I encountered the same issue. After 2 days investigation, I found it is a version issue. Please use spring-boot-cli-1.5.13.BUILD-20180509.054058-23-bin, the issue will be solved.

Issue resolved by using proper versions
Spring CLI v2.0.0.RELEASE
And Spring Cloud CLI v2.0.0.RELEASE

Related

Activiti BPMN doesn't have fonts when I use openjdk

I'm using activity https://www.activiti.org/userguide/
I update my project to open jdk 8 but it doesn't work. Im getting this error
com.sun.faces.context.AjaxExceptionHandlerImpl handlePartialResponseError
java.lang.NullPointerException
at sun.awt.FontConfiguration.getVersion(FontConfiguration.java:n)
at sun.awt.FontConfiguration.readFontConfigFile(FontConfiguration.java:n)
at sun.awt.FontConfiguration.init(FontConfiguration.java:n)
at sun.awt.X11FontManager.createFontConfiguration(X11FontManager.java:n)
at sun.font.SunFontManager$2.run(SunFontManager.java:n)
at java.security.AccessController.doPrivileged(Native Method)
at sun.font.SunFontManager.<init>(SunFontManager.java:n)
at sun.awt.FcFontManager.<init>(FcFontManager.java:n)
at sun.awt.X11FontManager.<init>(X11FontManager.java:n)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:n)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:n)
at java.lang.reflect.Constructor.newInstance(Constructor.java:n)
at java.lang.Class.newInstance(Class.java:n)
at sun.font.FontManagerFactory$1.run(FontManagerFactory.java:n)
at java.security.AccessController.doPrivileged(Native Method)
at sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:n)
at sun.font.SunFontManager.getInstance(SunFontManager.java:n)
at sun.font.FontDesignMetrics.getMetrics(FontDesignMetrics.java:n)
at sun.java2d.SunGraphics2D.getFontMetrics(SunGraphics2D.java:n)
at org.activiti.image.impl.DefaultProcessDiagramCanvas.initialize(DefaultProcessDiagramCanvas.java:n)
at org.activiti.image.impl.DefaultProcessDiagramCanvas.<init>(DefaultProcessDiagramCanvas.java:n)
at org.activiti.image.impl.DefaultProcessDiagramGenerator.initProcessDiagramCanvas(DefaultProcessDiagramGenerator.java:n)
at org.activiti.image.impl.DefaultProcessDiagramGenerator.generateProcessDiagram(DefaultProcessDiagramGenerator.java:n)
at org.activiti.image.impl.DefaultProcessDiagramGenerator.generateImage(DefaultProcessDiagramGenerator.java:n)
at org.activiti.image.impl.DefaultProcessDiagramGenerator.generateImage(DefaultProcessDiagramGenerator.java:n)
at com.MyClass.getBpmnDiagram(MyClass.java:n)
So, Does anyone know which maven library brings these dependencies of sun and java 2D?
or How I can fix this problem?
Thanks!
It was fixed installing fontconfig in linux machine.

Spring Boot Thin Jar, How To?

I want to use thin jar created by Spring Boot Maven Plugin (jarname.jar.original). I got all dependencies in lib directory. Tried to run. But it is giving following exception related to Banner. I tried to switch it off using spring.main.banner_mode=off. Why it is so obscure information about Spring boot thin jar ? I did not find any useful by googling.
java -cp 'target/thin-jar-0.1.0.jar:target/lib/*' com.example.cloudpayables.api.Application
Exception in thread "restartedMain" 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:497)
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
Caused by: java.lang.NoSuchMethodError: org.springframework.boot.builder.SpringApplicationBuilder.showBanner(Z)Lorg/springframework/boot/builder/SpringApplicationBuilder;
I would recommend looking at the maven-dependency-plugin to make sure you are capturing all the required dependencies for your project. What I am guessing is missing is some transitive dependency.
http://maven.apache.org/plugins/maven-dependency-plugin/examples/copying-project-dependencies.html
Josh Long will be very sad that the banner isn't showing and is causing the problem in your situation. :)

Cannot start Hive in terminal

I have installed and Configured Apache Hive-1.2.1 long ago. It worked fine. Recently I have installed Apache Spark-2.7.0 and started using its shells. Now when I want to work with Hive again, it didn't start. It's showing the following error:
Exception in thread "main" java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;[Ljava/lang/Object;Ljava/lang/Throwable;)V
at org.apache.commons.logging.impl.SLF4JLocationAwareLog.debug(SLF4JLocationAwareLog.java:133)
at org.apache.hadoop.hive.common.LogUtils.logConfigLocation(LogUtils.java:147)
at org.apache.hadoop.hive.common.LogUtils.initHiveLog4jDefault(LogUtils.java:128)
at org.apache.hadoop.hive.common.LogUtils.initHiveLog4jCommon(LogUtils.java:77)
at org.apache.hadoop.hive.common.LogUtils.initHiveLog4j(LogUtils.java:58)
at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:637)
at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:621)
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:497)
at org.apache.hadoop.util.RunJar.main(RunJar.java:160)
I tried reinstalling Hive, but the same error follows. Is this error due to installing Spark? How can I run Hive normally again?
It seems that you are having a conflict with your logging library. This question could help you: java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log

Error creating .war file

I am testing Tomcat7 showing data from the example table "malaga_plagues". I have done changes but, when I try test it again, I obtain the following error creating .war file.
[root#host-192-168-192-78 AMS_Widhoc]# ../../../apache-maven-3.3.3/bin/mvn package
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/maven/cli/MavenCli : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:643)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClassFromSelf(ClassRealm.java:401)
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:42)
at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:254)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)
at org.codehaus.plexus.classworlds.launcher.Launcher.getMainClass(Launcher.java:144)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:266)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[root#host-192-168-192-78 AMS_Widhoc]#
One month ago this was working fine, but now I have resumed the example and it does not work. I reinstalled Orion CB in mi VM but I didn't change anything in Tomcat.
Could you help me? Thank you.
Maven 3.3.3 is only compatible with Java 7+, and it seems that you are trying to run it with Java 6. Please check your JAVA_HOME environment variable, it should point to a Java 7 JDK.

Jetty Server exceptions while using in jersey framework

I am trying to use Jetty HTTPserver with jersey framework to make RESTful services. The code used is pretty simple:
URI baseUri = UriBuilder.fromUri("http://localhost/").port(9998).build();
ResourceConfig config = new ResourceConfig().packages("main.java");
Server server = JettyHttpContainerFactory.createServer(baseUri, config);
I am using maven to build the project with Java8 and following versions for jersey-container and jetty:
jersey-container-jetty-http - 2.17
jetty-server - 9.2.0.v20140526
But running the server is giving me AbstractMethodError. Here's the full stack trace:
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:497)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:297)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.AbstractMethodError: org.glassfish.jersey.jetty.JettyHttpContainerProvider.createContainer(Ljava/lang/Class;Ljavax/ws/rs/core/Application;)Ljava/lang/Object;
at org.glassfish.jersey.server.ContainerFactory.createContainer(ContainerFactory.java:81)
at org.glassfish.jersey.jetty.JettyHttpContainerFactory.createServer(JettyHttpContainerFactory.java:116)
at main.java.Main.startServer(Main.java:43)
at main.java.Main.main(Main.java:76)
... 6 more
Have you guys encountered this before and would anyone know a workaround for this?

Resources