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.
Build: NetBeans IDE 7.3 (Build 201305291404) VM: Java HotSpot(TM) 64-Bit Server VM, 23.25-b01, Java(TM) SE Runtime Environment, 1.7.0_25-b13 OS: Linux User Comments: jkovalsky: Installed full 7.3 distro as root, ran as user on JDK 7 Update 25 64b, activated JavaSE, updated to Patch 1, updated to 7.3.1 and opened Maven based UnitTestingExample project from issue #230464. Tried to create TestNG tests on "second" Java package but nothing happened not counting this NPE.. Stacktrace: java.lang.NullPointerException at org.netbeans.modules.testng.actions.TestNGTestCreatorProvider.createTests(TestNGTestCreatorProvider.java:129) at org.netbeans.modules.gsf.testrunner.TestCreatorAction.performAction(TestCreatorAction.java:138) at org.openide.util.actions.NodeAction$DelegateAction$1.run(NodeAction.java:586) at org.openide.util.actions.ActionInvoker$1.run(ActionInvoker.java:95) at org.openide.util.actions.ActionInvoker.doPerformAction(ActionInvoker.java:116) at org.openide.util.actions.ActionInvoker.invokeAction(ActionInvoker.java:99)
Created attachment 135135 [details] stacktrace
Reproducible. Cannot create any TestNG tests in a Maven based Java project if IDE was installed as root and run as user. JUnit and Ant based projects work fine. Increasing priority.
I have also found out that this is a regression caused by 7.3.1. It does not happen in NetBeans 7.3 only after I updated the IDE.
Fanis, please evaluate ASAP.
Product Version: NetBeans IDE 7.3 (Build 201305301707) Java: 1.7.0_21; Java HotSpot(TM) 64-Bit Server VM 23.21-b01 Runtime: Java(TM) SE Runtime Environment 1.7.0_21-b11 System: Linux version 3.5.0-30-generic running on amd64; UTF-8; en_US (nb) User directory: /tmp/230529 Cache directory: /tmp/230529/var/cache 1) installed 7.3 as root (got installed in /usr/local) 2) started it as user with clean userdir 3) did all the offered updates 4) updated to 7.3.1 5) opened maven j2se project 6) tried to create the TestNG test => got created OK 7) did some more updates from 7.3.1 (due to activation of java support from opening the project) 8) removed the test classes and dependency from the project 9) tried to create the TestNG test again => got created OK so not reproducible for me. Did I miss some step?
I used different jdk version. I will test also with u25 and report back.
Also please install the IDE into your user's home directory, not root's one. I am trying to reproduce this on today's build. Stay tuned as well.
Good news. I was NOT able to reproduce it on: Product Version: NetBeans IDE 7.3.1 (Build 201305301707) Java: 1.7.0_25; Java HotSpot(TM) 64-Bit Server VM 23.25-b01 Runtime: Java(TM) SE Runtime Environment 1.7.0_25-b13 System: Linux version 3.0.0-12-generic running on amd64; UTF-8; cs_CZ (nb) User directory: /home/cesilko/.netbeans/7.3.1 Cache directory: /home/cesilko/.cache/netbeans/7.3.1 So the only difference from my yesterday's work is the cumbersome update scenario. Will try to reproduce it once again with every detail recorded...
OK, so here is the full scenario reproducing the problem. I am Linux Mint 12 if it matters. 0. Become root (su). 1. Launch full 7.3 distro installer (netbeans-7.3-linux.sh) 2. Disable installation of GlassFish but enable JUnit installation. 3. Set destination to /home/cesilko/netbeans-7.3 and use /home/cesilko/Java/jdk1.7.0_25_64b. 4. Disable check for updates and install the IDE. 5. As user launch NetBeans 7.3, ignore import of 7.2.1 settings and go to "Tools > Plugins". 6. On "Installed" tab activate "Java SE" cluster. 7. Update all suggested 17 modules on "Updates" tab and restart the IDE. 8. Go to "Tools > Plugins" again. Disable "Certified Plugins" and "Plugin Portal" update centers on "Settings" tab. 9. Change URL of "NetBeans Distribution" update center to http://dlc.sun.com.edgesuite.net/netbeans/updates/7.3/uc/final/distribution/catalog_stage.xml.gz 10. Update all suggested 20 modules on "Updates" tab and restart the IDE. 11. Invoke "File > New Project..." from main menu. 12. Select "Maven" category, "Java Application" project type and push "Next >" and then "Finish" buttons. 13. Cancel "Enable CVS Support" dialog. 14. Right click "Source Packages" and invoke "New > Java Package" from popup menu. 15. Confirm creation of the package by "Finish" button. 16. Right click "Source Packages | newpackage" and invoke "New > Java Class" from popup menu. 17. Confirm creation of the class by "Finish" button. 18. Right click "Source Packages | newpackage" and invoke "Tools > Create Tests" from popup menu. 19. Select "TestNG" framework in "Create Tests" dialog and push "OK" button. 20. The NPE is thrown and no test is created.
I followed some more scenarios to narrow down the cause. 1) installed 7.3, followed steps from comment 9 => NPE 2) installed 7.3, followed steps from comment 9 but did not update to patch1 => NPE 3) installed 7.3 j2se, followed steps from comment 9 => No exception So it seems to be a problem with ergonomics. re-assigning
Tried steps from comment 9 and after activating java support both ant/maven testng support is activated. After updating to patch 2 maven testng support is deactivated and this is why we get the NPE. After activating maven testng support from the plugins dialog there is no NPE
NPE is likely caused by findTestNGSupport returning null. findTestNGSupport seeks for TestNGSupportImplementation in Lookup and as far as Lahváč is aware there are three implementations: http://lahoda.info/index/ui/implements?type=CLASS:org.netbeans.modules.testng.spi.TestNGSupportImplementation For our purposes the Maven one is important. However when I look at ~/nbuserdir73/config/Modules$ cat org-netbeans-modules-testng-maven.xml <!DOCTYPE module PUBLIC "-//NetBeans//DTD Module Status 1.0//EN" "http://www.netbeans.org/dtds/module-status-1_0.dtd"> <module name="org.netbeans.modules.testng.maven"> <param name="autoload">false</param> <param name="eager">false</param> <param name="enabled">false</param> <param name="jar">modules/org-netbeans-modules-testng-maven.jar</param> <param name="reloadable">false</param> </module> I can see the module is disabled. I see no connection with ergonomics - it is up to owner of TestNG to find out why. PS: I am surprised a of this kind is not eager or autoload providing org.netbeans.modules.testng.spi.TestNGSupportImplementation token which some other module would request.
I cannot reproduce today using the installation from Friday and following the steps from comment 9. Things I noticed: After step 6 everything under Java SE/Testing Tools categories in plugins dialog were activated. After step 10 when ide restarts only Ant,Java, Java Profiler from Java SE category and Ant TestNG Support from Testing Tools category are activated. After step 11 everything under Java SE/Testing Tools categories in plugins dialog are activated which leads to no NPE thrown Jirko can you still reproduce? Thank you
Going to try this out right away. Don't hang up...
Yes, I am able to reproduce the exception with today's content of the live [1] and staged [2] Update Centers. [1] http://dlc.sun.com.edgesuite.net/netbeans/updates/7.3/uc/final/distribution/catalog.xml.gz [2] http://dlc.sun.com.edgesuite.net/netbeans/updates/7.3/uc/final/distribution/catalog_stage.xml.gz
(In reply to comment #12) > I can see the module is disabled. I see no connection with ergonomics - it is > up to owner of TestNG to find out why. Jarda, can you help Fanis with the evaluation? Why is the module disabled after the restart when it was enabled before? Isn't this caused by feature-off functionality of ergonomics?
Further evaluation has revealed that ide-ergonomics.nbm which is a part of the patch 2 includes config.xml which turns off the testng.maven module. Reassigning back to ergonomics for further investigation.
(In reply to comment #17) > Further evaluation has revealed that ide-ergonomics.nbm which is a part of the > patch 2 includes config.xml which turns off the testng.maven module. > Reassigning back to ergonomics for further investigation. OK. That explains why the module is disabled. On the other hand it does not explain why we are getting NPE in such case. If the code is not ready for testng.maven module being enabled, it should recover from the NPE somehow. My favorite fix is: diff -r ce962b7ce537 testng.maven/nbproject/project.properties --- a/testng.maven/nbproject/project.properties Thu May 30 16:25:42 2013 +0200 +++ b/testng.maven/nbproject/project.properties Mon Jun 03 16:55:45 2013 +0200 @@ -49,3 +49,5 @@ javac.compilerargs=-Xlint -Xlint:-serial nbm.homepage=http://wiki.netbeans.org/TestNG nbm.module.author=Lukas Jungmann +is.eager=true + after rebuilding testng.maven and ide.ergonomics and inserting ide.ergonomics into 7.3 branch, I managed to create the TestNG test without problems.
I was curious why this bug manifests only with Maven+TestNg, but not Ant+TestNg. Well, is not that because asymetric dependencies in java.kit? $ grep java.kit/testng nbproject/* nbproject/project.xml: <code-name-base>org.netbeans.modules.testng</code-name-base> nbproject/project.xml: <code-name-base>org.netbeans.modules.testng.ant</code-name-base> Should not there also be a dependency on testng.maven (until it is made an eager module)?
Fixed in release73 branch:http://hg.netbeans.org/releases/rev/71ab440fef09 and also in trunk:http://hg.netbeans.org/core-main/rev/2379497b1cd7 as per suggestion from comment 19
Product Version: NetBeans IDE 7.3 (Build 201306052037) Updates: NetBeans IDE is updated to version NetBeans 7.3 Patch 2 Java: 1.7.0_25; Java HotSpot(TM) 64-Bit Server VM 23.25-b01 Runtime: Java(TM) SE Runtime Environment 1.7.0_25-b13 System: Linux version 3.0.0-12-generic running on amd64; UTF-8; cs_CZ (nb) User directory: /home/cesilko/.netbeans/7.3 Cache directory: /home/cesilko/.cache/netbeans/7.3 Excellent. I am happy to announce that the fix has been successful and no java.lang.NullPointerException is being thrown now after the 7.3 > 7.3 Patch 1 > 7.3 Patch 2 update. TestNG tests were created so I take the liberty of closing this issue as VERIFIED. Thanks Jardo & Theofanis!