2017-03-28 3 views
0

내 응용 프로그램 (mongodb)의 데이터베이스에 액세스 할 때 Kundera를 사용하려고합니다. 그러나 오류가 발생했습니다 : Cannot determine embedded database driver class for database type NONE 시작할 때.봄용 데이터베이스 드라이버로 kundera를 사용하면 오류가 발생합니다.

데이터베이스를 사용하려면 무엇을 설정해야합니까?

전체 오류 메시지 :

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.context.embedded.A[email protected]: 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를 사용하고 있습니다.

추가 정보가 필요하시면 언제든지 문의하십시오.

미리 감사드립니다.

편집 : 봄 CONFIGS :

의 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

예, 위키 페이지의 여러 페이지를 읽었습니다. 타임스. 봄 설정을 추가하겠습니다. 파일. – Tritzium

답변

0

나는 이것이 스프링 - jpa 종속성으로 인한 것일 수 있다고 생각합니다. 그것을 제거하고 작동하는지보십시오!