6 Replies Latest reply on Aug 13, 2013 11:13 AM by Mauricio Magnani Jr

    JBoss AS7 + Sonar

    Tadeu Rodrigo Becker Gois Newbie

      Boa tarde pessoal, sou amigo do Adriano Schimidt e ele indicou este grupo para me ajudar a resolver um problema para rodar o Sonar no JBoss AS 7. Fiz algumas pesquisas no google e o melhor que encontrei foi este site http://polycrystal.org/2012/02/26/deploying_sonar_to_jboss_as7.html mas a solução indicada neste site não funcionou.

       

      Mesmo o Sonar oficialmente informar que o JBoss não é suportado http://docs.codehaus.org/display/SONAR/Requirements

      alguém já passou por este problema e saberia me dizer se há possibilidade e que configuraçẽos alterar para que o Sonar rode no JBoss AS 7?

       

      Desde já agradeço,

        • 1. Re: JBoss AS7 + Sonar
          Ricardo Martinelli Oliveira Apprentice

          Fala Tadeu,

           

          Muito estranho isso de Sonar não suportar JBoss. Afinal, o Sonar não é uma aplicação Java EE empacotada em um war?

           

          De qualquer forma, se puder detalhar melhor qual é o problema enfrentado agora nos ajudaria a ajudá-lo. Afinal: Quem quer rir, tem que fazer rir... =D

          • 2. Re: JBoss AS7 + Sonar
            Tadeu Rodrigo Becker Gois Newbie

            Boa tarde Ricardo,

             

            na verdade o Sonar não é uma aplicação Java EE "normal" a sua distribuição vem com um servidor web embutido e vc pode iniciar o Sonar sem fazer deploy em outro servidor. Desta forma ele funciona perfeitamente.

             

            Mas é possivel através de um script ant criar um arquivo war. Foi este arquivo que tentei disponibilizar no JBoss e retornou o seguinte log:

             

             

            14:27:53,715 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015876: Starting deployment of "sonar.war"

            14:28:02,074 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-2) Class Path entry xml-apis.jar in "/content/sonar.war/WEB-INF/lib/serializer-2.7.1.jar"  does not point to a valid jar for a Class-Path reference.

            14:28:02,076 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-2) Class Path entry xercesImpl.jar in "/content/sonar.war/WEB-INF/lib/xalan-2.7.1.jar"  does not point to a valid jar for a Class-Path reference.

            14:28:02,077 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-2) Class Path entry xml-apis.jar in "/content/sonar.war/WEB-INF/lib/xalan-2.7.1.jar"  does not point to a valid jar for a Class-Path reference.

            14:28:02,078 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-2) Class Path entry serializer.jar in "/content/sonar.war/WEB-INF/lib/xalan-2.7.1.jar"  does not point to a valid jar for a Class-Path reference.

            14:28:02,295 WARN  [org.jboss.as.ee] (MSC service thread 1-1) JBAS011006: Not installing optional component org.eclipse.jetty.continuation.Servlet3Continuation$1 due to exception: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011054: Could not find default constructor for class org.eclipse.jetty.continuation.Servlet3Continuation$1

                      at org.jboss.as.ee.component.ComponentDescription$DefaultComponentConfigurator.configure(ComponentDescription.java:606)

                      at org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:81)

                      at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

                      at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

                      at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

                      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) [rt.jar:1.6.0_45]

                      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) [rt.jar:1.6.0_45]

                      at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_45]

             

             

            14:28:02,306 WARN  [org.jboss.as.ee] (MSC service thread 1-1) JBAS011006: Not installing optional component org.eclipse.jetty.continuation.Servlet3Continuation$2 due to exception: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011054: Could not find default constructor for class org.eclipse.jetty.continuation.Servlet3Continuation$2

                      at org.jboss.as.ee.component.ComponentDescription$DefaultComponentConfigurator.configure(ComponentDescription.java:606)

                      at org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:81)

                      at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

                      at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

                      at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

                      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) [rt.jar:1.6.0_45]

                      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) [rt.jar:1.6.0_45]

                      at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_45]

             

             

            14:28:02,337 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-1) JBAS010404: Deploying non-JDBC-compliant driver class org.postgresql.Driver (version 9.1)

            14:28:02,343 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-1) JBAS010404: Deploying non-JDBC-compliant driver class net.sourceforge.jtds.jdbc.Driver (version 1.2)

            14:28:02,345 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-1) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)

            14:28:02,350 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-1) JBAS010404: Deploying non-JDBC-compliant driver class com.mysql.jdbc.Driver (version 5.1)

            14:28:02,395 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/sonar]] (MSC service thread 1-2) Exception sending context initialized event to listener instance of class org.sonar.server.platform.PlatformLifecycleListener: java.lang.ClassCastException: org.slf4j.impl.Slf4jLoggerFactory

                      at org.sonar.core.config.Logback.configure(Logback.java:67) [sonar-core-3.6.2.jar:]

                      at org.sonar.core.config.Logback.configure(Logback.java:57) [sonar-core-3.6.2.jar:]

                      at org.sonar.server.platform.PlatformLifecycleListener.configureLogback(PlatformLifecycleListener.java:45) [classes:]

                      at org.sonar.server.platform.PlatformLifecycleListener.contextInitialized(PlatformLifecycleListener.java:32) [classes:]

                      at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392) [jbossweb-7.0.13.Final.jar:]

                      at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.13.Final.jar:]

                      at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]

                      at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)

                      at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1747)

                      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) [rt.jar:1.6.0_45]

                      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:919) [rt.jar:1.6.0_45]

                      at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_45]

             

             

            14:28:02,482 INFO  [jruby.rack] (MSC service thread 1-2) jruby 1.6.8 (ruby-1.8.7-p357) (2012-09-18 1772b40) (Oracle JRockit(R) 1.6.0_45) [linux-amd64-java]

            14:28:02,484 INFO  [jruby.rack] (MSC service thread 1-2) using a shared (threadsafe!) runtime

            14:28:08,641 INFO  [jruby.rack] (MSC service thread 1-2) An exception happened during JRuby-Rack startup

            java.lang.NullPointerException: null

            --- System

            jruby 1.6.8 (ruby-1.8.7-p357) (2012-09-18 1772b40) (Oracle JRockit(R) 1.6.0_45) [linux-amd64-java]

            Time: Mon Jul 22 14:28:08 -0300 2013

            Server: JBoss Web/7.0.13.Final

            jruby.home: classpath:/META-INF/jruby.home

             

             

            --- Context Init Parameters:

            jruby.compat.version = 1.8

            jruby.max.runtimes = 1

            jruby.min.runtimes = 1

            jruby.rack.logging = slf4j

            public.root = /

            rails.env = production

             

             

            --- Backtrace

            NativeException: java.lang.NullPointerException: null

                        (root) at /home/supero/jboss-as-7.1.1.Final/standalone/tmp/vfs/temp67a6076749579586/content-e722fb0c2773950a/WEB-INF/config/environment.rb:52

                           run at /home/supero/jboss-as-7.1.1.Final/standalone/tmp/vfs/temp67a6076749579586/content-e722fb0c2773950a/WEB-INF/gems/gems/rails-2.3.15/lib/initializer.rb:111

                        (root) at /home/supero/jboss-as-7.1.1.Final/standalone/tmp/vfs/temp67a6076749579586/content-e722fb0c2773950a/WEB-INF/config/environment.rb:32

                          load at org/jruby/RubyKernel.java:1087

              load_environment at /home/supero/jboss-as-7.1.1.Final/standalone/tmp/vfs/temp67a6076749579586/content-e722fb0c2773950a/WEB-INF/config/environment.rb:23

              load_environment at classpath:/./jruby/rack/rails_booter.rb:65

                        (root) at <script>:1

             

             

            --- RubyGems

            Gem.dir: /home/supero/jboss-as-7.1.1.Final/standalone/tmp/vfs/temp67a6076749579586/content-e722fb0c2773950a/WEB-INF/gems

            Gem.path:

            /home/supero/jboss-as-7.1.1.Final/standalone/tmp/vfs/temp67a6076749579586/content-e722fb0c2773950a/WEB-INF/gems

            Activated gems:

              rake-0.9.2.2

              activesupport-2.3.15

              activerecord-2.3.15

              rack-1.1.3

              actionpack-2.3.15

              actionmailer-2.3.15

              activeresource-2.3.15

              rails-2.3.15

              color-tools-1.3.0

             

             

            --- Bundler

            undefined method `bundle_path' for Bundler:Module

             

             

            --- JRuby-Rack Config

            compat_version = RUBY1_8

            default_logger = org.jruby.rack.logging.StandardOutLogger@1d4be21f

            err = org.jboss.stdio.StdioContext$2@1c20b844

            filter_adds_html = true

            filter_verifies_resource = false

            ignore_environment = false

            initial_memory_buffer_size =

            initial_runtimes = 1

            jms_connection_factory =

            jms_jndi_properties =

            logger = org.jruby.rack.logging.Slf4jLogger@1e0d1454

            logger_class_name = slf4j

            logger_name = jruby.rack

            maximum_memory_buffer_size =

            maximum_runtimes = 1

            num_initializer_threads =

            out = org.jboss.stdio.StdioContext$1@1c20b840

            rackup =

            rackup_path =

            rewindable = true

            runtime_arguments =

            runtime_timeout_seconds =

            serial_initialization = false

            servlet_context = org.apache.catalina.core.ApplicationContextFacade@1e0d1451

             

             

            --- Java Exception

            java.lang.NullPointerException

                      at org.sonar.server.ui.JRubyFacade.get(JRubyFacade.java:83)

                      at org.sonar.server.ui.JRubyFacade.getServerHome(JRubyFacade.java:450)

             

             

            14:28:08,659 ERROR [jruby.rack] (MSC service thread 1-2) unable to create shared application instance: org.jruby.rack.RackInitializationException: java.lang.NullPointerException: null

                      from org/sonar/server/ui/JRubyFacade.java:83:in `get'

                      from org/sonar/server/ui/JRubyFacade.java:450:in `getServerHome'

                      from /home/supero/jboss-as-7.1.1.Final/standalone/tmp/vfs/temp67a6076749579586/content-e722fb0c2773950a/WEB-INF/config/environment.rb:52:in `(root)'

                      from /home/supero/jboss-as-7.1.1.Final/standalone/tmp/vfs/temp67a6076749579586/content-e722fb0c2773950a/WEB-INF/gems/gems/rails-2.3.15/lib/initializer.rb:111:in `run'

                      from /home/supero/jboss-as-7.1.1.Final/standalone/tmp/vfs/temp67a6076749579586/content-e722fb0c2773950a/WEB-INF/config/environment.rb:32:in `(root)'

                      from org/jruby/RubyKernel.java:1087:in `load'

                      from /home/supero/jboss-as-7.1.1.Final/standalone/tmp/vfs/temp67a6076749579586/content-e722fb0c2773950a/WEB-INF/config/environment.rb:23:in `load_environment'

                      from classpath:/./jruby/rack/rails_booter.rb:65:in `load_environment'

                      from <script>:1:in `(root)'

             

             

                      at org.jruby.rack.DefaultRackApplicationFactory$4.init(DefaultRackApplicationFactory.java:231) [jruby-rack-1.1.10.jar:]

                      at org.jruby.rack.DefaultRackApplicationFactory.getApplication(DefaultRackApplicationFactory.java:58) [jruby-rack-1.1.10.jar:]

                      at org.jruby.rack.SharedRackApplicationFactory.init(SharedRackApplicationFactory.java:33) [jruby-rack-1.1.10.jar:]

                      at org.jruby.rack.RackServletContextListener.contextInitialized(RackServletContextListener.java:48) [jruby-rack-1.1.10.jar:]

                      at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392) [jbossweb-7.0.13.Final.jar:]

                      at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.13.Final.jar:]

                      at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]

                      at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)

                      at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1747)

                      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) [rt.jar:1.6.0_45]

                      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:919) [rt.jar:1.6.0_45]

                      at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_45]

            Caused by: org.jruby.exceptions.RaiseException: Native Exception: 'class java.lang.NullPointerException'; Message: null; StackTrace: java.lang.NullPointerException

                      at org.sonar.server.ui.JRubyFacade.get(JRubyFacade.java:83)

                      at org.sonar.server.ui.JRubyFacade.getServerHome(JRubyFacade.java:450)

             

             

                      at org.sonar.server.ui.JRubyFacade.get(JRubyFacade.java:83) [classes:]

                      at org.sonar.server.ui.JRubyFacade.getServerHome(JRubyFacade.java:450) [classes:]

            Caused by: java.lang.NullPointerException

                      ... 2 more

             

             

            14:28:08,669 ERROR [jruby.rack] (MSC service thread 1-2) Error: application initialization failed: org.jruby.rack.RackInitializationException: java.lang.NullPointerException: null

                      from org/sonar/server/ui/JRubyFacade.java:83:in `get'

                      from org/sonar/server/ui/JRubyFacade.java:450:in `getServerHome'

                      from /home/supero/jboss-as-7.1.1.Final/standalone/tmp/vfs/temp67a6076749579586/content-e722fb0c2773950a/WEB-INF/config/environment.rb:52:in `(root)'

                      from /home/supero/jboss-as-7.1.1.Final/standalone/tmp/vfs/temp67a6076749579586/content-e722fb0c2773950a/WEB-INF/gems/gems/rails-2.3.15/lib/initializer.rb:111:in `run'

                      from /home/supero/jboss-as-7.1.1.Final/standalone/tmp/vfs/temp67a6076749579586/content-e722fb0c2773950a/WEB-INF/config/environment.rb:32:in `(root)'

                      from org/jruby/RubyKernel.java:1087:in `load'

                      from /home/supero/jboss-as-7.1.1.Final/standalone/tmp/vfs/temp67a6076749579586/content-e722fb0c2773950a/WEB-INF/config/environment.rb:23:in `load_environment'

                      from classpath:/./jruby/rack/rails_booter.rb:65:in `load_environment'

                      from <script>:1:in `(root)'

             

             

                      at org.jruby.rack.DefaultRackApplicationFactory$4.init(DefaultRackApplicationFactory.java:231) [jruby-rack-1.1.10.jar:]

                      at org.jruby.rack.DefaultRackApplicationFactory.getApplication(DefaultRackApplicationFactory.java:58) [jruby-rack-1.1.10.jar:]

                      at org.jruby.rack.SharedRackApplicationFactory.init(SharedRackApplicationFactory.java:33) [jruby-rack-1.1.10.jar:]

                      at org.jruby.rack.RackServletContextListener.contextInitialized(RackServletContextListener.java:48) [jruby-rack-1.1.10.jar:]

                      at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392) [jbossweb-7.0.13.Final.jar:]

                      at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.13.Final.jar:]

                      at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]

                      at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)

                      at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1747)

                      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) [rt.jar:1.6.0_45]

                      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:919) [rt.jar:1.6.0_45]

                      at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_45]

            Caused by: org.jruby.exceptions.RaiseException: Native Exception: 'class java.lang.NullPointerException'; Message: null; StackTrace: java.lang.NullPointerException

                      at org.sonar.server.ui.JRubyFacade.get(JRubyFacade.java:83)

                      at org.sonar.server.ui.JRubyFacade.getServerHome(JRubyFacade.java:450)

             

             

                      at org.sonar.server.ui.JRubyFacade.get(JRubyFacade.java:83) [classes:]

                      at org.sonar.server.ui.JRubyFacade.getServerHome(JRubyFacade.java:450) [classes:]

            Caused by: java.lang.NullPointerException

                      ... 2 more

             

             

            14:28:08,686 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-2) Error listenerStart

            14:28:08,687 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-2) Context [/sonar] startup failed due to previous errors

            14:28:08,747 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.web.deployment.default-host./sonar: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./sonar: JBAS018040: Failed to start context

                      at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:95)

                      at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

                      at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1747) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

                      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) [rt.jar:1.6.0_45]

                      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:919) [rt.jar:1.6.0_45]

                      at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_45]

             

             

            14:28:08,981 INFO  [org.jboss.as.server] (HttpManagementService-threads - 1) JBAS015870: Deploy of deployment "sonar.war" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.web.deployment.default-host./sonar" => "org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./sonar: JBAS018040: Failed to start context"}}

            14:28:09,222 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015877: Stopped deployment sonar.war in 250ms

            14:28:09,226 INFO  [org.jboss.as.controller] (HttpManagementService-threads - 1) JBAS014774: Service status report

            JBAS014777:   Services which failed to start:      service jboss.web.deployment.default-host./sonar: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./sonar: JBAS018040: Failed to start context

            • 3. Re: JBoss AS7 + Sonar
              Adriano Schmidt Master

              fala tadeu : )

               

              dei uma pesquisada aqui..

               

              o "does not point to a valid jar for a Class-Path reference" você pode ignorar. ( https://community.jboss.org/thread/198349 )

               

              o "Could not find default constructor for class org.eclipse.jetty.continuation.Servlet3Continuation$1" ( https://community.jboss.org/thread/196447 )

               

              você pode tentar fazer alguma gambi do tipo pegar o código da Servlet3Continuation e usá-lo adicionando um construtor default

              • 4. Re: JBoss AS7 + Sonar
                Mauricio Magnani Jr Master

                Oi Tadeu tudo bom?

                 

                Conseguiu fazer o Sonar rodar no JBoss 7?

                 

                Eu baixei o pacote e já fiz alguns testes mas não tive sucesso.  Se eu conseguir aviso.

                 

                Abs

                • 5. Re: JBoss AS7 + Sonar
                  Tadeu Rodrigo Becker Gois Newbie

                  Bom dia Mauricio, desisti da configuração, estou rodando o sonar standalone.

                   

                  abs

                  • 6. Re: JBoss AS7 + Sonar
                    Mauricio Magnani Jr Master

                    Opa blz... dá muito trabalho mesmo.

                     

                    Abs