Bug 26240 - Create Process is limited to 1010 caracters string only.
Summary: Create Process is limited to 1010 caracters string only.
Status: RESOLVED INVALID
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Ant (show other bugs)
Version: 2.0.2   Edit
Hardware: PC Windows 2000
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Platform-Ant-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: core
Depends on:
Blocks:
 
Reported: 2002-11-14 03:46 EST by Cyrille Lebec CLA
Modified: 2004-12-02 10:07 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Cyrille Lebec CLA 2002-11-14 03:46:59 EST
in a ANT build.xml file I first generate javadoc before assembling the .war. 
But as the process try to create the command for javadoc I get the exception 
listed below:
The create process system seems to be limited to 1010 caraters string only.. 
and my javadoc commands needs more.
Can you help me on this ?

--- Nested Exception ---
java.io.IOException: CreateProcess: javadoc -d 
C:\local\java\eclipse\workspace\public\docs\api -public -use -splitindex -
windowtitle "XXXX | site public" -doctitle "XXXX | site public" -bottom "C 
2002" -classpath C:\resin\resin-2.1.6\lib\dom.jar;C:\resin\resin-2.1.6
\lib\jaxp.jar;C:\resin\resin-2.1.6\lib\jdbc-mysql.jar;C:\resin\resin-2.1.6
\lib\jdbc2_0-stdext.jar;C:\resin\resin-2.1.6\lib\jmx.jar;C:\resin\resin-2.1.6
\lib\jndi.jar;C:\resin\resin-2.1.6\lib\jsdk23.jar;C:\resin\resin-2.1.6\lib\jta-
spec1_0_1.jar;C:\resin\resin-2.1.6\lib\resin.jar;C:\resin\resin-2.1.6
\lib\sax.jar;C:\resin\resin-2.1.6
\lib\webutil.jar;C:\local\java\eclipse\workspace\public\WEB-
INF\classes;C:\local\java\eclipse\workspace\public\WEB-
INF\lib\XXXXComon.jar;C:\local\java\eclipse\workspace\public\WEB-
INF\lib\XSpace.jar;C:\local\java\eclipse\workspace\public\WEB-
INF\lib\agentxxxx.jar;C:\local\java\eclipse\workspace\public\WEB-
INF\lib\snmp.jar;C:\local\java\eclipse\workspace\public\WEB-
INF\lib\subagentxxxx.jar -sourcepath C:\local\java\eclipse\workspace\public\WEB-
?
	at java.lang.Win32Process.create(Native Method)
	at java.lang.Win32Process.<init>(Win32Process.java:63)
	at java.lang.Runtime.execInternal(Native Method)
	at java.lang.Runtime.exec(Runtime.java:550)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:324)
	at org.apache.tools.ant.taskdefs.Execute$Java13CommandLauncher.exec
(Execute.java:564)
	at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:384)
	at org.apache.tools.ant.taskdefs.Javadoc.execute(Javadoc.java:964)
	at org.apache.tools.ant.Task.perform(Task.java:217)
	at org.apache.tools.ant.Target.execute(Target.java:184)
	at org.apache.tools.ant.Target.performTasks(Target.java:202)
	at org.apache.tools.ant.Project.executeTarget(Project.java:601)
	at org.apache.tools.ant.Project.executeTargets(Project.java:560)
	at org.eclipse.ant.internal.core.ant.InternalAntRunner.run
(InternalAntRunner.java:262)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:324)
	at org.eclipse.ant.core.AntRunner.run(AntRunner.java:233)
	at org.eclipse.ui.externaltools.internal.core.AntFileRunner.execute
(AntFileRunner.java:59)
	at 
org.eclipse.ui.externaltools.internal.core.DefaultRunnerContext.executeRunner
(DefaultRunnerContext.java:413)
	at org.eclipse.ui.externaltools.internal.core.DefaultRunnerContext.run
(DefaultRunnerContext.java:464)
	at org.eclipse.ui.externaltools.internal.ui.AntLaunchWizard$1.run
(AntLaunchWizard.java:117)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run
(ModalContext.java:98)
Comment 1 Darin Wright CLA 2002-11-14 08:56:09 EST
Does this work if you run Ant from the command line (i.e. not within Eclipse)?
Comment 2 Cyrille Lebec CLA 2002-11-14 10:18:12 EST
Yes it does ... as i run on my build.xml outside of eclipse.
Comment 3 Darin Wright CLA 2002-11-15 21:28:54 EST
Needs investigation
Comment 4 Jared Burns CLA 2003-02-20 13:17:50 EST
Cannot reproduce on Linux or Win2000. Here are the steps I tried:
1. Create the following ant build file:
<project name="grah" default="blah">
  <target name="blah">
    <echo message="${myProp}"/>
  </target>
</project>
2. Created an Ant launch config with the argument:
  -DmyProp=<a 2,000 character long string>
3. Run the config.
4. The 2,000 character long string is correctly output.

This seems to indicate that long strings aren't a problem for the runtime
exec. I don't see anything in your stack trace indicating that there's a
problem with the length of the string. It's likely that Java just trims the
length of the string when it reports the stack trace. Is there any other
reason to believe that the string is being trimmed to 1010 characters?
Comment 5 Jared Burns CLA 2003-02-20 14:40:16 EST
D'oh. I just noticed that this bug is listed as 2.0.2. Cyrille, have you tried
Eclipse 2.1? Do you get the same problem in the latest integration build?
Comment 6 Jared Burns CLA 2003-02-28 14:16:32 EST
Cannot reproduce and no response from the reporter. Closing.
Comment 7 Ralph Brown CLA 2004-10-19 11:15:47 EDT
I am seeing the same problem associated with ANT.  Here is a portion of my 
output:

BUILD FAILED
C:\RetailDirect\build.xml:103: java.io.IOException: CreateProcess: 
C:\j2sdk1.4.1_02\jre\bin\java.exe -classpath C:\j2sdk1.4.1_02
\jre\lib\ext\dnsns.jar;...[LONG PATH HERE]...;C:\j2sdk1.4.1_02\jre?

The ? character marks the 1010th character of the command.

I have found elsewhere that a similar problem existed with the <javadoc/> task 
in ANT and it can be resolved by adding this to the task:  useexternalfile="yes"

Is there a similar fix for this?
Comment 8 Ralph Brown CLA 2004-10-19 11:52:11 EDT
Similar problem here:  http://forums.bea.com/bea/thread.jspa?
threadID=200060432&start=-1&f#202428357
Comment 9 shefbel CLA 2004-12-02 10:07:04 EST
I have faced with the same problem while compiling big project and looked 
through the ant tasks implementation for different tools. It looks like this is 
a common problem and small redesign for passing parameters is required.

Here is the link to MS documentation:
http://support.microsoft.com/default.aspx?scid=kb;en-us;830473
-=start=-
Command prompt (Cmd. exe) command-line string limitation
[skipped..]

How to work around the limitation
To work around the limitation, use one or more of the following methods (as 
appropriate to your situation): 
Modify programs that require long command lines so that they use a file that 
contains the parameter information, and then include the name of the file in 
the command line.

For example, instead of using the ExecutableFile.exe Parameter1 
Parameter2 ...ParameterN command line in a batch file, modify the program to 
use a command line that is similar to the following command line, where 
ParameterFile is a file that contains the required parameters (parameter1 
parameter2 ...ParameterN):
ExecutableFile.exe c:\temp\ParameterFile.txt 
-=end=-

Best Regards,
Victor.