Tapestry 5.1 and class not found exception

2 views
Skip to first unread message

Lionel Touati

unread,
Mar 2, 2010, 3:05:12 PM3/2/10
to impala-users
Hi Phil,

I'm trying to put up a prototype to use impala and Tapestry 5.1.

I've got a module called builder and a spring bean called
loginPageBuilder

I've got another web module referencing the previous module, and
compile works fine in eclipse.

However if I do

@BeginRender
public void beginRender() {
LoginPageBuilder service = Impala.getBean("loginPageBuilder",
LoginPageBuilder.class);
LoginPageBeanContext ctx = new LoginPageBeanContext();
ctx.setLocale(locale);
LoginPageBean bean = service.buildBeanForPage(ctx);
}
I get class not found exception on LoginPageBuilder.

Do you have any idea of what the problem coudl be ?

Phil Zoio

unread,
Mar 2, 2010, 4:07:34 PM3/2/10
to impala...@googlegroups.com
Hi Lionel,

The use of Impala.getBean(...) typically is used in a standalone
environment, rather than in a web application. Normally, you would use
the framework's mechanism for injecting the Spring beans into its
environment.

Tapestry, for example, provides a module for Spring integration
'tapestry-spring'

That being said, I had a go at trying to use Tapestry with 5.1.0.5, and
ran into a problem straight away. Impala uses
GenericWebApplicationContext, but if attempting to use an
ApplicationContext defined outside of Tapestry, Tapestry is expecting
this to be an instance of ConfigurableWebApplicationContext, which
GenericApplicationContext does not implement. A bodge fix for this would
involve getting Impala's Tapestry module to use an extended application
context which implements ConfigurableWebApplicationContext. I really
can't imagine why Tapestry should be assuming that
ConfigurableWebApplicationContext is being used. I would be surprised if
it is actually calling any of it's methods.

The short answer is that getting Impala to work with Tapestry 5.1 might
be tricky, requiring either a bug fix of Tapestry's side or some fancy
footwork on the Impala side. It works with 5.0.18 (see the Web
frameworks Sample -
http://code.google.com/p/impala/wiki/SamplesWebframework), but Tapestry
is always a bit of a moving target.

Phil

Lionel Touati

unread,
Mar 3, 2010, 2:46:34 AM3/3/10
to impala-users
Hi Phil,

I've actually patched the class using the wrong applicationcontext
interface and it works, but I still run into the same problem. I'll
try to look into this to see how things can be done

On 2 mar, 22:07, Phil Zoio <philz...@realsolve.co.uk> wrote:
> Hi Lionel,
>
> The use of Impala.getBean(...) typically is used in a standalone
> environment, rather than in a web application. Normally, you would use
> the framework's mechanism for injecting the Spring beans into its
> environment.
>
> Tapestry, for example, provides a module for Spring integration
> 'tapestry-spring'
>
> That being said, I had a go at trying to use Tapestry with 5.1.0.5, and
> ran into a problem straight away. Impala uses
> GenericWebApplicationContext, but if attempting to use an
> ApplicationContext defined outside of Tapestry, Tapestry is expecting
> this to be an instance of ConfigurableWebApplicationContext, which
> GenericApplicationContext does not implement. A bodge fix for this would
> involve getting Impala's Tapestry module to use an extended application
> context which implements ConfigurableWebApplicationContext. I really
> can't imagine why Tapestry should be assuming that
> ConfigurableWebApplicationContext is being used. I would be surprised if
> it is actually calling any of it's methods.
>
> The short answer is that getting Impala to work with Tapestry 5.1 might
> be tricky, requiring either a bug fix of Tapestry's side or some fancy
> footwork on the Impala side. It works with 5.0.18 (see the Web

> frameworks Sample -http://code.google.com/p/impala/wiki/SamplesWebframework), but Tapestry

Reply all
Reply to author
Forward
0 new messages