4

JAX-WS を使用して作成された WebService があります。次の方法で接続する JUnit を作成しました。

public class LicenseSvcClient {


    private static final String WS_URL = "https://dubdubdub.com/licenseService?wsdl";
    private static LicenseService licenseService;

    @BeforeClass
    public static void init() throws MalformedURLException{
        URL url = new URL(WS_URL);
        QName qname = new QName("http://webservices.activation.cellebrite/", "LicenseServiceImplService");
        Service service = Service.create(url, qname);
        licenseService = service.getPort(LicenseService.class);
        Map<String, Object> req_ctx = ((BindingProvider)licenseService).getRequestContext();
        req_ctx.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, WS_URL);

        Map<String, List<String>> headers = new HashMap<String, List<String>>();                

        req_ctx.put(MessageContext.HTTP_REQUEST_HEADERS, headers);

    }

    @Test
    public void lol(){

            licenseService.hasCellewiseLicense("Roflol");
    }

}

この JUnit は見事に機能し、サービスに接続しますが、別のアプリケーションからこのサービスに接続しようとすると、次の例外がスローされます。まったく同じコードを使用していることに注意してください。

[Fatal Error] licenseService?xsd=1:6:3: The element type "hr" must be terminated by the matching end-tag "</hr>".
[Fatal Error] licenseService?xsd=1:6:3: The element type "hr" must be terminated by the matching end-tag "</hr>".
2013-03-24 16:52:41,292 ERROR DefaultExceptionMapper:114 - Unexpected error occurred
org.apache.wicket.WicketRuntimeException: Can't instantiate page using constructor 'public cellebrite.urs.web.page.cellewise.CellewiseCodeGenerationPage()'. Might be it doesn't exist, may be it is not visible (public).
    at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:196)
    at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:68)
    at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:47)
    at org.apache.wicket.DefaultMapperContext.newPageInstance(DefaultMapperContext.java:103)
    at org.apache.wicket.request.handler.PageProvider.resolvePageInstance(PageProvider.java:264)
    at org.apache.wicket.request.handler.PageProvider.getPageInstance(PageProvider.java:165)
    at org.apache.wicket.request.handler.render.PageRenderer.getPage(PageRenderer.java:78)
    at org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:105)
    at org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:224)
    at org.apache.wicket.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:167)
    at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:784)
    at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
    at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:255)
    at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:212)
    at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:283)
    at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:188)
    at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:244)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1115)
    at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1115)
    at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:361)
    at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
    at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
    at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
    at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at org.mortbay.jetty.Server.handle(Server.java:324)
    at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534)
    at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:864)
    at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:533)
    at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:207)
    at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:403)
    at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
    at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:522)
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:177)
    ... 34 more
Caused by: javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.
    at org.apache.cxf.jaxws.ServiceImpl.<init>(ServiceImpl.java:150)
    at org.apache.cxf.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:91)
    at javax.xml.ws.Service.<init>(Unknown Source)
    at javax.xml.ws.Service.create(Unknown Source)
    at com.cellebrite.shared.webservice.LicenseServiceClient.init(LicenseServiceClient.java:59)
    at com.cellebrite.shared.webservice.LicenseServiceClient.load(LicenseServiceClient.java:79)
    at com.cellebrite.shared.webservice.LicenseServiceClient.isCellewiseEnabled(LicenseServiceClient.java:70)
    at WICKET_com.cellebrite.shared.webservice.LicenseServiceClient$$FastClassByCGLIB$$d8ec55d.invoke(<generated>)
    at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191)
    at org.apache.wicket.proxy.LazyInitProxyFactory$CGLibInterceptor.intercept(LazyInitProxyFactory.java:318)
    at WICKET_com.cellebrite.shared.webservice.LicenseServiceClient$$EnhancerByCGLIB$$57f3c545.isCellewiseEnabled(<generated>)
    at cellebrite.urs.web.page.cellewise.CellewiseCodeGenerationPage.canAccess(CellewiseCodeGenerationPage.java:49)
    at cellebrite.urs.web.page.cellewise.CellewiseCodeGenerationPage.<init>(CellewiseCodeGenerationPage.java:41)
    ... 39 more
Caused by: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.
    at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:94)
    at org.apache.cxf.jaxws.ServiceImpl.initializePorts(ServiceImpl.java:204)
    at org.apache.cxf.jaxws.ServiceImpl.<init>(ServiceImpl.java:148)
    ... 51 more
Caused by: javax.wsdl.WSDLException: WSDLException (at /definitions/types/xsd:schema): faultCode=PARSER_ERROR: Problem parsing 'http://dubdubdub.com/licenseService?xsd=1'.: org.xml.sax.SAXParseException: The element type "hr" must be terminated by the matching end-tag "</hr>".
    at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown Source)
    at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
    at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
    at com.ibm.wsdl.xml.WSDLReaderImpl.parseTypes(Unknown Source)
    at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source)
    at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
    at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
    at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:242)
    at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:191)
    at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:92)
    ... 53 more
Caused by: org.xml.sax.SAXParseExceptionpublicId: http://dubdubdub.com/licenseService?xsd=1; systemId: http://dubdubdub.com/licenseService?xsd=1; lineNumber: 6; columnNumber: 3; The element type "hr" must be terminated by the matching end-tag "</hr>".
    at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
    ... 63 more
4

1 に答える 1

1

http://dubdubdub.com/licenseService?xsd=1「実際の」サービスクライアントから呼び出されたときに、スタックトレースで指定された URL がエラーメッセージを返すと思います。

おそらく、指定された URL が実際に機能するかどうかを確認する必要があります。<hr>WSDL パーサーは、Web サービス クライアントが解析可能なスキーマ ファイルではなくエラー ページを取得していることを示唆する閉じられていないタグについて不平を言っています。

于 2013-03-25T12:27:22.160 に答える