2012-09-27 57 views
3

我有一個web服務,用於管理我們的應用內結算。現在我想將其更改爲包含對Android Subscription API的支持。所以我必須使用OAuth來查詢Google的服務器。 我的代碼完美地作爲一個基於控制檯的應用程序。但是,當我嘗試將其發佈爲web服務時,我會看到異常。這是一種錯誤還是我做錯了什麼?如果我錯了,請引導我。在Web服務中使用OAuth時出現異常

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. 傑克遜-core-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-β

回答

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. 

可能是類路徑設置不正確。

+0

我必須檢查我的類路徑是否正確設置..它是問題只有當我創建Oauth Webservice –

相關問題