Hello Minh, usually it is very simple.
Download the openejb.war from here: http://www.apache.org/dist/openejb/3.1.2/ deploy it (as openejb.war) to tomcat's webapp folder go to localhost:8080/openejb and run the "tests". I'd also do the install (for the agent). Than you could checkout this example: https://svn.apache.org/repos/asf/openejb/trunk/openejb3/examples/webapps/jsf/ => Follow the instructions in the README.txt If you want a modern version of JSF2 (MyFaces2), feel free to apply this patch: https://issues.apache.org/jira/browse/OPENEJB-1264 -Matthias On Thu, Apr 29, 2010 at 11:48 PM, Minh <[email protected]> wrote: > > Please someone help me. I have tried this for 2 full days and not able to get > a simple OpenEJB works on Tomcat. > > Not sure why I could not lookup the EJB bean...the example is very simple. > the lookup always return NULL. > > On tomcat startup, i saw this error, but nit sure it is related to the > problem, > > Apr 29, 2010 2:41:57 PM org.apache.catalina.loader.WebappClassLoader > validateJarFile > INFO: > validateJarFile(C:\apache-tomcat-6.0.20\webapps\recharge_report\WEB-INF\lib\javaee-api-5.0-2.jar) > - jar not loaded. See Servlet Spec 2.3, section 9.7 > .2. Offending class: javax/servlet/Servlet.class > context path = /recharge_report > > And here is my classes: > > > ------------------------------------------ > package edu.ucsd.ehs.service.helloworld; > > import javax.ejb.Stateless; > > @Stateless > public class HelloBean implements Hello { > > public String greet(String s) { > return "Hello " + s + "!"; > } > } > > > > > > package edu.ucsd.ehs.service.helloworld; > import javax.ejb.Local; > > @Local > public interface Hello{ > > public String greet(String s); > > } > > ---------------------------------------------- > > > And below is my struts action class where I look up for the bean and execute > its method > > > > > > public class HomeAction extends DispatchAction { > > �...@ejb > private Hello bean; > public ActionForward displayHome(ActionMapping mapping, ActionForm > form, > HttpServletRequest request, > HttpServletResponse > response)throws Exception { > > > > > System.out.println("***Context: HomeAction "); > try{ > System.out.println("***HomeAction: testing OPENEJB"); > String returnedString = bean.greet("OpenEJB User"); > System.out.println("***returnedString: " + > returnedString); > > > > -- > View this message in context: > http://openejb.979440.n4.nabble.com/How-to-use-OpenEJB-with-Tomcat-tp1680307p2076241.html > Sent from the OpenEJB Dev mailing list archive at Nabble.com. > -- Matthias Wessendorf blog: http://matthiaswessendorf.wordpress.com/ sessions: http://www.slideshare.net/mwessendorf twitter: http://twitter.com/mwessendorf
