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.
I have probably found one regression between 8.0.0 patch 2 version and 8.0.1 RC1. When I tried to debug main file in 8.0.1, I got ClassNotFoundException. I investigated what was wrong and it seems that there is a problem with classpath which Netbeans sends to maven exec plugin. It works correctly for "default config" but not for profiles. In our case the pom.xml contains profiles that add some additional dependencies. I checked classpath variable via debugger and for Netbeans 8.0.0 I could see that classpath contained all dependencies,with 8.0.1 I could see only "default" dependencies. Environment : Windows 7 64,JDK 7 update 67, Maven 3.2.2
It works fine for me on attached project using the same environment, hope I've created it correctly. Could you please attach your sample project? Thank you.
Created attachment 148577 [details] Sample project
It seems that attached project is empty. Could you resend it?
I checked output one more time and I can see that when I build project the command line contains : cd C:\projects\servio-ng\application\trunk\servio-ui-app; "JAVA_HOME=C:\\Program Files\\Java\\jdk1.7.0_67" M2_HOME=C:\\java\\apache-maven-3.2.2 cmd /c "\"\"C:\\java\\apache-maven-3.2.2\\bin\\mvn.bat\" -Dmaven.ext.class.path=\"C:\\java\\NetBeans 8.0.1 RC1\\java\\maven-nblib\\netbeans-eventspy.jar\" -Dfile.encoding=UTF-8 -PJetty-test install\"" but when I debug main function in test classes I can see this : NetBeans: JPDA Listening Start... JPDA Address: xxx:64031 Port:64031 cd C:\projects\servio-ng\application\trunk\servio-ui-app; "JAVA_HOME=C:\\Program Files\\Java\\jdk1.7.0_67" M2_HOME=C:\\java\\apache-maven-3.2.2 cmd /c "\"\"C:\\java\\apache-maven-3.2.2\\bin\\mvn.bat\" -Dexec.args=\"-XX:MaxPermSize=512m -Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=64031 -classpath %classpath sk.posam.servio.ui.ServioUiJettyServer\" -Dexec.executable=java -Dexec.classpathScope=test -Djpda.listen=true -Djpda.address=64031 -Dmaven.ext.class.path=\"C:\\java\\NetBeans 8.0.1 RC1\\java\\maven-nblib\\netbeans-eventspy.jar\" -Dfile.encoding=UTF-8 process-classes org.codehaus.mojo:exec-maven-plugin:1.2.1:exec\"" Scanning for projects... main difference is missing "-PJetty-test" so I suppose it is a reason for ClassNotFoundException. Any idea what is wrong? Something in my environment?
Sorry for that, resending.
Created attachment 148584 [details] Sample project
But as I understand you've added -PJetty-test install parameter manually? I think it has nothing to do with our problem. As far as I know Jetty is some servlet container for running maven web projects. You probably do something with classpath using Project Properties->Actions->select_your_Configuration->in_Actions_select_Debug_project->and you change exec args or whatever. Check please project properties classpath settings or attach your sample project in order I can investigate it. Thank you.
I found out what is wrong. I have created test project which contains similar setup as I have in my big project which I cannot send to you. Unfortunately this new project has worked correctly under 8.0.0 and also 8.0.1. So I compared differences between them and found out that test doesn't contain file "nbactions.xml". When I removed this file, everything was working. So, with this file, 8.0.1 has a problem, 8.0.1. has not.
Created attachment 148590 [details] Sample test project
Ok in this case closing as INVALID for now.
The same situation happens (wrong classpath based on default profile) when I set some properties for VM for default profile. (in background nbactions.xml file will be generated). For example, you can try to add "-Xmx1024" for "debug main file" action for default profile and after it try to debug main file and check the classpath. From my point of view it is serious regression and it should be fixed before final release of 8.0.1.
You mean probably to add -Xmx1024m, otherwise you get: Error occurred during initialization of VM, Too small initial heap. What is exactly wrong with the classpath or what do you have on your cp?
When file nbactions.xml exists then classpath contains dependencies from "default" profile even if I have set "Jetty-test" profile. Dependencies from Jetty-test are missing. Result is that during debugging main file I get ClassNotFoundException, in this case for example "Exception in thread "main" java.lang.ClassNotFoundException: org.eclipse.jetty.jmx.ConnectorServer". As you can see when Netbeans sets wrong maven profile (argument -PJetty-test is missing), you cannot debug any main file which is executed via maven-exec-plugin. How to reproduce this problem : 1) Open my test project 2) Add some argument to "default" profile for example "-Xmx1024m". Check if netbeans creates "nbactions.xml" 3) Set Jetty-test profile and execute "clean and build" (I don't use Compile on Save). 4) Try to debug main file JettyServer.java - I can see an exception during this step. In command line you can see missing "-PJetty-test"
I can see you're right. Appears as a regression.
Caused by changeset: http://hg.netbeans.org/main-silver/rev/db0646a1dc55
I need steps to reproduce. I did: $ unzip https://netbeans.org/bugzilla/attachment.cgi?id=148590 # open the project in NetBeans # but I can see nbactions.xml and nbactions-Jetty-test.xml # so I don't know what to change in configuration, etc. when I choose Jetty-test configuration. Select JettyServer. Choose Debug Test file, I see the right profile specified on the command line: $ mvn -Dtest=test.JettyServer -DforkMode=once "-Dmaven.surefire.debug=-Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=58445" -Djpda.listen=true -Djpda.address=58445 -PJetty-test test-compile surefire:testo
@Jarda: Are you using 8.0.1 RC1?
I am using custom build from release801
Steps to reproduce: 1) Download, extract and open in 8.0.1 RC1 Sample test project 2) Open test.JettyServer class file 3) Select Jetty-test profile 4) Right click and select Debug file.
OK, when I follow the describe steps and use "Debug File" instead of "Debug Test File", I see following in the output window: NetBeans: JPDA Listening Start... JPDA Address: logouticek:51789 Port:51789 cd /home/tmp/246300/test; JAVA_HOME=/usr/lib/jvm/java-8-oracle /netbeans/java/maven/bin/mvn "-Dexec.args=-XX:MaxPermSize=512m -Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=51789 -classpath %classpath test.JettyServer" -Dexec.executable=java -Dexec.classpathScope=test -Djpda.listen=true -Djpda.address=51789 process-classes org.codehaus.mojo:exec-maven-plugin:1.2.1:exec e.g. there is no profile specified.
changeset: 7f2892307f6b tag: tip parent: 703ecc6b7c50 user: Jaroslav Tulach <jtulach@netbeans.org> date: Mon Aug 11 14:05:06 2014 +0200 summary: #246300: Use fallback only if there is <profiles> section in the nbactions.xml file Martine, could you verify my fix? I can backport it when it is found to be sane.
http://hg.netbeans.org/ergonomics/rev/7f2892307f6b
Thank you Jarda, it works ok now, closing as VERIFIED.
+1 for 8.0.1 if considered safe
Appears in 8.0.1.
The ergonomics build was broken after my change (an accidental change in Maven module API). Had to bump spec version: http://hg.netbeans.org/ergonomics/rev/be5829d289ac Hopefully that is not required for release801 branch.
Integrated into 'releases/release801', will be available in build *201408122300* or newer. Wait for official and publicly available build. Changeset: http://hg.netbeans.org/releases/rev/c43e1eea7ac7 User: Martin Kozeny <mkozeny@netbeans.org> Log: #246300: Wrong classpath when profile is activated.
Integrated into 'main-silver', will be available in build *201408140001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/7f2892307f6b User: Jaroslav Tulach <jtulach@netbeans.org> Log: #246300: Use fallback only if there is <profiles> section in the nbactions.xml file