打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
jaxb实践
com.sun.tools.apt.main.CommandLine.parse(CommandLine.java:42)官方解释
http://bugs.sun.com/view_bug.do;jsessionid=e9d905c1f0f588ffffffffa3149dc97319886?bug_id=6510966
 
we tried to generate a XML schema out of our existing domain model by using the JAXB (2.1, JDK 1.6.0_07) schemagen.

Trying to launch the schemagen as described in the tutorial caused the following error:

  1. C:\temp>schemagen Example.java   
  2. An exception has occurred in apt (1.6.0_07). Please file a bug at the   
  3. Java Developer Connection (http://java.sun.com/webapps/bugreport)   
  4. after checking the Bug Parade for duplicates. Include your program and   
  5. the following diagnostic in your report.  Thank you.   
  6. java.lang.NullPointerException   
  7.         at com.sun.tools.apt.main.CommandLine.parse(CommandLine.java:42)   
  8.         at com.sun.tools.apt.main.Main.compile(Main.java:775)   
  9.         at com.sun.tools.apt.Main.processing(Main.java:95)   
  10.         at com.sun.tools.apt.Main.process(Main.java:85)   
  11.         at com.sun.tools.apt.Main.process(Main.java:67)   
  12.         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)   
  13.         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)   
  14.         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)   
  15.         at java.lang.reflect.Method.invoke(Method.java:597)   
  16.         at com.sun.tools.internal.jxc.SchemaGenerator$Runner.main(SchemaGenerator.java:190)   
  17.         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)   
  18.         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)   
  19.         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)   
  20.         at java.lang.reflect.Method.invoke(Method.java:597)   
  21.         at com.sun.tools.internal.jxc.SchemaGenerator.run(SchemaGenerator.java:128)   
  22.         at com.sun.tools.internal.jxc.SchemaGenerator.run(SchemaGenerator.java:38)   
  23.         at com.sun.tools.internal.jxc.SchemaGenerator.main(SchemaGenerator.java:30)  

After some researching we determined, that the tools.jar needs to be explicitly added to the classpath:

  1. C:\temp>schemagen -cp "%JAVA_HOME%\lib\tools.jar" Example.java   
  2. Note: Writing C:\temp\schema1.xsd   
  3. Note: Writing C:\temp\schema2.xsd  
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
org.logicalcobwebs.proxool.ShutdownHook#remove 异常原因
struts2空指针——spring的class没有获取到 web.xml中listener没有加listener-class标签
intellij idea中使用maven创建web项目
解决CenOS 7下启动ActiveMQ时报错
在java的main方法中调用java和javac
JDK、JRE、JVM之间的关系
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服