Jump to content

MIT giving an ArrayIndexOutOfBoundsException

27 replies to this topic

#1 Guest_G-Mon_*

  • Guests

Posted 14 July 2007 - 02:35 PM

Yesterday I was trying to use MIT v5.1.11 to make a secondary copy of a fresh Baldur's Gate 2 installation (I find myself reinstalling MG series games semi-frequently, for various reasons, and I'm trying to reduce said frequency). Only problem was MIT didn't want to play ball; when I tried it interactively, I was greeted by several grayed-out controls. I think that screenshot was with a slightly older version of Java, although installing the latest version didn't change anything. Next step: command line options. Still no dice. Then I tried turning on the "verbose" option and got the following error message:

java.lang.ArrayIndexOutOfBoundsException: 0
		at CloningData.instanceFor(CloningData.java:232)
		at MultiInstall.main(MultiInstall.java:64)

I'm currently running Windows XP Home with Sun JRE 6 update 2, if it matters any. If anyone can help figure this out, I'd appreciate it. Thanks in advance!

#2 Guest_Guest_*

  • Guests

Posted 14 July 2007 - 04:09 PM

The greyed-out controls is normal - the checkboxes activate when you select a source, depending on the game; 'Go' when you have a valid source and sink; and 'Cancel' when a clone is going.

I think the exception you post is causing the source to not register as valid. The offending code is this:
java.io.FileFilter exeFilter = new CaseInsensitiveFileFilter(possible.exeName);
if(source.listFiles(exeFilter)[0].length() != (long) possible.exeSize

Which would mean it can't find bgmain.exe . But I check for this case a few lines above:
for(Object fileobj : neededFiles){
	String file = fileobj.toString();
	if(source.listFiles(new CaseInsensitiveFileFilter(file)).length == 0){

Can anyone else see what's going on here? Because I'm lost.

#3 Orions_Stardom

  • Gibberlings
  • 206 posts

Posted 14 July 2007 - 04:10 PM

Above guest post was me.

#4 Guest_G-Mon_*

  • Guests

Posted 14 July 2007 - 10:40 PM

Actually, I think I should've mentioned earlier--I'm using BG2:The Collection with full installs of both SoA and ToB, with nothing else but the bonus disc and ToB patch from the expansion CD. As I may have mentioned indirectly, I'm also running the latest version of Sun's JRE available (after uninstalling older versions and a couple reboots). When running the MIT interactively, all of the controls (apart from the two "Browse" buttons) are grayed out even after putting in a valid source and sink. When I try using the command line with the same source and sink with the --batch and --verbose options, I get the above error. (Without --batch, it just shows the main screen with the source and sink pre-filled, but no other controls are usable.) Hope that helps a little better.

#5 Orions_Stardom

  • Gibberlings
  • 206 posts

Posted 14 July 2007 - 10:57 PM

Yeah, that's actually as expected - the reason the controls remain greyed out, and the reason --batch doesn't work, are both because MIT doesn't think your source is valid.
Thing is, the complaint it's giving should (as I outlined above) be impossible.

#6 Guest_Guest_*

  • Guests

Posted 14 July 2007 - 11:57 PM

Okay, I just played with it a bit more. It didn't recognize my EasyTutu install as valid, but it did recognize my BG1 install. However, nothing seemed to happen when I picked a sink for it and hit Go (the Cancel button became available, but I had no HD activity and clicking Cancel didn't seem to work). Again, none of these are modded in any way, apart from the official patches for BG1 and BG2.

#7 Orions_Stardom

  • Gibberlings
  • 206 posts

Posted 15 July 2007 - 12:22 AM

Can you try going --batch --verbose with your BG1 install?

#8 Guest_G-Mon_*

  • Guests

Posted 15 July 2007 - 01:56 AM

Tried --batch --verbose with BG1, and I got this:

Exception in thread "main" java.lang.NoClassDefFoundError: org/jdesktop/swingworker/SwingWorker
		at java.lang.ClassLoader.defineClass1(Native Method)
		at java.lang.ClassLoader.defineClass(Unknown Source)
		at java.security.SecureClassLoader.defineClass(Unknown Source)
		at java.net.URLClassLoader.defineClass(Unknown Source)
		at java.net.URLClassLoader.access$000(Unknown Source)
		at java.net.URLClassLoader$1.run(Unknown Source)
		at java.security.AccessController.doPrivileged(Native Method)
		at java.net.URLClassLoader.findClass(Unknown Source)
		at java.lang.ClassLoader.loadClass(Unknown Source)
		at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
		at java.lang.ClassLoader.loadClass(Unknown Source)
		at java.lang.ClassLoader.loadClassInternal(Unknown Source)
		at MultiInstall.main(MultiInstall.java:65)

As an aside, it's now 5 AM here and I am tired. I'll likely be coming by for the next few days at least, but for now, I'm going to bed. :)

#9 Orions_Stardom

  • Gibberlings
  • 206 posts

Posted 15 July 2007 - 03:19 AM

Ok, I see what's happening. That class missed out on being included in the jar somehow. Thing is, it is now also included in the standard library, under the name javax.swing.SwingWorker , but only in the newest version (from last December).

So, the question is - what is the best way to fix this? Should I include org.jdesktop.swingworker.SwingWorker in the MIT jar, or is it now safe to depend on the newer Java?

#10 Orions_Stardom

  • Gibberlings
  • 206 posts

Posted 15 July 2007 - 04:03 PM

I've repackaged MIT-5.1.11 to include the SwingWorker package. Does this solve the problem?

#11 Guest_G-Mon_*

  • Guests

Posted 15 July 2007 - 06:27 PM

Well, I'm not on the computer with my Baldur's Gate installs (mother's currently playing Sims 2...*mutter* and has been all day...), but I'll give it a shot when I can get on it. I can just get the updated MIT from its download page, right?

#12 Orions_Stardom

  • Gibberlings
  • 206 posts

Posted 16 July 2007 - 04:24 AM

Yes, the new package is on the download page.

#13 Guest_G-Mon_*

  • Guests

Posted 16 July 2007 - 02:02 PM

Hmm. Looks like it got BG1 to copy (and it seems to work in initial testing), but I'm still at square one with BG2. Oh well, at least it's some progress, right?

#14 Orions_Stardom

  • Gibberlings
  • 206 posts

Posted 19 July 2007 - 05:31 PM

You mentioned EasyTutu upthread - is this the game that's failing, or is there also a virgin BG2 install?
MIT doesn't support Tutu at this point, simply because neither andrewas nor I has the time or resources to figure it out.

#15 Guest_G-Mon_*

  • Guests

Posted 21 July 2007 - 04:07 PM

Yeah, there's a regular BG2 install on my machine. I was just playing around with the MIT for a bit when I tried it with EasyTutu. I'll probably do some more playing around with MIT over the weekend, in varying permutations of BG2 installs.

Reply to this topic


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users