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.

Reply via email to