How to run HelloEvents.java

Hi all,

I have tried the following code to compile.It is compiling well.But i dont know whether i am running it correctly.

[code]
public class HelloEvents implements ManagerEventListener
{
private ManagerConnection managerConnection;
public HelloEvents() throws IOException
{
ManagerConnectionFactory factory = new ManagerConnectionFactory(
“localhost”, “admin”, “1234”);
this.managerConnection = factory.createManagerConnection();
}
public void run() throws IOException, AuthenticationFailedException,
TimeoutException, InterruptedException
{
// register for events
managerConnection.addEventListener(this);
// connect to Asterisk and log in
managerConnection.login();
// request channel state
managerConnection.sendAction(new StatusAction());
managerConnection.logoff();
}
public void onManagerEvent(ManagerEvent event)
{
// just print received events
System.out.println(event);
}
public static void main(String[] args) throws Exception
{
HelloEvents helloEvents;

helloEvents = new HelloEvents();
helloEvents.run();
}
}
[/code].
After compiling,I have started the fastagi.Then when I call an extension 1300,It is showing the following error:

[quote]
INFO: Received connection from /127.0.0.1
Jan 23, 2008 12:32:13 PM org.asteriskjava.fastagi.AbstractMappingStrategy createAgiScriptInstance
SEVERE: Unable to create AgiScript instance of type HelloEvents: Class does not implement the AgiScript interface
Jan 23, 2008 1:03:19 PM org.asteriskjava.fastagi.AbstractMappingStrategy createAgiScriptInstance
SEVERE: Unable to create AgiScript instance of type hello.agi: Class not found, make sure the class exists and is available on the CLASSPATH
Jan 23, 2008 1:03:19 PM org.asteriskjava.fastagi.internal.AgiConnectionHandler run
SEVERE: No script configured for URL ‘agi://localhost/hello.agi’ (script ‘hello.agi’)
[/quote].
Am i running it correctly?If no how should i run?
please guide me to do this.

Thanks