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 239267 - @PostContruct method cannot throw checked exception
Summary: @PostContruct method cannot throw checked exception
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: EJB (show other bugs)
Version: 8.0
Hardware: All All
: P3 normal (vote)
Assignee: Martin Fousek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-09 13:39 UTC by Martin Janicek
Modified: 2013-12-10 12:40 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Particular patch (3.61 KB, patch)
2013-12-09 13:40 UTC, Martin Janicek
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Janicek 2013-12-09 13:39:39 UTC
Closely related to the issue 200716. In some cases (project's) the hint implemented as a fix for the issue 200716 does not work (nothing is shown even if the method has checked exception in it's declaration).

Application I'm talking about is located in [1], project name "services", class "ServiceConfiguration", method "setupStorage".

I have been debugging the problem for some time and fix few particular issues, but at the end HintsUtils.createEJBProblemContext(..) is trying to create instance of EJBProblemContext and it need instance of Ejb class. But for some reason this variable is not always find by "findByEjbClass" method and if it's null the hint is not shown. I stopped evaluation at this point..

I'm going to attach my particular patch.


[1] https://github.com/joshlong/the-spring-rest-stack
Comment 1 Martin Janicek 2013-12-09 13:40:50 UTC
Created attachment 142971 [details]
Particular patch
Comment 2 Martin Fousek 2013-12-10 12:24:54 UTC
Thank you Martin for the partial patch. Finally I applied only the maven part since changes in J2eeProjectCapabilities didn't behave in the same way as before - I got some failures in tests then.

The issue was in detection such hints only in session beans. The "findByEjbClass" method was resolving whether the class is SB/EB/MDB and in this case it wasn't issue since all classes are some Spring ones.

In any case thanks for pointing to this issue because I discovered more issues there. It should be fixed in web-main #b92156a79644 where are also completed unit tests against this hint. BTW, it also led to another issue #239303.
Comment 3 Martin Fousek 2013-12-10 12:40:42 UTC
Sorry, finally web-main #3434fb316220.