发布用于在数据库中插入和搜索数据的Web服务时出错

时间:2014-04-26 08:30:26

标签: java web-services jax-ws jax-rpc

首先,我为简单的get和set方法创建了一个web服务,并成功发布了该Web服务。之后,我创建了一个websevice,其中包含使用jdbc连接从oracle数据库插入和搜索数据的方法,但是当我尝试发布此Web服务时,我收到以下错误

Exception in thread "main" Server Runtime Error: javax.xml.ws.WebServiceException
        at com.sun.xml.internal.ws.transport.http.server.HttpEndpoint.publish(Unknown Source)
        at com.sun.xml.internal.ws.transport.http.server.EndpointImpl.publish(Unknown Source)
        at com.sun.xml.internal.ws.spi.ProviderImpl.createAndPublishEndpoint(Unknown Source)
        at javax.xml.ws.Endpoint.publish(Unknown Source)
        at com.bizmonks.services.BizMonksWSPublish.main(BizMonksWSPublish.java:10)
    Caused by: javax.xml.ws.WebServiceException
        at com.sun.xml.internal.ws.model.RuntimeModel.createJAXBContext(Unknown Source)
        at com.sun.xml.internal.ws.model.RuntimeModel.postProcess(Unknown Source)
        at com.sun.xml.internal.ws.modeler.RuntimeModeler.buildRuntimeModel(Unknown Source)
        at com.sun.xml.internal.ws.server.RuntimeEndpointInfo.createSEIModel(Unknown Source)
        at com.sun.xml.internal.ws.server.RuntimeEndpointInfo.init(Unknown Source)
        at com.sun.xml.internal.ws.transport.http.server.HttpEndpoint.publish(Unknown Source)
        ... 5 more
    Caused by: com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
    java.sql.Connection is an interface, and JAXB can't handle interfaces.
        this problem is related to the following location:
            at java.sql.Connection

    at com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException$Builder.check(Unknown Source)
    at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(Unknown Source)
    at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.<init>(Unknown Source)
    at com.sun.xml.internal.bind.v2.ContextFactory.createContext(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.sun.xml.internal.bind.api.JAXBRIContext.newInstance(Unknown Source)
    at com.sun.xml.internal.ws.model.RuntimeModel$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    ... 11 more
你能帮帮我吗?我无法找出我做错的地方。提前谢谢。

0 个答案:

没有答案