You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Zhi <zh...@gmail.com> on 2006/05/17 05:24:00 UTC

Compilation failure of java.nio.BufferOverflowException

I am trying replace ANT with MAVEN to build my project. In ant, I also met the memory overflow problem when execute the "javac" task. Finally the problem is solved by set memoryMaximumSize property like this,

<javac destdir="${classes.dir}" srcdir="${src.dir}" memoryMaximumSize="100m">

I am not sure whether it is the same reason, which makes the javac compiler not work. I have searched google, sun's bug database, and maven user list forum, but no hint found. 

Is there any friend can tell me why, or solve the problem? Thanks in advance.

Zhi


Here is the detail error message,

[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure

Failure executing javac, but could not parse the error:
Compiler (1.5.0_06) arises exception.

java.nio.BufferOverflowException
 at java.nio.Buffer.nextPutIndex(Buffer.java:419)
 at java.nio.HeapCharBuffer.put(HeapCharBuffer.java:145)
 at com.sun.tools.javac.parser.Scanner.decode(Scanner.java:405)
 at com.sun.tools.javac.parser.Scanner.<init>(Scanner.java:304)
 at com.sun.tools.javac.parser.Scanner.<init>(Scanner.java:238)
 at com.sun.tools.javac.parser.Scanner$Factory.newScanner(Scanner.java:72)
 at com.sun.tools.javac.main.JavaCompiler.parse(JavaCompiler.java:254)
 at com.sun.tools.javac.main.JavaCompiler.parse(JavaCompiler.java:281)
 at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:398)
 at com.sun.tools.javac.main.Main.compile(Main.java:592)
 at com.sun.tools.javac.main.Main.compile(Main.java:544)
 at com.sun.tools.javac.Main.compile(Main.java:85)
 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:585)
 at org.codehaus.plexus.compiler.javac.JavacCompiler.compileInProcess(JavacCompiler.java:400)
 at org.codehaus.plexus.compiler.javac.JavacCompiler.compile(JavacCompiler.java:136)
 at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:483)
 at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:111)
 at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:412)
 at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:534)
 at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:475)
 at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:454)
 at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:306)
 at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273)
 at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:140)
 at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
 at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
 at org.apache.maven.cli.MavenCli.main(MavenCli.java:256)
 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:585)
 at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
 at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
 at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
 at org.codehaus.classworlds.Launcher.main(Launcher.java:375)


[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.BuildFailureException: Compilation failure
 at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:555)
 at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:475)
 at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:454)
 at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:306)
 at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273)
 at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:140)
 at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
 at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
 at org.apache.maven.cli.MavenCli.main(MavenCli.java:256)
 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:585)
 at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
 at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
 at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
 at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.CompilationFailureException: Compilation failure
 at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:505)
 at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:111)
 at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:412)
 at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:534)
 ... 16 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 minute 3 seconds
[INFO] Finished at: Wed May 17 9:19:23 CST 2006
[INFO] Final Memory: 11M/21M
[INFO] ------------------------------------------------------------------------

Re: Re: Compilation failure of java.nio.BufferOverflowException

Posted by Wayne Fay <wa...@gmail.com>.
Try 512.
If that doesn't work, try 768. Then 1024.

Wayne

On 5/17/06, Zhi <zh...@gmail.com> wrote:
> Thanks Thorsten!
>
> Yes. I tried set MAVEN_OPTS=-Xmx256m just now. Unfortunately, it makes no difference. The exception message are still the same.
>
> Is there anybody can read the exception stack?
>
> java.nio.BufferOverflowException
>         at java.nio.Buffer.nextPutIndex(Buffer.java:419)
>         at java.nio.HeapCharBuffer.put(HeapCharBuffer.java:145)
>         at com.sun.tools.javac.parser.Scanner.decode(Scanner.java:405)
>         at com.sun.tools.javac.parser.Scanner.<init>(Scanner.java:304)
>         at com.sun.tools.javac.parser.Scanner.<init>(Scanner.java:238)
>         at com.sun.tools.javac.parser.Scanner$Factory.newScanner(Scanner.java:72)
>         at com.sun.tools.javac.main.JavaCompiler.parse(JavaCompiler.java:254)
>         at com.sun.tools.javac.main.JavaCompiler.parse(JavaCompiler.java:281)
>         at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:398)
>         at com.sun.tools.javac.main.Main.compile(Main.java:592)
>         at com.sun.tools.javac.main.Main.compile(Main.java:544)
>         at com.sun.tools.javac.Main.compile(Main.java:85)
>         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:585)
>         at org.codehaus.plexus.compiler.javac.JavacCompiler.compileInProcess(JavacCompiler.java:400)
>         at org.codehaus.plexus.compiler.javac.JavacCompiler.compile(JavacCompiler.java:136)
>         at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:483)
>         at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:111)
>         at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:412)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:534)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:475)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:454)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:306)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:140)
>         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:256)
>         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:585)
>         at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>         at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>         at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>         at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
>
>
> ----- Original Message -----
> From: "Thorsten Heit" <th...@xtramind.com>
> To: "Maven Users List" <us...@maven.apache.org>
> Sent: Wednesday, May 17, 2006 7:54 PM
> Subject: Re: Compilation failure of java.nio.BufferOverflowException
>
>
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > Hi,
> >
> >> I am trying replace ANT with MAVEN to build my project. In ant, I
> >> also met the memory overflow problem when execute the "javac" task.
> >> Finally the problem is solved by set memoryMaximumSize property like
> >> this,
> >>
> >> <javac destdir="${classes.dir}" srcdir="${src.dir}"
> >> memoryMaximumSize="100m">
> >>
> >> I am not sure whether it is the same reason, which makes the javac
> >> compiler not work. I have searched google, sun's bug database, and
> >> maven user list forum, but no hint found.
> >>
> >> Is there any friend can tell me why, or solve the problem? Thanks in
> >> advance.
> >
> > Have you tried to set the environment variable "MAVEN_OPTS"?
> >
> > MAVEN_OPTS=<parameters for the Java executable>
> >
> > for example: MAVEN_OPTS=-Xmx256m
> >
> >
> > Regards
> >
> > Thorsten
> > -----BEGIN PGP SIGNATURE-----
> > Version: GnuPG v1.4.3 (MingW32)
> >
> > iD8DBQFEaw71QvObkgCcDe0RAsOtAJ4kNCf2nrmgo5920a5nHOevfzB3pgCfXlBP
> > JH2AF/Gypwttxoe/fmoRkEo=
> > =Lson
> > -----END PGP SIGNATURE-----
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Re: Compilation failure of java.nio.BufferOverflowException

Posted by Zhi <zh...@gmail.com>.
Thanks Thorsten! 

Yes. I tried set MAVEN_OPTS=-Xmx256m just now. Unfortunately, it makes no difference. The exception message are still the same.

Is there anybody can read the exception stack?

java.nio.BufferOverflowException
        at java.nio.Buffer.nextPutIndex(Buffer.java:419)
        at java.nio.HeapCharBuffer.put(HeapCharBuffer.java:145)
        at com.sun.tools.javac.parser.Scanner.decode(Scanner.java:405)
        at com.sun.tools.javac.parser.Scanner.<init>(Scanner.java:304)
        at com.sun.tools.javac.parser.Scanner.<init>(Scanner.java:238)
        at com.sun.tools.javac.parser.Scanner$Factory.newScanner(Scanner.java:72)
        at com.sun.tools.javac.main.JavaCompiler.parse(JavaCompiler.java:254)
        at com.sun.tools.javac.main.JavaCompiler.parse(JavaCompiler.java:281)
        at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:398)
        at com.sun.tools.javac.main.Main.compile(Main.java:592)
        at com.sun.tools.javac.main.Main.compile(Main.java:544)
        at com.sun.tools.javac.Main.compile(Main.java:85)
        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:585)
        at org.codehaus.plexus.compiler.javac.JavacCompiler.compileInProcess(JavacCompiler.java:400)
        at org.codehaus.plexus.compiler.javac.JavacCompiler.compile(JavacCompiler.java:136)
        at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:483)
        at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:111)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:412)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:534)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:475)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:454)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:306)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:140)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:256)
        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:585)
        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)


----- Original Message ----- 
From: "Thorsten Heit" <th...@xtramind.com>
To: "Maven Users List" <us...@maven.apache.org>
Sent: Wednesday, May 17, 2006 7:54 PM
Subject: Re: Compilation failure of java.nio.BufferOverflowException


> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hi,
> 
>> I am trying replace ANT with MAVEN to build my project. In ant, I
>> also met the memory overflow problem when execute the "javac" task.
>> Finally the problem is solved by set memoryMaximumSize property like
>> this,
>> 
>> <javac destdir="${classes.dir}" srcdir="${src.dir}"
>> memoryMaximumSize="100m">
>> 
>> I am not sure whether it is the same reason, which makes the javac
>> compiler not work. I have searched google, sun's bug database, and
>> maven user list forum, but no hint found.
>> 
>> Is there any friend can tell me why, or solve the problem? Thanks in
>> advance.
> 
> Have you tried to set the environment variable "MAVEN_OPTS"?
> 
> MAVEN_OPTS=<parameters for the Java executable>
> 
> for example: MAVEN_OPTS=-Xmx256m
> 
> 
> Regards
> 
> Thorsten
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.3 (MingW32)
> 
> iD8DBQFEaw71QvObkgCcDe0RAsOtAJ4kNCf2nrmgo5920a5nHOevfzB3pgCfXlBP
> JH2AF/Gypwttxoe/fmoRkEo=
> =Lson
> -----END PGP SIGNATURE-----
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>

Re: Compilation failure of java.nio.BufferOverflowException

Posted by Thorsten Heit <th...@xtramind.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

> I am trying replace ANT with MAVEN to build my project. In ant, I
> also met the memory overflow problem when execute the "javac" task.
> Finally the problem is solved by set memoryMaximumSize property like
> this,
> 
> <javac destdir="${classes.dir}" srcdir="${src.dir}"
> memoryMaximumSize="100m">
> 
> I am not sure whether it is the same reason, which makes the javac
> compiler not work. I have searched google, sun's bug database, and
> maven user list forum, but no hint found.
> 
> Is there any friend can tell me why, or solve the problem? Thanks in
> advance.

Have you tried to set the environment variable "MAVEN_OPTS"?

MAVEN_OPTS=<parameters for the Java executable>

for example: MAVEN_OPTS=-Xmx256m


Regards

Thorsten
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (MingW32)

iD8DBQFEaw71QvObkgCcDe0RAsOtAJ4kNCf2nrmgo5920a5nHOevfzB3pgCfXlBP
JH2AF/Gypwttxoe/fmoRkEo=
=Lson
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org