• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

@Startup not starting up in JBoss AS 7.1.1

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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:

 
reply
    Bookmark Topic Watch Topic
  • New Topic