beehive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ken Tam" <>
Subject RE: Problem with declarative instantiation of a Control from a POJO
Date Tue, 01 Feb 2005 20:32:43 GMT
Hi Pietro,

It looks like that's exactly what's going on (the control instance field
is not being initialized).  When you use declarative controls in a POJO,
there needs to be _some_ code that does that initialization.  That code
is encapsulated in the org.apache.beehive.controls.api.bean.Controls
helper class in a static method called "initializeClient".  Basically,
you need to instantiate an instance of your POJO, and then call
initializeClient() on that instance (see the javadoc for more detail).

One caveat is that you must be compiling your POJO with apt, so that the
@Control annotation gets processed -- this will result in a
<POJO>ClientInitializer.class being created along side the .class file
for the POJO itself.  initializeClient() depends on that
ClientInitializer class to do its work.

Does this make sense?  Let me know if you'd like more details..

-----Original Message-----
From: Pietro Di Bello [] 
Sent: Tuesday, February 01, 2005 8:47 AM
To: Beehive Users
Subject: Fwd: Problem with declarative instantiation of a Control from a

I forgot to tell you that the error I got trying to use the control from
that pojo was a NullPointerException (it seems that the control has not
been initialized somehow...)


---------- Forwarded message ----------
From: Pietro Di Bello <>
Date: Tue, 1 Feb 2005 17:41:47 +0100
Subject: Problem with declarative instantiation of a Control from a POJO
To: Beehive Users <>

Hi all,
I'm using Beehive taken from SVN two days ago and have a problem
instantiating a Control within a POJO (I'm following the v1Beta docs,
chapter 'Control Programming', 6.1 Declarative Instantiation).

I've already used (successfully) the same beehive control from a
page-flow and also with a programmatic instantiation.

This is the code of the POJO, which uses an LdapAccess Control we

public class LdapAccessClient
    @Control @LdapAccess.LdapServer(
            userManagerName = "xxx",
            userManagerPassword = "yyy",
            serviceUrl = "zzz",
            searchDatabase = "ttt")
    private LdapAccessBean itsLdapAccess;

Do you have any idea?

Thanks a lot!

View raw message