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

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

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

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

Gradle

Gradleは、ビルド自動化ツールです。 ソフトウェアパッケージやドキュメント、 または実際に何か他の種類のプロジェクトの構築、テスト、公開、展開などを自動化が出来ます

Spring Boot

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

Q&A

解決済

1回答

863閲覧

新規Gradleプロジェクトのアプリが起動できない!

退会済みユーザー

退会済みユーザー

総合スコア0

Java

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

Gradle

Gradleは、ビルド自動化ツールです。 ソフトウェアパッケージやドキュメント、 または実際に何か他の種類のプロジェクトの構築、テスト、公開、展開などを自動化が出来ます

Spring Boot

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

0グッド

0クリップ

投稿2018/11/15 09:32

編集2018/11/16 02:00

新しくGradleプロジェクトを作成しました。
ピングポングする機能だけ実装し、アプリを起動したところ、下記のようなアプリログが出力され、正常にアプリが起動できませんでした。

心優しいどなたか、未熟な私にご教授ください。
原因追求にあたり、必要な情報があれば、開示いたします。

2018-11-16 01:13:58.125 INFO 7360 --- [ main] jp.co.pioneer.iotcloud.Application : Starting Application on DT0136 with PID 7360 (C:\gitRepository_iotcld-development\pioneer-dap-drivereport\bin\main started by ********* in C:\gitRepository_iotcld-development\pioneer-dap-drivereport) **略** 2018-11-16 01:13:58.854 WARN 7360 --- [ main] o.m.s.mapper.ClassPathMapperScanner : No MyBatis mapper was found in '[jp.co.pioneer.iotcloud]' package. Please check your configuration. 2018-11-16 01:13:59.686 INFO 7360 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http) **略** 2018-11-16 01:14:00.327 INFO 7360 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler] 2018-11-16 01:14:00.327 INFO 7360 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler] 2018-11-16 01:14:00.462 WARN 7360 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class 2018-11-16 01:14:00.465 INFO 7360 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]

以下、build.gradleファイルになります。

buildscript { ext { springBootVersion = '2.0.5.RELEASE' } repositories { mavenCentral() } dependencies { classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") classpath('org.flywaydb:flyway-gradle-plugin:5.2.1') } } apply plugin: 'java' apply plugin: 'eclipse' apply plugin: 'jacoco' apply plugin: 'org.springframework.boot' apply plugin: 'io.spring.dependency-management' jar { baseName = 'pioneer-dap-report' version = '0.0.1' } sourceCompatibility = 1.8 targetCompatibility = 1.8 repositories { mavenCentral() } dependencies { compile('org.springframework.boot:spring-boot-starter-jdbc') compile('org.springframework.boot:spring-boot-starter-thymeleaf') compile('org.springframework.boot:spring-boot-starter-web') compile('org.springframework.boot:spring-boot-starter-security') compile('org.springframework.boot:spring-boot-actuator') // compile('org.springframework.session:spring-session-data-redis') 現在不要 compile('org.thymeleaf.extras:thymeleaf-extras-springsecurity4') compile('org.mybatis.spring.boot:mybatis-spring-boot-starter:1.3.2') compile('org.projectlombok:lombok:1.18.4') compile('org.apache.commons:commons-lang3:3.8.1') compile('commons-io:commons-io:2.6') compile('org.apache.httpcomponents:httpcore:4.4.10') compile('org.apache.httpcomponents:httpclient') compile('org.apache.httpcomponents:httpmime:4.5.6') compile('org.hamcrest:hamcrest-all:1.3') compile('org.jasypt:jasypt:1.9.2') compile('net.sf.supercsv:super-csv:2.4.0') compile('com.amazonaws:aws-java-sdk-s3:1.11.449') compile('org.flywaydb:flyway-core') compile('org.aspectj:aspectjrt') compile('org.aspectj:aspectjweaver') compile('org.json:json:20180813') // https://mvnrepository.com/artifact/io.rest-assured/spring-mock-mvc compile('io.rest-assured:spring-mock-mvc:3.2.0') // https://mvnrepository.com/artifact/org.springframework.security/spring-security-test compile('org.springframework.security:spring-security-test:5.1.1.RELEASE') // compile('com.treasuredata.client:td-client:0.7.32') 削除予定 compile('org.msgpack:msgpack-core:0.8.16') runtime('org.mariadb.jdbc:mariadb-java-client:2.3.0') testCompile('org.springframework.boot:spring-boot-starter-test') testCompile('com.codeborne:selenide:5.0.1') testCompile('org.jmockit:jmockit:1.43') // http://springtestdbunit.github.io/spring-test-dbunit/ testCompile('com.github.springtestdbunit:spring-test-dbunit:1.3.0') testCompile('org.dbunit:dbunit:2.6.0') } eclipse { classpath { containers.remove('org.eclipse.jdt.launching.JRE_CONTAINER') containers 'org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8' } } // カバレッジレポート設定 jacocoTestReport { executionData = fileTree(dir: project.projectDir, includes:[ // レポート生成元ファイル=プロジェクトディレクトリ内のすべてのテスト実行結果ファイルを対象とする '**/*.exec', '**/*.ec' ] ) afterEvaluate { classDirectories = files(classDirectories.files.collect { fileTree(dir: it, exclude: [ '**/mbg/**', // mybatis ジェネレータのクラスを除外 '**/dto/**', // DTOクラスを除外 '**/config/**', // configのクラスを除外 '**/form/**', // formのクラスを除外 '**/api/**', // apiのクラスを除外 '**/datacode/**', // datacodeのクラスを除外 '**/constant/**', // constantのクラスを除外 '**/Application.class', // Application メインクラスを除外 ]) }) } }

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

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

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

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

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

A-pZ

2018/11/15 11:46

スタックトレースに法人名が出ているようですので、伏せましょう…。なお、build.gradleを書いていただくと、回答が得られると思います。Redisが含まれているようですが、それ以外に不要なものが含まれている可能性もあります。
退会済みユーザー

退会済みユーザー

2018/11/16 01:18 編集

以下、build.gradleファイルになります。 ``` buildscript { ext { springBootVersion = '2.0.5.RELEASE' } repositories { mavenCentral() } dependencies { classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") classpath('org.flywaydb:flyway-gradle-plugin:5.2.1') } } apply plugin: 'java' apply plugin: 'eclipse' apply plugin: 'jacoco' apply plugin: 'org.springframework.boot' apply plugin: 'io.spring.dependency-management' jar { baseName = 'pioneer-dap-report' version = '0.0.1' } sourceCompatibility = 1.8 targetCompatibility = 1.8 repositories { mavenCentral() } dependencies { compile('org.springframework.boot:spring-boot-starter-jdbc') compile('org.springframework.boot:spring-boot-starter-thymeleaf') compile('org.springframework.boot:spring-boot-starter-web') compile('org.springframework.boot:spring-boot-starter-security') compile('org.springframework.boot:spring-boot-actuator') // compile('org.springframework.session:spring-session-data-redis') 現在不要 compile('org.thymeleaf.extras:thymeleaf-extras-springsecurity4') compile('org.mybatis.spring.boot:mybatis-spring-boot-starter:1.3.2') compile('org.projectlombok:lombok:1.18.4') compile('org.apache.commons:commons-lang3:3.8.1') compile('commons-io:commons-io:2.6') compile('org.apache.httpcomponents:httpcore:4.4.10') compile('org.apache.httpcomponents:httpclient') compile('org.apache.httpcomponents:httpmime:4.5.6') compile('org.hamcrest:hamcrest-all:1.3') compile('org.jasypt:jasypt:1.9.2') compile('net.sf.supercsv:super-csv:2.4.0') compile('com.amazonaws:aws-java-sdk-s3:1.11.449') compile('org.flywaydb:flyway-core') compile('org.aspectj:aspectjrt') compile('org.aspectj:aspectjweaver') compile('org.json:json:20180813') // https://mvnrepository.com/artifact/io.rest-assured/spring-mock-mvc compile('io.rest-assured:spring-mock-mvc:3.2.0') // https://mvnrepository.com/artifact/org.springframework.security/spring-security-test compile('org.springframework.security:spring-security-test:5.1.1.RELEASE') // compile('com.treasuredata.client:td-client:0.7.32') 削除予定 compile('org.msgpack:msgpack-core:0.8.16') runtime('org.mariadb.jdbc:mariadb-java-client:2.3.0') testCompile('org.springframework.boot:spring-boot-starter-test') testCompile('com.codeborne:selenide:5.0.1') testCompile('org.jmockit:jmockit:1.43') // http://springtestdbunit.github.io/spring-test-dbunit/ testCompile('com.github.springtestdbunit:spring-test-dbunit:1.3.0') testCompile('org.dbunit:dbunit:2.6.0') } eclipse { classpath { containers.remove('org.eclipse.jdt.launching.JRE_CONTAINER') containers 'org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8' } } // カバレッジレポート設定 jacocoTestReport { executionData = fileTree(dir: project.projectDir, includes:[ // レポート生成元ファイル=プロジェクトディレクトリ内のすべてのテスト実行結果ファイルを対象とする '**/*.exec', '**/*.ec' ] ) afterEvaluate { classDirectories = files(classDirectories.files.collect { fileTree(dir: it, exclude: [ '**/mbg/**', // mybatis ジェネレータのクラスを除外 '**/dto/**', // DTOクラスを除外 '**/config/**', // configのクラスを除外 '**/form/**', // formのクラスを除外 '**/api/**', // apiのクラスを除外 '**/datacode/**', // datacodeのクラスを除外 '**/constant/**', // constantのクラスを除外 '**/Application.class', // Application メインクラスを除外 ]) }) } } ```
A-pZ

2018/11/16 01:51

コメントに書いてしまうとインデントなどが消えてしまうので、質問本文を編集すると良いでしょう。なお、最初のコメントにも記載していますが、スタックトレース(エラー文)に法人名(会社名)が出ていますので、編集されることをオススメします。
退会済みユーザー

退会済みユーザー

2018/11/16 01:57

文字数制限に引っかかるため、エラーログを削ります。ご指摘ありがとうございます。
guest

回答1

0

ベストアンサー

エラーログやビルド設定から推測するに、最後から2行目の

Failed to determine a suitable driver class

JDBCドライバが読めないと書かれており、ビルドでは

runtime('org.mariadb.jdbc:mariadb-java-client:2.3.0')

と、コンパイルに含めない設定になっているので、

runtimeではなく、compileにしてみてはいかがでしょうか。

投稿2018/11/16 08:56

A-pZ

総合スコア12011

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

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

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.50%

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

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

質問する

関連した質問