0

我找不到这个问题的解决方案。

当我尝试运行 ejbdoclet 时,出现错误

XDoclet classpath missing J2EE classes

XDoclet 类路径在哪里,它缺少的 J2EE 类在哪里?这里有人有什么想法吗?我正在使用 MyEclipse 和 Ant。

完整跟踪:

[ejbdoclet] XDoclet classpath missing J2EE classes
[ejbdoclet]     at xdoclet.modules.ejb.EjbDocletTask.validateOptions(EjbDocletTask.java:86)
[ejbdoclet]     at xjavadoc.ant.XJavadocTask.execute(XJavadocTask.java:89)
[ejbdoclet]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
[ejbdoclet]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ejbdoclet]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[ejbdoclet]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[ejbdoclet]     at java.lang.reflect.Method.invoke(Method.java:597)
[ejbdoclet]     at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[ejbdoclet]     at org.apache.tools.ant.Task.perform(Task.java:348)
[ejbdoclet]     at org.apache.tools.ant.Target.execute(Target.java:392)
[ejbdoclet]     at org.apache.tools.ant.Target.performTasks(Target.java:413)
[ejbdoclet]     at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
[ejbdoclet]     at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
[ejbdoclet]     at org.eclipse.ant.internal.launching.remote.EclipseSingleCheckExecutor.executeTargets(EclipseSingleCheckExecutor.java:30)
[ejbdoclet]     at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
[ejbdoclet]     at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:442)
[ejbdoclet]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
[ejbdoclet]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ejbdoclet]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[ejbdoclet]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[ejbdoclet]     at java.lang.reflect.Method.invoke(Method.java:597)
[ejbdoclet]     at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[ejbdoclet]     at org.apache.tools.ant.Task.perform(Task.java:348)
[ejbdoclet]     at org.apache.tools.ant.Target.execute(Target.java:392)
[ejbdoclet]     at org.apache.tools.ant.Target.performTasks(Target.java:413)
[ejbdoclet]     at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
[ejbdoclet]     at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
[ejbdoclet]     at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[ejbdoclet]     at org.eclipse.ant.internal.launching.remote.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
[ejbdoclet]     at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
[ejbdoclet]     at org.eclipse.ant.internal.launching.remote.InternalAntRunner.run(InternalAntRunner.java:424)
[ejbdoclet]     at org.eclipse.ant.internal.launching.remote.InternalAntRunner.main(InternalAntRunner.java:138)
[ejbdoclet] Caused by: Make sure the jar file containing the javax.ejb.EntityBean class is on the classpath specified in the <taskdef> that defined ejbdoclet. These classes are needed in order to generate correct output.
[ejbdoclet]     at xdoclet.DocletTask.checkClass(DocletTask.java:513)
[ejbdoclet]     at xdoclet.modules.ejb.EjbDocletTask.validateOptions(EjbDocletTask.java:83)
[ejbdoclet]     ... 31 more

BUILD FAILED
4

1 回答 1

0

您的路径中一定缺少一些 jar 文件,或者您在 build.xml 中的路径是错误的。检查您的 build.xml。我有一个类似的问题,但意识到我在路径中有一个错字。

<pathelement location="${resin.home}/lib/ejb-15.jar" />
<pathelement location="${resin.home}/lib/ejb-20.jar" />
<pathelement location="${resin.home}/lib/ejb-30.jar" />
<pathelement location="${build}"/>

我的resin.home 指向了错误的位置。我收到以下错误:

[ejbdoclet] XDoclet classpath missing J2EE classes
[ejbdoclet]     at xdoclet.modules.ejb.EjbDocletTask.validateOptions(EjbDocletTask.java:86)
[ejbdoclet]     at xjavadoc.ant.XJavadocTask.execute(XJavadocTask.java:89)
[ejbdoclet]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
[ejbdoclet]     at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
[ejbdoclet]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[ejbdoclet]     at java.lang.reflect.Method.invoke(Method.java:592)
于 2015-09-04T22:42:16.713 回答