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 187094 - rc2 hangs on open maven osgi bundle project
Summary: rc2 hangs on open maven osgi bundle project
Status: RESOLVED INVALID
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 6.x
Hardware: PC Linux
: P3 normal (vote)
Assignee: David Simonek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-02 14:41 UTC by artisan
Modified: 2010-06-04 10:53 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Netbeans trying to open the project (190.63 KB, image/png)
2010-06-02 14:41 UTC, artisan
Details
Thread dump of Netbeans opening the project. The "opening projects" thread is stuck. (26.28 KB, application/octet-stream)
2010-06-02 14:43 UTC, artisan
Details
The project it's trying to open (14.82 KB, application/zip)
2010-06-02 14:46 UTC, artisan
Details
Log after restarting netbeans (29.81 KB, text/x-log)
2010-06-02 14:51 UTC, artisan
Details
Log file when opening the project for the first time (35.54 KB, application/octet-stream)
2010-06-02 14:52 UTC, artisan
Details
Thread dump while netbeans tries to open the malformed project (26.33 KB, application/octet-stream)
2010-06-02 14:54 UTC, artisan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description artisan 2010-06-02 14:41:05 UTC
The release 6.9 RC2 hangs when trying to open a Maven OSGi bundle project. It just sits there, telling it's opening the project. Works with RC1 though.

I'm including the screenshot, threaddump and project. Hope this helps to find the issue.
Comment 1 artisan 2010-06-02 14:41:40 UTC
Created attachment 99761 [details]
Netbeans trying to open the project
Comment 2 artisan 2010-06-02 14:43:18 UTC
Created attachment 99762 [details]
Thread dump of Netbeans opening the project. The "opening projects" thread is stuck.
Comment 3 artisan 2010-06-02 14:46:37 UTC
Created attachment 99763 [details]
The project it's trying to open
Comment 4 artisan 2010-06-02 14:49:03 UTC
After 6 minutes it concludes the project is malformed. Restarting Netbeans shows the project but causes it to get stuck too.
Comment 5 artisan 2010-06-02 14:51:39 UTC
Created attachment 99764 [details]
Log after restarting netbeans
Comment 6 artisan 2010-06-02 14:52:15 UTC
Created attachment 99765 [details]
Log file when opening the project for the first time
Comment 7 artisan 2010-06-02 14:54:16 UTC
Created attachment 99766 [details]
Thread dump while netbeans tries to open the malformed project
Comment 8 Antonin Nebuzelsky 2010-06-03 13:54:03 UTC
Jaro, please help reproducing.
Comment 9 Jaroslav Pospisil 2010-06-03 14:08:03 UTC
Well, I'm unable to reproduce issue on my computer with RC2. I used OSGi bundle project created with tutorial(http://wiki.netbeans.org/Maven_Doc_OSGi_Quickstart) and started IDE with clean userdir.
I've checked the log and it seems to me that this could be caused by using org.apache.maven.wagon dependency (See issue http://netbeans.org/bugzilla/show_bug.cgi?id=177788) and in this case we can do nothing until upgrade to maven3,as Milos mentioned there.
Is it also possible,that VisualVM 1.2.2 tool I see opened on screenshot could somehow interfere with the IDE processes. Reporter,could you please check the scenario with only IDE opened?
Comment 10 artisan 2010-06-04 08:53:03 UTC
Email I sent today
==================

I guess with "Reporter" you mean me. :-)

I just managed to open the project by:

* Wiping the user directory <home>/.netbeans/6.9rc2
* Starting netbeans rc2
* Opening project

It took some time but in the end it I could clean & build and now it's okay.

The only thing I can think of being different is that I imported the settings from 6.9beta. There I've chosen a different maven (2.2.1) and location for the repository. Also, the project I tried to open was different of course. What I included into the bug attachments is the project that is  blocking rc2. I made it with rc1 originally. That might be a cause too.
Comment 11 artisan 2010-06-04 08:59:22 UTC
I've got a comparable issue with an EJB maven project. But this time I can cause it consistently.

1) Clear userdir of rc2
2) Start NB
3) Select in Maven options a Maven 2.2.1 installation.
4) Create project "Maven EJB"
5) Fill in details and press "Finish"

==> Causes the exception. This exception isn't thrown when using the embedded Maven 3. So here you are.

NetBeans: Executing '/u01/app/apache-maven-2.2.1/bin/mvn -DarchetypeVersion=1.0.2 -Darchetype.interactive=false -DgroupId=org.javacraft -DarchetypeArtifactId=ejb-javaee6 -Dversion=1.0-SNAPSHOT -DarchetypeGroupId=org.codehaus.mojo.archetypes -Dbasedir=/home/jan/NetBeansProjects -Dpackage=org.javacraft.kronos -DartifactId=kronos -Dnetbeans.execution=true -Dmaven.repo.local=/u01/m2repo --batch-mode org.apache.maven.plugins:maven-archetype-plugin:2.0-alpha-4:generate'
NetBeans:      JAVA_HOME=/u01/app/jdk
Exception in thread "main" java.lang.NoClassDefFoundError: org/codehaus/classworlds/Launcher
Caused by: java.lang.ClassNotFoundException: org.codehaus.classworlds.Launcher
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: org.codehaus.classworlds.Launcher.  Program will exit.
Comment 12 artisan 2010-06-04 09:32:49 UTC
I confirm the cause: Everything works fine with the embedded Maven. Also after importing all my settings of a previous installation. As long as I'm not using the local 2.2.1 installation.
Comment 13 David Simonek 2010-06-04 09:52:17 UTC
artisan, is your local maven installed correctly? Please try to run "mvn -v" from command line, see 
http://0xf00.org/blog/0xf00/entry/maven_error_java_lang_noclassdeffounderror
Comment 14 David Simonek 2010-06-04 09:56:52 UTC
Indeed it looks like maven installation problem, see following link:
http://www.permeance.com.au/web/terry.mueller/home/-/blogs/maven2-reports-java-lang-noclassdeffounderror:-org-codehaus-classworlds-launcher

So I'm lowering to P3 and awaiting comment from artisan.
Comment 15 artisan 2010-06-04 10:42:29 UTC
*shame*

You are right. Somebody defined the $M2_HOME variable without caring to check whether it points to an existing directory. Or a valid Maven installation for that matter.

Even if in Netbeans you've specified explicitly the location of the maven to be used.

I'm really sorry. Because I could open the project as is in RC1 I was assuming this was related to RC2.
Comment 16 David Simonek 2010-06-04 10:53:07 UTC
No problem, glad to hear that issue is solved.