Announcement Announcement Module
Collapse
No announcement yet.
Error after running: log4j:WARN Please initialize the log4j system properly. Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Error after running: log4j:WARN Please initialize the log4j system properly.

    Suppose I have this .xml file:

    <?xml version="1.0" encoding="UTF-8"?>

    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="
    http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
    <bean id="car" class="Car">
    <property name="wheel" ref="wheel" />
    </bean>

    <bean id="wheel" class="BridgeStone" />
    </beans>"

    ------------------
    My question would be, why does this error occur after running:

    log4j:WARN No appenders could be found for logger
    (org.springframework.beans.factory.xml.XmlBeanDefi nitionReader).
    log4j:WARN Please initialize the log4j system properly.
    Exception in thread "main"
    org.springframework.beans.factory.BeanDefinitionSt oreException: Line 6
    in XML document from class path resource [Travel.xml] is invalid;
    nested exception is org.xml.sax.SAXParseException: Document root
    element "beans", must match DOCTYPE root "null".
    org.xml.sax.SAXParseException: Document root element "beans", must
    match DOCTYPE root "null".
    . . . . .


    it somehow points to line 6 of the above xml file. Can someone please
    help me with this? Thank you so much.

  • #2
    Please use [ code][/code ] tags when posting code that way it remains readable.

    The 2 messages have nothing to do with each other....

    1) LOG4J include a log4j.properties or log4j.xml in the root of your classpath (google for log4j configuration)
    2) Check your xml parser, judging from the exception some old version is used.

    Comment

    Working...
    X