使用 cxf的程序 在win10 测试部署时报空指针异常

2018-11-08 15:50:55.072 DEBUG 21524 --- [nio-8080-exec-1] o.s.b.w.s.f.OrderedRequestContextFilter  : Cleared thread-bound request context: org.apache.catalina.connector.RequestFacade@4c608203
2018-11-08 15:50:55.073 ERROR 21524 --- [nio-8080-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.NullPointerException] with root cause

java.lang.NullPointerException: null
        at org.apache.cxf.common.util.Compiler.useJava6Compiler(Compiler.java:187) ~[cxf-bundle-2.7.18.jar!/:2.7.18]
        at org.apache.cxf.common.util.Compiler.compileFiles(Compiler.java:141) ~[cxf-bundle-2.7.18.jar!/:2.7.18]
        at org.apache.cxf.common.util.Compiler.compileFiles(Compiler.java:136) ~[cxf-bundle-2.7.18.jar!/:2.7.18]
        at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.compileJavaSrc(DynamicClientFactory.java:610) ~[cxf-bundle-2.7.18.jar!/:2.7.18]
        at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:369) ~[cxf-bundle-2.7.18.jar!/:2.7.18]
        at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:240) ~[cxf-bundle-2.7.18.jar!/:2.7.18]
        at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:233) ~[cxf-bundle-2.7.18.jar!/:2.7.18]
        at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:188) ~[cxf-bundle-2.7.18.jar!/:2.7.18]
        at cn.com.hongyousoft.microservices.customapp.service.LoginServer.login(LoginServer.java:55) ~[classes!/:0.1]
异常信息如上 . 同一个机子在idea中调试没有问题.

打成jar包运行时报错,猜测和环境有关, 经过一番琢磨,发现是环境变量.

在系统环境变量中的path 变量里 %JAVA_HOMNE%之前有目录中有其他含有java文件.把%JAVA_HOMNE%在path 中提到最前.解决. 在此记录.

 

posted @ 2018-11-08 15:56  oY-CCTR  阅读(958)  评论(0编辑  收藏  举报