質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
JSP

JSP(Java Server Pages)とは、ウェブアプリケーションの表示レイヤーに使われるサーバーサイドの技術のことです。

Java

Javaは、1995年にサン・マイクロシステムズが開発したプログラミング言語です。表記法はC言語に似ていますが、既存のプログラミング言語の短所を踏まえていちから設計されており、最初からオブジェクト指向性を備えてデザインされています。セキュリティ面が強力であることや、ネットワーク環境での利用に向いていることが特徴です。Javaで作られたソフトウェアは基本的にいかなるプラットフォームでも作動します。

Spring Boot

Spring Bootは、Javaのフレームワークの一つ。Springプロジェクトが提供する様々なフレームワークを統合した、アプリケーションを高速で開発するために設計されたフレームワークです。

Q&A

1回答

45669閲覧

Spring Boot -プロジェクト作成し、起動した後のエラー

tashi4801

総合スコア8

JSP

JSP(Java Server Pages)とは、ウェブアプリケーションの表示レイヤーに使われるサーバーサイドの技術のことです。

Java

Javaは、1995年にサン・マイクロシステムズが開発したプログラミング言語です。表記法はC言語に似ていますが、既存のプログラミング言語の短所を踏まえていちから設計されており、最初からオブジェクト指向性を備えてデザインされています。セキュリティ面が強力であることや、ネットワーク環境での利用に向いていることが特徴です。Javaで作られたソフトウェアは基本的にいかなるプラットフォームでも作動します。

Spring Boot

Spring Bootは、Javaのフレームワークの一つ。Springプロジェクトが提供する様々なフレームワークを統合した、アプリケーションを高速で開発するために設計されたフレームワークです。

0グッド

0クリップ

投稿2016/11/05 06:57

###前提・実現したいこと
Spring Bootでlocalhost:8080/にアクセスし、jspの簡単なページを表示したいと考えています。

###発生している問題・エラーメッセージ
. ____ _ __ _ _
/\ / ' __ _ () __ __ _ \ \ \
( ( )_
_ | '_ | '| | ' / ` | \ \ \
\/ __)| |)| | | | | || (
| | ) ) ) )
' || .__|| ||| |_, | / / / /
=========|
|==============|
/=////
:: Spring Boot :: (v1.4.1.RELEASE)

2016-11-05 15:32:46.481 INFO 2056 --- [ main] com.example.HajibootApplication : Starting HajibootApplication on DESKTOP-N91LT9F with PID 2056 (C:\workspace\Hajiboot\target\classes started by tashi in C:\workspace\Hajiboot)
2016-11-05 15:32:46.485 INFO 2056 --- [ main] com.example.HajibootApplication : No active profile set, falling back to default profiles: default
2016-11-05 15:32:46.600 INFO 2056 --- [ main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@3d3fcdb0: startup date [Sat Nov 05 15:32:46 JST 2016]; root of context hierarchy
2016-11-05 15:32:47.380 WARN 2056 --- [ main] s.c.a.AnnotationConfigApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.info.ProjectInfoAutoConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'spring.info-org.springframework.boot.autoconfigure.info.ProjectInfoProperties': Initialization of bean failed; nested exception is javax.validation.ValidationException: Unable to create a Configuration, because no Bean Validation provider could be found. Add a provider like Hibernate Validator (RI) to your classpath.
2016-11-05 15:32:47.381 INFO 2056 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans on shutdown
2016-11-05 15:32:47.386 INFO 2056 --- [ main] utoConfigurationReportLoggingInitializer :

Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2016-11-05 15:32:47.390 ERROR 2056 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :


APPLICATION FAILED TO START


Description:

The Bean Validation API is on the classpath but no implementation could be found

Action:

Add an implementation, such as Hibernate Validator, to the classpath

###該当のソースコード
pomはこのような形です。

<?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>

<groupId>com.example</groupId> <artifactId>demo</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>jar</packaging> <name>Hajiboot</name> <description>Demo project for Spring Boot</description> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.4.1.RELEASE</version> <relativePath /> <!-- lookup parent from repository --> </parent> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <java.version>1.8</java.version> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-validator</artifactId> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build>
</project>

###試したこと

こいつをpomに追加してみましたが、ダメでした。
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
</dependency>

###補足情報(言語/FW/ツール等のバージョンなど)
jdk1.8.0_112
apache-maven-3.3.9

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

A-pZ

2016/11/05 07:52

SpringBootの初期設定に関する問題は、プロジェクトの作成方法と、@SpringBootApplicationをつけたクラスと、@Configureをつけたクラスもあると、回答が得られると思います。
guest

回答1

0

回答が付いていないので、解決したかもしれませんが、他の人が見た際の1つの情報として
残しておきます。

私も、

Description:

The Bean Validation API is on the classpath but no implementation could be found

Action:

Add an implementation, such as Hibernate Validator, to the classpath

の事象が出たので、その時は、

https://stackoverflow.com/questions/36329001/unable-to-create-a-configuration-because-no-bean-validation-provider-could-be-f

のanswerにあるpom.xmlに以下を記載するようなものが見つかったので、

xml

1<dependency> 2 <groupId>org.hibernate</groupId> 3 <artifactId>hibernate-validator</artifactId> 4 <version>5.2.4.Final</version> 5</dependency>

pom.xmlに記載したが、同じエラーは変わらず。

で、いろいろ見ていたら、自分のmavenローカルリポジトリにある
/org/hibernate/hibernate-validator/5.2.4.Final/hibernate-validator-5.2.4.Final.jar
のファイルが壊れているのか、読み込みできていなかった

org/hibernate/hibernate-validator のディレクトリをrename move して、
eclipse上のプロジェクトで右クリック→ maven → プロジェクトの更新をして
新たにダウンロードした、「hibernate-validator-5.2.4.Final.jar」と以前のファイルを比較すると、ファイルサイズが変わっていた。

最終的には、pom.xmlには、hibernate-validatorの指定はせず、
他のdependencyとして、spring-boot-starter-web 内に定義される hibernate-validatorの5.3.5.Final が自動で使われて、

SpringApplication.run(~
で、エラーなく起動しました。jarファイルのheadなのかわかりませんが、壊れていたようでした。

投稿2017/05/26 09:04

編集2017/05/26 09:13
kuniku

総合スコア253

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだベストアンサーが選ばれていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問