Error saving web.xml file

140 views
Skip to first unread message

John Reiter

unread,
Apr 18, 2012, 9:55:41 AM4/18/12
to eclim-user
I recently upgraded eclim to 1.7.3, and since then I've been having
issues saving a web.xml file. I'm using headless eclim, and every
time I save web.xml, vim hangs for a few seconds. When it stops
hanging, the buffer no longer has syntax highlighting and there is an
error displayed in vim:

error: src-resolve: Cannot resolve the name 'javaee:service-refGroup'
to a(n) 'group' component.
E315: ml_get: invalid lnum: 805

There is also an error in standard out on the terminal where I
launched eclimd(the same error appears in .log.eclimd):

2012-04-18 09:36:28,578 ERROR
[org.eclim.plugin.core.command.AbstractCommand] Exception during
cleanup of command: [-editor, vim, -command, project_refresh_file, -
p, , -f, ]
java.lang.IllegalArgumentException: Path for project must have only
one segment.
at org.eclipse.core.runtime.Assert.isLegal(Assert.java:63)
at
org.eclipse.core.internal.resources.WorkspaceRoot.getProject(WorkspaceRoot.java:
184)
at
org.eclim.plugin.core.util.ProjectUtils.getProject(ProjectUtils.java:
110)
at
org.eclim.plugin.core.util.ProjectUtils.getProject(ProjectUtils.java:
96)
at
org.eclim.plugin.core.command.AbstractCommand.cleanup(AbstractCommand.java:
122)
at org.eclim.command.Main$1.run(Main.java:104)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at
org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:
135)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:
3563)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3212)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:
2696)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:
332)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:
667)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:
149)
at
org.eclim.eclipse.AbstractEclimApplication.start(AbstractEclimApplication.java:
169)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:
196)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:
110)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:
79)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:
344)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:
179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
at org.eclipse.equinox.launcher.Main.main(Main.java:1386)


FWIW, I'm running Indigo on Fedora Core 16.

John

Eric Van Dewoestine

unread,
Apr 18, 2012, 10:55:52 AM4/18/12
to eclim...@googlegroups.com
On 2012-04-18 06:55:41, John Reiter wrote:
> I recently upgraded eclim to 1.7.3, and since then I've been having
> issues saving a web.xml file. I'm using headless eclim, and every
> time I save web.xml, vim hangs for a few seconds. When it stops
> hanging, the buffer no longer has syntax highlighting and there is an
> error displayed in vim:
>
> error: src-resolve: Cannot resolve the name 'javaee:service-refGroup'
> to a(n) 'group' component.
> E315: ml_get: invalid lnum: 805

What version of vim are you running? Please post the first few lines
of running :version in vim. This particular error (E315) signals an
internal vim error that usually mean a bug in vim.

Can you open the web.xml in vim, then run:

:let g:EclimLogLevel = 10

Then save the file and run:

:messages

At the end of that output should be a line showing the webxml_validate
command that was run. Can you copy that command and run it in a shell
and post the output here.

> There is also an error in standard out on the terminal where I
> launched eclimd(the same error appears in .log.eclimd):
>
> 2012-04-18 09:36:28,578 ERROR
> [org.eclim.plugin.core.command.AbstractCommand] Exception during
> cleanup of command: [-editor, vim, -command, project_refresh_file, -
> p, , -f, ]

Did -p and -f really have no arguments or did you just remove them
before posting?

This should be an unrelated error (it's simply logged, not raised up
to vim), but if no project or file were supplied to the command that
is very odd.

A quick fix to avoid this issue would be to add the following to your
vimrc:

:let g:EclimWebXmlValidate = 0

but it would be nice to figure out what's going wrong.

Would you mind posting your web.xml, or the smallest version of it
that still triggers this issue?

--
eric

John Reiter

unread,
Apr 18, 2012, 3:08:24 PM4/18/12
to eclim...@googlegroups.com
On Wed, Apr 18, 2012 at 10:55 AM, Eric Van Dewoestine
<erva...@gmail.com> wrote:
> On 2012-04-18 06:55:41, John Reiter wrote:
>> I recently upgraded eclim to 1.7.3, and since then I've been having
>> issues saving a web.xml file.  I'm using headless eclim, and every
>> time I save web.xml, vim hangs for a few seconds.  When it stops
>> hanging, the buffer no longer has syntax highlighting and there is an
>> error displayed in vim:
>>
>> error: src-resolve: Cannot resolve the name 'javaee:service-refGroup'
>> to a(n) 'group' component.
>> E315: ml_get: invalid lnum: 805
>
> What version of vim are you running? Please post the first few lines
> of running :version in vim.  This particular error (E315) signals an
> internal vim error that usually mean a bug in vim.

I'm using vim(actually gvim) from the Fedora Core yum repo:

VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Sep 21 2011 09:33:50)
Included patches: 1-315
Modified by <bugz...@redhat.com>
Compiled by <bugz...@redhat.com>

> Can you open the web.xml in vim, then run:
>
>  :let g:EclimLogLevel = 10
>
> Then save the file and run:
>
>  :messages
>
> At the end of that output should be a line showing the webxml_validate
> command that was run. Can you copy that command and run it in a shell
> and post the output here.

Other than some NERDTree output, here is the entirety of my :messages
output after launching a fresh vim, running ":let g:EclimLogLevel =
10" and saving the web.xml file(actual project name replaced with
<project_name>):

"<project_name>/centralized/<project_name>-web.xml" 516L, 21992C
(0s) system: "/home/john/eclipse/eclim" --nailgun-port 9091 -editor
vim -command projects
"<project_name>/centralized/<project_name>-web.xml" 516L, 21992C written
(11s) system: "/home/john/eclipse/eclim" --nailgun-port 9091 -editor
vim -command xml_validate -p "<project_name>" -f
"centralized/<project_name>-web.xml" -s
"/tmp/xml/ns/javaee/javaee_5.xsd" 2102L, 63695C
(1 of 14) error: src-resolve: Cannot resolve the name


'javaee:service-refGroup' to a(n) 'group' component.
E315: ml_get: invalid lnum: 805

>> There is also an error in standard out on the terminal where I


>> launched eclimd(the same error appears in .log.eclimd):
>>
>> 2012-04-18 09:36:28,578 ERROR
>> [org.eclim.plugin.core.command.AbstractCommand] Exception during
>> cleanup of command: [-editor, vim, -command, project_refresh_file, -
>> p, , -f, ]
>
> Did -p and -f really have no arguments or did you just remove them
> before posting?
>
> This should be an unrelated error (it's simply logged, not raised up
> to vim), but if no project or file were supplied to the command that
> is very odd.

They really had no arguments. It doesn't seem to happen every time
(and didn't happen after saving and posting the :messages output
above), but it is still happening sometimes after saving the web.xml.

It doesn't seem to be specific to the content of this particular
web.xml. Even stripping it down to just this still causes it:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">

<display-name>Project</display-name>

</web-app>

However, similar web.xml files in other projects in the same workspace
save/validate perfectly fine. I also tried creating a new web.xml
with the minimal content above in the same directory as the
problematic one, and it causes the same issue. It seems odd, but
could it somehow be specific to this directory?

I'm also getting vim to crash pretty often doing this testing.

John

Eric Van Dewoestine

unread,
Apr 18, 2012, 4:38:24 PM4/18/12
to eclim...@googlegroups.com

Ah, so eclim isn't setting it to be of file type webxml because the
file isn't named "web.xml", so it's performing regular xml validation.

The regular xml validation is going off and fetching the xsd every
time and is actually validating the xsd, which I didn't realize it
would do, and coming up with some validation errors due to the fact
that the eclipse wst doesn't appear to properly resolve relative xsds
referenced in the web-app_2_5.xsd file.

I'm not encountering the ml_get error but I have vim up to patch level
495, so the issue may have been fixed since 315 or redhat has its own
patches that are trigging that.

I'm going to update the eclim webxml file type detection to recognize
*web.xml instead of just web.xml.

You've got a few options on how to avoid this issue:

1. after opening the file you can just run :set ft=webxml
2. you can update the file eclim/plugin/ftdetect_jdt.vim in your vim
files dir and change the line:
autocmd BufRead web.xml
to
autocmd BufRead *web.xml
3. disable xml validation:
let g:EclimXmlValidate = 0

Then you can remove the 'let g:EclimWebXmlValidate = 0' from your
vimrc that I suggested earlier so that you get the benefit of eclim's
web.xml validation (which doesn't do the nasty xsd fetching) now or
later depending on which of the above options you chose.

> >> There is also an error in standard out on the terminal where I
> >> launched eclimd(the same error appears in .log.eclimd):
> >>
> >> 2012-04-18 09:36:28,578 ERROR
> >> [org.eclim.plugin.core.command.AbstractCommand] Exception during
> >> cleanup of command: [-editor, vim, -command, project_refresh_file, -
> >> p, , -f, ]
> >
> > Did -p and -f really have no arguments or did you just remove them
> > before posting?
> >
> > This should be an unrelated error (it's simply logged, not raised up
> > to vim), but if no project or file were supplied to the command that
> > is very odd.
>
> They really had no arguments. It doesn't seem to happen every time
> (and didn't happen after saving and posting the :messages output
> above), but it is still happening sometimes after saving the web.xml.

That is weird. If you figure out the steps to reproduce this, please
let me know.

It could be that the other web.xml files are actually named "web.xml"
so eclim is setting the filetype properly and avoiding the xml
validation which is trigging the bug in vim.

> I'm also getting vim to crash pretty often doing this testing.

Applying one of the options above should prevent the crashing.

> John

--
eric

John Reiter

unread,
Apr 19, 2012, 1:56:58 PM4/19/12
to eclim...@googlegroups.com
Seems to be working fine after changing ftdetect_jdt.vim. It's odd
because I actually considered the name of the file might be the
problem, so I tried creating a new one just called web.xml in the same
directory and it still had the same issue. I must have just typoed it
or something.

Anyway, thanks Eric! Eclim is awesome and I appreciate your support.

John

> --
> You received this message because you are subscribed to the Google Groups "eclim-user" group.
> To post to this group, send email to eclim...@googlegroups.com.
> To unsubscribe from this group, send email to eclim-user+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/eclim-user?hl=en.
>

Reply all
Reply to author
Forward
0 new messages