how to debug cas-overlay project in eclipse?

1,189 views
Skip to first unread message
Assigned to ibab...@univeris.com by me

Dong Wenting

unread,
Nov 9, 2016, 1:28:30 AM11/9/16
to CAS Community

Misagh Moayyed

unread,
Nov 9, 2016, 10:10:31 AM11/9/16
to cas-...@apereo.org

You add the dependencies you need to the project. You also need, I suspect, some sort of decompiler like JAD so you can step through the binary code and you probably also do need to set up remote debugging so when you deploy you can connect the IDE and step into the code.

 

--Misagh

--
- CAS gitter chatroom: https://gitter.im/apereo/cas
- CAS mailing list guidelines: https://apereo.github.io/cas/Mailing-Lists.html
- CAS documentation website: https://apereo.github.io/cas
- CAS project website: https://github.com/apereo/cas
---
You received this message because you are subscribed to the Google Groups "CAS Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+u...@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/56f3bde1-0009-4a9e-beb1-79f5106f79da%40apereo.org.

john c

unread,
Nov 10, 2016, 10:52:11 AM11/10/16
to jasig-cas-user, cas-...@apereo.org, 0525...@bjtu.edu.cn
add some cas dependency to your project,e.g.

<dependency>
    <groupId>org.apereo.cas</groupId>
    <artifactId>cas-server-support-yubikey</artifactId>
    <version>${cas.version}</version>
</dependency>
this will import those cas core library to project,and you will see them in "Java Resources/Libraries/Maven Dependencies"

then, you can set debug point ,e.g. org.jasig.cas.authentication.PolicyBasedAuthenticationManager.PolicyBasedAuthenticationManager.authenticateInternal 


在 2016年11月9日星期三 UTC+8下午2:28:32,Dong Wenting写道:

Dong Wenting

unread,
Nov 18, 2016, 7:54:17 AM11/18/16
to jasig-cas-user, cas-...@apereo.org, 0525...@bjtu.edu.cn
I try your answer. but it has some problem.
First,cas-server-support-yubikey only has 5.0.0+ version, so I change cas.version to  5.0.0. look at this https://mvnrepository.com/artifact/org.apereo.cas/cas-server-support-yubikey


<dependency>
    <groupId>org.apereo.cas</groupId>
    <artifactId>cas-server-support-yubikey</artifactId>
    <version>5.0.0</version>
</dependency>

Second, after that I run the project in tomcat but it failed. The console is

Dong Wenting

unread,
Nov 18, 2016, 7:54:18 AM11/18/16
to jasig-cas-user, cas-...@apereo.org, 0525...@bjtu.edu.cn
Thank you. I finally figure out a solution, which may help others to setup up server quickly. But I think apereo still needs a better document to describe how to getting start. ^ ^

First, import cas-overlay-template project into Eclipse:

        Eclipse->File->Import->Existing Maven Projects->Select cas-overlay-template project.
       
       change src/main/webapp/WEB-INF/spring-configuration/propertyFileConfigurer.xml to meet your need, I debug it on windows, so I change it like this:
  
        <util:properties id="casProperties" location="file:D:\\git\\cas-overlay-template\\etc\\cas.properties" />
     
       Right click project->Debug as ->Debug on Server-> choose Tomcat 8.0->add cas-overlay->Finish, make sure it works, visit http://localhost:8080/cas/login with casuser/Mellon.

Second, add the follow to pom.xml , which add all dependencies to your Maven Dependencies:

       <dependencies>

        <dependency>
            <groupId>org.apereo.cas</groupId>
            <artifactId>cas-server-support-yubikey</artifactId>
            <version>5.0.0</version>
        </dependency>
       
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <version>1.4.1.RELEASE</version>
            <scope>provided</scope>
        </dependency>
       
        <dependency>
            <groupId>org.jasig.cas</groupId>
            <artifactId>cas-server-webapp</artifactId>
            <version>${cas.version}</version>
            <type>war</type>
            <scope>runtime</scope>
        </dependency>
    </dependencies>

    important ! delete Servers, and setup it again like former. 
    Debug As->Debug on Server->choose tomcat 8.0->add cas-overlay->Finish.
    add a breakpoint on DispatcherServlet.doDispatch(), it works~


On Thursday, November 10, 2016 at 5:18:34 PM UTC+8, john c wrote:
Reply all
Reply to author
Forward
0 new messages