You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by Minh <bm...@hotmail.com> on 2010/04/30 00:00:13 UTC

Re: OpenEJB Tomcat Deployments

Hi,

can someone who has been succefully using OpenEJB with tomcat tell me what I
need to do to make this simple EJB deployed and work on tomcat 6.0.20

i have a very simple EJB Bean. Compiled and then put them in a war file
togther with the servlet HomeAction where I look up the Bean Hello. for some
reason I wont be able to look up for the bean, the bean is always NULL.

Can you tell me if i need to do anythign else or what did i missed? what did
I do wrong here ...any extra deployment sescriptor in web.xml etc ......


I saw minor error when Tomcat start up, but not sure it relates to the
error...if so, how can I fix this?

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


The javaee-api-5.0-2.jar is located inside war-file/WEB-INF\lib\ directory.

thanks
Minh



---------------------------------------------------------------
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);

}


--------------------------------------------------------------




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/OpenEJB-Tomcat-Deployments-tp980872p2076252.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: OpenEJB Tomcat Deployments

Posted by David Blevins <da...@visi.com>.
On Apr 29, 2010, at 3:00 PM, Minh wrote:

> I saw minor error when Tomcat start up, but not sure it relates to the
> error...if so, how can I fix this?
>
> 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

It might relate.  Certainly, including another copy of the Java EE  
libraries in your webapp is not allowed as the error message says.  So  
you should remove the javaee-api-5.0-2.jar from your webapp.  If by  
chance you put any OpenEJB libraries in your webapp as well, that  
wouldn't work either.

Follow the four steps on this page if you haven't already:

   http://openejb.apache.org/tomcat.html

Once that is done you can develop webapps as you would in a standard  
Java EE server.

-David