Ticket #127 (closed defect: wontfix)

Opened 11 months ago

Last modified 3 months ago

"Command line too long" error on start-up, Windows 2000

Reported by: fcohen Assigned to: fcohen@pushtotest.com
Priority: minor Milestone:
Version: 5.1 Keywords:
Cc:

Description (Last modified by fcohen)

I just came across your TestMaker product and - since it might be a useful tool for the problem I'm working on - downloaded it to have a look. Unfortunately, the TestMaker.bat file fails on my Windows 2000 computer with message "command line too long". The underlying cause is described here: http://support.microsoft.com/default.aspx?scid=kb;en-us;830473

I was not able to come up with a simple workaround (but the reason might be, that I'm not that technical). Neither did I find anything in your FAQs, issue tracker or users mailing list (didn't find a way to search through the latter). Am I the first one to run into this?

Thanks for your help!

Tobias

Frank Cohen wrote:

Here is the workaround:

I copied a cmd.exe from WinXP to c:\winnt\system32\ with the name cmd_XP.exe. So I opened a command window using that file (Start - Run - cmd_XP.exe) and ran TestMaker.bat successfully (well, after I got my JAVA_HOME environment variable set to what it needed to be).

-Frank

Change History

08/21/07 21:24:29 changed by fcohen

Dear Tobias: Thank you for your interest in PushToTest TestMaker. We encountered the "command line too long" error a while ago. (http://cake.pushtotest.com/pipermail/users/2006-July/002995.html) We solved the problem by simplifying the TestMaker.bat script for TestMaker 4.1.

We are no longer validating TestMaker releases against Windows 2000 but we would be glad if you were to experiment with the TestMaker.bat file to find a solution.

I will also post this to the users@lists.pushtotest.com emai list to see if there are people in the community. You can sign-up at http://lists.pushtotest.com/mailman/listinfo/users.

-Frank

08/24/07 11:24:43 changed by fcohen

  • priority changed from trivial to major.

08/24/07 11:34:05 changed by fcohen

Simon Tuffs wrote:

I got a chance to play with Testmaker 5 briefly tonight. The installation went smootly, I installed the 1.6 JRE since I was at 1.5, and I want to experiment with the new scripting languages.

I had the usual trouble with getting Testmaker to start, finally stumbling on "set JAVA_HOME=c:\program files\java\jre1.6.0_01 without" any quotes as the mojo to make the TestMaker.bat script start properly. This is always ugly stuff, using .bat launchers. That's why I wrote one-jar: Frank knows about it, he might want to look into using it for future releases since it avoids a lot of that messy scripting.

08/24/07 11:35:00 changed by fcohen

OneJar? is found at http://one-jar.sourceforge.net. It is a good concept. We need to confirm it would work in the TestMaker environment. -Frank

11/04/07 11:51:33 changed by fcohen

  • priority changed from major to critical.

11/04/07 17:30:28 changed by fcohen

I did a little research on this. Windows 2000 requires the command line to call TestMaker to be less than 2048 characters long. I tried putting all of the jar files into one directory (so no directories-within-directories.) At its most compact, the classpath to all these jars is 2097 characters long. A different solution is needed. Perhaps we should tell the class loader of the jar files in the main.java at startup?

Here is the one directory classpath, fyi: /TestMaker.jar:./soapui-1.7.5.jar:./activation-1.1.jar:./javamail-1.4.jar:./wsdl4j-1.6.2.jar:./log4j-1.2.8.jar:./looks-2.1.2.jar:./forms-1.0.7.jar:./commons-logging-1.0.4.jar:./not-yet-commons-ssl-0.3.7.jar:./commons-cli-1.0.jar:./commons-beanutils-1.7.0.jar:./swingx-SNAPSHOT.jar:./l2fprod-common-fontchooser-0.2-dev.jar:./commons-codec-1.3.jar:./groovy-all-1.0.jar:./jetty-6.1.1.jar:./jetty-util-6.1.1.jar:./servlet-api-2.5-6.1.1.jar:./xbean-2.2.0.jar:./xbean_xpath-2.2.0.jar:./soapui/xmlpublic-2.2.0.jar:./jsr173_1.0_api-xmlbeans-2.2.0.jar:./soapui-xmlbeans-1.7.jar:./soap-xmlbeans-1.2.jar:./j2ee-xmlbeans-1.4.jar:./ext-xmlbeans-1.0.jar:./saxonb-8.6.1.jar:./saxonb-dom-8.6.1.jar:./xmlunit-1.0.jar:./xmlsec-1.2.1.jar:./xalan-2.7.0.jar:./wss4j-1.5.0.jar:./bcprov-jdk15-133.jar:./commons-httpclient-3.0.1-soapui.jar:./httpunit.jar:./js.jar:./nekohtml.jar:./TestGen.jar:./servlet.jar:./Tidy.jar:./velocity-1.3.jar:./xercesImpl.jar:./xmlParserAPIs.jar:./junit-3.8.1.jar:./htmlunit-1.13.jar:./commons-httpclient-3.0.1.jar:./commons-codec-1.3.jar:./commons-collections-3.2.jar:./commons-io-1.3.jar:./commons-lang-2.2.jar:./commons-logging-1.1.jar:./jaxen-1.1.jar:./js-1.6R5.jar:./xercesImpl-2.6.2.jar:./xmlParserAPIs-2.6.2.jar:./jython/jython.jar:./browseropen_utils.jar:./j.jar:./jCookie.jar:./jaxen-core.jar:./jaxen-jdom.jar:./jcommon-1.0.0.jar:./jdom.jar:./jfreechart-1.0.1.jar:./jnumeric-0.1a3.jar:./kawa-1.7.90.jar:./log4j-1.2.13.jar:./looks-1.2.2.jar:./maxq.jar:./soap.jar:./swing-layout-1.0.jar:./tagsoup-1.0rc3.jar:./tool.jar:./weather.jar:./wsdl4j.jar:./xmlrpc-1.1.jar:./PTTMonitorClient.jar:./sinetfactory.jar:./AbsoluteLayout.jar:./jaxr-api.jar:./jaxr-impl.jar:./mysql-connector.jar:./jtds-1.2.2.jar:./stringtemplate.jar:./antlr-2.7.7.jar:./jaxb-api.jar:./jaxb-impl.jar:./jaxb-libs.jar:./kxml2.jar:./xmlpull.jar:./dom.jar:./sax.jar:./xalan.jar:./xercesImpl.jar:./jaxp-api.jar:./activation-1.1.jar:./commons-beanutils.jar:./commons-collections.jar:./commons-digester.jar:./commons-logging.jar:./jaas.jar:./jax-qname.jar:./jta-spec1_0_1.jar:./namespace.jar:./relaxngDatatype.jar:./xsdlib.jar:./TestNetworkClient.jar:./dom4j.jar:./jaxm-api.jar:./jaxm-runtime.jar:./saaj-api.jar:./saaj-impl.jar:./axis.jar:./axis-schema.jar:./commons-discovery-0.2.jar:./commons-logging-1.0.4.jar:./jaxrpc.jar:./log4j-1.2.8.jar:./saaj.jar:./wsdl4j-1.5.1.jar:./build/bsh-engine.jar:./beanshell/lib/bsh-2.0b5.jar:./browserjs-engine.jar:./freemarker-engine.jar:./groovy-engine.jar:./groovy-1.0.jar:./jacl-engine.jar:./jaskell-engine.jar:./java-engine.jar:./jawk-engine.jar:./jelly-engine.jar:./jep-engine.jar:./jexl-engine.jar:./jruby-engine.jar:./asm-2.2.3.jar:./asm-commons-2.2.3.jar:./backport-util-concurrent.jar:./jruby.jar:./judo-engine.jar:./juel-engine.jar:./jython-engine.jar:./jython.jar:./ognl-engine.jar:./pnuts-jsr223.jar:./scheme-engine.jar:./script-api.jar:./sleep-engine.jar:./velocity-engine.jar:./xpath-engine.jar:./xslt-engine.jar

-Frank

11/05/07 20:51:42 changed by fcohen

I wrote to Simon Tuffs, author of OneJar?:

Hi Simon:

I'm working on http://bugs.pushtotest.com/ticket/127 for TestMaker 5.1. I have not yet tried OneJar? and will do so next.

Is there a clean way to dynamically change the System ClassLoader? to recognize new jar files at runtime? I would like to start-up TM with a minimal classpath and then add all of the needed jars to the classpath. That would let me offer TM users a Swing GUI to manage jars (something that helps a lot with technical support.)

There is some discussion of doing this at: http://forum.java.sun.com/thread.jspa?threadID=759542&messageID=4337079

What do you think?

-Frank

Simon wrote back to me:

Yes, this should be possible using a URLClassLoader. One-jar now supports the extension of the class-path through a system-property (one-jar.class.path) as described here: http://one-jar.sourceforge.net/index.php?page=documents&file=whatsnew As long as your TestMaker code is loaded as a lib or main jar in one-jar, you can add new codebases on startup and they will be resolved by your code.

If you want to extend the classpath after application startup you would have to find a way of calling addURL() on this class-loader to add new repositories.

Simon.

11/06/07 06:35:01 changed by fcohen

Simon wrote:

Hi Frank:

I read the ticket, I think you're on the right track now. In order to manipulate the JarClassLoader?.externalClassLoader from inside your application you will need to rebuild the one-jar-boot.jar: you will also have to add a method to JarClassLoader? to allow you to call addURL() on it, since the member is protected. Make sure to synchronize the method. You'll have to rebuild one-jar-boot-0.96.jar, and the ant taskdef one-jar-ant-task-0.96.jar (assuming you want to use it to build TestMaker). This is all supported by the build.xml script.

Then, you can add calls to ((JarClassLoader?)Boot.getClassLoader()).addURL(<your-url-here>) to extend the classpath. Once you one-jar your application it should be able to dynamically augment the list of codebases.

Simon.

11/09/07 22:56:24 changed by fcohen

  • version changed from 5 to 5.1.

11/10/07 10:33:35 changed by fcohen

  • owner set to fcohen@pushtotest.com.

11/17/07 23:58:09 changed by fcohen

  • priority changed from critical to minor.

I'm ready to give up on this. I spent 3 hours reworking the classpath construction in TestMaker.sh and .bat. I don't see being able to get the classpath down to 2048 characters. It looks like I have another 3 hours to go. So for now I am putting this on hold. This means TestMaker 5.1 is compatible with Windows XP, Windows 2003 Server, Windows Vista, and not compatible with Windows 2000 or NT.

-Frank

11/27/07 23:04:53 changed by fcohen

  • status changed from new to closed.
  • resolution set to wontfix.

12/12/07 07:21:36 changed by fcohen

Mike Collins came up with a simple workaround to solve this problem at http://cake.pushtotest.com/pipermail/users/2007-November/003466.html. In summary:

I tried to install TestMaker on Windows 2000. No entry was made in the Start - Programs list, so I read here to just run TestMaker.bat. When I tried to run TestMaker.bat, it didn't seem to do anything (just flashed and went away). So I opened a command window (Start - Run - cmd.exe) to see what the error message was. I ran TestMaker.bat again, and saw that the error message was “The input line is too long”. --

Googling on that message, I found out that Windows 2000 has a maximum batch file line length of 2048 characters. Windows XP has a max of 8192. So I copied a cmd.exe from WinXP to c:\winnt\system32\ with the name cmd_XP.exe. So I opened a command window using that file (Start - Run - cmd_XP.exe) and ran TestMaker.bat successfully (well, after I got my JAVA_HOME environment variable set to what it needed to be).

--

Thank you, Mike!

-Frank

01/20/08 00:34:01 changed by fcohen

  • description changed.

04/16/08 07:35:31 changed by fcohen

To download the cmd.exe file use the following URL:

http://downloads.pushtotest.com/cmd.exe

-Frank