Railo 4 Session Dump Error

275 views
Skip to first unread message

Grant Copley

unread,
Jul 6, 2012, 2:48:47 PM7/6/12
to ra...@googlegroups.com
I just downloaded the Railo 4 Beta to look at all the cool new features. Great work guys!

For some reason, I'm unable to do a cfdump or writeDump() on the session scope. I keep getting:

java.lang.StackOverflowError 
   at railo.runtime.type.scope.storage.StorageScopeImpl.keys(StorageScopeImpl.java:287):287 
   at railo.runtime.type.util.CollectionUtil.keys(CollectionUtil.java:67):67 
   at railo.runtime.type.scope.storage.StorageScopeImpl.keys(StorageScopeImpl.java:287):287 
   at railo.runtime.type.util.CollectionUtil.keys(CollectionUtil.java:67):67 
   at railo.runtime.type.scope.storage.StorageScopeImpl.keys(StorageScopeImpl.java:287):287 
   at railo.runtime.type.util.CollectionUtil.keys(CollectionUtil.java:67):67 
   at railo.runtime.type.scope.storage.StorageScopeImpl.keys(StorageScopeImpl.java:287):287 
   at railo.runtime.type.util.CollectionUtil.keys(CollectionUtil.java:67):67 
   at railo.runtime.type.scope.storage.StorageScopeImpl.keys(StorageScopeImpl.java:287):287 
   at railo.runtime.type.util.CollectionUtil.keys(CollectionUtil.java:67):67 
   at railo.runtime.type.scope.storage.StorageScopeImpl.keys(StorageScopeImpl.java:287):287 
   at railo.runtime.type.util.CollectionUtil.keys(CollectionUtil.java:67):67 
   at railo.runtime.type.scope.storage.StorageScopeImpl.keys(StorageScopeImpl.java:287):287 
   at railo.runtime.type.util.CollectionUtil.keys(CollectionUtil.java:67):67 
   at railo.runtime.type.scope.storage.StorageScopeImpl.keys(StorageScopeImpl.java:287):287 
   at railo.runtime.type.util.CollectionUtil.keys(CollectionUtil.java:67):67 
   at railo.runtime.type.scope.storage.StorageScopeImpl.keys(Sto 

Any thoughts? All the other scopes I can dump fine. 

I'm running Railo Express 4.0.0.013 on Windows 7 64-bit.

Thanks.

Alan Holden

unread,
Jul 6, 2012, 3:31:49 PM7/6/12
to ra...@googlegroups.com
My first thought is - that your session scope must be huge.
But that just seems too easy.
Al

Grant Copley

unread,
Jul 6, 2012, 3:34:54 PM7/6/12
to ra...@googlegroups.com
@Alan - The error message would suggest that, but that seems impossible. My application simply has two files: an Application.cfc with no methods, and an index.cfm page where I'm playing around with the functions on my local machine. I haven't stored anything in the session scope yet, and I've created probably 10 session maximum. 

Alan Holden

unread,
Jul 6, 2012, 4:05:51 PM7/6/12
to ra...@googlegroups.com
Yeah, I thought that was too simple ;-]

Can you do this without an error (like in a cfset or cfscript)?
createObject("java", "coldfusion.runtime.SessionTracker")



Grant Copley

unread,
Jul 6, 2012, 4:18:45 PM7/6/12
to ra...@googlegroups.com
Yes, I'm able to run the createObject statement without errors. I am also able to perform a dump on this.

Andrew Penhorwood

unread,
Jul 6, 2012, 4:18:51 PM7/6/12
to ra...@googlegroups.com
I think you will need to store something in the session which will cause Railo to create the session.  If memory serves me the scope does not exist until if is first used.

Andy

Scott Busche

unread,
Jul 6, 2012, 4:25:25 PM7/6/12
to ra...@googlegroups.com
If it doesn't exist, wouldn't that be a null pointer exception instead of a stack overflow?

Grant Copley

unread,
Jul 6, 2012, 4:36:35 PM7/6/12
to ra...@googlegroups.com
Andy,

Unfortunately this isn't the case. First, Railo should automatically create and store the variables session.cfid, session.cftoken, or session.sessionId when the onSessionStart event occurs. This depends on the Railo settings in the administrator, but regardless, there should be something in the session scope without me manually doing anything.

Just to check, I tried adding something to the session scope and I'm still getting the same error.

I'm starting to think this might be a bug. Anyone else experiencing this issue?

Grant Copley

unread,
Jul 6, 2012, 4:40:11 PM7/6/12
to ra...@googlegroups.com
Ok guys, this is odd. If I go into the Railo Administrator and I change my Session type from CFML to J2EE, I'm able to dump the session variables fine. If I switch it back to CFML, I get the error again.

Alan Holden

unread,
Jul 6, 2012, 4:44:45 PM7/6/12
to ra...@googlegroups.com
I agree with your theory, although I can't say whether or not the bug is new to Railo 4 or just your own environment.
Seems like your system has developed some nasty loop or racing issue with regard to sessions.
As a matter or trivia, is your J2EE container using Java sessions as well?
Your Application.cfc is empty? Have you tried removing it?

I should also note that - while I'm CFML proficient, I'm only 8 months or so into Railo. Plus I'm quite often an idiot.

Al

Grant Copley

unread,
Jul 6, 2012, 4:52:00 PM7/6/12
to ra...@googlegroups.com
Al,

LOL we are in the same boat.

I did try removing my Application.cfc altogether, and I've also tried resetting the application using the applicationStop() method. 

I'm not sure on the J2EE container sessions. How can I check?

Igal

unread,
Jul 6, 2012, 5:36:13 PM7/6/12
to ra...@googlegroups.com
I didn't look at the code but this looks like a recursive call that doesn't have an exit point so it keeps on calling itself.

the Stack keeps references to the calling code point, so each method call in that recursive call adds a new Frame to the stack.  at some point the stack reaches its limit in size and you get the Stack Overflow error.

this is consistent with the stack trace where you can see  CollectionUtil.java:67 and StorageScopeImpl.java:287 over and over again.

another option is that you have object1 referencing object2 that then references object1 again (maybe even via other references).  if the writeDump() doesn't keep track of which objects were already dumped then you will also run out of Stack space at some point.  that would explain why you can dump other objects/scopes but not a particular one.

looks like a bug to me, but again -- I didn't look deep into it.  if you can easily switch to Railo 3.3 and dump the Session scope there then this is definitely Railo-4 related.

if you suspect it to be a bug you should open a ticket in the JIRA https://issues.jboss.org/browse/RAILO and try to include some code that reproduces the error when run independently of your system.

Igal

unread,
Jul 6, 2012, 6:10:05 PM7/6/12
to ra...@googlegroups.com
you can try running this script:

the following script will "dump" only the keys and types.  passing a maxLevels arg will stop the recursion at the maxLevels value.

if you want to test a Stack Overflow, just enable the circular reference and don't pass a maxLevels arg:


<!--- cfml script begin ---> 

<cffunction name="shallowDump" output="true">

<cfargument name="key">
<cfargument name="val" default="[EVAL]">
<cfargument name="maxLevels" default="0">
<cfargument name="level" default="0">
<cfset var Local = {}>
<cfif IsSimpleValue( val ) && val EQ '[EVAL]'>
<cfset val = Evaluate( key )>
</cfif>
<cfif IsStruct( val )>
<p style="text-indent:#level * 4#em;">#key#</p>

<cfif ( maxLevels GT 0 ) && ( level LT maxLevels )>
<cfloop array="#StructKeyArray( val )#" index="Local.ai">

<cfset shallowDump( Local.ai, val[ Local.ai ], maxLevels, level + 1 )>
</cfloop>
<cfelse>
<p>-- ommited --</p>
</cfif>
<cfelse>
<p style="text-indent:#level * 4#em;">#key#: [#val.getClass().getName()#]</p>
</cfif>
</cffunction>


<cfif false>
<!--- enabling this will cause Stack Overflow if there is no limit on the max levels --->
<cfset session._circularReference = session>
</cfif>


<cfset shallowDump( "Session", "[EVAL]", 4 )>

<!--- cfml script end --->


HTH,


Igal


On Friday, July 6, 2012 11:48:47 AM UTC-7, Grant Copley wrote:

Igal

unread,
Jul 6, 2012, 6:24:44 PM7/6/12
to ra...@googlegroups.com
if the session identifier cookie sent to your browser is CFID then you are using Railo's sessions, if it is jSessionId then you are using the J2EE Sessions.

also, if this is due to a circular reference (which is the most likely scenario) then you will get a Stack Overflow with ACF as well.

Grant Copley

unread,
Jul 7, 2012, 12:34:36 PM7/7/12
to ra...@googlegroups.com
OK guys, this most definitely is a bug in Railo 4.
 
I did the exact same thing on a different machine with 32-bit Windows 7 instead of 64-bit.
 
Again, I'm just download Railo 4, starting up Railo, creating a single .cfm page in the webroot, and trying to dump the session scope. I still get the same error.
 
I'm going to enter this as a bug.
 
@lgal - I tried running your script. It simple outputs the word "Session" to the browser and then I see the same error again.
 
Thanks for the help.

Igal

unread,
Jul 7, 2012, 1:48:54 PM7/7/12
to ra...@googlegroups.com
@Grant -- I installed Railo4 beta to test this and I can confirm that I also get a Stack Overflow when dumping the Session scope.

I saw that you opened the ticket in the JIRA so I'm sure that it will be fixed soon.


Igal

CF_Ray

unread,
Oct 29, 2012, 1:01:26 PM10/29/12
to ra...@googlegroups.com
I'm getting the same results when dumping the session scope with 'session type' set to CFML in the server administrator. When I change the value to J2EE, I have no problem.

I'm using a fairly clean install of Tomcat 7.0.32 and Railo 4.0.0.013 beta on Win7 64bit. (JDK 1.7.0_09) By default the session type is set to CFML in the server admin.

If it helps, I was able to get some output using:
writeDump(serialize(session));

-RV

Michael Offner

unread,
Oct 29, 2012, 2:41:28 PM10/29/12
to ra...@googlegroups.com
update to the latest version, this will solve the problem.

/micha

2012/10/29 CF_Ray <rayv...@gmail.com>



--
/micha

Michael Offner CTO Railo Technologies GmbH
Reply all
Reply to author
Forward
0 new messages