File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes Is there any way to initialize a class during EJB Module deployment? 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 "Is there any way to initialize a class during EJB Module deployment?" Watch "Is there any way to initialize a class during EJB Module deployment?" New topic
Author

Is there any way to initialize a class during EJB Module deployment?

Azrael Noor
Ranch Hand

Joined: Jul 29, 2010
Posts: 382
Is there any way to initialize a class during deployment ?

I need to run a process during deployment only so that user intervene not require, when i restart server or so. This is my requirement.

Do you have any procedure to solve it please?



* Admins and Mods i am sorry i asked the question before in Servlets module and i got answer according to that only, but i have to make only EJB module, no web application work here.
So i need to ask question again here.


Regards
Azrael Noor
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9937
    
159

EJB3.1 introduces a @Startup @Singleton which you can use to do that. Are you using EJB3.1?

[My Blog] [JavaRanch Journal]
Azrael Noor
Ranch Hand

Joined: Jul 29, 2010
Posts: 382
No, Jaikarn i am not sing EJB 3.1
i am using EJB 3.0,
Jboss virgin 4.0.1 SP1.

Thank you very much for reply
Azrael Noor
Ranch Hand

Joined: Jul 29, 2010
Posts: 382
1) I used Servlet Context Listener for solving this purpose, made a bean in EJB Module and
while after 5 minutes it will send data to bean and data if recieved then it will insert that time to class. Multithreading is used in servlet.

2) Other methods need one time manual intervention for running a class or jsp or whatever and it was required to run the class during deployment and find no method to do so in ejb-3.0 and jboss4.0

Thank you for you helps
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Is there any way to initialize a class during EJB Module deployment?
 
Similar Threads
eclipse : new module
Why my ejb module is missing?
Is there any way to initialize a class during deployment?
How ejb-ref works, when we have to ejb's deployed on two diffrent machines???
deploying multiple ejb module