Hi All,
I have a problem I hope someone can help me with:
What I'm trying to do is programmatically create controls which access
system controls ie JDBC
I can create the control and I can also access sub controls (non system)
within the parent which are defined declaratively and they work fine.
The problem arises when I try to access a control that requires a
contextual service. IE JDBC.
Is this even possible?
I've tried this from an extension of the XmlHttpRequestServlet (doPost
method)
The ReceivablesControlImpl is a basic control which references a number
of JDBC controls. The error is in the method (viewReceivable) that
calls methods on the JDBC controls.
ReceivablesControlImpl rec = (ReceivablesControlImpl)
java.beans.Beans.instantiate(
getClass().getClassLoader(),
"controls.receivables. ReceivablesControlImpl");
org.apache.beehive.controls.api.bean.Controls.initializeClient( null,
rec,null );
Receivable r = rec.viewReceivable(1L);
gives me:
org.apache.beehive.controls.api.ControlException: Control initialization
failure[org.apache.beehive.controls.api.Con
trolException: Contextual service
org.apache.beehive.controls.api.context.ResourceContext is not
available]
at
org.apache.beehive.controls.runtime.bean.ControlBean.ensureControl(Contr
olBean.java:326)
at
controls.database.receivables.JdbcReceivablesBean.viewReceivable(JdbcRec
eivablesBean.java:251)
at
controls.receivables.ReceivablesControlImpl.viewReceivable(ReceivablesCo
ntrolImpl.java:60)
Environment:
Tomcat 5.5
Beehive 1.02
Help would be much appreciated
Thank you,
Steven Dalton