2016-04-24 142 views
0

我正在爲智能購物系統製作Android應用程序。我想: -如何通過Web服務將Android應用程序與MySQL DB進行通信?

  1. 使Web應用程序,它可以創建有關的產品(具有產品獨特的ID即QR碼)信息的QR碼。所有這些信息應該存儲在MySQL

  2. 該QR代碼將包含一個URL像 http://localhost:8080/Mysupermarket/index.jsp/pid=1 (像這樣)

  3. 客戶將掃描QR碼和將被引導到這個頁面,不知何故,他應該獲取該產品在數據庫中的所有詳細信息存儲。

4.該數據應該然後轉換爲字符串,以便我的應用程序可以轉換爲語音

我有什麼迄今所做的?

http://codeoncloud.blogspot.in/2012/03/android-mysql-client.html

我跟着這個教程,使用SOAP的Web服務。但是,當我在服務器上運行Web應用程序,然後單擊listservice,把它扔到這個異常

java.lang.NoClassDefFoundError: 
org/apache/ws/commons/schema/resolver/URIResolver 
     at org.apache.axis2.deployment.ModuleDeployer.deploy(ModuleDeployer.java:128) 
     at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:144) 
     at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:585) 
     at org.apache.axis2.deployment.RepositoryListener.init(RepositoryListener.java:264) 
     at org.apache.axis2.deployment.RepositoryListener.init2(RepositoryListener.java:66) 
     at org.apache.axis2.deployment.RepositoryListener.<init>(RepositoryListener.java:61) 
     at org.apache.axis2.deployment.DeploymentEngine.loadRepository(DeploymentEngine.java:152) 
     at org.apache.axis2.deployment.WarBasedAxisConfigurator.getAxisConfiguration(WarBasedAxisConfigurator.java:233) 
     at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:64) 
     at org.apache.axis2.transport.http.AxisServlet.initConfigContext(AxisServlet.java:620) 
     at org.apache.axis2.transport.http.AxisServlet.init(AxisServlet.java:471) 
     at org.apache.axis2.webapp.AxisAdminServlet.init(AxisAdminServlet.java:60) 
     at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1231) 
     at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1144) 
     at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1031) 
     at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4997) 
     at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5289) 
     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) 
     at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408) 
     at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398) 
     at java.util.concurrent.FutureTask.run(Unknown Source) 
     at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) 
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) 
     at java.lang.Thread.run(Unknown Source) 
    Caused by: java.lang.ClassNotFoundException: org.apache.ws.commons.schema.resolver.URIResolver 
     at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1333) 
     at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1167) 
     ... 24 more 

    Apr 24, 2016 8:48:37 PM org.apache.catalina.core.StandardContext loadOnStartup 
    SEVERE: Servlet [AxisAdminServlet] in web application [/WebApp] threw load() exception 
    java.lang.ClassNotFoundException: org.apache.ws.commons.schema.resolver.URIResolver 
     at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1333) 
     at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1167) 
     at org.apache.axis2.deployment.ModuleDeployer.deploy(ModuleDeployer.java:128) 
     at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:144) 
     at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:585) 
     at org.apache.axis2.deployment.RepositoryListener.init(RepositoryListener.java:264) 
     at org.apache.axis2.deployment.RepositoryListener.init2(RepositoryListener.java:66) 
     at org.apache.axis2.deployment.RepositoryListener.<init>(RepositoryListener.java:61) 
     at org.apache.axis2.deployment.DeploymentEngine.loadRepository(DeploymentEngine.java:152) 
     at org.apache.axis2.deployment.WarBasedAxisConfigurator.getAxisConfiguration(WarBasedAxisConfigurator.java:233) 
     at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:64) 
     at org.apache.axis2.transport.http.AxisServlet.initConfigContext(AxisServlet.java:620) 
     at org.apache.axis2.transport.http.AxisServlet.init(AxisServlet.java:471) 
     at org.apache.axis2.webapp.AxisAdminServlet.init(AxisAdminServlet.java:60) 
     at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1231) 
     at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1144) 
     at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1031) 
     at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4997) 
     at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5289) 
     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) 
     at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408) 
     at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398) 
     at java.util.concurrent.FutureTask.run(Unknown Source) 
     at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) 
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) 
     at java.lang.Thread.run(Unknown Source) 

    Apr 24, 2016 8:48:38 PM org.apache.catalina.startup.HostConfig deployDirectory 
    INFO: Deploying web application directory C:\apache-tomcat-8.0.30\webapps\docs 
    Apr 24, 2016 8:48:38 PM org.apache.catalina.startup.HostConfig deployDirectory 
    INFO: Deployment of web application directory C:\apache-tomcat-8.0.30\webapps\docs has finished in 47 ms 
    Apr 24, 2016 8:48:38 PM org.apache.catalina.startup.HostConfig deployDirectory 
    INFO: Deploying web application directory C:\apache-tomcat-8.0.30\webapps\examples 
    Apr 24, 2016 8:48:38 PM org.apache.catalina.core.ApplicationContext log 
    INFO: ContextListener: contextInitialized() 
    Apr 24, 2016 8:48:38 PM org.apache.catalina.core.ApplicationContext log 
    INFO: SessionListener: contextInitialized() 
    Apr 24, 2016 8:48:38 PM org.apache.catalina.startup.HostConfig deployDirectory 
    INFO: Deployment of web application directory C:\apache-tomcat-8.0.30\webapps\examples has finished in 563 ms 
    Apr 24, 2016 8:48:38 PM org.apache.catalina.startup.HostConfig deployDirectory 
    INFO: Deploying web application directory C:\apache-tomcat-8.0.30\webapps\host-manager 
    Apr 24, 2016 8:48:38 PM org.apache.catalina.startup.HostConfig deployDirectory 
    INFO: Deployment of web application directory C:\apache-tomcat-8.0.30\webapps\host-manager has finished in 46 ms 
    Apr 24, 2016 8:48:38 PM org.apache.catalina.startup.HostConfig deployDirectory 
    INFO: Deploying web application directory C:\apache-tomcat-8.0.30\webapps\manager 
    Apr 24, 2016 8:48:38 PM org.apache.catalina.startup.HostConfig deployDirectory 
    INFO: Deployment of web application directory C:\apache-tomcat-8.0.30\webapps\manager has finished in 32 ms 
    Apr 24, 2016 8:48:38 PM org.apache.catalina.startup.HostConfig deployDirectory 
    INFO: Deploying web application directory C:\apache-tomcat-8.0.30\webapps\ROOT 
    Apr 24, 2016 8:48:38 PM org.apache.catalina.startup.HostConfig deployDirectory 
    INFO: Deployment of web application directory C:\apache-tomcat-8.0.30\webapps\ROOT has finished in 62 ms 
    Apr 24, 2016 8:48:38 PM org.apache.coyote.AbstractProtocol start 
    INFO: Starting ProtocolHandler ["http-nio-8080"] 
    Apr 24, 2016 8:48:38 PM org.apache.coyote.AbstractProtocol start 
    INFO: Starting ProtocolHandler ["ajp-nio-8009"] 
    Apr 24, 2016 8:48:38 PM org.apache.catalina.startup.Catalina start 
    INFO: Server startup in 4629 ms 
    [INFO] Clustering has been disabled 
    [WARN] Unable to instantiate deployer org.apache.axis2.deployment.ServiceDeployer; see debug logs for more details 
    Apr 24, 2016 8:48:42 PM org.apache.catalina.core.ApplicationContext log 
    SEVERE: StandardWrapper.Throwable 
    java.lang.NoClassDefFoundError: org/apache/ws/commons/schema/resolver/URIResolver 
     at org.apache.axis2.deployment.ModuleDeployer.deploy(ModuleDeployer.java:128) 
     at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:144) 
     at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:585) 
     at org.apache.axis2.deployment.RepositoryListener.init(RepositoryListener.java:264) 
     at org.apache.axis2.deployment.RepositoryListener.init2(RepositoryListener.java:66) 
     at org.apache.axis2.deployment.RepositoryListener.<init>(RepositoryListener.java:61) 
     at org.apache.axis2.deployment.DeploymentEngine.loadRepository(DeploymentEngine.java:152) 
     at org.apache.axis2.deployment.WarBasedAxisConfigurator.getAxisConfiguration(WarBasedAxisConfigurator.java:233) 
     at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:64) 
     at org.apache.axis2.transport.http.AxisServlet.initConfigContext(AxisServlet.java:620) 
     at org.apache.axis2.transport.http.AxisServlet.init(AxisServlet.java:471) 
     at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1231) 
     at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1144) 
     at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:817) 
     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:135) 
     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) 
     at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) 
     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141) 
     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) 
     at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616) 
     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) 
     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:521) 
     at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1096) 
     at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:674) 
     at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500) 
     at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456) 
     at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) 
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) 
     at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) 
     at java.lang.Thread.run(Unknown Source) 
    Caused by: java.lang.ClassNotFoundException: org.apache.ws.commons.schema.resolver.URIResolver 
     at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1333) 
     at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1167) 
     ... 30 more 

    Apr 24, 2016 8:48:42 PM org.apache.catalina.core.StandardWrapperValve invoke 
    SEVERE: Allocate exception for servlet AxisServlet 
    java.lang.ClassNotFoundException: org.apache.ws.commons.schema.resolver.URIResolver 
     at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1333) 
     at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1167) 
     at org.apache.axis2.deployment.ModuleDeployer.deploy(ModuleDeployer.java:128) 
     at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:144) 
     at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:585) 
     at org.apache.axis2.deployment.RepositoryListener.init(RepositoryListener.java:264) 
     at org.apache.axis2.deployment.RepositoryListener.init2(RepositoryListener.java:66) 
     at org.apache.axis2.deployment.RepositoryListener.<init>(RepositoryListener.java:61) 
     at org.apache.axis2.deployment.DeploymentEngine.loadRepository(DeploymentEngine.java:152) 
     at org.apache.axis2.deployment.WarBasedAxisConfigurator.getAxisConfiguration(WarBasedAxisConfigurator.java:233) 
     at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:64) 
     at org.apache.axis2.transport.http.AxisServlet.initConfigContext(AxisServlet.java:620) 
     at org.apache.axis2.transport.http.AxisServlet.init(AxisServlet.java:471) 
     at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1231) 
     at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1144) 
     at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:817) 
     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:135) 
     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) 
     at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) 
     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141) 
     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) 
     at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616) 
     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) 
     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:521) 
     at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1096) 
     at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:674) 
     at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500) 
     at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456) 
     at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) 
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) 
     at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) 
     at java.lang.Thread.run(Unknown Source) 

如何解決呢? 也請建議一些關於如何將Android應用程序連接到Web服務的好教程。 他們大多數都使用PHP。我想使用Java。

在此先感謝

回答

0

此錯誤看起來是構建路徑問題。您必須添加對應用程序的依賴關係; 正確的依賴關係是;

<dependency> 
     <groupId>org.apache.ws.commons.schema</groupId> 
     <artifactId>XmlSchema</artifactId> 
     <version>1.3.2</version> 
    </dependency> 
+0

我做到了。但現在它顯示錯誤的服務,當我運行它 – sandy

+0

我通過下載最新的模式2.2.1 – sandy

相關問題