Community
Participate
Working Groups
To reproduce this, import an ear with a J2EE Application Client module in it (with source). The import works fine by putting the Java files at the right location. However, in the J2EE and Java perspectives, the Project Explorer only shows the default package although there are more packages present in the project (visible in Resource view). You can take a look at my screen captures. There are currently no workaround other than restarting the workbench, then the missing packages show up.
Created attachment 45398 [details] J2EE view only shows default package
Created attachment 45399 [details] More package present in the project (in Resource view)
What build was this on?
WTP 1.5 RC5-200606161055
Can you confirm if your environment has the "Empty Packages" and "Empty Parent Packages" filters enabled? If so, does disabling them bring the subpackages back?
By default, the Empty parent packages is enabled (with checkmark). I tried disabling both but it does not show those packages.
This issue was originally observed on the Project Explorer, but the problem is rooted somewhere in the JavaModel. In the scenario, a project is imported that creates a JDT Type directly (the Main.java class for the AppClient project), and then some other *.java files are created under the same folder. The existence of these folders is noted in the Resource Navigator, so I know the IResourceDelta events must be generated, but the Package Explorer doesn't respond to update the JavaElementInfo objects. Closing and reopening the project causes the necessary refresh. Moving to JDT/UI for further investigation. I will attach the test case to this defect.
Created attachment 46044 [details] Import this *.ear file in a WTP environment. Notice the Package Explorer doesn't render the packages under testAppClient
Is there any chance that this will be fixed for 3.2.1? Most people won't realize that they have to restart and as an Eclipse adopter our testers are getting confused by this.
Martin -- can you comment on the possibility of this making it into 3.2.1?
Kicking this up a notch to garner some attention.
reproduced in WTP 1.5. - it seems the Java model missed an update. The classes 'Hello' and 'Hello2' are not contained in the Java element tree, but found by search engine - when I tried first, all elements correctly showed up. On the second try I got the result as described above. Moving to jdt.core
Would it be possible to get this into Eclipse 3.2.1?
Debugging this test case shows that method doExecute(IProgressMonitor, IAdaptable) from org.eclipse.jst.j2ee.internal.common.operations.NewJavaClassOperation create the Main.java file which populate JavaModel before than org.eclipse.jdt.internal.core.DeltaProcessor receive event of IProject creation through resourceChanged(IResourceChangeEvent). Michael, I'm not really a specialist of this code and Jerome is currently in vacation. However, I've made a test with a simple java project or a jar file import and our DeltaProcessor first receives the IResourceChangeEvent and updates the java model. It seems that this order is necessary as otherwise, java model is wrongly initialized with no children in sourde folder appClientModule... So, it sounds like there's something wrong in resources creation on your side. If you think jst.j2ee behavior is correct while importing, could you explain me the reason? Thanks
The scenario from a JDT Core point of view is as follows. In an IWorkspaceRunnable: 1. A Java project is created 2. IJavaProject#findType(...) is used (this populates the model's cache, and the pkg fragment root is cached with 1 child: the default package) 3. A new package is added 4. At the end of the IWorkspaceRunnable, the resource delta contains only the project addition (which is valid). The DeltaProcessor should close the IJavaProject when it finds it is added as it does for other elements.
Created attachment 48299 [details] Proposed fix aginst R3_2_maintenance branch
+1 for addressing in 3.2.1
Jerome -- thanks for taking care of this issue for 3.2.1!
Has the patch for this defect made it into the 3.2.1 mainstream? if it has in what built level. Thank you
Sorry it is not in the 3.2.1 stream yet. This needs to be thoroughly tested first. We will indicate in this bug report when it is commited.
Released for 3.2.1 in R3_2_maintenance stream. Test case added in JavaProjectTests#testBug148859()
Verified for 3.2.1 using build M20060908-1655. This needs to be released in HEAD as well.
Released for 3.3 M2 in HEAD stream
Verified for 3.3 M2 using build I20060918-0010.