我已经使用REST api实现了医院管理系统。当我的各个部分都运行时没有任何错误。但是我们使用GitHub集成了该项目,然后在pom.xml第一行中给出了错误。这是代码中的错误行。
<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">
这是我的pom.xml文件。
<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>Hospital</groupId>
<artifactId>Hospital</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>3.0.0</version>
<configuration>
<warSourceDirectory>WebContent</warSourceDirectory>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-bundle</artifactId>
<version>1.19.4</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-core</artifactId>
<version>1.19.4</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-server</artifactId>
<version>1.19.4</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.48</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.2.3</version>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.8.1</version>
</dependency>
</dependencies>
</project>
这是我的错误
Apr 17, 2020 5:53:40 PM com.sun.jersey.api.core.ScanningResourceConfig logClasses
INFO: Root resource classes found:
class homePage.service.HomePageService
class doctors.service.DoctorService
class hospital.service.HospitalService
class user.service.UserLoginService
class user.service.UserRegisterService
class payment.service.PaymentService
Apr 17, 2020 5:53:40 PM com.sun.jersey.api.core.ScanningResourceConfig init
INFO: No provider classes found.
Apr 17, 2020 5:53:41 PM com.sun.jersey.server.impl.application.WebApplicationImpl _initiate
INFO: Initiating Jersey application, version 'Jersey: 1.19.4 05/24/2017 03:46 PM'
Apr 17, 2020 5:53:43 PM com.sun.jersey.spi.inject.Errors processErrorMessages
WARNING: The following warnings have been detected with resource and/or provider classes:
WARNING: A sub-resource method, public java.lang.String hospital.service.HospitalService.ReadHospitals(), with URI template, "/", is treated as a resource method
WARNING: A sub-resource method, public java.lang.String hospital.service.HospitalService.insertHoapitalDet(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String), with URI template, "/", is treated as a resource method
WARNING: A sub-resource method, public java.lang.String hospital.service.HospitalService.deleteHospitalDet(java.lang.String), with URI template, "/", is treated as a resource method
WARNING: A sub-resource method, public java.lang.String hospital.service.HospitalService.updateHospitalDet(java.lang.String), with URI template, "/", is treated as a resource method
WARNING: A sub-resource method, public java.lang.String doctors.service.DoctorService.updateDoctor(java.lang.String), with URI template, "/", is treated as a resource method
WARNING: A sub-resource method, public java.lang.String doctors.service.DoctorService.insertDoctor(java.lang.String,java.lang.String,java.lang.String,int,java.lang.String,java.lang.String,java.lang.String), with URI template, "/", is treated as a resource method
WARNING: A sub-resource method, public java.lang.String doctors.service.DoctorService.deleteDoctor(java.lang.String), with URI template, "/", is treated as a resource method
WARNING: A sub-resource method, public java.lang.String doctors.service.DoctorService.readDoctors(), with URI template, "/", is treated as a resource method
WARNING: A sub-resource method, public java.lang.String user.service.UserRegisterService.insertUser(java.lang.String,java.lang.String,java.lang.String,int,java.lang.String,int), with URI template, "/", is treated as a resource method
WARNING: A sub-resource method, public java.lang.String user.service.UserLoginService.validateLogin(java.lang.String,java.lang.String), with URI template, "/", is treated as a resource method
WARNING: A sub-resource method, public java.lang.String user.service.UserLoginService.readUser(java.lang.String,java.lang.String), with URI template, "/", is treated as a resource method
WARNING: A sub-resource method, public java.lang.String user.service.UserLoginService.updateUser(java.lang.String), with URI template, "/", is treated as a resource method
WARNING: A sub-resource method, public java.lang.String user.service.UserLoginService.deleteUser(java.lang.String), with URI template, "/", is treated as a resource method
WARNING: A sub-resource method, public java.lang.String payment.service.PaymentService.validatePayment(java.lang.String,java.lang.String), with URI template, "/", is treated as a resource method
Apr 17, 2020 5:53:43 PM org.apache.catalina.core.StandardContext reload
INFO: Reloading Context with name [/Hospital] is completed
如果有人已修复,我希望答复。
我不明白您与github集成的含义。
[我认为这个问题是由于您的方法中定义了@Path("/")
,我说这是假设您已经具有一个类级注释@Path("/yourPathSpecificToThisClass")
。然后,您可以添加@Path("/somepath")
,但不添加@Path("/")
。这是因为它仅需要请求方法(@ Get,@ Post等)来标识路径。