Issue Details (XML | Word | Printable)

Key: NUCMAVEN-44
Type: Bug Bug
Status: Closed Closed
Resolution: Won't Fix
Priority: Major Major
Assignee: Unassigned
Reporter: shanyu zhao
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
DataNucleus Tools : Maven plugin

maven plugin throws "The command line is too long" exception on Windows

Created: 27/Dec/13 06:36 AM   Updated: 04/Apr/14 07:16 AM   Resolved: 27/Dec/13 08:43 AM
Component/s: Enhancer
Affects Version/s: 3.3.0.release, 3.3.1
Fix Version/s: None

Environment: Windows

Severity: Development


 Description  « Hide
When trying to build apache hive 0.13 on Windows, I got this error message:

[DEBUG] Executing command line:
[DEBUG] cmd.exe /X /C "java -cp C:\Users\shanyu\.m2\repository\org\datanucleus\d
atanucleus-maven-plugin\3.3.0-release\datanucleus-maven-plugin-3.3.0-release.jar
;C:\Users\shanyu\.m2\repository\org\datanucleus\datanucleus-core\3.2.2\datanucle
us-core-3.2.2.jar;C:\Users\shanyu\.m2\repository\org\codehaus\plexus\plexus-util
s\3.0.8\plexus-utils-3.0.8.jar;C:\Users\shanyu\.m2\repository\org\codehaus\plexu
s\plexus-component-annotations\1.5.5\plexus-component-annotations-1.5.5.jar;C:\U
sers\shanyu\.m2\repository\org\sonatype\sisu\sisu-inject-bean\2.3.0\sisu-inject-
bean-2.3.0.jar;C:\Users\shanyu\.m2\repository\org\sonatype\sisu\sisu-guice\3.1.0
\sisu-guice-3.1.0-no_aop.jar;C:\Users\shanyu\.m2\repository\org\sonatype\sisu\si
su-guava\0.9.9\sisu-guava-0.9.9.jar;C:\Users\shanyu\.m2\repository\org\apache\xb
ean\xbean-reflect\3.4\xbean-reflect-3.4.jar;C:\Users\shanyu\.m2\repository\log4j
\log4j\1.2.12\log4j-1.2.12.jar;C:\Users\shanyu\.m2\repository\commons-logging\co
mmons-logging-api\1.1\commons-logging-api-1.1.jar;C:\Users\shanyu\.m2\repository
\com\google\collections\google-collections\1.0\google-collections-1.0.jar;C:\Use
rs\shanyu\.m2\repository\junit\junit\3.8.2\junit-3.8.2.jar;C:\GitHub\Apache\hive
\metastore\target\classes;C:\GitHub\Apache\hive\serde\target\hive-serde-0.13.0-S
NAPSHOT.jar;C:\GitHub\Apache\hive\common\target\hive-common-0.13.0-SNAPSHOT.jar;
C:\Users\shanyu\.m2\repository\commons-codec\commons-codec\1.4\commons-codec-1.4
.jar;C:\Users\shanyu\.m2\repository\org\apache\avro\avro\1.7.5\avro-1.7.5.jar;C:
\Users\shanyu\.m2\repository\com\thoughtworks\paranamer\paranamer\2.3\paranamer-
2.3.jar;C:\Users\shanyu\.m2\repository\org\xerial\snappy\snappy-java\1.0.5\snapp
y-java-1.0.5.jar;C:\GitHub\Apache\hive\shims\aggregator\target\hive-shims-0.13.0
-SNAPSHOT.jar;C:\GitHub\Apache\hive\shims\common\target\hive-shims-common-0.13.0
-SNAPSHOT.jar;C:\GitHub\Apache\hive\shims\common-secure\target\hive-shims-common
-secure-0.13.0-SNAPSHOT.jar;C:\Users\shanyu\.m2\repository\com\google\guava\guav
a\11.0.2\guava-11.0.2.jar;C:\Users\shanyu\.m2\repository\com\google\code\findbug
s\jsr305\1.3.9\jsr305-1.3.9.jar;C:\Users\shanyu\.m2\repository\commons-cli\commo
ns-cli\1.2\commons-cli-1.2.jar;C:\Users\shanyu\.m2\repository\commons-lang\commo
ns-lang\2.4\commons-lang-2.4.jar;C:\Users\shanyu\.m2\repository\commons-logging\
commons-logging\1.1.3\commons-logging-1.1.3.jar;C:\Users\shanyu\.m2\repository\o
rg\apache\derby\derby\10.4.2.0\derby-10.4.2.0.jar;C:\Users\shanyu\.m2\repository
\org\datanucleus\datanucleus-api-jdo\3.2.1\datanucleus-api-jdo-3.2.1.jar;C:\User
s\shanyu\.m2\repository\org\datanucleus\datanucleus-rdbms\3.2.1\datanucleus-rdbm
s-3.2.1.jar;C:\Users\shanyu\.m2\repository\javax\jdo\jdo-api\3.0.1\jdo-api-3.0.1
.jar;C:\Users\shanyu\.m2\repository\javax\transaction\jta\1.1\jta-1.1.jar;C:\Use
rs\shanyu\.m2\repository\org\antlr\antlr-runtime\3.4\antlr-runtime-3.4.jar;C:\Us
ers\shanyu\.m2\repository\org\antlr\stringtemplate\3.2.1\stringtemplate-3.2.1.ja
r;C:\Users\shanyu\.m2\repository\antlr\antlr\2.7.7\antlr-2.7.7.jar;C:\Users\shan
yu\.m2\repository\org\apache\thrift\libfb303\0.9.0\libfb303-0.9.0.jar;C:\Users\s
hanyu\.m2\repository\org\apache\thrift\libthrift\0.9.0\libthrift-0.9.0.jar;C:\Us
ers\shanyu\.m2\repository\org\apache\httpcomponents\httpclient\4.2.5\httpclient-
4.2.5.jar;C:\Users\shanyu\.m2\repository\org\apache\httpcomponents\httpcore\4.2.
4\httpcore-4.2.4.jar;C:\Users\shanyu\.m2\repository\org\apache\hadoop\hadoop-com
mon\2.2.0\hadoop-common-2.2.0.jar;C:\Users\shanyu\.m2\repository\org\apache\hado
op\hadoop-annotations\2.2.0\hadoop-annotations-2.2.0.jar;C:\GitHub\Monarch\tools
\java\jre\..\lib\tools.jar;C:\Users\shanyu\.m2\repository\org\apache\commons\com
mons-math\2.1\commons-math-2.1.jar;C:\Users\shanyu\.m2\repository\xmlenc\xmlenc\
0.52\xmlenc-0.52.jar;C:\Users\shanyu\.m2\repository\commons-httpclient\commons-h
ttpclient\3.0.1\commons-httpclient-3.0.1.jar;C:\Users\shanyu\.m2\repository\comm
ons-io\commons-io\2.4\commons-io-2.4.jar;C:\Users\shanyu\.m2\repository\commons-
net\commons-net\3.1\commons-net-3.1.jar;C:\Users\shanyu\.m2\repository\javax\ser
vlet\servlet-api\2.5\servlet-api-2.5.jar;C:\Users\shanyu\.m2\repository\org\mort
bay\jetty\jetty\6.1.26\jetty-6.1.26.jar;C:\Users\shanyu\.m2\repository\org\mortb
ay\jetty\jetty-util\6.1.26\jetty-util-6.1.26.jar;C:\Users\shanyu\.m2\repository\
com\sun\jersey\jersey-core\1.14\jersey-core-1.14.jar;C:\Users\shanyu\.m2\reposit
ory\com\sun\jersey\jersey-json\1.14\jersey-json-1.14.jar;C:\Users\shanyu\.m2\rep
ository\org\codehaus\jettison\jettison\1.1\jettison-1.1.jar;C:\Users\shanyu\.m2\
repository\stax\stax-api\1.0.1\stax-api-1.0.1.jar;C:\Users\shanyu\.m2\repository
\com\sun\xml\bind\jaxb-impl\2.2.3-1\jaxb-impl-2.2.3-1.jar;C:\Users\shanyu\.m2\re
pository\javax\xml\bind\jaxb-api\2.2.2\jaxb-api-2.2.2.jar;C:\Users\shanyu\.m2\re
pository\javax\activation\activation\1.1\activation-1.1.jar;C:\Users\shanyu\.m2\
repository\org\codehaus\jackson\jackson-jaxrs\1.9.2\jackson-jaxrs-1.9.2.jar;C:\U
sers\shanyu\.m2\repository\org\codehaus\jackson\jackson-xc\1.9.2\jackson-xc-1.9.
2.jar;C:\Users\shanyu\.m2\repository\com\sun\jersey\jersey-server\1.14\jersey-se
rver-1.14.jar;C:\Users\shanyu\.m2\repository\asm\asm\3.1\asm-3.1.jar;C:\Users\sh
anyu\.m2\repository\log4j\log4j\1.2.16\log4j-1.2.16.jar;C:\Users\shanyu\.m2\repo
sitory\net\java\dev\jets3t\jets3t\0.6.1\jets3t-0.6.1.jar;C:\Users\shanyu\.m2\rep
ository\commons-configuration\commons-configuration\1.6\commons-configuration-1.
6.jar;C:\Users\shanyu\.m2\repository\commons-collections\commons-collections\3.2
.1\commons-collections-3.2.1.jar;C:\Users\shanyu\.m2\repository\commons-digester
\commons-digester\1.8\commons-digester-1.8.jar;C:\Users\shanyu\.m2\repository\co
mmons-beanutils\commons-beanutils\1.7.0\commons-beanutils-1.7.0.jar;C:\Users\sha
nyu\.m2\repository\commons-beanutils\commons-beanutils-core\1.8.0\commons-beanut
ils-core-1.8.0.jar;C:\Users\shanyu\.m2\repository\org\codehaus\jackson\jackson-c
ore-asl\1.9.2\jackson-core-asl-1.9.2.jar;C:\Users\shanyu\.m2\repository\org\code
haus\jackson\jackson-mapper-asl\1.9.2\jackson-mapper-asl-1.9.2.jar;C:\Users\shan
yu\.m2\repository\com\google\protobuf\protobuf-java\2.5.0\protobuf-java-2.5.0.ja
r;C:\Users\shanyu\.m2\repository\org\apache\hadoop\hadoop-auth\2.2.0\hadoop-auth
-2.2.0.jar;C:\Users\shanyu\.m2\repository\com\jcraft\jsch\0.1.42\jsch-0.1.42.jar
;C:\Users\shanyu\.m2\repository\org\apache\zookeeper\zookeeper\3.4.5\zookeeper-3
.4.5.jar;C:\Users\shanyu\.m2\repository\org\apache\commons\commons-compress\1.4.
1\commons-compress-1.4.1.jar;C:\Users\shanyu\.m2\repository\org\tukaani\xz\1.0\x
z-1.0.jar;C:\Users\shanyu\.m2\repository\org\apache\hadoop\hadoop-mapreduce-clie
nt-core\2.2.0\hadoop-mapreduce-client-core-2.2.0.jar;C:\Users\shanyu\.m2\reposit
ory\org\apache\hadoop\hadoop-yarn-common\2.2.0\hadoop-yarn-common-2.2.0.jar;C:\U
sers\shanyu\.m2\repository\org\apache\hadoop\hadoop-yarn-api\2.2.0\hadoop-yarn-a
pi-2.2.0.jar;C:\Users\shanyu\.m2\repository\com\google\inject\guice\3.0\guice-3.
0.jar;C:\Users\shanyu\.m2\repository\javax\inject\javax.inject\1\javax.inject-1.
jar;C:\Users\shanyu\.m2\repository\aopalliance\aopalliance\1.0\aopalliance-1.0.j
ar;C:\Users\shanyu\.m2\repository\com\sun\jersey\jersey-test-framework\jersey-te
st-framework-grizzly2\1.9\jersey-test-framework-grizzly2-1.9.jar;C:\Users\shanyu
\.m2\repository\com\sun\jersey\jersey-test-framework\jersey-test-framework-core\
1.9\jersey-test-framework-core-1.9.jar;C:\Users\shanyu\.m2\repository\javax\serv
let\javax.servlet-api\3.0.1\javax.servlet-api-3.0.1.jar;C:\Users\shanyu\.m2\repo
sitory\com\sun\jersey\jersey-client\1.9\jersey-client-1.9.jar;C:\Users\shanyu\.m
2\repository\com\sun\jersey\jersey-grizzly2\1.9\jersey-grizzly2-1.9.jar;C:\Users
\shanyu\.m2\repository\org\glassfish\grizzly\grizzly-http\2.1.2\grizzly-http-2.1
.2.jar;C:\Users\shanyu\.m2\repository\org\glassfish\grizzly\grizzly-framework\2.
1.2\grizzly-framework-2.1.2.jar;C:\Users\shanyu\.m2\repository\org\glassfish\gmb
al\gmbal-api-only\3.0.0-b023\gmbal-api-only-3.0.0-b023.jar;C:\Users\shanyu\.m2\r
epository\org\glassfish\external\management-api\3.0.0-b012\management-api-3.0.0-
b012.jar;C:\Users\shanyu\.m2\repository\org\glassfish\grizzly\grizzly-http-serve
r\2.1.2\grizzly-http-server-2.1.2.jar;C:\Users\shanyu\.m2\repository\org\glassfi
sh\grizzly\grizzly-rcm\2.1.2\grizzly-rcm-2.1.2.jar;C:\Users\shanyu\.m2\repositor
y\org\glassfish\grizzly\grizzly-http-servlet\2.1.2\grizzly-http-servlet-2.1.2.ja
r;C:\Users\shanyu\.m2\repository\org\glassfish\javax.servlet\3.1\javax.servlet-3
.1.jar;C:\Users\shanyu\.m2\repository\com\sun\jersey\contribs\jersey-guice\1.9\j
ersey-guice-1.9.jar;C:\Users\shanyu\.m2\repository\com\google\inject\extensions\
guice-servlet\3.0\guice-servlet-3.0.jar;C:\Users\shanyu\.m2\repository\io\netty\
netty\3.4.0.Final\netty-3.4.0.Final.jar;C:\Users\shanyu\.m2\repository\org\slf4j
\slf4j-api\1.7.5\slf4j-api-1.7.5.jar;C:\Users\shanyu\.m2\repository\org\slf4j\sl
f4j-log4j12\1.7.5\slf4j-log4j12-1.7.5.jar org.datanucleus.enhancer.DataNucleusEn
hancer -v -api JDO C:\GitHub\Apache\hive\metastore\target\classes\package.jdo"
[DEBUG] Exit code: 1
[DEBUG] --------------------
[DEBUG] Standard output from the DataNucleus tool org.datanucleus.enhancer.Data
NucleusEnhancer :
[DEBUG] --------------------
[INFO]
[DEBUG] --------------------
[ERROR] --------------------
[ERROR] Standard error from the DataNucleus tool + org.datanucleus.enhancer.Dat
aNucleusEnhancer :
[ERROR] --------------------
[ERROR] The command line is too long.


The java exception is:
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o
rg.datanucleus:datanucleus-maven-plugin:3.3.0-release:enhance (default) on proje
ct hive-metastore: The DataNucleus tool org.datanucleus.enhancer.DataNucleusEnha
ncer exited with a non-null exit code.
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:217)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:84)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:59)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBu
ild(LifecycleStarter.java:183)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl
eStarter.java:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun
cher.java:290)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
a:230)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
uncher.java:409)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
352)
Caused by: org.apache.maven.plugin.MojoExecutionException: The DataNucleus tool
org.datanucleus.enhancer.DataNucleusEnhancer exited with a non-null exit code.
        at org.datanucleus.maven.AbstractDataNucleusMojo.executeCommandLine(Abst
ractDataNucleusMojo.java:282)
        at org.datanucleus.maven.AbstractEnhancerMojo.enhance(AbstractEnhancerMo
jo.java:204)
        at org.datanucleus.maven.AbstractEnhancerMojo.executeDataNucleusTool(Abs
tractEnhancerMojo.java:72)
        at org.datanucleus.maven.AbstractDataNucleusMojo.execute(AbstractDataNuc
leusMojo.java:126)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default
BuildPluginManager.java:101)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:209)
        ... 19 more

Andy Jefferson added a comment - 27/Dec/13 08:43 AM - edited
If Windows complains about the length of a command line then you need to address why you are inputting too many files (that causes the command line too long), not expecting some plugin to magically come up with some solution. You could use a persistence.xml (as advised many times to forum questions) for example. See also the docs http://www.datanucleus.org/products/accessplatform/jdo/enhancer.html#maven

Andy Jefferson made changes - 27/Dec/13 08:43 AM
Field Original Value New Value
Status Open [ 1 ] Resolved [ 5 ]
Resolution Won't Fix [ 2 ]
Andy Jefferson made changes - 29/Dec/13 04:50 PM
Status Resolved [ 5 ] Closed [ 6 ]
shanyu zhao added a comment - 29/Dec/13 09:42 PM
Thanks a lot Andy! I was able to follow the document to workaround the problem with "<fork>false</fork>".

Note that the problem in this case is not that I have too many classes or JDO files to enhance, so the persistence.xml doesn't work. The problem is I have too many jars in the classpath that causes the command line too long.

Wes Thompson added a comment - 07/Mar/14 12:15 PM
Wait...why was this closed without a fix? Datanucleus's chose to interface directly with the OS by forking.

This could be fixed by pushing parameters into a temp file and then pointing the process to read the temp file.

The issue author even said that it is not due to use of JDO/Datanucleus by itself. Its due to the the number of libraries/jars that are being used.

Downstream users are going to run into this more and more as time goes on.

Marco Schulze added a comment - 04/Apr/14 07:16 AM
This issue is actually closed WITH a fix. However, I overlooked this issue and opened NUCMAVEN-47 (instead of re-opening this issue).