我是Java的新手,我的网络服务运动衫有问题。 我创建了一个项目Web服务(project1)和一个项目abc。当我在Web服务中调用类Calcu时,我得到一个错误:
HelloWorldService.java:
import aa.Calcu;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.core.Response;
@Path("/hello") //Path
public class HelloWorldService {
@GET
@Path("/{param}") //parameter
public Response getMsg(@PathParam("param") String msg) {
Calcu c=new Calcu();
String output = "My say : " + msg ;
output= output + c.Concat("3","2");
return Response.status(200).entity(output).build();
}
}
和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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>ground1</groupId>
<artifactId>project1</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>project1 Maven Webapp</name>
<url>http://maven.apache.org</url>
<repositories>
<repository>
<id>maven2-repository.java.net</id>
<name>Java.net Repository for Maven</name>
<url>http://download.java.net/maven/2/</url>
<layout>default</layout>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-server</artifactId>
<version>1.8</version>
</dependency>
</dependencies>
<build>
<finalName>project1</finalName>
</build>
</project>
请告诉我有什么问题?