• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EJB deployment on TomEE server

 
Prajakta Acharya
Ranch Hand
Posts: 138
Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ranganathan Kaliyur Mannar
Bartender
Posts: 1101
10
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you check the deploying in tomee page?
 
Prajakta Acharya
Ranch Hand
Posts: 138
Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1101
10
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 138
Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 138
Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1101
10
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cool!
You're welcome.
 
kennylee lee
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14
Java jQuery
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
xsunil kumar
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Prajakta,

I am also facing the same issue. Can you give me example, how you have done the lookup of EJB.

Regards,
Sunil
 
Rob Spoor
Sheriff
Pie
Posts: 20512
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Prajakta hasn't been active since early 2014, so I doubt you'll get an answer...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic