无法访问特别是weblogic上的webapp服务

时间:2017-06-08 08:32:44

标签: java web-services weblogic axis2

我正在测试我的webservices calls我的某个网络应用程序,看起来除了web-servers之外每个Weblogic都有效。

好像Weblogic方存在错误。我附加了日志和代码。

以下是日志:

2017-06-08 12:06:40,744 ERROR [org.apache.axis2.engine.AxisEngine] - <The service cannot be found for the endpoint reference (EPR) http://localhost:7001/***/services/***>
org.apache.axis2.AxisFault: The service cannot be found for the endpoint reference (EPR) http://localhost:7001/***/services/***
       at org.apache.axis2.engine.DispatchPhase.checkPostConditions(DispatchPhase.java:65)
       at org.apache.axis2.engine.Phase.invoke(Phase.java:334)
       at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:254)
       at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:160)
       at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:173)
       at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:144)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:751)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:844)
       at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:280)
       at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:254)
       at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:136)
       at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:346)
       at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:25)
       at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
       at com.***.tools.auth.client.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:90)
       at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
       at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3436)
       at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3402)
       at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
       at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
       at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:57)
       at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2285)
       at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2201)
       at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179)
       at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1572)
       at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:255)
       at weblogic.work.ExecuteThread.execute(ExecuteThread.java:311)
       at weblogic.work.ExecuteThread.run(ExecuteThread.java:263)

我试过Tomcat, Jboss and Websphere,它运作正常。

以下是代码:

public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException,
            ServletException {

        // Conditionally select and set the character encoding to be used
        if (ignore || (request.getCharacterEncoding() == null)) {
            String encoding = selectEncoding(request);
            if (encoding != null)
                request.setCharacterEncoding(encoding);
        }

        // Pass control on to the next filter
        chain.doFilter(request, response);

        response.setCharacterEncoding(encoding);
    }

更新

更新web.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>
            /WEB-INF/config/xxxx/xxxx.xml
            /WEB-INF/config/xxxx/xxxx.xml
            /WEB-INF/applicationContext.xml
            /WEB-INF/config/xxxx/xxxx.xml
            /WEB-INF/classes/xxxx.xml
        </param-value>
    </context-param>

    <!-- Uncomment this section to enable container managed authentication. You'll also need to configure security in the container.
     <context-param>
        <param-name>CBA_Prefix</param-name>
        <param-value>xxxx</param-value>
        <description>Org Prefix - CBA</description>
    </context-param> 
    -->

    <filter>
        <filter-name>EncodeFilter</filter-name>
        <filter-class>com.xxxx.tools.auth.client.SetCharacterEncodingFilter</filter-class>
        <init-param>
            <param-name>encoding</param-name>
            <param-value>UTF-8</param-value>
        </init-param>
    </filter>
    <filter>
        <filter-name>authFilter</filter-name>
        <filter-class>com.xxx.tools.auth.client.AuthServletFilter</filter-class>
    </filter>
    <filter>
        <filter-name>ResponseOverrideFilter</filter-name>
        <filter-class>
            org.displaytag.filter.ResponseOverrideFilter
        </filter-class>
    </filter>

    <filter-mapping>
        <filter-name>EncodeFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
    <filter-mapping>
        <filter-name>authFilter</filter-name>
        <url-pattern>*.do</url-pattern>
    </filter-mapping>
    <filter-mapping>
        <filter-name>authFilter</filter-name>
        <url-pattern>*.jsp</url-pattern>
    </filter-mapping>
    <filter-mapping>
        <filter-name>ResponseOverrideFilter</filter-name>
        <url-pattern>*.do</url-pattern>
    </filter-mapping>

    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
    <servlet>
        <servlet-name>action</servlet-name>
        <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
        <init-param>
            <param-name>config</param-name>
            <param-value>/WEB-INF/struts-config-base.xml,/WEB-INF/struts-config.xml</param-value>
        </init-param>
        <load-on-startup>0</load-on-startup>
    </servlet>
    <servlet>
        <servlet-name>configuration</servlet-name>
        <servlet-class>com.xxx.xxxx.xxx.xxx.aConfiguration</servlet-class>
        <init-param>
            <param-name>config</param-name>
            <param-value>
                ${}/xxxx.xml,
                /WEB-INF/config/XSSConfig.xml,
                /WEB-INF/config/xxxx.xml
            </param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>      
    <!-- Axis2  API -->     
    <servlet>
        <servlet-name>AxisServlet</servlet-name>
        <display-name>Apache-Axis Servlet</display-name>
        <servlet-class>org.apache.axis2.transport.http.AxisServlet</servlet-class>
        <load-on-startup>2</load-on-startup>
    </servlet>      

    <servlet-mapping>
        <servlet-name>action</servlet-name>
        <url-pattern>*.do</url-pattern>
    </servlet-mapping>

    <!-- Axis2  servlet mapping-->  
    <servlet-mapping>
        <servlet-name>AxisServlet</servlet-name>
        <url-pattern>/servlet/AxisServlet</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>AxisServlet</servlet-name>
        <url-pattern>*.jws</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>AxisServlet</servlet-name>
        <url-pattern>/services/*</url-pattern>
    </servlet-mapping>  
    <!-- END OF Axis2 case management API servlet mapping-->    

    <welcome-file-list>
        <welcome-file>Index.jsp</welcome-file>
        <welcome-file>index.html</welcome-file>
    </welcome-file-list>

    <!-- error pages -->
    <error-page>
        <error-code>404</error-code>
        <location>/WEB-INF/jsps/Error.jsp</location>
    </error-page>
    <error-page>
        <error-code>500</error-code>
        <location>/WEB-INF/jsps/Error.jsp</location>
    </error-page>
    <error-page>
        <exception-type>java.lang.Throwable</exception-type>
        <location>/WEB-INF/jsps/Error.jsp</location>
    </error-page>


    <taglib>
        <taglib-uri>http://www.xxxx.com/xxxx/xxxx/xxxx/tags-html</taglib-uri>
        <taglib-location>/WEB-INF/tlds/aa-html.tld</taglib-location>
    </taglib>
    <taglib>
        <taglib-uri>http://xxxx.xxxx/tags-tools</taglib-uri>
        <taglib-location>/WEB-INF/tlds/xxxx.tld</taglib-location>
    </taglib>
    <taglib>
        <taglib-uri>/WEB-INF/xxx.tld</taglib-uri>
        <taglib-location>/WEB-INF/tlds/xxx.tld</taglib-location>
    </taglib>
    <taglib>
        <taglib-uri>/WEB-INF/xxx</taglib-uri>
        <taglib-location>/WEB-INF/tlds/xxxx</taglib-location>
    </taglib>
    <taglib>
        <taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
        <taglib-location>/WEB-INF/tlds/struts-bean.tld</taglib-location>
    </taglib>
    <taglib>
        <taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
        <taglib-location>/WEB-INF/tlds/struts-html.tld</taglib-location>
    </taglib>
    <taglib>
        <taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
        <taglib-location>/WEB-INF/tlds/struts-logic.tld</taglib-location>
    </taglib>
    <taglib>
        <taglib-uri>/WEB-INF/xxxx</taglib-uri>
        <taglib-location>/WEB-INF/tlds/xxxx</taglib-location>
    </taglib>
    <taglib>
        <taglib-uri>/WEB-INF/struts-tiles.tld</taglib-uri>
        <taglib-location>/WEB-INF/tlds/struts-tiles.tld</taglib-location>
    </taglib>
    <taglib>
        <taglib-uri>http://jakarta.apache.org/struts/tags-bean</taglib-uri>
        <taglib-location>/WEB-INF/tlds/struts-bean.tld</taglib-location>
    </taglib>
    <taglib>
        <taglib-uri>http://jakarta.apache.org/struts/tags-html</taglib-uri>
        <taglib-location>/WEB-INF/tlds/struts-html.tld</taglib-location>
    </taglib>
    <taglib>
        <taglib-uri>http://jakarta.apache.org/struts/tags-logic</taglib-uri>
        <taglib-location>/WEB-INF/tlds/struts-logic.tld</taglib-location>
    </taglib>
    <taglib>
        <taglib-uri>http://jakarta.apache.org/struts/tags-tiles</taglib-uri>
        <taglib-location>/WEB-INF/tlds/struts-tiles.tld</taglib-location>
    </taglib>
    <taglib>
        <taglib-uri>http://jakarta.apache.org/taglibs/display</taglib-uri>
        <taglib-location>/WEB-INF/tlds/xxxx</taglib-location>
    </taglib>
    <taglib>
        <taglib-uri>http://www.rsasecurity.com/taglibs/RSAList</taglib-uri>
        <taglib-location>/WEB-INF/tlds/xxxx</taglib-location>
    </taglib>
    <taglib>
        <taglib-uri>http://displaytag.sf.net</taglib-uri>
        <taglib-location>/WEB-INF/tlds/display.tld</taglib-location>
    </taglib>
    <resource-ref>
        <description>DB Connection</description>
        <res-ref-name>jdbc/xxxxDB</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
    </resource-ref>

    <resource-ref>
        <res-ref-name>jdbc/xxxDB</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
    </resource-ref>

    <resource-ref>
        <res-ref-name>jdbc/xxxDB</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
    </resource-ref>

    <!--   ========================== Container Managed Security =======================  -->

    <!-- Uncomment this section to enable container managed authentication. You'll also need to configure security in the container.
    <security-constraint>
        <web-resource-collection>
            <web-resource-name>Protected Area</web-resource-name>
            <url-pattern>/*</url-pattern>
            <http-method>DELETE</http-method>
            <http-method>GET</http-method>
            <http-method>POST</http-method>
            <http-method>PUT</http-method>
        </web-resource-collection>
        <auth-constraint>
            <role-name>xxx</role-name>
            <role-name>xxx</role-name>
            <role-name>xxx</role-name>
            <role-name>xxx</role-name>
            <role-name>xxxx</role-name>
        </auth-constraint>
        <user-data-constraint>
            <transport-guarantee>CONFIDENTIAL</transport-guarantee>
        </user-data-constraint>
    </security-constraint>
    <login-config>
        <auth-method>BASIC</auth-method>
        <realm-name>default</realm-name>
    </login-config>
    <security-role>
        <description>Admin User</description>
        <role-name>admin</role-name>
    </security-role>
    <security-role>
        <role-name>csr</role-name>
    </security-role>
    <security-role>
        <role-name>xxx</role-name>
    </security-role>
    <security-role>
        <role-name>xxx</role-name>
    </security-role>
    <security-role>
        <role-name>xxx</role-name>
    </security-role>
    -->

    <!--   ============================= Env Entries =================================== -->

    <env-entry>
        <env-entry-name>moduleName</env-entry-name>
        <env-entry-value>xxx</env-entry-value>
        <env-entry-type>java.lang.String</env-entry-type>       
    </env-entry>

    <env-entry>
        <description>Required when accessing PM core database under DB2 using DAOFactory</description>
        <env-entry-name>db2SchemaName</env-entry-name>
        <env-entry-value>xxx</env-entry-value> 
        <env-entry-type>java.lang.String</env-entry-type> 
    </env-entry>

</web-app>

更新 Axis2.xml 文件

    <axisconfig name="AxisJava2.0">
    <parameter name="hotdeployment">true</parameter>
    <parameter name="hotupdate">false</parameter>
    <parameter name="enableMTOM">false</parameter>
    <parameter name="enableSwA">false</parameter>
    <parameter name="attachmentDIR"></parameter>
    <parameter name="sizeThreshold">4000</parameter-->
      <parameter name="ConfigContextTimeoutInterval">30000</parameter>
    <parameter name="sendStacktraceDetailsWithFaults">false</parameter>
    <parameter name="DrillDownToRootCauseForFaultReason">false</parameter>
    <parameter name="disableREST" locked="false">false</parameter>
    <parameter name="disableSOAP12" locked="true">false</parameter>
    <threadContextMigrators>
        <threadContextMigrator listId="JAXWS-ThreadContextMigrator-List"
                               class="org.apache.axis2.jaxws.addressing.migrator.EndpointContextMapMigrator"/>
    </threadContextMigrators>
      <messageReceivers>
        <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only"
                         class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver"/>
        <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out"
                         class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
        <messageReceiver mep="http://www.w3.org/2006/01/wsdl/in-only"
                         class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver"/>
        <messageReceiver mep="http://www.w3.org/2006/01/wsdl/in-out"
                         class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
        <messageReceiver mep="http://www.w3.org/ns/wsdl/in-only"
                         class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver"/>
        <messageReceiver mep="http://www.w3.org/ns/wsdl/in-out"
                         class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
    </messageReceivers>
        <messageFormatters>
        <messageFormatter contentType="application/x-www-form-urlencoded"
                          class="org.apache.axis2.transport.http.XFormURLEncodedFormatter"/>
        <messageFormatter contentType="multipart/form-data"
                          class="org.apache.axis2.transport.http.MultipartFormDataFormatter"/>
        <messageFormatter contentType="application/xml"
                          class="org.apache.axis2.transport.http.ApplicationXMLFormatter"/>
        <messageFormatter contentType="text/xml"
                          class="org.apache.axis2.transport.http.SOAPMessageFormatter"/>
        <messageFormatter contentType="application/soap+xml"
                          class="org.apache.axis2.transport.http.SOAPMessageFormatter"/>
    </messageFormatters>
     <messageBuilders>
        <messageBuilder contentType="application/xml"
                        class="org.apache.axis2.builder.ApplicationXMLBuilder"/>
        <messageBuilder contentType="application/x-www-form-urlencoded"
                        class="org.apache.axis2.builder.XFormURLEncodedBuilder"/>
        <messageBuilder contentType="multipart/form-data"
                        class="org.apache.axis2.builder.MultipartFormDataBuilder"/>
    </messageBuilders>
        <transportReceiver name="http"
                       class="org.apache.axis2.transport.http.AxisServletListener">
        <parameter name="port">8080</parameter>
              </transportReceiver>
    <transportReceiver name="https" class="org.apache.axis2.transport.http.AxisServletListener">
        <parameter name="port">8443</parameter>
    </transportReceiver>
     <transportSender name="local"
                     class="org.apache.axis2.transport.local.LocalTransportSender"/>
    <transportSender name="http"
                     class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
        <parameter name="PROTOCOL">HTTP/1.1</parameter>
        <parameter name="Transfer-Encoding">chunked</parameter>
        </transportSender>
    <transportSender name="https"
                     class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
        <parameter name="PROTOCOL">HTTP/1.1</parameter>
        <parameter name="Transfer-Encoding">chunked</parameter>
    </transportSender>
       <phaseOrder type="InFlow">
        <!--  System predefined phases       -->
        <phase name="Transport">
            <handler name="RequestURIBasedDispatcher"
                     class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher">
                <order phase="Transport"/>
            </handler>
            <handler name="SOAPActionBasedDispatcher"
                     class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher">
                <order phase="Transport"/>
            </handler>
        </phase>
        <phase name="Addressing">
            <handler name="AddressingBasedDispatcher"
                     class="org.apache.axis2.dispatchers.AddressingBasedDispatcher">
                <order phase="Addressing"/>
            </handler>
        </phase>
        <phase name="Security"/>
        <phase name="PreDispatch"/>
        <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
            <handler name="RequestURIBasedDispatcher"
                     class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher"/>
            <handler name="SOAPActionBasedDispatcher"
                     class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher"/>
            <handler name="RequestURIOperationDispatcher"
                     class="org.apache.axis2.dispatchers.RequestURIOperationDispatcher"/>
            <handler name="SOAPMessageBodyBasedDispatcher"
                     class="org.apache.axis2.dispatchers.SOAPMessageBodyBasedDispatcher"/>
            <handler name="HTTPLocationBasedDispatcher"
                     class="org.apache.axis2.dispatchers.HTTPLocationBasedDispatcher"/>
            <handler name="GenericProviderDispatcher"
                     class="org.apache.axis2.jaxws.dispatchers.GenericProviderDispatcher"/>
            <handler name="MustUnderstandValidationDispatcher"
                     class="org.apache.axis2.jaxws.dispatchers.MustUnderstandValidationDispatcher"/>
        </phase>
        <phase name="RMPhase"/>
            <phase name="OperationInPhase">
            <handler name="MustUnderstandChecker"
                     class="org.apache.axis2.jaxws.dispatchers.MustUnderstandChecker">
                <order phase="OperationInPhase"/>
            </handler>
        </phase>
        <phase name="soapmonitorPhase"/>
        <phase name="loggingPhase"/>
    </phaseOrder>
    <phaseOrder type="OutFlow">
         <phase name="soapmonitorPhase"/>
        <phase name="OperationOutPhase"/>
        <phase name="loggingPhase"/>
        <!--system predefined phase-->
        <!--these phase will run irrespective of the service-->
        <phase name="RMPhase"/>
        <phase name="PolicyDetermination"/>
        <phase name="MessageOut"/>
        <phase name="Security"/>
    </phaseOrder>
    <phaseOrder type="InFaultFlow">
        <phase name="Addressing">
            <handler name="AddressingBasedDispatcher"
                     class="org.apache.axis2.dispatchers.AddressingBasedDispatcher">
                <order phase="Addressing"/>
            </handler>
        </phase>
        <phase name="Security"/>
        <phase name="PreDispatch"/>
        <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
            <handler name="RequestURIBasedDispatcher"
                     class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher"/>
            <handler name="SOAPActionBasedDispatcher"
                     class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher"/>
            <handler name="RequestURIOperationDispatcher"
                     class="org.apache.axis2.dispatchers.RequestURIOperationDispatcher"/>
            <handler name="SOAPMessageBodyBasedDispatcher"
                     class="org.apache.axis2.dispatchers.SOAPMessageBodyBasedDispatcher"/>
            <handler name="HTTPLocationBasedDispatcher"
                     class="org.apache.axis2.dispatchers.HTTPLocationBasedDispatcher"/>
            <handler name="GenericProviderDispatcher"
                     class="org.apache.axis2.jaxws.dispatchers.GenericProviderDispatcher"/>
            <handler name="MustUnderstandValidationDispatcher"
                     class="org.apache.axis2.jaxws.dispatchers.MustUnderstandValidationDispatcher"/>
        </phase>
        <phase name="RMPhase"/>
        <phase name="OperationInFaultPhase"/>
        <phase name="soapmonitorPhase"/>
        <phase name="loggingPhase"/>
    </phaseOrder>
    <phaseOrder type="OutFaultFlow">
        <phase name="soapmonitorPhase"/>
        <phase name="OperationOutFaultPhase"/>
        <phase name="RMPhase"/>
        <phase name="PolicyDetermination"/>
        <phase name="loggingPhase"/>
        <phase name="MessageOut"/>
        <phase name="Security"/>
    </phaseOrder>
</axisconfig>

1 个答案:

答案 0 :(得分:0)

我有一个x <- tbl(db1, "Table1") %>% dplyr::left_join(tbl(db2, "Table2"), by = "JoinColumn", copy = TRUE) 无法识别我的端点的项目。正如我所见,你缺少weblogic特定的描述符。解决方案是创建一个:

  

https://docs.oracle.com/cd/E13222_01/wls/docs100/webserv_ref/dd.html

如图所示:

Weblogic

或检查:

  

http://docs.oracle.com/cd/E23943_01/web.1111/e13750/dd.htm#WSREF433

另请在SO中检查类似的问题:https://stackoverflow.com/a/23878741/4823977