0

I am a little new to J2EE. I have a EJB3 project and I want to run a class on application start-up, how can I do that?

I know in EJB3.1 I can use @startup and @singleton unfortunately that is not a option and I have to use EJb3 and java 5. I have done some research and there were a few solutions but I have been unable to make it work.

Vitaliy
  • 8,044
  • 7
  • 38
  • 66
  • This may help http://docs.oracle.com/javaee/5/api/javax/servlet/ServletContextListener.html#contextInitialized%28javax.servlet.ServletContextEvent%29 – Henry May 08 '14 at 22:03

2 Answers2

0

WebSphere Application Server version 6.1 does not support EJB3 with a standard installation. You also need to have a feature pack for EJB 3.0 installed.

See this information on the IBM site.

If this is not your issue you should update your question with more detail of what goes wrong.

DanielBarbarian
  • 5,093
  • 12
  • 35
  • 44
0

Your only options prior to WebSphere 8 (with EJB 3.1 support) are:

  • WebSphere startup beans. These are a programming model extension
  • Package a WAR with the application, and use a ServletContextListener to initialize state used by the EJBs.
Brett Kail
  • 33,593
  • 2
  • 85
  • 90