Maven issues: IntelliJ keeps displaying message: reading pom.xml
I'm on IntelliJ 8.1.
My status bar on the bottom displays a message that says reading pom.xml that never stops. My pom.xml is as follows...
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.datacleaner</groupId>
<artifactId>datacleaner</artifactId>
<packaging>jar</packaging>
<version>0.1b</version>
<name>datacleaner</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-dbutils</groupId>
<artifactId>commons-dbutils</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>jtds</groupId>
<artifactId>jtds</artifactId>
<version>1.2</version>
</dependency>
</dependencies>
</project>
I also typed in a class name and hit Alt+Enter... The quick fix Add Maven dependency doesn't work either for me
请先登录再写评论。
Hi,
Try invalidating system caches (File->Invalidate caches) and reimport the project.
Thanks,
Anton Makeev
thanks Anton Makeev !
I am facing the same problem.
I did (File →Invalidate caches), selected all checkboxes in the Popup and clicked the button to restart IntelliJ.
After restart, I still get the same error. My major concern is that I do not get the real error (root cause) so I am clueless what should be wrong. When I run mvn on the commandline all compiles, tests are green, and build is successful.
Any ideas what I can try?
Oh, I just checked the idea.log and found that there seems to be a bug in the custom Java parser implemented in IntelliJ:
Caused by: java.lang.IllegalArgumentException: Malformed type: // <I> type of SomeType
SomeType<OtherType>
at com.intellij.psi.impl.cache.TypeInfo.fromString(TypeInfo.java:600)
at com.intellij.psi.impl.cache.TypeInfo.fromString(TypeInfo.java:587)
at com.intellij.psi.impl.java.stubs.impl.PsiClassReferenceListStubImpl.lambda$new$0(PsiClassReferenceListStubImpl.java:24)
at com.intellij.util.containers.ContainerUtil.map2Array(ContainerUtil.java:953)
at com.intellij.psi.impl.java.stubs.impl.PsiClassReferenceListStubImpl.<init>(PsiClassReferenceListStubImpl.java:24)
at com.intellij.psi.impl.java.stubs.JavaClassReferenceListElementType.createStub(JavaClassReferenceListElementType.java:46)
at com.intellij.psi.impl.java.stubs.JavaClassReferenceListElementType.createStub(JavaClassReferenceListElementType.java:27)
at com.intellij.psi.stubs.LightStubBuilder.createStub(LightStubBuilder.java:132)
at com.intellij.psi.stubs.LightStubBuilder.buildStubTree(LightStubBuilder.java:81)
at com.intellij.psi.stubs.LightStubBuilder.buildStubTree(LightStubBuilder.java:55)
at com.intellij.psi.stubs.StubTreeBuilder.lambda$buildStubTree$1(StubTreeBuilder.java:142)
at com.intellij.psi.stubs.StubTreeBuilder.handleStubBuilderException(StubTreeBuilder.java:98)
... 62 more
Seems that this is indeed a bug but not related to the pom.xml parsing error.
The idea.log does also not provide additional information about what should be wrong in pom.xml.
I also found this issue that is related:
https://youtrack.jetbrains.com/issue/IDEA-295596/It-keeps-saying-pom.xml-has-syntax-errors-even-though-theres-no-error-and-doesnt-let-me-load-maven-project
I also increased heap-size for maven importer but still the same result…
https://stackoverflow.com/questions/36473138/cant-import-the-maven-project-in-intellij-idea-2016-1-1/51875187#51875187
More users with this problem but still no solution:
https://youtrack.jetbrains.com/issue/IDEA-25324
Error unmarshaling return header; nested exception is:
java.net.SocketException: Connection reset
I was not aware that IntelliJ needs Internet to parse a pom.xml file. Does it consult an AI cloud for this?
IMHO it is best practice to have local catalogs for common XML namespaces but maybe IntelliJ does a lookup of every namespace URL and XSD file for every pom.xml - if that is the case that explains why all is so slow since that is a pointless waste of performance. My project has 600 maven modules and according pom.xml files - not much fun to work with IntelliJ in such context…
When I [ctrl][click] on the XSD in IntelliJ I can see a maven-4.0.0.xsd that comes from maven.jar of the maven plugin of IntelliJ.
So IntelliJ does implement such best-practices. Great.
But where does the SocketException come from? When reading artifacts (like source-jars)?
I also see this:
Joerg Hohwiller Could you please share the full logs, so we can take a closer look at the issue (Help → Collect Logs and Diagnostic Data)?
As a possible workaround:
pom.xml
→ Open as Project> Could you please share the full logs, so we can take a closer look at the issue (Help → Collect Logs and Diagnostic Data)?
Is there a way to upload them only for JetBrains without revealing project names and details on the web? It is impossible for me to reproduce the bug in an isolated demo project. When I use IntelliJ in “playground” or “sandbox” projects all works fine. The real problems only happen if I work with Ultimate in consultancy projects with years of legacy history that have grown large and have complex POM structures with many modules.
I have collected the logs and diagnostic data. Since it contains a lot of data also anonymizing it does not seem an easy task.
Joerg Hohwiller You can share the logs using our private upload service.
Diagnostic data and logs uploaded:
Upload id: 2024_11_11_ZeqWsER2v73Swax6izvA5N (file: idea-logs-20241104-1353192113510364914572032.zip)
Thanks for having a look.
Joerg Hohwiller Thank you for sharing the logs!
It looks like something might be interrupting the connection between IDEA and the proxy process it uses to interact with the Maven-based Projects.
This might be, for instance, if said proxy process stops unexpectedly or if something does not allow the two to communicate.
It might be worth looking into your firewall settings to make sure loopback connections (connection to 127.0.0.1) are not being blocked and checking the Windows logs for any errors related to the unexpected process terminations.
Roman Vatagin thanks for analyzing my logs.
I will check my windows events and error logs. In case I find something of interest I will let you know.
If firewall would prevent loopback connections, no language server would work in IJ, VSCode, Eclipse, etc. Also mvnd works fine on my machine so I do not expect that loopback connections are not working.
Joerg Hohwiller Thank you, please let me know if you'll find anything!
In regards to the connection blocking, it may happen on per-process basis and/or heuristically, for instance well-known processes like
mvnd
may be allowed, while others like IDEA'sMavenServer
may be blocked.