Building CAS

Matthew Jones matthew.jones at interactivedata.com
Thu Oct 9 11:20:43 EDT 2008


Hi Thai,

I have skipped the Eclipse part and am trying just to build from the 
command line. I have edited the pom.xml and deployerContextConfig.xml 
files appropriately for the CAS I wish to deploy (that I have running 
having patched the deployed .war file that I downloaded). I am using 
OpenLDAP I'm using the "ordinary" LDAP binder rather than the fast one.

After running mvn package in the appropriate directory I get a cas.war 
file in the target sub-directory and I then try to deploy that. When 
this is deployed, it does indeed appear to have added the Spring LDAP 
.jar files that I previously added manually but the .war file doesn't 
deploy successfully.

Anyway, the "highlights" of catalina.out are as follows and I really 
don't understand the one about cas.log. It is there and is owned by 
Tomcat. This is the same Tomcat instance that I have the downloaded war 
file deployed on and edited. Indeed, I can still start this CAS server 
and it still appears to function correctly (it is under 
/cas-server-webapp-3.3 in the Tomcat manager rather than my built one 
which is under /cas)

log4j:ERROR setFile(null,true) call failed.
java.io.FileNotFoundException: cas.log (Permission denied)
log4j:ERROR setFile(null,true) call failed.
java.io.FileNotFoundException: cas.log (Permission denied)

2008-10-06 17:35:00,692 ERROR 
[org.springframework.web.context.ContextLoader] - <Context 
initialization failed>
java.lang.NoClassDefFoundError: org/springframework/core/SmartClassLoader
     at java.lang.ClassLoader.defineClass1(Native Method)
     at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
     at 
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
2008-10-06 17:35:00,701 FATAL 
[org.jasig.cas.web.init.SafeContextLoaderListener] - 
<SafeContextLoaderListener:
The Spring ContextLoaderListener we wrap threw on contextInitialized.
But for our having caught this error, the web application context would 
not have initialized.>
java.lang.NoClassDefFoundError: org/springframework/core/SmartClassLoader

SafeContextLoaderListener:
The Spring ContextLoaderListener we wrap threw on contextInitialized.
But for our having caught this error, the web application context would 
not have initialized.
java.lang.NoClassDefFoundError: org/springframework/core/SmartClassLoader

2008-10-06 17:35:00,709 ERROR 
[org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/cas]] - 
<SafeContextLoaderListener:
The Spring ContextLoaderListener we wrap threw on contextInitialized.
But for our having caught this error, the web application context would 
not have initialized.>
java.lang.NoClassDefFoundError: org/springframework/core/SmartClassLoader

2008-10-06 17:35:00,742 ERROR 
[org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/cas]] - 
<Exception starting filter springSecurityFilterChain>
java.lang.NoClassDefFoundError: 
org/springframework/beans/PropertyAccessorFactory
     at 
org.springframework.web.filter.GenericFilterBean.init(GenericFilterBean.java:165)
2008-10-06 17:35:00,755 ERROR 
[org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/cas]] - 
<Exception starting filter CAS Client Info Logging Filter>
java.lang.NoClassDefFoundError: 
org/springframework/beans/PropertyAccessorFactory
     at 
org.springframework.web.filter.GenericFilterBean.init(GenericFilterBean.java:165)
Oct 6, 2008 5:35:00 PM org.apache.catalina.core.StandardContext start
SEVERE: Error filterStart
Oct 6, 2008 5:35:00 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/cas] startup failed due to previous errors
Oct 6, 2008 5:35:00 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive cas-server-webapp-3.3.war
2008-10-06 17:35:08,938 INFO 
[org.jasig.cas.web.flow.AuthenticationViaFormAction] - <FormObjectClass 
not set.  Using default class of 
org.jasig.cas.authentication.principal.UsernamePasswordCredentials with 
formObjectName credentials and validator 
org.jasig.cas.validation.UsernamePasswordCredentialsValidator.>

All of which makes me think I have missed something fundemental in my 
configuration somewhere. I am trying to build the war file on Ubuntu 
8.04 AMD64 with the following:
# mvn --version
Maven version: 2.0.8
Java version: 1.6.0_06
OS name: "linux" version: "2.6.24-19-generic" arch: "amd64" Family: "unix"

The last part of the output from the mvn package command run the 
cas-server-webapp is as follows:

[INFO] BUILD SUCCESSFUL
[INFO] 
------------------------------------------------------------------------
[INFO] Total time: 14 seconds
[INFO] Finished at: Thu Oct 09 15:13:22 BST 2008
[INFO] Final Memory: 21M/52M
[INFO] 
------------------------------------------------------------------------

which implies it worked. I have assumed that I don't actually need any 
of the Eclipse part for this to work.

> Maven2 and CAS-3.3 are all you need.
> Here is what I did:
> 
> o I used Eclispe but after installing the Maven plug-in, eclipse
> treats all my projects as Maven projects and if it could not find
> pom.xml in a project, it complains about it. So I removed the plug-in
> and use Eclispe as a editor. I know the purpose of the plug-in is to
> eliminate the manual process as I will described below and more. But
> for now I will not use it until I have more time to figure it out.
> Hopefully, someone can have some input on this.
> 
> o When you untar the CAS-3.3 you will find the directory
> cas-server-webapp, use that directory to create a Java project in
> Eclipse.
> NOTE: If you have mvn in your PATH, you can go to the
> cas-server-webapp and run the command: mvn package
> First time you run, Maven will download some files (you need internet
> connection)
> It should success building and create cas-server-webapp/target/cas.war file.
> This should be the same as CAS-3.3/modules/cas-server-webapp-3.3.war
> file that include in the download
> 
> To modify CAS to support authenticate against LDAP:
> All files mention below are relative to the cas-server-webapp directory
> o Modify pom.xml file and add:
> ----------------------------------------------
> <dependency>
> 			<groupId>org.jasig.cas</groupId>
> 			<artifactId>cas-server-support-ldap</artifactId>
> 			<version>${project.version}</version>
> </dependency>
> ---------------------------------------------
> in between the <dependencies>
> 
> o Modify src/main/webapp/WEB-INF/deployerConfigContext.xml and replace:
>   org.jasig.cas.authentication.handler.support.SimpleTestUsernamePasswordAuthenticationHandler
> with
>   org.jasig.cas.adaptors.ldap.FastBindLdapAuthenticationHandler
> 
> and add:
> ------------------------------------------------
> <bean id="contextSource"
> class="org.jasig.cas.adaptors.ldap.util.AuthenticatedLdapContextSource">
> 		<property name="pool" value="true" />
> 		<property name="urls">
> 			<list>
> 				<value>ldap://your-ldap-server:389</value>
> 			</list>
> 		</property>
> 		<property name="baseEnvironmentProperties">
> 			<map>
> 				<entry>
> 					<key>
> 						<value>java.naming.security.authentication</value>
> 					</key>
> 					<value>simple</value></entry></map></property>
> 		<property name="userName">
> 			<value>your-cn-of-the-access-or-anonymous</value></property>
> 		<property name="password">
> 			<value>depend-on-anonymous-access</value>
> 		</property>
> 	</bean>
> ----------------------------------------------------------
> in between the <beans>
> 
> o Now if you go back the prompt and run: mvn package again, maven will
> download the spring ldap jar files for you and include in the newly
> build cas.war
> 
> Hope that help! (please update if you found any trouble)
> 
> Thai Nguyen
> 
> On Tue, Oct 7, 2008 at 4:29 AM, Matthew Jones
> <matthew.jones at interactivedata.com> wrote:
>> Up until now all I have been doing is deploying CAS from the downloaded .war
>> file and adding the Spring LDAP jars manually. I now want to move to being
>> able to build a custom .war file that contains the required LDAP jars and
>> then move on to writing a custom authentication handler for our combined
>> X509 certificates and username /pasword.
>>
>> I have installed maven2 and already have the CAS 3.3 download as that's what
>> I have deployed to our test system. Is that sufficient for what I want to
>> do? Is there any basic guide for novices starting along this line?
>>
>> I do have eclipse installed although I haven't used it for anything related
>> to CAS although I have seen using Eclipse mentioned. Is this the recommended
>> approach? I'm after the simplest approach to set this up so I'm happy to
>> follow any reasonable approach especially as this isn't in my normal working
>> set currently.
>>
>> All help and advice gratefully received.
>>
>> Thanks

-- 
Matthew Jones
Interactive Data Managed Solutions Ltd
-----------------------------------------------------------------------
Registered in England Company Number 3691868
Registered Office: Fitzroy House, 13-17 Epworth Street, London, EC2A 4DL
Tel: +44 (0)1242 694133 | Fax: +44 (0)1242 694109
matthew.jones at interactivedata.com
http://www.interactivedata-ms.com/694133

This message (including any files transmitted with it) may contain 
confidential and/or proprietary information, is the property of 
Interactive Data Corporation and/or its subsidiaries, and is directed 
only to the addressee(s). If you are not the designated recipient or 
have reason to believe you received this message in error, please delete 
this message from your system and notify the sender immediately. An 
unintended recipient's disclosure, copying, distribution, or use of this 
message or any attachments is prohibited and may be unlawful.
Interactive Data (Europe) Ltd Registered No. 949387 England Registered 
Office: Fitzroy House 13-17 Epworth Street. London. EC2A 4DL

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 2690 bytes
Desc: S/MIME Cryptographic Signature
Url : http://tp.its.yale.edu/pipermail/cas/attachments/20081009/8f24ee67/attachment.bin 


More information about the cas mailing list