Eclipse“创建Web服务”显示奇怪的错误

时间:2011-01-13 17:10:33

标签: java eclipse web-services json wsdl

编辑2:

我之前可能应该提到这一点,但是在设置Web服务之后我会收到警告(但在实际制作之前,发生错误的地方)。这是警告:

  

服务类   “net.rim.Indy.WebService.Functions_JSONP”   不符合一个或多个   JAX-RPC 1.1的要求   规范,可能不会部署或   功能正常。

果汁:

  

服务类   “net.rim.Indy.WebService.Functions_JSONP”   不符合一个或多个   JAX-RPC 1.1的要求   规范,可能不会部署或   功能正常。该领域或   值类型的属性“原因”   “atg.taglib.json.util.JSONException”   通过服务类使用   “net.rim.Indy.WebService.Functions_JSONP”   有一个数据类型,   “java.lang.Throwable”,不是   由JAX-RPC 1.1支持   规格。类型的实例   可能不会序列化或反序列化   正确。数据丢失或完整   可能导致Web服务失败。

如果修复了这个问题,我感觉Web服务将开始工作,因为除了JSON功能之外,它与我的另一个相同。需要更改某些内容,以便JAX规范完全支持我的Web服务。

编辑:

我现在正在解决自动为我选择错误项目的问题。我按照文件 - >新建 - >网络服务。我的设置如下:

Web service type: Bottom up
Service implementation: net.aaa.bbb.WebService.Functions_JSONP
Server runtime: Tomcat v6
Web service runtime: Apache Axis
Service project: ABC
Client type: Java Proxy

我勾选“发布Web服务”并点击下一步。然后在下一页上我再次点击Next以生成Functions_JSONP.wsdl并获得以下错误:

IWAB0398E Error in generating WSDL from Java:  java.lang.ClassNotFoundException: net.aaa.bbb.WebService.Functions_JSONP

这是完整的堆栈跟踪:

IWAB0398E Error in generating WSDL from Java:  java.lang.ClassNotFoundException: net.aaa.bbb.WebService.Functions_JSONP
    java.lang.ClassNotFoundException: net.aaa.bbb.WebService.Functions_JSONP
    at org.apache.axis.utils.ClassUtils.loadClass(ClassUtils.java:204)
    at org.apache.axis.utils.ClassUtils.forName(ClassUtils.java:100)
    at org.apache.axis.wsdl.fromJava.Emitter.setCls(Emitter.java:2079)
    at org.apache.axis.tools.ant.wsdl.Java2WsdlAntTask.execute(Java2WsdlAntTask.java:188)
    at org.eclipse.jst.ws.internal.axis.consumption.core.command.Java2WSDLCommand.executeAntTask(Java2WSDLCommand.java:180)
    at org.eclipse.jst.ws.internal.axis.consumption.core.command.Java2WSDLCommand.execute(Java2WSDLCommand.java:95)
    at org.eclipse.jst.ws.internal.axis.creation.ui.command.BUCodeGenOperation$BottomUpWSModifyOperation.execute(BUCodeGenOperation.java:122)
    at org.eclipse.jst.ws.internal.axis.creation.ui.command.BUCodeGenOperation.execute(BUCodeGenOperation.java:86)
    at org.eclipse.wst.command.internal.env.core.fragment.CommandFragmentEngine.runCommand(CommandFragmentEngine.java:419)
    at org.eclipse.wst.command.internal.env.core.fragment.CommandFragmentEngine.visitTop(CommandFragmentEngine.java:359)
    at org.eclipse.wst.command.internal.env.core.fragment.CommandFragmentEngine.moveForwardToNextStop(CommandFragmentEngine.java:254)
    at org.eclipse.wst.command.internal.env.ui.widgets.SimpleCommandEngineManager$6.run(SimpleCommandEngineManager.java:294)
    at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464)
    at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372)
    at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:1008)
    at org.eclipse.wst.command.internal.env.ui.widgets.SimpleCommandEngineManager.runForwardToNextStop(SimpleCommandEngineManager.java:264)
    at org.eclipse.wst.command.internal.env.ui.widgets.WizardPageManager.runForwardToNextStop(WizardPageManager.java:91)
    at org.eclipse.wst.command.internal.env.ui.widgets.WizardPageManager.getNextPage(WizardPageManager.java:154)
    at org.eclipse.wst.command.internal.env.ui.widgets.SimpleWizardPage.getNextPage(SimpleWizardPage.java:136)
    at org.eclipse.jface.wizard.WizardDialog.nextPressed(WizardDialog.java:887)
    at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:426)
    at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:624)
    at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:234)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
    at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
    at org.eclipse.jface.window.Window.open(Window.java:801)
    at org.eclipse.ui.internal.handlers.WizardHandler$New.executeHandler(WizardHandler.java:254)
    at org.eclipse.ui.internal.handlers.WizardHandler.execute(WizardHandler.java:274)
    at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:293)
    at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
    at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
    at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
    at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)
    at org.eclipse.ui.internal.actions.CommandAction.runWithEvent(CommandAction.java:157)
    at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
    at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
    at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
    at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
    at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1407)

可能是什么问题?

谢谢!

1 个答案:

答案 0 :(得分:2)

从您的邮件中看起来像序列化问题。您似乎将可抛出的类暴露为公共API的一部分,这违反了JAX-RPC。 (请检查您的异常类以获取throwable的实例。删除它们,您应该没问题。)

注意:发生的例子。如果你的例外有这个,那就是违规行为。

私人Throwable throwable;

public Throwable getThrowable(){         回归     }