Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

maven版本的ltp4j编译失败 #23

Open
zxy00 opened this issue Jan 12, 2017 · 31 comments
Open

maven版本的ltp4j编译失败 #23

zxy00 opened this issue Jan 12, 2017 · 31 comments

Comments

@zxy00
Copy link

zxy00 commented Jan 12, 2017

[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for edu.hit.ir.ltp4j:ltp4j:nar:0.1.0-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 54, column 15
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building hitscir-ltp4j 0.1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- nar-maven-plugin:3.5.0:nar-validate (default-nar-validate) @ ltp4j ---
[INFO] Using AOL: x86_64-MacOSX-gpp
[INFO]
[INFO] --- nar-maven-plugin:3.5.0:nar-download (default-nar-download) @ ltp4j ---
[INFO] Getting Nar dependencies
[INFO] Getting Nar dependencies
[INFO]
[INFO] --- nar-maven-plugin:3.5.0:nar-unpack (default-nar-unpack) @ ltp4j ---
[INFO] Getting Nar dependencies
[INFO] Unpacking 0 dependencies to /Users/zxy/study/ltp/ltp4j/target/nar
[INFO]
[INFO] --- nar-maven-plugin:3.5.0:nar-gnu-configure (default-nar-gnu-configure) @ ltp4j ---
[INFO]
[INFO] --- nar-maven-plugin:3.5.0:nar-system-generate (default-nar-system-generate) @ ltp4j ---
[INFO] Generating /Users/zxy/study/ltp/ltp4j/target/nar/nar-generated/edu/hit/ir/ltp4j/NarSystem.java
[INFO] Not using 'native-lib-loader' because it is not a dependency)
[INFO]
[INFO] --- nar-maven-plugin:3.5.0:nar-vcproj (default-nar-vcproj) @ ltp4j ---
[INFO]
[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ ltp4j ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/zxy/study/ltp/ltp4j/src/main/resources
[INFO]
[INFO] --- nar-maven-plugin:3.5.0:nar-resources (default-nar-resources) @ ltp4j ---
[INFO] Copied 0 resources
[INFO]
[INFO] --- nar-maven-plugin:3.5.0:nar-gnu-resources (default-nar-gnu-resources) @ ltp4j ---
[INFO]
[INFO] --- maven-compiler-plugin:3.6.0:compile (default-compile) @ ltp4j ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 8 source files to /Users/zxy/study/ltp/ltp4j/target/classes
[INFO]
[INFO] --- nar-maven-plugin:3.5.0:nar-javah (default-nar-javah) @ ltp4j ---
[INFO] Running /Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/bin/javah compiler on 7 classes...
[INFO] + /Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/bin/javah -classpath /Users/zxy/study/ltp/ltp4j/target/classes -d /Users/zxy/study/ltp/ltp4j/target/nar/javah-include edu.hit.ir.ltp4j.NarSystem edu.hit.ir.ltp4j.SplitSentence edu.hit.ir.ltp4j.Postagger edu.hit.ir.ltp4j.Parser edu.hit.ir.ltp4j.Segmentor edu.hit.ir.ltp4j.NER edu.hit.ir.ltp4j.SRL
[INFO]
[INFO] --- nar-maven-plugin:3.5.0:nar-gnu-make (default-nar-gnu-make) @ ltp4j ---
[INFO]
[INFO] --- nar-maven-plugin:3.5.0:nar-compile (default-nar-compile) @ ltp4j ---
[INFO] Compiling 6 native files
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.560 s
[INFO] Finished at: 2017-01-12T20:08:50+08:00
[INFO] Final Memory: 19M/207M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.maven-nar:nar-maven-plugin:3.5.0:nar-compile (default-nar-compile) on project ltp4j: NAR: Include path not found: com.github.maven_nar.IncludePath@37b57b54 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
zxydeMacBook-Pro:ltp4j zxy$ find target/ -type f -name ".jar" -or -name ".so"
zxydeMacBook-Pro:ltp4j zxy$ find target/ -type f -name ".jar" -or -name ".so"
zxydeMacBook

@Oneplus
Copy link
Member

Oneplus commented Jan 12, 2017

看起来好像是没拉ltp,试试先

git submodule init
git submodule update

mvn

@zxy00
Copy link
Author

zxy00 commented Jan 13, 2017

我就是根据文档编译的,但是mac下,下载的ltp4j-neoltp4j不包含.gitmodules和.travrs.yml,在进到项目中编译的时候,git submodule init 不能用,然后网上查下,先git init,在执行git submodule init
git submodule update就可以了,但是最后编译还是没成功

@zxy00
Copy link
Author

zxy00 commented Jan 13, 2017

@Oneplus

@zxy00
Copy link
Author

zxy00 commented Jan 13, 2017

@Oneplus

zxydeMacBook-Pro:ltp zxy$ cd ltp4j
zxydeMacBook-Pro:ltp4j zxy$ git submodule init
fatal: Not a git repository (or any of the parent directories): .git
zxydeMacBook-Pro:ltp4j zxy$ git init
Initialized empty Git repository in /Users/zxy/study/ltp/ltp4j/.git/
zxydeMacBook-Pro:ltp4j zxy$ git submodule init
zxydeMacBook-Pro:ltp4j zxy$ git submodule update
zxydeMacBook-Pro:ltp4j zxy$ mvn
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for edu.hit.ir.ltp4j:ltp4j:nar:0.1.0-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 54, column 15
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building hitscir-ltp4j 0.1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- nar-maven-plugin:3.5.0:nar-validate (default-nar-validate) @ ltp4j ---
[INFO] Using AOL: x86_64-MacOSX-gpp
[INFO]
[INFO] --- nar-maven-plugin:3.5.0:nar-download (default-nar-download) @ ltp4j ---
[INFO] Getting Nar dependencies
[INFO] Getting Nar dependencies
[INFO]
[INFO] --- nar-maven-plugin:3.5.0:nar-unpack (default-nar-unpack) @ ltp4j ---
[INFO] Getting Nar dependencies
[INFO] Unpacking 0 dependencies to /Users/zxy/study/ltp/ltp4j/target/nar
[INFO]
[INFO] --- nar-maven-plugin:3.5.0:nar-gnu-configure (default-nar-gnu-configure) @ ltp4j ---
[INFO]
[INFO] --- nar-maven-plugin:3.5.0:nar-system-generate (default-nar-system-generate) @ ltp4j ---
[INFO] Generating /Users/zxy/study/ltp/ltp4j/target/nar/nar-generated/edu/hit/ir/ltp4j/NarSystem.java
[INFO] Not using 'native-lib-loader' because it is not a dependency)
[INFO]
[INFO] --- nar-maven-plugin:3.5.0:nar-vcproj (default-nar-vcproj) @ ltp4j ---
[INFO]
[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ ltp4j ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/zxy/study/ltp/ltp4j/src/main/resources
[INFO]
[INFO] --- nar-maven-plugin:3.5.0:nar-resources (default-nar-resources) @ ltp4j ---
[INFO] Copied 0 resources
[INFO]
[INFO] --- nar-maven-plugin:3.5.0:nar-gnu-resources (default-nar-gnu-resources) @ ltp4j ---
[INFO]
[INFO] --- maven-compiler-plugin:3.6.0:compile (default-compile) @ ltp4j ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 8 source files to /Users/zxy/study/ltp/ltp4j/target/classes
[INFO]
[INFO] --- nar-maven-plugin:3.5.0:nar-javah (default-nar-javah) @ ltp4j ---
[INFO] Running /Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/bin/javah compiler on 7 classes...
[INFO] + /Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/bin/javah -classpath /Users/zxy/study/ltp/ltp4j/target/classes -d /Users/zxy/study/ltp/ltp4j/target/nar/javah-include edu.hit.ir.ltp4j.NarSystem edu.hit.ir.ltp4j.SplitSentence edu.hit.ir.ltp4j.Postagger edu.hit.ir.ltp4j.Parser edu.hit.ir.ltp4j.Segmentor edu.hit.ir.ltp4j.NER edu.hit.ir.ltp4j.SRL
[INFO]
[INFO] --- nar-maven-plugin:3.5.0:nar-gnu-make (default-nar-gnu-make) @ ltp4j ---
[INFO]
[INFO] --- nar-maven-plugin:3.5.0:nar-compile (default-nar-compile) @ ltp4j ---
[INFO] Compiling 6 native files
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.150 s
[INFO] Finished at: 2017-01-13T09:28:30+08:00
[INFO] Final Memory: 19M/204M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.maven-nar:nar-maven-plugin:3.5.0:nar-compile (default-nar-compile) on project ltp4j: NAR: Include path not found: com.github.maven_nar.IncludePath@4492eede -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
zxydeMacBook-Pro:ltp4j zxy$

@Oneplus
Copy link
Member

Oneplus commented Jan 13, 2017

好像不是git clone的,所以实际ltp还是没拉下来。

建议

git clone https://github.com/HIT-SCIR/ltp4j.git
git checkout neoltp4j
git submodule init
git submodule update

关于是否把ltp拉下来了,只要看src/main/c++/ltp文件夹里面有没文件就知道了。
另外,如果看到Compiling 6 native files这个肯定是不对的,正常需要compile 150+个文件。

@Oneplus
Copy link
Member

Oneplus commented Jan 13, 2017

@endyul neoltp4j是不是mac下不能编译?我记得之前好像说过这件事。

@endyul
Copy link
Collaborator

endyul commented Jan 13, 2017

能过编译的阶段,测试阶段过不去。编译的产出是可以用的

@zxy00
Copy link
Author

zxy00 commented Jan 13, 2017

@Oneplus 尝试了你给的命令,不可以,第二个命令就错误了

@endyul
Copy link
Collaborator

endyul commented Jan 13, 2017

@zxy00 请问报什么错?

@Oneplus
Copy link
Member

Oneplus commented Jan 13, 2017 via email

@zxy00
Copy link
Author

zxy00 commented Jan 13, 2017

[WARNING] ltp/src/parser.n/parser.cpp:190:17: warning: implicit conversion changes signedness: 'const int' to 'size_type' (aka 'unsigned long') [-Wsign-conversion]
[ERROR] PUSH( CLUSTER(S1) );
[ERROR] ~~~~~~~~^~~
[ERROR] ltp/src/parser.n/parser.cpp:185:50: note: expanded from macro 'CLUSTER'
[ERROR] #define CLUSTER(id) (ctx.id >= 0 ? (cluster[ctx.id]+kClusterInFeaturespace): kNilCluster)
[ERROR] ~~~~~~~ ~~~~^~
[ERROR] ltp/src/parser.n/parser.cpp:188:46: note: expanded from macro 'PUSH'
[ERROR] #define PUSH(feat) do { features.push_back( feat ); } while (0);
[ERROR] ^~~~
[WARNING] ltp/src/parser.n/parser.cpp:191:9: warning: implicit conversion changes signedness: 'const value_type' (aka 'const int') to 'unsigned long' [-Wsign-conversion]
[ERROR] PUSH( CLUSTER(S2) );
[ERROR] ~~~~~~^~~~~~~~~~~~~
[ERROR] ltp/src/parser.n/parser.cpp:185:38: note: expanded from macro 'CLUSTER'
[ERROR] #define CLUSTER(id) (ctx.id >= 0 ? (cluster[ctx.id]+kClusterInFeaturespace): kNilCluster)
[ERROR] ^ ~
[ERROR] ltp/src/parser.n/parser.cpp:188:46: note: expanded from macro 'PUSH'
[ERROR] #define PUSH(feat) do { features.push_back( feat ); } while (0);
[ERROR] ^~~~
[WARNING] ltp/src/parser.n/parser.cpp:191:17: warning: implicit conversion changes signedness: 'const int' to 'size_type' (aka 'unsigned long') [-Wsign-conversion]
[ERROR] PUSH( CLUSTER(S2) );
[ERROR] ~~~~~~~~^~~
[ERROR] ltp/src/parser.n/parser.cpp:185:50: note: expanded from macro 'CLUSTER'
[ERROR] #define CLUSTER(id) (ctx.id >= 0 ? (cluster[ctx.id]+kClusterInFeaturespace): kNilCluster)
[ERROR] ~~~~~~~ ~~~~^~
[ERROR] ltp/src/parser.n/parser.cpp:188:46: note: expanded from macro 'PUSH'
[ERROR] #define PUSH(feat) do { features.push_back( feat ); } while (0);
[ERROR] ^~~~
[WARNING] ltp/src/parser.n/parser.cpp:192:9: warning: implicit conversion changes signedness: 'const value_type' (aka 'const int') to 'unsigned long' [-Wsign-conversion]
[ERROR] PUSH( CLUSTER(N0) ); PUSH( CLUSTER4(N0) ); PUSH( CLUSTER6(N0) );
[ERROR] ~~~~~~^~~~~~~~~~~~~
[ERROR] ltp/src/parser.n/parser.cpp:185:38: note: expanded from macro 'CLUSTER'
[ERROR] #define CLUSTER(id) (ctx.id >= 0 ? (cluster[ctx.id]+kClusterInFeaturespace): kNilCluster)
[ERROR] ^ ~
[ERROR] ltp/src/parser.n/parser.cpp:188:46: note: expanded from macro 'PUSH'
[ERROR] #define PUSH(feat) do { features.push_back( feat ); } while (0);
[ERROR] ^~~~
[WARNING] ltp/src/parser.n/parser.cpp:192:17: warning: implicit conversion changes signedness: 'const int' to 'size_type' (aka 'unsigned long') [-Wsign-conversion]
[ERROR] PUSH( CLUSTER(N0) ); PUSH( CLUSTER4(N0) ); PUSH( CLUSTER6(N0) );
[ERROR] ~~~~~~~~^~~
[ERROR] ltp/src/parser.n/parser.cpp:185:50: note: expanded from macro 'CLUSTER'
[ERROR] #define CLUSTER(id) (ctx.id >= 0 ? (cluster[ctx.id]+kClusterInFeaturespace): kNilCluster)
[ERROR] ~~~~~~~ ~~~~^~
[ERROR] ltp/src/parser.n/parser.cpp:188:46: note: expanded from macro 'PUSH'
[ERROR] #define PUSH(feat) do { features.push_back( feat ); } while (0);
[ERROR] ^~~~
[WARNING] ltp/src/parser.n/parser.cpp:192:33: warning: implicit conversion changes signedness: 'const value_type' (aka 'const int') to 'unsigned long' [-Wsign-conversion]
[ERROR] PUSH( CLUSTER(N0) ); PUSH( CLUSTER4(N0) ); PUSH( CLUSTER6(N0) );
[ERROR] ~~~~~~^~~~~~~~~~~~~~
[ERROR] ltp/src/parser.n/parser.cpp:186:38: note: expanded from macro 'CLUSTER4'
[ERROR] #define CLUSTER4(id) (ctx.id >= 0 ? (cluster4[ctx.id]+kCluster4InFeaturespace): kNilCluster4)
[ERROR] ^ ~
[ERROR] ltp/src/parser.n/parser.cpp:188:46: note: expanded from macro 'PUSH'
[ERROR] #define PUSH(feat) do { features.push_back( feat ); } while (0);
[ERROR] ^~~~
[WARNING] ltp/src/parser.n/parser.cpp:192:42: warning: implicit conversion changes signedness: 'const int' to 'size_type' (aka 'unsigned long') [-Wsign-conversion]
[ERROR] PUSH( CLUSTER(N0) ); PUSH( CLUSTER4(N0) ); PUSH( CLUSTER6(N0) );
[ERROR] ~~~~~~~~~^~~
[ERROR] ltp/src/parser.n/parser.cpp:186:51: note: expanded from macro 'CLUSTER4'
[ERROR] #define CLUSTER4(id) (ctx.id >= 0 ? (cluster4[ctx.id]+kCluster4InFeaturespace): kNilCluster4)
[ERROR] ~~~~~~~~ ~~~~^~
......
T E S T S

Running edu.hit.ir.ltp4j.test.SRLTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.13 sec <<< FAILURE!
Running edu.hit.ir.ltp4j.test.NERTest
Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.096 sec <<< FAILURE!
Running edu.hit.ir.ltp4j.test.ParserTest
Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.085 sec <<< FAILURE!
Running edu.hit.ir.ltp4j.test.SegmentorTest
Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.075 sec <<< FAILURE!
Running edu.hit.ir.ltp4j.test.PostaggerTest
Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.076 sec <<< FAILURE!

Results :

Tests in error:
testPostaggerCreate(edu.hit.ir.ltp4j.test.PostaggerTest)
testPostaggerPostag(edu.hit.ir.ltp4j.test.PostaggerTest)

Tests run: 9, Failures: 0, Errors: 9, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:11 min
[INFO] Finished at: 2017-01-13T10:31:11+08:00
[INFO] Final Memory: 26M/325M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.maven-nar:nar-maven-plugin:3.5.0:nar-integration-test (default-nar-integration-test) on project ltp4j: There are test failures.
[ERROR]
[ERROR] Please refer to /Users/zxy/ltp4j/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
zxydeMacBook-Pro:ltp4j zxy$
Display all 1671 possibilities? (y or n)
zxydeMacBook-Pro:ltp4j zxy$
Display all 1671 possibilities? (y or n)
! heap ptardiff5.18
./ heap32 ptargrep
.anaconda-navigator-post-link.sh help ptargrep5.16
.anaconda-navigator-pre-unlink.sh

@Oneplus @endyul

@zxy00
Copy link
Author

zxy00 commented Jan 13, 2017

@Oneplus用你的方法,出现上面的错误

@endyul
Copy link
Collaborator

endyul commented Jan 13, 2017

@zxy00
这里build已经完成了,test失败是maven-nar的bug,等待官方修复,可以暂时忽略
编译出的jar和动态库分别是:
target/ltp4j-0.1.0-SNAPSHOT-x86_64-MacOSX-gpp-jni.nar
target/nar/ltp4j-0.1.0-SNAPSHOT-x86_64-MacOSX-gpp-jni/lib/x86_64-MacOSX-gpp/jni/libltp4j-0.1.0-SNAPSHOT.jnilib

@zxy00
Copy link
Author

zxy00 commented Jan 13, 2017

@endyul 这样就可以调用了吗,教程的话,生成ltp.jar,但是这个没有

@zxy00
Copy link
Author

zxy00 commented Jan 13, 2017

@endyul @Oneplus 已经生成了,谢谢啦

@endyul
Copy link
Collaborator

endyul commented Jan 13, 2017

@zxy00
这里生成的target/ltp4j-0.1.0-SNAPSHOT-x86_64-MacOSX-gpp-jni.nar就是

@endyul
Copy link
Collaborator

endyul commented Jan 13, 2017

@zxy00
示例请参考这个文档 http://ltp4j.readthedocs.io/en/neoltp4j/api.html

@zxy00
Copy link
Author

zxy00 commented Jan 13, 2017

@endyul 好的,谢谢

@endyul
Copy link
Collaborator

endyul commented Jan 13, 2017

@Oneplus 我来跟进一下编译问题,完善一下文档. 然后正式release这个分支吧

@Oneplus
Copy link
Member

Oneplus commented Jan 13, 2017

@endyul 看看有没有可能提交到maven centeral,这样可以直接把ltp4j当成mvn dependency用。

@endyul
Copy link
Collaborator

endyul commented Jan 14, 2017

@Oneplus 好的

@zxy00
Copy link
Author

zxy00 commented Jan 16, 2017

A fatal error has been detected by the Java Runtime Environment:

SIGSEGV (0xb) at pc=0x00000001279b9cfa, pid=899, tid=0x0000000000001703

JRE version: Java(TM) SE Runtime Environment (8.0_101-b13) (build 1.8.0_101-b13)

Java VM: Java HotSpot(TM) 64-Bit Server VM (25.101-b13 mixed mode bsd-amd64 compressed oops)

Problematic frame:

C [libltp4j-0.1.0-SNAPSHOT.jnilib+0x148cfa] ltp::framework::ViterbiDecoder::get_result(unsigned long const&, std::__1::vector<int, std::__1::allocator >&)+0x8a

Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again

An error report file with more information is saved as:

/Users/zxy/study/Java/workspace2/AnalysisByCognitive/hs_err_pid899.log

If you would like to submit a bug report, please visit:

http://bugreport.java.com/bugreport/crash.jsp

The crash happened outside the Java Virtual Machine in native code.

See problematic frame for where to report the bug

@Oneplus @endyul 运行一段时间,出现上面的错误,怎么解决

@liangyangtao
Copy link

Failed to execute goal com.github.maven-nar:nar-maven-plugin:3.5.0:nar-validate (default-nar-validate) on project ltp4j: Could not launch cmd.exe /X /C "link /?": Error while executing process. Cannot run program "link": CreateProcess error=2
tim 20171229162337

@liangyangtao
Copy link

[DEBUG] -- Searching for usable VisualStudio
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.829 s
[INFO] Finished at: 2017-12-29T16:29:59+08:00
[INFO] Final Memory: 11M/150M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.maven-nar:nar-maven-plugin:3.5.0:nar-validate (default-nar-validate) on project ltp4j: Could not launch cmd.exe /X /C "lin
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.github.maven-nar:nar-maven-plugin:3.5.0:nar-validate (default-nar-validate) on pr
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Could not launch cmd.exe /X /C "link /?"
at com.github.maven_nar.NarUtil.runCommand (NarUtil.java:594)
at com.github.maven_nar.Msvc.initVisualStudio (Msvc.java:317)
at com.github.maven_nar.Msvc.init (Msvc.java:196)
at com.github.maven_nar.Msvc.setMojo (Msvc.java:486)
at com.github.maven_nar.AbstractNarMojo.validate (AbstractNarMojo.java:323)
at com.github.maven_nar.AbstractNarMojo.execute (AbstractNarMojo.java:194)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: org.codehaus.plexus.util.cli.CommandLineException: Error while executing process.
at org.codehaus.plexus.util.cli.Commandline.execute (Commandline.java:675)
at com.github.maven_nar.NarUtil.runCommand (NarUtil.java:566)
at com.github.maven_nar.Msvc.initVisualStudio (Msvc.java:317)
at com.github.maven_nar.Msvc.init (Msvc.java:196)
at com.github.maven_nar.Msvc.setMojo (Msvc.java:486)
at com.github.maven_nar.AbstractNarMojo.validate (AbstractNarMojo.java:323)
at com.github.maven_nar.AbstractNarMojo.execute (AbstractNarMojo.java:194)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: java.io.IOException: Cannot run program "link": CreateProcess error=2, ???????????
at java.lang.ProcessBuilder.start (ProcessBuilder.java:1048)
at java.lang.Runtime.exec (Runtime.java:620)
at org.codehaus.plexus.util.cli.Commandline.execute (Commandline.java:655)
at com.github.maven_nar.NarUtil.runCommand (NarUtil.java:566)
at com.github.maven_nar.Msvc.initVisualStudio (Msvc.java:317)
at com.github.maven_nar.Msvc.init (Msvc.java:196)
at com.github.maven_nar.Msvc.setMojo (Msvc.java:486)
at com.github.maven_nar.AbstractNarMojo.validate (AbstractNarMojo.java:323)
at com.github.maven_nar.AbstractNarMojo.execute (AbstractNarMojo.java:194)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: java.io.IOException: CreateProcess error=2, ???????????
at java.lang.ProcessImpl.create (Native Method)
at java.lang.ProcessImpl. (ProcessImpl.java:386)
at java.lang.ProcessImpl.start (ProcessImpl.java:137)
at java.lang.ProcessBuilder.start (ProcessBuilder.java:1029)
at java.lang.Runtime.exec (Runtime.java:620)
at org.codehaus.plexus.util.cli.Commandline.execute (Commandline.java:655)
at com.github.maven_nar.NarUtil.runCommand (NarUtil.java:566)
at com.github.maven_nar.Msvc.initVisualStudio (Msvc.java:317)
at com.github.maven_nar.Msvc.init (Msvc.java:196)
at com.github.maven_nar.Msvc.setMojo (Msvc.java:486)
at com.github.maven_nar.AbstractNarMojo.validate (AbstractNarMojo.java:323)
at com.github.maven_nar.AbstractNarMojo.execute (AbstractNarMojo.java:194)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

@liu946
Copy link
Collaborator

liu946 commented Dec 30, 2017

是否安装了VS呢?
@liangyangtao

@liangyangtao
Copy link

liangyangtao commented Jan 2, 2018

@liu946 谢谢指点,是没有安装VS , 对c++了解不多,我安装试试

@whitezdm
Copy link

一直报Failed to execute goal com.github.maven-nar:nar-maven-plugin:3.5.0:nar-compile (default-nar-compile) on project ltp4j: NAR: Include path not found: com.github.maven_nar.IncludePath,错误不知道错在哪里,vs2015也都安装了,很头疼

@wuao-codebase
Copy link

[ERROR] Failed to execute goal com.github.maven-nar:nar-maven-plugin:3.5.0:nar-validate (default-nar-validate) on project ltp4j: Could not launch cmd.exe /X /C "link /?": Error while executing process. Cannot run program "link": CreateProcess error=2, 系统找不到指定的文件。 -> [Help 1]

@liangyangtao 一样的问题,安装vs2017后没能解决。

@liu946
Copy link
Collaborator

liu946 commented Jan 25, 2018

可以参考一下 #35 。不知是否是因为test导致的。

@yuye2133
Copy link

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:13 min
[INFO] Finished at: 2018-02-10T20:40:34+08:00
[INFO] Final Memory: 11M/117M
[INFO] ------------------------------------------------------------------------
[ERROR] Unknown lifecycle phase "Dmaven.test.skip=true". You must specify a valid lifecycle phase or a goal in the format : or :[:]:. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/LifecyclePhaseNotFoundException

@xsy0rival
Copy link

请问在Windows下怎么将ltp4j编译成jar包啊?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants