使用SQLite数据库的简单SpringBoot CRUD应用程序

时间:2018-07-08 12:04:48

标签: spring-boot

当尝试使用SpringBoot数据库实现简单的SQLite应用程序时,出现以下错误。

  

org.springframework.beans.factory.UnsatisfiedDependencyException:创建名称为'org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration'的bean时出错:通过构造函数参数0表示的依赖关系未满足;嵌套异常为org.springframework.beans.factory.BeanCreationException:创建名称为“ dataSource”的Bean时出错,该名称在com.airelogic.bugtrackersystem.BugtrackersystemApplication中定义:通过工厂方法实例化Bean失败;嵌套的异常是org.springframework.beans.BeanInstantiationException:无法实例化[javax.sql.DataSource]:工厂方法'dataSource'引发了异常;嵌套异常为java.lang.IllegalStateException:无法加载JDBC驱动程序类[org.sqlite.JDBC]

我无法粘贴剩余的代码,因为堆栈溢出不允许我。如果有人有任何初步想法,请告诉我。随后,我会根据您的问题附加完整的代码。

这是POM

<?xml version="1.0" encoding="UTF-8"?>

http://maven.apache.org/xsd/maven-4.0.0.xsd“>     4.0.0

<groupId>com.airelogic</groupId>
<artifactId>bugtrackersystem</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>bugtrackersystem</name>
<description>Demo project for Spring Boot</description>

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.0.3.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</groupId>
        <artifactId>spring-orm</artifactId>
        <exclusions>
            <exclusion>
                <artifactId>commons-logging</artifactId>
                <groupId>commons-logging</groupId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-tomcat</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-cloud-connectors</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-jdbc</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-jpa</artifactId>
    </dependency>

    <dependency>
        <groupId>org.eclipse.persistence</groupId>
        <artifactId>javax.persistence</artifactId>
        <version>2.0.0</version>
    </dependency>

    <dependency>
        <groupId>org.xerial</groupId>
        <artifactId>sqlite-jdbc</artifactId>
    </dependency>

    <dependency>
        <groupId>com.zsoltfabok</groupId>
        <artifactId>sqlite-dialect</artifactId>
        <version>1.0</version>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
</dependencies>



    <build>
    <finalName>spring-jpa</finalName>
    <resources>
        <resource>
            <directory>src/main/resources</directory>
            <filtering>true</filtering>
        </resource>
    </resources>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <configuration>
                <warSourceDirectory>src/main/webapp</warSourceDirectory>
                <failOnMissingWebXml>false</failOnMissingWebXml>
            </configuration>
        </plugin>
    </plugins>
</build>

application.properties

spring.jpa.database-platform=org.hibernate.dialect.SQLiteDialect
spring.jpa.hibernate.ddl-auto=create
spring.jpa.show-sql=true

spring.datasource.url=jdbc:sqlite3:bugtrackersystem.db
spring.datasource.username=
spring.datasource.password=
spring.datasource.driver-class-name=org.sqlite.JDBC 

Adding User Repository class:
package com.airelogic.bugtrackersystem.controllers;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;

import com.airelogic.bugtrackersystem.model.User;
import com.airelogic.bugtrackersystem.repositories.UserRepository;

@RestController
@RequestMapping("/api/v1/users")
public class UserController {

@Autowired
private UserRepository userRepository;

@GetMapping
public List<User> list(){       
    return userRepository.findAll();
}

@PostMapping
@ResponseStatus(HttpStatus.OK)
public void create(@RequestBody User user) {
    userRepository.save(user);
}

@GetMapping("/{id}")
public User get(@PathVariable("id") long id) {
    return userRepository.getOne(id);
}

}

User class:

package com.airelogic.bugtrackersystem.model;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

@Entity
@JsonIgnoreProperties({"hibernateLazyInitializer", "handler"})
public class User {

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private int id;
private String fullName;
private String userName;
private String password;

public int getId() {
    return id;
}
public void setId(int id) {
    this.id = id;
}
public String getFullName() {
    return fullName;
}
public void setFullName(String fullName) {
    this.fullName = fullName;
}
public String getUserName() {
    return userName;
}
public void setUserName(String userName) {
    this.userName = userName;
}
public String getPassword() {
    return password;
}
public void setPassword(String password) {
    this.password = password;
}

}

Main Application:

package com.airelogic.bugtrackersystem;

import javax.sql.DataSource;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import 
org.springframework.boot.autoconfigure.jdbc.
DataSourceAutoConfiguration;
import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean;
import 
org.springframework.data.jpa.repository.config.EnableJpaRepositories;

import com.airelogic.bugtrackersystem.repositories.UserRepository;

@SpringBootApplication
@EnableJpaRepositories(basePackageClasses = UserRepository.class)
@EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class})
public class BugtrackersystemApplication {

public static void main(String[] args) {
    SpringApplication.run(BugtrackersystemApplication.class, args);
}


@SuppressWarnings("rawtypes")
@Bean
public DataSource dataSource() {
        DataSourceBuilder dataSourceBuilder = 
DataSourceBuilder.create();
        dataSourceBuilder.driverClassName("org.sqlite.JDBC");
        dataSourceBuilder.url("jdbc:sqlite:mydb.db");
        return dataSourceBuilder.build();   
 }
}

我一直在处理依赖关系,目前面临以下问题。堆栈跟踪如下:

/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/bin/java -Dfile.encoding=UTF-8 -classpath /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre/lib/deploy.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre/lib/ext/cldrdata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre/lib/ext/jaccess.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre/lib/ext/jfxrt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre/lib/ext/nashorn.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre/lib/ext/sunec.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre/lib/ext/zipfs.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre/lib/javaws.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre/lib/jfxswt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre/lib/management-agent.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre/lib/plugin.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/lib/ant-javafx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/lib/javafx-mx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/lib/jconsole.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/lib/packager.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/lib/sa-jdi.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/lib/tools.jar:/Users/narasimhakotnala/Desktop/bugtrackersystemSandeep/target/classes:/Users/narasimhakotnala/.m2/repository/org/springframework/spring-orm/5.0.7.RELEASE/spring-orm-5.0.7.RELEASE.jar:/Users/narasimhakotnala/.m2/repository/org/springframework/spring-beans/5.0.7.RELEASE/spring-beans-5.0.7.RELEASE.jar:/Users/narasimhakotnala/.m2/repository/org/springframework/spring-core/5.0.7.RELEASE/spring-core-5.0.7.RELEASE.jar:/Users/narasimhakotnala/.m2/repository/org/springframework/spring-jcl/5.0.7.RELEASE/spring-jcl-5.0.7.RELEASE.jar:/Users/narasimhakotnala/.m2/repository/org/springframework/spring-jdbc/5.0.7.RELEASE/spring-jdbc-5.0.7.RELEASE.jar:/Users/narasimhakotnala/.m2/repository/org/springframework/spring-tx/5.0.7.RELEASE/spring-tx-5.0.7.RELEASE.jar:/Users/narasimhakotnala/.m2/repository/org/springframework/spring-context/5.0.7.RELEASE/spring-context-5.0.7.RELEASE.jar:/Users/narasimhakotnala/.m2/repository/org/springframework/spring-aop/5.0.7.RELEASE/spring-aop-5.0.7.RELEASE.jar:/Users/narasimhakotnala/.m2/repository/org/springframework/spring-expression/5.0.7.RELEASE/spring-expression-5.0.7.RELEASE.jar:/Users/narasimhakotnala/.m2/repository/org/springframework/spring-webmvc/5.0.7.RELEASE/spring-webmvc-5.0.7.RELEASE.jar:/Users/narasimhakotnala/.m2/repository/org/springframework/spring-web/5.0.7.RELEASE/spring-web-5.0.7.RELEASE.jar:/Users/narasimhakotnala/.m2/repository/org/springframework/boot/spring-boot-starter-tomcat/2.0.3.RELEASE/spring-boot-starter-tomcat-2.0.3.RELEASE.jar:/Users/narasimhakotnala/.m2/repository/javax/annotation/javax.annotation-api/1.3.2/javax.annotation-api-1.3.2.jar:/Users/narasimhakotnala/.m2/repository/org/apache/tomcat/embed/tomcat-embed-core/8.5.31/tomcat-embed-core-8.5.31.jar:/Users/narasimhakotnala/.m2/repository/org/apache/tomcat/embed/tomcat-embed-el/8.5.31/tomcat-embed-el-8.5.31.jar:/Users/narasimhakotnala/.m2/repository/org/apache/tomcat/embed/tomcat-embed-websocket/8.5.31/tomcat-embed-websocket-8.5.31.jar:/Users/narasimhakotnala/.m2/repository/org/springframework/boot/spring-boot-starter-web/2.0.3.RELEASE/spring-boot-starter-web-2.0.3.RELEASE.jar:/Users/narasimhakotnala/.m2/repository/org/springframework/boot/spring-boot-starter-json/2.0.3.RELEASE/spring-boot-starter-json-2.0.3.RELEASE.jar:/Users/narasimhakotnala/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.9.6/jackson-databind-2.9.6.jar:/Users/narasimhakotnala/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.9.0/jackson-annotations-2.9.0.jar:/Users/narasimhakotnala/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.9.6/jackson-core-2.9.6.jar:/Users/narasimhakotnala/.m2/repository/com/fasterxml/jackson/datatype/jackson-datatype-jdk8/2.9.6/jackson-datatype-jdk8-2.9.6.jar:/Users/narasimhakotnala/.m2/repository/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.9.6/jackson-datatype-jsr310-2.9.6.jar:/Users/narasimhakotnala/.m2/repository/com/fasterxml/jackson/module/jackson-module-parameter-names/2.9.6/jackson-module-parameter-names-2.9.6.jar:/Users/narasimhakotnala/.m2/repository/org/hibernate/validator/hibernate-validator/6.0.10.Final/hibernate-validator-6.0.10.Final.jar:/Users/narasimhakotnala/.m2/repository/javax/validation/validation-api/2.0.1.Final/validation-api-2.0.1.Final.jar:/Users/narasimhakotnala/.m2/repository/org/jboss/logging/jboss-logging/3.3.2.Final/jboss-logging-3.3.2.Final.jar:/Users/narasimhakotnala/.m2/repository/com/fasterxml/classmate/1.3.4/classmate-1.3.4.jar:/Users/narasimhakotnala/.m2/repository/org/springframework/boot/spring-boot-starter-cloud-connectors/2.0.3.RELEASE/spring-boot-starter-cloud-connectors-2.0.3.RELEASE.jar:/Users/narasimhakotnala/.m2/repository/org/springframework/cloud/spring-cloud-spring-service-connector/2.0.2.RELEASE/spring-cloud-spring-service-connector-2.0.2.RELEASE.jar:/Users/narasimhakotnala/.m2/repository/org/springframework/cloud/spring-cloud-connectors-core/2.0.2.RELEASE/spring-cloud-connectors-core-2.0.2.RELEASE.jar:/Users/narasimhakotnala/.m2/repository/org/springframework/cloud/spring-cloud-cloudfoundry-connector/2.0.2.RELEASE/spring-cloud-cloudfoundry-connector-2.0.2.RELEASE.jar:/Users/narasimhakotnala/.m2/repository/org/springframework/cloud/spring-cloud-heroku-connector/2.0.2.RELEASE/spring-cloud-heroku-connector-2.0.2.RELEASE.jar:/Users/narasimhakotnala/.m2/repository/org/springframework/cloud/spring-cloud-localconfig-connector/2.0.2.RELEASE/spring-cloud-localconfig-connector-2.0.2.RELEASE.jar:/Users/narasimhakotnala/.m2/repository/org/apache/commons/commons-lang3/3.7/commons-lang3-3.7.jar:/Users/narasimhakotnala/.m2/repository/org/springframework/boot/spring-boot-starter-jdbc/2.0.3.RELEASE/spring-boot-starter-jdbc-2.0.3.RELEASE.jar:/Users/narasimhakotnala/.m2/repository/com/zaxxer/HikariCP/2.7.9/HikariCP-2.7.9.jar:/Users/narasimhakotnala/.m2/repository/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25.jar:/Users/narasimhakotnala/.m2/repository/org/springframework/boot/spring-boot-starter/2.0.3.RELEASE/spring-boot-starter-2.0.3.RELEASE.jar:/Users/narasimhakotnala/.m2/repository/org/springframework/boot/spring-boot/2.0.3.RELEASE/spring-boot-2.0.3.RELEASE.jar:/Users/narasimhakotnala/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/2.0.3.RELEASE/spring-boot-autoconfigure-2.0.3.RELEASE.jar:/Users/narasimhakotnala/.m2/repository/org/springframework/boot/spring-boot-starter-logging/2.0.3.RELEASE/spring-boot-starter-logging-2.0.3.RELEASE.jar:/Users/narasimhakotnala/.m2/repository/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar:/Users/narasimhakotnala/.m2/repository/ch/qos/logback/logback-core/1.2.3/logback-core-1.2.3.jar:/Users/narasimhakotnala/.m2/repository/org/apache/logging/log4j/log4j-to-slf4j/2.10.0/log4j-to-slf4j-2.10.0.jar:/Users/narasimhakotnala/.m2/repository/org/apache/logging/log4j/log4j-api/2.10.0/log4j-api-2.10.0.jar:/Users/narasimhakotnala/.m2/repository/org/slf4j/jul-to-slf4j/1.7.25/jul-to-slf4j-1.7.25.jar:/Users/narasimhakotnala/.m2/repository/org/yaml/snakeyaml/1.19/snakeyaml-1.19.jar:/Users/narasimhakotnala/.m2/repository/org/springframework/boot/spring-boot-starter-data-jpa/2.0.3.RELEASE/spring-boot-starter-data-jpa-2.0.3.RELEASE.jar:/Users/narasimhakotnala/.m2/repository/org/springframework/boot/spring-boot-starter-aop/2.0.3.RELEASE/spring-boot-starter-aop-2.0.3.RELEASE.jar:/Users/narasimhakotnala/.m2/repository/org/aspectj/aspectjweaver/1.8.13/aspectjweaver-1.8.13.jar:/Users/narasimhakotnala/.m2/repository/org/hibernate/hibernate-core/5.2.17.Final/hibernate-core-5.2.17.Final.jar:/Users/narasimhakotnala/.m2/repository/org/hibernate/javax/persistence/hibernate-jpa-2.1-api/1.0.2.Final/hibernate-jpa-2.1-api-1.0.2.Final.jar:/Users/narasimhakotnala/.m2/repository/org/javassist/javassist/3.22.0-GA/javassist-3.22.0-GA.jar:/Users/narasimhakotnala/.m2/repository/antlr/antlr/2.7.7/antlr-2.7.7.jar:/Users/narasimhakotnala/.m2/repository/org/jboss/jandex/2.0.3.Final/jandex-2.0.3.Final.jar:/Users/narasimhakotnala/.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar:/Users/narasimhakotnala/.m2/repository/org/hibernate/common/hibernate-commons-annotations/5.0.1.Final/hibernate-commons-annotations-5.0.1.Final.jar:/Users/narasimhakotnala/.m2/repository/javax/transaction/javax.transaction-api/1.2/javax.transaction-api-1.2.jar:/Users/narasimhakotnala/.m2/repository/org/springframework/data/spring-data-jpa/2.0.8.RELEASE/spring-data-jpa-2.0.8.RELEASE.jar:/Users/narasimhakotnala/.m2/repository/org/springframework/data/spring-data-commons/2.0.8.RELEASE/spring-data-commons-2.0.8.RELEASE.jar:/Users/narasimhakotnala/.m2/repository/org/springframework/spring-aspects/5.0.7.RELEASE/spring-aspects-5.0.7.RELEASE.jar:/Users/narasimhakotnala/.m2/repository/org/eclipse/persistence/javax.persistence/2.0.0/javax.persistence-2.0.0.jar:/Users/narasimhakotnala/.m2/repository/org/xerial/sqlite-jdbc/3.21.0.1/sqlite-jdbc-3.21.0.1.jar:/Users/narasimhakotnala/.m2/repository/com/zsoltfabok/sqlite-dialect/1.0/sqlite-dialect-1.0.jar com.airelogic.bugtrackersystem.BugtrackersystemApplication
2018-07-08 19:49:30.735 DEBUG 29950 --- [           main] o.s.w.c.s.StandardServletEnvironment     : Adding PropertySource 'configurationProperties' with highest search precedence

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

2018-07-08 19:49:30.805 DEBUG 29950 --- [           main] o.s.w.c.s.StandardServletEnvironment     : Adding PropertySource 'servletConfigInitParams' with lowest search precedence
2018-07-08 19:49:30.806 DEBUG 29950 --- [           main] o.s.w.c.s.StandardServletEnvironment     : Adding PropertySource 'servletContextInitParams' with lowest search precedence
2018-07-08 19:49:30.806 DEBUG 29950 --- [           main] o.s.w.c.s.StandardServletEnvironment     : Adding PropertySource 'systemProperties' with lowest search precedence
2018-07-08 19:49:30.806 DEBUG 29950 --- [           main] o.s.w.c.s.StandardServletEnvironment     : Adding PropertySource 'systemEnvironment' with lowest search precedence
2018-07-08 19:49:30.806 DEBUG 29950 --- [           main] o.s.w.c.s.StandardServletEnvironment     : Initialized StandardServletEnvironment with PropertySources [StubPropertySource {name='servletConfigInitParams'}, StubPropertySource {name='servletContextInitParams'}, MapPropertySource {name='systemProperties'}, SystemEnvironmentPropertySource {name='systemEnvironment'}]
2018-07-08 19:49:40.845  INFO 29950 --- [           main] c.a.b.BugtrackersystemApplication        : Starting BugtrackersystemApplication on Narasimhas-MacBook-Pro.local with PID 29950 (/Users/narasimhakotnala/Desktop/bugtrackersystemSandeep/target/classes started by narasimhakotnala in /Users/narasimhakotnala/Desktop/bugtrackersystemSandeep)
2018-07-08 19:49:40.846  INFO 29950 --- [           main] c.a.b.BugtrackersystemApplication        : No active profile set, falling back to default profiles: default
2018-07-08 19:49:40.900  INFO 29950 --- [           main] ConfigServletWebServerApplicationContext : Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@2ddc8ecb: startup date [Sun Jul 08 19:49:40 BST 2018]; root of context hierarchy
2018-07-08 19:49:41.577 DEBUG 29950 --- [           main] o.s.w.c.s.StandardServletEnvironment     : Removing PropertySource 'defaultProperties'
2018-07-08 19:49:41.737  INFO 29950 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$164bc703] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2018-07-08 19:49:42.030  INFO 29950 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
2018-07-08 19:49:42.056  INFO 29950 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2018-07-08 19:49:42.056  INFO 29950 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet Engine: Apache Tomcat/8.5.31
2018-07-08 19:49:42.066  INFO 29950 --- [ost-startStop-1] o.a.catalina.core.AprLifecycleListener   : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/Users/narasimhakotnala/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.]
2018-07-08 19:49:42.180  INFO 29950 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2018-07-08 19:49:42.181 DEBUG 29950 --- [ost-startStop-1] o.s.web.context.ContextLoader            : Published root WebApplicationContext as ServletContext attribute with name [org.springframework.web.context.WebApplicationContext.ROOT]
2018-07-08 19:49:42.181  INFO 29950 --- [ost-startStop-1] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 1284 ms
2018-07-08 19:49:42.329  INFO 29950 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean  : Servlet dispatcherServlet mapped to [/]
2018-07-08 19:49:42.333  INFO 29950 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'characterEncodingFilter' to: [/*]
2018-07-08 19:49:42.333  INFO 29950 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2018-07-08 19:49:42.333  INFO 29950 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2018-07-08 19:49:42.333  INFO 29950 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'requestContextFilter' to: [/*]
2018-07-08 19:49:42.356 DEBUG 29950 --- [           main] o.s.w.c.s.StandardServletEnvironment     : Replacing PropertySource 'servletContextInitParams' with 'servletContextInitParams'
2018-07-08 19:49:42.388 ERROR 29950 --- [           main] com.zaxxer.hikari.HikariConfig           : Failed to load driver class org.sqlite.JDBC from HikariConfig class classloader sun.misc.Launcher$AppClassLoader@135fbaa4
2018-07-08 19:49:42.391  WARN 29950 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in com.airelogic.bugtrackersystem.BugtrackersystemApplication: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.sql.DataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under '' to com.zaxxer.hikari.HikariDataSource
2018-07-08 19:49:42.393  INFO 29950 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2018-07-08 19:49:42.406  INFO 29950 --- [           main] ConditionEvaluationReportLoggingListener : 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2018-07-08 19:49:42.408 ERROR 29950 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   :

申请无法开始


说明:

无法将“”下的属性绑定到com.zaxxer.hikari.HikariDataSource:

Property: driverclassname
Value: org.sqlite.JDBC
Origin: "driverClassName" from property source "source"
Reason: Failed to load driver class org.sqlite.JDBC in either of HikariConfig class loader or Thread context classloader

操作:

更新您的应用程序配置

以退出代码1完成的过程

================================ Narasimhas-MacBook-Pro:bugtracker narasimhakotnala $ ls bugtrackersystem.db mvnw mvnw.cmd pom.xml src目标 Narasimhas-MacBook-Pro:bugtracker narasimhakotnala $ sqlite3 bugtrackersystem.db SQLite版本3.16.0 2016-11-04 19:09:39 输入“ .help”作为使用提示。 sqlite> .tables hibernate_sequence用户
sqlite>从用户选择*; 1 | nara | nara | kot 2 | Rachel Lintott | rachel | lintott 3 |马特·斯蒂芬斯|马特|斯蒂芬斯 sqlite>选择* from hibernate_sequence; 4 sqlite>

0 个答案:

没有答案