2

我正在尝试使用 Spring Data、LingPipe 和 Mapreduce 对文本进行分类。所以我在我的本地 maven 存储库上安装了 LingPipe。

mvn install:install-file -DgroupId=com.aliasi -DartifactId=lingpipe -Dversion=4.1.0 -Dpackaging=jar -DgeneratePom=true -Dfile=lingpipe-4.1.0.jar

我已将依赖项添加到我的 pom 文件中。

        <dependency>
            <groupId>com.aliasi</groupId>
            <artifactId>lingpipe</artifactId>
            <version>4.1.0</version>
            <scope>compile</scope>
        </dependency>

但是当我执行我的 MapReduce 程序时,我得到了 ClassNotFound 异常。请给我建议。错误看起来像

INFO: Running job: job_201310112311_0012
Oct 12, 2013 10:10:53 AM org.apache.hadoop.mapred.JobClient monitorAndPrintJob
INFO:  map 0% reduce 0%
Oct 12, 2013 10:11:01 AM org.apache.hadoop.mapred.JobClient monitorAndPrintJob
INFO: Task Id : attempt_201310112311_0012_m_000000_0, Status : FAILED
Error: java.lang.ClassNotFoundException: com.aliasi.classify.ConditionalClassification
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at com.test.MyMap.map(MyMap.java:20)
    at com.test.MyMap.map(MyMap.java:14)
    at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:145)
    at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:764)
    at org.apache.hadoop.mapred.MapTask.run(MapTask.java:364)
    at org.apache.hadoop.mapred.Child$4.run(Child.java:255)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:415)
    at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1190)
    at org.apache.hadoop.mapred.Child.main(Child.java:249)

Oct 12, 2013 10:11:07 AM org.apache.hadoop.mapred.JobClient monitorAndPrintJob
INFO: Task Id : attempt_201310112311_0012_m_000000_1, Status : FAILED
Error: java.lang.ClassNotFoundException: com.aliasi.classify.ConditionalClassification
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at com.test.MyMap.map(MyMap.java:20)
    at com.test.MyMap.map(MyMap.java:14)
    at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:145)
    at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:764)
    at org.apache.hadoop.mapred.MapTask.run(MapTask.java:364)
    at org.apache.hadoop.mapred.Child$4.run(Child.java:255)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:415)
    at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1190)
    at org.apache.hadoop.mapred.Child.main(Child.java:249)

有没有其他方法可以将第三方 Jar 添加到 Maven 或者我在这里遗漏了什么?

4

0 回答 0