error: null pointer exception in JaxWsDynamicClientFactory
来源:互联网 发布:数据质量 衡量标准 编辑:程序博客网 时间:2024/06/05 20:36
http://stackoverflow.com/questions/15564388/dynamic-client-using-jaxwsdynamicclientfactory-apache-cxf
问题:
JaxWsDynamicClientFactory clientFactory = JaxWsDynamicClientFactory.newInstance(); Client client = clientFactory.createClient("http://172.16.41.6:8085/Logd.asmx?wsdl");
原因:
You need to run the code using a JDK, not a JRE. The NPE is happening in the following bit of CXF'sCompiler
class
JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); StandardJavaFileManager fileManager = compiler.getStandardFileManager(null, null, null);
compiler
is null if you run in a JRE(java/jre not java/jdk/jre).
在eclipse中执行代码,默认使用eclipse中指定的jre。若指定的jre不在jdk中,无法找到jdk/bin下的编译器,返回null。CXF'sCompiler
中即会出现null pointer exception。
解决:
需要使用JAVA安装目录下面的JDK下面的jre
如果你是eclipse的工程很容易出现不是那个目录。。你可以再windows->preferences->java-Install JRE下面去指定,然后修改工程里的JRE引用到正确的JDK的JRE(右击JRE Library System --> properties --> execution environment下拉表)。
0 0
- error: null pointer exception in JaxWsDynamicClientFactory
- 【android】null pointer exception
- null pointer exception
- Null Pointer and Cast Exception
- Myeclipse+Aptana显示Null Pointer Exception
- 字符串 比较 避免 null pointer exception
- error exception in Java
- eclipse部署网站时出现null pointer exception的解决方法
- 在Java中避免空指针异常(Null Pointer Exception)
- 在Java中避免空指针异常(Null Pointer Exception)
- 在Java中避免空指针异常(Null Pointer Exception)
- JAVA mail MimeUtility.quote 函数抛出 NULL Pointer Exception.
- 关于unable to instantiate activity componentinfo - Null Pointer Exception
- null pointer
- Null pointer (NULL array pointer is passed) in function cvGetMat, 报这样的错
- laravel - Error in exception handler
- git使用,VirtualAlloc pointer is null, Win32 error 487...........
- oracle数据库 java.lang.Exception: Exception in sending Request :: null
- Linux磁盘管理
- 字符串的简单操作
- libjingle 登录openfire测试
- Hat's Fibonacci(杭电1250)
- FFmpeg滤镜代码级分析
- error: null pointer exception in JaxWsDynamicClientFactory
- MyEclipse10 安装SVN后,每次启动myeclipse弹出“SubVersion Native Library Not Availbale”窗口
- vs2010项目转换为vs2008项目
- 软件工程-关于词频统计程序设计实现分析
- POJ 1236 Network of Schools(强连通分量)
- POJ 3254 状压DP
- WebForms UnobtrusiveValidationMode 需要“jquery”ScriptResourceMapping。请添加一个名为 jquery (区分大小写)的 ScriptRe
- 计算机区分指令和数据?
- 23 快速排序2