This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 200715

Summary: Only one @PostConstruct permitted in an EJB
Product: javaee Reporter: arungupta <arungupta>
Component: EJBAssignee: Martin Fousek <marfous>
Status: RESOLVED FIXED    
Severity: normal CC: pjiricka
Priority: P3    
Version: 7.0.1   
Hardware: All   
OS: Other   
Issue Type: DEFECT Exception Reporter:

Description arungupta 2011-08-06 00:10:04 UTC
@javax.annotation.PostConstruct javadoc at:

http://download.oracle.com/javaee/6/api/javax/annotation/PostConstruct.html

says

Only one method can be annotated with this annotation. 

In that case, the following code:

-- cut here --
@Singleton
public class NewSessionBean {

    @PostConstruct
    void startup2() {
        
    }
    
    @PostConstruct
    void startup() throws SQLException {
-- cut here --

should show tag an error.
Comment 1 Martin Fousek 2011-10-06 09:30:22 UTC
Thanks a lot for reporting that, it's really good idea for new hint in the EJB area.

However I set the target milestone to Next since it will not be probably enough of time for doing that still for this release.
Comment 2 Martin Fousek 2012-04-13 12:22:16 UTC
Done in web-main #acb87914f0bb.
Comment 3 Quality Engineering 2012-04-14 09:43:50 UTC
Integrated into 'main-golden', will be available in build *201204140400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/acb87914f0bb
User: Martin Fousek <marfous@netbeans.org>
Log: #200715 - Only one @PostConstruct permitted in an EJB + #200716