在Web服务中使用OAuth时出现异常

时间:2012-09-27 05:00:18

标签: java android web-services oauth-2.0 axis

我有一个开发用于管理我们的应用内结算的网络服务。现在我想将其更改为包含对Android Subscription API的支持。所以我要使用OAuth来查询Google的服务器。 我的代码完美地作为基于控制台的应用程序。但是当我尝试将其作为webservice发布时,我会遇到异常。这是某种错误还是我做错了什么?如果我错了,请指导我。

IWAB0398E Error in generating WSDL from Java:  java.lang.NoClassDefFoundError: com/google/api/client/http/HttpRequestInitializer
    java.lang.NoClassDefFoundError: com/google/api/client/http/HttpRequestInitializer
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
    at java.lang.Class.getDeclaredMethod(Unknown Source)
    at org.apache.axis.description.JavaServiceDesc.loadServiceDescByIntrospection(JavaServiceDesc.java:874)
    at org.apache.axis.description.JavaServiceDesc.loadServiceDescByIntrospection(JavaServiceDesc.java:846)
    at org.apache.axis.description.JavaServiceDesc.getOperations(JavaServiceDesc.java:410)
    at org.apache.axis.wsdl.fromJava.Emitter.writePortType(Emitter.java:1016)
    at org.apache.axis.wsdl.fromJava.Emitter.getWSDL(Emitter.java:484)
    at org.apache.axis.wsdl.fromJava.Emitter.emit(Emitter.java:331)
    at org.apache.axis.wsdl.fromJava.Emitter.emit(Emitter.java:430)
    at org.apache.axis.tools.ant.wsdl.Java2WsdlAntTask.execute(Java2WsdlAntTask.java:243)
    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.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:507)
    at org.eclipse.wst.command.internal.env.ui.widgets.SimpleCommandEngineManager.runForwardToNextStop(SimpleCommandEngineManager.java:264)
    at org.eclipse.wst.command.internal.env.ui.widgets.popup.DynamicPopupWizard.runHeadLess(DynamicPopupWizard.java:188)
    at org.eclipse.wst.command.internal.env.ui.widgets.popup.DynamicPopupWizard$1.run(DynamicPopupWizard.java:143)
    at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464)
    at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372)
    at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:507)
    at org.eclipse.wst.command.internal.env.ui.widgets.popup.DynamicPopupWizard.run(DynamicPopupWizard.java:139)
    at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:251)
    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:620)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:575)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1408)

以下是我使用过的罐子。

  1. 谷歌-API服务-androidpublisher-V1-rev2-1.8.0-beta.jar

  2. 谷歌-HTTP-客户杰克逊-1.11.0-β

  3. 杰克逊核-ASL-1.9.9

  4. 番石榴11.0.1

  5. 谷歌OAuth的客户端 - 1.11.0-β

  6. 谷歌-HTTP-客户1.11.0-β

  7. 谷歌-API服务日历-V3-rev16-1.8.0-β

  8. 谷歌-API的客户端 - 1.11.0-β

  9. 谷歌-HTTP-客户jackson2-1.11.0-β

1 个答案:

答案 0 :(得分:0)

java.lang.NoClassDefFoundError: com/google/api/client/http/HttpRequestInitializer

这意味着。

This runtime error is thrown by the JVM when there is an attempt by a
ClassLoader to load the definition of a Class (Class referenced in your 
application code etc.) and when such Class definition could not be found
within the current ClassLoader tree.

可能未正确设置类路径。