aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes EJB deployment on TomEE server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB deployment on TomEE server" Watch "EJB deployment on TomEE server" New topic
Author

EJB deployment on TomEE server

Prajakta Acharya
Ranch Hand

Joined: Nov 08, 2012
Posts: 136

Can someone help me with the process of deploying EJB application on TOMEE server? Is it simply dropping EJB application jar in the common library folder of the server?
How does TOMEE bind EJBs to JNDI names?

Thanks.


Regards,
Prajakta
Ranganathan Kaliyur Mannar
Bartender

Joined: Oct 16, 2003
Posts: 1075
    
  10

Did you check the deploying in tomee page?


Ranga.
SCJP 1.4, OCMJEA/SCEA 5.0.
Prajakta Acharya
Ranch Hand

Joined: Nov 08, 2012
Posts: 136

Hi Ranganathan. Thanks for pointing me to the appropriate page.

I checked it out and did following:
1) Created WAR file of the web application containing a JSP and a servlet. Servlet refers to EJB.
2) Created EJB project containing a local interface and a session bean.
Build JAR file of the project.
3) Created an EAR project and included both WAR and JAR in it and put it in 'apps' folder of TOMEE.

Result:
1) When EAR with only WAR was deployed, application was deployed sccessfully.
2) When EAR with WAR and EJB JAR was deployed, I could not see index page of the application, indicating something went wrong in EJB JAR.

I did following in EJB Project.
Local interface:


Session bean:


Servlet code:


I have been trying it for quite some time now. Please help..........
Ranganathan Kaliyur Mannar
Bartender

Joined: Oct 16, 2003
Posts: 1075
    
  10

Hi Prajakta,
I have myself never tried TomEE, but, I would like to point out 2 things. These are new to JEE and introduced only from JEE 6:
a) There are now 2 profiles available for servers to support - Web Profile and Full Profile. I think TomEE supports only Web Profile.
b) An EJB can be packaged within a WAR itself.

So, these might be related to the issues you are facing. I would suggest you read through the TomEE documentation and understand it before you package and deploy your application.
Prajakta Acharya
Ranch Hand

Joined: Nov 08, 2012
Posts: 136

I went through TOMEE documentation and also this link: http://www.adam-bien.com/roller/abien/entry/is_java_ee_6_war

It says, EJB jar can be put in WEB-INF/lib folder and packaged as a WAR. After deploying this WAR, TOMEE gives exception as javax.naming.NameNotFoundException: Name "global" not found

If EJB jar is not placed in the lib folder. app deploys successfully. I am using TOMEE1.5

Any help will be appreciated. Thanks.
Prajakta Acharya
Ranch Hand

Joined: Nov 08, 2012
Posts: 136

I could deploy and test EJB on tomcat successfully.

Did following:
1) Created EJB project and exported it as a JAR.
2) Created a web application and put EJB jar in its WEB-INF/lib folder.
3) After going through some forums, got to know the default JNDI name to which TOMEE binds the deployed EJBs. It is <EJBNAME><Interface:Local/Remote>
4) Used this name to look-up in servlet code.

However, 'mappedName' in @Stateless annotation in EJB did not override this default JNDI name............

Thanks Ranganathan for guiding me.
Ranganathan Kaliyur Mannar
Bartender

Joined: Oct 16, 2003
Posts: 1075
    
  10

Cool!
You're welcome.
kennylee lee
Greenhorn

Joined: Feb 13, 2014
Posts: 1
Prajakta Acharya wrote:Can someone help me with the process of deploying EJB application on TOMEE server? Is it simply dropping EJB application jar in the common library folder of the server?
How does TOMEE bind EJBs to JNDI names?

Thanks.


hi prajakta:

I follow you step to deploy a WAR include EJB, but can't use ejb function. Can you show me the web project config.

many thanks.
Alok Agrawal
Greenhorn

Joined: Feb 01, 2008
Posts: 12

HI,

thanks for this post.

I followed the same process. hwoever I am facing below issue of nameNotFoundexception:



My ejb-jar XML is like that:



Please help me ... thanks


Alok Agrawal
Learn Thru PPT Sports Info
 
 
subject: EJB deployment on TomEE server
 
Similar Threads
ejb2.x and jboss application server migrate into ejb3.x and OpenEjb/Tomee application server
EJB Transaction Timeout
Access remote EJB 3 with tomcat
soap web service communication
EJB 3.0 deployment on TOMEE