• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

EJB deployment on TomEE server

 
Ranch Hand
Posts: 138
Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 1104
10
Netbeans IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you check the deploying in tomee page?
 
Prajakta Acharya
Ranch Hand
Posts: 138
Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 1104
10
Netbeans IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 1104
10
Netbeans IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Cool!
You're welcome.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 14
jQuery Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Prajakta hasn't been active since early 2014, so I doubt you'll get an answer...
 
World domination requires a hollowed out volcano with good submarine access. Tiny ads are optional.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic