2 Replies Latest reply on Mar 12, 2004 10:53 AM by vguhesan

    Log4j, Xerces, and paths with spaces

    andie

      I have jboss (v3.0.3) installed in C:\Program Files\jboss and I am trying to use Xerces as the XML parser (run -j xerces). When I start JBoss I get the following:

      16:04:35,656 INFO [Log4jService$URLWatchTimerTask] Configuring from URL: resource:log4j.xml
      log4j:ERROR Could not parse input source [org.xml.sax.InputSource@95cfbe].
      java.net.MalformedURLException: no protocol: log4j.dtd
      at java.net.URL.(Unknown Source)
      at java.net.URL.(Unknown Source)
      at java.net.URL.(Unknown Source)
      at org.apache.xerces.impl.XMLEntityManager.startEntity(XMLEntityManager.java:807)
      at org.apache.xerces.impl.XMLEntityManager.startDTDEntity(XMLEntityManager.java:767)
      at org.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(XMLDTDScannerImpl.java:275)
      at org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(XMLDocumentScannerImpl.java:841)
      at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:329)
      at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:525)
      at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:581)
      at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:152)
      at org.apache.xerces.parsers.DOMParser.parse(DOMParser.java:253)
      at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:201)
      at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:672)
      at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:616)
      at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:602)
      at org.apache.log4j.xml.DOMConfigurator.configure(DOMConfigurator.java:704)
      at org.jboss.logging.Log4jService$URLWatchTimerTask.reconfigure(Log4jService.java:486)
      at org.jboss.logging.Log4jService$URLWatchTimerTask.run(Log4jService.java:425)
      at org.jboss.logging.Log4jService.startService(Log4jService.java:281)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:164)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:976)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:397)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
      at $Proxy3.start(Unknown Source)
      at org.jboss.deployment.SARDeployer.start(SARDeployer.java:249)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:802)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:616)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:580)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:564)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
      at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:324)
      at org.jboss.system.server.ServerImpl.start(ServerImpl.java:221)
      at com.xms.install.jboss.JBossJService.bootJBoss(JBossJService.java:139)
      at com.xms.install.jboss.JBossJService.start(JBossJService.java:64)
      16:04:35,843 INFO [Log4jService] Started

      Jboss starts and 'works' fine but I don't get a server.log file (everything is written to boot.log). Log4j isn't configured.
      If I use cimson everything works fine.
      If I install into C:\jboss everything works fine.

      It seems that there is some issue with Xerces and reading the log4j config file from a path with a space. Any help would be much appreciated!

        • 1. Re: Log4j, Xerces, and paths with spaces
          okidoky

          I'm getting similar things.

          14:01:42,799 INFO [Log4jService] Starting
          14:01:42,814 INFO [Log4jService$URLWatchTimerTask] Configuring from URL: resource:log4j.xml
          log4j:WARN Parsing error on line 11 and column -1
          log4j:WARN Valid documents must have a <!DOCTYPE declaration.
          log4j:ERROR Parsing error on line 11 and column -1
          log4j:ERROR Element type "log4j:configuration" is not declared.
          log4j:ERROR Parsing error on line 11 and column -1
          log4j:ERROR Attribute "xmlns:log4j" is not declared for element "log4j:configuration".
          log4j:ERROR Parsing error on line 11 and column -1
          log4j:ERROR Attribute "debug" is not declared for element "log4j:configuration".

          • 2. Re: Log4j, Xerces, and paths with spaces
            vguhesan

            I had the same problem when I installed JBoss 3.2.3 bundled with Tomcat. The problem was that I had my default JAVA_HOME set to version j2sdk1.4.1_02. I edited \JBoss\bin\run.bat and added a extra line to force the JAVA_HOME to point to a later version of JDK (namely, j2sdk1.4.2_03) and that fixed the problem. I left the XercesImpl.jar and xml-apis.jar as is that came bundled with JBoss 3.2.3.

            FILE: run.bat
            ---------------------------------------
            :FOUND_RUN_JAR

            REM --- BEGIN: ADDED THIS LINE ---
            set java_home=E:\Java\j2sdk1.4.2_03\jre
            REM --- END: ADDED THIS LINE ---

            if not "%JAVA_HOME%" == "" goto ADD_TOOLS

            set JAVA=java
            ---------------------------------------

            I hope this helps.

            Venkatt