Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Hudson » Maven Build : ArrayIndexOutOfBoundsException
Maven Build : ArrayIndexOutOfBoundsException [message #894125] Fri, 06 July 2012 18:33 Go to next message
Ashoka Upadhya is currently offline Ashoka UpadhyaFriend
Messages: 1
Registered: July 2012
Junior Member

I am running Maven 3 build on hudson slave and getting below exception. This started happening after moving to JDK 1.7. Any help is appreciated.


[INFO] Using Maven 3 installation: Maven-3
[INFO] Checking Maven 3 installation environment
[platform] $ /opt/install/apps/maven/current/bin/mvn --help
[INFO] Checking Maven 3 installation version
[platform] $ /opt/install/apps/maven/current/bin/mvn --version
[INFO] Detected Maven 3 installation version: 3.0.4
[DEBUG] Waiting for connection on port: 58977
[platform] $ /opt/install/apps/maven/current/bin/mvn clean deploy -V -B -DHUDSON=true -Dmaven.ext.class.path=/home/hudson/maven/slavebundle/resources:/home/hudson/maven/slavebundle/lib/maven3-eventspy-3.0.jar:/home/hudson/slave.jar -Dhudson.eventspy.port=58977 -Dmaven.repo.local=/home/hudson/platform/.maven/repo -f parent/pom.xml -N -q -U
[ERROR] Failure: java.lang.ArrayIndexOutOfBoundsException: 0
FATAL: java.lang.ArrayIndexOutOfBoundsException: 0
org.hudsonci.utils.tasks.OperationFailure: java.lang.ArrayIndexOutOfBoundsException: 0
at org.hudsonci.utils.tasks.PerformOperation.execute(PerformOperation.java:75)
at org.hudsonci.maven.plugin.builder.MavenBuilder.perform(MavenBuilder.java:169)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:630)
at hudson.model.Build$RunnerImpl.build(Build.java:175)
at hudson.model.Build$RunnerImpl.doRun(Build.java:137)
at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:429)
at hudson.model.Run.run(Run.java:1366)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:145)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
at hudson.remoting.RemoteInvocationHandler$RPCRequest.choose(RemoteInvocationHandler.java:295)
at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:273)
at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:258)
at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:218)
at hudson.remoting.UserRequest.perform(UserRequest.java:114)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:283)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Re: Maven Build : ArrayIndexOutOfBoundsException [message #894127 is a reply to message #894125] Fri, 06 July 2012 18:37 Go to previous messageGo to next message
Steve Christou is currently offline Steve ChristouFriend
Messages: 125
Registered: June 2012
Location: Milwaukee, Wisconsin
Senior Member

Hudson currently does not compile in jdk 1.7, or 1.5. You must use jdk 1.6.

Edit: As a side note are you using a maven project? The maven job has been deprecated and it is recommended that you use a freestyle job and use the maven 3 build step.


/**
 * @author Steven Christou
 * @dev    Hudson-ci
 */

[Updated on: Fri, 06 July 2012 18:38]

Report message to a moderator

Re: Maven Build : ArrayIndexOutOfBoundsException [message #895705 is a reply to message #894127] Sun, 15 July 2012 07:32 Go to previous messageGo to next message
Paul McGuire is currently offline Paul McGuireFriend
Messages: 5
Registered: July 2012
Junior Member
Hi,
We've also just migrated to jdk 1.7 and hit the exact same problem with the slave machines!

Does this mean building java code on slaves other than 1.6 are not supported? Or should it be possible to launch the slave process using java 1.6, but still build our code that is using 1.7?

Hopefully this is simple but I've had a look at the slave plugin page but couldn't figure it out. Any pointers appreciated.
Re: Maven Build : ArrayIndexOutOfBoundsException [message #895881 is a reply to message #895705] Mon, 16 July 2012 12:39 Go to previous messageGo to next message
Steve Christou is currently offline Steve ChristouFriend
Messages: 125
Registered: June 2012
Location: Milwaukee, Wisconsin
Senior Member

We have not gotten around to providing support for jdk 1.7 yet (hopefully that will change very soon). You must download the jdk 1.6 and use that instead.

Quote:
Does this mean building java code on slaves other than 1.6 are not supported? Or should it be possible to launch the slave process using java 1.6, but still build our code that is using 1.7?

You should have no problems running java 1.6 and 1.7. Since hudson is already compiled into a .war file, you don't need the full JDK 1.6, you just need the JRE in order for hudson to run. I always thought there was an argument for the jvm that uses "sourcejdk" "targetjdk" where you can specify the -source jdk version (1.6) and the -target jdk version (1.7) and have no compatibility issues.


/**
 * @author Steven Christou
 * @dev    Hudson-ci
 */
Re: Maven Build : ArrayIndexOutOfBoundsException [message #895894 is a reply to message #895881] Mon, 16 July 2012 12:57 Go to previous messageGo to next message
Paul McGuire is currently offline Paul McGuireFriend
Messages: 5
Registered: July 2012
Junior Member
Ok, sorry to be a bit slow on this. Is this the position:

Hudson can run on JRE 6 or JRE 7 - No problem
Husdon isn't supported to compile projects to Java 7 but this is coming soon?

If this is correct is there a jira issue or roadmap I can track/vote on? Or any beta code I can try out?

(BTW, we're compiling code OK to Java 7 in the master, its just the slave nodes that are causing issues so perhaps things are pretty close now?)
Re: Maven Build : ArrayIndexOutOfBoundsException [message #895999 is a reply to message #895894] Mon, 16 July 2012 19:45 Go to previous messageGo to next message
Steve Christou is currently offline Steve ChristouFriend
Messages: 125
Registered: June 2012
Location: Milwaukee, Wisconsin
Senior Member

Quote:
Hudson can run on JRE 6 or JRE 7 - No problem
Husdon isn't supported to compile projects to Java 7 but this is coming soon?

If your project is using JDK or JRE 7, you should have no issues there. It's just that hudson must be in a JRE 6 environment to compile. I believe adding the -source and -target parts will fix it so you can use JRE 7.

Quote:
If this is correct is there a jira issue or roadmap I can track/vote on? Or any beta code I can try out?

We currently do not use jira roadmap feature for anything hudson releated. You can log a bug for this issue in the bugs.eclipse.org and Winston and I can will take a look at it.

Edit: Actually log a bug requesting the feature for jdk 7 support for master and slave nodes. I will talk to Winston today or tomorrow about it. Also put the bugzilla ID on this page.


/**
 * @author Steven Christou
 * @dev    Hudson-ci
 */

[Updated on: Mon, 16 July 2012 19:47]

Report message to a moderator

Re: Maven Build : ArrayIndexOutOfBoundsException [message #896852 is a reply to message #895999] Fri, 20 July 2012 07:11 Go to previous messageGo to next message
Paul McGuire is currently offline Paul McGuireFriend
Messages: 5
Registered: July 2012
Junior Member
Hi,
I've tried but failed to run the slave as JRE6 but compile as JDK7, if you've got any instructions that would be great. Meanwhile I've raised bugzilla https://bugs.eclipse.org/bugs/show_bug.cgi?id=385566
Re: Maven Build : ArrayIndexOutOfBoundsException [message #896995 is a reply to message #896852] Fri, 20 July 2012 18:01 Go to previous messageGo to next message
Paul McGuire is currently offline Paul McGuireFriend
Messages: 5
Registered: July 2012
Junior Member
Hi,
After further fiddling I've got something thats working for me. Not sure if this will work for everyone but thought I'd share. To make the build launch ok on the slave agent I had to change these settings for the node:

Advanced -> Java Path: /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Commands/java

Environment Variables:
name: JAVA_HOME
value: /Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home

Btw, the slave is running on a mac.

Hope that helps anyone who finds this thread like I did.
Re: Maven Build : ArrayIndexOutOfBoundsException [message #896996 is a reply to message #896995] Fri, 20 July 2012 18:02 Go to previous messageGo to next message
Steve Christou is currently offline Steve ChristouFriend
Messages: 125
Registered: June 2012
Location: Milwaukee, Wisconsin
Senior Member

Since this worked for you, I'm closing that bug as no fix required.

/**
 * @author Steven Christou
 * @dev    Hudson-ci
 */
Re: Maven Build : ArrayIndexOutOfBoundsException [message #897001 is a reply to message #896996] Fri, 20 July 2012 18:26 Go to previous messageGo to next message
Paul McGuire is currently offline Paul McGuireFriend
Messages: 5
Registered: July 2012
Junior Member
Understood - thanks.

Is one of the objectives of the new 3.X hudson development to targeting running ok JRE7? I know java 6 is almost end of life, and apple especially seem to be very keen to drop Java 6 from their platform.

The SSH slave.jar is now the last thing using JRE6 (hudson itself runs happily on JRE7 for me). The sooner I'm java 7 everywhere, the happier I'll be Razz

Cheers,Paul
Re: Maven Build : ArrayIndexOutOfBoundsException [message #897003 is a reply to message #897001] Fri, 20 July 2012 18:31 Go to previous messageGo to next message
Steve Christou is currently offline Steve ChristouFriend
Messages: 125
Registered: June 2012
Location: Milwaukee, Wisconsin
Senior Member

We won't be dropping support for JRE 6 because it's still a very stable version of java, but the hudson slave.jar should work with JRE 7 and hudson 3.x out of the box.

/**
 * @author Steven Christou
 * @dev    Hudson-ci
 */
Re: Maven Build : ArrayIndexOutOfBoundsException [message #1004958 is a reply to message #897003] Thu, 24 January 2013 07:59 Go to previous messageGo to next message
Lionel Giavelli is currently offline Lionel GiavelliFriend
Messages: 2
Registered: January 2013
Location: San Francisco
Junior Member
Sorry, what dependency do you use to get MavenBuilder?
I always fail to resolve package
package org.hudsonci.maven.plugin.builder does not exist
import org.hudsonci.maven.plugin.builder.MavenBuilder;
Thanks
Re: Maven Build : ArrayIndexOutOfBoundsException [message #1005329 is a reply to message #1004958] Thu, 24 January 2013 22:08 Go to previous messageGo to next message
Steve Christou is currently offline Steve ChristouFriend
Messages: 125
Registered: June 2012
Location: Milwaukee, Wisconsin
Senior Member

To get the mavenbuilder class, add this dependency to your pom.xml file:
<dependency>
<groupId>org.eclipse.hudson.main</groupId>
<artifactId>maven-plugin</artifactId>
<version>3.0.0-1</version>
</dependency>


/**
 * @author Steven Christou
 * @dev    Hudson-ci
 */
Re: Maven Build : ArrayIndexOutOfBoundsException [message #1085893 is a reply to message #896995] Tue, 13 August 2013 13:59 Go to previous messageGo to next message
Mike Konikoff is currently offline Mike KonikoffFriend
Messages: 2
Registered: August 2013
Junior Member
I set JAVA_HOME environment variable for the node, but I don't see where to set Advanced -> Java path. My slave is a Windows 7 VM and I'm getting the same error.
Re: Maven Build : ArrayIndexOutOfBoundsException [message #1085965 is a reply to message #1085893] Tue, 13 August 2013 15:56 Go to previous message
Geoff Waymark is currently offline Geoff WaymarkFriend
Messages: 28
Registered: July 2012
Junior Member
Advanced -> Java Path will be available on the node if it's launched via ssh.

How is your slave invoked?

Your Slave on Windows 7 should be launched using Java6, with the JAVA_HOME for the slave set to Java7. For the workaround to work.


Geoff Waymark
Eclipse Hudson team
Previous Topic:Hudson copy command in shell executable
Next Topic:${WORKSPACE} not resolved with Windows script build step
Goto Forum:
  


Current Time: Fri Apr 19 22:30:58 GMT 2024

Powered by FUDForum. Page generated in 0.04502 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top