• 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 3.0 with JBoss 5.1

 
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I am new to EJB and JBoss.I am trying to develop a very simple EJB 3.0 stateless calculator bean which I have done upto this.I have one remote interface "Calculator.java" a stateless bean class "CalculatorBean.java".I have successfully compiled these and packaged in a jar file and kept it in "JBOSS_HOME\server\default\deploy" dir.Now I have one "Client.java" which is a console program having main method.I have created "InitialContext" object then doing lookup with "CalculatorBean/remote".It also compiled successfully but while running it gives "NoInitialContextException" and saying Need to specify class name in environment or system property or in an application resource file.I am not using any tool like maven or ant or any IDE.Please tell me the way to deploy an ejb in JBoss and accessing it from a client.

Thanks,
Arka
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Arka, welcome to JavaRanch!

This FAQ will help you get past the error. Also have a look at the EJB3 tutorials here
 
Arka Sharma
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Actually this is my first time that I'm writing EJB.Can you send me some link to some documents or something where there will be step by step process to deploy an EJB and then access business method from client.Perhaps I'm making some mistake.One more thing how to get a jndi name in jboss for a particular bean ?
 
Arka Sharma
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


I followed the steps there and I got this

Buildfile: C:\Program Files\eclipse\plugins\org.eclipse.jst.server.generic.jboss_1.6.1.v200904151730\buildfiles\jboss323.xml
deploy.j2ee.web:
[jar] Building jar: E:\wrokspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\JSPServlet.war
[move] Moving 1 file to C:\jboss-5.0.1.GA\server\default\deploy

BUILD FAILED
C:\Program Files\eclipse\plugins\org.eclipse.jst.server.generic.jboss_1.6.1.v200904151730\buildfiles\jboss323.xml:12: Unable to remove existing file C:\jboss-5.0.1.GA\server\default\deploy\JSPServlet.war

Total time: 188 milliseconds
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This sounds like JBoss AS is already running and has the war file opened. Stop the app server first, and then start it again after the build.
 
They gave me pumpkin ice cream. It was not pumpkin pie ice cream. Wiping my tongue on this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic