2017-03-28 8 views
0

私のアプリケーション(mongodb)のデータベースにアクセスするためにKunderaを使用しようとしています。しかし、私はエラーが発生している:Cannot determine embedded database driver class for database type NONEそれを起動します。kunderaをspring用のデータベースドライバとして使用するとエラーが発生する

データベースを使用するためには何を設定する必要がありますか?

完全なエラーメッセージ:

Cannot determine embedded database driver class for database type NONE 

Action: 

If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (no profiles are currently active). 

全ログ>

Connected to the target VM, address: '127.0.0.1:17260', transport: 'socket' 

    . ____   _   __ _ _ 
/\\/___'_ __ _ _(_)_ __ __ _ \ \ \ \ 
(()\___ | '_ | '_| | '_ \/ _` | \ \ \ \ 
\\/ ___)| |_)| | | | | || (_| | )))) 
    ' |____| .__|_| |_|_| |_\__, |//// 
=========|_|==============|___/=/_/_/_/ 
:: Spring Boot ::  (v1.5.0.RELEASE) 

2017-03-28 21:53:10.162 INFO 204 --- [   main] main.App         
: Starting App on DESKTOP-J12LM4I with PID 204 
(D:\--omitted--\resttest\build\classes\main started by Johan Vikström in D:\--omitted--\resttest) 
2017-03-28 21:53:10.165 INFO 204 --- [   main] main.App         
: No active profile set, falling back to default profiles: default 
2017-03-28 21:53:10.318 INFO 204 --- [   main] 
ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot[email protected]6cd28fa7: startup date [Tue Mar 28 21:53:10 CEST 2017]; root of context hierarchy 
2017-03-28 21:53:11.648 INFO 204 --- [   main] 
f.a.AutowiredAnnotationBeanPostProcessor : JSR-330 'javax.inject.Inject' 
annotation found and supported for autowiring 
2017-03-28 21:53:11.718 INFO 204 --- [   main] 
trationDelegate$BeanPostProcessorChecker : Bean'org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration' of type [org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 
2017-03-28 21:53:11.786 INFO 204 --- [   main] trationDelegate$BeanPostProcessorChecker : Bean 'validator' of type 
[org.springframework.validation.beanvalidation.LocalValidatorFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 
2017-03-28 21:53:11.833 INFO 204 --- [   main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$e1fc46a] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 
2017-03-28 21:53:12.210 INFO 204 --- [   main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat initialized with port(s): 8080 
(http) 
2017-03-28 21:53:12.226 INFO 204 --- [   main] o.apache.catalina.core.StandardService : Starting service Tomcat 
2017-03-28 21:53:12.227 INFO 204 --- [   main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache 
Tomcat/8.5.11 
2017-03-28 21:53:12.369 INFO 204 --- [ost-startStop-1] o.a.c.c.C.[Tomcat]. 
[localhost].[/]  : Initializing Spring embedded WebApplicationContext 
2017-03-28 21:53:12.369 INFO 204 --- [ost-startStop-1] o.s.web.context.ContextLoader   : Root WebApplicationContext: 
initialization completed in 2054 ms 
2017-03-28 21:53:12.669 INFO 204 --- [ost-startStop-1] 
o.s.b.w.servlet.ServletRegistrationBean : Mapping servlet: 'dispatcherServlet' to [/] 
2017-03-28 21:53:12.681 INFO 204 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*] 
2017-03-28 21:53:12.682 INFO 204 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*] 
2017-03-28 21:53:12.682 INFO 204 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/*] 
2017-03-28 21:53:12.683 INFO 204 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*] 
2017-03-28 21:53:12.773 WARN 204 --- [   main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: 
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration': 
Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Tomcat.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate 
[org.apache.tomcat.jdbc.pool.DataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Cannot determine embedded database driver class for database type NONE. If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (no profiles are currently active). 
2017-03-28 21:53:12.780 INFO 204 --- [   main] utoConfigurationReportLoggingInitializer : 

Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled. 
2017-03-28 21:53:12.785 ERROR 204 --- [   main] o.s.b.d.LoggingFailureAnalysisReporter : 

*************************** 
APPLICATION FAILED TO START 
*************************** 

Description: 

Cannot determine embedded database driver class for database type NONE 

Action: 

If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (no profiles are currently active). 

私は何これを行うには見当がつかない。私はこれらの過去4日間のKunderaとSpringの使用に関連するさまざまなエラーがありました。デバッグするために何度も再試行しなければなりませんでした。しかし、私はどこから始めるべきか分かりません。また、私はIntellijを使用しています。

追加情報が必要な場合は、お気軽にお問い合わせください。

ありがとうございます。

EDIT: スプリングコンフィグ:

persistence.xmlの

<persistence xmlns="http://java.sun.com/xml/ns/persistence" 
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xsi:schemaLocation="http://java.sun.com/xml/ns/persistence 
https://raw.github.com/impetus-opensource/Kundera/Kundera-2.0.4/kundera-core/src/test/resources/META-INF/persistence_2_0.xsd" 
     version="2.0"> 

<!-- 
    The mongodb installation must allow outside connections. 
--> 

<persistence-unit name="mongo_pu"> 
    <provider>com.impetus.kundera.KunderaPersistence</provider> 
    <class>main.storage.entites.UserEntity</class> 
    <exclude-unlisted-classes>true</exclude-unlisted-classes> 
    <properties> 
     <property name="kundera.nodes" value="192.168.10.190" /> 
     <property name="kundera.port" value="27017" /> 
     <property name="kundera.keyspace" value="test" /> 
     <property name="kundera.client.lookup.class" 
        value="com.impetus.client.mongodb.MongoDBClientFactory" /> 

    </properties> 
</persistence-unit> 

applicationContext.xmlを

<?xml version="1.0" encoding="UTF-8"?> 
<beans:beans xmlns="http://www.springframework.org/schema/mvc" 
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xmlns:beans="http://www.springframework.org/schema/beans" 
     xmlns:context="http://www.springframework.org/schema/context" 
     xsi:schemaLocation="http://www.springframework.org/schema/mvc 
http://www.springframework.org/schema/mvc/spring-mvc.xsd 
    http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans.xsd 
    http://www.springframework.org/schema/context 
http://www.springframework.org/schema/context/spring-context.xsd"> 

<!-- DispatcherServlet Context: defines this servlet's request-processing infrastructure --> 

<!-- Enables the Spring MVC @Controller programming model --> 
<annotation-driven /> 

<context:component-scan base-package="main" /> 

<beans:bean id="dao" class="main.storage.DaoImpl"> 
</beans:bean> 
<beans:bean id="userDao" class="main.storage.UserDaoImpl"/> 

<beans:bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"> 
    <beans:property name="persistenceUnitName" value="mongo_pu"/> 
</beans:bean> 
<beans:bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"> 
    <beans:property name="entityManagerFactory" ref="entityManagerFactory" /> 
</beans:bean> 

App.java

package main; 

import org.springframework.boot.SpringApplication; 
import org.springframework.boot.autoconfigure.EnableAutoConfiguration; 
import org.springframework.boot.autoconfigure.SpringBootApplication; 
import org.springframework.context.annotation.ComponentScan; 

@ComponentScan 
@EnableAutoConfiguration 
@SpringBootApplication 
public class App { 
    public static void main(String[] args){ 
     SpringApplication.run(App.class, args); 
    } 
} 
+0

これを参照してください:https://github.com/impetus-opensource/Kundera/wiki/Using-Kundera-with-Springまた、スプリング設定ファイルで質問を更新してください –

+0

はい、私はそのwiki-page multiple回。私は春の設定を追加します。ファイル。 – Tritzium

答えて

0

これは、spring-jpa依存性がバンドルに含まれている可能性があります。それを削除し、それが動作するかどうかを確認してください!

関連する問題