注追加した後:https://github.com/silentsnooc/spring-oauth-issue:
をあなたはgithubの上で最低限の例のクローンを作成することができます。 Java Applictionとしてmahlzeit.api.service.Application
を実行してください。は、インターフェイスをインスタンス化することはできませんorg.springframework.context.ApplicationListener春 - セキュリティのOAuth2
私は私のpom.xmlにspring-security-oauth2
を追加した後:
<dependency>
<groupId>org.springframework.security.oauth</groupId>
<artifactId>spring-security-oauth2</artifactId>
<version>2.2.0.RELEASE</version>
</dependency>
は、私は私の@SpringBootApplication
を実行した後
Exception in thread "main" java.lang.IllegalArgumentException: Cannot instantiate interface org.springframework.context.ApplicationListener : org.springframework.boot.context.logging.ClasspathLoggingApplicationListener
at org.springframework.boot.SpringApplication.createSpringFactoriesInstances(SpringApplication.java:439)
at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:418)
at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:409)
at org.springframework.boot.SpringApplication.<init>(SpringApplication.java:268)
at org.springframework.boot.SpringApplication.<init>(SpringApplication.java:247)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1245)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1233)
を得るために始めました。私はSpring Boot 2.0.0.M5を使用していることに注意してください。これが問題の根源(w.r.t.バージョン)である可能性があります。
これは私が使用している全体のpom.xmlである:;
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>server</artifactId>
<groupId>mahlzeit</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>api</artifactId>
<properties>
<spring.boot.version>2.0.0.M5</spring.boot.version>
</properties>
<dependencies>
<!-- Spring Framework Boot -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>${spring.boot.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
<version>${spring.boot.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<version>${spring.boot.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>${spring.boot.version}</version>
<scope>test</scope>
</dependency>
<!-- Spring Framework -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-jwt</artifactId>
<version>1.0.8.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security.oauth</groupId>
<artifactId>spring-security-oauth2</artifactId>
<version>2.2.0.RELEASE</version>
</dependency>
<dependency>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.4.1208-jdbc42-atlassian-hosted</version>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<repositories>
<!-- Required since this is currently using Spring RC version -->
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/libs-milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
</project>
は、私は、これは矛盾するバージョンとしなければならないかもしれない疑いを持っている - stackoverflowの上のほとんどの答えはちょうどそれをあることが判明 - しかし、私は私がここに持っています実際の問題を作ることはできません。
春ブーツ2.0.0.M5状態のためrelease notes:
OAuth 2.0のサポート春のセキュリティのOAuthプロジェクトから
機能は、コア春のセキュリティに移行されています。 OAuth 2.0クライアントのサポートは既に追加されており、追加機能は予定通りに移行されます。あなたはまだあなたが手動で物事をorg.springframework.security.oauth:spring-security-oauth2
を追加し、設定する必要があります移行されていない春のセキュリティのOAuth機能に依存している場合
。 OAuth 2.0クライアントのサポートが必要な場合は、Spring Boot 2.0が提供する自動設定を使用できます。 Springブート1.5をサポートし続けているため、古いアプリケーションでもアップグレードパスが提供されるまで、引き続きその使用が可能です。
あなたの春のブート設定コードはどこですか?それらも置く。 –
あなたの '自動設定 'を意味します。親タグはどこにありますか?完全な 'pom.xml 'を入れてください。 –
あなたのpomにパッケージ情報が見つかりませんでした。私のビルドプラグインはhttps://pastebin.com/Ghcd7tWaのように見えます –