| Summary: | ClassCastException when trying to open EJB reference | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [WebTools] WTP Java EE Tools | Reporter: | Kaloyan Raev <kaloyan> | ||||||||||
| Component: | jst.j2ee | Assignee: | Dimitar Giormov <dimitar.giormov> | ||||||||||
| Status: | RESOLVED FIXED | QA Contact: | Chuck Bridgham <cbridgha> | ||||||||||
| Severity: | normal | ||||||||||||
| Priority: | P2 | CC: | ccc, david_williams, dimitar.giormov, vladislav.iliev | ||||||||||
| Version: | 3.2 | Flags: | david_williams:
pmc_approved+
dimitar.giormov: pmc_approved? (raghunathan.srinivasan) dimitar.giormov: pmc_approved? (naci.dai) dimitar.giormov: pmc_approved? (deboer) dimitar.giormov: pmc_approved? (neil.hauge) dimitar.giormov: pmc_approved? (kaloyan) cbridgha: review+ |
||||||||||
| Target Milestone: | 3.2.3 | ||||||||||||
| Hardware: | PC | ||||||||||||
| OS: | Windows Vista | ||||||||||||
| Whiteboard: | PMC_approved | ||||||||||||
| Attachments: |
|
||||||||||||
This is a regression from WTP 3.2.0. It was caused by bug 260705 Created attachment 186716 [details]
Patch
This is a proposal for a patch.
Please check it.
Vladislav, can you rework a little bit the patch. 1. Purely cosmetic, but remove the commented out code. 2. In the code you are checking for existing Resource reference, but in the list with Ejb references. (patch line 320) Created attachment 186809 [details]
Patch
Second version of the previously proposed patch.
Created attachment 186819 [details]
cleaned up commented code + backup plan for application client project.
approve Dear PMC members, This bug causes the eclipse to open error dialog on double click in the case where a EJB reference is selected in Dynamic Web Project. The correct behavior is to open the class where the reference is defined using annotation, or to open the web.xml There is a workaround: find the reference you will need manually - search in the classes or the web.xml or both. The fix is tested manually. Chuck has reviewed the change. Risk: Low Technical details: The fix differentiates the ejb and web projects and artifacts and applies the same logic for both: 1. Check if the reference comes from xml if true opens the appropriate xml file, if false checks in which class the reference is defined and opens this class. Note: this bug did not have 'PMC' in whiteboard, so has not shown up on review list and has gone unnoticed ... until Carl's watchful eye. I've update the whiteboard and will approve so (hopefully) Carl can release for our RC2. Committed to R3_2_maintenance for WTP 3.2.3 RC2 |
Created attachment 177985 [details] exception Reproducible on latest 3.2.2 and 3.3 builds. Steps to reproduce: 1. Create new Web 2.5 project. 2. Create new EJB 3.0 project. 3. Create new EAR 5 project and include the Web and EJB project created above. 4. Create new Session Bean in the EJB project. 5. Create new Servlet in the Web project. 6. Create a reference in the Servlet to the Session Bean - using @EJB in the Java code. 7. Expand the DD tree of the Web project > References. 8. Double-click on the reference. The following ClassCastException is thrown: org.eclipse.jst.javaee.web.internal.impl.WebAppImpl cannot be cast to org.eclipse.jst.javaee.ejb.EJBJar Full exception log is attached.