Announcement Announcement Module
No announcement yet.
STS 3.5 - MVC template problem - log4j.dtd not found Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    version 2.7.0-Release - issue still occuring

    Hi guys,

    I have the issue described in the previous post but the fix is not working for me...

    Windows 7 pro
    STS 2.7.0-Release

    Trying to start a new Spring MCV Project template

    Is a space in the location string problematic ?


    • #17
      Bug in STS 2.7.0 release is not fixed.
      When fix it manually Key must be "-//APACHE//DTD LOG4J 1.2//EN", not "-//LOGGER".
      See example this:


      • #18

        That's what I figured after loading the previous version of sts (key being changed).

        Thanks for the reply.


        • #19
          This removed the warning yes, but it got replaced by a red cross.
          Not a good trade.

          The error is this:
          The errors below were detected when validating the file "org.apache.log4j_1.2.15.v201012070815.jar" via the file "log4j.xml". In most cases these errors can be detected by validating "org.apache.log4j_1.2.15.v201012070815.jar" directly. However it is possible that errors will only occur when org.apache.log4j_1.2.15.v201012070815.jar is validated in the context of log4j.xml.


          • #20
            Hi Gr3y

            Didn't get the red cross here.

            Can you post exactly the string you entered in the XML catalog ?


            • #21
              Originally posted by mtlcpu View Post
              Hi Gr3y

              Didn't get the red cross here.

              Can you post exactly the string you entered in the XML catalog ?
              The string i entered was:
              -//APACHE//DTD LOG4J 1.2//EN

              And key type was: Public ID

              File was: org.apache.log4j_1.2.15.v201012070815.jar

              I can live with the warning, doesn't bother me.


              • #22
                Hi Gr3y

                Once you've selected the file, you need to manually add "jar:file:" as a prefix and "!/org/apache/log4j/xml/log4j.dtd" at the end (without the "") as noted before in the thread.

                You also need to put the full path of the file, not only the jar name (although I'm sure you did that if you used the file explorer to chose it).

                Hope this helps.


                • #23
                  Hello mtlcpu

                  Thanks for assist, however I still get the warning.
                  However, I did miss the part about jar:file: in the beginning before.

                  My XML Catalog entry now looks like this (this is on a mac btw )
                  Location: jar:file:/Users/gr3y/springsource/sts-2.7.1.RELEASE/plugins/org.apache.log4j_1.2.15.v201012070815.jar!/org/apache/log4j/xml/log4j.dtd
                  Key type: Public ID
                  Key: -//APACHE//DTD LOG4J 1.2//EN

                  With this, I still get the warning: The file cannot be validated as the XML definition "/Users/gr3y/workspace/Hello/MVC/src/test/resources/log4j.dtd (No such file or directory)" that is specified as describing the syntax of the file cannot be located.

                  Note, selected the log4j file through Finder.

                  Did I miss anything this time?


                  • #24

                    I have to say I'm not familiar with the path on Mac so I guess that's they way it should be and the rest looks fine.

                    The last thing you might want to make sure to do is to save the file. For me, I had to add a space somewhere and then remove it. This would put the file in a "modified" state and then upon saving, the warning went away. I know that if you just save the file, it doesn't do anything and the warning will remain. You need to modify it in some way (even if it means to change it back right after) to trigger a modified state and then a re-eval of the file.

                    If that doesn't work, I might have to do with the way to write the path on the Mac system and I'll let someone else more knowledgeable comment on this issue.


                    • #25
                      mtlcpu, thanks. That was what I needed to do. After saving the file again, the warning vanishes.


                      • #26
                        Glad to see it worked. Cheers !


                        • #27
                          For what it's worth - this is still happening in a default install of STS 2.8.0.MS Build 201109211000

                          I was able to resolve the issue by:

                          1) Updating the XML Catalog as described above (from Preferences->XML->XML Catalog), which replaced the red X with a yellow !
                          On my Mac:
                          Location: jar:file:/Users/<myusername>/springsource/sts-2.8.0.M2/plugins/org.apache.log4j_1.2.15.v201012070815!/org/apache/log4j/xml/log4j.dtd
                          Key type: Public ID
                          Key: -//APACHE//DTD LOG4J 1.2//EN

                          2) To remove the yellow !, cut all content from log4j.xml in the MVC application, save, and then paste it back and save.

                          Hope this gets fixed before the release rollout!



                          • #28
                            Thank you very much for the input. We are tracking this issue here and plan to address this for the STS 2.8 release:

                            STS-916: Add log4j.dtd to public XML catalog