综合编程

The boot pot is not called

微信扫一扫,分享到朋友圈

The boot pot is not called
0

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.ejb.EJB;
import javax.ejb.Stateless;
import javax.ejb.LocalBean;

@Stateless
@LocalBean
@javax.ejb.Startup
public class Startup {
    @EJB
    private ProviderEJB providerEJB;

    @PostConstruct
    public void onStartup() {
        System.err.println("Initialization success.");
    }
}

But the code is not called after I deploy the application. What can cause this?

Try the following set of annotations:

@Singleton
@Startup
public class Startup {
    @EJB
    private ProviderEJB providerEJB;

    @PostConstruct
    public void onStartup() {
        System.err.println("Initialization success.");
    }
}

You will find more details here
and in this book
(chapter 2).

阅读原文...


微信扫一扫,分享到朋友圈

The boot pot is not called
0

Hello, buddy!

Scala 与设计模式(六):Bridge 桥接模式

上一篇

Sign up now to test Nvidia’s GeForce Now game streaming service for crappy laptops

下一篇

评论已经被关闭。

插入图片

热门分类

往期推荐

The boot pot is not called

长按储存图像,分享给朋友