Eclipse調試cas server 3.5.2.1

因爲在配置CAS+LDAP老是報錯,決定Eclipse調試cas server,跟蹤問題出在哪裏?java

=============================================================
WHO: [username: aaaa]
WHAT: 'principal' cannot be null.
Check the correctness of @Audit annotation at the following audit point: execution(public abstract org.jasig.cas.authentication.Authentication org.jasig.cas.authentication.AuthenticationManager.authenticate(org.jasig.cas.authentication.principal.Credentials))
ACTION: TICKET_GRANTING_TICKET_NOT_CREATED
APPLICATION: CAS
WHEN: Thu May 29 17:04:41 CST 2014
CLIENT IP ADDRESS: 127.0.0.1
SERVER IP ADDRESS: 127.0.0.1
=============================================================


這裏以cas-server-3.5.2.1-release.zip說明如何配置調試環境:
1. 下載cas-server-3.5.2.1-release.zip,這裏麪包含了源碼和打包後的文件。
2. 解壓縮cas-server-3.5.2.1-release.zip,在modules子目錄裏面找到cas-server-webapp-3.5.2.1.war。
3. 解壓縮cas-server-webapp-3.5.2.1.war到eclipse的workspace目錄,這樣可讓cas-server-webapp-3.5.2.1方便成爲eclipse的一個項目。
4. 在cas-server-webapp-3.5.2.1下新建WebContent子目錄。WebContent是eclipse web項目的網站根目錄。
5. 將原來cas-server-webapp-3.5.2.1目錄下的全部內容都移動到WebContent。
6. 刪除WebContent/WEB-INF/classes目錄下的org目錄。這個目錄對應的是cas-server-webapp的源碼。
7. 將cas-server-3.5.2.1-releas/cas-server-core/src/main/java目錄下的源碼複製到cas-server-webapp-3.5.2.1/cas-server-core。只須要java目錄就能夠,其它都不要。
8. 重複第7步,將cas-server-webapp和cas-server-support-ldap目錄下的源碼都複製過來。最後的目錄結構以下圖:

9. 編譯cas-server-support-ldap時須要用到spring-ldap-core和spring-ldap-core-tiger,注意要1.3.2的版本,不要用最新的2.0.2的版本。這兩個文件不容易找到,能夠用maven去自動下載。web

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.mycompany.app</groupId>
  <artifactId>my-app</artifactId>
  <packaging>jar</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>my-app</name>
  <url>http://maven.apache.org</url>
  <dependencies>
    <dependency>
        <groupId>org.springframework.ldap</groupId>
        <artifactId>spring-ldap-core</artifactId>
        <version>1.3.2.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.ldap</groupId>
        <artifactId>spring-ldap-core-tiger</artifactId>
        <version>1.3.2.RELEASE</version>
    </dependency>
  </dependencies>
</project>

10. 建立Dyanmic Web Project,注意源碼目錄的定義,不是默認的src。


spring

11. 配置完畢,能夠調試了。


apache

相關文章
相關標籤/搜索