zdd

            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
            2 隨筆 :: 0 文章 :: 5 評論 :: 0 Trackbacks
             我的Web Services服務已經可以了,即:http://127.0.0.1/datacenter/zddservices/GetEJFLService?wsdl 已經可以顯示。但是當我調用這個方法時就報錯:
          org.codehaus.xfire.XFireRuntimeException: Could not invoke service.. Nested exception is org.codehaus.xfire.fault.XFireFault: Fault
          org.codehaus.xfire.fault.XFireFault: Fault
              at org.codehaus.xfire.fault.XFireFault.createFault(XFireFault.java:
          89)
              at org.codehaus.xfire.client.Client.invoke(Client.java:
          267)
              at org.codehaus.xfire.client.XFireProxy.handleRequest(XFireProxy.java:
          77)
              at org.codehaus.xfire.client.XFireProxy.invoke(XFireProxy.java:
          57)
              at $Proxy0.getEJFLxml(Unknown Source)
              at com.datacenter.getxml.getejflxml(getxml.java:
          25)
              at com.datacenter.getxml.main(getxml.java:
          14)
          Caused by: java.lang.NullPointerException
              at org.codehaus.xfire.transport.http.CommonsHttpMessageSender.hasResponse(CommonsHttpMessageSender.java:
          149)
              at org.codehaus.xfire.transport.http.HttpChannel.sendViaClient(HttpChannel.java:
          175)
              at org.codehaus.xfire.transport.http.HttpChannel.send(HttpChannel.java:
          82)
              at org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageSender.java:
          26)
              at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:
          98)
              at org.codehaus.xfire.client.Client.invoke(Client.java:
          263)

          可能的原因:我的這個服務必須登錄才能訪問:http://127.0.0.1/datacenter/zddservices/GetEJFLService?wsdl.有一個驗證的過程。我對這個驗證的東西不是很懂!所以請大家幫忙看看。下面是驗證的xml
          <?xml version="1.0" encoding="ISO-8859-1"?>
          <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
              xmlns:xsi
          ="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation
          ="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
              version
          ="2.4">
              
          <display-name>Central Authentication System (CAS) 3.0</display-name>
              
          <context-param>
                  
          <param-name>contextConfigLocation</param-name>
                  
          <param-value>
                      
          /WEB-INF/spring-configuration/*.xml
                      /WEB-INF/deployerConfigContext.xml
                  </param-value>
              </context-param>

              <!-- 
                  place this into the contextConfigLocation to enable remote services
                  /WEB-INF/remoteServices.xml,
                  classpath:org/codehaus/xfire/spring/xfire.xml
                  
                  place this into the contextConfigLocation to enable the event publishing
              -->

              <!--
                  - Location of the Log4J config file, for initialization and refresh checks.
                  - Applied by Log4jConfigListener.
              -->
              <context-param>
                  <param-name>log4jConfigLocation</param-name>
                  <param-value>classpath:log4j.properties</param-value>
              </context-param>
              
              <context-param>
                  <param-name>log4jExposeWebAppRoot</param-name>
                  <param-value>false</param-value>
              </context-param>
              
              <filter>
                  <filter-name>CAS Client Info Logging Filter</filter-name>
                  <filter-class>org.inspektr.common.web.ClientInfoThreadLocalFilter</filter-class>
              </filter>
              
              <filter>
                  <filter-name>springSecurityFilterChain</filter-name>
                  <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
              </filter>

              <filter-mapping>
                <filter-name>springSecurityFilterChain</filter-name>
                <url-pattern>/services/*</url-pattern>
              </filter-mapping>

              <filter-mapping>
                  <filter-name>CAS Client Info Logging Filter</filter-name>
                  <url-pattern>/*</url-pattern>
              </filter-mapping>

              <!--
                  - Configures Log4J for this web app.
                  - As this context specifies a context-param "log4jConfigLocation", its file path
                  - is used to load the Log4J configuration, including periodic refresh checks.
                  -
                  - Would fall back to default Log4J initialization (non-refreshing) if no special
                  - context-params are given.
                  -
                  - Exports a "web app root key", i.e. a system property that specifies the root
                  - directory of this web app, for usage in log file paths.
                  - This web app specifies "cas.root" (see log4j.properties file).
              -->
              <!-- Leave the listener commented-out if using JBoss -->
              <listener>
                  <listener-class>
                      org.springframework.web.util.Log4jConfigListener
                  </listener-class>
              </listener>

              <!--
                  - Loads the CAS ApplicationContext.  
                  - The deployer choice here is how to handle Throwables thrown by Spring's 
                  - ContextLoaderListener.  The Spring ContextLoaderListener will throw an exception when the
                  - application context cannot be loaded, say because the bean XML files are not valid XML or do not
                  - refer to real classes and properties or because a bean configured via Spring throws an exception
                  - at construction, property setting, or on an afterPropertiesSet() lifecycle method.
                  -
                  - If you'd like these errors to be fatal and prevent the CAS servlet context from loading at all,
                  - use org.springframework.web.context.ContextLoaderListener.
                  -
                  - If you'd like these errors to result in all requests for CAS getting a "CAS is Unavailable" response, 
                  - use org.jasig.cas.web.init.SafeContextLoaderListener
              -->
              <listener>
                  <listener-class>
                      org.jasig.cas.web.init.SafeContextLoaderListener
                  </listener-class>
              </listener>

              <!--
                  - This is the Spring dispatcher servlet which delegates all requests to the 
                  - Spring WebMVC controllers as configured in cas-servlet.xml.
                  -   
                  - The choice made above about how to handle a broken ApplicationContext at 
                  - context initialization applies here as well, sicne this servlet is load-on-startup.
                  -
                  - If you'd like these errors to be fatal and prevent the CAS servlet from loading at all,
                  - use org.springframework.web.servlet.DispatcherServlet.
                  -
                  - If you'd like these errors to result in all requests for CAS getting a "CAS is Unavailable" response, 
                  - use org.jasig.cas.web.init.SafeDispatcherServlet
              -->
              <servlet>
                  <servlet-name>cas</servlet-name>
                  <servlet-class>
                      org.jasig.cas.web.init.SafeDispatcherServlet
                  </servlet-class>
                  <init-param>
                      <param-name>publishContext</param-name>
                      <param-value>false</param-value>
                  </init-param>
                  <load-on-startup>1</load-on-startup>
              </servlet>
              
              <servlet-mapping>
                  <servlet-name>cas</servlet-name>
                  <url-pattern>/login</url-pattern>
              </servlet-mapping>

              <servlet-mapping>
                  <servlet-name>cas</servlet-name>
                  <url-pattern>/logout</url-pattern>
              </servlet-mapping>

              <servlet-mapping>
                  <servlet-name>cas</servlet-name>
                  <url-pattern>/validate</url-pattern>
              </servlet-mapping>

              <servlet-mapping>
                  <servlet-name>cas</servlet-name>
                  <url-pattern>/serviceValidate</url-pattern>
              </servlet-mapping>
              
              <servlet-mapping>
                  <servlet-name>cas</servlet-name>
                  <url-pattern>/samlValidate</url-pattern>
              </servlet-mapping>

              <servlet-mapping>
                  <servlet-name>cas</servlet-name>
                  <url-pattern>/proxy</url-pattern>
              </servlet-mapping>

              <servlet-mapping>
                  <servlet-name>cas</servlet-name>
                  <url-pattern>/proxyValidate</url-pattern>
              </servlet-mapping>

              <servlet-mapping>
                  <servlet-name>cas</servlet-name>
                  <url-pattern>/CentralAuthenticationService</url-pattern>
              </servlet-mapping>
              
              <servlet-mapping>
                  <servlet-name>cas</servlet-name>
                  <url-pattern>/services/add.html</url-pattern>
              </servlet-mapping>
              
              <servlet-mapping>
                  <servlet-name>cas</servlet-name>
                  <url-pattern>/services/logout.html</url-pattern>
              </servlet-mapping>
              
              <servlet-mapping>
                  <servlet-name>cas</servlet-name>
                  <url-pattern>/services/loggedOut.html</url-pattern>
              </servlet-mapping>
              
              <servlet-mapping>
                  <servlet-name>cas</servlet-name>
                  <url-pattern>/services/manage.html</url-pattern>
              </servlet-mapping>
              
              <servlet-mapping>
                  <servlet-name>cas</servlet-name>
                  <url-pattern>/services/edit.html</url-pattern>
              </servlet-mapping>

              <servlet-mapping>
                  <servlet-name>cas</servlet-name>
                  <url-pattern>/openid/*</url-pattern>
              </servlet-mapping>

              <servlet-mapping>
                  <servlet-name>cas</servlet-name>
                  <url-pattern>/services/viewCurrentStatistics.html</url-pattern>
              </servlet-mapping>
              
              <servlet-mapping>
                  <servlet-name>cas</servlet-name>
                  <url-pattern>/services/viewStatistics.html</url-pattern>
              </servlet-mapping>
              
              <servlet-mapping>
                  <servlet-name>cas</servlet-name>
                  <url-pattern>/services/viewLogRequests.html</url-pattern>
              </servlet-mapping>
              
              <servlet-mapping>
                  <servlet-name>cas</servlet-name>
                  <url-pattern>/services/deleteRegisteredService.html</url-pattern>
              </servlet-mapping>

              <session-config>
                  <!-- Default to 5 minute session timeouts -->
                  <session-timeout>5</session-timeout>
              </session-config>

              <error-page>
                  <exception-type>org.springframework.context.ApplicationContextException</exception-type>
                  <location>/WEB-INF/view/jsp/brokenContext.jsp</location>
              </error-page>
          <!--
              <error-page>
                  <exception-type>java.lang.Exception</exception-type>
                  <location>/WEB-INF/view/jsp/errors.jsp</location>
              </error-page>
          -->
              <error-page>
                  <error-code>404</error-code>
                  <location>/</location>
              </error-page>
              
              <welcome-file-list>
                    <welcome-file>index.jsp</welcome-file>
                </welcome-file-list> 
          </web-app>
          posted on 2009-12-28 17:53 肖東 閱讀(1051) 評論(1)  編輯  收藏

          評論

          # re: Web Services 求助!!! 2009-12-29 10:09 肖東
          看來遇到問題還是要從根源入手啊!上面的問題解決了!告訴大家解決的辦法,希望有所幫助:
          1、無論如何,請求一定會經過Servlet的,而我的框架是spring+struts的。spring配置文件中有一個是關于CAS驗證的。其中的一段配置如下:
          <security:http entry-point-ref="casProcessingFilterEntryPoint">
          <security:intercept-url pattern="/**" access="ROLE_USER" />
          <security:logout invalidate-session="true" logout-success-url="/cas-logout.jsp"/>
          </security:http>
          大家注意這個屬性 pattern="/**" 它的配置的意思就是所有的請求都要經過CAS驗證。而我把這個屬性隨便的修改一下,讓所有的請求都不經過驗證,問題就解決了!
          說明:其實最好的解決辦法是讓Web Services的請求也經過CAS驗證,但是如何配置還沒有解決。以后解決會告訴大家  回復  更多評論
            


          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 西城区| 五原县| 肥乡县| 肥东县| 柘城县| 保靖县| 东港市| 沐川县| 墨玉县| 孟连| 乡宁县| 乌拉特前旗| 湾仔区| 巴彦县| 麦盖提县| 白水县| 两当县| 万源市| 广饶县| 英超| 苍溪县| 涟水县| 皮山县| 靖宇县| 麻江县| 嫩江县| 水城县| 瓦房店市| 祥云县| 抚远县| 新乡县| 文安县| 宝山区| 比如县| 嘉荫县| 建阳市| 信宜市| 泸溪县| 平顶山市| 石棉县| 乐业县|