[jboss-user] [EJB/JBoss] - sample hello world application
Narasimha
do-not-reply at jboss.com
Wed Apr 18 23:37:23 EDT 2007
I am a beginner. I want to start with a hello world application.
at this point i made the following :
a>business interface
b>bean
c>test client
a>firstInterface.java
package server;
import javax.ejb.Remote;
@Remote
public interface firstInterface
{
public String hello();
}
b>firstBean.java
package server;
import javax.ejb.Remote;
import javax.ejb.Stateless;
@ Stateless
@ Remote(firstInterface.class)
public class firstBean implements firstInterface
{
public String hello()
{
System.out.println("hello()");
return "hello world !";
}
}
c>firstTestClient.java
package client;
import javax.naming.Context;
import javax.naming.InitialContext;
import server.firstInterface;
public class firstTestClient {
/**
* @param args
* @throws Exception
*/
public static void main(String[] args) throws Exception
{
// TODO Auto-generated method stub
Context ctx = new InitialContext();
firstInterface fInterface = (firstInterface) ctx.lookup("server/firstInterface");
System.out.println(fInterface.hello());
}
}
i have no idea as what to do further. I do not know the flow. for instance what all xml files do i need to generate and esentially how do i deploy the bean.
i realy appreciate if you guys could help me out.
thank you.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4038700#4038700
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4038700
More information about the jboss-user
mailing list