1 2 Previous Next 15 Replies Latest reply on Jun 8, 2011 5:44 PM by pgmjsd

    New JBoss Logging Configuration Problem

    andy.miller

      I'm trying to turn off the CONSOLE logging, and use the ASYNC logging in the new logging framework, but when I comment out the CONSOLE section, uncomment the ASYNC section, and change the root configuration at the bottom to just specify the ASYNC, I get the following exception:

       

      20:53:06,882 ERROR [AbstractKernelController] Error installing to Parse: name=vfs:///home/jboss/jboss-6.0.0.20100429-M3/server/all/deploy/jboss-logging.xml state=PreParse mode=Manual requiredState=Parse: org.jboss.deployers.spi.DeploymentException: Error creating managed object for vfs:///home/jboss/jboss-6.0.0.20100429-M3/server/all/deploy/jboss-logging.xml

          at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49) [:2.2.0.Alpha4]

          at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:362) [:2.2.0.Alpha4]

          at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:322) [:2.2.0.Alpha4]

          at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:294) [:2.2.0.Alpha4]

          at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.deploy(AbstractParsingDeployerWithOutput.java:234) [:2.2.0.Alpha4]

          at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:179) [:2.2.0.Alpha4]

          at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1857) [:2.2.0.Alpha4]

          at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1575) [:2.2.0.Alpha4]

          at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1516) [:2.2.0.Alpha4]

          at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:377) [jboss-dependency.jar:2.2.0.Alpha9]

          at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2042) [jboss-dependency.jar:2.2.0.Alpha9]

          at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1081) [jboss-dependency.jar:2.2.0.Alpha9]

          at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1320) [jboss-dependency.jar:2.2.0.Alpha9]

          at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1244) [jboss-dependency.jar:2.2.0.Alpha9]

          at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1137) [jboss-dependency.jar:2.2.0.Alpha9]

          at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:937) [jboss-dependency.jar:2.2.0.Alpha9]

          at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:652) [jboss-dependency.jar:2.2.0.Alpha9]

          at org.jboss.deployers.plugins.deployers.DeployersImpl.change(DeployersImpl.java:2008) [:2.2.0.Alpha4]

          at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:1101) [:2.2.0.Alpha4]

          at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:679) [:2.2.0.Alpha4]

          at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117) [:6.0.0.20100429-M3]

          at org.jboss.system.server.profileservice.repository.ProfileDeployAction.install(ProfileDeployAction.java:70) [:6.0.0.20100429-M3]

          at org.jboss.system.server.profileservice.repository.AbstractProfileAction.install(AbstractProfileAction.java:53) [:6.0.0.20100429-M3]

          at org.jboss.system.server.profileservice.repository.AbstractProfileService.install(AbstractProfileService.java:403) [:6.0.0.20100429-M3]

          at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:377) [jboss-dependency.jar:2.2.0.Alpha9]

          at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2042) [jboss-dependency.jar:2.2.0.Alpha9]

          at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1081) [jboss-dependency.jar:2.2.0.Alpha9]

          at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1320) [jboss-dependency.jar:2.2.0.Alpha9]

          at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1244) [jboss-dependency.jar:2.2.0.Alpha9]

          at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1137) [jboss-dependency.jar:2.2.0.Alpha9]

          at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:892) [jboss-dependency.jar:2.2.0.Alpha9]

          at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:639) [jboss-dependency.jar:2.2.0.Alpha9]

          at org.jboss.system.server.profileservice.repository.AbstractProfileService.registerProfile(AbstractProfileService.java:308) [:6.0.0.20100429-M3]

          at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:256) [:6.0.0.20100429-M3]

          at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:97) [:6.0.0.20100429-M3]

          at org.jboss.bootstrap.impl.base.server.AbstractServer.startBootstraps(AbstractServer.java:827) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-5]

          at org.jboss.bootstrap.impl.base.server.AbstractServer$StartServerTask.run(AbstractServer.java:417) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-5]

          at java.lang.Thread.run(Thread.java:636) [:1.6.0_18]

      Caused by: org.jboss.xb.binding.JBossXBException: Failed to parse source: {urn:jboss:logging:6.0}handler-ref not found as a child of {urn:jboss:logging:6.0}sub-handlers in sequence: {choice}*

          at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:195) [jbossxb.jar:2.0.2.Beta7]

          at org.jboss.xb.binding.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:168) [jbossxb.jar:2.0.2.Beta7]

          at org.jboss.xb.util.JBossXBHelper.parse(JBossXBHelper.java:229) [jbossxb.jar:2.0.2.Beta7]

          at org.jboss.xb.util.JBossXBHelper.parse(JBossXBHelper.java:206) [jbossxb.jar:2.0.2.Beta7]

          at org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer.parse(SchemaResolverDeployer.java:137) [:2.2.0.Alpha4]

          at org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer.parse(SchemaResolverDeployer.java:121) [:2.2.0.Alpha4]

          at org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer.parseAndInit(AbstractVFSParsingDeployer.java:315) [:2.2.0.Alpha4]

          at org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer.parseAndInit(AbstractVFSParsingDeployer.java:297) [:2.2.0.Alpha4]

          at org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer.parse(AbstractVFSParsingDeployer.java:221) [:2.2.0.Alpha4]

          at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:348) [:2.2.0.Alpha4]

          ... 36 more

      Caused by: org.jboss.xb.binding.JBossXBRuntimeException: {urn:jboss:logging:6.0}handler-ref not found as a child of {urn:jboss:logging:6.0}sub-handlers in sequence: {choice}*

          at org.jboss.xb.binding.sunday.unmarshalling.ElementPosition.nextPosition(ElementPosition.java:199) [jbossxb.jar:2.0.2.Beta7]

          at org.jboss.xb.binding.sunday.unmarshalling.ElementPosition.startParticle(ElementPosition.java:475) [jbossxb.jar:2.0.2.Beta7]

          at org.jboss.xb.binding.sunday.unmarshalling.SundayContentHandler.startElement(SundayContentHandler.java:203) [jbossxb.jar:2.0.2.Beta7]

          at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.startElement(SaxJBossXBParser.java:370) [jbossxb.jar:2.0.2.Beta7]

          at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source) [xercesImpl.jar:6.0.0.20100429-M3]

          at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source) [xercesImpl.jar:6.0.0.20100429-M3]

          at org.apache.xerces.xinclude.XIncludeHandler.emptyElement(Unknown Source) [xercesImpl.jar:6.0.0.20100429-M3]

          at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source) [xercesImpl.jar:6.0.0.20100429-M3]

          at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) [xercesImpl.jar:6.0.0.20100429-M3]

          at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) [xercesImpl.jar:6.0.0.20100429-M3]

          at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) [xercesImpl.jar:6.0.0.20100429-M3]

          at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) [xercesImpl.jar:6.0.0.20100429-M3]

          at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) [xercesImpl.jar:6.0.0.20100429-M3]

          at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) [xercesImpl.jar:6.0.0.20100429-M3]

          at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) [xercesImpl.jar:6.0.0.20100429-M3]

          at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:191) [jbossxb.jar:2.0.2.Beta7]

       

      I have attached the jboss-logging.xml file I'm trying to use.

        • 1. Re: New JBoss Logging Configuration Problem
          wolfgangknauf

          Hi,

           

          it seems that the element "sub-handlers" has no child "handler-ref". I found the xml definition here (search the method "setSubHandlerMetaDataList" for XML annotations): http://grepcode.com/file/repository.jboss.com/maven2/org.jboss.logging/logging-service-metadata/1.0.0.CR8/org/jboss/logging/metadata/AbstractHandlerMetaData.java#AbstractHandlerMetaData

           

          Best regards

           

          Wolfgang

          • 2. Re: New JBoss Logging Configuration Problem
            dmlloyd

            Yup, I remember having a lot of trouble mapping this element type in JBossXB.  I'll have a look ASAP.  In the meantime you should be able to "inline" the subhandler definition into the async handler for now.

            • 3. Re: New JBoss Logging Configuration Problem
              andy.miller

              David Lloyd wrote:

               

              Yup, I remember having a lot of trouble mapping this element type in JBossXB.  I'll have a look ASAP.  In the meantime you should be able to "inline" the subhandler definition into the async handler for now.

              I assume that means take the subhandler tags out, and just add the FILE stuff directly in there?  I'll give that a try.

              • 4. Re: New JBoss Logging Configuration Problem
                andy.miller

                David Lloyd wrote:

                 

                Yup, I remember having a lot of trouble mapping this element type in JBossXB.  I'll have a look ASAP.  In the meantime you should be able to "inline" the subhandler definition into the async handler for now.

                I in-lined the subhandler definition in the async handler, and the parse error went away.  However, no matter what I have tried, I cannot get anything to be written to the server.log file through the async handler.  I managed to get the file created, but nothing ever gets written to it.

                • 5. Re: New JBoss Logging Configuration Problem
                  dmlloyd

                  Andrig Miller wrote:

                   

                  David Lloyd wrote:

                   

                  Yup, I remember having a lot of trouble mapping this element type in JBossXB.  I'll have a look ASAP.  In the meantime you should be able to "inline" the subhandler definition into the async handler for now.

                  I in-lined the subhandler definition in the async handler, and the parse error went away.  However, no matter what I have tried, I cannot get anything to be written to the server.log file through the async handler.  I managed to get the file created, but nothing ever gets written to it.

                  Strange... any exceptions on the console?

                  • 6. Re: New JBoss Logging Configuration Problem
                    delete

                    Was anyone able to write logs asynchronously?

                    • 7. Re: New JBoss Logging Configuration Problem
                      andy.miller

                      David Lloyd wrote:

                       

                      Andrig Miller wrote:

                       

                      David Lloyd wrote:

                       

                      Yup, I remember having a lot of trouble mapping this element type in JBossXB.  I'll have a look ASAP.  In the meantime you should be able to "inline" the subhandler definition into the async handler for now.

                      I in-lined the subhandler definition in the async handler, and the parse error went away.  However, no matter what I have tried, I cannot get anything to be written to the server.log file through the async handler.  I managed to get the file created, but nothing ever gets written to it.

                      Strange... any exceptions on the console?

                      I didn't see any exceptions.  Just nothing coming out in the log.  It's been ages since I looked at this, and was going to look at it again with AS 7 to see if its still a problem.

                      • 8. Re: New JBoss Logging Configuration Problem
                        mreasy

                        Same problem here with 6.0 CR1

                        • 9. Re: New JBoss Logging Configuration Problem
                          ctomc

                          The problem still exists in latest trunk build (pre 6.0.0.final)

                          this problem is espacialy annoying as in jboss-logging.xml there is "sample" config to use for ASYNC appender but that sample config does not work and dies with exception mentioned up here.

                           

                          So there is no way to configure async appender and that is a no-go for production servers... This realy needs to be fixed before final release.

                          • 10. Re: New JBoss Logging Configuration Problem
                            jaikiran

                            Tomaz Cerar wrote:

                             

                            So there is no way to configure async appender and that is a no-go for production servers... This realy needs to be fixed before final release.

                            Out of curiosity, why not just use your own log4j.xml, packaged in the application, and configure the log4j's Async appender?

                            • 11. Re: New JBoss Logging Configuration Problem
                              ctomc

                              jaikiran pai wrote:

                               

                              Tomaz Cerar wrote:

                               

                              So there is no way to configure async appender and that is a no-go for production servers... This realy needs to be fixed before final release.

                              Out of curiosity, why not just use your own log4j.xml, packaged in the application, and configure the log4j's Async appender?

                               

                              I like to have configuration in one place, also less jar/configuration duplication etc.

                              and possibly also becouse we got used to the fact that the easiest way to get logging working before as 6 was to do it this way. Also logs can be in central place and frankly I hate the idea that each application uses its own logging framework, logging configuration and that I cannot change the way logging behaves without modification application ear/war.

                               

                              In short, if there is good infrastructure in place, why not use it the best way possible

                              • 12. Re: New JBoss Logging Configuration Problem
                                jaikiran

                                Tomaz Cerar wrote:

                                 

                                jaikiran pai wrote:


                                Out of curiosity, why not just use your own log4j.xml, packaged in the application, and configure the log4j's Async appender?

                                 

                                I like to have configuration in one place, also less jar/configuration duplication etc.

                                and possibly also becouse we got used to the fact that the easiest way to get logging working before as 6 was to do it this way. Also logs can be in central place and frankly I hate the idea that each application uses its own logging framework, logging configuration and that I cannot change the way logging behaves without modification application ear/war.

                                Okay, so you are intentionally using the jboss logging mechanism. Fair enough.

                                 

                                As for whether this issue is going to be addressed for 6.0 Final, I'm not really sure.

                                • 13. Re: New JBoss Logging Configuration Problem
                                  newguy2010

                                  I use log4j.xml for my project and have no problem. But I do want to use the traditional way which allows me to edit the log4j file outside my application as I don't want to compile my project everytime I append a logger in log4j.xml.

                                  • 14. Re: New JBoss Logging Configuration Problem
                                    dmlloyd
                                    1 2 Previous Next