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 200716

Summary: @PostContruct method cannot throw checked exception
Product: javaee Reporter: arungupta <arungupta>
Component: EJBAssignee: Martin Fousek <marfous>
Status: RESOLVED FIXED    
Severity: normal CC: pjiricka
Priority: P3    
Version: 7.0.1   
Hardware: PC   
OS: Other   
Issue Type: DEFECT Exception Reporter:

Description arungupta 2011-08-06 00:12:42 UTC
As per the @PostConstruct javadoc at:

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

The method MUST NOT throw a checked exception.

So the following code should tag an error:

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

    @PostConstruct
    void startup() throws SQLException {
    }
-- cut here --
Comment 1 Martin Fousek 2011-10-12 04:44:42 UTC
Will be fixed together with issue #200715 in next release.
Comment 2 Martin Fousek 2012-04-13 12:22:07 UTC
Done in web-main #acb87914f0bb.