facebook

XML Validation becomes SLOW

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #203206 Reply

    Hi,
    after the first days using MyEclipse after an occasional fresh install everything went tighth and smooth. But now the validation of my struts-config.xml and hibernate mapping xml-documents takes a very long time with no noteable CPU or DISK activity.

    What might be the reason?

    Environment:

      Windows 2000
      JDK 1.4.2_03
      Eclipse 2.1.2
      MyEclipse 2.6.4

    undefined

    #203224 Reply

    Scott Anderson
    Participant

    Interesting. Is there anything in the log file? Have you recently changed anything in your environment, like your JDK?

    #203225 Reply

    Riyad Kalla
    Member

    ralf can you describe slow? Do you mean you hit CTRL-SPACE and it takes “too long” for the completion window to popup, or you mean typing into the editor is slow?

    #203239 Reply

    @support-rkalla wrote:

    ralf can you describe slow? Do you mean you hit CTRL-SPACE and it takes “too long” for the completion window to popup, or you mean typing into the editor is slow?

    The Editor works perfectly well. I’ve never checked the code-completion on the hibernate mapping file.

    Slow means: finally saving the document takes approx. 20 seconds.

    #203240 Reply

    @scott wrote:

    Interesting. Is there anything in the log file? Have you recently changed anything in your environment, like your JDK?

    Which log-file do you mean?

    Last week i’ve removed and reinstalled the JDK (due to problems with the Java-Plugin). But despite this fresh install of the JDK, the release (1.4.2_03) and even the directory structure (c:\Programme\jdk1.4.2_03) are the same like before.

    I observed this problem before the reinstall. It’s the same thing on my colleagues system.

    #203241 Reply

    Riyad Kalla
    Member

    ralf,
    to help pinpoint the problem, can you turn off XML validation and see if saving is sped up?
    Window>Prefs>MyEclipse>Editors>XML Editor>Configuration>XML Validation> NONE

    #203247 Reply

    @support-rkalla wrote:

    ralf,
    to help pinpoint the problem, can you turn off XML validation and see if saving is sped up?
    Window>Prefs>MyEclipse>Editors>XML Editor>Configuration>XML Validation> NONE

    Eclipse started from scratch without validation:

    First “Save”-> ~ 1 second
    Second “Save” -> instantly

    Eclipse started from scratch with XML validation

    First “Save” -> ~ 23 seconds
    Second “Save” -> ~ 21 seconds

    #203253 Reply

    Riyad Kalla
    Member

    Ralf thank you for the detail, can you do two more things for me (to help the devs look into this):

    1) Right after saving the file, right click and select “Validate”, how long does that take?
    2) Please copy-paste the last two entries in your log file startings with “!SESSION——————“, the file is here: <eclipse install dir>\workspace\.metadata\.log

    Also I’m wondering if this is a problem of the XML editor downloading the DTD every time you validate… are you working on a machine that you don’t have administrative rights to? i.e. if the XML editor tries to download the DTD and cache it, but can’t, so every time you save it has to pull the DTD again.

    You can try and see if this could be a problem copy copy-pasting the URL to the DTD into your browser, download the DTD to your local directory (in the same dir as the XML file) and then change the DTD location in the XML file to just be the name of the dtd (since its in the same folder). So lets say you are editing your web.xml file, your original would look like this:

    
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
        <servlet>
            <servlet-name>action</servlet-name>
            <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
            <init-param>
                <param-name>config</param-name>
                <param-value>/WEB-INF/struts-config.xml</param-value>
            </init-param>
            <init-param>
                <param-name>debug</param-name>
                <param-value>3</param-value>
            </init-param>
            <init-param>
                <param-name>detail</param-name>
                <param-value>3</param-value>
            </init-param>
            <load-on-startup>1</load-on-startup>
        </servlet>
        <servlet-mapping>
            <servlet-name>action</servlet-name>
            <url-pattern>*.do</url-pattern>
        </servlet-mapping>
    </web-app>
    

    and then you can download the DTD and put it in the same dir as the XML file, and change your web.xml file to say this:

    
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "web-app_2_3.dtd">
    <web-app>
        <servlet>
            <servlet-name>action</servlet-name>
            <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
            <init-param>
                <param-name>config</param-name>
                <param-value>/WEB-INF/struts-config.xml</param-value>
            </init-param>
            <init-param>
                <param-name>debug</param-name>
                <param-value>3</param-value>
            </init-param>
            <init-param>
                <param-name>detail</param-name>
                <param-value>3</param-value>
            </init-param>
            <load-on-startup>1</load-on-startup>
        </servlet>
        <servlet-mapping>
            <servlet-name>action</servlet-name>
            <url-pattern>*.do</url-pattern>
        </servlet-mapping>
    </web-app>
    

    note that the URL to the dtd has changed to just the file name. Now save exit and reopen this file and see if editing is faster… if it is, then there is some issue with the XML editor pulling down the DTD. You mentioned you are having this problem with the hibernate files, so make sure to do the things I mentioned above, but with your hibernate file (to avoid introducing too many variables).

    #203289 Reply

    Scott Anderson
    Participant

    From this thread, it would appear that the time is being taken up on save performing the validation of the hibernate mappings file. Actually, while 20 seconds does seem “long”, depending on the size of the file it just might take Xerces that long to parse it on that particular hardware configuration. It could be that Eclipse is short on memory or something also.

    One workaround if this is problematic is to turn off validation and then manually validate, as Riyad instructed above, only when you really want too. This will have the added benefit of speeding up your project rebuild times also.

    #203345 Reply

    @scott wrote:

    From this thread, it would appear that the time is being taken up on save performing the validation of the hibernate mappings file. Actually, while 20 seconds does seem “long”, depending on the size of the file it just might take Xerces that long to parse it on that particular hardware configuration. It could be that Eclipse is short on memory or something also.

    I think i found the root cause of my problem: my HTTP proxy requires authentication.

    While everything works perfectly when i’m at home, i have some problems each time i’m connected to the customer’s network. His internet proxy requires a valid authentication and Eclipse does not ask for the credential.

    This finally raises some additional questions:

      1) Why does Eclipse does not ask me for the credentials?
      2) Why doest the XML Editor does not cache the DTDs for some time?
    #203353 Reply

    Scott Anderson
    Participant

    1) Why does Eclipse does not ask me for the credentials?

    Good question. I honestly don’t know if this is functinality that Eclipse should be handling or we should. I know that in 3.0, much more thought has been given to proxy connections. That one will require research.

    2) Why doest the XML Editor does not cache the DTDs for some time?

    Actually, it does, but only beginning with the 2.7 builds. Since you’re using 2.6.4 the editor tries to go to the physical URL each time. 2.7 RC2 has support for cached DTD’s and should work quite well in this situation since it ships with most of the popular DTD’s and then caches the rest that you need when you first request them.

    #203382 Reply

    Riyad Kalla
    Member

    Ralf,
    Michael just replied with this to say on the subject:

    This article defines how to specify non-authenticating proxies settings from
    the commandline:
    http://www.javaworld.com/javaworld/javatips/jw-javatip42.html.

    java -DproxySet=true -DproxyHost=myProxyMachineName -DproxyPort=85
    <myProgram>

    I checked out the Xerces FAQ, since that is what we and Eclipse uses
    internally, and did not see a resolution for authenticating proxies.

    so it seems that it really isn’t in ME’s or even Eclipse’s power right now to implement support for authing proxies (Because all the tools defer to Xerces to handle this)

Viewing 12 posts - 1 through 12 (of 12 total)
Reply To: XML Validation becomes SLOW

You must be logged in to post in the forum log in