在 Glassfish 上部署 Web 应用程序时出错

Ham*_*ava 2 java exception glassfish

我正在使用 Eclipse + Glassfish 4.0

当我部署一个简单的项目时,出现以下错误:

cannot Deploy Testmart 

deploy is failing=Error occurred during deployment: Exception while loading 
the app : java.lang.IllegalStateException: ContainerBase.addChild: start: 
org.apache.catalina.LifecycleException: java.lang.RuntimeException: 
Servlet web service endpoint '' failure. Please see server.log for more details.
Run Code Online (Sandbox Code Playgroud)

编辑 :

ProductCatalog.java类:

import org.hamed.train.service.ProductServiceImp;

@WebService
public class ProductCatalog {
    ProductServiceImp productService = new ProductServiceImp();
    @WebMethod
    public List<String> getProducts() {
        return productService.getProductCategories();
    }
    public List<String> getProducts(String category) {
        return productService.getProducts(category);
    }
}
Run Code Online (Sandbox Code Playgroud)

system.log内容:http : //txs.io/B7P

Ham*_*ava 5

根据@Silly Freak 的评论,我找到了答案。

这两个方法不应具有相同的名称:

产品目录.java

public List<String> getProducts() {
        return productService.getProductCategories();
    }

public List<String> getProducts(String category) {
        return productService.getProducts(category);
    }
Run Code Online (Sandbox Code Playgroud)

解决方案:

我将第一个方法名称更改为其他名称并像魅力一样工作。