Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6377673
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:54:18+00:00 2026-05-25T01:54:18+00:00

I’m trying to set up Terracotta (Web Sessions + ehcache + hibernate) with Railo

  • 0

I’m trying to set up Terracotta (Web Sessions + ehcache + hibernate) with Railo (Open Source ColdFusion Engine – http://www.getrailo.org). I’m able to start the Terracotta server, to connect the application server to the Terracotta server, and to run the application normally with all three elements (sessions, ehcache, and hibernate) fully functional.

The problem is if I shutdown the application server, and I restart it, it will connect properly to the Terracotta server, but it’ll start to throw various classNotFoundExceptions, either on the session object, or on the ehcache objects.

I’ve attached various java stacktrace for your information. Any idea why this is happening only after the application server is restarted and how do I fix it?

Kind regards,

Philip

–

Java stack trace:

railo.runtime.type.scope.JSession

railo.runtime.type.StructImpl

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T01:54:18+00:00Added an answer on May 25, 2026 at 1:54 am

    OK, I think I found a workaround to all those problems. Hopefully, it might help someone else.

    First you need to upgrade your ehCache and add the terracotta jars to your classpath to be able to work with terracotta. This means you’ll need to remove the ehcache.jar bundled with Railo, as this is an old version that doesn’t work with terracotta. The jars are:

    • ehcache-core-##.##.##.jar (##.##.## is the version)
    • ehcache-terracotta-##.##.##.jar
    • slf4j-api-##.##.##.jar
    • slf4j-jdk14-##.##.##.jar
    • slf4j-log4j12-##.##.##.jar
    • terracotta-toolkit-1.3-runtime-##.##.##.jar
    • REMOVE the “ehcache.jar” from the Railo lib library, otherwise Terracotta will not load.

    Next you need to add the <terracottaConfig url=”localhost:9510″ /> and <terracotta clustered=”true” /> lines to your ehcache.xml, which needs to be in your class path. This is well documented on the Terracotta website.

    ehCache takes the ContextClassLoader() to load all classes, it it fails, it fallbacks on ClassLoaderUtil. Railo contextClassLoader() is set by default to “org.apache.catalina.loader.WebappClassLoader” (Tomcat ClassLoader). This class loader wasn’t able to find the railo objects properly, so you need to change it to “railo.loader.classloader.RailoClassLoader”. Since this is a per thread (i.e. per request) context class loader, you need to call the following command at the start of your onRequestStart() method:

    <cfset getPageContext().getThread().currentThread().setContextClassLoader( getPageContext().getClass().getClassLoader() ) />
    

    This should fix ehcache and hibernate. Next sessions, using the tomcat valve with Terracotta seems to be a problem, because the valve seems to be called before Railo handles the request. Therefore the “org.apache.catalina.loader.WebappClassLoader” is used and a class not found exception is thrown. A workaround for this is to store the session itself in ehcache and Terracotta with distribute it across the cluster. The problem is that objects stored in Terracotta need to be serializable, and the J2EE session is based on “org.apache.catalina.connector.SessionFacade”, which is not serializable. Therefore, to work around that limitation, I just converted the J2EE session to a simple struct, which is serializable, by using the structCopy(session) command, and put the resulting struct in ehcache.

    That should be able to get you going with Terracotta and Railo.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to render a haml file in a javascript response like so:
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.