2011-11-19 35 views
3

我使用JAX-WS,netbeans 7.0和glassfish-3.1.1編寫web服務。 我嘗試派遣SOAPHandler我的網絡服務使用@HandlerChain:jax-ws,glassfish和@HandlerChain

package ws; 

import javax.jws.WebService; 
import javax.jws.WebMethod; 

import javax.jws.HandlerChain; 


@WebService(serviceName = "ServerInfo", portName="ServerInfoPort") 
@HandlerChain(file="handler-chain.xml") 
public class ServerInfo { 
    @WebMethod(operationName="getServerName") 
    public String getServerName() 
    { 
     return "test server"; 
    } 
} 

處理-chain.xml:

<handler-chains xmlns="http://java.sun.com/xml/ns/javaee" 
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee"> 
    <handler-chain> 
    <handler> 
     <handler-name>ws.SoapMessageHandler</handler-name> 
     <handler-class>ws.SoapMessageHandler</handler-class> 
    </handler> 
    </handler-chain> 
</handler-chains> 

但在日誌中的GlassFish打印:

SEVERE: component referenced from annotation symbol cannot be found 
symbol: javax.jws.HandlerChain 
location: class ws.ServerInfo 

幫幫我!請!

+0

有沒有解決這個問題的方法?當我重新部署戰爭時,我總是不得不重新啓動GF。 –

回答

1

這似乎是一個glassfish錯誤:GLASSFISH-16875 我看到相同的問題,但儘管出現錯誤,服務和處理程序按預期工作。

+0

我仍然遇到最新的問題(3.1.2.2)。 –