无法先从移动设备查看发布的Web服务

时间:2019-04-25 09:45:52

标签: java spring web-services ibm-mobilefirst jax-ws

我有一个Mobile First项目,内部有一个Web服务。发布并在浏览器中输入http://localhost:9080/mfp/api/adapters/abcMfpApi/test时,无法查看发布的Web服务并显示HTTP 404 Not Found错误。

下面是applicationContext.xml

<?xml version="1.0" encoding="UTF-8"?>

<beans
    xmlns="http://www.springframework.org/schema/beans"
    xmlns:util="http://www.springframework.org/schema/util"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:p="http://www.springframework.org/schema/p"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:jee="http://www.springframework.org/schema/jee"
    xmlns:aop="http://www.springframework.org/schema/aop"
    xmlns:task="http://www.springframework.org/schema/task"
    xmlns:ws="http://jax-ws.dev.java.net/spring/core"
    xmlns:wss="http://jax-ws.dev.java.net/spring/servlet"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
         http://www.springframework.org/schema/beans/spring-beans.xsd
         http://www.springframework.org/schema/aop
         http://www.springframework.org/schema/aop/spring-aop.xsd
         http://www.springframework.org/schema/context
         http://www.springframework.org/schema/context/spring-context.xsd
         http://www.springframework.org/schema/util
         http://www.springframework.org/schema/util/spring-util.xsd
         http://www.springframework.org/schema/jee 
         http://www.springframework.org/schema/jee/spring-jee.xsd
         http://www.springframework.org/schema/task
         http://www.springframework.org/schema/task/spring-task.xsd
         http://jax-ws.dev.java.net/spring/core
        http://jax-ws.dev.java.net/spring/core.xsd
        http://jax-ws.dev.java.net/spring/servlet
        http://jax-ws.dev.java.net/spring/servlet.xsd">

    <wss:binding url="/test">
        <wss:service>
            <ws:service bean="#testWS" />
        </wss:service>
    </wss:binding>

    <bean id="testWS" class="abc.controller.CallbackControllerTest" />

</beans>

下面是Web服务类:

package abc.controller;

import javax.jws.WebService;
import javax.ws.rs.Path;

    @WebService(endpointInterface = "abc.controller.callbackControllerInterface")
    public class CallbackControllerTest implements CallbackControllerInterface {

        @Override
        public void Notify(String event) {

        }
    }

下面是接口类:

package abc.controller;

import javax.jws.WebMethod;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;

@WebService
@SOAPBinding(style = SOAPBinding.Style.RPC)
public interface CallbackControllerInterface {

    @WebMethod
    public void Notify(String event);
}

下面是来自Mobile First的错误日志:

2019-04-25 17:17:03.688 [UnknownExceptionMapper] - Exception detected
javax.ws.rs.ClientErrorException: HTTP 404 Not Found
    at org.apache.cxf.jaxrs.utils.SpecExceptions.toHttpException(SpecExceptions.java:117) ~[SpecExceptions.class:?]
    at org.apache.cxf.jaxrs.utils.ExceptionUtils.toHttpException(ExceptionUtils.java:162) ~[ExceptionUtils.class:?]
    at org.apache.cxf.jaxrs.utils.JAXRSUtils.findTargetMethod(JAXRSUtils.java:528) ~[JAXRSUtils.class:?]
    at org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.processRequest(JAXRSInInterceptor.java:177) ~[JAXRSInInterceptor.class:?]
    at org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.handleMessage(JAXRSInInterceptor.java:77) ~[JAXRSInInterceptor.class:?]
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307) ~[PhaseInterceptorChain.class:3.1.0]
    at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) ~[ChainInitiationObserver.class:3.1.0]
    at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:251) ~[AbstractHTTPDestination.class:3.1.0]
    at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234) ~[ServletController.class:3.1.0]
    at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208) ~[ServletController.class:3.1.0]
    at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160) ~[ServletController.class:3.1.0]
    at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:171) ~[CXFNonSpringServlet.class:3.1.0]
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:293) ~[AbstractHTTPServlet.class:3.1.0]
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:217) ~[AbstractHTTPServlet.class:3.1.0]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:687) ~[com.ibm.ws.javaee.servlet.3.1_1.0.11.jar:?]
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:268) ~[AbstractHTTPServlet.class:3.1.0]
    at com.ibm.mfp.server.java.adapter.shared.JAXRSSandbox$3.doFilter(JAXRSSandbox.java:579) ~[mfp-server.war:?]
    at com.ibm.mfp.server.java.adapter.shared.FilterChainImpl.doFilter(FilterChainImpl.java:86) ~[mfp-server.war:?]
    at com.ibm.mfp.server.java.adapter.shared.JAXRSSandbox.handleRequest(JAXRSSandbox.java:584) ~[mfp-server.war:?]
    at com.ibm.mfp.server.java.adapter.internal.rest.AdaptersEndpoint.adapterServing(AdaptersEndpoint.java:123) ~[mfp-server.war:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_201]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_201]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_201]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_201]
    at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221) ~[InvocableHandlerMethod.class:4.1.6.RELEASE]
    at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137) ~[InvocableHandlerMethod.class:4.1.6.RELEASE]
    at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110) ~[ServletInvocableHandlerMethod.class:5.0.1.RELEASE]
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:776) ~[RequestMappingHandlerAdapter.class:5.0.1.RELEASE]
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:705) ~[RequestMappingHandlerAdapter.class:5.0.1.RELEASE]
    at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) ~[AbstractHandlerMethodAdapter.class:5.0.1.RELEASE]
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959) ~[DispatcherServlet.class:5.0.1.RELEASE]
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893) ~[DispatcherServlet.class:5.0.1.RELEASE]
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966) ~[FrameworkServlet.class:5.0.1.RELEASE]
    at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:857) ~[FrameworkServlet.class:5.0.1.RELEASE]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:687) ~[com.ibm.ws.javaee.servlet.3.1_1.0.11.jar:?]
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842) ~[FrameworkServlet.class:5.0.1.RELEASE]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) ~[com.ibm.ws.javaee.servlet.3.1_1.0.11.jar:?]
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1287) ~[?:?]
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:778) ~[?:?]
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:475) ~[?:?]
    at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1158) ~[?:?]
    at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:81) ~[?:?]
    at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:928) ~[?:?]
    at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost$2.run(DynamicVirtualHost.java:262) ~[?:?]
    at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink$TaskWrapper.run(HttpDispatcherLink.java:955) ~[?:?]
    at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink.ready(HttpDispatcherLink.java:341) ~[?:?]
    at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:470) ~[?:?]
    at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleNewRequest(HttpInboundLink.java:404) ~[?:?]
    at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.processRequest(HttpInboundLink.java:284) ~[?:?]
    at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.ready(HttpInboundLink.java:255) ~[?:?]
    at com.ibm.ws.tcpchannel.internal.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:174) ~[?:?]
    at com.ibm.ws.tcpchannel.internal.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:83) ~[?:?]
    at com.ibm.ws.tcpchannel.internal.WorkQueueManager.requestComplete(WorkQueueManager.java:504) ~[?:?]
    at com.ibm.ws.tcpchannel.internal.WorkQueueManager.attemptIO(WorkQueueManager.java:574) ~[?:?]
    at com.ibm.ws.tcpchannel.internal.WorkQueueManager.workerRun(WorkQueueManager.java:929) ~[?:?]
    at com.ibm.ws.tcpchannel.internal.WorkQueueManager$Worker.run(WorkQueueManager.java:1018) ~[?:?]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_201]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_201]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_201]
[INFO ]    2019-04-25 17:17:03.692 [InboundBodyLogger] - inbound-response|Method:GET|Endpoint:/mfp/api/adapters/abcMfpApi/test|Header:{Content-Type=[application/json], Date=[Thu, 25 Apr 2019 09:17:03 GMT]}|Body:{"errorCode":"INTERNAL_SERVER_ERROR","errorMessage":"Internal server error"}

有人可以对我的问题提供以下帮助吗?

  1. 如何知道已发布Web服务的确切URL?
  2. 如果我的http://localhost:9080/mfp/api/adapters/abcMfpApi/test网址是 正确,为什么移动设备首先返回404错误?

0 个答案:

没有答案