You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Brad Harper <br...@epsiia.com> on 2006/09/20 16:38:12 UTC

Error: java.lang.StringIndexOutOfBoundsException

Hello:

See the FATAL ERROR from captured maven output below.

In context, the native maven plugin is being used to compile a C++
source file, prior to linking an .exe application.

Has anyone seen this sort of thing before? Thanks.

Brad

....
recmods.cpp
[INFO] cl /MT /W3 /GX /DWINDOWS-X86 /DWIN32 /D_WINDOWS /Zi /Od /DDEBUG /DHAVE_DONGLE -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.epsiia.dxr\include\common -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.epsiia.dxr\include\gui -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.epsiia.dxr\include\crypt -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.epsiia.dxr\include\record -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.epsiia.dxr\bin\dxrecord /Fop:\exodus\dxr\WINDOWS-X86\dxrecord\target\recorder.obj -c p:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.epsiia.dxr\bin\dxrecord\recorder.cpp
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.

recorder.cpp
p:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.epsiia.dxr\bin\dxrecord\recorder.cpp(4050) : warning C4101: 'ucplogrek' : unreferenced local variable
[INFO] cl /MT /W3 /GX /DWINDOWS-X86 /DWIN32 /D_WINDOWS /Zi /Od /DDEBUG /DHAVE_DONGLE -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.epsiia.dxr\include\common -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.epsiia.dxr\include\gui -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.epsiia.dxr\include\crypt -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.epsiia.dxr\include\record -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.epsiia.dxr\bin\dxrecord /Fop:\exodus\dxr\WINDOWS-X86\dxrecord\target\reindex.obj -c p:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.epsiia.dxr\bin\dxrecord\reindex.cpp
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.

reindex.cpp
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] String index out of range: -17
[INFO] ------------------------------------------------------------------------
[DEBUG] Trace
java.lang.StringIndexOutOfBoundsException: String index out of range: -17
	at java.lang.String.substring(String.java:1768)
	at org.codehaus.plexus.util.FileUtils.basename(FileUtils.java:215)
	at org.codehaus.plexus.util.FileUtils.basename(FileUtils.java:200)
	at org.codehaus.mojo.natives.compiler.AbstractCompiler.getObjectFile(AbstractCompiler.java:120)
	at org.codehaus.mojo.natives.compiler.AbstractCompiler.compile(AbstractCompiler.java:66)
	at org.codehaus.mojo.natives.plugin.NativeCompileMojo.execute(NativeCompileMojo.java:162)
	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] Total time: 4 minutes 56 seconds
[INFO] Finished at: Wed Sep 20 09:35:18 CDT 2006
[INFO] Final Memory: 8M/16M
[INFO] ------------------------------------------------------------------------

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


RE: Error: java.lang.StringIndexOutOfBoundsException [MORE]

Posted by Brad Harper <br...@epsiia.com>.
Yes. I removed the plugin from my local repository and watched it
download the version from the snapshot repository.

You didn't mention the version, but I found the one (1.0-alpha-2-SNAPSHOT)
built at about the time you sent your e-mail from 23:00 yesterday.

Brad

> -----Original Message-----
> From: dan tran [mailto:dantran@gmail.com]
> Sent: Thursday, September 21, 2006 1:40 PM
> To: Maven Users List
> Subject: Re: Error: java.lang.StringIndexOutOfBoundsException [MORE]
> 
> 
> did you set 1.0-alpha-2-SNAPSHOT as your version?
> 
> -Dan
> 
> 
> 
> On 9/21/06, Brad Harper <br...@epsiia.com> wrote:
> >
> > Dan:
> >
> > You might want to double check.
> >
> > I have downloaded
> >
> >
> > 
> http://snapshots.repository.codehaus.org//org/codehaus/mojo/na
> tive-maven-plugin/1.0-alpha-2-SNAPSHOT/
> >
> > and still see the same problem using a <fileName>abc</fileName>
> > element where the file has no suffix (or dot delimiter).
> >
> > Brad
> >
> > > -----Original Message-----
> > > From: dan tran [mailto:dantran@gmail.com]
> > > Sent: Wednesday, September 20, 2006 11:04 PM
> > > To: Maven Users List
> > > Subject: Re: Error: 
> java.lang.StringIndexOutOfBoundsException [MORE]
> > >
> > >
> > > I went ahead with the fix + unit test MOJO:509 and deployed a
> > > snapshot,
> > > please test it out
> > >
> > > -Dan
> > >
> > >
> > >
> > > On 9/20/06, dan tran <da...@gmail.com> wrote:
> > > >
> > > >  Confirm, it is a bug in plexus-util when try to get
> > > basename of this
> > > > string
> > > >
> > > >
> > > >
> > > >
> > > C:\dev\mojo\maven-native\native-maven-plugin\src\it\jni\native
> > > \win32\..\src\main\native\HelloWorld2
> > > >
> > > > this is windows path,
> > > >
> > > > if I convert it unix path then it is ok.
> > > >
> > > > -D
> > > >
> > > >
> > > >
> > > >  On 9/20/06, dan tran <da...@gmail.com> wrote:
> > > > >
> > > > >  that is a bug, please file it with a sample pom.
> > > > >
> > > > > Thanks
> > > > >
> > > > > -Dan
> > > > >
> > > > >
> > > > >  On 9/20/06, Brad Harper <brad.harper@epsiia.com > wrote:
> > > > > >
> > > > > > Dan:
> > > > > >
> > > > > > That put me on to the solution. There was a 
> <fileName> element
> > > > > > following 'reindex.cpp ' that didn't have file extension [a
> > > > > > cut/paste error in the pom file], like
> > > > > >
> > > > > >   <fileName>abc</fileName>
> > > > > >
> > > > > > Mea culpa.
> > > > > >
> > > > > > Even so, I would think that things shouldn't crater 
> with such
> > > > > > an obscure error. Basically, the named file didn't exist in
> > > > > > the source directory.
> > > > > >
> > > > > > Maybe AbstractCompiler shouldn't attempt to 
> construct the object
> > > > > > filename (and perhaps perform other operations) until
> > > it has been
> > > > > > determined that the source file actually exists in 
> the source
> > > > > > directory.
> > > > > >
> > > > > > Thanks.
> > > > > >
> > > > > > Brad
> > > > > >
> > > > > > > -----Original Message-----
> > > > > > > From: dan tran [mailto:dantran@gmail.com ]
> > > > > > > Sent: Wednesday, September 20, 2006 6:03 PM
> > > > > > > To: Maven Users List
> > > > > > > Subject: Re: Error:
> > > java.lang.StringIndexOutOfBoundsException [MORE]
> > > > > > >
> > > > > > >
> > > > > > > reindex.cpp compilation is ok,
> > > > > > >
> > > > > > > The compilation after reindex.cpp is the main problem
> > > > > > >
> > > > > > > -Dan
> > > > > > >
> > > > > > > On 9/20/06, dan tran < dantran@gmail.com> wrote:
> > > > > > > >
> > > > > > > >  Hi Brad, thanks for looking into this problem, 
> do you have
> > > > > > > reproducable
> > > > > > > > test case?
> > > > > > > >
> > > > > > > > -D
> > > > > > > >
> > > > > > > >
> > > > > > > >  On 9/20/06, Brad Harper <br...@epsiia.com> wrote:
> > > > > > > > >
> > > > > > > > > Looking at the source code for classes
> > > > > > > > >
> > > > > > > > >   org.codehaus.mojo.natives.compiler.AbstractCompiler
> > > > > > > > >
> > > > > > > > > and
> > > > > > > > >
> > > > > > > > > org.codehaus.plexus.util.FileUtils
> > > > > > > > >
> > > > > > > > > it seems singularly odd that String.substring() would
> > > > > > > > > suddenly be receiving an index with a value of -17
> > > > > > > > > passed by the FileUtils.basename() methods.
> > > > > > > > >
> > > > > > > > > I haven't been able to affect the outcome by altering
> > > > > > > > > the order or names of the files involved.
> > > > > > > > >
> > > > > > > > > Method AbstractCompiler.getObjectFile () is 
> attempting to
> > > > > > > > > construct the string name of the object file 
> associated
> > > > > > > > > with the current source file. Looking in the target/
> > > > > > > > > directory, I see that the object file for source file
> > > > > > > > > 'reindex.cpp' has been created and exists with
> > > the expected
> > > > > > > > > name: 'reindex.obj'.
> > > > > > > > >
> > > > > > > > > Brad
> > > > > > > > >
> > > > > > > > > > -----Original Message-----
> > > > > > > > > > From: Brad Harper
> > > > > > > > > > Sent: Wednesday, September 20, 2006 9:38 AM
> > > > > > > > > > To: users
> > > > > > > > > > Subject: Error:
> > > java.lang.StringIndexOutOfBoundsException
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > Hello:
> > > > > > > > > >
> > > > > > > > > > See the FATAL ERROR from captured maven 
> output below.
> > > > > > > > > >
> > > > > > > > > > In context, the native maven plugin is being used to
> > > > > > > compile a C++
> > > > > > > > > > source file, prior to linking an .exe application.
> > > > > > > > > >
> > > > > > > > > > Has anyone seen this sort of thing before? Thanks.
> > > > > > > > > >
> > > > > > > > > > Brad
> > > > > > > > > >
> > > > > > > > > > ....
> > > > > > > > > > recmods.cpp
> > > > > > > > > > [INFO] cl /MT /W3 /GX /DWINDOWS-X86 /DWIN32
> > > /D_WINDOWS /Zi
> > > > > > > > > > /Od /DDEBUG /DHAVE_DONGLE
> > > > > > > > > >
> > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > > > > > > epsiia.dxr\include\common
> > > > > > > > > >
> > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > > > > > > epsiia.dxr\include\gui
> > > > > > > > > >
> > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > > > > > > epsiia.dxr\include\crypt
> > > > > > > > > >
> > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > >
> > > > > > > > > > epsiia.dxr\include\record
> > > > > > > > > >
> > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > > > > > > epsiia.dxr\bin\dxrecord
> > > > > > > > > >
> > > /Fop:\exodus\dxr\WINDOWS-X86\dxrecord\target\recorder.obj -c
> > > > > > > > > >
> > > p:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.ep
> > > > > > > > > > siia.dxr\bin\dxrecord\recorder.cpp
> > > > > > > > > > Microsoft (R) 32-bit C/C++ Optimizing 
> Compiler Version
> > > > > > > > > > 12.00.8804 for 80x86
> > > > > > > > > > Copyright (C) Microsoft Corp 1984-1998. All
> > > rights reserved.
> > > > > > > > > >
> > > > > > > > > > recorder.cpp
> > > > > > > > > >
> > > p:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.ep
> > > > > >
> > > > > > > > > > siia.dxr\bin\dxrecord\recorder.cpp(4050) :
> > > warning C4101:
> > > > > > > > > > 'ucplogrek' : unreferenced local variable
> > > > > > > > > > [INFO] cl /MT /W3 /GX /DWINDOWS-X86 /DWIN32
> > > /D_WINDOWS /Zi
> > > > > > > > > > /Od /DDEBUG /DHAVE_DONGLE
> > > > > > > > > >
> > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > > > > > > epsiia.dxr\include\common
> > > > > > > > > >
> > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > >
> > > > > > > > > > epsiia.dxr\include\gui
> > > > > > > > > >
> > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > > > > > > epsiia.dxr\include\crypt
> > > > > > > > > >
> > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > >
> > > > > > > > > > epsiia.dxr\include\record
> > > > > > > > > >
> > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > > > > > > epsiia.dxr\bin\dxrecord
> > > > > > > > > >
> > > /Fop:\exodus\dxr\WINDOWS-X86\dxrecord\target\reindex.obj -c
> > > > > > > > > >
> > > p:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.ep
> > > > > > > > > > siia.dxr\bin\dxrecord\reindex.cpp
> > > > > > > > > > Microsoft (R) 32-bit C/C++ Optimizing 
> Compiler Version
> > > > > > > > > > 12.00.8804 for 80x86
> > > > > > > > > > Copyright (C) Microsoft Corp 1984-1998. All
> > > rights reserved.
> > > > > > > > > >
> > > > > > > > > > reindex.cpp
> > > > > > > > > > [INFO]
> > > > > > > > > >
> > > --------------------------------------------------------------
> > > > > >
> > > > > > > > > > ----------
> > > > > > > > > > [ERROR] FATAL ERROR
> > > > > > > > > > [INFO]
> > > > > > > > > >
> > > --------------------------------------------------------------
> > > > > > > > > > ----------
> > > > > > > > > > [INFO] String index out of range: -17
> > > > > > > > > > [INFO]
> > > > > > > > > >
> > > --------------------------------------------------------------
> > > > > > > > > > ----------
> > > > > > > > > > [DEBUG] Trace
> > > > > > > > > > java.lang.StringIndexOutOfBoundsException:
> > > String index out
> > > > > > > > > > of range: -17
> > > > > > > > > >       at 
> java.lang.String.substring(String.java:1768)
> > > > > > > > > >       at
> > > > > > > > > > org.codehaus.plexus.util.FileUtils.basename
> > > (FileUtils.java
> > > > > > :215)
> > > > > > > > > >       at
> > > > > > > > > >
> > > org.codehaus.plexus.util.FileUtils.basename(FileUtils.java
> > > > > > :200)
> > > > > > > > > >       at
> > > > > > > > > >
> > > org.codehaus.mojo.natives.compiler.AbstractCompiler.getObjectF
> > > > > > > > > > ile(AbstractCompiler.java :120)
> > > > > > > > > >       at
> > > > > > > > > >
> > > org.codehaus.mojo.natives.compiler.AbstractCompiler.compile(Ab
> > > > > > > > > > stractCompiler.java:66)
> > > > > > > > > >       at
> > > > > > > > > >
> > > org.codehaus.mojo.natives.plugin.NativeCompileMojo.execute(Nat
> > > > > > > > > > iveCompileMojo.java:162)
> > > > > > > > > >       at
> > > > > > > > > >
> > > org.apache.maven.plugin.DefaultPluginManager.executeMojo(Defau
> > > > > > > > > > ltPluginManager.java:412)
> > > > > > > > > >       at
> > > > > > > > > >
> > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoa
> > > > > > > > > > ls(DefaultLifecycleExecutor.java:534)
> > > > > > > > > >       at
> > > > > > > > > >
> > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoa
> > > > > > > > > > lWithLifecycle(DefaultLifecycleExecutor.java :475)
> > > > > > > > > >       at
> > > > > > > > > >
> > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoa
> > > > > > > > > > l(DefaultLifecycleExecutor.java:454)
> > > > > > > > > >       at
> > > > > > > > > >
> > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoa
> > > > > > > > > > 
> lAndHandleFailures(DefaultLifecycleExecutor.java:306)
> > > > > > > > > >       at
> > > > > > > > > >
> > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTas
> > > > > > > > > > kSegments(DefaultLifecycleExecutor.java:273)
> > > > > > > > > >       at
> > > > > > > > > >
> > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(De
> > > > > > > > > faultLifecycleExecutor.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(NativeMethodAccess
> > > > > > > > > > orImpl.java:39)
> > > > > > > > > >       at
> > > > > > > > > >
> > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> > > > > > > > > > odAccessorImpl.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] Total time: 4 minutes 56 seconds
> > > > > > > > > > [INFO] Finished at: Wed Sep 20 09:35:18 CDT 2006
> > > > > > > > > > [INFO] Final Memory: 8M/16M
> > > > > > > > > > [INFO]
> > > > > > > > > >
> > > --------------------------------------------------------------
> > > > > > > > > > ----------
> > > > > > > > > >
> > > > > > > > > >
> > > > > > >
> > > > > >
> > > 
> ---------------------------------------------------------------------
> > > > > > > > > > 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
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > 
> ---------------------------------------------------------------------
> > > > > > 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
> >
> >
> 

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


Re: Error: java.lang.StringIndexOutOfBoundsException [MORE]

Posted by dan tran <da...@gmail.com>.
did you set 1.0-alpha-2-SNAPSHOT as your version?

-Dan



On 9/21/06, Brad Harper <br...@epsiia.com> wrote:
>
> Dan:
>
> You might want to double check.
>
> I have downloaded
>
>
> http://snapshots.repository.codehaus.org//org/codehaus/mojo/native-maven-plugin/1.0-alpha-2-SNAPSHOT/
>
> and still see the same problem using a <fileName>abc</fileName>
> element where the file has no suffix (or dot delimiter).
>
> Brad
>
> > -----Original Message-----
> > From: dan tran [mailto:dantran@gmail.com]
> > Sent: Wednesday, September 20, 2006 11:04 PM
> > To: Maven Users List
> > Subject: Re: Error: java.lang.StringIndexOutOfBoundsException [MORE]
> >
> >
> > I went ahead with the fix + unit test MOJO:509 and deployed a
> > snapshot,
> > please test it out
> >
> > -Dan
> >
> >
> >
> > On 9/20/06, dan tran <da...@gmail.com> wrote:
> > >
> > >  Confirm, it is a bug in plexus-util when try to get
> > basename of this
> > > string
> > >
> > >
> > >
> > >
> > C:\dev\mojo\maven-native\native-maven-plugin\src\it\jni\native
> > \win32\..\src\main\native\HelloWorld2
> > >
> > > this is windows path,
> > >
> > > if I convert it unix path then it is ok.
> > >
> > > -D
> > >
> > >
> > >
> > >  On 9/20/06, dan tran <da...@gmail.com> wrote:
> > > >
> > > >  that is a bug, please file it with a sample pom.
> > > >
> > > > Thanks
> > > >
> > > > -Dan
> > > >
> > > >
> > > >  On 9/20/06, Brad Harper <brad.harper@epsiia.com > wrote:
> > > > >
> > > > > Dan:
> > > > >
> > > > > That put me on to the solution. There was a <fileName> element
> > > > > following 'reindex.cpp ' that didn't have file extension [a
> > > > > cut/paste error in the pom file], like
> > > > >
> > > > >   <fileName>abc</fileName>
> > > > >
> > > > > Mea culpa.
> > > > >
> > > > > Even so, I would think that things shouldn't crater with such
> > > > > an obscure error. Basically, the named file didn't exist in
> > > > > the source directory.
> > > > >
> > > > > Maybe AbstractCompiler shouldn't attempt to construct the object
> > > > > filename (and perhaps perform other operations) until
> > it has been
> > > > > determined that the source file actually exists in the source
> > > > > directory.
> > > > >
> > > > > Thanks.
> > > > >
> > > > > Brad
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: dan tran [mailto:dantran@gmail.com ]
> > > > > > Sent: Wednesday, September 20, 2006 6:03 PM
> > > > > > To: Maven Users List
> > > > > > Subject: Re: Error:
> > java.lang.StringIndexOutOfBoundsException [MORE]
> > > > > >
> > > > > >
> > > > > > reindex.cpp compilation is ok,
> > > > > >
> > > > > > The compilation after reindex.cpp is the main problem
> > > > > >
> > > > > > -Dan
> > > > > >
> > > > > > On 9/20/06, dan tran < dantran@gmail.com> wrote:
> > > > > > >
> > > > > > >  Hi Brad, thanks for looking into this problem, do you have
> > > > > > reproducable
> > > > > > > test case?
> > > > > > >
> > > > > > > -D
> > > > > > >
> > > > > > >
> > > > > > >  On 9/20/06, Brad Harper <br...@epsiia.com> wrote:
> > > > > > > >
> > > > > > > > Looking at the source code for classes
> > > > > > > >
> > > > > > > >   org.codehaus.mojo.natives.compiler.AbstractCompiler
> > > > > > > >
> > > > > > > > and
> > > > > > > >
> > > > > > > > org.codehaus.plexus.util.FileUtils
> > > > > > > >
> > > > > > > > it seems singularly odd that String.substring() would
> > > > > > > > suddenly be receiving an index with a value of -17
> > > > > > > > passed by the FileUtils.basename() methods.
> > > > > > > >
> > > > > > > > I haven't been able to affect the outcome by altering
> > > > > > > > the order or names of the files involved.
> > > > > > > >
> > > > > > > > Method AbstractCompiler.getObjectFile () is attempting to
> > > > > > > > construct the string name of the object file associated
> > > > > > > > with the current source file. Looking in the target/
> > > > > > > > directory, I see that the object file for source file
> > > > > > > > 'reindex.cpp' has been created and exists with
> > the expected
> > > > > > > > name: 'reindex.obj'.
> > > > > > > >
> > > > > > > > Brad
> > > > > > > >
> > > > > > > > > -----Original Message-----
> > > > > > > > > From: Brad Harper
> > > > > > > > > Sent: Wednesday, September 20, 2006 9:38 AM
> > > > > > > > > To: users
> > > > > > > > > Subject: Error:
> > java.lang.StringIndexOutOfBoundsException
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > Hello:
> > > > > > > > >
> > > > > > > > > See the FATAL ERROR from captured maven output below.
> > > > > > > > >
> > > > > > > > > In context, the native maven plugin is being used to
> > > > > > compile a C++
> > > > > > > > > source file, prior to linking an .exe application.
> > > > > > > > >
> > > > > > > > > Has anyone seen this sort of thing before? Thanks.
> > > > > > > > >
> > > > > > > > > Brad
> > > > > > > > >
> > > > > > > > > ....
> > > > > > > > > recmods.cpp
> > > > > > > > > [INFO] cl /MT /W3 /GX /DWINDOWS-X86 /DWIN32
> > /D_WINDOWS /Zi
> > > > > > > > > /Od /DDEBUG /DHAVE_DONGLE
> > > > > > > > >
> > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > > > > > epsiia.dxr\include\common
> > > > > > > > >
> > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > > > > > epsiia.dxr\include\gui
> > > > > > > > >
> > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > > > > > epsiia.dxr\include\crypt
> > > > > > > > >
> > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > >
> > > > > > > > > epsiia.dxr\include\record
> > > > > > > > >
> > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > > > > > epsiia.dxr\bin\dxrecord
> > > > > > > > >
> > /Fop:\exodus\dxr\WINDOWS-X86\dxrecord\target\recorder.obj -c
> > > > > > > > >
> > p:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.ep
> > > > > > > > > siia.dxr\bin\dxrecord\recorder.cpp
> > > > > > > > > Microsoft (R) 32-bit C/C++ Optimizing Compiler Version
> > > > > > > > > 12.00.8804 for 80x86
> > > > > > > > > Copyright (C) Microsoft Corp 1984-1998. All
> > rights reserved.
> > > > > > > > >
> > > > > > > > > recorder.cpp
> > > > > > > > >
> > p:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.ep
> > > > >
> > > > > > > > > siia.dxr\bin\dxrecord\recorder.cpp(4050) :
> > warning C4101:
> > > > > > > > > 'ucplogrek' : unreferenced local variable
> > > > > > > > > [INFO] cl /MT /W3 /GX /DWINDOWS-X86 /DWIN32
> > /D_WINDOWS /Zi
> > > > > > > > > /Od /DDEBUG /DHAVE_DONGLE
> > > > > > > > >
> > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > > > > > epsiia.dxr\include\common
> > > > > > > > >
> > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > >
> > > > > > > > > epsiia.dxr\include\gui
> > > > > > > > >
> > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > > > > > epsiia.dxr\include\crypt
> > > > > > > > >
> > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > >
> > > > > > > > > epsiia.dxr\include\record
> > > > > > > > >
> > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > > > > > epsiia.dxr\bin\dxrecord
> > > > > > > > >
> > /Fop:\exodus\dxr\WINDOWS-X86\dxrecord\target\reindex.obj -c
> > > > > > > > >
> > p:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.ep
> > > > > > > > > siia.dxr\bin\dxrecord\reindex.cpp
> > > > > > > > > Microsoft (R) 32-bit C/C++ Optimizing Compiler Version
> > > > > > > > > 12.00.8804 for 80x86
> > > > > > > > > Copyright (C) Microsoft Corp 1984-1998. All
> > rights reserved.
> > > > > > > > >
> > > > > > > > > reindex.cpp
> > > > > > > > > [INFO]
> > > > > > > > >
> > --------------------------------------------------------------
> > > > >
> > > > > > > > > ----------
> > > > > > > > > [ERROR] FATAL ERROR
> > > > > > > > > [INFO]
> > > > > > > > >
> > --------------------------------------------------------------
> > > > > > > > > ----------
> > > > > > > > > [INFO] String index out of range: -17
> > > > > > > > > [INFO]
> > > > > > > > >
> > --------------------------------------------------------------
> > > > > > > > > ----------
> > > > > > > > > [DEBUG] Trace
> > > > > > > > > java.lang.StringIndexOutOfBoundsException:
> > String index out
> > > > > > > > > of range: -17
> > > > > > > > >       at java.lang.String.substring(String.java:1768)
> > > > > > > > >       at
> > > > > > > > > org.codehaus.plexus.util.FileUtils.basename
> > (FileUtils.java
> > > > > :215)
> > > > > > > > >       at
> > > > > > > > >
> > org.codehaus.plexus.util.FileUtils.basename(FileUtils.java
> > > > > :200)
> > > > > > > > >       at
> > > > > > > > >
> > org.codehaus.mojo.natives.compiler.AbstractCompiler.getObjectF
> > > > > > > > > ile(AbstractCompiler.java :120)
> > > > > > > > >       at
> > > > > > > > >
> > org.codehaus.mojo.natives.compiler.AbstractCompiler.compile(Ab
> > > > > > > > > stractCompiler.java:66)
> > > > > > > > >       at
> > > > > > > > >
> > org.codehaus.mojo.natives.plugin.NativeCompileMojo.execute(Nat
> > > > > > > > > iveCompileMojo.java:162)
> > > > > > > > >       at
> > > > > > > > >
> > org.apache.maven.plugin.DefaultPluginManager.executeMojo(Defau
> > > > > > > > > ltPluginManager.java:412)
> > > > > > > > >       at
> > > > > > > > >
> > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoa
> > > > > > > > > ls(DefaultLifecycleExecutor.java:534)
> > > > > > > > >       at
> > > > > > > > >
> > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoa
> > > > > > > > > lWithLifecycle(DefaultLifecycleExecutor.java :475)
> > > > > > > > >       at
> > > > > > > > >
> > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoa
> > > > > > > > > l(DefaultLifecycleExecutor.java:454)
> > > > > > > > >       at
> > > > > > > > >
> > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoa
> > > > > > > > > lAndHandleFailures(DefaultLifecycleExecutor.java:306)
> > > > > > > > >       at
> > > > > > > > >
> > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTas
> > > > > > > > > kSegments(DefaultLifecycleExecutor.java:273)
> > > > > > > > >       at
> > > > > > > > >
> > org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(De
> > > > > > > > faultLifecycleExecutor.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(NativeMethodAccess
> > > > > > > > > orImpl.java:39)
> > > > > > > > >       at
> > > > > > > > >
> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> > > > > > > > > odAccessorImpl.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] Total time: 4 minutes 56 seconds
> > > > > > > > > [INFO] Finished at: Wed Sep 20 09:35:18 CDT 2006
> > > > > > > > > [INFO] Final Memory: 8M/16M
> > > > > > > > > [INFO]
> > > > > > > > >
> > --------------------------------------------------------------
> > > > > > > > > ----------
> > > > > > > > >
> > > > > > > > >
> > > > > >
> > > > >
> > ---------------------------------------------------------------------
> > > > > > > > > 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
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > > >
> > ---------------------------------------------------------------------
> > > > > 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: Error: java.lang.StringIndexOutOfBoundsException [MORE]

Posted by Brad Harper <br...@epsiia.com>.
Dan:

You might want to double check.

I have downloaded

   http://snapshots.repository.codehaus.org//org/codehaus/mojo/native-maven-plugin/1.0-alpha-2-SNAPSHOT/

and still see the same problem using a <fileName>abc</fileName>
element where the file has no suffix (or dot delimiter).

Brad

> -----Original Message-----
> From: dan tran [mailto:dantran@gmail.com]
> Sent: Wednesday, September 20, 2006 11:04 PM
> To: Maven Users List
> Subject: Re: Error: java.lang.StringIndexOutOfBoundsException [MORE]
> 
> 
> I went ahead with the fix + unit test MOJO:509 and deployed a 
> snapshot,
> please test it out
> 
> -Dan
> 
> 
> 
> On 9/20/06, dan tran <da...@gmail.com> wrote:
> >
> >  Confirm, it is a bug in plexus-util when try to get 
> basename of this
> > string
> >
> >
> >
> > 
> C:\dev\mojo\maven-native\native-maven-plugin\src\it\jni\native
> \win32\..\src\main\native\HelloWorld2
> >
> > this is windows path,
> >
> > if I convert it unix path then it is ok.
> >
> > -D
> >
> >
> >
> >  On 9/20/06, dan tran <da...@gmail.com> wrote:
> > >
> > >  that is a bug, please file it with a sample pom.
> > >
> > > Thanks
> > >
> > > -Dan
> > >
> > >
> > >  On 9/20/06, Brad Harper <brad.harper@epsiia.com > wrote:
> > > >
> > > > Dan:
> > > >
> > > > That put me on to the solution. There was a <fileName> element
> > > > following 'reindex.cpp ' that didn't have file extension [a
> > > > cut/paste error in the pom file], like
> > > >
> > > >   <fileName>abc</fileName>
> > > >
> > > > Mea culpa.
> > > >
> > > > Even so, I would think that things shouldn't crater with such
> > > > an obscure error. Basically, the named file didn't exist in
> > > > the source directory.
> > > >
> > > > Maybe AbstractCompiler shouldn't attempt to construct the object
> > > > filename (and perhaps perform other operations) until 
> it has been
> > > > determined that the source file actually exists in the source
> > > > directory.
> > > >
> > > > Thanks.
> > > >
> > > > Brad
> > > >
> > > > > -----Original Message-----
> > > > > From: dan tran [mailto:dantran@gmail.com ]
> > > > > Sent: Wednesday, September 20, 2006 6:03 PM
> > > > > To: Maven Users List
> > > > > Subject: Re: Error: 
> java.lang.StringIndexOutOfBoundsException [MORE]
> > > > >
> > > > >
> > > > > reindex.cpp compilation is ok,
> > > > >
> > > > > The compilation after reindex.cpp is the main problem
> > > > >
> > > > > -Dan
> > > > >
> > > > > On 9/20/06, dan tran < dantran@gmail.com> wrote:
> > > > > >
> > > > > >  Hi Brad, thanks for looking into this problem, do you have
> > > > > reproducable
> > > > > > test case?
> > > > > >
> > > > > > -D
> > > > > >
> > > > > >
> > > > > >  On 9/20/06, Brad Harper <br...@epsiia.com> wrote:
> > > > > > >
> > > > > > > Looking at the source code for classes
> > > > > > >
> > > > > > >   org.codehaus.mojo.natives.compiler.AbstractCompiler
> > > > > > >
> > > > > > > and
> > > > > > >
> > > > > > > org.codehaus.plexus.util.FileUtils
> > > > > > >
> > > > > > > it seems singularly odd that String.substring() would
> > > > > > > suddenly be receiving an index with a value of -17
> > > > > > > passed by the FileUtils.basename() methods.
> > > > > > >
> > > > > > > I haven't been able to affect the outcome by altering
> > > > > > > the order or names of the files involved.
> > > > > > >
> > > > > > > Method AbstractCompiler.getObjectFile () is attempting to
> > > > > > > construct the string name of the object file associated
> > > > > > > with the current source file. Looking in the target/
> > > > > > > directory, I see that the object file for source file
> > > > > > > 'reindex.cpp' has been created and exists with 
> the expected
> > > > > > > name: 'reindex.obj'.
> > > > > > >
> > > > > > > Brad
> > > > > > >
> > > > > > > > -----Original Message-----
> > > > > > > > From: Brad Harper
> > > > > > > > Sent: Wednesday, September 20, 2006 9:38 AM
> > > > > > > > To: users
> > > > > > > > Subject: Error: 
> java.lang.StringIndexOutOfBoundsException
> > > > > > > >
> > > > > > > >
> > > > > > > > Hello:
> > > > > > > >
> > > > > > > > See the FATAL ERROR from captured maven output below.
> > > > > > > >
> > > > > > > > In context, the native maven plugin is being used to
> > > > > compile a C++
> > > > > > > > source file, prior to linking an .exe application.
> > > > > > > >
> > > > > > > > Has anyone seen this sort of thing before? Thanks.
> > > > > > > >
> > > > > > > > Brad
> > > > > > > >
> > > > > > > > ....
> > > > > > > > recmods.cpp
> > > > > > > > [INFO] cl /MT /W3 /GX /DWINDOWS-X86 /DWIN32 
> /D_WINDOWS /Zi
> > > > > > > > /Od /DDEBUG /DHAVE_DONGLE
> > > > > > > > 
> -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > > > > epsiia.dxr\include\common
> > > > > > > > 
> -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > > > > epsiia.dxr\include\gui
> > > > > > > > 
> -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > > > > epsiia.dxr\include\crypt
> > > > > > > > 
> -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > >
> > > > > > > > epsiia.dxr\include\record
> > > > > > > > 
> -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > > > > epsiia.dxr\bin\dxrecord
> > > > > > > > 
> /Fop:\exodus\dxr\WINDOWS-X86\dxrecord\target\recorder.obj -c
> > > > > > > > 
> p:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.ep
> > > > > > > > siia.dxr\bin\dxrecord\recorder.cpp
> > > > > > > > Microsoft (R) 32-bit C/C++ Optimizing Compiler Version
> > > > > > > > 12.00.8804 for 80x86
> > > > > > > > Copyright (C) Microsoft Corp 1984-1998. All 
> rights reserved.
> > > > > > > >
> > > > > > > > recorder.cpp
> > > > > > > > 
> p:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.ep
> > > >
> > > > > > > > siia.dxr\bin\dxrecord\recorder.cpp(4050) : 
> warning C4101:
> > > > > > > > 'ucplogrek' : unreferenced local variable
> > > > > > > > [INFO] cl /MT /W3 /GX /DWINDOWS-X86 /DWIN32 
> /D_WINDOWS /Zi
> > > > > > > > /Od /DDEBUG /DHAVE_DONGLE
> > > > > > > > 
> -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > > > > epsiia.dxr\include\common
> > > > > > > > 
> -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > >
> > > > > > > > epsiia.dxr\include\gui
> > > > > > > > 
> -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > > > > epsiia.dxr\include\crypt
> > > > > > > > 
> -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > >
> > > > > > > > epsiia.dxr\include\record
> > > > > > > > 
> -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > > > > epsiia.dxr\bin\dxrecord
> > > > > > > > 
> /Fop:\exodus\dxr\WINDOWS-X86\dxrecord\target\reindex.obj -c
> > > > > > > > 
> p:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.ep
> > > > > > > > siia.dxr\bin\dxrecord\reindex.cpp
> > > > > > > > Microsoft (R) 32-bit C/C++ Optimizing Compiler Version
> > > > > > > > 12.00.8804 for 80x86
> > > > > > > > Copyright (C) Microsoft Corp 1984-1998. All 
> rights reserved.
> > > > > > > >
> > > > > > > > reindex.cpp
> > > > > > > > [INFO]
> > > > > > > > 
> --------------------------------------------------------------
> > > >
> > > > > > > > ----------
> > > > > > > > [ERROR] FATAL ERROR
> > > > > > > > [INFO]
> > > > > > > > 
> --------------------------------------------------------------
> > > > > > > > ----------
> > > > > > > > [INFO] String index out of range: -17
> > > > > > > > [INFO]
> > > > > > > > 
> --------------------------------------------------------------
> > > > > > > > ----------
> > > > > > > > [DEBUG] Trace
> > > > > > > > java.lang.StringIndexOutOfBoundsException: 
> String index out
> > > > > > > > of range: -17
> > > > > > > >       at java.lang.String.substring(String.java:1768)
> > > > > > > >       at
> > > > > > > > org.codehaus.plexus.util.FileUtils.basename 
> (FileUtils.java
> > > > :215)
> > > > > > > >       at
> > > > > > > > 
> org.codehaus.plexus.util.FileUtils.basename(FileUtils.java
> > > > :200)
> > > > > > > >       at
> > > > > > > > 
> org.codehaus.mojo.natives.compiler.AbstractCompiler.getObjectF
> > > > > > > > ile(AbstractCompiler.java :120)
> > > > > > > >       at
> > > > > > > > 
> org.codehaus.mojo.natives.compiler.AbstractCompiler.compile(Ab
> > > > > > > > stractCompiler.java:66)
> > > > > > > >       at
> > > > > > > > 
> org.codehaus.mojo.natives.plugin.NativeCompileMojo.execute(Nat
> > > > > > > > iveCompileMojo.java:162)
> > > > > > > >       at
> > > > > > > > 
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(Defau
> > > > > > > > ltPluginManager.java:412)
> > > > > > > >       at
> > > > > > > > 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoa
> > > > > > > > ls(DefaultLifecycleExecutor.java:534)
> > > > > > > >       at
> > > > > > > > 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoa
> > > > > > > > lWithLifecycle(DefaultLifecycleExecutor.java :475)
> > > > > > > >       at
> > > > > > > > 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoa
> > > > > > > > l(DefaultLifecycleExecutor.java:454)
> > > > > > > >       at
> > > > > > > > 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoa
> > > > > > > > lAndHandleFailures(DefaultLifecycleExecutor.java:306)
> > > > > > > >       at
> > > > > > > > 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTas
> > > > > > > > kSegments(DefaultLifecycleExecutor.java:273)
> > > > > > > >       at
> > > > > > > > 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(De
> > > > > > > faultLifecycleExecutor.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(NativeMethodAccess
> > > > > > > > orImpl.java:39)
> > > > > > > >       at
> > > > > > > > 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> > > > > > > > odAccessorImpl.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] Total time: 4 minutes 56 seconds
> > > > > > > > [INFO] Finished at: Wed Sep 20 09:35:18 CDT 2006
> > > > > > > > [INFO] Final Memory: 8M/16M
> > > > > > > > [INFO]
> > > > > > > > 
> --------------------------------------------------------------
> > > > > > > > ----------
> > > > > > > >
> > > > > > > >
> > > > >
> > > > 
> ---------------------------------------------------------------------
> > > > > > > > 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
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > > > 
> ---------------------------------------------------------------------
> > > > 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: Error: java.lang.StringIndexOutOfBoundsException [MORE]

Posted by dan tran <da...@gmail.com>.
I went ahead with the fix + unit test MOJO:509 and deployed a snapshot,
please test it out

-Dan



On 9/20/06, dan tran <da...@gmail.com> wrote:
>
>  Confirm, it is a bug in plexus-util when try to get basename of this
> string
>
>
>
> C:\dev\mojo\maven-native\native-maven-plugin\src\it\jni\native\win32\..\src\main\native\HelloWorld2
>
> this is windows path,
>
> if I convert it unix path then it is ok.
>
> -D
>
>
>
>  On 9/20/06, dan tran <da...@gmail.com> wrote:
> >
> >  that is a bug, please file it with a sample pom.
> >
> > Thanks
> >
> > -Dan
> >
> >
> >  On 9/20/06, Brad Harper <brad.harper@epsiia.com > wrote:
> > >
> > > Dan:
> > >
> > > That put me on to the solution. There was a <fileName> element
> > > following 'reindex.cpp ' that didn't have file extension [a
> > > cut/paste error in the pom file], like
> > >
> > >   <fileName>abc</fileName>
> > >
> > > Mea culpa.
> > >
> > > Even so, I would think that things shouldn't crater with such
> > > an obscure error. Basically, the named file didn't exist in
> > > the source directory.
> > >
> > > Maybe AbstractCompiler shouldn't attempt to construct the object
> > > filename (and perhaps perform other operations) until it has been
> > > determined that the source file actually exists in the source
> > > directory.
> > >
> > > Thanks.
> > >
> > > Brad
> > >
> > > > -----Original Message-----
> > > > From: dan tran [mailto:dantran@gmail.com ]
> > > > Sent: Wednesday, September 20, 2006 6:03 PM
> > > > To: Maven Users List
> > > > Subject: Re: Error: java.lang.StringIndexOutOfBoundsException [MORE]
> > > >
> > > >
> > > > reindex.cpp compilation is ok,
> > > >
> > > > The compilation after reindex.cpp is the main problem
> > > >
> > > > -Dan
> > > >
> > > > On 9/20/06, dan tran < dantran@gmail.com> wrote:
> > > > >
> > > > >  Hi Brad, thanks for looking into this problem, do you have
> > > > reproducable
> > > > > test case?
> > > > >
> > > > > -D
> > > > >
> > > > >
> > > > >  On 9/20/06, Brad Harper <br...@epsiia.com> wrote:
> > > > > >
> > > > > > Looking at the source code for classes
> > > > > >
> > > > > >   org.codehaus.mojo.natives.compiler.AbstractCompiler
> > > > > >
> > > > > > and
> > > > > >
> > > > > > org.codehaus.plexus.util.FileUtils
> > > > > >
> > > > > > it seems singularly odd that String.substring() would
> > > > > > suddenly be receiving an index with a value of -17
> > > > > > passed by the FileUtils.basename() methods.
> > > > > >
> > > > > > I haven't been able to affect the outcome by altering
> > > > > > the order or names of the files involved.
> > > > > >
> > > > > > Method AbstractCompiler.getObjectFile () is attempting to
> > > > > > construct the string name of the object file associated
> > > > > > with the current source file. Looking in the target/
> > > > > > directory, I see that the object file for source file
> > > > > > 'reindex.cpp' has been created and exists with the expected
> > > > > > name: 'reindex.obj'.
> > > > > >
> > > > > > Brad
> > > > > >
> > > > > > > -----Original Message-----
> > > > > > > From: Brad Harper
> > > > > > > Sent: Wednesday, September 20, 2006 9:38 AM
> > > > > > > To: users
> > > > > > > Subject: Error: java.lang.StringIndexOutOfBoundsException
> > > > > > >
> > > > > > >
> > > > > > > Hello:
> > > > > > >
> > > > > > > See the FATAL ERROR from captured maven output below.
> > > > > > >
> > > > > > > In context, the native maven plugin is being used to
> > > > compile a C++
> > > > > > > source file, prior to linking an .exe application.
> > > > > > >
> > > > > > > Has anyone seen this sort of thing before? Thanks.
> > > > > > >
> > > > > > > Brad
> > > > > > >
> > > > > > > ....
> > > > > > > recmods.cpp
> > > > > > > [INFO] cl /MT /W3 /GX /DWINDOWS-X86 /DWIN32 /D_WINDOWS /Zi
> > > > > > > /Od /DDEBUG /DHAVE_DONGLE
> > > > > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > > > epsiia.dxr\include\common
> > > > > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > > > epsiia.dxr\include\gui
> > > > > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > > > epsiia.dxr\include\crypt
> > > > > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > >
> > > > > > > epsiia.dxr\include\record
> > > > > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > > > epsiia.dxr\bin\dxrecord
> > > > > > > /Fop:\exodus\dxr\WINDOWS-X86\dxrecord\target\recorder.obj -c
> > > > > > > p:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.ep
> > > > > > > siia.dxr\bin\dxrecord\recorder.cpp
> > > > > > > Microsoft (R) 32-bit C/C++ Optimizing Compiler Version
> > > > > > > 12.00.8804 for 80x86
> > > > > > > Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
> > > > > > >
> > > > > > > recorder.cpp
> > > > > > > p:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.ep
> > >
> > > > > > > siia.dxr\bin\dxrecord\recorder.cpp(4050) : warning C4101:
> > > > > > > 'ucplogrek' : unreferenced local variable
> > > > > > > [INFO] cl /MT /W3 /GX /DWINDOWS-X86 /DWIN32 /D_WINDOWS /Zi
> > > > > > > /Od /DDEBUG /DHAVE_DONGLE
> > > > > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > > > epsiia.dxr\include\common
> > > > > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > >
> > > > > > > epsiia.dxr\include\gui
> > > > > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > > > epsiia.dxr\include\crypt
> > > > > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > >
> > > > > > > epsiia.dxr\include\record
> > > > > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > > > epsiia.dxr\bin\dxrecord
> > > > > > > /Fop:\exodus\dxr\WINDOWS-X86\dxrecord\target\reindex.obj -c
> > > > > > > p:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.ep
> > > > > > > siia.dxr\bin\dxrecord\reindex.cpp
> > > > > > > Microsoft (R) 32-bit C/C++ Optimizing Compiler Version
> > > > > > > 12.00.8804 for 80x86
> > > > > > > Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
> > > > > > >
> > > > > > > reindex.cpp
> > > > > > > [INFO]
> > > > > > > --------------------------------------------------------------
> > >
> > > > > > > ----------
> > > > > > > [ERROR] FATAL ERROR
> > > > > > > [INFO]
> > > > > > > --------------------------------------------------------------
> > > > > > > ----------
> > > > > > > [INFO] String index out of range: -17
> > > > > > > [INFO]
> > > > > > > --------------------------------------------------------------
> > > > > > > ----------
> > > > > > > [DEBUG] Trace
> > > > > > > java.lang.StringIndexOutOfBoundsException: String index out
> > > > > > > of range: -17
> > > > > > >       at java.lang.String.substring(String.java:1768)
> > > > > > >       at
> > > > > > > org.codehaus.plexus.util.FileUtils.basename (FileUtils.java
> > > :215)
> > > > > > >       at
> > > > > > > org.codehaus.plexus.util.FileUtils.basename(FileUtils.java
> > > :200)
> > > > > > >       at
> > > > > > > org.codehaus.mojo.natives.compiler.AbstractCompiler.getObjectF
> > > > > > > ile(AbstractCompiler.java :120)
> > > > > > >       at
> > > > > > > org.codehaus.mojo.natives.compiler.AbstractCompiler.compile(Ab
> > > > > > > stractCompiler.java:66)
> > > > > > >       at
> > > > > > > org.codehaus.mojo.natives.plugin.NativeCompileMojo.execute(Nat
> > > > > > > iveCompileMojo.java:162)
> > > > > > >       at
> > > > > > > org.apache.maven.plugin.DefaultPluginManager.executeMojo(Defau
> > > > > > > ltPluginManager.java:412)
> > > > > > >       at
> > > > > > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoa
> > > > > > > ls(DefaultLifecycleExecutor.java:534)
> > > > > > >       at
> > > > > > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoa
> > > > > > > lWithLifecycle(DefaultLifecycleExecutor.java :475)
> > > > > > >       at
> > > > > > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoa
> > > > > > > l(DefaultLifecycleExecutor.java:454)
> > > > > > >       at
> > > > > > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoa
> > > > > > > lAndHandleFailures(DefaultLifecycleExecutor.java:306)
> > > > > > >       at
> > > > > > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTas
> > > > > > > kSegments(DefaultLifecycleExecutor.java:273)
> > > > > > >       at
> > > > > > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(De
> > > > > > faultLifecycleExecutor.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(NativeMethodAccess
> > > > > > > orImpl.java:39)
> > > > > > >       at
> > > > > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> > > > > > > odAccessorImpl.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] Total time: 4 minutes 56 seconds
> > > > > > > [INFO] Finished at: Wed Sep 20 09:35:18 CDT 2006
> > > > > > > [INFO] Final Memory: 8M/16M
> > > > > > > [INFO]
> > > > > > > --------------------------------------------------------------
> > > > > > > ----------
> > > > > > >
> > > > > > >
> > > >
> > > ---------------------------------------------------------------------
> > > > > > > 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
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: users-help@maven.apache.org
> > >
> > >
> >
>

Re: Error: java.lang.StringIndexOutOfBoundsException [MORE]

Posted by dan tran <da...@gmail.com>.
Confirm, it is a bug in plexus-util when try to get basename of this string


C:\dev\mojo\maven-native\native-maven-plugin\src\it\jni\native\win32\..\src\main\native\HelloWorld2

this is windows path,

if I convert it unix path then it is ok.

-D



On 9/20/06, dan tran <da...@gmail.com> wrote:
>
>  that is a bug, please file it with a sample pom.
>
> Thanks
>
> -Dan
>
>
>  On 9/20/06, Brad Harper <br...@epsiia.com> wrote:
> >
> > Dan:
> >
> > That put me on to the solution. There was a <fileName> element
> > following 'reindex.cpp ' that didn't have file extension [a
> > cut/paste error in the pom file], like
> >
> >   <fileName>abc</fileName>
> >
> > Mea culpa.
> >
> > Even so, I would think that things shouldn't crater with such
> > an obscure error. Basically, the named file didn't exist in
> > the source directory.
> >
> > Maybe AbstractCompiler shouldn't attempt to construct the object
> > filename (and perhaps perform other operations) until it has been
> > determined that the source file actually exists in the source
> > directory.
> >
> > Thanks.
> >
> > Brad
> >
> > > -----Original Message-----
> > > From: dan tran [mailto:dantran@gmail.com]
> > > Sent: Wednesday, September 20, 2006 6:03 PM
> > > To: Maven Users List
> > > Subject: Re: Error: java.lang.StringIndexOutOfBoundsException [MORE]
> > >
> > >
> > > reindex.cpp compilation is ok,
> > >
> > > The compilation after reindex.cpp is the main problem
> > >
> > > -Dan
> > >
> > > On 9/20/06, dan tran <da...@gmail.com> wrote:
> > > >
> > > >  Hi Brad, thanks for looking into this problem, do you have
> > > reproducable
> > > > test case?
> > > >
> > > > -D
> > > >
> > > >
> > > >  On 9/20/06, Brad Harper <br...@epsiia.com> wrote:
> > > > >
> > > > > Looking at the source code for classes
> > > > >
> > > > >   org.codehaus.mojo.natives.compiler.AbstractCompiler
> > > > >
> > > > > and
> > > > >
> > > > > org.codehaus.plexus.util.FileUtils
> > > > >
> > > > > it seems singularly odd that String.substring() would
> > > > > suddenly be receiving an index with a value of -17
> > > > > passed by the FileUtils.basename() methods.
> > > > >
> > > > > I haven't been able to affect the outcome by altering
> > > > > the order or names of the files involved.
> > > > >
> > > > > Method AbstractCompiler.getObjectFile () is attempting to
> > > > > construct the string name of the object file associated
> > > > > with the current source file. Looking in the target/
> > > > > directory, I see that the object file for source file
> > > > > 'reindex.cpp' has been created and exists with the expected
> > > > > name: 'reindex.obj'.
> > > > >
> > > > > Brad
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: Brad Harper
> > > > > > Sent: Wednesday, September 20, 2006 9:38 AM
> > > > > > To: users
> > > > > > Subject: Error: java.lang.StringIndexOutOfBoundsException
> > > > > >
> > > > > >
> > > > > > Hello:
> > > > > >
> > > > > > See the FATAL ERROR from captured maven output below.
> > > > > >
> > > > > > In context, the native maven plugin is being used to
> > > compile a C++
> > > > > > source file, prior to linking an .exe application.
> > > > > >
> > > > > > Has anyone seen this sort of thing before? Thanks.
> > > > > >
> > > > > > Brad
> > > > > >
> > > > > > ....
> > > > > > recmods.cpp
> > > > > > [INFO] cl /MT /W3 /GX /DWINDOWS-X86 /DWIN32 /D_WINDOWS /Zi
> > > > > > /Od /DDEBUG /DHAVE_DONGLE
> > > > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > > epsiia.dxr\include\common
> > > > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > > epsiia.dxr\include\gui
> > > > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > > epsiia.dxr\include\crypt
> > > > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > > epsiia.dxr\include\record
> > > > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > > epsiia.dxr\bin\dxrecord
> > > > > > /Fop:\exodus\dxr\WINDOWS-X86\dxrecord\target\recorder.obj -c
> > > > > > p:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.ep
> > > > > > siia.dxr\bin\dxrecord\recorder.cpp
> > > > > > Microsoft (R) 32-bit C/C++ Optimizing Compiler Version
> > > > > > 12.00.8804 for 80x86
> > > > > > Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
> > > > > >
> > > > > > recorder.cpp
> > > > > > p:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.ep
> > > > > > siia.dxr\bin\dxrecord\recorder.cpp(4050) : warning C4101:
> > > > > > 'ucplogrek' : unreferenced local variable
> > > > > > [INFO] cl /MT /W3 /GX /DWINDOWS-X86 /DWIN32 /D_WINDOWS /Zi
> > > > > > /Od /DDEBUG /DHAVE_DONGLE
> > > > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > > epsiia.dxr\include\common
> > > > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > > epsiia.dxr\include\gui
> > > > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > > epsiia.dxr\include\crypt
> > > > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > > epsiia.dxr\include\record
> > > > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > > epsiia.dxr\bin\dxrecord
> > > > > > /Fop:\exodus\dxr\WINDOWS-X86\dxrecord\target\reindex.obj -c
> > > > > > p:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.ep
> > > > > > siia.dxr\bin\dxrecord\reindex.cpp
> > > > > > Microsoft (R) 32-bit C/C++ Optimizing Compiler Version
> > > > > > 12.00.8804 for 80x86
> > > > > > Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
> > > > > >
> > > > > > reindex.cpp
> > > > > > [INFO]
> > > > > > --------------------------------------------------------------
> > > > > > ----------
> > > > > > [ERROR] FATAL ERROR
> > > > > > [INFO]
> > > > > > --------------------------------------------------------------
> > > > > > ----------
> > > > > > [INFO] String index out of range: -17
> > > > > > [INFO]
> > > > > > --------------------------------------------------------------
> > > > > > ----------
> > > > > > [DEBUG] Trace
> > > > > > java.lang.StringIndexOutOfBoundsException: String index out
> > > > > > of range: -17
> > > > > >       at java.lang.String.substring(String.java:1768)
> > > > > >       at
> > > > > > org.codehaus.plexus.util.FileUtils.basename (FileUtils.java:215)
> > > > > >       at
> > > > > > org.codehaus.plexus.util.FileUtils.basename(FileUtils.java:200)
> > > > > >       at
> > > > > > org.codehaus.mojo.natives.compiler.AbstractCompiler.getObjectF
> > > > > > ile(AbstractCompiler.java :120)
> > > > > >       at
> > > > > > org.codehaus.mojo.natives.compiler.AbstractCompiler.compile (Ab
> > > > > > stractCompiler.java:66)
> > > > > >       at
> > > > > > org.codehaus.mojo.natives.plugin.NativeCompileMojo.execute(Nat
> > > > > > iveCompileMojo.java:162)
> > > > > >       at
> > > > > > org.apache.maven.plugin.DefaultPluginManager.executeMojo(Defau
> > > > > > ltPluginManager.java:412)
> > > > > >       at
> > > > > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoa
> > > > > > ls(DefaultLifecycleExecutor.java:534)
> > > > > >       at
> > > > > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoa
> > > > > > lWithLifecycle(DefaultLifecycleExecutor.java :475)
> > > > > >       at
> > > > > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoa
> > > > > > l(DefaultLifecycleExecutor.java:454)
> > > > > >       at
> > > > > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoa
> > > > > > lAndHandleFailures(DefaultLifecycleExecutor.java:306)
> > > > > >       at
> > > > > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTas
> > > > > > kSegments(DefaultLifecycleExecutor.java:273)
> > > > > >       at
> > > > > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(De
> > > > > faultLifecycleExecutor.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(NativeMethodAccess
> > > > > > orImpl.java:39)
> > > > > >       at
> > > > > > sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMeth
> > > > > > odAccessorImpl.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] Total time: 4 minutes 56 seconds
> > > > > > [INFO] Finished at: Wed Sep 20 09:35:18 CDT 2006
> > > > > > [INFO] Final Memory: 8M/16M
> > > > > > [INFO]
> > > > > > --------------------------------------------------------------
> > > > > > ----------
> > > > > >
> > > > > >
> > > ---------------------------------------------------------------------
> > > > > > 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
> > > > >
> > > > >
> > > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>

Re: Error: java.lang.StringIndexOutOfBoundsException [MORE]

Posted by dan tran <da...@gmail.com>.
that is a bug, please file it with a sample pom.

Thanks

-Dan


On 9/20/06, Brad Harper <br...@epsiia.com> wrote:
>
> Dan:
>
> That put me on to the solution. There was a <fileName> element
> following 'reindex.cpp' that didn't have file extension [a
> cut/paste error in the pom file], like
>
>   <fileName>abc</fileName>
>
> Mea culpa.
>
> Even so, I would think that things shouldn't crater with such
> an obscure error. Basically, the named file didn't exist in
> the source directory.
>
> Maybe AbstractCompiler shouldn't attempt to construct the object
> filename (and perhaps perform other operations) until it has been
> determined that the source file actually exists in the source
> directory.
>
> Thanks.
>
> Brad
>
> > -----Original Message-----
> > From: dan tran [mailto:dantran@gmail.com]
> > Sent: Wednesday, September 20, 2006 6:03 PM
> > To: Maven Users List
> > Subject: Re: Error: java.lang.StringIndexOutOfBoundsException [MORE]
> >
> >
> > reindex.cpp compilation is ok,
> >
> > The compilation after reindex.cpp is the main problem
> >
> > -Dan
> >
> > On 9/20/06, dan tran <da...@gmail.com> wrote:
> > >
> > >  Hi Brad, thanks for looking into this problem, do you have
> > reproducable
> > > test case?
> > >
> > > -D
> > >
> > >
> > >  On 9/20/06, Brad Harper <br...@epsiia.com> wrote:
> > > >
> > > > Looking at the source code for classes
> > > >
> > > >   org.codehaus.mojo.natives.compiler.AbstractCompiler
> > > >
> > > > and
> > > >
> > > > org.codehaus.plexus.util.FileUtils
> > > >
> > > > it seems singularly odd that String.substring() would
> > > > suddenly be receiving an index with a value of -17
> > > > passed by the FileUtils.basename() methods.
> > > >
> > > > I haven't been able to affect the outcome by altering
> > > > the order or names of the files involved.
> > > >
> > > > Method AbstractCompiler.getObjectFile() is attempting to
> > > > construct the string name of the object file associated
> > > > with the current source file. Looking in the target/
> > > > directory, I see that the object file for source file
> > > > 'reindex.cpp' has been created and exists with the expected
> > > > name: 'reindex.obj'.
> > > >
> > > > Brad
> > > >
> > > > > -----Original Message-----
> > > > > From: Brad Harper
> > > > > Sent: Wednesday, September 20, 2006 9:38 AM
> > > > > To: users
> > > > > Subject: Error: java.lang.StringIndexOutOfBoundsException
> > > > >
> > > > >
> > > > > Hello:
> > > > >
> > > > > See the FATAL ERROR from captured maven output below.
> > > > >
> > > > > In context, the native maven plugin is being used to
> > compile a C++
> > > > > source file, prior to linking an .exe application.
> > > > >
> > > > > Has anyone seen this sort of thing before? Thanks.
> > > > >
> > > > > Brad
> > > > >
> > > > > ....
> > > > > recmods.cpp
> > > > > [INFO] cl /MT /W3 /GX /DWINDOWS-X86 /DWIN32 /D_WINDOWS /Zi
> > > > > /Od /DDEBUG /DHAVE_DONGLE
> > > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > epsiia.dxr\include\common
> > > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > epsiia.dxr\include\gui
> > > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > epsiia.dxr\include\crypt
> > > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > epsiia.dxr\include\record
> > > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > epsiia.dxr\bin\dxrecord
> > > > > /Fop:\exodus\dxr\WINDOWS-X86\dxrecord\target\recorder.obj -c
> > > > > p:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.ep
> > > > > siia.dxr\bin\dxrecord\recorder.cpp
> > > > > Microsoft (R) 32-bit C/C++ Optimizing Compiler Version
> > > > > 12.00.8804 for 80x86
> > > > > Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
> > > > >
> > > > > recorder.cpp
> > > > > p:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.ep
> > > > > siia.dxr\bin\dxrecord\recorder.cpp(4050) : warning C4101:
> > > > > 'ucplogrek' : unreferenced local variable
> > > > > [INFO] cl /MT /W3 /GX /DWINDOWS-X86 /DWIN32 /D_WINDOWS /Zi
> > > > > /Od /DDEBUG /DHAVE_DONGLE
> > > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > epsiia.dxr\include\common
> > > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > epsiia.dxr\include\gui
> > > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > epsiia.dxr\include\crypt
> > > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > epsiia.dxr\include\record
> > > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > epsiia.dxr\bin\dxrecord
> > > > > /Fop:\exodus\dxr\WINDOWS-X86\dxrecord\target\reindex.obj -c
> > > > > p:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.ep
> > > > > siia.dxr\bin\dxrecord\reindex.cpp
> > > > > Microsoft (R) 32-bit C/C++ Optimizing Compiler Version
> > > > > 12.00.8804 for 80x86
> > > > > Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
> > > > >
> > > > > reindex.cpp
> > > > > [INFO]
> > > > > --------------------------------------------------------------
> > > > > ----------
> > > > > [ERROR] FATAL ERROR
> > > > > [INFO]
> > > > > --------------------------------------------------------------
> > > > > ----------
> > > > > [INFO] String index out of range: -17
> > > > > [INFO]
> > > > > --------------------------------------------------------------
> > > > > ----------
> > > > > [DEBUG] Trace
> > > > > java.lang.StringIndexOutOfBoundsException: String index out
> > > > > of range: -17
> > > > >       at java.lang.String.substring(String.java:1768)
> > > > >       at
> > > > > org.codehaus.plexus.util.FileUtils.basename (FileUtils.java:215)
> > > > >       at
> > > > > org.codehaus.plexus.util.FileUtils.basename(FileUtils.java:200)
> > > > >       at
> > > > > org.codehaus.mojo.natives.compiler.AbstractCompiler.getObjectF
> > > > > ile(AbstractCompiler.java :120)
> > > > >       at
> > > > > org.codehaus.mojo.natives.compiler.AbstractCompiler.compile(Ab
> > > > > stractCompiler.java:66)
> > > > >       at
> > > > > org.codehaus.mojo.natives.plugin.NativeCompileMojo.execute(Nat
> > > > > iveCompileMojo.java:162)
> > > > >       at
> > > > > org.apache.maven.plugin.DefaultPluginManager.executeMojo(Defau
> > > > > ltPluginManager.java:412)
> > > > >       at
> > > > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoa
> > > > > ls(DefaultLifecycleExecutor.java:534)
> > > > >       at
> > > > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoa
> > > > > lWithLifecycle(DefaultLifecycleExecutor.java:475)
> > > > >       at
> > > > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoa
> > > > > l(DefaultLifecycleExecutor.java:454)
> > > > >       at
> > > > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoa
> > > > > lAndHandleFailures(DefaultLifecycleExecutor.java:306)
> > > > >       at
> > > > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTas
> > > > > kSegments(DefaultLifecycleExecutor.java:273)
> > > > >       at
> > > > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(De
> > > > faultLifecycleExecutor.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(NativeMethodAccess
> > > > > orImpl.java:39)
> > > > >       at
> > > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> > > > > odAccessorImpl.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] Total time: 4 minutes 56 seconds
> > > > > [INFO] Finished at: Wed Sep 20 09:35:18 CDT 2006
> > > > > [INFO] Final Memory: 8M/16M
> > > > > [INFO]
> > > > > --------------------------------------------------------------
> > > > > ----------
> > > > >
> > > > >
> > ---------------------------------------------------------------------
> > > > > 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
> > > >
> > > >
> > >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

RE: Error: java.lang.StringIndexOutOfBoundsException [MORE]

Posted by Brad Harper <br...@epsiia.com>.
Dan:

That put me on to the solution. There was a <fileName> element
following 'reindex.cpp' that didn't have file extension [a
cut/paste error in the pom file], like

   <fileName>abc</fileName>

Mea culpa.

Even so, I would think that things shouldn't crater with such
an obscure error. Basically, the named file didn't exist in
the source directory.

Maybe AbstractCompiler shouldn't attempt to construct the object
filename (and perhaps perform other operations) until it has been
determined that the source file actually exists in the source
directory.

Thanks.

Brad

> -----Original Message-----
> From: dan tran [mailto:dantran@gmail.com]
> Sent: Wednesday, September 20, 2006 6:03 PM
> To: Maven Users List
> Subject: Re: Error: java.lang.StringIndexOutOfBoundsException [MORE]
> 
> 
> reindex.cpp compilation is ok,
> 
> The compilation after reindex.cpp is the main problem
> 
> -Dan
> 
> On 9/20/06, dan tran <da...@gmail.com> wrote:
> >
> >  Hi Brad, thanks for looking into this problem, do you have 
> reproducable
> > test case?
> >
> > -D
> >
> >
> >  On 9/20/06, Brad Harper <br...@epsiia.com> wrote:
> > >
> > > Looking at the source code for classes
> > >
> > >   org.codehaus.mojo.natives.compiler.AbstractCompiler
> > >
> > > and
> > >
> > > org.codehaus.plexus.util.FileUtils
> > >
> > > it seems singularly odd that String.substring() would
> > > suddenly be receiving an index with a value of -17
> > > passed by the FileUtils.basename() methods.
> > >
> > > I haven't been able to affect the outcome by altering
> > > the order or names of the files involved.
> > >
> > > Method AbstractCompiler.getObjectFile() is attempting to
> > > construct the string name of the object file associated
> > > with the current source file. Looking in the target/
> > > directory, I see that the object file for source file
> > > 'reindex.cpp' has been created and exists with the expected
> > > name: 'reindex.obj'.
> > >
> > > Brad
> > >
> > > > -----Original Message-----
> > > > From: Brad Harper
> > > > Sent: Wednesday, September 20, 2006 9:38 AM
> > > > To: users
> > > > Subject: Error: java.lang.StringIndexOutOfBoundsException
> > > >
> > > >
> > > > Hello:
> > > >
> > > > See the FATAL ERROR from captured maven output below.
> > > >
> > > > In context, the native maven plugin is being used to 
> compile a C++
> > > > source file, prior to linking an .exe application.
> > > >
> > > > Has anyone seen this sort of thing before? Thanks.
> > > >
> > > > Brad
> > > >
> > > > ....
> > > > recmods.cpp
> > > > [INFO] cl /MT /W3 /GX /DWINDOWS-X86 /DWIN32 /D_WINDOWS /Zi
> > > > /Od /DDEBUG /DHAVE_DONGLE
> > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > epsiia.dxr\include\common
> > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > epsiia.dxr\include\gui
> > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > epsiia.dxr\include\crypt
> > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > epsiia.dxr\include\record
> > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > epsiia.dxr\bin\dxrecord
> > > > /Fop:\exodus\dxr\WINDOWS-X86\dxrecord\target\recorder.obj -c
> > > > p:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.ep
> > > > siia.dxr\bin\dxrecord\recorder.cpp
> > > > Microsoft (R) 32-bit C/C++ Optimizing Compiler Version
> > > > 12.00.8804 for 80x86
> > > > Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
> > > >
> > > > recorder.cpp
> > > > p:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.ep
> > > > siia.dxr\bin\dxrecord\recorder.cpp(4050) : warning C4101:
> > > > 'ucplogrek' : unreferenced local variable
> > > > [INFO] cl /MT /W3 /GX /DWINDOWS-X86 /DWIN32 /D_WINDOWS /Zi
> > > > /Od /DDEBUG /DHAVE_DONGLE
> > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > epsiia.dxr\include\common
> > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > epsiia.dxr\include\gui
> > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > epsiia.dxr\include\crypt
> > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > epsiia.dxr\include\record
> > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > epsiia.dxr\bin\dxrecord
> > > > /Fop:\exodus\dxr\WINDOWS-X86\dxrecord\target\reindex.obj -c
> > > > p:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.ep
> > > > siia.dxr\bin\dxrecord\reindex.cpp
> > > > Microsoft (R) 32-bit C/C++ Optimizing Compiler Version
> > > > 12.00.8804 for 80x86
> > > > Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
> > > >
> > > > reindex.cpp
> > > > [INFO]
> > > > --------------------------------------------------------------
> > > > ----------
> > > > [ERROR] FATAL ERROR
> > > > [INFO]
> > > > --------------------------------------------------------------
> > > > ----------
> > > > [INFO] String index out of range: -17
> > > > [INFO]
> > > > --------------------------------------------------------------
> > > > ----------
> > > > [DEBUG] Trace
> > > > java.lang.StringIndexOutOfBoundsException: String index out
> > > > of range: -17
> > > >       at java.lang.String.substring(String.java:1768)
> > > >       at
> > > > org.codehaus.plexus.util.FileUtils.basename (FileUtils.java:215)
> > > >       at
> > > > org.codehaus.plexus.util.FileUtils.basename(FileUtils.java:200)
> > > >       at
> > > > org.codehaus.mojo.natives.compiler.AbstractCompiler.getObjectF
> > > > ile(AbstractCompiler.java :120)
> > > >       at
> > > > org.codehaus.mojo.natives.compiler.AbstractCompiler.compile(Ab
> > > > stractCompiler.java:66)
> > > >       at
> > > > org.codehaus.mojo.natives.plugin.NativeCompileMojo.execute(Nat
> > > > iveCompileMojo.java:162)
> > > >       at
> > > > org.apache.maven.plugin.DefaultPluginManager.executeMojo(Defau
> > > > ltPluginManager.java:412)
> > > >       at
> > > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoa
> > > > ls(DefaultLifecycleExecutor.java:534)
> > > >       at
> > > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoa
> > > > lWithLifecycle(DefaultLifecycleExecutor.java:475)
> > > >       at
> > > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoa
> > > > l(DefaultLifecycleExecutor.java:454)
> > > >       at
> > > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoa
> > > > lAndHandleFailures(DefaultLifecycleExecutor.java:306)
> > > >       at
> > > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTas
> > > > kSegments(DefaultLifecycleExecutor.java:273)
> > > >       at
> > > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(De
> > > faultLifecycleExecutor.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(NativeMethodAccess
> > > > orImpl.java:39)
> > > >       at
> > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> > > > odAccessorImpl.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] Total time: 4 minutes 56 seconds
> > > > [INFO] Finished at: Wed Sep 20 09:35:18 CDT 2006
> > > > [INFO] Final Memory: 8M/16M
> > > > [INFO]
> > > > --------------------------------------------------------------
> > > > ----------
> > > >
> > > > 
> ---------------------------------------------------------------------
> > > > 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
> > >
> > >
> >
> 

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


Re: Error: java.lang.StringIndexOutOfBoundsException [MORE]

Posted by dan tran <da...@gmail.com>.
reindex.cpp compilation is ok,

The compilation after reindex.cpp is the main problem

-Dan

On 9/20/06, dan tran <da...@gmail.com> wrote:
>
>  Hi Brad, thanks for looking into this problem, do you have reproducable
> test case?
>
> -D
>
>
>  On 9/20/06, Brad Harper <br...@epsiia.com> wrote:
> >
> > Looking at the source code for classes
> >
> >   org.codehaus.mojo.natives.compiler.AbstractCompiler
> >
> > and
> >
> > org.codehaus.plexus.util.FileUtils
> >
> > it seems singularly odd that String.substring() would
> > suddenly be receiving an index with a value of -17
> > passed by the FileUtils.basename() methods.
> >
> > I haven't been able to affect the outcome by altering
> > the order or names of the files involved.
> >
> > Method AbstractCompiler.getObjectFile() is attempting to
> > construct the string name of the object file associated
> > with the current source file. Looking in the target/
> > directory, I see that the object file for source file
> > 'reindex.cpp' has been created and exists with the expected
> > name: 'reindex.obj'.
> >
> > Brad
> >
> > > -----Original Message-----
> > > From: Brad Harper
> > > Sent: Wednesday, September 20, 2006 9:38 AM
> > > To: users
> > > Subject: Error: java.lang.StringIndexOutOfBoundsException
> > >
> > >
> > > Hello:
> > >
> > > See the FATAL ERROR from captured maven output below.
> > >
> > > In context, the native maven plugin is being used to compile a C++
> > > source file, prior to linking an .exe application.
> > >
> > > Has anyone seen this sort of thing before? Thanks.
> > >
> > > Brad
> > >
> > > ....
> > > recmods.cpp
> > > [INFO] cl /MT /W3 /GX /DWINDOWS-X86 /DWIN32 /D_WINDOWS /Zi
> > > /Od /DDEBUG /DHAVE_DONGLE
> > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > epsiia.dxr\include\common
> > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > epsiia.dxr\include\gui
> > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > epsiia.dxr\include\crypt
> > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > epsiia.dxr\include\record
> > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > epsiia.dxr\bin\dxrecord
> > > /Fop:\exodus\dxr\WINDOWS-X86\dxrecord\target\recorder.obj -c
> > > p:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.ep
> > > siia.dxr\bin\dxrecord\recorder.cpp
> > > Microsoft (R) 32-bit C/C++ Optimizing Compiler Version
> > > 12.00.8804 for 80x86
> > > Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
> > >
> > > recorder.cpp
> > > p:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.ep
> > > siia.dxr\bin\dxrecord\recorder.cpp(4050) : warning C4101:
> > > 'ucplogrek' : unreferenced local variable
> > > [INFO] cl /MT /W3 /GX /DWINDOWS-X86 /DWIN32 /D_WINDOWS /Zi
> > > /Od /DDEBUG /DHAVE_DONGLE
> > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > epsiia.dxr\include\common
> > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > epsiia.dxr\include\gui
> > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > epsiia.dxr\include\crypt
> > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > epsiia.dxr\include\record
> > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > epsiia.dxr\bin\dxrecord
> > > /Fop:\exodus\dxr\WINDOWS-X86\dxrecord\target\reindex.obj -c
> > > p:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.ep
> > > siia.dxr\bin\dxrecord\reindex.cpp
> > > Microsoft (R) 32-bit C/C++ Optimizing Compiler Version
> > > 12.00.8804 for 80x86
> > > Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
> > >
> > > reindex.cpp
> > > [INFO]
> > > --------------------------------------------------------------
> > > ----------
> > > [ERROR] FATAL ERROR
> > > [INFO]
> > > --------------------------------------------------------------
> > > ----------
> > > [INFO] String index out of range: -17
> > > [INFO]
> > > --------------------------------------------------------------
> > > ----------
> > > [DEBUG] Trace
> > > java.lang.StringIndexOutOfBoundsException: String index out
> > > of range: -17
> > >       at java.lang.String.substring(String.java:1768)
> > >       at
> > > org.codehaus.plexus.util.FileUtils.basename (FileUtils.java:215)
> > >       at
> > > org.codehaus.plexus.util.FileUtils.basename(FileUtils.java:200)
> > >       at
> > > org.codehaus.mojo.natives.compiler.AbstractCompiler.getObjectF
> > > ile(AbstractCompiler.java :120)
> > >       at
> > > org.codehaus.mojo.natives.compiler.AbstractCompiler.compile(Ab
> > > stractCompiler.java:66)
> > >       at
> > > org.codehaus.mojo.natives.plugin.NativeCompileMojo.execute(Nat
> > > iveCompileMojo.java:162)
> > >       at
> > > org.apache.maven.plugin.DefaultPluginManager.executeMojo(Defau
> > > ltPluginManager.java:412)
> > >       at
> > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoa
> > > ls(DefaultLifecycleExecutor.java:534)
> > >       at
> > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoa
> > > lWithLifecycle(DefaultLifecycleExecutor.java:475)
> > >       at
> > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoa
> > > l(DefaultLifecycleExecutor.java:454)
> > >       at
> > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoa
> > > lAndHandleFailures(DefaultLifecycleExecutor.java:306)
> > >       at
> > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTas
> > > kSegments(DefaultLifecycleExecutor.java:273)
> > >       at
> > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(De
> > faultLifecycleExecutor.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(NativeMethodAccess
> > > orImpl.java:39)
> > >       at
> > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> > > odAccessorImpl.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] Total time: 4 minutes 56 seconds
> > > [INFO] Finished at: Wed Sep 20 09:35:18 CDT 2006
> > > [INFO] Final Memory: 8M/16M
> > > [INFO]
> > > --------------------------------------------------------------
> > > ----------
> > >
> > > ---------------------------------------------------------------------
> > > 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: maven native question

Posted by dan tran <da...@gmail.com>.
Yes, the link  mojo, will copy all those dependencies without the version to
target/lib ( i think) and
pass them into the linker.

check out the example

http://svn.codehaus.org/mojo/trunk/mojo/maven-native/native-maven-plugin/src/it/linkages/

-D


On 9/20/06, Brad Harper <br...@epsiia.com> wrote:
>
> If I have a module/sub-project with <packaging>exe</packaging>
> and the <build> element lists <dependency> element(s) of
> <type>lib</type> ...
>
> is the maven native plugin smart enough to automatically put the
> lib artifacts in the linker command line to satisfy the
> dependencies?
>
> Brad
>
> > -----Original Message-----
> > From: Brad Harper
> > Sent: Wednesday, September 20, 2006 6:22 PM
> > To: users
> > Subject: RE: Error: java.lang.StringIndexOutOfBoundsException [MORE]
> >
> >
> > Dan,
> >
> > No, not distilled into something small. [I do have the
> > entire "mvn -X install" output, if that would help.]
> >
> > Brad
> >
> > > -----Original Message-----
> > > From: dan tran [mailto:dantran@gmail.com]
> > > Sent: Wednesday, September 20, 2006 5:23 PM
> > > To: Maven Users List
> > > Subject: Re: Error: java.lang.StringIndexOutOfBoundsException [MORE]
> > >
> > >
> > > Hi Brad, thanks for looking into this problem, do you have
> > > reproducable test
> > > case?
> > >
> > > -D
> > >
> > >
> > > On 9/20/06, Brad Harper <br...@epsiia.com> wrote:
> > > >
> > > > Looking at the source code for classes
> > > >
> > > >   org.codehaus.mojo.natives.compiler.AbstractCompiler
> > > >
> > > > and
> > > >
> > > > org.codehaus.plexus.util.FileUtils
> > > >
> > > > it seems singularly odd that String.substring() would
> > > > suddenly be receiving an index with a value of -17
> > > > passed by the FileUtils.basename() methods.
> > > >
> > > > I haven't been able to affect the outcome by altering
> > > > the order or names of the files involved.
> > > >
> > > > Method AbstractCompiler.getObjectFile() is attempting to
> > > > construct the string name of the object file associated
> > > > with the current source file. Looking in the target/
> > > > directory, I see that the object file for source file
> > > > 'reindex.cpp' has been created and exists with the expected
> > > > name: 'reindex.obj'.
> > > >
> > > > Brad
> > > >
> > > > > -----Original Message-----
> > > > > From: Brad Harper
> > > > > Sent: Wednesday, September 20, 2006 9:38 AM
> > > > > To: users
> > > > > Subject: Error: java.lang.StringIndexOutOfBoundsException
> > > > >
> > > > >
> > > > > Hello:
> > > > >
> > > > > See the FATAL ERROR from captured maven output below.
> > > > >
> > > > > In context, the native maven plugin is being used to
> > compile a C++
> > > > > source file, prior to linking an .exe application.
> > > > >
> > > > > Has anyone seen this sort of thing before? Thanks.
> > > > >
> > > > > Brad
> > > > >
> > > > > ....
> > > > > recmods.cpp
> > > > > [INFO] cl /MT /W3 /GX /DWINDOWS-X86 /DWIN32 /D_WINDOWS /Zi
> > > > > /Od /DDEBUG /DHAVE_DONGLE
> > > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > epsiia.dxr\include\common
> > > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > epsiia.dxr\include\gui
> > > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > epsiia.dxr\include\crypt
> > > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > epsiia.dxr\include\record
> > > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > epsiia.dxr\bin\dxrecord
> > > > > /Fop:\exodus\dxr\WINDOWS-X86\dxrecord\target\recorder.obj -c
> > > > > p:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.ep
> > > > > siia.dxr\bin\dxrecord\recorder.cpp
> > > > > Microsoft (R) 32-bit C/C++ Optimizing Compiler Version
> > > > > 12.00.8804 for 80x86
> > > > > Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
> > > > >
> > > > > recorder.cpp
> > > > > p:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.ep
> > > > > siia.dxr\bin\dxrecord\recorder.cpp(4050) : warning C4101:
> > > > > 'ucplogrek' : unreferenced local variable
> > > > > [INFO] cl /MT /W3 /GX /DWINDOWS-X86 /DWIN32 /D_WINDOWS /Zi
> > > > > /Od /DDEBUG /DHAVE_DONGLE
> > > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > epsiia.dxr\include\common
> > > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > epsiia.dxr\include\gui
> > > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > epsiia.dxr\include\crypt
> > > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > epsiia.dxr\include\record
> > > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > > epsiia.dxr\bin\dxrecord
> > > > > /Fop:\exodus\dxr\WINDOWS-X86\dxrecord\target\reindex.obj -c
> > > > > p:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.ep
> > > > > siia.dxr\bin\dxrecord\reindex.cpp
> > > > > Microsoft (R) 32-bit C/C++ Optimizing Compiler Version
> > > > > 12.00.8804 for 80x86
> > > > > Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
> > > > >
> > > > > reindex.cpp
> > > > > [INFO]
> > > > > --------------------------------------------------------------
> > > > > ----------
> > > > > [ERROR] FATAL ERROR
> > > > > [INFO]
> > > > > --------------------------------------------------------------
> > > > > ----------
> > > > > [INFO] String index out of range: -17
> > > > > [INFO]
> > > > > --------------------------------------------------------------
> > > > > ----------
> > > > > [DEBUG] Trace
> > > > > java.lang.StringIndexOutOfBoundsException: String index out
> > > > > of range: -17
> > > > >       at java.lang.String.substring(String.java:1768)
> > > > >       at
> > > > > org.codehaus.plexus.util.FileUtils.basename(FileUtils.java:215)
> > > > >       at
> > > > > org.codehaus.plexus.util.FileUtils.basename(FileUtils.java:200)
> > > > >       at
> > > > > org.codehaus.mojo.natives.compiler.AbstractCompiler.getObjectF
> > > > > ile(AbstractCompiler.java:120)
> > > > >       at
> > > > > org.codehaus.mojo.natives.compiler.AbstractCompiler.compile(Ab
> > > > > stractCompiler.java:66)
> > > > >       at
> > > > > org.codehaus.mojo.natives.plugin.NativeCompileMojo.execute(Nat
> > > > > iveCompileMojo.java:162)
> > > > >       at
> > > > > org.apache.maven.plugin.DefaultPluginManager.executeMojo(Defau
> > > > > ltPluginManager.java:412)
> > > > >       at
> > > > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoa
> > > > > ls(DefaultLifecycleExecutor.java:534)
> > > > >       at
> > > > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoa
> > > > > lWithLifecycle(DefaultLifecycleExecutor.java:475)
> > > > >       at
> > > > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoa
> > > > > l(DefaultLifecycleExecutor.java:454)
> > > > >       at
> > > > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoa
> > > > > lAndHandleFailures(DefaultLifecycleExecutor.java:306)
> > > > >       at
> > > > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTas
> > > > > kSegments(DefaultLifecycleExecutor.java:273)
> > > > >       at
> > > > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(De
> > > > faultLifecycleExecutor.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(NativeMethodAccess
> > > > > orImpl.java:39)
> > > > >       at
> > > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> > > > > odAccessorImpl.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] Total time: 4 minutes 56 seconds
> > > > > [INFO] Finished at: Wed Sep 20 09:35:18 CDT 2006
> > > > > [INFO] Final Memory: 8M/16M
> > > > > [INFO]
> > > > > --------------------------------------------------------------
> > > > > ----------
> > > > >
> > > > >
> > >
> > ---------------------------------------------------------------------
> > > > > 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
> > > >
> > > >
> > >
> >
> > ---------------------------------------------------------------------
> > 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
>
>

maven native question

Posted by Brad Harper <br...@epsiia.com>.
If I have a module/sub-project with <packaging>exe</packaging>
and the <build> element lists <dependency> element(s) of
<type>lib</type> ...

is the maven native plugin smart enough to automatically put the
lib artifacts in the linker command line to satisfy the
dependencies?

Brad

> -----Original Message-----
> From: Brad Harper 
> Sent: Wednesday, September 20, 2006 6:22 PM
> To: users
> Subject: RE: Error: java.lang.StringIndexOutOfBoundsException [MORE]
> 
> 
> Dan,
> 
> No, not distilled into something small. [I do have the
> entire "mvn -X install" output, if that would help.]
> 
> Brad
> 
> > -----Original Message-----
> > From: dan tran [mailto:dantran@gmail.com]
> > Sent: Wednesday, September 20, 2006 5:23 PM
> > To: Maven Users List
> > Subject: Re: Error: java.lang.StringIndexOutOfBoundsException [MORE]
> > 
> > 
> > Hi Brad, thanks for looking into this problem, do you have 
> > reproducable test
> > case?
> > 
> > -D
> > 
> > 
> > On 9/20/06, Brad Harper <br...@epsiia.com> wrote:
> > >
> > > Looking at the source code for classes
> > >
> > >   org.codehaus.mojo.natives.compiler.AbstractCompiler
> > >
> > > and
> > >
> > > org.codehaus.plexus.util.FileUtils
> > >
> > > it seems singularly odd that String.substring() would
> > > suddenly be receiving an index with a value of -17
> > > passed by the FileUtils.basename() methods.
> > >
> > > I haven't been able to affect the outcome by altering
> > > the order or names of the files involved.
> > >
> > > Method AbstractCompiler.getObjectFile() is attempting to
> > > construct the string name of the object file associated
> > > with the current source file. Looking in the target/
> > > directory, I see that the object file for source file
> > > 'reindex.cpp' has been created and exists with the expected
> > > name: 'reindex.obj'.
> > >
> > > Brad
> > >
> > > > -----Original Message-----
> > > > From: Brad Harper
> > > > Sent: Wednesday, September 20, 2006 9:38 AM
> > > > To: users
> > > > Subject: Error: java.lang.StringIndexOutOfBoundsException
> > > >
> > > >
> > > > Hello:
> > > >
> > > > See the FATAL ERROR from captured maven output below.
> > > >
> > > > In context, the native maven plugin is being used to 
> compile a C++
> > > > source file, prior to linking an .exe application.
> > > >
> > > > Has anyone seen this sort of thing before? Thanks.
> > > >
> > > > Brad
> > > >
> > > > ....
> > > > recmods.cpp
> > > > [INFO] cl /MT /W3 /GX /DWINDOWS-X86 /DWIN32 /D_WINDOWS /Zi
> > > > /Od /DDEBUG /DHAVE_DONGLE
> > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > epsiia.dxr\include\common
> > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > epsiia.dxr\include\gui
> > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > epsiia.dxr\include\crypt
> > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > epsiia.dxr\include\record
> > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > epsiia.dxr\bin\dxrecord
> > > > /Fop:\exodus\dxr\WINDOWS-X86\dxrecord\target\recorder.obj -c
> > > > p:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.ep
> > > > siia.dxr\bin\dxrecord\recorder.cpp
> > > > Microsoft (R) 32-bit C/C++ Optimizing Compiler Version
> > > > 12.00.8804 for 80x86
> > > > Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
> > > >
> > > > recorder.cpp
> > > > p:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.ep
> > > > siia.dxr\bin\dxrecord\recorder.cpp(4050) : warning C4101:
> > > > 'ucplogrek' : unreferenced local variable
> > > > [INFO] cl /MT /W3 /GX /DWINDOWS-X86 /DWIN32 /D_WINDOWS /Zi
> > > > /Od /DDEBUG /DHAVE_DONGLE
> > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > epsiia.dxr\include\common
> > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > epsiia.dxr\include\gui
> > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > epsiia.dxr\include\crypt
> > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > epsiia.dxr\include\record
> > > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > > epsiia.dxr\bin\dxrecord
> > > > /Fop:\exodus\dxr\WINDOWS-X86\dxrecord\target\reindex.obj -c
> > > > p:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.ep
> > > > siia.dxr\bin\dxrecord\reindex.cpp
> > > > Microsoft (R) 32-bit C/C++ Optimizing Compiler Version
> > > > 12.00.8804 for 80x86
> > > > Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
> > > >
> > > > reindex.cpp
> > > > [INFO]
> > > > --------------------------------------------------------------
> > > > ----------
> > > > [ERROR] FATAL ERROR
> > > > [INFO]
> > > > --------------------------------------------------------------
> > > > ----------
> > > > [INFO] String index out of range: -17
> > > > [INFO]
> > > > --------------------------------------------------------------
> > > > ----------
> > > > [DEBUG] Trace
> > > > java.lang.StringIndexOutOfBoundsException: String index out
> > > > of range: -17
> > > >       at java.lang.String.substring(String.java:1768)
> > > >       at
> > > > org.codehaus.plexus.util.FileUtils.basename(FileUtils.java:215)
> > > >       at
> > > > org.codehaus.plexus.util.FileUtils.basename(FileUtils.java:200)
> > > >       at
> > > > org.codehaus.mojo.natives.compiler.AbstractCompiler.getObjectF
> > > > ile(AbstractCompiler.java:120)
> > > >       at
> > > > org.codehaus.mojo.natives.compiler.AbstractCompiler.compile(Ab
> > > > stractCompiler.java:66)
> > > >       at
> > > > org.codehaus.mojo.natives.plugin.NativeCompileMojo.execute(Nat
> > > > iveCompileMojo.java:162)
> > > >       at
> > > > org.apache.maven.plugin.DefaultPluginManager.executeMojo(Defau
> > > > ltPluginManager.java:412)
> > > >       at
> > > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoa
> > > > ls(DefaultLifecycleExecutor.java:534)
> > > >       at
> > > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoa
> > > > lWithLifecycle(DefaultLifecycleExecutor.java:475)
> > > >       at
> > > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoa
> > > > l(DefaultLifecycleExecutor.java:454)
> > > >       at
> > > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoa
> > > > lAndHandleFailures(DefaultLifecycleExecutor.java:306)
> > > >       at
> > > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTas
> > > > kSegments(DefaultLifecycleExecutor.java:273)
> > > >       at
> > > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(De
> > > faultLifecycleExecutor.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(NativeMethodAccess
> > > > orImpl.java:39)
> > > >       at
> > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> > > > odAccessorImpl.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] Total time: 4 minutes 56 seconds
> > > > [INFO] Finished at: Wed Sep 20 09:35:18 CDT 2006
> > > > [INFO] Final Memory: 8M/16M
> > > > [INFO]
> > > > --------------------------------------------------------------
> > > > ----------
> > > >
> > > > 
> > 
> ---------------------------------------------------------------------
> > > > 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
> > >
> > >
> > 
> 
> ---------------------------------------------------------------------
> 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: Error: java.lang.StringIndexOutOfBoundsException [MORE]

Posted by Brad Harper <br...@epsiia.com>.
Dan,

No, not distilled into something small. [I do have the
entire "mvn -X install" output, if that would help.]

Brad

> -----Original Message-----
> From: dan tran [mailto:dantran@gmail.com]
> Sent: Wednesday, September 20, 2006 5:23 PM
> To: Maven Users List
> Subject: Re: Error: java.lang.StringIndexOutOfBoundsException [MORE]
> 
> 
> Hi Brad, thanks for looking into this problem, do you have 
> reproducable test
> case?
> 
> -D
> 
> 
> On 9/20/06, Brad Harper <br...@epsiia.com> wrote:
> >
> > Looking at the source code for classes
> >
> >   org.codehaus.mojo.natives.compiler.AbstractCompiler
> >
> > and
> >
> > org.codehaus.plexus.util.FileUtils
> >
> > it seems singularly odd that String.substring() would
> > suddenly be receiving an index with a value of -17
> > passed by the FileUtils.basename() methods.
> >
> > I haven't been able to affect the outcome by altering
> > the order or names of the files involved.
> >
> > Method AbstractCompiler.getObjectFile() is attempting to
> > construct the string name of the object file associated
> > with the current source file. Looking in the target/
> > directory, I see that the object file for source file
> > 'reindex.cpp' has been created and exists with the expected
> > name: 'reindex.obj'.
> >
> > Brad
> >
> > > -----Original Message-----
> > > From: Brad Harper
> > > Sent: Wednesday, September 20, 2006 9:38 AM
> > > To: users
> > > Subject: Error: java.lang.StringIndexOutOfBoundsException
> > >
> > >
> > > Hello:
> > >
> > > See the FATAL ERROR from captured maven output below.
> > >
> > > In context, the native maven plugin is being used to compile a C++
> > > source file, prior to linking an .exe application.
> > >
> > > Has anyone seen this sort of thing before? Thanks.
> > >
> > > Brad
> > >
> > > ....
> > > recmods.cpp
> > > [INFO] cl /MT /W3 /GX /DWINDOWS-X86 /DWIN32 /D_WINDOWS /Zi
> > > /Od /DDEBUG /DHAVE_DONGLE
> > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > epsiia.dxr\include\common
> > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > epsiia.dxr\include\gui
> > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > epsiia.dxr\include\crypt
> > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > epsiia.dxr\include\record
> > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > epsiia.dxr\bin\dxrecord
> > > /Fop:\exodus\dxr\WINDOWS-X86\dxrecord\target\recorder.obj -c
> > > p:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.ep
> > > siia.dxr\bin\dxrecord\recorder.cpp
> > > Microsoft (R) 32-bit C/C++ Optimizing Compiler Version
> > > 12.00.8804 for 80x86
> > > Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
> > >
> > > recorder.cpp
> > > p:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.ep
> > > siia.dxr\bin\dxrecord\recorder.cpp(4050) : warning C4101:
> > > 'ucplogrek' : unreferenced local variable
> > > [INFO] cl /MT /W3 /GX /DWINDOWS-X86 /DWIN32 /D_WINDOWS /Zi
> > > /Od /DDEBUG /DHAVE_DONGLE
> > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > epsiia.dxr\include\common
> > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > epsiia.dxr\include\gui
> > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > epsiia.dxr\include\crypt
> > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > epsiia.dxr\include\record
> > > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > > epsiia.dxr\bin\dxrecord
> > > /Fop:\exodus\dxr\WINDOWS-X86\dxrecord\target\reindex.obj -c
> > > p:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.ep
> > > siia.dxr\bin\dxrecord\reindex.cpp
> > > Microsoft (R) 32-bit C/C++ Optimizing Compiler Version
> > > 12.00.8804 for 80x86
> > > Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
> > >
> > > reindex.cpp
> > > [INFO]
> > > --------------------------------------------------------------
> > > ----------
> > > [ERROR] FATAL ERROR
> > > [INFO]
> > > --------------------------------------------------------------
> > > ----------
> > > [INFO] String index out of range: -17
> > > [INFO]
> > > --------------------------------------------------------------
> > > ----------
> > > [DEBUG] Trace
> > > java.lang.StringIndexOutOfBoundsException: String index out
> > > of range: -17
> > >       at java.lang.String.substring(String.java:1768)
> > >       at
> > > org.codehaus.plexus.util.FileUtils.basename(FileUtils.java:215)
> > >       at
> > > org.codehaus.plexus.util.FileUtils.basename(FileUtils.java:200)
> > >       at
> > > org.codehaus.mojo.natives.compiler.AbstractCompiler.getObjectF
> > > ile(AbstractCompiler.java:120)
> > >       at
> > > org.codehaus.mojo.natives.compiler.AbstractCompiler.compile(Ab
> > > stractCompiler.java:66)
> > >       at
> > > org.codehaus.mojo.natives.plugin.NativeCompileMojo.execute(Nat
> > > iveCompileMojo.java:162)
> > >       at
> > > org.apache.maven.plugin.DefaultPluginManager.executeMojo(Defau
> > > ltPluginManager.java:412)
> > >       at
> > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoa
> > > ls(DefaultLifecycleExecutor.java:534)
> > >       at
> > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoa
> > > lWithLifecycle(DefaultLifecycleExecutor.java:475)
> > >       at
> > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoa
> > > l(DefaultLifecycleExecutor.java:454)
> > >       at
> > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoa
> > > lAndHandleFailures(DefaultLifecycleExecutor.java:306)
> > >       at
> > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTas
> > > kSegments(DefaultLifecycleExecutor.java:273)
> > >       at
> > > org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(De
> > faultLifecycleExecutor.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(NativeMethodAccess
> > > orImpl.java:39)
> > >       at
> > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> > > odAccessorImpl.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] Total time: 4 minutes 56 seconds
> > > [INFO] Finished at: Wed Sep 20 09:35:18 CDT 2006
> > > [INFO] Final Memory: 8M/16M
> > > [INFO]
> > > --------------------------------------------------------------
> > > ----------
> > >
> > > 
> ---------------------------------------------------------------------
> > > 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
> >
> >
> 

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


Re: Error: java.lang.StringIndexOutOfBoundsException [MORE]

Posted by dan tran <da...@gmail.com>.
Hi Brad, thanks for looking into this problem, do you have reproducable test
case?

-D


On 9/20/06, Brad Harper <br...@epsiia.com> wrote:
>
> Looking at the source code for classes
>
>   org.codehaus.mojo.natives.compiler.AbstractCompiler
>
> and
>
> org.codehaus.plexus.util.FileUtils
>
> it seems singularly odd that String.substring() would
> suddenly be receiving an index with a value of -17
> passed by the FileUtils.basename() methods.
>
> I haven't been able to affect the outcome by altering
> the order or names of the files involved.
>
> Method AbstractCompiler.getObjectFile() is attempting to
> construct the string name of the object file associated
> with the current source file. Looking in the target/
> directory, I see that the object file for source file
> 'reindex.cpp' has been created and exists with the expected
> name: 'reindex.obj'.
>
> Brad
>
> > -----Original Message-----
> > From: Brad Harper
> > Sent: Wednesday, September 20, 2006 9:38 AM
> > To: users
> > Subject: Error: java.lang.StringIndexOutOfBoundsException
> >
> >
> > Hello:
> >
> > See the FATAL ERROR from captured maven output below.
> >
> > In context, the native maven plugin is being used to compile a C++
> > source file, prior to linking an .exe application.
> >
> > Has anyone seen this sort of thing before? Thanks.
> >
> > Brad
> >
> > ....
> > recmods.cpp
> > [INFO] cl /MT /W3 /GX /DWINDOWS-X86 /DWIN32 /D_WINDOWS /Zi
> > /Od /DDEBUG /DHAVE_DONGLE
> > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > epsiia.dxr\include\common
> > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > epsiia.dxr\include\gui
> > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > epsiia.dxr\include\crypt
> > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > epsiia.dxr\include\record
> > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > epsiia.dxr\bin\dxrecord
> > /Fop:\exodus\dxr\WINDOWS-X86\dxrecord\target\recorder.obj -c
> > p:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.ep
> > siia.dxr\bin\dxrecord\recorder.cpp
> > Microsoft (R) 32-bit C/C++ Optimizing Compiler Version
> > 12.00.8804 for 80x86
> > Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
> >
> > recorder.cpp
> > p:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.ep
> > siia.dxr\bin\dxrecord\recorder.cpp(4050) : warning C4101:
> > 'ucplogrek' : unreferenced local variable
> > [INFO] cl /MT /W3 /GX /DWINDOWS-X86 /DWIN32 /D_WINDOWS /Zi
> > /Od /DDEBUG /DHAVE_DONGLE
> > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > epsiia.dxr\include\common
> > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > epsiia.dxr\include\gui
> > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > epsiia.dxr\include\crypt
> > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > epsiia.dxr\include\record
> > -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> > epsiia.dxr\bin\dxrecord
> > /Fop:\exodus\dxr\WINDOWS-X86\dxrecord\target\reindex.obj -c
> > p:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.ep
> > siia.dxr\bin\dxrecord\reindex.cpp
> > Microsoft (R) 32-bit C/C++ Optimizing Compiler Version
> > 12.00.8804 for 80x86
> > Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
> >
> > reindex.cpp
> > [INFO]
> > --------------------------------------------------------------
> > ----------
> > [ERROR] FATAL ERROR
> > [INFO]
> > --------------------------------------------------------------
> > ----------
> > [INFO] String index out of range: -17
> > [INFO]
> > --------------------------------------------------------------
> > ----------
> > [DEBUG] Trace
> > java.lang.StringIndexOutOfBoundsException: String index out
> > of range: -17
> >       at java.lang.String.substring(String.java:1768)
> >       at
> > org.codehaus.plexus.util.FileUtils.basename(FileUtils.java:215)
> >       at
> > org.codehaus.plexus.util.FileUtils.basename(FileUtils.java:200)
> >       at
> > org.codehaus.mojo.natives.compiler.AbstractCompiler.getObjectF
> > ile(AbstractCompiler.java:120)
> >       at
> > org.codehaus.mojo.natives.compiler.AbstractCompiler.compile(Ab
> > stractCompiler.java:66)
> >       at
> > org.codehaus.mojo.natives.plugin.NativeCompileMojo.execute(Nat
> > iveCompileMojo.java:162)
> >       at
> > org.apache.maven.plugin.DefaultPluginManager.executeMojo(Defau
> > ltPluginManager.java:412)
> >       at
> > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoa
> > ls(DefaultLifecycleExecutor.java:534)
> >       at
> > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoa
> > lWithLifecycle(DefaultLifecycleExecutor.java:475)
> >       at
> > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoa
> > l(DefaultLifecycleExecutor.java:454)
> >       at
> > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoa
> > lAndHandleFailures(DefaultLifecycleExecutor.java:306)
> >       at
> > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTas
> > kSegments(DefaultLifecycleExecutor.java:273)
> >       at
> > org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(De
> faultLifecycleExecutor.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(NativeMethodAccess
> > orImpl.java:39)
> >       at
> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> > odAccessorImpl.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] Total time: 4 minutes 56 seconds
> > [INFO] Finished at: Wed Sep 20 09:35:18 CDT 2006
> > [INFO] Final Memory: 8M/16M
> > [INFO]
> > --------------------------------------------------------------
> > ----------
> >
> > ---------------------------------------------------------------------
> > 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
>
>

Error: java.lang.StringIndexOutOfBoundsException [MORE]

Posted by Brad Harper <br...@epsiia.com>.
Looking at the source code for classes

   org.codehaus.mojo.natives.compiler.AbstractCompiler

and

  org.codehaus.plexus.util.FileUtils

it seems singularly odd that String.substring() would
suddenly be receiving an index with a value of -17
passed by the FileUtils.basename() methods.

I haven't been able to affect the outcome by altering
the order or names of the files involved.

Method AbstractCompiler.getObjectFile() is attempting to
construct the string name of the object file associated
with the current source file. Looking in the target/
directory, I see that the object file for source file
'reindex.cpp' has been created and exists with the expected
name: 'reindex.obj'.

Brad

> -----Original Message-----
> From: Brad Harper 
> Sent: Wednesday, September 20, 2006 9:38 AM
> To: users
> Subject: Error: java.lang.StringIndexOutOfBoundsException
> 
> 
> Hello:
> 
> See the FATAL ERROR from captured maven output below.
> 
> In context, the native maven plugin is being used to compile a C++
> source file, prior to linking an .exe application.
> 
> Has anyone seen this sort of thing before? Thanks.
> 
> Brad
> 
> ....
> recmods.cpp
> [INFO] cl /MT /W3 /GX /DWINDOWS-X86 /DWIN32 /D_WINDOWS /Zi 
> /Od /DDEBUG /DHAVE_DONGLE 
> -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> epsiia.dxr\include\common 
> -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> epsiia.dxr\include\gui 
> -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> epsiia.dxr\include\crypt 
> -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> epsiia.dxr\include\record 
> -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> epsiia.dxr\bin\dxrecord 
> /Fop:\exodus\dxr\WINDOWS-X86\dxrecord\target\recorder.obj -c 
> p:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.ep
> siia.dxr\bin\dxrecord\recorder.cpp
> Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 
> 12.00.8804 for 80x86
> Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
> 
> recorder.cpp
> p:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.ep
> siia.dxr\bin\dxrecord\recorder.cpp(4050) : warning C4101: 
> 'ucplogrek' : unreferenced local variable
> [INFO] cl /MT /W3 /GX /DWINDOWS-X86 /DWIN32 /D_WINDOWS /Zi 
> /Od /DDEBUG /DHAVE_DONGLE 
> -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> epsiia.dxr\include\common 
> -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> epsiia.dxr\include\gui 
> -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> epsiia.dxr\include\crypt 
> -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> epsiia.dxr\include\record 
> -Ip:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.
> epsiia.dxr\bin\dxrecord 
> /Fop:\exodus\dxr\WINDOWS-X86\dxrecord\target\reindex.obj -c 
> p:\exodus\dxr\WINDOWS-X86\dxrecord\..\..\src\main\c-cpp\com.ep
> siia.dxr\bin\dxrecord\reindex.cpp
> Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 
> 12.00.8804 for 80x86
> Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
> 
> reindex.cpp
> [INFO] 
> --------------------------------------------------------------
> ----------
> [ERROR] FATAL ERROR
> [INFO] 
> --------------------------------------------------------------
> ----------
> [INFO] String index out of range: -17
> [INFO] 
> --------------------------------------------------------------
> ----------
> [DEBUG] Trace
> java.lang.StringIndexOutOfBoundsException: String index out 
> of range: -17
> 	at java.lang.String.substring(String.java:1768)
> 	at 
> org.codehaus.plexus.util.FileUtils.basename(FileUtils.java:215)
> 	at 
> org.codehaus.plexus.util.FileUtils.basename(FileUtils.java:200)
> 	at 
> org.codehaus.mojo.natives.compiler.AbstractCompiler.getObjectF
> ile(AbstractCompiler.java:120)
> 	at 
> org.codehaus.mojo.natives.compiler.AbstractCompiler.compile(Ab
> stractCompiler.java:66)
> 	at 
> org.codehaus.mojo.natives.plugin.NativeCompileMojo.execute(Nat
> iveCompileMojo.java:162)
> 	at 
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(Defau
> ltPluginManager.java:412)
> 	at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoa
> ls(DefaultLifecycleExecutor.java:534)
> 	at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoa
> lWithLifecycle(DefaultLifecycleExecutor.java:475)
> 	at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoa
> l(DefaultLifecycleExecutor.java:454)
> 	at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoa
> lAndHandleFailures(DefaultLifecycleExecutor.java:306)
> 	at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTas
> kSegments(DefaultLifecycleExecutor.java:273)
> 	at 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(De
faultLifecycleExecutor.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(NativeMethodAccess
> orImpl.java:39)
> 	at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> odAccessorImpl.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] Total time: 4 minutes 56 seconds
> [INFO] Finished at: Wed Sep 20 09:35:18 CDT 2006
> [INFO] Final Memory: 8M/16M
> [INFO] 
> --------------------------------------------------------------
> ----------
> 
> ---------------------------------------------------------------------
> 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