beehive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hoi Lam" <h...@bea.com>
Subject RE: Control initialization failure
Date Tue, 21 Dec 2004 22:28:53 GMT
Hello Tim,

A control requires certain contextual services during runtime which are
typically provided by a context container that it runs under.

If you are running your control in the Web tier, here is a message in
the archive that Kyle had provided on how to setup the ControlFilter to
provide these services in the Web Tier:

http://nagoya.apache.org/eyebrowse/ReadMsg?listName=beehive-user@incubat
or.apache.org&msgId=2026505 

If you want to run your control in a standalone bean context container,
Brett has provided some useful classes here:

http://nagoya.apache.org/jira/browse/BEEHIVE-103

Hoi
-----Original Message-----
From: Timothy Brown [mailto:tbrownagc@earthlink.net] 
Sent: Tuesday, December 21, 2004 12:36 PM
To: beehive-dev@incubator.apache.org
Subject: Control initialization failure

Hello,

 

I am trying to use the database control and I get the following
exception:

 

Response from the selectEmployee() method on the Employee Manager
Control:
Exception caught: Control initialization failure[Contextual service
org.apache.beehive.controls.api.context.ResourceContext is not
available]

 

This is my code from my jcx file:

 

import java.sql.SQLException;

import java.io.Serializable;

import java.util.Iterator;

import java.util.HashMap;

 

import org.apache.beehive.controls.api.bean.ControlExtension;

 

import dbControl.DatabaseControl;

import dbControl.DatabaseControl.ConnectionDataSource;

 

 

//@ControlExtension

//@ConnectionDataSource(jndiName="java:comp/env/com.bea.EventTracker")

 

@ControlExtension

@ConnectionDataSource(jndiName="jdbc:hsqldb:hsql://localhost, sa")

 

public interface EmployeeDBControl extends DatabaseControl

{

   

    @SQL(statement="SELECT employee_id, first_name, last_name FROM
EMPLOYEE
WHERE employee_id={ id }")

    public Employee selectEmployee( int id ) throws SQLException;

 

 

    @SQL(statement="UPDATE EMPLOYEE SET last_name = {lname} WHERE id =
{emp_id}")

    public void updateEmployee( String lName, int emp_id ) throws
SQLException;

    

}

 

Any ideas?

 

Thanks,

 

Tim



Mime
View raw message