This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JBoss/WildFly and the fly likes @Startup not starting up in JBoss AS 7.1.1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "@Startup not starting up in JBoss AS 7.1.1" Watch "@Startup not starting up in JBoss AS 7.1.1" New topic
Author

@Startup not starting up in JBoss AS 7.1.1

Derrick Williams
Greenhorn

Joined: Nov 27, 2010
Posts: 9
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

Joined: Jul 20, 2005
Posts: 9962
    
163

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.

[My Blog] [JavaRanch Journal]
Derrick Williams
Greenhorn

Joined: Nov 27, 2010
Posts: 9

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:

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: @Startup not starting up in JBoss AS 7.1.1
 
Similar Threads
Extending RequestProcessor
unable to run jsf richfaces fileupload example from "exadel.com"
Deployment in JBoss 7.1.1.Final
Problems to use Console object on Java 6
EJB Timer Services Query