Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

@Startup not starting up in JBoss AS 7.1.1

 
Derrick Williams
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys-

I am using JBoss AS 7.1.1 and would like to have a function execute when my EAR file starts up, to do some housekeeping and initialization and so on. From what I've been reading, this code should work:



I am expecting the message "Starting Up!" to display on the console, but this doesn't happen.

I do see this line in the console:

02:15:36,101 INFO [org.jboss.seam.Component] (MSC service thread 1-1) Component: orders, scope: APPLICATION, type: SINGLETON_SESSION_BEAN, class: com.innitech.insitu.OrdersEngine, JNDI: java:app/insitu-ejb/OrdersEngine


I don't know if there's any setting or library I need to configure. I am using JBoss Developer Studio Version: 6.0.0.GA.

Any hints appreciated!

-Derrick

 
Jaikiran Pai
Marshal
Pie
Posts: 10444
227
IntelliJ IDE Ubuntu
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
import org.jboss.seam.annotations.Startup;
import org.jboss.seam.annotations.intercept.PostConstruct;


Those are wrong imports. You need the javax.ejb.Startup and javax.annotation.PostConstruct.
 
Derrick Williams
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi Jaikrain-

Thanks for the help! I guess that'll teach me to just pick a random import header from the pick list in Eclipse when typing in examples.

Just for completion, here is the working code:

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic