You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by David Ezzio <de...@ysoft.com> on 2004/09/19 02:30:58 UTC

No such property: exception.class.name

Hi,

I have an exception handling page that has a property "Exception" 
defined by a page property-specification and an abstract method in the page.

When attempting to navigate this property with the ognl expression 
"exception.class.name", I get an exception.

The ognl engine apparently finds exception and its class, but not the 
class name.

Details below.

Can anyone see what I am doing wrong?

David

----- details follow -------

The abstract page class has the declaration:

abstract public Exception  getException();

<property-specification name="exception"  type="java.lang.Exception" 
persistent="no"/>


When the page is activated by a PageRedirectionException, it attempts to
render the following template snippet:

Exception: <span jwcid="@Insert" 
value="ognl:exception.class.name">java.lang.Exception</span>

This yields an exception:

Unable to resolve expression 'exception.class.name' for 
lab3.pages.ConcurrencyExceptionPage$Enhance_10@b8501d[ConcurrencyException].

ognl.NoSuchPropertyException
name
target: class kodo.util.OptimisticVerificationException
Stack Trace:
ognl.ObjectPropertyAccessor.getProperty(ObjectPropertyAccessor.java:123)
ognl.OgnlRuntime.getProperty(OgnlRuntime.java:1443)
ognl.ASTProperty.getValueBody(ASTProperty.java:96)
ognl.SimpleNode.getValue(SimpleNode.java:192)
ognl.ASTChain.getValueBody(ASTChain.java:109)
ognl.SimpleNode.getValue(SimpleNode.java:192)
ognl.Ognl.getValue(Ognl.java:335)
ognl.Ognl.getValue(Ognl.java:310)
org.apache.tapestry.binding.ExpressionBinding.resolveProperty(ExpressionBinding.java:201) 

org.apache.tapestry.binding.ExpressionBinding.getObject(ExpressionBinding.java:194) 

org.apache.tapestry.binding.AbstractBinding.getObject(AbstractBinding.java:208) 

org.apache.tapestry.param.AbstractParameterConnector.getBindingValue(AbstractParameterConnector.java:105) 

org.apache.tapestry.param.ObjectParameterConnector.setParameter(ObjectParameterConnector.java:53) 

org.apache.tapestry.param.ParameterManager.setParameters(ParameterManager.java:105) 

org.apache.tapestry.AbstractComponent.prepareForRender(AbstractComponent.java:898) 

org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:853)
org.apache.tapestry.BaseComponent.renderComponent(BaseComponent.java:118)
org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:857)
org.apache.tapestry.AbstractPage.renderPage(AbstractPage.java:300)
org.apache.tapestry.engine.RequestCycle.renderPage(RequestCycle.java:371)
org.apache.tapestry.engine.AbstractEngine.renderResponse(AbstractEngine.java:732) 

org.apache.tapestry.engine.AbstractEngine.handlePageRedirectException(AbstractEngine.java:1026) 

org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:882)
...





---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


OGNL bug WAS RE: No such property: exception.class.name

Posted by Nicholas Lesiecki <nl...@vmsinfo.com>.
I'd submit this to Drew. It may be a known limitation, or he may have
screwed up (:P Drew).

Submit bugs to: 

ognl-developer@lists.ognl.org

(Note: I shouldn't imply that OGNL has only one developer--I just don't know
any of the others.)


I wouldn't be surprised either if it has been fixed in a point release...

Nick

-----Original Message-----
From: Bryan Lewis [mailto:bryan@maine.rr.com] 
Sent: Sunday, September 19, 2004 10:32 AM
To: Tapestry users
Subject: Re: No such property: exception.class.name

Interesting.  I get the same error, ognl.NoSuchPropertyException.  But only
if I try to access it with the expression "ognl:exception.class.name".  I
get no error when I try two other ways:

* with the expression "ognl:getException().getClass().getName()"
* with a call to a java method getExceptionClassName() that returns the
name.

It looks like an inconsistency in ognl.  The API for
ognl.ObjectPropertyAccessor says it "uses reflection on the target object's
class."  The other two ways I tried don't involve reflection, so maybe
there's some problem in doing reflection on Class?


----- Original Message ----- 
From: "David Ezzio" <de...@ysoft.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Saturday, September 18, 2004 8:30 PM
Subject: No such property: exception.class.name


> Hi,
>
> I have an exception handling page that has a property "Exception"
> defined by a page property-specification and an abstract method in the
page.
>
> When attempting to navigate this property with the ognl expression
> "exception.class.name", I get an exception.
>
> The ognl engine apparently finds exception and its class, but not the
> class name.
>
> Details below.
>
> Can anyone see what I am doing wrong?
>
> David
>
> ----- details follow -------
>
> The abstract page class has the declaration:
>
> abstract public Exception  getException();
>
> <property-specification name="exception"  type="java.lang.Exception"
> persistent="no"/>
>
>
> When the page is activated by a PageRedirectionException, it attempts to
> render the following template snippet:
>
> Exception: <span jwcid="@Insert"
> value="ognl:exception.class.name">java.lang.Exception</span>
>
> This yields an exception:
>
> Unable to resolve expression 'exception.class.name' for
>
lab3.pages.ConcurrencyExceptionPage$Enhance_10@b8501d[ConcurrencyException].
>
> ognl.NoSuchPropertyException
> name
> target: class kodo.util.OptimisticVerificationException
> Stack Trace:
> ognl.ObjectPropertyAccessor.getProperty(ObjectPropertyAccessor.java:123)
> ognl.OgnlRuntime.getProperty(OgnlRuntime.java:1443)
> ognl.ASTProperty.getValueBody(ASTProperty.java:96)
> ognl.SimpleNode.getValue(SimpleNode.java:192)
> ognl.ASTChain.getValueBody(ASTChain.java:109)
> ognl.SimpleNode.getValue(SimpleNode.java:192)
> ognl.Ognl.getValue(Ognl.java:335)
> ognl.Ognl.getValue(Ognl.java:310)
>
org.apache.tapestry.binding.ExpressionBinding.resolveProperty(ExpressionBind
ing.java:201)
>
>
org.apache.tapestry.binding.ExpressionBinding.getObject(ExpressionBinding.ja
va:194)
>
>
org.apache.tapestry.binding.AbstractBinding.getObject(AbstractBinding.java:2
08)
>
>
org.apache.tapestry.param.AbstractParameterConnector.getBindingValue(Abstrac
tParameterConnector.java:105)
>
>
org.apache.tapestry.param.ObjectParameterConnector.setParameter(ObjectParame
terConnector.java:53)
>
>
org.apache.tapestry.param.ParameterManager.setParameters(ParameterManager.ja
va:105)
>
>
org.apache.tapestry.AbstractComponent.prepareForRender(AbstractComponent.jav
a:898)
>
> org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:853)
> org.apache.tapestry.BaseComponent.renderComponent(BaseComponent.java:118)
> org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:857)
> org.apache.tapestry.AbstractPage.renderPage(AbstractPage.java:300)
> org.apache.tapestry.engine.RequestCycle.renderPage(RequestCycle.java:371)
>
org.apache.tapestry.engine.AbstractEngine.renderResponse(AbstractEngine.java
:732)
>
>
org.apache.tapestry.engine.AbstractEngine.handlePageRedirectException(Abstra
ctEngine.java:1026)
>
> org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:882)
> ...
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: No such property: exception.class.name

Posted by Bryan Lewis <br...@maine.rr.com>.
Interesting.  I get the same error, ognl.NoSuchPropertyException.  But only
if I try to access it with the expression "ognl:exception.class.name".  I
get no error when I try two other ways:

* with the expression "ognl:getException().getClass().getName()"
* with a call to a java method getExceptionClassName() that returns the
name.

It looks like an inconsistency in ognl.  The API for
ognl.ObjectPropertyAccessor says it "uses reflection on the target object's
class."  The other two ways I tried don't involve reflection, so maybe
there's some problem in doing reflection on Class?


----- Original Message ----- 
From: "David Ezzio" <de...@ysoft.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Saturday, September 18, 2004 8:30 PM
Subject: No such property: exception.class.name


> Hi,
>
> I have an exception handling page that has a property "Exception"
> defined by a page property-specification and an abstract method in the
page.
>
> When attempting to navigate this property with the ognl expression
> "exception.class.name", I get an exception.
>
> The ognl engine apparently finds exception and its class, but not the
> class name.
>
> Details below.
>
> Can anyone see what I am doing wrong?
>
> David
>
> ----- details follow -------
>
> The abstract page class has the declaration:
>
> abstract public Exception  getException();
>
> <property-specification name="exception"  type="java.lang.Exception"
> persistent="no"/>
>
>
> When the page is activated by a PageRedirectionException, it attempts to
> render the following template snippet:
>
> Exception: <span jwcid="@Insert"
> value="ognl:exception.class.name">java.lang.Exception</span>
>
> This yields an exception:
>
> Unable to resolve expression 'exception.class.name' for
>
lab3.pages.ConcurrencyExceptionPage$Enhance_10@b8501d[ConcurrencyException].
>
> ognl.NoSuchPropertyException
> name
> target: class kodo.util.OptimisticVerificationException
> Stack Trace:
> ognl.ObjectPropertyAccessor.getProperty(ObjectPropertyAccessor.java:123)
> ognl.OgnlRuntime.getProperty(OgnlRuntime.java:1443)
> ognl.ASTProperty.getValueBody(ASTProperty.java:96)
> ognl.SimpleNode.getValue(SimpleNode.java:192)
> ognl.ASTChain.getValueBody(ASTChain.java:109)
> ognl.SimpleNode.getValue(SimpleNode.java:192)
> ognl.Ognl.getValue(Ognl.java:335)
> ognl.Ognl.getValue(Ognl.java:310)
>
org.apache.tapestry.binding.ExpressionBinding.resolveProperty(ExpressionBind
ing.java:201)
>
>
org.apache.tapestry.binding.ExpressionBinding.getObject(ExpressionBinding.ja
va:194)
>
>
org.apache.tapestry.binding.AbstractBinding.getObject(AbstractBinding.java:2
08)
>
>
org.apache.tapestry.param.AbstractParameterConnector.getBindingValue(Abstrac
tParameterConnector.java:105)
>
>
org.apache.tapestry.param.ObjectParameterConnector.setParameter(ObjectParame
terConnector.java:53)
>
>
org.apache.tapestry.param.ParameterManager.setParameters(ParameterManager.ja
va:105)
>
>
org.apache.tapestry.AbstractComponent.prepareForRender(AbstractComponent.jav
a:898)
>
> org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:853)
> org.apache.tapestry.BaseComponent.renderComponent(BaseComponent.java:118)
> org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:857)
> org.apache.tapestry.AbstractPage.renderPage(AbstractPage.java:300)
> org.apache.tapestry.engine.RequestCycle.renderPage(RequestCycle.java:371)
>
org.apache.tapestry.engine.AbstractEngine.renderResponse(AbstractEngine.java
:732)
>
>
org.apache.tapestry.engine.AbstractEngine.handlePageRedirectException(Abstra
ctEngine.java:1026)
>
> org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:882)
> ...
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org