Startup bean not called

前端 未结 4 1578
情深已故
情深已故 2021-02-09 21:00

I created a Java Web Application Project in NetBeans, and created a startup bean in it:

package malibu.util;

import javax.annotation.PostConstruct;
import javax         


        
4条回答
  •  广开言路
    2021-02-09 21:28

    The Startup annotation is for usage with Singleton beans, not with stateless beans. See the javadoc.

    Also, @LocalBean is not needed in this case. This declares that you want an additional no-interface view, but this is only needed if the bean implements a remote or local business interface. If you omit it you get a no-interface view by default.

提交回复
热议问题