spring-bootでJPAを使用してmysqlにアクセスできませんspring-bootでmysantにアクセスする
私はスプリングブートとスプリングには新しいです。私のapplication.propertiesファイルは私が考えることができるもののエラーで見れライン
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/mydatabase
spring.datasource.username=root
spring.datasource.password=mypassword
spring.jpa.database-platform=org.hibernate.dialect.MySQL5Dialect
spring.jpa.show-sql=true
spring.jpa.hibernate.ddl-auto=update
下回ってい
Description:
Parameter 0 of constructor in org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration required a bean of type 'javax.sql.DataSource' that could not be found.
- Bean method 'dataSource' not loaded because @ConditionalOnProperty (spring.datasource.jndi-name) did not find property 'jndi-name'
- Bean method 'dataSource' not loaded because @ConditionalOnBean (types: org.springframework.boot.jta.XADataSourceWrapper; SearchStrategy: all) did not find any beans
Action:
Consider revisiting the conditions above or defining a bean of type 'javax.sql.DataSource' in your configuration.
の下に私が得た
誤りがある春ブートは、」私はdidnのことを不平を言っていますさ私はデータソースurl &のログインのための資格を与えているので、私は必要ではないと私は思っています(spring.datasource.jndi-name)。
spring.datasource.jndi-nameに私が与えるべき価値が分かりません。
何か助けていただきありがとうございます。私はこれに打たれました。空のデータソース名および上記のドライバー、プラスあなたの他のプロパティと
spring.datasource.driver-class-name=com.mysql.jdbc.jdbc2.optional.MysqlDataSource
spring.datasource.name=
:
'pom.xml'を表示すると、クラスパスにMySQLドライバがありますか? – Artegon
これは非常に興味深いです。どこかでサンプルを共有できますか?他の条件がここに記載されていない理由を理解したいと思います。 –
お返事ありがとうございます。 –