• 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

Deploying an EJB onto TomEE

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello  I have created a simple EJB  ( the classic Calculator Bean) and have deployed it to my Tomcat7 Server (localhost).  
I "deployed" the JAR by copying-and-pasting it into the C:\Tomcat7\Webapps directory;  then I started up the Server.
My Tomcat Server has been enhanced with the TOMEE feature.  
The output that appears in my Cmd Window during Startup would indicate that the deployment was successful..... like so:

.....
.....
Sep 11, 2016 7:41:40 PM org.apache.openejb.assembler.classic.Assembler createApplication
INFO: Deployed Application(path=C:\tomcat7\webapps\ROOT)
Sep 11, 2016 7:41:40 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory C:\tomcat7\webapps\ROOT has finished in 109 ms
Sep 11, 2016 7:41:40 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-apr-8400"]
Sep 11, 2016 7:41:40 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-apr-8009"]
Sep 11, 2016 7:41:40 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 6937 ms
Sep 11, 2016 7:41:50 PM org.apache.openejb.config.ConfigurationFactory configureApplication
INFO: Configuring enterprise application: C:\tomcat7\webapps\EJBProject.jar
Sep 11, 2016 7:41:50 PM org.apache.openejb.config.InitEjbDeployments deploy
INFO: Auto-deploying ejb CalculatorBean: EjbDeployment(deployment-id=CalculatorBean)
Sep 11, 2016 7:41:50 PM org.apache.openejb.config.AppInfoBuilder build
INFO: Enterprise application "C:\tomcat7\webapps\EJBProject.jar" loaded.
Sep 11, 2016 7:41:50 PM org.apache.openejb.assembler.classic.Assembler createAppClassLoader
INFO: Creating dedicated application classloader for EJBProject
Sep 11, 2016 7:41:50 PM org.apache.openejb.assembler.classic.Assembler createApplication
INFO: Assembling app: C:\tomcat7\webapps\EJBProject.jar
Sep 11, 2016 7:41:50 PM org.apache.openejb.assembler.classic.JndiBuilder bind
INFO: Jndi(name=CalculatorBeanLocalBean) --> Ejb(deployment-id=CalculatorBean)
Sep 11, 2016 7:41:50 PM org.apache.openejb.assembler.classic.JndiBuilder bind
INFO: Jndi(name=global/EJBProject/CalculatorBean!org.andyEJB.CalculatorBean) --> Ejb(deployment-id=CalculatorBean)
Sep 11, 2016 7:41:50 PM org.apache.openejb.assembler.classic.JndiBuilder bind
INFO: Jndi(name=global/EJBProject/CalculatorBean) --> Ejb(deployment-id=CalculatorBean)
Sep 11, 2016 7:41:50 PM org.apache.openejb.cdi.CdiBuilder initSingleton
INFO: Existing thread singleton service in SystemInstance(): org.apache.openejb.cdi.ThreadSingletonServiceImpl@1ecf049e
Sep 11, 2016 7:41:50 PM org.apache.openejb.cdi.OpenEJBLifecycle startApplication
INFO: OpenWebBeans Container is starting...
Sep 11, 2016 7:41:50 PM org.apache.webbeans.plugins.PluginLoader startUp
INFO: Adding OpenWebBeansPlugin : [CdiPlugin]
Sep 11, 2016 7:41:50 PM org.apache.webbeans.plugins.PluginLoader startUp
INFO: Adding OpenWebBeansPlugin : [OpenWebBeansJsfPlugin]
Sep 11, 2016 7:41:50 PM org.apache.webbeans.config.BeansDeployer validateInjectionPoints
INFO: All injection points were validated successfully.
Sep 11, 2016 7:41:50 PM org.apache.openejb.cdi.OpenEJBLifecycle startApplication
INFO: OpenWebBeans Container has started, it took 16 ms.
Sep 11, 2016 7:41:50 PM org.apache.openejb.assembler.classic.Assembler startEjbs
INFO: Created Ejb(deployment-id=CalculatorBean, ejb-name=CalculatorBean, container=My Stateless Container)
Sep 11, 2016 7:41:50 PM org.apache.openejb.assembler.classic.Assembler startEjbs
INFO: Started Ejb(deployment-id=CalculatorBean, ejb-name=CalculatorBean, container=My Stateless Container)
Sep 11, 2016 7:41:50 PM org.apache.openejb.assembler.classic.Assembler createApplication
INFO: Deployed Application(path=C:\tomcat7\webapps\EJBProject.jar)

----------------------------------------------
But I see no sign of this EJB when I open the Tomcat Manager and look at the List of deployed Applications.  Is my EJB deployed successfully or not ?
If it is,  why does it not appear in List within the Manager Widow ?

thanks.

 
Saloon Keeper
Posts: 7582
176
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is TomEE's manager app supposed to show EJBs? On Tomcat, the app shows very little information about each app.

Can you use the EJB in your code?
 
Andrew Jerpe
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Good question!  I haven't built the Client code yet. You are right;  it will either work or not-work.  

I hope the EJB responds successfully to the request it will be sent... but even if it DOES work correctly,  I will be disappointed at the lack of a good monitoring mechanism of EJB's in Tomcat. There is no mention of it's presence anywhere in the GUI.   Perhaps I need to study this issue further.

Thanks for the response.
 
Saloon Keeper
Posts: 27752
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The Tomcat management webapps were designed for vanilla Tomcat. Tomcat does not support EJBs.

TomEE is Tomcat plus extensions designed to make it more of a full-stack JEE implementation. Any monitoring features that would permit you to discover information about the additional JEE services - including EJBs would have to come from extensions added to Tomcat to make it TomEE.

So you'll need to look at the documentation for TomEE.
 
Andrew Jerpe
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks.  It turned out that I was using the wrong archetype wen I constructed the POM of my project.  The Maven build created a deployable JAR package; which Tomcat deployed but which was not a  recognizable application.  The correct package-type turned out to be a WAR file.  When you get the packaging right,  it is depicted in the TOMEE GUI  and good things happen.  Thanks again....
 
reply
    Bookmark Topic Watch Topic
  • New Topic