[Prev] Thread [Next]  |  [Prev] Date [Next]

[transfer-dev] Railo 3.0.015 with Transfer (AOP advice and stack overflow) whostheJBoss Tue Jun 23 05:00:40 2009

Hey guys,

I've been following the discussion about using Transfer on Railo while
trying to resolve a few issues, but I can't quite figure them out out.
I was hoping someone else had maybe run into this problem and had some
clarification as to what might be going on here. I am very close to
having everything working except for just these few issues. Hopefully
my explanation isn't too dense. The first problem is pretty
straightforward, the second is a little more complex. I've given a
short version of the problems at the end of the post to clarify.

Here is a brief explanation of my problem. I am running Railo 3.0.015:

Issue # 1.)

When I use: <order property="sortOrder" order="asc"/> (sortOrder is
the name of a numeric column in my database) I receive the following

Application Execution Exception
Error Type: database : 0
Error Messages: Column 'sortOrder' in order clause is ambiguous

I have tried manually filling in the sortOrder column with ascending
values to test, I have tried using all zero values, but nothing seems
to work. In my application sometimes this column will have a value
higher than 0, sometimes it will not. This works fine on CF8, but
fails on Railo. As of now I have to remove the order property
completely from my transfer definition file for Transfer not to give
me this error when trying to use the object. On CF8 it will simply
output them in default order, if the column is filled in it will order
them by the column value, if not it ignores it.


Issue # 2.) I have a function (a ColdBox handler action) that creates
some objects in a composition and saves them to the database. If I
visit this create page in CF8 the database entries and corresponding
objects are all created properly. I can refresh this page multiple
times in a row and new objects/records are created every time. I can
then view all of the objects / records in an output page I have
created. So, CF8 works fine everytime with no changes to my existing

When using Railo, if I visit my create page BEFORE visiting any other
page (such as my output page) that calls objects of the type I want to
create, I get this error:

Application Execution Exception
Error Type: expression : 0
Error Messages: component [catalog.components.decorators.catalogs] has
existing functions are

After receiving this error, additional attempts to visit the create
page result in the following error:

Application Execution Exception
Error Type: java.lang.stackoverflowerror : 0
Error Messages: java.lang.StackOverflowError
Tag Context:
ID:     ??
LINE:   80
Template:       C:\railo\railo-
ID:     ??
LINE:   8
Template:       C:\railo\railo-
ID:     ??
LINE:   210
Template:       C:\railo\railo-
ID:     ??
LINE:   81
Template:       C:\railo\railo-
ID:     ??
LINE:   8
Template:       C:\railo\railo-
ID:     ??
LINE:   210
Template:       C:\railo\railo-

It goes on like this for quite a while, alternating between these
methods. I see maybe a hundred of these. I'm guessing there is some
kind of loop happening. Here is the stack trace:

        at railo.commons.lang.CharBuffer$Entity.(
        at railo.commons.lang.CharBuffer$Entity.(
        at railo.commons.lang.CharBuffer.(
        at railo.runtime.writer.BodyContentImpl.(
        at railo.runtime.PageContextImpl.pushBody(
        at railo.runtime.type.UDFImpl._call(
        at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues
        at railo.runtime.PageContextImpl.getFunction(

Now, if I visit a page that does a list or get on the type of object I
was trying to create FIRST and THEN visit the create page it will work
and create the objects and database entrys. However, attempting to
call the create page again results in the same stack overflow error as

So, I can call the create page once, but after that I get a stack
overflow error. If I try to call the create page without having called
another page that uses those same type of objects I'm trying to
create, it fails with the error about

If I add the following method to a decorator for every object that I
try to use in the compositions, then I can call the create page
without having to visit a page that gets or lists the object of that
type first:

<cffunction name="actionBeforeCreateTransferEvent" access="public"
returntype="void" output="false" hint="I set the created date before I
am persisted for the first time.">
<cfargument name="event" hint="The event object"
type="" required="Yes">

Once I add this function, I can call the create page right off the bat
and it works, but the subsequent calls still give me the stack
overflow. So, adding "actionBeforeCreateTransferEvent" removes the
error about that, but still leaves the stack overflow error. Why am I
having to add this method???

Also, I am advising the handler action with AOP for transactions. If I
disable the AOP advice for the handler action (without using
"actionBeforeCreateTransferEvent" in my decorator), then I receive the
following error, just as above:

Application Execution Exception
Error Type: expression : 0
Error Messages: component [catalog.components.decorators.catalogs] has
existing functions are

So, I have to have AOP turned on to even be able to call the create
page if I haven't added the "actionBeforeCreateTransferEvent" method
to the decorator. Even then, if I have added the method, it just works
the once and then starts giving me stack overflow errors.

I am not sure what to do about these issues. It's working here and
there. Transfer can delete, view and manage objects. It can handle
compositions, but it fails when I try to create more than once (with
AOP transaction advice enabled) or if I create without having called a
page that views those types of objects without having a
"actionBeforeCreateTransferEvent" method on my decorators. It only
does this on compositions, regular objects can be created without an

So, a quick recap in easier terms:

Issue #1: <collection type="array"><order property="sortOrder"
order="asc"/></collection> throws an error about an ambiguous clause.


Issue #2: I can call my handler that creates objects and database
entries based on a composition when AOP transaction advice is NOT
being used and I have added the "actionBeforeCreateTransferEvent" to
the decorator for each object involved in the create sequence. This
causes no errors, but I am forced to add this decorator method and am
not able to use transaction advice. None of this is required in CF8,
it all works. I need transaction advice, so this is a major issue.

If I have AOP transaction advice enabled, then I can call the create
page once successfully, but subsequent attempts fail with the stack
overflow error.

If I do not include the "actionBeforeCreateTransferEvent" on all
objects involved in the creation, then trying to call the handler
action that creates my objects and database entries will fail with the
error above about "has no function with name
[ACTIONBEFORECREATETRANSFEREVENT]" unless I have visited a page that
lists or gets the types of objects I am trying to create before
calling the create page.

Either way, once I have successfully called the create handler action,
if I have AOP transaction advice enabled I will always receive the
stack overflow error on subsequent calls. If I disable the transaction
advice AND have added the "actionBeforeCreateTransferEvent" method to
my decorators then I can call the create as many times as I want.

I have added passby="value" to all of my arguments of type array and I
have added lazy="true" to all of my relationships, but neither do
anything to resolve my stack overflow error.

Any help with this would be greatly appreciated! This is a MAJOR
hurdle for me.

Before posting questions to the group please read:

You received this message because you are subscribed to the Google Groups 
"transfer-dev" group.
To post to this group, send email to [EMAIL PROTECTED]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at