Hello there! Yeah, unless your class has a constructor you must tell
it what setters to use, at least the same problem was happening to me
and I solved (Actually, Hugo Palma gave me the hint :D )
<service-point id="localPortals"
interface="RLocalPortals"/>
<implementation service-id="localPortals">
<invoke-factory>
<construct class="impl.RLocalPortalsImpl">
<set-object property="session" value="service:sessionFactory"/>
</construct>
</invoke-factory>
</implementation>
Cheers
On 8/8/05, Ron Piterman <[EMAIL PROTECTED]> wrote:
> Hi,
> I use the hibernate example from howards article in TSS, but I am not
> sure I understand HiveMind correctly:
>
> When I define a service for Interface X, and in the implementation class
> of some other service, I add a setter: setBla(X x), hivemind should set
> an X instance to the Service implementation automatically?
>
> Or do I have to explicitly add <set-service... to each factory ?
>
>
> In a repository implementation , the hibernate session is not being set.
>
> Nothing on the logs (DEBUG level) - how do I get to the source of the
> problem?
>
>
> Here are some files...
> Thanx, Ron
>
>
> ...
> <service-point id="sessionFactory"
> interface="org.apache.hivemind.ServiceImplementationFactory"
> parameters-occurs="none"/>
>
> <service-point id="session" interface="org.hibernate.Session"/>
> ...
>
> <service-point id="localPortals"
> interface="RLocalPortals"/>
> <implementation service-id="localPortals">
> <invoke-factory>
> <construct class="impl.RLocalPortalsImpl"/>
> </invoke-factory>
> </implementation>
>
> ---
>
> public class RLocalPortalsImpl extends AbstractRepositoryImpl implements
> RLocalPortals {
>
> public List getRegistrationCountries() {
> Query q =
> session.getNamedQuery("registration-countries"); // *NullPExcep*
> return q.list();
> }
> public void setSession(Session session) {
> this.session = session;
> }
> }
>
> ---
>
> On the session.getNamedQuery(...) I get a null pointer exception,
> meaning the session is null :-(
>
> Wo what did I do wrong?
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]