How to Setup CAS to Work with MySQL Database for Username/Password User Authentication on Debian Linux

74 views
Skip to first unread message

Emmanuel Chukwu

unread,
Nov 23, 2018, 4:50:50 PM11/23/18
to CAS Community
Greetings to you all.

I am new to CAS with very little experience with Apache Maven and Gradle. I am just joining this group today.
I have been trying to setup CAS to query MySQL database for username/password authentication.
I managed to install JDK 7, Tomcat 8 and Maven. Tomact is working correctly.
I have tried with different versions of CAS to configure dependencies in pom.xml and build but I keep having different challenges.
The latest error I got trying to build from version 4.0.x is shown below:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.3:testCompile (default-testCompile) on project cas-server-webapp: Compilation failure: Compilation failure:[ERROR] error reading /home/cas/.m2/repository/org/jasig/cas/cas-server-webapp-support/4.0.8-SNAPSHOT/cas-server-webapp-support-4.0.8-SNAPSHOT.jar; error in opening zip file[ERROR] error reading /home/cas/.m2/repository/org/jasig/cas/cas-server-support-jdbc/4.0.8-SNAPSHOT/cas-server-support-jdbc-4.0.8-SNAPSHOT.jar; error in opening zip file[ERROR] error reading /home/cas/.m2/repository/org/slf4j/slf4j-api/1.7.5/slf4j-api-1.7.5.jar; error in opening zip file[ERROR] error reading /home/cas/.m2/repository/org/slf4j/slf4j-log4j12/1.7.5/slf4j-log4j12-1.7.5.jar; error in opening zip file[ERROR] error reading /home/cas/.m2/repository/org/slf4j/jcl-over-slf4j/1.7.5/jcl-over-slf4j-1.7.5.jar; error in opening zip file[ERROR] error reading /home/cas/.m2/repository/org/jasig/cas/cas-server-webapp-support/4.0.8-SNAPSHOT/cas-server-webapp-support-4.0.8-SNAPSHOT.jar; error in opening zip file[ERROR] error reading /home/cas/.m2/repository/org/jasig/cas/cas-server-support-jdbc/4.0.8-SNAPSHOT/cas-server-support-jdbc-4.0.8-SNAPSHOT.jar; error in opening zip file[ERROR] error reading /home/cas/.m2/repository/org/slf4j/slf4j-api/1.7.5/slf4j-api-1.7.5.jar; error in opening zip file[ERROR] error reading /home/cas/.m2/repository/org/slf4j/slf4j-log4j12/1.7.5/slf4j-log4j12-1.7.5.jar; error in opening zip file[ERROR] error reading /home/cas/.m2/repository/org/slf4j/jcl-over-slf4j/1.7.5/jcl-over-slf4j-1.7.5.jar; error in opening zip file[ERROR] /opt/cas/cas/cas-server-webapp/src/test/java/org/jasig/cas/WiringTests.java:[27,47] package org.springframework.web.context.support does not exist[ERROR] /opt/cas/cas/cas-server-webapp/src/test/java/org/jasig/cas/WiringTests.java:[37,13] cannot find symbol[ERROR]   symbol:   class XmlWebApplicationContext[ERROR]   location: class org.jasig.cas.WiringTests[ERROR] /opt/cas/cas/cas-server-webapp/src/test/java/org/jasig/cas/WiringTests.java:[41,34] cannot find symbol[ERROR]   symbol:   class XmlWebApplicationContext[ERROR]   location: class org.jasig.cas.WiringTests[ERROR] -> [Help 1][ERROR][ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.[ERROR] Re-run Maven using the -X switch to enable full debug logging.[ERROR][ERROR] For more information about the errors and possible solutions, please read the following articles:[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException


Please I need someone to guide me on the best way to achieve this. What is the best version of CAS to use? Which versions of JDK and Tomcat will work with it?
What are the steps to build either with Maven or Gradle?
Any help is highly  appreciated.

Thanks

Ray Bon

unread,
Nov 23, 2018, 6:55:56 PM11/23/18
to cas-...@apereo.org
Emmanuel,

Depending on your time line, you might consider CAS 6.0 which will be official before end of the year (you will need jdk 11). Otherwise use the latest 5.3 with JDK 8. (Note: 5.3 is only available as a maven build, 6.0 only as gradle.)
For db config, see https://apereo.github.io/cas/5.3.x/installation/Database-Authentication.html and search this user list, others have asked questions about db authentication - I have not used it.)

Ray

P.S. Oracle JDK 8 will be end of life early next year and they are changing the JDK update process so you may want to plan for paid for support or switch to open JDK.
-- 
Ray Bon
Programmer analyst
Development Services, University Systems
2507218831 | CLE 019 | rb...@uvic.ca

Andy Ng

unread,
Nov 24, 2018, 7:35:10 AM11/24/18
to CAS Community
Hi Ray and Emmanuel,

CAS 5.3.x not only available as a maven build, it can be built using gradle too, see: https://github.com/apereo/cas-gradle-overlay-template/tree/master.

And I would argue one might want to use gradle to build their CAS 5.3.x if you are starting now, since maven would be obsolete in CAS 6.x.

The guide in David's note is awesome, and I would also recommend this read for Database Authentication: https://apereo.github.io/2017/02/22/cas51-dbauthn-tutorial/.

Other than that, follows Ray advice and you will probably be fine.

Cheers!
- Andy




Emmanuel Chukwu

unread,
Nov 26, 2018, 4:46:15 AM11/26/18
to cas-...@apereo.org
Hi Ray and Andy.
Thanks for taking out time to reply my question. You guys are awesome! I will want to go with the option of CAS 5.3.x with OpenJDK 8 (Please what's the right package name to install on Debian?). I will consult the references and will revert back if I need further assistance.
Cheers!

--
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
---
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/3250bb92-4820-4175-92c8-6e701a4fa0f1%40apereo.org.

Ray Bon

unread,
Nov 26, 2018, 12:42:33 PM11/26/18
to cas-...@apereo.org
This should be it: https://wiki.debian.org/Java

Ray

Emmanuel Chukwu

unread,
Nov 30, 2018, 11:22:05 AM11/30/18
to cas-...@apereo.org
Hi all,
Please who knows the right package name to install Open JDK 8 on Debian. The Open JDK 8 packaged used in David's notes doesn't work with Debian (It is for RHEL). I have searched online and the suggestions I got did not work.


Virus-free. www.avg.com

Ray Bon

unread,
Nov 30, 2018, 12:14:09 PM11/30/18
to cas-...@apereo.org
Emmanuel,

First try default-jdk witch may give you version 8 depending on which debian you are using (check with java -version). If that is the wrong version you can use openjdk-8-jdk.

Ray

Emmanuel Chukwu

unread,
Nov 30, 2018, 12:29:49 PM11/30/18
to cas-...@apereo.org
Thanks Ray,
I tried the default-jdk option but it installed JDK 7 (I am using Debian 8)
When I tried:
sudo apt-get install openjdk-8-jdk
It returned the below error:
E: Package 'openjdk-8-jdk' has no installation candidate



Virus-free. www.avg.com

Reply all
Reply to author
Forward
0 new messages