[
https://issues.apache.org/jira/browse/GROOVY-5467?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Paul King closed GROOVY-5467.
-----------------------------
Resolution: Fixed
I am going to close this issue. We could try to catch the exception as per
below:
{code}
--- src/main/groovy/lang/GroovyClassLoader.java (revision
a1e97f17da156c26e9ede58bbf7bcb9c7987256d)
+++ src/main/groovy/lang/GroovyClassLoader.java (revision )
@@ -685,6 +685,8 @@
} else {
throw ncdfe;
}
+ } catch (sun.misc.InvalidJarIndexException ijie) {
+ throw new RuntimeException("Index error loading loading class '" +
name + "', possible corrupt jar?", ijie);
}
{code}
but then we reference an internal class that is subject to change.
>From searching the error it seems to have mainly occurred in the past when
>buggy build tools were used to build corrupt jars. The popular tools seem to
>have fixed previous issues. In any case we are very limited in what we can do
>to solve the problem given how and where it is occurring.
If it crops up more frequently, we can reopen and apply some kind of fix like
above.
> catch Exception from loading from a jar to avoid BUG! message and do proper
> error reporting
> -------------------------------------------------------------------------------------------
>
> Key: GROOVY-5467
> URL: https://issues.apache.org/jira/browse/GROOVY-5467
> Project: Groovy
> Issue Type: Bug
> Components: xforms
> Affects Versions: 1.8.6
> Environment: Windows 7, 64 bit
> Reporter: Juljan May
> Priority: Minor
>
> I have a testsuite within a soapui project which runs perfectly using soapUI
> (4.5.0). Trying to run the testsuite in a JUnit test fails:
> "java.lang.AssertionError: expected:<FINISHED> but was:<FAILED>".
> I Assume its due to the error message i get in the console:
> "ERROR [SoapUI] An error occured [BUG! exception in phase 'semantic analysis'
> in source unit 'Script1.groovy' Invalid index], see error log for details
> BUG! exception in phase 'semantic analysis' in source unit 'Script1.groovy'
> Invalid index"
> This i my code:
> {code}
> @Test
> public void allTestCases() throws Exception {
> WsdlProject project = new WsdlProject("someproject.xml");
> List<TestSuite> testSuites = project.getTestSuiteList();
> for (TestSuite suite : testSuites) {
> List<TestCase> testCases = suite.getTestCaseList();
> for (TestCase testCase : testCases) {
> TestRunner runner2 = testCase.run(new PropertiesMap(), false);
> assertEquals(Status.FINISHED, runner2.getStatus());
> }
> }
> }
> {code}
> At first i was using groovy-all-1.8.0 and I also tried it with 1.8.6.
> afterwards.Nothing changed...
> I only get this error message when I'm using groovy scripts in my testsuite.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)