Forum Discussion

Marclev's avatar
Marclev
New Contributor
13 years ago

ArrayIndexOutOfBoundsException when generating war

Generating a war file does not work in SOAP UI Version 4.6.1, and it can't work looking at what's happening (see below).

1. Steps to reproduce: Run wargenerator.bat (from GUI, it just hangs completely, so need to do from the command line).

2. Observe following output:

SoapUI 4.6.1 War Generator
Configuring log4j from [C:\dev\tools\SoapUI-4.6.1\bin\soapui-log4j.xml]
13:18:39,254 INFO [DefaultSoapUICore] initialized soapui-settings from [C:\Users\mlevin\soapui-sett
ings.xml]
13:18:39,915 INFO [WsdlProject] Loaded project from [file:/C:/dev/work/sony/sony-mock-services/Sony
-soapui-project.xml]
13:18:40,181 INFO [WsdlProject] Saved project [Sony] to [C:\Users\mlevin\AppData\Local\Temp\Sony-pr
oject.xml - 31969 bytes
13:18:40,182 INFO [SoapUIMockAsWarGenerator] Creating WAR file with endpoint [Sony]
13:18:40,190 INFO [MockAsWar] Creating WAR directory in [C:\Users\mlevin\AppData\Local\Temp\warasmo
ck]
13:18:40,193 INFO [JarPackager] Coping files from C:\dev\tools\SoapUI-4.6.1\bin\..\lib to C:\Users\mlevin\AppData\Local\Temp\warasmock\WEB-INF\lib
Exception in thread "SwingWorker" java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.AbstractStringBuilder.replace(Unknown Source)
at java.lang.StringBuilder.replace(Unknown Source)
at com.eviware.soapui.tools.MockAsWar.createContent(MockAsWar.java:166)
at com.eviware.soapui.tools.MockAsWar.createWebXml(MockAsWar.java:147)
at com.eviware.soapui.tools.MockAsWar$1.construct(MockAsWar.java:92)
at com.eviware.soapui.support.swing.SwingWorkerDelegator.construct(SwingWorkerDelegator.java:46)
at com.eviware.soapui.support.swing.SwingWorker$2.run(SwingWorker.java:149)
at java.lang.Thread.run(Unknown Source)
13:18:41,836 INFO [SoapUIMockAsWarGenerator] WAR Generation complete

3. Fix:

The constant SOAP_UI_SETTINGS in MockAsWar.java is set to "[SoapUISettings]" (note the upper case S), but in soapui-4.6.1.jar\com\eviware\soapui\resources\mockaswar it is set as "[soapUISettings]" (i.e. with a lower case s). Changing this in the web.xml in soapui-4.6.1.jar to "[SoapUISettings]" fixes the issue.

1 Reply

  • Hi,

    This is unfortunately a known issue with SoapUI 4.6.1.

    SOAP-906 is being used to tracked this. The fix is scheduled to be included in 4.6.2.

    I believe you have seen viewtopic.php?f=13&t=21976 as a workaround from another post I reviewed.