Announcement Announcement Module
Collapse
No announcement yet.
init-method needs an argument initialized Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • init-method needs an argument initialized

    I have a class with init method tht need to be called as soon as it is instantiated .The init method requires an argument to be initialized but when i create a bean and deploy the application it gives null pointer exception

    Code:
    Timer timer;
    ....
    init_method()
    {
         timer.schedule( this , new Date(), 1000 );
    }
    
    
    //bean definition
    
    <bean id="watcher" class="data.impl.PGWatcher" init-method="init_method">
    here this is an implementaion of sub-class of TimerTask

  • #2
    Wat is the sequence in bean creation

    Init method called first or parameters initialized first

    Comment


    • #3
      Originally posted by vishalj View Post
      Wat is the sequence in bean creation

      Init method called first or parameters initialized first
      3.5.1.1. Initialization callbacks:

      ...allows a bean to perform initialization work after all necessary properties on the bean have been set by the container

      Comment


      • #4
        Thanks it solved my problem

        Comment

        Working...
        X