Wednesday, May 4, 2011

af:serverListener produces compilation error in jDeveloper

I had a weird problem that adding a af:serverListerner component on jspx page caused compilation error?!?


Compiler log:
The class of the deferred-methods return type "{0}" can not be found.
No property editor found for the bean "javax.el.MethodExpression"

Interesting, when I removed that af:serverListener component from the page (just to pass compilation) and then added it again during run-time, it worked normally (the backing bean method triggered correctly, including passing params, etc).

Further, when created a simple test case with the same code there was no problem. But, ok, that was expected, because I've used a similar code combination on other project, too. So I suspected it has something with the project settings, but I couldn't find why, regarding a lot of project dependencies and included libraries.

Here is some simplified related code ... from jspx page...


function aaa(event) {
   var esrc = event.getSource();
   AdfCustomEvent.queue(esrc, "bbb", {fvalue : "TEST"},true);
   event.cancel();
}






... and from backing bean ...
public void onClick(ClientEvent clientEvent) {
   String message = (String) clientEvent.getParameters().get("fvalue");
   System.out.println(message);
}


After spending a lot of time (and I won't tell you how much :-))  I found that, on the top of the page, there is a tag:



By looking on its properties, I saw there an attribute deferredSyntaxAllowedAsLiteral which is by default set to false. By reading on the internet I found that others also sugest it to be set to false. And then I was lucky (or desperate enough) so I explicitly have set it to false - and then I got no more compilation error!!!

The only explanation I could think is that some of the libraries included in the project somehow have changed the default value of the attribute or something like that... you judge... I go to make some coffee.






Copyright © 2010 Sasha Stojanovic.