Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes EJB and other Java EE Technologies and the fly likes where should I put ejb-jar.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "where should I put ejb-jar.xml" Watch "where should I put ejb-jar.xml" New topic
Author

where should I put ejb-jar.xml

Goran Markovic
Ranch Hand

Joined: Sep 26, 2008
Posts: 399
Hi. I cannot find out where to place ejb-jar.xml file. I want to use it to inject some resource (String, int), but my application then won't to deploy.
I put ejb-jar.xml file into top level of my-ejb.jar file:

my-ejb.jar
|
|
|-----ejb-jar.xml
|------com.test.SomeBeans



I was try to inject resource like this in MDB :

and this ejb-jar.xml:


or if I try this way in stateless bean:

and ejb-jar.xml :


or if I put ejb-jar.xml file into META-INF/ejb-jar.xml, I get the same result. The EAR application, won't deploy!
So what and where I should put???
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 32481
    
214

It's supposed to go in META-INF/ejb-jar.xml. Is that your full ejb-jar.xml? It's supposed to have a line on top of that which declares the schema.


[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Goran Markovic
Ranch Hand

Joined: Sep 26, 2008
Posts: 399
Thanks Jeanne, my mistake (I was pretty much exhausted) and oversight two ejb element in my DD. it is works now. Thanks
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: where should I put ejb-jar.xml
 
It's not a secret anymore!