Spring plugin in Eclipse cannot open pom.xml
Asked Answered
B

2

22

I've installed the most popular plugin in Eclipse (Spring Tools 4.14.1) and i tried to create a new project and open the pom.xml and then it shows error and comes like

Failed to create the part's controls

The error shows like this. Why does this happen? How to fix it?

java.lang.NoClassDefFoundError: org/eclipse/tm4e/ui/utils/ContentTypeHelper
    at org.eclipse.tm4e.languageconfiguration.LanguageConfigurationCharacterPairMatcher.findContentTypes(LanguageConfigurationCharacterPairMatcher.java:134)
    at org.eclipse.tm4e.languageconfiguration.LanguageConfigurationCharacterPairMatcher.getMatcher(LanguageConfigurationCharacterPairMatcher.java:113)
    at org.eclipse.tm4e.languageconfiguration.LanguageConfigurationCharacterPairMatcher.match(LanguageConfigurationCharacterPairMatcher.java:47)
    at org.eclipse.jface.text.source.MatchingCharacterPainter.paint(MatchingCharacterPainter.java:313)
    at org.eclipse.jface.text.PaintManager.addPainter(PaintManager.java:207)
    ...
Bute answered 28/4, 2022 at 11:40 Comment(6)
Does installing Eclipse tm4e via Help > Install New Software... working with the update site http://download.eclipse.org/tm4e/snapshots/ fix your issue?Hexamerous
Yes, it does! So the pom.xml editing relys on a part that a regular install of Eclipse may not really cover. Many thanks! :)Bute
Maybe Spring Tools 4.14.1 misses explicit requiring of tm4e, which is included in the Eclipse IDE for Enterprise Java and Web Developers but not in the Eclipse IDE for Java Developers (which I guess you have, right?). So please makes sure it has been reported here: github.com/spring-projects/sts4/issuesHexamerous
Or maybe it's an issue of m2e. Into which Eclipse IDE package and Eclipse version with which m2e version did you install Spring Tools 4.14.1?Hexamerous
Yes i did. My install is actually in Enterprise Java version, and it didn't include tm4e.Bute
Then it must have been an older Eclipse version and when Spring Tools 4.14.1 was installed, Maven support m2e was also updated. m2e uses tm4e for XML syntax highlighting, but in the past m2e used WTP instead.Hexamerous
A
42

Spring Tools 4.14.1 is missing tm4e.

To install it, go to "Help → Install new software → Add URL: https://download.eclipse.org/tm4e/snapshots/. Click finish. Restart Eclipse.

Thanks to howlger for ideas from the question comments.

Aundrea answered 30/4, 2022 at 14:3 Comment(5)
Thanks! This worked for me using: download.eclipse.org/tm4e/releases/latestProduction
Need select only the "TextMate Core" component.Tonicity
The answer was right, however, it seems like this should have been mentioned in the Eclipse package management as a dependency.Winker
After installing the releases/latest, my eclipse freezes at startup (with 1MB Ram), just showing the startscreen. It's a Eclipse 2022-06 running with JavaAdopt11.Mccann
I am still getting the same error for pom.xml and "Text editor does not have a document provider" for application.properties. Eclipse: 2023-09 STS: 4.20 + tm4e already installed.Chilli
E
0

I installed Dockerfile support files for eclipse and then I faced this issue where I'm unable to open my pom.xml file and got the exact error which OP has posted, then I followed what Mr. Howlger advised and installed the software from below link and now I'm able to resolve the issue.

http://download.eclipse.org/tm4e/snapshots/

Euell answered 12/11, 2022 at 11:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.