This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes Passing runtime parameters to EJB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Passing runtime parameters to EJB" Watch "Passing runtime parameters to EJB" New topic
Author

Passing runtime parameters to EJB

Douglas Kent
Ranch Hand

Joined: Oct 06, 2000
Posts: 171
Hello,
I need to pass some parameters to my stateless session EJB (mail server info) at creation. Have looked in the associated deployment descriptors (ejb-jar.xml, etc) and see that there is no extensibility there. Anyone have any ideas about how to do this?
Steve Chernyak
Ranch Hand

Joined: Oct 19, 2000
Posts: 113
We use properties files
Marcos Maia
Ranch Hand

Joined: Jan 06, 2001
Posts: 977
Hi,
you can use from the ejb-jar.xml dd:

then from your implementation:

regards.
[ June 14, 2002: Message edited by: Marcos Maia ]
seshu kumar
Greenhorn

Joined: Jun 13, 2002
Posts: 23
One Problem with setting these in the descriptor as env entries is, that it might be necessary to redeploy the app in the appserver(for changes).
(Unless of course the Appserver allows you to edit the descriptor while the App is running.
I worked on iPlanet and it requires a redeploy.
I think weblogic allows you to edit descriptors through admin console.Correct me If I'm wrong!
)
Properties file seems to be more easier to manage.
Marcos Maia
Ranch Hand

Joined: Jan 06, 2001
Posts: 977
Originally posted by seshu kumar:
One Problem with setting these in the descriptor as env entries is, that it might be necessary to redeploy the app in the appserver(for changes).
(Unless of course the Appserver allows you to edit the descriptor while the App is running.
I worked on iPlanet and it requires a redeploy.
I think weblogic allows you to edit descriptors through admin console.Correct me If I'm wrong!
)
Properties file seems to be more easier to manage.


Hi,
Yes, you�re wrigth about WebLogic 6x, you can edit the dd through the admin console.
Malli Raman
Ranch Hand

Joined: Nov 07, 2001
Posts: 312
Is it possible to pass runtime properties for a servlet.
Regards,
Raman.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15639
    
  15

Originally posted by Malli Subramanian Raman:
[QB]Is it possible to pass runtime properties for a servlet.

If it wasn't, Struts wouldn't work.
Both properties files and the web.xml file are available, in addition to the runtime environmental sources such as JNDI.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Passing runtime parameters to EJB
 
Similar Threads
ejbCreate()
reference and value
JAXB with JAX-RPC1.1+ EJB
EJBObject * Serializable
Does the EJBObject act as a skeleton?