誰かが深刻な問題で私を助けることができるかどうか疑問に思っていました... 多くの依存関係を使用してプロジェクトから jar を作成する必要があります... 問題は: 自分の手で書いた私の build.xml ファイルが機能していません。より具体的には、問題なく実行され、警告のみが表示されます:
Buildfile: C:\Users\Alexis Fasquel\workspace\FirstEditServer\build.xml
clean:
[delete] Deleting directory C:\Users\Alexis Fasquel\workspace\FirstEditServer\bin
[delete] Deleting directory C:\Users\Alexis Fasquel\workspace\FirstEditServer\dist
makedir:
[mkdir] Created dir: C:\Users\Alexis Fasquel\workspace\FirstEditServer\bin
[mkdir] Created dir: C:\Users\Alexis Fasquel\workspace\FirstEditServer\dist
compile:
[javac] C:\Users\Alexis Fasquel\workspace\FirstEditServer\build.xml:101: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
[javac] Compiling 14 source files to C:\Users\Alexis Fasquel\workspace\FirstEditServer\bin
jar:
[jar] Building jar: C:\Users\Alexis Fasquel\workspace\FirstEditServer\dist\firstEditServer.jar
main:
BUILD SUCCESSFUL
Total time: 1 second
しかし、残念ながら、まだ classNotFoundDefError が発生します
インスタンス化しようとした最初のクラスが見つからないため、完全なトレースを出力しませんでした...だから、何も機能していないと思います...しかし、ここにあります:
Exception in thread "main" java.lang.NoClassDefFoundError: gate/util/GateExcept
on
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.getMethod0(Unknown Source)
at java.lang.Class.getMethod(Unknown Source)
at sun.launcher.LauncherHelper.getMainMethod(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
Caused by: java.lang.ClassNotFoundException: gate.util.GateException
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 6 more
私のbuild.xmlファイルがあります...誰かがそれを見て、おそらく私のエラーを見つけることができますか?
<?xml version="1.0"?>
<project name="Ant-Test" default="main" basedir=".">
<!-- Sets variables which can later be used. -->
<!-- The value of a property is accessed via ${} -->
<property name="src.dir" location="src" />
<property name="bin.dir" location="bin" />
<property name="gate.dir" location="gate" />
<property name="virtuoso.dir" location="virtuoso" />
<property name="recommendation.dir" location="recommendation" />
<property name="dist.dir" location="dist" />
<path id="bin.classpath">
<fileset dir="${virtuoso.dir}">
<include name="openrdf-sesame-2.6.5-onejar.jar" />
<include name="slf4j-api-1.5.0.jar" />
<include name="slf4j-jdk14-1.5.0.jar" />
<include name="virt_sesame2.jar" />
<include name="virtjdbc3.jar" />
</fileset>
<fileset dir="${gate.dir}">
<include name="plugins\Gazetteer_LKB\Gazetteer_LKB.jar" />
<include name="lib\gate.jar" />
<include name="lib\log4j.jar" />
<include name="lib\commons-io.jar" />
<include name="plugins\Tagger_Framework\TaggerFramework.jar" />
<include name="lib\ant-contrib.jar" />
<include name="lib\ant-launcher.jar" />
<include name="lib\ant.jar" />
<include name="lib\aopalliance.jar" />
<include name="lib\apache-mime4j-core.jar" />
<include name="lib\apache-mime4j-dom.jar" />
<include name="lib\bcmail-jdk15.jar" />
<include name="lib\bcprov-jdk15.jar" />
<include name="lib\commons-codec.jar" />
<include name="lib\commons-compress.jar" />
<include name="lib\commons-lang.jar" />
<include name="lib\commons-logging.jar" />
<include name="lib\dom4j.jar" />
<include name="lib\fontbox.jar" />
<include name="lib\gate-asm.jar" />
<include name="lib\gate-compiler-jdt.jar" />
<include name="lib\lucene-core.jar" />
<include name="lib\metadata-extractor.jar" />
<include name="lib\nekohtml.jar" />
<include name="lib\pdfbox.jar" />
<include name="lib\poi-ooxml-schemas.jar" />
<include name="lib\poi-ooxml.jar" />
<include name="lib\poi-scratchpad.jar" />
<include name="lib\poi.jar" />
<include name="lib\spring-aop.jar" />
<include name="lib\spring-beans.jar" />
<include name="lib\spring-core.jar" />
<include name="lib\tika-core.jar" />
<include name="lib\tika-parsers.jar" />
<include name="lib\wstx-lgpl.jar" />
<include name="lib\xercesImpl.jar" />
<include name="lib\xmlbeans.jar" />
<include name="lib\xmlunit.jar" />
<include name="lib\xpp3.jar" />
<include name="lib\xstream.jar" />
<include name="lib\ivy.jar" />
<include name="lib\java-getopt.jar" />
<include name="lib\java2html.jar" />
<include name="lib\javacc.jar" />
<include name="lib\jaxen.jar" />
<include name="lib\jdom.jar" />
<include name="lib\jempbox.jar" />
<include name="lib\junit.jar" />
<include name="plugins\Gazetteer_LKB\lib\commons-cli-1.1.jar" />
<include name="plugins\Gazetteer_LKB\lib\commons-collections-3.2.1.jar" />
<include name="plugins\Gazetteer_LKB\lib\commons-httpclient-3.1.jar" />
<include name="plugins\Gazetteer_LKB\lib\kim-api-3.0-RC5.jar" />
<include name="plugins\Gazetteer_LKB\lib\kim-util-3.0-RC5.jar" />
<include name="plugins\Gazetteer_LKB\lib\owlim-lite-4.3.jar" />
<include name="plugins\Gazetteer_LKB\lib\trove4j-2.0.2.jar" />
<include name="plugins\Gazetteer_LKB\lib\openrdf-sesame-2.6.3-onejar.jar" />
<include name="plugins\Gazetteer_LKB\lib\slf4j-api-1.5.11.jar" />
<include name="plugins\Gazetteer_LKB\lib\slf4j-log4j12-1.5.11.jar" />
</fileset>
<fileset dir="${recommendation.dir}">
<include name="simmetrics_jar_v1_6_2_d07_02_07.jar" />
</fileset>
</path>
<!-- Deletes the existing bin, docs and dist directory-->
<target name="clean">
<delete dir="${bin.dir}" />
<delete dir="${dist.dir}" />
</target>
<!-- Creates the bin and dist directory-->
<target name="makedir">
<mkdir dir="${bin.dir}" />
<mkdir dir="${dist.dir}" />
</target>
<!-- Compiles the java code (including the usage of library for JUnit -->
<target name="compile" depends="clean, makedir">
<javac srcdir="${src.dir}" destdir="${bin.dir}" classpathref="bin.classpath">
</javac>
</target>
<!--Creates the deployable jar file -->
<target name="jar" depends="compile">
<jar destfile="${dist.dir}\firstEditServer.jar" basedir="${bin.dir}">
<manifest>
<attribute name="Main-Class" value="com.firstedit.main.Main" />
</manifest>
</jar>
</target>
<target name="main" depends="compile, jar">
<description>Main target</description>
</target>
</project>
ご覧のとおり、GateException は実際には gate.jar にあります...