生成项目“ com.bea.util.jam.internal.javadoc.JavadocClassloadingException:”时出错

时间:2019-02-14 21:13:58

标签: build ant teamcity

尝试在TeamCity中构建Java项目时遇到错误。同一项目在我的本地环境中构建并执行得很好。我最近在GitLab上对该项目进行了更改。这是我第一次与GitLab和TeamCity合作。其他项目在构建过程中没有问题。我无法理解导致此错误的原因:

[15:58:54][Step 1/1] compile.earCommons (4s)
[15:58:54][compile.earCommons] echo
[15:58:54][compile.earCommons] echo
[15:58:54][compile.earCommons] wlcompile (4s)
[15:58:59][wlcompile] 
com.bea.util.jam.internal.javadoc.JavadocClassloadingException: An error 
has occurred while invoking javadoc to inspect your source
files.  This may be due to the fact that $JAVA_HOME/lib/tools.jar does
not seem to be in your system classloader.  One common case in which 
this happens is when using the 'ant' tool, which uses a special
context classloader to load classes from tools.jar.

This situation elicits what is believed to a javadoc bug in the initial
release of JDK 1.6.  Javadoc attempts to use its own context classloader
tools.jar but ignores one that may have already been set, which leads
to some classes being loaded into two different classloaders.  The
telltale sign of this problem is a javadoc error message saying that
'languageVersion() must return LanguageVersion - you might see this
message in your process' output.

This will hopefully be fixed in a later release of JDK 1.6; if a new
version of 1.6 has become available, you might be able to solve this
by simply upgrading to the latest JDK.

Alternatively, you can work around it by simply including 
$JAVA_HOME/lib/tools.jar in the java -classpath
parameter.  If you are running ant, you will need to modify the standard
ant script to include tools.jar in the -classpath.
[15:58:59][Step 1/1] Process exited with code 1
[15:58:59][Step 1/1] Ant output
[15:59:10][Step 1/1] Process exited with code 1 (Step: Ant)
[15:58:59][Step 1/1] Step Ant failed

****更新****

Build Step: Ant
Step 1:
Runner type: Ant (Runner for Ant build.xml files)
Execute:  If all previous steps finished successfully
build.xml file: \ant\build.xml
Working directory: same as checkout directory
Targets: none specified
Ant home path: C:\apache-ant-1.7.0
Additional Ant command line parameters: -lib c:\WebLogic\12.1.2\wlserver\server\lib\javaee.jar;c:\WebLogic\12.1.2\wlserver\server\lib\weblogic.jar;c:\WebLogic\12.1.2\wlserver\server\lib\webservices.jar
JDK home path: c:\Program Files\Java\jdk1.7.0_80
JVM command line parameters: not specified
Reduce test failure feedback time: OFF
Java code coverage: disabled
Docker Settings
Docker Image: unset

在这方面的任何帮助,我将不胜感激。

1 个答案:

答案 0 :(得分:0)

我发现其中一个文件存在字符编码问题,导致编译器无法加载Java类。一旦修复该问题,构建就可以正常工作。