I'm working on a Portlet project using Java8 and Spring 4.1.5
I have a class annotated with #Service that includes this line (same failure with any closure)
user.getOrganizations().stream().forEach(o -> System.out.println(o));
When I deploy my webapp I get the following error (omitting the massive stack-trace)
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [C:\dev\liferay-developer-studio\DeveloperStudio\workspace\somepath\service\MyService.class];
nested exception is java.lang.ArrayIndexOutOfBoundsException: 52264
....
Caused by: java.lang.ArrayIndexOutOfBoundsException: 52264
at org.springframework.asm.ClassReader.readClass(Unknown Source)
My dependencies in MVN look like:
myGroupId:myArtifactId:war:0.0.0-SNAPSHOT
+- com.liferay.portal:portal-service:jar:6.2.10.11:provided
+- com.liferay.portal:util-bridges:jar:6.2.10.11:provided
+- com.liferay.portal:util-java:jar:6.2.10.11:provided
+- com.liferay.portal:util-taglib:jar:6.2.10.11:provided
+- javax.portlet:portlet-api:jar:2.0:provided
+- javax.servlet:servlet-api:jar:2.5:provided
+- javax.servlet.jsp:jsp-api:jar:2.2:provided
+- org.springframework:spring-webmvc-portlet:jar:4.1.5.RELEASE:provided
| +- org.springframework:spring-beans:jar:4.1.5.RELEASE:provided
| +- org.springframework:spring-context:jar:4.1.5.RELEASE:provided
| | +- org.springframework:spring-aop:jar:4.1.5.RELEASE:provided
| | | \- aopalliance:aopalliance:jar:1.0:provided
| | \- org.springframework:spring-expression:jar:4.1.5.RELEASE:provided
| +- org.springframework:spring-core:jar:4.1.5.RELEASE:provided
| | \- commons-logging:commons-logging:jar:1.2:provided
| +- org.springframework:spring-web:jar:4.1.5.RELEASE:provided
| \- org.springframework:spring-webmvc:jar:4.1.5.RELEASE:provided
+- org.springframework:spring-test:jar:4.1.5.RELEASE:test
+- org.mockito:mockito-all:jar:1.10.8:test
+- junit:junit:jar:4.11:test
| \- org.hamcrest:hamcrest-core:jar:1.3:test
+- org.powermock:powermock-module-junit4:jar:1.5.1:test
| \- org.powermock:powermock-module-junit4-common:jar:1.5.1:test
| \- org.powermock:powermock-reflect:jar:1.5.1:test
| \- org.objenesis:objenesis:jar:1.2:test
+- org.powermock:powermock-module-junit4-rule-agent:jar:1.5.1:test
| +- org.powermock:powermock-module-javaagent:jar:1.5.1:test
| \- org.powermock:powermock-core:jar:1.5.1:test
| \- org.javassist:javassist:jar:3.18.0-GA:test
\- org.powermock:powermock-api-mockito:jar:1.5.1:test
\- org.powermock:powermock-api-support:jar:1.5.1:test
Every solution that I've found so far says "If you are using spring 3 update to spring 4" but I'm already using it
Any ideas?
Cheers
Turns out that the issue is the container I'm working with - Liferay - has an older version of Spring (3.something).
The dependencies in my pom are provided; in addition in my liferay-plugin-package.properties the property portal-dependency-jars had the spring jars in the list.
This means that my plugin was using the Liferay's libs which have an older version of ASM unable to parse bytecode of classes using the new Java8 syntactical features, hence the breakage.
To solve it I got rid of the spring jars from liferay-plugin-package.properties and set the scope for spring in my pom to compile. This solved the problem.
(Note: Liferay doesn't officially support Java 8 at the moment so they are not meant to upgrade their spring version yet)
Related
I am working on Spring Boot and getting NoSuchMethodError when I click on Debug.
Apparently it is caused by multiple slf4j bindings in the classpath.
It all happened all of a sudden and I am not able to fix this for over a week now.
Please see the attached stacktrace.
My maven dependency tree is pasted below showing the different loggers on the list.
[INFO] +- org.thymeleaf.extras:thymeleaf-extras-springsecurity5:jar:3.0.4.RELEASE:compile
[INFO] | \- org.slf4j:slf4j-api:jar:1.7.30:compile
[INFO] +- org.springframework.boot:spring-boot-starter-actuator:jar:2.4.2:compile
[INFO] | +- org.springframework.boot:spring-boot-starter:jar:2.4.2:compile
[INFO] | | +- org.springframework.boot:spring-boot-starter-logging:jar:2.4.2:compile
[INFO] | | | +- ch.qos.logback:logback-classic:jar:1.2.3:compile
[INFO] | | | | \- ch.qos.logback:logback-core:jar:1.2.3:compile
[INFO] | | | +- org.apache.logging.log4j:log4j-to-slf4j:jar:2.13.3:compile
[INFO] | | | | \- org.apache.logging.log4j:log4j-api:jar:2.13.3:compile
[INFO] | | | \- org.slf4j:jul-to-slf4j:jar:1.7.30:compile
There could be many breakpoints
I have a Java project which has a dependency of SpringBoot version 2.3.6.RELEASE. However, I'm in trouble trying to upgrade to 2.4.0 version. In the project nothing else was changed, only version of SpringBoot. Since then the application throws the following error message:
Caused by: java.lang.ClassCastException: com.nimbusds.jose.shaded.json.JSONObject cannot be cast to net.minidev.json.JSONObject
I did some comparison of maven dependency tree (mvn dependency:tree) and found out that probably some significant changes have been done for nimbus-jose-jwt and json-smart libs.
2.3.6.RELEASE
[INFO] +- org.springframework.security:spring-security-oauth2-jose:jar:5.3.5.RELEASE:compile
[INFO] | +- com.nimbusds:nimbus-jose-jwt:jar:8.19:compile (version managed from 8.20.1)
[INFO] | | +- com.github.stephenc.jcip:jcip-annotations:jar:1.0-1:compile
[INFO] | | \- net.minidev:json-smart:jar:1.3.1:provided (scope managed from compile)
[INFO] | +- org.springframework.security:spring-security-core:jar:5.3.5.RELEASE:compile
2.4.0
[INFO] +- org.springframework.security:spring-security-oauth2-jose:jar:5.4.1:compile
[INFO] | +- com.nimbusds:nimbus-jose-jwt:jar:9.1.2:compile (version managed from 9.0.1)
[INFO] | | \- com.github.stephenc.jcip:jcip-annotations:jar:1.0-1:compile
[INFO] | +- org.springframework.security:spring-security-core:jar:5.4.1:compile
As can be seen above nimbus-jose-jwt has been updated from 8.19 to 9.1.2. Moreover, json-smart is not anymore part of nimbus-jose-jwt in 2.4.0.
The root cause is probably this change https://connect2id.com/blog/nimbus-jose-jwt-9
However, what should be done in order to prevent this exception?
You could override the default versions of jars nimbus-jose-jwt and json-smart, by adding the older version explicitly in your pom.
Please refer here : https://github.com/Azure/azure-sdk-for-java/issues/14898
In my case - I had to upgrade to 2.5.7 Springboot version and the nimbus-jose-jwt:jar version came with SB-2.5.7 is 9.10.1.
org.springframework.security:spring-security-oauth2-jose:jar:5.5.3:compile
[INFO] | +- (org.springframework.security:spring-security-core:jar:5.5.3:compile - version managed from 4.2.15.RELEASE; omitted for duplicate)
[INFO] | +- (org.springframework.security:spring-security-oauth2-core:jar:5.5.3:compile - omitted for duplicate)
[INFO] | +- (org.springframework:spring-core:jar:5.3.13:compile - version managed from 5.3.11; omitted for duplicate)
[INFO] | \- com.nimbusds:nimbus-jose-jwt:jar:9.10.1:compile
After downgrading the nimbus-jose-jwt to 8.20 the app started working.
I have Spring project which uses org.springframework.security.oauth, spring-boot-starter-data-rest and spring-boot-starter-web.
Everything works well but I want to exclude some fields from domain objects using #JsonIgnore annotation. This doesn't work. I checked both:
com.fasterxml.jackson.annotation.JsonIgnore and org.codehaus.jackson.annotate.JsonIgnore
My mvn dependency:tree shows:
[INFO] +- org.springframework.boot:spring-boot-starter-data-rest:jar:1.5.9.RELEASE:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.8.0:compile
and
[INFO] org.springframework:na-punkty-data-rest:war:0.1.0
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:1.5.9.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter:jar:1.5.9.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot:jar:1.5.9.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-autoconfigure:jar:1.5.9.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-starter-logging:jar:1.5.9.RELEASE:compile
[INFO] | | | +- ch.qos.logback:logback-classic:jar:1.1.11:compile
[INFO] | | | | \- ch.qos.logback:logback-core:jar:1.1.11:compile
[INFO] | | | +- org.slf4j:jul-to-slf4j:jar:1.7.25:compile
[INFO] | | | \- org.slf4j:log4j-over-slf4j:jar:1.7.25:compile
[INFO] | | \- org.yaml:snakeyaml:jar:1.17:runtime
[INFO] | +- org.hibernate:hibernate-validator:jar:5.3.6.Final:compile
[INFO] | | +- javax.validation:validation-api:jar:1.1.0.Final:compile
[INFO] | | +- org.jboss.logging:jboss-logging:jar:3.3.1.Final:compile
[INFO] | | \- com.fasterxml:classmate:jar:1.3.4:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-databind:jar:2.8.10:compile
[INFO] | | \- com.fasterxml.jackson.core:jackson-core:jar:2.8.10:compile
and
[INFO] +- org.springframework.security.oauth:spring-security-oauth2:jar:2.0.11.RELEASE:compile
[INFO] | +- org.springframework:spring-beans:jar:4.3.13.RELEASE:compile
[INFO] | +- org.springframework:spring-core:jar:4.3.13.RELEASE:compile
[INFO] | +- org.springframework:spring-context:jar:4.3.13.RELEASE:compile
[INFO] | +- org.springframework.security:spring-security-core:jar:4.2.3.RELEASE:compile
[INFO] | | \- aopalliance:aopalliance:jar:1.0:compile
[INFO] | +- commons-codec:commons-codec:jar:1.10:compile
[INFO] | \- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.13:compile
[INFO] | \- org.codehaus.jackson:jackson-core-asl:jar:1.9.13:compile
I am not using any classes from org.codehaus or com.fasterxml directly in my code (I only try to use it with #JsonIgnore in one place). In my opinion I should get rid of doubling implementation and make oAuth use com.fasterxml. But I am not sure is it a good path and how to achieve it?
I tried to build https://spring.io/guides/gs/accessing-data-rest/ and use #JsonIgnore and it works there, but the mvn dependency:tree shows only one implementation for jackson mapper there (com.fasterxml).
Can anyone help me please?
Good evening,
I found the reason why #JsonIgnore didn't work. It was a typo :(
I had private field starting from a capital letter:
#JsonIgnore
private String Roles;
after changing it to
#JsonIgnore
private String roles;
it started working. Of course I had to use proper #JsonIgnore implementation, in this case it was com.fasterxml.jackson.annotation.JsonIgnore
Sorry for posting this question. Everyting works good there. I was blind.
The artefact jackson-mapper-asl belongs to Jackson 1 ("Codehaus"). To switch to jackson-databind you have to use Jackson 2 ("FasterXML").
In this specific situation, the dependency is brought in transitively by spring-security-oauth. Therefore you have to upgrade to version 2.4.0 - yet to be released on 2019-11-07.
The upgrade of Jackson 1 to 2 is done in this Github issue.
I can't start my Spring Boot application anymore after adding persistence. The error is:
java.lang.NoSuchMethodError: org.springframework.data.repository.config.AnnotationRepositoryConfigurationSource.<init>(Lorg/springframework/core/type/AnnotationMetadata;Ljava/lang/Class;Lorg/springframework/core/io/ResourceLoader;Lorg/springframework/core/env/Environment;Lorg/springframework/beans/factory/support/BeanDefinitionRegistry;)V
at org.springframework.boot.autoconfigure.data.AbstractRepositoryConfigurationSourceSupport$1.<init>(AbstractRepositoryConfigurationSourceSupport.java:68) ~[spring-boot-autoconfigure-1.5.7.RELEASE.jar:1.5.7.RELEASE]
I tracked this down to the changes in spring-data-commons where AnnotationRepositoryConfigurationSource resides and an additional constructor argument was added in version 1.13.5, and version 1.13.7 with the same constructor signature should be used by spring-boot-starter-data-jpa in version 1.5.7. And we only use Spring Boot dependencies with version number 1.5.7.
So then I built the dependency tree and strangely found spring-data-commons in version 1.13.4, not 1.13.7 (third to last line):
...(snippet)
[INFO] +- com.name.project:project-subproject8:jar:1.0.0-SNAPSHOT:compile
[INFO] | \- org.springframework.boot:spring-boot-starter-data-jpa:jar:1.5.7.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-jdbc:jar:1.5.4.RELEASE:compile
[INFO] | | +- org.apache.tomcat:tomcat-jdbc:jar:8.5.15:compile
[INFO] | | | \- org.apache.tomcat:tomcat-juli:jar:8.5.15:compile
[INFO] | | \- org.springframework:spring-jdbc:jar:4.3.9.RELEASE:compile
[INFO] | +- org.hibernate:hibernate-core:jar:5.0.12.Final:compile
[INFO] | | +- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:jar:1.0.0.Final:compile
[INFO] | | +- antlr:antlr:jar:2.7.7:compile
[INFO] | | +- org.jboss:jandex:jar:2.0.0.Final:compile
[INFO] | | +- dom4j:dom4j:jar:1.6.1:compile
[INFO] | | \- org.hibernate.common:hibernate-commons-annotations:jar:5.0.1.Final:compile
[INFO] | +- org.hibernate:hibernate-entitymanager:jar:5.0.12.Final:compile
[INFO] | +- javax.transaction:javax.transaction-api:jar:1.2:compile
[INFO] | +- org.springframework.data:spring-data-jpa:jar:1.11.4.RELEASE:compile
[INFO] | | +- org.springframework.data:spring-data-commons:jar:1.13.4.RELEASE:compile
[INFO] | | \- org.springframework:spring-orm:jar:4.3.9.RELEASE:compile
[INFO] | \- org.springframework:spring-aspects:jar:4.3.9.RELEASE:compile
...
Going up the tree you can see that spring-data-jpa is included in version 1.11.4, whereas, according to Spring Boot Dependency Appendix, it should be version 1.11.7. This seems to cause the error. But we don't depend on spring-data-jpa directly via our pom files.
So I don't know how this older version got into the dependency tree.
The pom of spring-boot-starter-data-jpa doesn't indicate any version numbers.
I had the same issue, and yeah it is SOLVED now!!!
You can always exclude particular inner dependency from the outer dependency. You have already given hint to solve this issue.
The root cause is that you most likely have compiled a class against a different version of the class that is missing a method, than the one you are using when running it.
I switched to 1.5.7 version of spring boot, so i just needed to add jpa dependency compatible with spring boot 1.5.7 version. Why jpa dependency because - org.springframework.data.repository.config.AnnotationRepositoryConfigurationSource is in the spring data package. And it worked
On Spring Boot 1.2.3.RELEASE trying to setup SSH on JDK 1.8, Windows 7.
I got the application.properties configured as:
shell.ssh.port=2212
shell.ssh.enabled=true
shell.auth=simple
shell.auth.simple.user.name=user
shell.auth.simple.user.password=password
When the application starts and trying to access it via putty, the following exception appears:
java.lang.IllegalStateException: No session available
at org.apache.sshd.common.AbstractSessionIoHandler.exceptionCaught(AbstractSessionIoHandler.java:52) ~[sshd-core-0.6.0.jar:0.6.0]
at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.exceptionCaught(DefaultIoFilterChain.java:697) ~[mina-core-2.0.2.jar:na]
at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextExceptionCaught(DefaultIoFilterChain.java:483) [mina-core-2.0.2.jar:na]
at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1100(DefaultIoFilterChain.java:46) [mina-core-2.0.2.jar:na]
at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.exceptionCaught(DefaultIoFilterChain.java:791) [mina-core-2.0.2.jar:na]
at org.apache.mina.core.filterchain.IoFilterAdapter.exceptionCaught(IoFilterAdapter.java:111) [mina-core-2.0.2.jar:na]
at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextExceptionCaught(DefaultIoFilterChain.java:483) [mina-core-2.0.2.jar:na]
at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireExceptionCaught(DefaultIoFilterChain.java:471) [mina-core-2.0.2.jar:na]
at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionCreated(DefaultIoFilterChain.java:359) [mina-core-2.0.2.jar:na]
at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$700(DefaultIoFilterChain.java:46) [mina-core-2.0.2.jar:na]
at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.sessionCreated(DefaultIoFilterChain.java:771) [mina-core-2.0.2.jar:na]
at org.apache.mina.core.filterchain.IoFilterAdapter.sessionCreated(IoFilterAdapter.java:79) [mina-core-2.0.2.jar:na]
at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionCreated(DefaultIoFilterChain.java:357) [mina-core-2.0.2.jar:na]
at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireSessionCreated(DefaultIoFilterChain.java:350) [mina-core-2.0.2.jar:na]
at org.apache.mina.core.service.IoServiceListenerSupport.fireSessionCreated(IoServiceListenerSupport.java:211) [mina-core-2.0.2.jar:na]
at org.apache.mina.core.polling.AbstractPollingIoProcessor.addNow(AbstractPollingIoProcessor.java:514) [mina-core-2.0.2.jar:na]
at org.apache.mina.core.polling.AbstractPollingIoProcessor.handleNewSessions(AbstractPollingIoProcessor.java:481) [mina-core-2.0.2.jar:na]
at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$200(AbstractPollingIoProcessor.java:67) [mina-core-2.0.2.jar:na]
at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:1071) [mina-core-2.0.2.jar:na]
at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64) [mina-core-2.0.2.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_31]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_31]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_31]
Caused by: java.lang.AbstractMethodError: org.apache.sshd.common.keyprovider.AbstractKeyPairProvider.loadKeys()[Ljava/security/KeyPair;
at org.apache.sshd.common.keyprovider.AbstractKeyPairProvider.getKeyTypes(AbstractKeyPairProvider.java:49) ~[sshd-core-0.6.0.jar:0.6.0]
at org.apache.sshd.server.session.ServerSession.sendKexInit(ServerSession.java:331) ~[sshd-core-0.6.0.jar:0.6.0]
at org.apache.sshd.server.session.ServerSession.<init>(ServerSession.java:92) ~[sshd-core-0.6.0.jar:0.6.0]
at org.apache.sshd.server.session.SessionFactory.doCreateSession(SessionFactory.java:43) ~[sshd-core-0.6.0.jar:0.6.0]
at org.apache.sshd.common.session.AbstractSessionFactory.createSession(AbstractSessionFactory.java:38) ~[sshd-core-0.6.0.jar:0.6.0]
at org.apache.sshd.common.AbstractSessionIoHandler.sessionCreated(AbstractSessionIoHandler.java:37) ~[sshd-core-0.6.0.jar:0.6.0]
at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.sessionCreated(DefaultIoFilterChain.java:643) ~[mina-core-2.0.2.jar:na]
at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextSessionCreated(DefaultIoFilterChain.java:357) [mina-core-2.0.2.jar:na]
Is there something I am missing here?
Thanks.
Update:
Thanks for the pointers. Here is my dependency tree:
[INFO] +- org.springframework.boot:spring-boot-starter-actuator:jar:1.2.3.RELEASE:compile
[INFO] | \- org.springframework.boot:spring-boot-actuator:jar:1.2.3.RELEASE:compile
[INFO] \- org.springframework.boot:spring-boot-starter-remote-shell:jar:1.2.3.RELEASE:compile
[INFO] +- org.crashub:crash.cli:jar:1.3.1:compile
[INFO] +- org.crashub:crash.connectors.ssh:jar:1.3.1:compile
[INFO] | +- org.apache.sshd:sshd-core:jar:0.6.0:compile
[INFO] | +- org.apache.sshd:sshd-pam:jar:0.11.0:compile
[INFO] | | \- net.sf.jpam:jpam:jar:1.1:compile
[INFO] | +- org.bouncycastle:bcpkix-jdk15on:jar:1.51:compile
[INFO] | \- org.apache.mina:mina-core:jar:2.0.2:compile
[INFO] +- org.crashub:crash.embed.spring:jar:1.3.1:compile
[INFO] +- org.crashub:crash.plugins.cron:jar:1.3.1:compile
[INFO] | \- it.sauronsoftware.cron4j:cron4j:jar:2.2.5:compile
[INFO] +- org.crashub:crash.plugins.mail:jar:1.3.1:compile
[INFO] | \- javax.mail:mail:jar:1.4.7:compile
[INFO] | \- javax.activation:activation:jar:1.1:compile
[INFO] +- org.crashub:crash.shell:jar:1.3.1:compile
[INFO] \- org.codehaus.groovy:groovy:jar:2.3.11:compile
All dependencies appear transitive from spring-boot-starter-remote-shell. I will try to fix up with manual override.
I started a spring boot project with jdk1.8, added the spring-boot-starter-remote-shell maven dependency & your configuration, gave it a go, and everything went smooth.
However java.lang.AbstractMethodError made me suspect a classpath issue, so I quickly ran a mvn dependency:tree on my project and, among others, spring-boot-starter-remote-shell:jar:1.2.3.RELEASE has org.apache.sshd:sshd-core:jar:0.11.0 as a transitive dependency as you can see below.
[INFO] +- org.springframework.boot:spring-boot-starter-remote-shell:jar:1.2.3.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-actuator:jar:1.2.3.RELEASE:compile
[INFO] | | \- org.springframework.boot:spring-boot-actuator:jar:1.2.3.RELEASE:compile
[INFO] | +- org.crashub:crash.cli:jar:1.3.1:compile
[INFO] | +- org.crashub:crash.connectors.ssh:jar:1.3.1:compile
[INFO] | | +- org.apache.sshd:sshd-core:jar:0.11.0:compile <===THIS ONE===
[INFO] | | +- org.apache.sshd:sshd-pam:jar:0.11.0:compile
[INFO] | | | \- net.sf.jpam:jpam:jar:1.1:compile
[INFO] | | +- org.bouncycastle:bcprov-jdk15on:jar:1.51:compile
[INFO] | | +- org.bouncycastle:bcpkix-jdk15on:jar:1.51:compile
[INFO] | | \- org.apache.mina:mina-core:jar:2.0.7:compile
[INFO] | +- org.crashub:crash.embed.spring:jar:1.3.1:compile
[INFO] | +- org.crashub:crash.plugins.cron:jar:1.3.1:compile
[INFO] | | \- it.sauronsoftware.cron4j:cron4j:jar:2.2.5:compile
[INFO] | +- org.crashub:crash.plugins.mail:jar:1.3.1:compile
[INFO] | | \- javax.mail:mail:jar:1.4:compile
[INFO] | | \- javax.activation:activation:jar:1.1:compile
[INFO] | +- org.crashub:crash.shell:jar:1.3.1:compile
[INFO] | \- org.codehaus.groovy:groovy:jar:2.3.11:compile
Another quick look at your stacktrace revealed that you seemed to have a different version on the classpath at org.apache.sshd.common.keyprovider.AbstractKeyPairProvider.getKeyTypes(AbstractKeyPairProvider.java:49) ~[sshd-core-0.6.0.jar:0.6.0] so what I did next was to manually specify this version as a dependency in the pom. When I rerun the app and attempted to connect via SSH I got the same exception as you did.
Also looking at the classes, the AbstractKeyPairProvider.loadKeys() method has a different signature which most likely messes up the implementations depending on the 0.11.0 contract, such as URLKeyPairProvider:
0.6.0 protected abstract KeyPair[] loadKeys();
0.11.0 public abstract Iterable<KeyPair> loadKeys();
So, either you also have added this version unintentionally, or some of your other dependencies are referring it, effectively shadowing 0.11.0 on the classpath. In my case I enabled the spring boot actuator HTTP endpoints confirming the above:
In conclusion, check your dependency tree and figure out where does the sshd-core 0.6.0 and perhaps mina-core 2.0.2 come from and exclude them.