jbosstools / m2e-polyglot-poc

M2E Polyglot Support Experiment
Eclipse Public License 1.0
15 stars 8 forks source link

Error in generated groovy #3

Open dsyer opened 8 years ago

dsyer commented 8 years ago

I get a red marker on pom.groovy (my first project). Here's the error:

org.eclipse.jface.text.BadLocationException
    at org.eclipse.jface.text.ListLineTracker.getLineOffset(ListLineTracker.java:201)
    at org.eclipse.jface.text.AbstractLineTracker.getLineOffset(AbstractLineTracker.java:169)
    at org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument.getLineOffset(BasicStructuredDocument.java:1495)
    at org.eclipse.m2e.editor.xml.internal.MarkerLocationService.findLocationForMarker(MarkerLocationService.java:106)
    at org.eclipse.m2e.core.internal.markers.MarkerUtils.decorateMarker(MarkerUtils.java:48)
    at org.eclipse.m2e.core.internal.markers.MavenMarkerManager.addErrorMarker(MavenMarkerManager.java:308)
    at org.eclipse.m2e.core.internal.builder.MavenBuilderImpl.processBuildResults(MavenBuilderImpl.java:318)
    at org.eclipse.m2e.core.internal.builder.MavenBuilderImpl.build(MavenBuilderImpl.java:179)
    at org.eclipse.m2e.core.internal.builder.MavenBuilder$1.method(MavenBuilder.java:172)
    at org.eclipse.m2e.core.internal.builder.MavenBuilder$1.method(MavenBuilder.java:1)
    at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod$1$1.call(MavenBuilder.java:115)
    at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:176)
    at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:112)
    at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod$1.call(MavenBuilder.java:105)
    at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:176)
    at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:151)
    at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:99)
    at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod.execute(MavenBuilder.java:86)
    at org.eclipse.m2e.core.internal.builder.MavenBuilder.build(MavenBuilder.java:200)
    at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:734)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:205)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:245)
    at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:300)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:303)
    at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:359)
    at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:382)
    at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:144)
    at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:235)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
dsyer commented 8 years ago

The red marker went away when I removed the relativeLocation from the parent (the errors are still there though - dozens of them just like the above).

fbricon commented 8 years ago

Well, this is unexpected. Error markers on polyglot poms can only come from the polyglot translation (like badly formed pom).

The exception you see is caused by the POM XML editor somehow, which is not used to open other stuff than pom.xml. Nothing in the stacktrace points at the polyglot plugin.

Is there a way you could provide a sample project reproducing the error?

dsyer commented 8 years ago

This project has errors for me: https://github.com/scratches/polyglot-demo

fbricon commented 8 years ago

Sorry but it works for me, even tried on a stock STS 3.7.1 installation : http://screencast.com/t/qCPYntnnXd

dsyer commented 8 years ago

Wow, thanks for trying that. Leads me to believe it's probably the Groovy support for m2e that's the problem (it's a one click install from STS and I need it for a load of projects that use Spock for testing, so it's always installed on top for me).

dsyer commented 8 years ago

You didn't show the Errors view though in the screencast (that's where I see the issues), so I guess it could still be an issue.

fbricon commented 8 years ago

I installed all the groovy tooling from the dashboard (*). I'm seeing some errors in the log, but they're caused by spring IDE, not related to m2e stuff

http://screencast.com/t/ZqbBiJW9sX

I also tried to convert a new spring boot project to polyglot Maven and noticed the empty parent relativePath issue. This is a problem upstream, I'll open a bug.

(*) @martinlippert are you aware the dashboard fails to open when STS 2.7.1 is started w/ JDK 9?

martinlippert commented 8 years ago

@fbricon Haven't tried to run STS on top of JDK9 yet. Wonder it works at all, thought Eclipse might need fixes in Neon to run on JDK9

martinlippert commented 8 years ago

@fbricon what exactly doesn't work?

fbricon commented 8 years ago

The dashboard doesn't open (only shows a tiny tab with just the closing cross). I cleaned the logs since then but I vaguely remember seeing some JavaFX classes couldn't be accessed. I'll open a bug later in STS JIRA later

See http://screencast.com/t/ZqbBiJW9sX at 29 sec.

martinlippert commented 8 years ago

Yepp, an issue in our JIRA would be great. I vaguely guess that the JavaFX bridge from Tom that we use (from e(fx)clipse) might not be JDK9 compatible. But we will see.