glassfish视图端点不可见

时间:2014-12-07 10:50:12

标签: web-services glassfish jax-ws

我已经编写了一个从我的DB获取数据列表的web服务。但是当我部署应用程序时,我看不到视图端点。这是我的代码。

package com.mesutemre.service;

@WebService(name = "KitapListesi" , targetNamespace = "http://com.mesutemre.service/")
public interface KitapListesi {

@WebMethod(operationName = "listallBooks")
@WebResult(name = "books")
public List<Kitaplar> findAllKitaplar();

}

实施班

package com.mesutemre.service;

@WebService(portName = "kitapListesiPort", serviceName = "KitapListesiService", targetNamespace = "http://com.mesutemre.service/", endpointInterface = "com.mesutemre.service.KitapListesi")
public class KitapListesiImpl implements KitapListesi {

private MySQLBaglantisi msb;

@Override
public List<Kitaplar> findAllKitaplar() {
    msb.baglan();
    String sql = "SELECT * FROM kutuphane.kitaplar";
    List<Kitaplar> kitapList = new ArrayList<Kitaplar>();
    try {
        PreparedStatement pstmt = (PreparedStatement) msb.getConnection()
                .prepareStatement(sql);
        ResultSet rs = pstmt.executeQuery();
        while (rs.next()) {
            kitapList.add(new Kitaplar(rs.getInt(1), rs.getString(2), rs
                    .getString(3), rs.getString(4), rs.getString(5)));
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
    msb.baglantiyiKes();
    return kitapList;
}

}

这个问题是关于我的代码还是其他问题?

1 个答案:

答案 0 :(得分:-1)

在Glassfish server.log文件中,您应该看到如下行:

[2014-12-08T00:00:00.000+0000] [glassfish 4.0] [INFO] [AS-WSJSR109IMPL-00018 [javax.enterprise.webservices] [tid: _ThreadID=35 _ThreadName=admin-listener(4)] [timeMillis: 1418029146568] [levelValue: 800] [[ Webservice Endpoint deployed KitapListesiService listening at address at http://example:8080/example/KitapListesiService.]]