[ 
https://issues.apache.org/activemq/browse/SMX4KNL-188?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=49391#action_49391
 ] 

Edell Nolan commented on SMX4KNL-188:
-------------------------------------

I have debugged this down and its down to code in the wisdom-core for the 
ShellImpl.java

It attempts to do the following for the Terminal width and this is whats 
causing the error

In the run method it attempts 

            if (message != null) {
                io.out.print(message);             
                io.out.println(repeat("-", io.getTerminal().getTerminalWidth() 
- 1));
                io.out.flush();
            }

then in the repeat method 

 private static String repeat(final String str, final int repeat) {
        System.out.println("repeat = " + repeat);
        System.out.println("str length" +  str.length());
        StringBuilder buffer = new StringBuilder(repeat * str.length());
        for (int i = 0; i < repeat; i++) {
            buffer.append(str);
        }
        return buffer.toString();
    }

so effectively it ends up attempting to create quite a large negative sized 
array and barfs.

I am not sure yet if this is because of the JLine version we are using.

Edell.

> Gshell itests fail on windows 
> ------------------------------
>
>                 Key: SMX4KNL-188
>                 URL: https://issues.apache.org/activemq/browse/SMX4KNL-188
>             Project: ServiceMix Kernel
>          Issue Type: Bug
>            Reporter: Edell Nolan
>             Fix For: 1.1.0
>
>
> The gshell itests fail consistently on windows for me 
> When it attempts to get 
> getOsgiService(Shell.class); 
> In the test logs - it throws 
> testHelp(org.apache.servicemix.kernel.gshell.itests.CoreTest)  Time elapsed: 
> 9.25 sec  <<< ERROR!
> java.lang.IllegalStateException: Unable to dynamically start generated unit 
> test bundle
>       at 
> org.springframework.osgi.test.AbstractOnTheFlyBundleCreatorTests.postProcessBundleContext(AbstractOnTheFlyBundleCreatorTests.java:519)
>       at 
> org.springframework.osgi.test.AbstractConfigurableBundleCreatorTests.postProcessBundleContext(AbstractConfigurableBundleCreatorTests.java:223)
>       at 
> org.springframework.osgi.test.AbstractOsgiTests.startup(AbstractOsgiTests.java:262)
>       at 
> org.springframework.osgi.test.AbstractOsgiTests.prepareTestExecution(AbstractOsgiTests.java:374)
>       at 
> org.springframework.osgi.test.AbstractOsgiTests.runBare(AbstractOsgiTests.java:203)
>       at 
> org.springframework.osgi.test.AbstractOsgiTests$1.protect(AbstractOsgiTests.java:184)
>       at junit.framework.TestResult.runProtected(TestResult.java:124)
>       at 
> org.springframework.osgi.test.AbstractOsgiTests.run(AbstractOsgiTests.java:181)
>       at junit.framework.TestSuite.runTest(TestSuite.java:208)
>       at junit.framework.TestSuite.run(TestSuite.java:203)
>       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.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:213)
>       at 
> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:138)
>       at 
> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:125)
>       at org.apache.maven.surefire.Surefire.run(Surefire.java:132)
>       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.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:308)
>       at 
> org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:879)
> Caused by: org.osgi.framework.BundleException: The framework has been 
> shutdown.
>       at org.apache.felix.framework.Felix.installBundle(Felix.java:2244)
>       at org.apache.felix.framework.Felix.installBundle(Felix.java:2227)
>       at 
> org.apache.felix.framework.BundleContextImpl.installBundle(BundleContextImpl.java:132)
>       at 
> org.springframework.osgi.test.AbstractOnTheFlyBundleCreatorTests.installAndStartBundle(AbstractOnTheFlyBundleCreatorTests.java:531)
>       at 
> org.springframework.osgi.test.AbstractOnTheFlyBundleCreatorTests.postProcessBundleContext(AbstractOnTheFlyBundleCreatorTests.java:516)
>       ... 23 more
>       ... 23 more
> The remaining tests fail because then the port is in use.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to