The input line is too long. The syntax of the command is incorrect.

I am a prentice on J2EE by using the Tutorial 1.4.

I keep getting this error message: "The input line is too long. The syntax of the command is incorrect." from the windows's terminal no matter what arguments I issued for the commandasantright after I successfully executed command "asant build" under the directory of both<Install>\j2eetutorial14\examples\web\bookstore andbookstore1 when I practice the topic ofThe Example Servlets onChapter 11: Java Servlet Technology.

The command and the arguments are:

asant create-db_common

asant create-bookstore-war

asant package-bookstore

asant deploy-war

All of them have the same outcome:

"The input line is too long.

The syntax of the command is incorrect."

I have tried to do the research on the google and ased some Java developer friends and school teachers; unfortunately, none of them can solve this problem.

The OS I am using iswin2k professional. The commands were issued onDOS terminal. I have successfully builtapplication server, and pointbase, deploy tool. I have utilize this tools and environment to run all theexamples very well onChapter 8: Building Web Services with JAX-RPC.

Even worse, after failing on running theServlets Examples, I got the same error message when I go back to theChapter 8's Examples and run the command "asant build" on the directory<install>\j2eetutorial14\examples\jaxrpc\staticstub.

TheServer andPointBase were activated when I issued those commands.

Can someone or the Tutorial's authors kindly help? Thank you very much!

[1780 byte] By [sundewrainbowa] at [2007-10-2 5:37:53]
# 1

I checked the log from admin console and found this error message that was Severe:

A "com.sun.enterprise.tools.guiframework.exception.FrameworkError" was caught. The message from the exception: "Unable to get View for viewDescriptor 'webApplications'"

The root cause is "com.sun.enterprise.admin.common.exception.MBeanConfigException: Component not registered"

See the HTML source for more detailed (stack trace) information.

sundewrainbowa at 2007-7-16 1:48:21 > top of Java-index,Enterprise & Remote Computing,AVK Portability...
# 2

The answer is in the FAQ you access from the Tutorial. If you access the :"I have problems compiling the examples using asant

." entry, it takes you to the following link:

http://java.sun.com/j2ee/1.4/docs/tutorial/information/faq.html#compile

The fourth bullet says:

You get a Syntax Error when running asant

on Windows 2000.

There is a bug in asant.bat

that results in a Syntax Error in Windows 2000's command prompt. The line that sets the classpath is too long.

There is a work-around. Open <[i]J2EE_HOME[/i]>/bin/asant.bat

(e.g. c:/Sun/AppServer/bin/asant.bat

) in a text editor and remove the following lines:

"-Dcom.sun.aas.instanceName=server"

"-Djava.endorsed.dirs=%AS_INSTALL%\lib\endorsed"

eric.jendrocka at 2007-7-16 1:48:21 > top of Java-index,Enterprise & Remote Computing,AVK Portability...
# 3

Hi eric.jendrock,

Appreciate your help; unfortunately, in my asant.bat script I cannot find the line you indicated even though I found the solution addressed in the FAQ as you instructed, too. The only ines I found are:

:runAnt

"%_JAVACMD%" %ANT_OPTS% -Dcom.sun.aas.installRoot="%AS_INSTALL%" -Djava.library.path="%AS_INSTALL%\bin;%AS_ICU_LIB%" -classpath "%AS_INSTALL%/lib/appserv-se.jar";"%AS_INSTALL%/lib/admin-cli.jar";"%AS_INSTALL%/lib/appserv-admin.jar";"%AS_INSTALL%/lib/j2ee.jar";"%AS_INSTALL%/lib/appserv-ext.jar";"%AS_INSTALL%/lib/appserv-rt.jar";"%AS_INSTALL%/lib/commons-launcher.jar";"%AS_INSTALL%/lib/install/applications/jmsra/imqjmsra.jar";"%LOCALCLASSPATH%" "-Dant.home=%ANT_HOME%" org.apache.tools.ant.Main %ANT_ARGS% %ANT_CMD_LINE_ARGS%

goto end

:runAntWithJikes

"%_JAVACMD%" %ANT_OPTS% -Dcom.sun.aas.installRoot="%AS_INSTALL%" -Djava.library.path="%AS_INSTALL%\bin;%AS_ICU_LIB%" -classpath "%AS_INSTALL%/lib/appserv-se.jar";"%AS_INSTALL%/lib/admin-cli.jar";"%AS_INSTALL%/lib/appserv-admin.jar";"%AS_INSTALL%/lib/j2ee.jar";"%AS_INSTALL%/lib/appserv-ext.jar";"%AS_INSTALL%/lib/appserv-rt.jar";"%AS_INSTALL%/lib/commons-launcher.jar";"%AS_INSTALL%/lib/install/applications/jmsra/imqjmsra.jar";"%LOCALCLASSPATH%" "-Dant.home=%ANT_HOME%" "-Djikes.class.path=%JIKESPATH%" org.apache.tools.ant.Main %ANT_ARGS% %ANT_CMD_LINE_ARGS%

goto end

I however did tried to remove those lines with -Dcom and -Djava but kept the variables of arg0s, "%_JAVACMD%" %ANT_OPTS%. Here is the result I got:

Usage: java [-options] class [args...]

(to execute a class)

or java [-options] -jar jarfile [args...]

(to execute a jar file)

where options include:

-clientto select the "client" VM

-serverto select the "server" VM

...

...

Looks funnier. Do you haver any clue or better solutions? Thanks!

sundewrainbowa at 2007-7-16 1:48:21 > top of Java-index,Enterprise & Remote Computing,AVK Portability...