• 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

Starting Headfirst EJB... Quick compile question

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay, I'm starting Headfirst EJB... when I compile the first sample (chap 1 pg30). The javac compiler complains. It appears I would need to reference a j2ee.jar???

I get the following error on compile:

package javax.ejb does not exist.
import javax.ejb.EJBObject

Is there a seperate javac for j2ee? Do I need to reference an exernal jar (i.e. j2ee.jar)?

Thanks in advance.

 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Joshua,
Welcome to JavaRanch!

That jar comes with your applications server. What are you using, JBoss? In other words, what did you install to run the example.
 
Joshua Ostrom
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jeanne Boyarsky wrote:Joshua,
Welcome to JavaRanch!

That jar comes with your applications server. What are you using, JBoss? In other words, what did you install to run the example.



I'm using the Sun App server. I did resolve this btw, I needed to include C:\Sun\AppServer\lib\j2ee.jar on my classpath. So simple fix.

Thanks for the feedback!
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I also just started HeadFirst EJB and after reading chapter 2, i thought of accessing the stub/skeleton classes for the Advice application discussed in chapter 1.
I was getting some error while running RI server, so now I am using Sun Java™ System Application Server Platform Edition 8.2 to run the examples. (Though I think SJSAS is the enhanced version of RI, and after that there is GlassFish, correct me if I am wrong)
While deploying the EJB I selected to generate the Client Jar for the Advice application.
Now, this client jar should contain stub also right, apart from interfaces.
I first deployed (using deploytool) after creating the enterprise bean, and then I again deployed after creating the Client.
Here is the content of that AdviceAppClient.jar.

>jar -tvf AdviceAppClient.jar
182 Wed Sep 16 05:53:28 IST 2009 Advice.class
960 Wed Sep 16 05:53:28 IST 2009 AdviceBean.class
203 Wed Sep 16 05:53:28 IST 2009 AdviceHome.class
194 Wed Sep 16 05:53:28 IST 2009 META-INF/sun-j2ee-ri.project
1186 Wed Sep 16 05:53:28 IST 2009 ejb-jar-ic.jar
851 Wed Sep 16 05:53:28 IST 2009 AdviceClient.class
1056 Wed Sep 16 05:53:28 IST 2009 app-client-ic.jar
173 Wed Sep 16 05:53:28 IST 2009 META-INF/MANIFEST.MF
477 Wed Sep 16 05:53:28 IST 2009 META-INF/application.xml
354 Wed Sep 16 05:53:28 IST 2009 META-INF/sun-application.xml

My doubts are:
1. How AdviceBean.class comes into this jar. It should not right?
2. Where are the stubs?

I searched on google abit about it, which says that now AS can create stubs/skeleton dynamically.
Is my server also doing the same or I am missing something?
Thanks in advance.

 
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
"Lk Kl"

Please click on the "My Private Messages" link on top of this page, for a message from JavaRanch.
reply
    Bookmark Topic Watch Topic
  • New Topic