13 Replies Latest reply on Jan 25, 2013 3:02 AM by fan kam thong

    jboss-cli connect throws out of memory exception

    fan kam thong Newbie

      I am using 7.1.3 building from source, when I start jboss-cli , there is an out of memory exception being thrown:

       

      ---------------------------------------------------------------------------

      java.lang.OutOfMemoryError: Java heap space

              at java.util.Arrays.copyOf(Arrays.java:2882)

              at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.

      java:100)

              at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:390

      )

              at java.lang.StringBuilder.append(StringBuilder.java:119)

              at org.jboss.as.cli.impl.CommandContextImpl.handleSafe(CommandContextImp

      l.java:551)

              at org.jboss.as.cli.impl.CommandContextImpl.interact(CommandContextImpl.

      java:1113)

              at org.jboss.as.cli.impl.CliLauncher.main(CliLauncher.java:243)

              at org.jboss.as.cli.CommandLineMain.main(CommandLineMain.java:34)

              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.

      java:39)

              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces

      sorImpl.java:25)

              at java.lang.reflect.Method.invoke(Method.java:597)

              at org.jboss.modules.Module.run(Module.java:270)

              at org.jboss.modules.Main.main(Main.java:294)

      Press any key to continue . . .

      ------------------------------------------------------------------------------

       

      I found that this issue was reported here https://issues.jboss.org/browse/AS7-5687

       

      Is using 7.1.4 EAP the only solution available ?

        • 1. Re: jboss-cli connect throws out of memory exception
          Nicklas Karlsson Master

          That would appears to be the most clean solution.

          • 2. Re: jboss-cli connect throws out of memory exception
            fan kam thong Newbie

            I dont mind to do some manual fixes as long as there is alternative solution. EAP is not an option yet for my company

            • 3. Re: jboss-cli connect throws out of memory exception
              Nicklas Karlsson Master

              You can probably hunt down the fix and see if it can be backported (although technically 7.1.3 is as "EAP" as 7.1.4 so it should be in there, too, once it's released. I don't think the fix is a private patch)

              • 4. Re: jboss-cli connect throws out of memory exception
                Nicklas Karlsson Master

                https://github.com/jbossas/jboss-as/commit/2f5e8a888c976a0e4e6657ffc5e2f5c397ada5e4

                 

                (it looks like it goes into an endless loop in CommandContextImpl so it should be a one-line-fix)

                • 5. Re: jboss-cli connect throws out of memory exception
                  fan kam thong Newbie

                  The fixes do not pass through the mvn install with the following exception:

                   

                  --------------------------------------------------------------------------------------------------------------------------

                   

                  [ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:

                  2.5:checkstyle (check-style) on project jboss-as-cli: An error has occurred in C

                  heckstyle report generation. Failed during checkstyle execution: There are 7 che

                  ckstyle errors. -> [Help 1]

                  org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o

                  rg.apache.maven.plugins:maven-checkstyle-plugin:2.5:checkstyle (check-style) on

                  project jboss-as-cli: An error has occurred in Checkstyle report generation.

                          at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor

                  .java:217)

                          at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor

                  .java:153)

                          at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor

                  .java:145)

                          at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje

                  ct(LifecycleModuleBuilder.java:84)

                          at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje

                  ct(LifecycleModuleBuilder.java:59)

                          at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBu

                  ild(LifecycleStarter.java:183)

                          at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl

                  eStarter.java:161)

                          at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)

                          at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)

                          at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)

                          at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)

                          at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)

                          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.

                  java:39)

                          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces

                  sorImpl.java:25)

                          at java.lang.reflect.Method.invoke(Method.java:597)

                          at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun

                  cher.java:290)

                          at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav

                  a:230)

                          at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La

                  uncher.java:409)

                          at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:

                  352)

                  Caused by: org.apache.maven.plugin.MojoExecutionException: An error has occurred

                  in Checkstyle report generation.

                          at org.apache.maven.reporting.AbstractMavenReport.execute(AbstractMavenR

                  eport.java:83)

                          at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default

                  BuildPluginManager.java:101)

                          at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor

                  .java:209)

                          ... 19 more

                  Caused by: org.apache.maven.reporting.MavenReportException: Failed during checks

                  tyle execution

                          at org.apache.maven.plugin.checkstyle.CheckstyleReport.executeReport(Che

                  ckstyleReport.java:595)

                          at org.apache.maven.reporting.AbstractMavenReport.generate(AbstractMaven

                  Report.java:131)

                          at org.apache.maven.reporting.AbstractMavenReport.execute(AbstractMavenR

                  eport.java:76)

                          ... 21 more

                  Caused by: org.apache.maven.plugin.checkstyle.CheckstyleExecutorException: There

                  are 7 checkstyle errors.

                          at org.apache.maven.plugin.checkstyle.DefaultCheckstyleExecutor.executeC

                  heckstyle(DefaultCheckstyleExecutor.java:218)

                          at org.apache.maven.plugin.checkstyle.CheckstyleReport.executeReport(Che

                  ckstyleReport.java:576)

                          ... 23 more

                  [ERROR]

                  [ERROR] Re-run Maven using the -X switch to enable full debug logging.

                  [ERROR]

                  [ERROR] For more information about the errors and possible solutions, please rea

                  d the following articles:

                  [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionE

                  xception

                  • 6. Re: jboss-cli connect throws out of memory exception
                    Nicklas Karlsson Master

                    Run "build clean install". That way you use the correct (bundled) maven version.

                    • 7. Re: jboss-cli connect throws out of memory exception
                      fan kam thong Newbie

                      It seems like I am having the same problem with "build clean install"

                       

                      [INFO] BUILD FAILURE

                      [INFO] ------------------------------------------------------------------------

                      [INFO] Total time: 6:52.616s

                      [INFO] Finished at: Wed Jan 23 11:10:11 SGT 2013

                      [INFO] Final Memory: 192M/247M

                      [INFO] ------------------------------------------------------------------------

                      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:

                      2.5:checkstyle (check-style) on project jboss-as-cli: An error has occurred in C

                      heckstyle report generation. Failed during checkstyle execution: There are 7 che

                      ckstyle errors. -> [Help 1]

                      [ERROR]

                      [ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit

                      ch.

                      [ERROR] Re-run Maven using the -X switch to enable full debug logging.

                      [ERROR]

                      [ERROR] For more information about the errors and possible solutions, please rea

                      d the following articles:

                      [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionE

                      xception

                      [ERROR]

                      [ERROR] After correcting the problems, you can resume the build with the command

                       

                       

                      [ERROR]   mvn <goals> -rf :jboss-as-cli

                      Press any key to continue . . .

                      • 8. Re: jboss-cli connect throws out of memory exception
                        Nicklas Karlsson Master

                        Run it with the -e switch and try to find out what the checkstyle errors are. Checkstyle can be disabled but there are probably underlying problems that would manifest themselves later on, anyway.

                        1 of 1 people found this helpful
                        • 9. Re: jboss-cli connect throws out of memory exception
                          fan kam thong Newbie

                          I attach the log from the build process. How can I disable the checkstyle ? what will be the implication if it's disabled ?

                          • 10. Re: jboss-cli connect throws out of memory exception
                            Nicklas Karlsson Master

                            Don't know if that's the reason but in the end of the log there is

                             

                            C:\Users\ktfan\Desktop\jboss-temp\jboss-as-7.1.3.Final\jboss-as-7.1.3.Final\cli\src\main\java\org\jboss\as\cli\handlers\OperationRequestHandler.java:83: Line has trailing spaces.

                            C:\Users\ktfan\Desktop\jboss-temp\jboss-as-7.1.3.Final\jboss-as-7.1.3.Final\cli\src\main\java\org\jboss\as\cli\handlers\OperationRequestHandler.java:84:1: Line contains a tab character.

                            C:\Users\ktfan\Desktop\jboss-temp\jboss-as-7.1.3.Final\jboss-as-7.1.3.Final\cli\src\main\java\org\jboss\as\cli\handlers\OperationRequestHandler.java:85: Line has trailing spaces.

                            C:\Users\ktfan\Desktop\jboss-temp\jboss-as-7.1.3.Final\jboss-as-7.1.3.Final\cli\src\main\java\org\jboss\as\cli\handlers\OperationRequestHandler.java:86:1: Line contains a tab character.

                            C:\Users\ktfan\Desktop\jboss-temp\jboss-as-7.1.3.Final\jboss-as-7.1.3.Final\cli\src\main\java\org\jboss\as\cli\handlers\OperationRequestHandler.java:88: Line has trailing spaces.

                            C:\Users\ktfan\Desktop\jboss-temp\jboss-as-7.1.3.Final\jboss-as-7.1.3.Final\cli\src\main\java\org\jboss\as\cli\handlers\OperationRequestHandler.java:89:1: Line contains a tab character.

                            C:\Users\ktfan\Desktop\jboss-temp\jboss-as-7.1.3.Final\jboss-as-7.1.3.Final\cli\src\main\java\org\jboss\as\cli\impl\CommandContextImpl.java:552:1: Line contains a tab character.

                             

                            have you unzipped on unix and moved to windows or something?

                             

                            you could try "build clean install -DskipTests -Dcheckstyle.skip"


                            1 of 1 people found this helpful
                            • 11. Re: jboss-cli connect throws out of memory exception
                              fan kam thong Newbie

                              I managed to build the jboss version with the fixes after fixing the unnecessary trailing spaces and tab character.

                               

                              Apparently, I managed to use jboss-cli command to connect to the server. However I have a minor issue here, I have to specify the IP and port while using the "connect" command since I have changed my management interface IP from 127.0.0,1 to my own specified IP.

                               

                              <interface name="management">

                                    <inet-address value="${jboss.bind.address.management:192.169.1.118}"/>

                              </interface>

                               

                               

                              If not I will have this error prompt,

                               

                              The controller is not available at localhost:9999: java.net.ConnectException: JBAS012144: Could not connect to remote://localhost:9999. The connection timed out: JBAS012144: Could not connect to remote://localhost:9999. The connection timed out

                               

                              May I know if there is any configuration where I can overwrite this default localhost:9999 ?

                              • 12. Re: jboss-cli connect throws out of memory exception
                                Nicklas Karlsson Master

                                jboss-cli --controller=192.169.1.118:9999

                                • 13. Re: jboss-cli connect throws out of memory exception
                                  fan kam thong Newbie

                                  Nicklas, thanks for all the pointers & advices. my problem is resolved now.