« Return to Thread: Tapestry/Javassist reading the wrong class type

Tapestry/Javassist reading the wrong class type

by mraible :: Rate this Message:

Reply to Author | View in Thread

I have the following contrib:Table that reds a Set of users from the servletContext (they're added to it as they login to maintain a list of active users).

<table jwcid="table@contrib:Table" class="table contribTable" id="user"
    rowsClass="ognl:beans.rowsClass.next" row="ognl:row"
    columns="user.username:username, activeUsers.fullName:fullName"
    source="ognl:getServletContext().getAttribute('userNames')" initialSortColumn="username"
    arrowUpAsset="asset:upArrow" arrowDownAsset="asset:downArrow">
</table>

Even thought "userNames" is a list of User objects in the ServletContext, javassist doesn't seem to recognize that. It seems to cast it to its UserDetails interface instead of the User object. Any ideas how to fix this?

ERROR [btpool0-2] HiveMindExpressionCompiler.compileExpression(224) | Error generating OGNL statements for expression username with root org.appfuse.model.User@791a53[username=admin,enabled=false,accountExpired=false,credentialsExpired=false,accountLocked=false,Granted Authorities: ]
org.apache.hivemind.ApplicationRuntimeException: Unable to add method void set(ognl.OgnlContext, java.lang.Object, java.lang.Object) to class $ASTProperty_114b3aa67a1: [source error] setUsername(java.lang.String) not found in org.acegisecurity.userdetails.UserDetails
        at org.apache.tapestry.enhance.ClassFabImpl.addMethod(ClassFabImpl.java:278)
        at org.apache.tapestry.services.impl.HiveMindExpressionCompiler.compileExpression(HiveMindExpressionCompiler.java:214)
        at ognl.OgnlRuntime.compileExpression(OgnlRuntime.java:523)
        at ognl.Ognl.compileExpression(Ognl.java:141)
        at org.apache.tapestry.services.impl.ExpressionCacheImpl.parse(ExpressionCacheImpl.java:152)
        at org.apache.tapestry.services.impl.ExpressionCacheImpl.getCompiledExpression(ExpressionCacheImpl.java:115)
        at $ExpressionCache_114b3aa6746.getCompiledExpression($ExpressionCache_114b3aa6746.java)
        at org.apache.tapestry.services.impl.ExpressionEvaluatorImpl.read(ExpressionEvaluatorImpl.java:108)
        at $ExpressionEvaluator_114b3aa6744.read($ExpressionEvaluator_114b3aa6744.java)
        at org.apache.tapestry.contrib.table.model.ognl.OgnlTableColumnEvaluator.getColumnValue(OgnlTableColumnEvaluator.java:59)

Thanks,

Matt

 « Return to Thread: Tapestry/Javassist reading the wrong class type