我在开发环境中有一个SpringBoot项目,它是Windows 7 64& JDK 8一切都很好,因为我已经完成了它,一切都运行正常。当我把它作为WAR包打包到富有成效的环境时,它就是Tomcat 8&在Linux机器上的JDK 8,它不起作用,因为我不熟悉Java,你能不能看看我做错了什么。 我检查了日志文件,这里有一些错误
2016-10-23 16:57:02.314 INFO 8408 --- [localhost-startStop-2]
s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/gjbuploadnew],
methods=[POST],consumes=[application/json;charset=UTF-8],
produces=[application/json;charset=UTF-8]}" onto public
com.newwebservice.models.Gjret
com.newwebservice.web.api.UploadgjbnewController.
uploadgjbnew(com.newwebservice.models.Gjupload)
throws java.sql.SQLException,java.lang.ClassNotFoundException
2016-10-23 16:57:02.318 INFO 8408 ---
[localhost-startStop-2]
s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped
"{[/error],produces=[text/html]}" onto public
org.springframework.web.servlet.ModelAndVieworg.
springframework.boot.autoconfigure.web.BasicErrorController.errorHtml
(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse)
2016-10-23 16:57:02.319
INFO 8408 --- [localhost-startStop-2]
s.w.s.m.m.a.RequestMappingHandlerMapping :
Mapped "{[/error]}" onto public
org.springframework.http.ResponseEntity<java.util.Map
<java.lang.String,java.lang.Object>>
org.springframework.boot.autoconfigure.web.BasicErrorController.
error(javax.servlet.http.HttpServletRequest)
我确实使用了jtds库,虽然它显示日志文件中出现了SQL异常,但我发现jtds-1.3.1.jar文件的库位于webapps / newwebservice / WEB-INF / lib文件夹中,我无法弄清楚我做错了什么。
这是我的pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.newwebservice</groupId>
<artifactId>newwebservice</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>newwebservice</name>
<description>newwebservice</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.0.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.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-cache</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-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.sourceforge.jtds</groupId>
<artifactId>jtds</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>