Values in cas.properties not taking effect

71 views
Skip to first unread message

SCHILENS, JEREMIAH

unread,
Feb 16, 2018, 3:25:41 PM2/16/18
to cas-...@apereo.org

Hello,

 

I seem to be having some trouble with changes I make in cas.properties taking effect when I build the overlay. I’m trying to setup an ehcache and when I specify:

cas.ticket.registry.ehcache.configLocation:             file:/etc/cas/config/ehcache-replicated.xml

 

I see this in the catalina.out of tomcat:

2018-02-16 14:42:40,922 WARN [net.sf.ehcache.config.ConfigurationFactory] - <No configuration found. Configuring ehcache from ehcache-failsafe.xml  found in the classpath: jar:file:…./webapps/cas/WEB-INF/lib/ehcache-2.10.4.jar!/ehcache-failsafe.xml>

 

I can confirm that /etc/cas/config/ehcache-replicated.xml exists, has the content I want, and is owned and readable by the user running tomcat.

 

I had a similar problem with the log4j2.xml in the cas-management app and worked around it by putting the log4j2.xml file in src/main/webapp/WEB-INF/classes. I’ve tried the same here but it doesn’t work. What am I not doing correctly with the overlay?

 

Thank you,

 

Jeremiah

Ray Bon

unread,
Feb 16, 2018, 4:15:27 PM2/16/18
to cas-...@apereo.org
Jeremiah,

You could put the settings in cas.properties as per https://apereo.github.io/cas/5.2.x/installation/Ehcache-Ticket-Registry.html

Ray
-- 
Ray Bon
Programmer analyst
Development Services, University Systems
2507218831 | CLE 019 | rb...@uvic.ca

SCHILENS, JEREMIAH

unread,
Feb 20, 2018, 11:33:18 AM2/20/18
to cas-...@apereo.org

Ray,

 

This is what I have in my cas.properties now for ehcache. I couldn’t figure out where classpath actually referenced so I tried the absolute file path.

 

cas.ticket.registry.ehcache.replicateUpdatesViaCopy=true

cas.ticket.registry.ehcache.cacheManagerName=ticketRegistryCacheManager

cas.ticket.registry.ehcache.replicatePuts=true

cas.ticket.registry.ehcache.replicateUpdates=true

cas.ticket.registry.ehcache.memoryStoreEvictionPolicy=LRU

cas.ticket.registry.ehcache.configLocation=file:/etc/cas/config/ehcache-replicated.xml

cas.ticket.registry.ehcache.maximumBatchSize=100

cas.ticket.registry.ehcache.shared=false

 

and in /etc/cas/config/ehcache-replicated.xml

 

<ehcache name="ehCacheTicketRegistryCache"

    updateCheck="false"

    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

    xsi:noNamespaceSchemaLocation="http://ehcache.org/ehcache.xsd">

 

        <diskStore path="java.io.tmpdir/cas"/>

 

        <!-- Automatic Peer Discovery -->

                     <cacheManagerPeerProviderFactory

        class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"

        properties="peerDiscovery=automatic, multicastGroupAddress=230.0.0.1, multicastGroupPort=4446, timeToLive=32"

        propertySeparator="," />

 

        <cacheManagerPeerListenerFactory

      class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"

       properties="peerDiscovery=automatic, multicastGroupAddress=230.0.0.1, multicastGroupPort=4446, timeToLive=32"

       propertySeparator="," />

</ehcache>

 

Thanks,

 

Jeremiah

--
- 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/1518815719.1763.37.camel%40uvic.ca.

Ray Bon

unread,
Feb 20, 2018, 12:57:52 PM2/20/18
to cas-...@apereo.org
Jeremiah,

You could try putting ehcache-replicated.xml in src/main/resources. It will end up in the the classpath. If the classpath is the default search location, you can remove the property cas.ticket.registry.ehcache.configLocation or set it to 'classpath:/ehcache-replicated.xml'.
If you want to keep it in /etc/cas/..., try adding a couple extra '/', 'file:///etc/cas/...'

Ray

SCHILENS, JEREMIAH

unread,
Feb 20, 2018, 2:54:55 PM2/20/18
to cas-...@apereo.org

Ray,

 

Thanks for that suggestion. I tried

cas.ticket.registry.ehcache.configLocation=classpath:/ehcache-replicated.xml

With the file at

src/main/resources/ehcache-replicated.xml

I can see it ends up in the deployed war

cas/WEB-INF/classes/ehcache-replicated.xml

But it wasn’t being processed by tomcat

2018-02-20 14:10:24,589 WARN [net.sf.ehcache.config.ConfigurationFactory] - <No configuration found. Configuring ehcache from ehcache-failsafe.xml  found in the classpath: file:yyyyy/webapps/cas/WEB-INF/classes/ehcache-failsafe.xml>

 

I was following a generic ehcache guide and ended up naming the file ehcache.xml and without changing the configLocation varible to match, the file was loaded.

It feels like changing cas.properties has zero effect on some things. Bottom line though, it works now.

Reply all
Reply to author
Forward
0 new messages