This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 222651 - Exception when adding a JAR in EAR Library Directory
Summary: Exception when adding a JAR in EAR Library Directory
Status: CLOSED FIXED
Alias: None
Product: WTP Java EE Tools
Classification: WebTools
Component: jst.j2ee (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.0 M6   Edit
Assignee: Stefan Dimov CLA
QA Contact: Chuck Bridgham CLA
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2008-03-13 15:48 EDT by Kaloyan Raev CLA
Modified: 2008-05-29 12:56 EDT (History)
0 users

See Also:


Attachments
Fix for the glitch found in the new "packed-in-lib-dir bundled libs" feature (2.35 KB, patch)
2008-03-13 19:10 EDT, Stefan Dimov CLA
bjorn.freeman-benson: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kaloyan Raev CLA 2008-03-13 15:48:23 EDT
Build: I20080313113126

Steps to reproduce:
1. Start in clean workspace. 
2. Create an EJB 3.0 project. 
3. Create an EAR 5.0 project that includes the EJB 3.0 module. 
4. Create a Java project. 
5. Right-click EAR 5 project > Properties > J2EE Module Dependencies. 
6. Click the check box that is in the cell of "In Lib Dir" column and Java project's row. 

An exception is logged in the Error Log:
java.lang.ClassCastException: org.eclipse.core.internal.resources.Project cannot be cast to org.eclipse.wst.common.componentcore.resources.IVirtualComponent
	at org.eclipse.jst.j2ee.internal.AddModulestoEARPropertiesPage$3.checkStateChanged(AddModulestoEARPropertiesPage.java:788)
	at org.eclipse.jst.j2ee.internal.ui.DoubleCheckboxTableItem$1.widgetSelected(DoubleCheckboxTableItem.java:82)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:227)
Comment 1 Kaloyan Raev CLA 2008-03-13 15:49:52 EDT
Stefan, please have a look. 

The build can be taken from here:
http://build.eclipse.org/webtools/committers/wtp-R3.0-I/20080313113126/I-I20080313113126-20080313113126/ 

When creating the project have in mind the workaround described in bug 222638. 
Comment 2 Stefan Dimov CLA 2008-03-13 19:10:46 EDT
Created attachment 92525 [details]
Fix for the glitch found in the new "packed-in-lib-dir bundled libs" feature

I've located the glitch found by Kaloyan and provided a patch for it.

Best wishes!
S.
Comment 3 Kaloyan Raev CLA 2008-03-24 06:43:00 EDT
Thanks for the patch. Dropped to HEAD. 
Comment 4 Kaloyan Raev CLA 2008-04-07 07:05:57 EDT
Verified with S-3.0M6-20080404175400
Comment 5 David Williams CLA 2008-04-24 00:44:28 EDT
mass change to add 'contributed' keyword based on bugzilla query, please correct if that's not accurate (by marking patches as obsolete and removing the 'contributed' keyword. 
Comment 6 Kaloyan Raev CLA 2008-05-29 12:56:44 EDT
Closing