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 Dev (Build 201304212301) VM: Java HotSpot(TM) 64-Bit Server VM, 23.21-b01, Java(TM) SE Runtime Environment, 1.7.0_21-b11 OS: Windows 7 User Comments: zdenek.rod: I wanted to profile current maven project and it cause this error. Stacktrace: java.lang.IllegalArgumentException: Argument has embedded quote, use the explicit CMD.EXE call. at java.lang.ProcessImpl.isQuoted(ProcessImpl.java:168) at java.lang.ProcessImpl.needsEscaping(ProcessImpl.java:182) at java.lang.ProcessImpl.<init>(ProcessImpl.java:262) at java.lang.ProcessImpl.start(ProcessImpl.java:133) at java.lang.ProcessBuilder.start(ProcessBuilder.java:1023) at org.netbeans.modules.maven.execute.MavenCommandLineExecutor.run(MavenCommandLineExecutor.java:205)
Created attachment 133714 [details] stacktrace
Created attachment 133721 [details] stacktrace right-click on a maven JavaSE project and selected "Profile" this is the command line from the output (some path have been changed due to privacy): cd C:\home\alied\NetBeansProjects\company\router\router-pipeline; JAVA_HOME=C:\\usr\\local\\jdk1.7 M2_HOME=C:\\maven C:\\maven\\bin\\mvn.bat "-Dexec.args=-agentpath:\\\"C:/usr/local/NetBeans 7.3.1 Dev/profiler/lib/deployed/jdk16/windows-amd64/profilerinterface.dll\\\"=\\\"C:\\usr\\local\\NetBeans 7.3.1 Dev\\profiler\\lib\\\",5140,60 -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=C:\\Users\\alied.perez\\AppData\\Local\\NetBeans\\Cache\\7.3.1dev\\mavencachedirs\\65877311\\org-netbeans-modules-profiler -classpath %classpath com.mycompany.company.platform.router.Router" -Dexec.executable=C:\\usr\\local\\jdk1.7\\bin\\java.exe -DskipTests=true -T 1C process-classes org.codehaus.mojo:exec-maven-plugin:1.2.1:exec I haven't yet looked much at this, but I see too many '\'s here
ok, just did a small test: created a symlink NetBeans -> NetBeans 7.3.1 Dev and now the profiler is working. Is this a regression? I remember to have seen this before
so the issue seems to be when there is a space in the Netbeans path. I managed to make a workaround, but I believe this is a priority bug (although this was happening in 7.3 as I recall)
I wonder if this is JDK related? maybe some of the security patches turned this off? In any case I don't see many ways of workarounding it, we are stuffing multiple parameters to JDK into a single maven property that we pass to maven (maven's JDK) to process. if the multiple parameters contain spaces when they need to be escaped. That's what we are doing AFAIK, apparently that's bad now, but not quoting the space in path will just cause the agent not to be found.
Related to this change introduced by Java in 7u21? http://www.oracle.com/technetwork/java/javase/7u21-relnotes-1932873.html#jruntime
Although Netbeans is using ProcessBuilder, it seems to be related to the new changes in JDK7u21 (since both reports use this version) There are some related issues in JDK db[1][2] (see also related bugs) and just found this issue from 2005!![3](is is still valid?): an interesting explanation is in this code review request[4] [1]http://bugs.sun.com/view_bug.do?bug_id=7051946 [2]http://bugs.sun.com/view_bug.do?bug_id=7177083 [3]https://netbeans.org/bugzilla/show_bug.cgi?id=61597 [4]http://mail.openjdk.java.net/pipermail/core-libs-dev/2011-September/007674.html
just for the record, with jdk 1.7_21 I can build a maven project with both the IDE (and it's maven binaries) and java itself in paths with spaces. So the issue is not in how we run maven itself, it's likely in how we pass parameters to maven plugins that process them and spawn another JVM.
I'm able to debug and also profile the main class, with both the jdk and ide having space in path on win 7 professional, 64 bit. The command line looks like this for me (as printed in the output): cd C:\Users\mkleint\src\maven-3\maven-model-builder; "JAVA_HOME=C:\\Program Files\\Java\\jdk1.7.0_21" "\"C:\\Program Files\\NetBeans Dev 201305062300\\java\\maven\\bin\\mvn.bat\"" "-Dexec.args=-agentpath:\\\"C:/Program Files/NetBeans Dev 201305062300/profiler/lib/deployed/jdk16/windows-amd64/profilerinterface.dll\\\"=\\\"C:\\Program Files\\NetBeans Dev 201305062300\\profiler\\lib\\\",5140,10 -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=C:\\Users\\mkleint\\AppData\\Local\\NetBeans\\Cache\\dev\\mavencachedirs\\992689654\\org-netbeans-modules-profiler -classpath %classpath org.apache.maven.model.validation.NewMain" "-Dexec.executable=C:\\Program Files\\Java\\jdk1.7.0_21\\bin\\java.exe" -Dexec.classpathScope=runtime org.codehaus.mojo:exec-maven-plugin:1.2.1:exec
never mind, I can reproduce now, the IDE was using older jdk 1.7 build before. with _21, this always occurs with profile main class but can potentially occur with any other command where a single maven parameter/property is used to set multiple cmd line parameters.
This effectively makes JDK 1.7_u21 unsuable with JavaFX projects on windows since they pass the jfxrt.jar as parameter for the bootclasspath.
JDK bug #8014730 (referenced by this issue) isn't visible to the public (not sure why) but I believe this issue is fixed by JDK bug #8012453. The downside is this issue is marked as fixed in JDK 8 and has not been backported to JDK 7 (though perhaps it will be in the future).
This bug already has 5 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=200171
Created attachment 135088 [details] stacktrace Running the memory profile on a project.
Created attachment 135166 [details] stacktrace I start a simple Java application (main) and pass it a path containing blanks as a parameter. I enclose the path with "" (quotes), which leads to this error. The same works fine if executed from the OS command line
a partial workaround is to keep both netbeans binaries and project sources on paths without spaces..
This bug already has 10 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=200171
Looking at the last comment on http://bugs.sun.com/view_bug.do?bug_id=8014730 isn't the evaluator implying that this is a Maven bug? Did anyone open a corresponding bug report against Maven?
(In reply to comment #18) > Looking at the last comment on http://bugs.sun.com/view_bug.do?bug_id=8014730 > isn't the evaluator implying that this is a Maven bug? AFAIK no, he's implying that we are calling the maven bat file wrongly from netbeans codebase..
note to self: what appears to work on cmd line (win7) is this: cmd /c ""C:\Users\mkleint\space in path\apache-maven-3.0.4\bin\mvn.bat" -Dexec.executable=java -Dexec.args="-jar C:\Users\mkleint\Documents\NetBeansProjects\JavaApplication13\dist\JavaApplication13.jar -Dxx=\"space path\" -Dfoo=bar" exec:exec"" please note the -Dxx=\"space path\" -Dfoo=bar" part. when changed to -Dxx=\"space path\"" it fails. when changed to -Dxx=\"space path\" " (extra space between the quotes), it works.
http://hg.netbeans.org/core-main/rev/b93ec984cbca converted the execution on windows to use cmd /c appears to be working for me for both maven and netbeans with and without space in path, with jdk u17 and u21. both simple builds and profile main class actions. mmirilovic, nebuzelsky: is there still time to backport to beta branch?
http://hg.netbeans.org/releases/rev/d740df48ffc8 also in release74 beta branch now
Integrated into 'releases', will be available in build *201306132201* or newer. Wait for official and publicly available build. Changeset: http://hg.netbeans.org/releases/rev/d740df48ffc8 User: Milos Kleint <mkleint@netbeans.org> Log: #228901 use cmd /c on windows, since u21 embedded quotes don't work otherwise.
Integrated into 'main-golden', will be available in build *201306142301* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/b93ec984cbca User: Milos Kleint <mkleint@netbeans.org> Log: #228901 use cmd /c on windows, since u21 embedded quotes don't work otherwise.
I see that the target for this bug fix is 7.4. Will it ever be ported to 7.3.1? I ran a check for updates and none were available. And the build number for the 7.3.1 Netbeans I have installed is: 201306052037
I am too interested if this will be integrated into 7.3.1. If not, why not?
(In reply to mimkorn from comment #26) > I am too interested if this will be integrated into 7.3.1. If not, why not? because it's working in 7.4 that was released. There's no resources allocated for backporting issue fixes to older versions right now.