当出现以下错误时:
------------------------------------------------------
java.lang.ClassCastException: com.sun.tools.javadoc.ClassDocImpl cannot be cast to com.sun.javadoc.AnnotationTypeDoc
at com.sun.tools.javadoc.AnnotationDescImpl.annotationType(AnnotationDescImpl.java:46)
at com.sun.tools.doclets.internal.toolkit.util.Util.isDeprecated(Util.java:811)
at com.sun.tools.doclets.formats.html.TagletWriterImpl.deprecatedTagOutput(TagletWriterImpl.java:85)
at com.sun.tools.doclets.internal.toolkit.taglets.DeprecatedTaglet.getTagletOutput(DeprecatedTaglet.java:40)
at com.sun.tools.doclets.formats.html.HtmlSerialFieldWriter.writeMemberDeprecatedInfo(HtmlSerialFieldWriter.java:96)
at com.sun.tools.doclets.internal.toolkit.builders.SerializedFormBuilder.buildFieldInfo(SerializedFormBuilder.java:444)
at sun.reflect.GeneratedMethodAccessor68.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.tools.doclets.internal.toolkit.builders.SerializedFormBuilder.invokeMethod(SerializedFormBuilder.java:131)
at com.sun.tools.doclets.internal.toolkit.builders.AbstractBuilder.build(AbstractBuilder.java:90)
at com.sun.tools.doclets.internal.toolkit.builders.SerializedFormBuilder.buildSerializableFields(SerializedFormBuilder.java:482)
at sun.reflect.GeneratedMethodAccessor75.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.tools.doclets.internal.toolkit.builders.SerializedFormBuilder.invokeMethod(SerializedFormBuilder.java:131)
at com.sun.tools.doclets.internal.toolkit.builders.AbstractBuilder.build(AbstractBuilder.java:90)
at com.sun.tools.doclets.internal.toolkit.builders.SerializedFormBuilder.buildClassSerializedForm(SerializedFormBuilder.java:185)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.tools.doclets.internal.toolkit.builders.SerializedFormBuilder.invokeMethod(SerializedFormBuilder.java:131)
at com.sun.tools.doclets.internal.toolkit.builders.AbstractBuilder.build(AbstractBuilder.java:90)
at com.sun.tools.doclets.internal.toolkit.builders.SerializedFormBuilder.buildPackageSerializedForm(SerializedFormBuilder.java:167)
at sun.reflect.GeneratedMethodAccessor76.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.tools.doclets.internal.toolkit.builders.SerializedFormBuilder.invokeMethod(SerializedFormBuilder.java:131)
at com.sun.tools.doclets.internal.toolkit.builders.AbstractBuilder.build(AbstractBuilder.java:90)
at com.sun.tools.doclets.internal.toolkit.builders.SerializedFormBuilder.buildSerializedFormSummaries(SerializedFormBuilder.java:148)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.tools.doclets.internal.toolkit.builders.SerializedFormBuilder.invokeMethod(SerializedFormBuilder.java:131)
at com.sun.tools.doclets.internal.toolkit.builders.AbstractBuilder.build(AbstractBuilder.java:90)
at com.sun.tools.doclets.internal.toolkit.builders.SerializedFormBuilder.buildSerializedForm(SerializedFormBuilder.java:116)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.tools.doclets.internal.toolkit.builders.SerializedFormBuilder.invokeMethod(SerializedFormBuilder.java:131)
at com.sun.tools.doclets.internal.toolkit.builders.AbstractBuilder.build(AbstractBuilder.java:90)
at com.sun.tools.doclets.internal.toolkit.builders.SerializedFormBuilder.build(SerializedFormBuilder.java:101)
at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.generateOtherFiles(AbstractDoclet.java:137)
at com.sun.tools.doclets.formats.html.HtmlDoclet.generateOtherFiles(HtmlDoclet.java:66)
at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.startGeneration(AbstractDoclet.java:122)
at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.start(AbstractDoclet.java:64)
at com.sun.tools.doclets.formats.html.HtmlDoclet.start(HtmlDoclet.java:42)
at com.sun.tools.doclets.standard.Standard.start(Standard.java:23)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.tools.javadoc.DocletInvoker.invoke(DocletInvoker.java:215)
at com.sun.tools.javadoc.DocletInvoker.start(DocletInvoker.java:91)
at com.sun.tools.javadoc.Start.parseAndExecute(Start.java:340)
at com.sun.tools.javadoc.Start.begin(Start.java:128)
at com.sun.tools.javadoc.Main.execute(Main.java:41)
at com.sun.tools.javadoc.Main.main(Main.java:31)
java.lang.ClassCastException: com.sun.tools.javadoc.ClassDocImpl cannot be cast to com.sun.javadoc.AnnotationTypeDoc
at com.sun.tools.javadoc.AnnotationDescImpl.annotationType(AnnotationDescImpl.java:46)
at com.sun.tools.doclets.internal.toolkit.util.ClassUseMapper.mapAnnotations(ClassUseMapper.java:439)
at com.sun.tools.doclets.internal.toolkit.util.ClassUseMapper.<init>(ClassUseMapper.java:183)
at com.sun.tools.doclets.formats.html.ClassUseWriter.generate(ClassUseWriter.java:109)
at com.sun.tools.doclets.formats.html.HtmlDoclet.generateOtherFiles(HtmlDoclet.java:92)
at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.startGeneration(AbstractDoclet.java:122)
1045 警告
at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.start(AbstractDoclet.java:64)
at com.sun.tools.doclets.formats.html.HtmlDoclet.start(HtmlDoclet.java:42)
at com.sun.tools.doclets.standard.Standard.start(Standard.java:23)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.tools.javadoc.DocletInvoker.invoke(DocletInvoker.java:215)
at com.sun.tools.javadoc.DocletInvoker.start(DocletInvoker.java:91)
at com.sun.tools.javadoc.Start.parseAndExecute(Start.java:340)
at com.sun.tools.javadoc.Start.begin(Start.java:128)
at com.sun.tools.javadoc.Main.execute(Main.java:41)
at com.sun.tools.javadoc.Main.main(Main.java:31)
------------------------------------------------------
解决办法:
这个是由于你缺少包而导致的。
到http://www.mvnsearch.org/maven2/javax/persistence/persistence-api/1.0/下载persistence-api-1.0.jar 包
放到项目当中,就不会出现这种问题了。