【发布时间】:2019-04-16 05:03:17
【问题描述】:
我的程序编译没有任何错误。但是在执行大文件时,我得到了以下异常:
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:java (default-cli) on project rdf4j-getting-started:
An exception occured while executing the Java class. null: InvocationTargetException: The parser has encountered
more than "100,000" entity expansions in this document; this is the limit imposed by the application. -> [Help 1]
我正在使用以下命令:
mvn -Djdk.xml.totalEntitySizeLimit=0 -DentityExpansionLimit=0 exec:java
我的 pom 和所有依赖项:
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>rdf4j-getting-started</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>HelloRDF4J</name>
<dependencies>
<dependency>
<groupId>org.eclipse.rdf4j</groupId>
<artifactId>rdf4j-runtime</artifactId>
<version>2.0M2</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>utf8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<configuration>
<mainClass>ConvertOntology</mainClass>
</configuration>
</plugin>
</plugins>
</build>
</project>
我正在使用以下 java 版本:
java version "1.8.0_192"
Java(TM) SE Runtime Environment (build 1.8.0_192-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.192-b12, mixed mode)
请帮忙
【问题讨论】:
-
请让我们看看你的 pom.xml 和你的 Java 代码。
-
@PowerStat 请检查代码。注意到对于小文件,它工作得很好
-
我认为你的 pom 会更有趣,因为它使用了 exec-maven-plugin - 它报告了错误。
-
一个快速的谷歌搜索出现了this。