Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8596145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T00:36:24+00:00 2026-06-12T00:36:24+00:00

I had a scenario in which I needed one bean (ReportManager) to be loaded

  • 0

I had a scenario in which I needed one bean (ReportManager) to be loaded at application startup, so it can schedule reports for execution (polled from database by DataStore bean).

Googling around I found @Singleton, @Startup and @DependsOn annotations, which I’ve used like this:

@Singleton
@Startup
@DependsOn("DataStore")
public class ReportManager {
    @EJB
    DataStore dataStore;

    @PostConstruct
    public void scheduleReports() {
       logger.log("INITIALIZED");
       List<Report> reports = dataStore.getReports();
       ....
    }
}

@Singleton
@RolesAllowed("user") //I had security checks implemented like that beforehand
public class DataStore {
    @PostConstruct
    public void initialize() {
        logger.log("INITIALIZED");
    }

    public List<Report> getReports() {
        ...
    }
}

The problem was that I was getting really strange exception during deployment time:

<2012-09-27 14:04:15 CEST> <Warning> <Deployer> <BEA-149004> <Failures were detected while initiating deploy task for application "app".>
<2012-09-27 14:04:15 CEST> <Warning> <Deployer> <BEA-149078> <Stack trace for message 149004
weblogic.application.ModuleException: Exception starting module: EJBModule(app-ejb-1.0-SNAPSHOT.jar)

Unable to deploy EJB: ReportManager from app-ejb-1.0-SNAPSHOT.jar:

Singleton ReportManager(Application: app, EJBComponent: app-ejb-1.0-SNAPSHOT.jar) failed to initialize.

   at weblogic.ejb.container.deployer.EJBModule.start(EJBModule.java:592)
 .....

Caused By: weblogic.ejb.container.InternalException: Transaction marked rollback or not expected transaction status: 1
   at weblogic.ejb.container.manager.SingletonSessionManager.postCallback(SingletonSessionManager.java:464)

Not really heplful exception message. Especially that I was also not getting any “INITIALIZED” log entries. When I commented out the dataStore.getReports() invocation everything was working fine and beans were constructed in proper order (“INITIALIZED” messages were produced). Including dataStore method invocation was causing above error and was somehow supressing all the log output.

I am using Weblogic 12c.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T00:36:26+00:00Added an answer on June 12, 2026 at 12:36 am

    Finally I’ve figured out what was causing the error. It was the @RolesAllowed declaration which was blocking method invocation due to the empty security context, not set in @PostConstruct method when executed in @Startup bean (From EJB 3.1 spec, ch. 4.3.4: The PostConstruct lifecycle callback interceptor methods execute in an unspecified security context.).

    What was needed to make it work was just the addition of @PermitAll to the invoked method:

    @PermitAll
    public List<Report> getReports() {
       ...
    }
    

    The error was so misleasing I’ve decided to put this case here, as I couldn’t google the answer.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I ran into a scenario where I had a delegate callback which could occur
I came across a scenario where I had to use Union all, how can
Had a good read through similar topics but I can't quite a) find one
Here's the scenario: I have a multi threaded java web application which is running
here's my first! quick rundown: SCENARIO i'm creating an app in which you can
I'm having a scenario where I had to deploy multiple directories for different languages.
Had a good search here but can't see anything that gets my mind in
Had this working; at one stage. The problem is the following text is now
I had an array which contained lines of a file that I had to
I have had a template for some time which wrappers a C library FILE*.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.