Bug 500823 - hierarchical project presentation not working
Summary: hierarchical project presentation not working
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: IDE (show other bugs)
Version: 4.6   Edit
Hardware: PC Windows 7
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-05 02:39 EDT by Christian Jacob CLA
Modified: 2019-05-27 05:22 EDT (History)
5 users (show)

See Also:


Attachments
A sample Eclipse Neon.2 project demonstrating the issue in this bug (1.73 KB, application/gzip)
2017-01-30 19:40 EST, J James CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Jacob CLA 2016-09-05 02:39:43 EDT
If have a Maven multiple module project and want to have it shown in a hierarchical manner. Therefore, I select "Projects Presentation" --> "Hierarchical". The result is that only the root project and its pom.xml file are shown, but nothing more.


-- Configuration Details --
Product: Eclipse 4.6.0.20160613-1800 (org.eclipse.epp.package.jee.product)
Installed Features:
 org.eclipse.platform 4.6.0.v20160606-1342
Comment 1 J James CLA 2017-01-30 18:58:10 EST
I confirm, and second, this issue.

-- Configuration Details --
Version: Neon.2 Release (4.6.2)
Build id: 20161208-0600
Comment 2 J James CLA 2017-01-30 19:40:44 EST
Created attachment 266524 [details]
A sample Eclipse Neon.2 project demonstrating the issue in this bug
Comment 3 J James CLA 2017-01-30 19:41:13 EST
To reproduce:

1. Untar the attached file bug500823.tar.gz. Notice the directory 'bar'
2. Open a new workspace in Eclipse.
3. Right click in Project Explorer and choose Import > Import > General > Existing Projects Into Workspace
4. Choose the directory 'bar'. Click OK and Finish
5. Go to the downward pointing triangle menu in the Project Explorer, choose Projects Presentation > Hierarchical.

6. Expand bar, then src/main/java, and notice the directories 'foo' and 'foo.foo2'. They are listed on separate lines, but they should be nested: 'foo' as the parent directory for an entry listed as 'foo2'.
Comment 4 Andrey Loskutov CLA 2017-01-31 01:19:54 EST
Any related errors in the error log view?
Comment 5 J James CLA 2017-01-31 12:00:00 EST
If I reopen the sample Eclipse Neon.2 attachment that I added yesterday, I do see an error in Error Log View. It is a single entry that reads:

While loading class "org.eclipse.m2e.jdt.internal.MavenClasspathContainerInitializer", thread "Thread[Worker-3,5,main]" timed out waiting (5106ms) for thread "Thread[Worker-2,5,main]" to finish starting bundle "org.eclipse.m2e.jdt_1.7.0.20160603-1933 [556]". To avoid deadlock, thread "Thread[Worker-3,5,main]" is proceeding but "org.eclipse.m2e.jdt.internal.MavenClasspathContainerInitializer" may not be fully initialized.


HOWEVER, if I recreate the workspace, and the Maven project, select Project Presentation > Hierarchical, and then create the example file structure, the packages are not listed hierarchically, and there is _no error_ in the error log view.

So, the error I see with my previous attachment may not be relevant.


---
---- The following is the detailed error message ----
--


eclipse.buildId=4.6.2.M20161124-1400
java.version=1.8.0_121
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -data /home/jjames/deleteme-workspace2 -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.jee.product

org.eclipse.osgi
Warning
Tue Jan 31 09:44:17 MST 2017
While loading class "org.eclipse.m2e.jdt.internal.MavenClasspathContainerInitializer", thread "Thread[Worker-3,5,main]" timed out waiting (5106ms) for thread "Thread[Worker-2,5,main]" to finish starting bundle "org.eclipse.m2e.jdt_1.7.0.20160603-1933 [556]". To avoid deadlock, thread "Thread[Worker-3,5,main]" is proceeding but "org.eclipse.m2e.jdt.internal.MavenClasspathContainerInitializer" may not be fully initialized.

org.osgi.framework.BundleException: Unable to acquire the state change lock for the module: osgi.identity; type="osgi.bundle"; version:Version="1.7.0.20160603-1933"; osgi.identity="org.eclipse.m2e.jdt"; singleton:="true" [id=556] STARTED [STARTED]
	at org.eclipse.osgi.container.Module.lockStateChange(Module.java:337)
	at org.eclipse.osgi.container.Module.start(Module.java:401)
	at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:470)
	at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:529)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:325)
	at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:345)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:423)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:372)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:364)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:161)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at org.eclipse.osgi.internal.framework.EquinoxBundle.loadClass(EquinoxBundle.java:564)
	at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:174)
	at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)
	at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
	at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
	at org.eclipse.jdt.core.JavaCore.computeClasspathContainerInitializer(JavaCore.java:3471)
	at org.eclipse.jdt.core.JavaCore.getClasspathContainerInitializer(JavaCore.java:3447)
	at org.eclipse.jdt.internal.core.JavaModelManager.initializeContainer(JavaModelManager.java:2920)
	at org.eclipse.jdt.internal.core.JavaModelManager$10.run(JavaModelManager.java:2845)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2240)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2267)
	at org.eclipse.jdt.internal.core.JavaModelManager.initializeAllContainers(JavaModelManager.java:2885)
	at org.eclipse.jdt.internal.core.JavaModelManager.getClasspathContainer(JavaModelManager.java:1965)
	at org.eclipse.jdt.core.JavaCore.initializeAfterLoad(JavaCore.java:4187)
	at org.eclipse.jdt.internal.ui.InitializeAfterLoadJob$RealJob.run(InitializeAfterLoadJob.java:36)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: java.util.concurrent.TimeoutException: Timeout after waiting 5 seconds to acquire the lock.
	at org.eclipse.osgi.container.Module.lockStateChange(Module.java:334)
	... 27 more
Root exception:
java.util.concurrent.TimeoutException: Timeout after waiting 5 seconds to acquire the lock.
	at org.eclipse.osgi.container.Module.lockStateChange(Module.java:334)
	at org.eclipse.osgi.container.Module.start(Module.java:401)
	at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:470)
	at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:529)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:325)
	at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:345)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:423)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:372)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:364)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:161)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at org.eclipse.osgi.internal.framework.EquinoxBundle.loadClass(EquinoxBundle.java:564)
	at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:174)
	at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)
	at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
	at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
	at org.eclipse.jdt.core.JavaCore.computeClasspathContainerInitializer(JavaCore.java:3471)
	at org.eclipse.jdt.core.JavaCore.getClasspathContainerInitializer(JavaCore.java:3447)
	at org.eclipse.jdt.internal.core.JavaModelManager.initializeContainer(JavaModelManager.java:2920)
	at org.eclipse.jdt.internal.core.JavaModelManager$10.run(JavaModelManager.java:2845)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2240)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2267)
	at org.eclipse.jdt.internal.core.JavaModelManager.initializeAllContainers(JavaModelManager.java:2885)
	at org.eclipse.jdt.internal.core.JavaModelManager.getClasspathContainer(JavaModelManager.java:1965)
	at org.eclipse.jdt.core.JavaCore.initializeAfterLoad(JavaCore.java:4187)
	at org.eclipse.jdt.internal.ui.InitializeAfterLoadJob$RealJob.run(InitializeAfterLoadJob.java:36)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Comment 6 Christian Jacob CLA 2017-02-01 02:13:04 EST
The issue seems to occur only with Multi Projects Project with more than one hierarchy Level. A structure

main Project -> Sub

works fine, whereas a structure

main Project -> Sub -> SubSub

has the describet flaws.
Comment 7 J James CLA 2017-02-06 16:57:03 EST
Hi Christian.. The issue is happening even in single, as opposed to multi, project workspaces. 

>HOWEVER, if I recreate the workspace, and the Maven project, select Project 
>Presentation > Hierarchical, and then create the example file structure, the 
>packages are not listed hierarchically, and there is _no error_ in the error log 
>view.

Also the sample project I've attached to this bug contains a single project, and this malfunction occurs.
Comment 8 leokom leokom CLA 2018-10-24 02:31:47 EDT
For me "Project Presentation" -> "Hierarchical" simply does nothing for a multi-module Maven project.
Definitely the feature is not working
Comment 9 John Smith CLA 2019-01-09 14:42:42 EST
If you add parent project and all modules to a working set then the hierarchy is shown.
Comment 10 Thomas Mortagne CLA 2019-05-27 05:13:09 EDT
I have hierarchical presentation issues with Maven too.

The following works fine:
* import -> Existing Maven projects
* select something
a new multimodule Maven project in the workspace.
Comment 11 Thomas Mortagne CLA 2019-05-27 05:22:04 EDT
Sorry bad manipulation sent the previous comment unfinished.

Importing a multimodule project work just fine but when I try to import a sub module that was not previous selected it end up at the root of the workspace instead of replacing the folder.