问:
Error list of services Apache-axis
I'm trying to mount a SOAP server and I'm getting the following error when I click to the service options of the Axis apache. I'm using apache-tomcat-8, axis2-1.7.6 and java 9.

I would like to know what I'm doing wrong. I'm new in java and sorry if the informatión is not enough.

```[WARN] Web application uses org.apache.axis2.transport.http.AxisAdminServlet; please update web.xml to use org.apache.axis2.webapp.AxisAdminServlet instead
[WARN] Unable to load manifest for StAX implementation at jrt:/java.xml/
[INFO] Clustering has been disabled
[WARN] Unable to instantiate deployer org.apache.axis2.deployment.ServiceDeployer; see debug logs for more details
nov. 13, 2017 8:59:03 P. M. org.apache.catalina.core.ApplicationContext log
GRAVE: 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:149)
    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:120)
    at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1183)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1099)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:989)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4931)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5241)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    at java.base/java.lang.Thread.run(Thread.java:844)
Caused by: java.lang.ClassNotFoundException: org.apache.ws.commons.schema.resolver.URIResolver
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1291)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1119)
    ... 24 more

nov. 13, 2017 8:59:03 P. M. org.apache.catalina.core.StandardContext loadOnStartup
GRAVE: Servlet [AxisAdminServlet] in web application [/test_server] threw load() exception
java.lang.ClassNotFoundException: org.apache.ws.commons.schema.resolver.URIResolver
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1291)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1119)
    at org.apache.axis2.deployment.ModuleDeployer.deploy(ModuleDeployer.java:128)
    at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:149)
    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:120)
    at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1183)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1099)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:989)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4931)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5241)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    at java.base/java.lang.Thread.run(Thread.java:844)

nov. 13, 2017 8:59:04 P. M. org.apache.coyote.AbstractProtocol start
INFORMACIÓN: Starting ProtocolHandler ["http-nio-8080"]
nov. 13, 2017 8:59:04 P. M. org.apache.coyote.AbstractProtocol start
INFORMACIÓN: Starting ProtocolHandler ["ajp-nio-8009"]
nov. 13, 2017 8:59:04 P. M. org.apache.catalina.startup.Catalina start
INFORMACIÓN: Server startup in 10198 ms
[INFO] Clustering has been disabled
[WARN] Unable to instantiate deployer org.apache.axis2.deployment.ServiceDeployer; see debug logs for more details
nov. 13, 2017 8:59:48 P. M. org.apache.catalina.core.ApplicationContext log
GRAVE: 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:149)
    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:1183)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1099)
    at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:779)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:133)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.base/java.lang.Thread.run(Thread.java:844)
Caused by: java.lang.ClassNotFoundException: org.apache.ws.commons.schema.resolver.URIResolver
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1291)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1119)
    ... 31 more

nov. 13, 2017 8:59:48 P. M. org.apache.catalina.core.StandardWrapperValve invoke
GRAVE: Excepción de reserva de espacio para servlet [AxisServlet]
java.lang.ClassNotFoundException: org.apache.ws.commons.schema.resolver.URIResolver
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1291)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1119)
    at org.apache.axis2.deployment.ModuleDeployer.deploy(ModuleDeployer.java:128)
    at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:149)
    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:1183)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1099)
    at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:779)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:133)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.base/java.lang.Thread.run(Thread.java:844)

[WARN] Unable to instantiate deployer org.apache.axis2.deployment.ServiceDeployer; see debug logs for more details
nov. 13, 2017 9:08:15 P. M. org.apache.catalina.core.StandardWrapperValve invoke
GRAVE: El Servlet.service() para el servlet [jsp] en el contexto con ruta [/test_server] lanzó la excepción [Ha sucedido una excepción al procesar la página JSP [/axis2-web/HappyAxis.jsp] en línea [340]

337:             OMElement payload = createEnvelope();
338:             ConfigurationContext configctx =
339:                     ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
340:             ServiceClient client = new ServiceClient(configctx, null);
341:             EndpointReference targetEPR = new EndpointReference(IP + configctx.getServicePath() + "/Version");
342:             Options options = new Options();
343:             client.setOptions(options);

Stacktrace:] con causa raíz
java.lang.ClassNotFoundException: org.apache.ws.commons.schema.utils.NamespacePrefixList
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1291)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1119)
    at org.apache.axis2.client.ServiceClient.createAnonymousService(ServiceClient.java:264)
    at org.apache.axis2.client.ServiceClient.configureServiceClient(ServiceClient.java:171)
    at org.apache.axis2.client.ServiceClient.<init>(ServiceClient.java:143)
    at org.apache.jsp.axis2_002dweb.HappyAxis_jsp.invokeTheService(HappyAxis_jsp.java:327)
    at org.apache.jsp.axis2_002dweb.HappyAxis_jsp._jspService(HappyAxis_jsp.java:556)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:443)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:385)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:329)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.base/java.lang.Thread.run(Thread.java:844)

[INFO] Clustering has been disabled
[WARN] Unable to instantiate deployer org.apache.axis2.deployment.ServiceDeployer; see debug logs for more details
nov. 13, 2017 9:11:04 P. M. org.apache.catalina.core.ApplicationContext log
GRAVE: 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:149)
    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:1183)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1099)
    at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:779)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:133)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.base/java.lang.Thread.run(Thread.java:844)
Caused by: java.lang.ClassNotFoundException: org.apache.ws.commons.schema.resolver.URIResolver
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1291)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1119)
    ... 31 more

nov. 13, 2017 9:11:04 P. M. org.apache.catalina.core.StandardWrapperValve invoke
GRAVE: Excepción de reserva de espacio para servlet [AxisServlet]
java.lang.ClassNotFoundException: org.apache.ws.commons.schema.resolver.URIResolver
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1291)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1119)
    at org.apache.axis2.deployment.ModuleDeployer.deploy(ModuleDeployer.java:128)
    at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:149)
    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:1183)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1099)
    at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:779)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:133)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.base/java.lang.Thread.run(Thread.java:844)
```

<p>This is my web.xml file:</p>

```<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
  <display-name>test_server</display-name>
  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>default.html</welcome-file>
    <welcome-file>default.htm</welcome-file>
    <welcome-file>default.jsp</welcome-file>
    <welcome-file>/axis2-web/index.jsp</welcome-file>
  </welcome-file-list>
  <servlet>
    <display-name>Apache-Axis Servlet</display-name>
    <servlet-name>AxisServlet</servlet-name>
    <servlet-class>org.apache.axis2.transport.http.AxisServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>AxisServlet</servlet-name>
    <url-pattern>/servlet/AxisServlet</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>AxisServlet</servlet-name>
    <url-pattern>*.jws</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>AxisServlet</servlet-name>
    <url-pattern>/services/*</url-pattern>
  </servlet-mapping>
  <servlet>
    <display-name>Apache-Axis Admin Servlet Web Admin</display-name>
    <servlet-name>AxisAdminServlet</servlet-name>
    <servlet-class>org.apache.axis2.transport.http.AxisAdminServlet</servlet-class>
    <load-on-startup>100</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>AxisAdminServlet</servlet-name>
    <url-pattern>/axis2-admin/*</url-pattern>
  </servlet-mapping>
</web-app>
```

答:
```<code>java.lang.ClassNotFoundException: org.apache.ws.commons.schema.resolver.URIResolver
</code>```

According to error above, you should do one of the following:

Import the jar of the class URIResolver to your project (For example, if you use Maven, then add it as dependency to pom.xml)

Add the jar of the class URIResolver to your classpath.

And align web.xml. It is not valid xml. The last part is commented.

Title: Error list of services Apache-axis

Body:
I'm trying to mount a SOAP server and I'm getting the following error when I click to the service options of the Axis apache. I'm using apache-tomcat-8, axis2-1.7.6 and java 9.

I would like to know what I'm doing wrong. I'm new in java and sorry if the informatión is not enough.

[WARN] Web application uses org.apache.axis2.transport.http.AxisAdminServlet; please update web.xml to use org.apache.axis2.webapp.AxisAdminServlet instead
[WARN] Unable to load manifest for StAX implementation at jrt:/java.xml/
[INFO] Clustering has been disabled
[WARN] Unable to instantiate deployer org.apache.axis2.deployment.ServiceDeployer; see debug logs for more details
nov. 13, 2017 8:59:03 P. M. org.apache.catalina.core.ApplicationContext log
GRAVE: 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:149)
    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:120)
    at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1183)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1099)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:989)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4931)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5241)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    at java.base/java.lang.Thread.run(Thread.java:844)
Caused by: java.lang.ClassNotFoundException: org.apache.ws.commons.schema.resolver.URIResolver
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1291)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1119)
    ... 24 more

nov. 13, 2017 8:59:03 P. M. org.apache.catalina.core.StandardContext loadOnStartup
GRAVE: Servlet [AxisAdminServlet] in web application [/test_server] threw load() exception
java.lang.ClassNotFoundException: org.apache.ws.commons.schema.resolver.URIResolver
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1291)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1119)
    at org.apache.axis2.deployment.ModuleDeployer.deploy(ModuleDeployer.java:128)
    at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:149)
    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:120)
    at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1183)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1099)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:989)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4931)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5241)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    at java.base/java.lang.Thread.run(Thread.java:844)

nov. 13, 2017 8:59:04 P. M. org.apache.coyote.AbstractProtocol start
INFORMACIÓN: Starting ProtocolHandler ["http-nio-8080"]
nov. 13, 2017 8:59:04 P. M. org.apache.coyote.AbstractProtocol start
INFORMACIÓN: Starting ProtocolHandler ["ajp-nio-8009"]
nov. 13, 2017 8:59:04 P. M. org.apache.catalina.startup.Catalina start
INFORMACIÓN: Server startup in 10198 ms
[INFO] Clustering has been disabled
[WARN] Unable to instantiate deployer org.apache.axis2.deployment.ServiceDeployer; see debug logs for more details
nov. 13, 2017 8:59:48 P. M. org.apache.catalina.core.ApplicationContext log
GRAVE: 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:149)
    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:1183)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1099)
    at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:779)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:133)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.base/java.lang.Thread.run(Thread.java:844)
Caused by: java.lang.ClassNotFoundException: org.apache.ws.commons.schema.resolver.URIResolver
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1291)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1119)
    ... 31 more

nov. 13, 2017 8:59:48 P. M. org.apache.catalina.core.StandardWrapperValve invoke
GRAVE: Excepción de reserva de espacio para servlet [AxisServlet]
java.lang.ClassNotFoundException: org.apache.ws.commons.schema.resolver.URIResolver
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1291)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1119)
    at org.apache.axis2.deployment.ModuleDeployer.deploy(ModuleDeployer.java:128)
    at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:149)
    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:1183)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1099)
    at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:779)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:133)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.base/java.lang.Thread.run(Thread.java:844)

[WARN] Unable to instantiate deployer org.apache.axis2.deployment.ServiceDeployer; see debug logs for more details
nov. 13, 2017 9:08:15 P. M. org.apache.catalina.core.StandardWrapperValve invoke
GRAVE: El Servlet.service() para el servlet [jsp] en el contexto con ruta [/test_server] lanzó la excepción [Ha sucedido una excepción al procesar la página JSP [/axis2-web/HappyAxis.jsp] en línea [340]

337:             OMElement payload = createEnvelope();
338:             ConfigurationContext configctx =
339:                     ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
340:             ServiceClient client = new ServiceClient(configctx, null);
341:             EndpointReference targetEPR = new EndpointReference(IP + configctx.getServicePath() + "/Version");
342:             Options options = new Options();
343:             client.setOptions(options);

Stacktrace:] con causa raíz
java.lang.ClassNotFoundException: org.apache.ws.commons.schema.utils.NamespacePrefixList
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1291)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1119)
    at org.apache.axis2.client.ServiceClient.createAnonymousService(ServiceClient.java:264)
    at org.apache.axis2.client.ServiceClient.configureServiceClient(ServiceClient.java:171)
    at org.apache.axis2.client.ServiceClient.<init>(ServiceClient.java:143)
    at org.apache.jsp.axis2_002dweb.HappyAxis_jsp.invokeTheService(HappyAxis_jsp.java:327)
    at org.apache.jsp.axis2_002dweb.HappyAxis_jsp._jspService(HappyAxis_jsp.java:556)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:443)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:385)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:329)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.base/java.lang.Thread.run(Thread.java:844)

[INFO] Clustering has been disabled
[WARN] Unable to instantiate deployer org.apache.axis2.deployment.ServiceDeployer; see debug logs for more details
nov. 13, 2017 9:11:04 P. M. org.apache.catalina.core.ApplicationContext log
GRAVE: 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:149)
    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:1183)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1099)
    at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:779)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:133)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.base/java.lang.Thread.run(Thread.java:844)
Caused by: java.lang.ClassNotFoundException: org.apache.ws.commons.schema.resolver.URIResolver
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1291)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1119)
    ... 31 more

nov. 13, 2017 9:11:04 P. M. org.apache.catalina.core.StandardWrapperValve invoke
GRAVE: Excepción de reserva de espacio para servlet [AxisServlet]
java.lang.ClassNotFoundException: org.apache.ws.commons.schema.resolver.URIResolver
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1291)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1119)
    at org.apache.axis2.deployment.ModuleDeployer.deploy(ModuleDeployer.java:128)
    at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:149)
    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:1183)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1099)
    at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:779)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:133)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.base/java.lang.Thread.run(Thread.java:844)

This is my web.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
  <display-name>test_server</display-name>
  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>default.html</welcome-file>
    <welcome-file>default.htm</welcome-file>
    <welcome-file>default.jsp</welcome-file>
    <welcome-file>/axis2-web/index.jsp</welcome-file>
  </welcome-file-list>
  <servlet>
    <display-name>Apache-Axis Servlet</display-name>
    <servlet-name>AxisServlet</servlet-name>
    <servlet-class>org.apache.axis2.transport.http.AxisServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>AxisServlet</servlet-name>
    <url-pattern>/servlet/AxisServlet</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>AxisServlet</servlet-name>
    <url-pattern>*.jws</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>AxisServlet</servlet-name>
    <url-pattern>/services/*</url-pattern>
  </servlet-mapping>
  <servlet>
    <display-name>Apache-Axis Admin Servlet Web Admin</display-name>
    <servlet-name>AxisAdminServlet</servlet-name>
    <servlet-class>org.apache.axis2.transport.http.AxisAdminServlet</servlet-class>
    <load-on-startup>100</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>AxisAdminServlet</servlet-name>
    <url-pattern>/axis2-admin/*</url-pattern>
  </servlet-mapping>
</web-app>

Body:
java.lang.ClassNotFoundException: org.apache.ws.commons.schema.resolver.URIResolver

According to error above, you should do one of the following:

Import the jar of the class URIResolver to your project (For example, if you use Maven, then add it as dependency to pom.xml)

Add the jar of the class URIResolver to your classpath.

And align web.xml. It is not valid xml. The last part is commented.


来源: stackexchange

问:
Bug in Visual Studio 2015 on Debug Source Files tab?
Looking in other places on the web, it looks like the "Debug Source Files" tab is supposed to give a list of source files that are being ignored by Visual Studio.  However in my Visual Studio 2015 community edition, this is what I see for that tab:

This is exactly the same as appears for the "Configuration" tab making me think this is a bug in Visual Studio 2015.  Does anyone else get this?

答: Looks like it was a bug in the first version of Visual Studio 2015.  I upgraded to Update 3, and now the dialog shows correctly:

ContentLicense: CC BY-SA 3.0


问:
I want to read spring properties file that has a map of maps
I want to have a property like below that is a map of maps

```<code>propertymap = {
    key1:'{subkey1:'subvalue1',subkey2:'subvalue2'}',
    key2:'{subkey3:'subvalue3',subkey4:'subvalue4'}' }

@Value("#{${propertymap}}")
private Map<String,Map<String,String>> propertymap;
</code>```

used code like above in my config class but got error. please let me know if there is a way to do this.

```<code>Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private java.util.Map  nested exception is org.springframework.beans.factory.BeanExpressionException: Expression parsing failed; nested exception is org.springframework.expression.spel.SpelParseException: EL1043E:(pos 17): Unexpected token. Expected 'rcurly(})' but was 'identifier'
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:573)
    at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331)
</code>```

答:
I found the way, I had to just remove the ' after the key

```<code>propertymap = {
   key1:{
      subkey1:'subvalue1',
      subkey2:'subvalue2'
   },
   key2:{
      subkey3:'subvalue3',
      subkey4:'subvalue4'
   }
}
</code>```

and below code picks it up

```<code>@Value("#{${propertymap}}")
private Map<String,Map<String,String>> propertymap;
</code>```

Body:
I want to have a property like below that is a map of maps

propertymap = {
    key1:'{subkey1:'subvalue1',subkey2:'subvalue2'}',
    key2:'{subkey3:'subvalue3',subkey4:'subvalue4'}' }

@Value("#{${propertymap}}")
private Map<String,Map<String,String>> propertymap;

used code like above in my config class but got error. please let me know if there is a way to do this.

Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private java.util.Map  nested exception is org.springframework.beans.factory.BeanExpressionException: Expression parsing failed; nested exception is org.springframework.expression.spel.SpelParseException: EL1043E:(pos 17): Unexpected token. Expected 'rcurly(})' but was 'identifier'
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:573)
    at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331)

Body:
I found the way, I had to just remove the ' after the key

propertymap = {
   key1:{
      subkey1:'subvalue1',
      subkey2:'subvalue2'
   },
   key2:{
      subkey3:'subvalue3',
      subkey4:'subvalue4'
   }
}

and below code picks it up

@Value("#{${propertymap}}")
private Map<String,Map<String,String>> propertymap;


问:
gmail api error in apps scripting + Insufficient permissions error code 403 domain global
I have the Gmail API enabled and looked up all questions on stackoverflow to make sure I am not missing anything. Even after conforming all the options for the gmail API, I am getting the following error:

```<code>{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "insufficientPermissions",
    "message": "Insufficient Permission"
   }
  ],
  "code": 403,
  "message": "Insufficient Permission"
 }
}
</code>```

I am out of options and would like to understand where I am going wrong.

```<code>    var body = "<html><body>"
      + "<p>" + "Hi Team," + "<br/><br/>"
      + "<p>" + "Can you please review the bid for the following opportunity:" + "<br/>"
      + "<p>" + "<u><b>Opportunity Details: </b></u>"+ "<br/>"
      + "</body></html>";

      Logger.log(body);
      var con = ContactsApp.getContactsByGroup(ContactsApp.getContactGroup('Australia'));
      var toList = [];
      for (var i in con) {
        toList[i] = "<" + con[i].getPrimaryEmail() + ">";
      }
      toList = toList.join(',');

      var msg = {
        to: toList,
        from: {
          name: ContactsApp.getContact(Session.getEffectiveUser().getEmail()).getFullName(),
          email: Session.getEffectiveUser().getEmail(),
          signature: Gmail.Users.Settings.SendAs.list("me").sendAs[0].signature
        },
        body: body,
        subject: sub
      };

      //  var htmlBody = '<p>Hello, I am an HTML message</p><br/>' + '<a href="---------------">Click here</a>';
      //  var signature = Gmail.Users.Settings.SendAs.list("me").sendAs[0].signature    ;    //sendAs.filter(function(account){if(account.isDefault){return true}})[0].signature;

      var raw = 'From: <' + msg.from.email + '>\r\n' +
        'To: ' + msg.to + '\r\n' +
          'Subject:' + msg.subject + '\r\n' +
            'Content-Type: text/html; charset=UTF-8\r\n' +
              '\r\n' + msg.body + msg.from.signature;

      var draftBody = Utilities.base64Encode(raw, Utilities.Charset.UTF_8).replace(/\//g,'_').replace(/\+/g,'-');

      var params = {
        method      : "post",
        contentType : "application/json",
        headers     : {"Authorization": "Bearer " + ScriptApp.getOAuthToken()},
        devMode     : true,
        muteHttpExceptions:true,
        payload:JSON.stringify({
          "message": {
            "raw": draftBody
          }
        })
      };

      var resp = UrlFetchApp.fetch("https://www.googleapis.com/gmail/v1/users/me/drafts", params);
      Logger.log(resp);
      Logger.log(resp.getContentText());
</code>```

答:
I solved this problem by manually modifying the manifest file in the Google Scripts interface.

If you look under File > Project Properties > Scopes, you will find there are certain scopes for which the app is already requesting an authorization. You can manually add to these scopes by changing the json manifest file, under View > Show manifest file to add the ones in your Project Properties + the one you need for Gmail API, in my case, "https://www.googleapis.com/auth/gmail.compose".

Hope it helps.

Body:
I have the Gmail API enabled and looked up all questions on stackoverflow to make sure I am not missing anything. Even after conforming all the options for the gmail API, I am getting the following error:

{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "insufficientPermissions",
    "message": "Insufficient Permission"
   }
  ],
  "code": 403,
  "message": "Insufficient Permission"
 }
}

I am out of options and would like to understand where I am going wrong.

    var body = ""
      + "
" + "Hi Team," + "

"
      + "
" + "Can you please review the bid for the following opportunity:" + "
"
      + "
" + "Opportunity Details: "+ "
"
      + "";

      Logger.log(body);
      var con = ContactsApp.getContactsByGroup(ContactsApp.getContactGroup('Australia'));
      var toList = [];
      for (var i in con) {
        toList[i] = "<" + con[i].getPrimaryEmail() + ">";
      }
      toList = toList.join(',');

      var msg = {
        to: toList,
        from: {
          name: ContactsApp.getContact(Session.getEffectiveUser().getEmail()).getFullName(),
          email: Session.getEffectiveUser().getEmail(),
          signature: Gmail.Users.Settings.SendAs.list("me").sendAs[0].signature
        },
        body: body,
        subject: sub
      };

      //  var htmlBody = '
Hello, I am an HTML message

' + 'Click here';
      //  var signature = Gmail.Users.Settings.SendAs.list("me").sendAs[0].signature    ;    //sendAs.filter(function(account){if(account.isDefault){return true}})[0].signature;

      var raw = 'From: <' + msg.from.email + '>\r\n' +
        'To: ' + msg.to + '\r\n' +
          'Subject:' + msg.subject + '\r\n' +
            'Content-Type: text/html; charset=UTF-8\r\n' +
              '\r\n' + msg.body + msg.from.signature;

      var draftBody = Utilities.base64Encode(raw, Utilities.Charset.UTF_8).replace(/\//g,'_').replace(/\+/g,'-');

      var params = {
        method      : "post",
        contentType : "application/json",
        headers     : {"Authorization": "Bearer " + ScriptApp.getOAuthToken()},
        devMode     : true,
        muteHttpExceptions:true,
        payload:JSON.stringify({
          "message": {
            "raw": draftBody
          }
        })
      };

      var resp = UrlFetchApp.fetch("https://www.googleapis.com/gmail/v1/users/me/drafts", params);
      Logger.log(resp);
      Logger.log(resp.getContentText());


问:
Best practices for configuration and property files with artifactory / maven
We've got a lot of java property files as well as JBoss configuration files that need to be deployed with our app.  Currently, we've got a maven build that puts all of the .jar and .war files into artifactory, but NOT the .property files or JBoss configurations.  Is there a best practice for storing these in artifactory?  If they should not be stored there, where should they be stored so they can be easily deployed with the binaries?</p>

答:
There is no best practice, both solutions are fine. In practice usually it depends on the deployment tools in use, your application architecture (e.g. are config files shared across components? etc.), the number of environments, the need for encryption of config files but also your release cycles (do you need to repackage for every configuration change?) etc.

For example if using ansible the default setup is to store configuration and deployment instructions in a VCS. Which mean all what remains into Artifactory in that case are the binaries.


问:
Implement an asynchronous tcp connection with a timeout
I am getting an exception:

```<code>"An unhandled exception of type 'System.NotSupportedException' occurred in
 System.dll

 Additional information: This protocol version is not supported."
</code>```

when I run the following code. I am trying to implement an asynchronous tcp connection with a timeout.

I've seen and read several stack overflow examples, some using TcpClient and some using Socket. I assume the former wraps up the latter and is newer. I am trying with TcpClient.BeginConnect

The documentation does not list NotSupported as one of the exception types this method can throw. How do I track down what the problem is?

```<code>public class Client
{
    private string m_host;
    private uint m_port;
    private uint m_timeoutMilliseconds;
    private TcpClient m_client;

    public Client(string host, uint port, uint timeoutMilliseconds)
    {
        m_host = host;
        m_port = port;
        m_timeoutMilliseconds = timeoutMilliseconds;
        m_client = new TcpClient();
    }

    public bool Connect()
    {
        IPHostEntry hostInfo = Dns.GetHostEntry(m_host);
        IPAddress ipAddress = hostInfo.AddressList[0];
        IPEndPoint endpoint = new IPEndPoint(ipAddress, (int)m_port);

        IAsyncResult result = m_client.BeginConnect(ipAddress, (int)m_port, new AsyncCallback(OnConnect), m_client);
        result.AsyncWaitHandle.WaitOne((int)m_timeoutMilliseconds, true);

        // SNIP

        return true;
    }

    public void Disconnect()
    {
        throw new NotImplementedException();
    }

    public void MakeRequest(string symbol)
    {
        throw new NotImplementedException();
    }

    private static void OnConnect(IAsyncResult asyncResult)
    {
        Socket socket = (Socket)asyncResult.AsyncState;
        socket.EndConnect(asyncResult);

        Console.WriteLine("Socket connected to {0}"
                        , socket.RemoteEndPoint.ToString());

    }
}

class Program
{
    static void Main(string[] args)
    {
        Client client = new Integration.Client("127.0.0.1", 24001, 360000);
        client.Connect();
    }
}
</code>```

答:
By default, TcpClient assumes you're using an IPv4 address. There's a constructor overload that lets you specify which address family to use though, but this would mean constructing it after you've done the dns lookup:

```<code>m_client = new TcpClient(ipAddress.AddressFamily);
IAsyncResult result = m_client.BeginConnect(ipAddress, (int)m_port, new AsyncCallback(OnConnect), m_client);
</code>```

Alternatively you could find the IPv4 address in the hostInfo.AddressList and connect to that - that's what the BeginConnect(string host, ...) overload does for you under the hood (unless you have specified IPv6 in the constructor).

I have no idea why they didn't just take the AddressFamily from the IPAddress you're passing, perhaps because the underlying Socket is created in the TcpClient constructor. I was also suprised to see the following in the reference source page of TcpClient:

```<code>//
// IPv6: Maintain address family for the client
//
AddressFamily m_Family = AddressFamily.InterNetwork;
</code>```

I don't understand that comment, but apparently someone did have IPv6 in mind when choosing the default.

Body:
I am getting an exception:

"An unhandled exception of type 'System.NotSupportedException' occurred in
 System.dll

 Additional information: This protocol version is not supported."

when I run the following code. I am trying to implement an asynchronous tcp connection with a timeout.

I've seen and read several stack overflow examples, some using TcpClient and some using Socket. I assume the former wraps up the latter and is newer. I am trying with TcpClient.BeginConnect

The documentation does not list NotSupported as one of the exception types this method can throw. How do I track down what the problem is?

public class Client
{
    private string m_host;
    private uint m_port;
    private uint m_timeoutMilliseconds;
    private TcpClient m_client;

    public Client(string host, uint port, uint timeoutMilliseconds)
    {
        m_host = host;
        m_port = port;
        m_timeoutMilliseconds = timeoutMilliseconds;
        m_client = new TcpClient();
    }

    public bool Connect()
    {
        IPHostEntry hostInfo = Dns.GetHostEntry(m_host);
        IPAddress ipAddress = hostInfo.AddressList[0];
        IPEndPoint endpoint = new IPEndPoint(ipAddress, (int)m_port);

        IAsyncResult result = m_client.BeginConnect(ipAddress, (int)m_port, new AsyncCallback(OnConnect), m_client);
        result.AsyncWaitHandle.WaitOne((int)m_timeoutMilliseconds, true);

        // SNIP

        return true;
    }

    public void Disconnect()
    {
        throw new NotImplementedException();
    }

    public void MakeRequest(string symbol)
    {
        throw new NotImplementedException();
    }

    private static void OnConnect(IAsyncResult asyncResult)
    {
        Socket socket = (Socket)asyncResult.AsyncState;
        socket.EndConnect(asyncResult);

        Console.WriteLine("Socket connected to {0}"
                        , socket.RemoteEndPoint.ToString());

    }
}

class Program
{
    static void Main(string[] args)
    {
        Client client = new Integration.Client("127.0.0.1", 24001, 360000);
        client.Connect();
    }
}

Body:
By default, TcpClient assumes you're using an IPv4 address. There's a constructor overload that lets you specify which address family to use though, but this would mean constructing it after you've done the dns lookup:

m_client = new TcpClient(ipAddress.AddressFamily);
IAsyncResult result = m_client.BeginConnect(ipAddress, (int)m_port, new AsyncCallback(OnConnect), m_client);

Alternatively you could find the IPv4 address in the hostInfo.AddressList and connect to that - that's what the BeginConnect(string host, ...) overload does for you under the hood (unless you have specified IPv6 in the constructor).

I have no idea why they didn't just take the AddressFamily from the IPAddress you're passing, perhaps because the underlying Socket is created in the TcpClient constructor. I was also suprised to see the following in the reference source page of TcpClient:

//
// IPv6: Maintain address family for the client
//
AddressFamily m_Family = AddressFamily.InterNetwork;

I don't understand that comment, but apparently someone did have IPv6 in mind when choosing the default.


问:
Sigabrt on Main function
I've just began to learn iOS development and now I have a sigabrt on my main function. The error is triggered by calling:

```<code>    int retVal = UIApplicationMain(argc, argv, nil, nil);
</code>```

As I am very new to iOS programming I have no idea on what could by causing this error. One thing that I have found on my callstack is the following exception being raised: dyld_stub_objc_exception_throw
What could be causing this error?

答:
It was just a typical error of someone learning a new language/API. I forgot to properly set up the view.</p>

```<code>UIView *controllersView = [myViewController view];
[window addSubview:controllersView];
</code>```

Title: Sigabrt on Main function

Body:
I've just began to learn iOS development and now I have a sigabrt on my main function. The error is triggered by calling:

    int retVal = UIApplicationMain(argc, argv, nil, nil);

As I am very new to iOS programming I have no idea on what could by causing this error. One thing that I have found on my callstack is the following exception being raised: dyld_stub_objc_exception_throw
What could be causing this error?

Body:
It was just a typical error of someone learning a new language/API. I forgot to properly set up the view.

UIView *controllersView = [myViewController view];
[window addSubview:controllersView];

ContentLicense: CC BY-SA 2.5


问:
Update Model Instance via Django REST POST
I've got a model "Assignment" that I want to be able to update through the api.

Updated per comments

urls.py

```<code>router = routers.DefaultRouter()
router.register(r'assignments', views.AssignmentList, base_name='Assignments')

urlpatterns = [
    url(r'^api/v1/', include(router.urls)),
    url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')),
]
</code>```

serializers.py

```<code>class AssignmentSerializer(serializers.ModelSerializer):
class Meta:
    model = Assignment
    fields = (
        'id', 'company', 'farm', 'sensor', 'name', 'location', 'notes', 'units', 'max_height', 'frequency',
        'interval', 'max_threshold', 'min_threshold', 'notify', 'last_alert_time', 'last_alert_water_level')
</code>```

views.py

```<code>class AssignmentList(viewsets.ModelViewSet):
serializer_class = AssignmentSerializer
pagination_class = None

def get_queryset(self):
    queryset = Assignment.objects.all()
    company_id = self.request.query_params.get('company_id', None)
    sensor_id = self.request.query_params.get('sensor_id', None)
    if company_id is not None:
        queryset = Assignment.objects.filter(company_id=company_id)
    if sensor_id is not None:
        queryset = Assignment.objects.filter(sensor_id=sensor_id)
    return queryset
</code>```

Currently my view allows for easy filtering based on two of the fields, 'company_id' and 'sensor_id'. This allows for easy access of the data in json. Unfortunately I can't figure out how to POST back even with the built in API form. I would like to be able to filter down to a single instance and edit a single field, let's say "assignment.name" for now.

It's my understanding that...

The actions provided by the ModelViewSet class are .list(), .retrieve(), .create(), .update(), .partial_update(), and .destroy(). (DRF Docs)

So what do I need to do to leverage them to edit a model instance via url? Or honestly just edit one period. I've been running in circles trying different Mixins, views (UpdateAPIView, RetrieveUpdateAPIView etc.) and this question in particular Stack Overflow: Django Rest Framework update field.

答:
Why you're lacking the required foreign key fields is entirely the question.

The reason is that presumably your fields are called company, farm and sensor, not company_id etc. Because the underlying database fields are called company_id and so on, DRF detects them as read-only properties on the model and so allows you to specify those names in the fields tuple without showing an error, but doesn't display the field in the browsable API. Change the fields tuple to include the actual names of the Django fields.

Note also that since you're using HyperlinkedModelSerializer, DRF it expects a linked ViewSet for those related models. If you don't have those defined, chnage it to a basic ModelSerializer.

Body:
I've got a model "Assignment" that I want to be able to update through the api.

Updated per comments

urls.py

router = routers.DefaultRouter()
router.register(r'assignments', views.AssignmentList, base_name='Assignments')

urlpatterns = [
    url(r'^api/v1/', include(router.urls)),
    url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')),
]

serializers.py

class AssignmentSerializer(serializers.ModelSerializer):
class Meta:
    model = Assignment
    fields = (
        'id', 'company', 'farm', 'sensor', 'name', 'location', 'notes', 'units', 'max_height', 'frequency',
        'interval', 'max_threshold', 'min_threshold', 'notify', 'last_alert_time', 'last_alert_water_level')

views.py

class AssignmentList(viewsets.ModelViewSet):
serializer_class = AssignmentSerializer
pagination_class = None

def get_queryset(self):
    queryset = Assignment.objects.all()
    company_id = self.request.query_params.get('company_id', None)
    sensor_id = self.request.query_params.get('sensor_id', None)
    if company_id is not None:
        queryset = Assignment.objects.filter(company_id=company_id)
    if sensor_id is not None:
        queryset = Assignment.objects.filter(sensor_id=sensor_id)
    return queryset

Currently my view allows for easy filtering based on two of the fields, 'company_id' and 'sensor_id'. This allows for easy access of the data in json. Unfortunately I can't figure out how to POST back even with the built in API form. I would like to be able to filter down to a single instance and edit a single field, let's say "assignment.name" for now.

It's my understanding that...

The actions provided by the ModelViewSet class are .list(), .retrieve(), .create(), .update(), .partial_update(), and .destroy(). (DRF Docs)

So what do I need to do to leverage them to edit a model instance via url? Or honestly just edit one period. I've been running in circles trying different Mixins, views (UpdateAPIView, RetrieveUpdateAPIView etc.) and this question in particular Stack Overflow: Django Rest Framework update field.


问:
Convert firebase json to typescript array
I can easily get the data working in my HTML, but when I have to convert it for visualization purposes it is a struggle.

I get the data as a FirebaseListObservable. In my case there's 3 value-types in each List, but it is only one of them there has to be part of the array. How do I convert a FirebaseListObservable to an array in typescript?

The reason of converting is to use graphs in my app.

Typescript getting the data:

```<code>this.measure= this.db.list('/Users/'+this.username+'/Measure');
enter code here
</code>```

Typescript for chartjs

```<code>this.data = [12, 24, 91, 23]
</code>```

The data has to be the data from the firebase

答:
Declare a empty array data=[];

then get the data with .subscribe()

```<code>this.db.list('/Users/'+this.username+'/Measure').subscribe(measures => {
    measures.forEach(measure => {
      this.data.push(measure.number);//.number should be your field in firebase
    })
  })
</code>```

this will fetch all list and search through all items and push your desired values to the array.

Body:
I can easily get the data working in my HTML, but when I have to convert it for visualization purposes it is a struggle.

I get the data as a FirebaseListObservable. In my case there's 3 value-types in each List, but it is only one of them there has to be part of the array. How do I convert a FirebaseListObservable to an array in typescript?

The reason of converting is to use graphs in my app.

Typescript getting the data:

this.measure= this.db.list('/Users/'+this.username+'/Measure');
enter code here

Typescript for chartjs

this.data = [12, 24, 91, 23]

The data has to be the data from the firebase

Body:
Declare a empty array data=[];

then get the data with .subscribe()

this.db.list('/Users/'+this.username+'/Measure').subscribe(measures => {
    measures.forEach(measure => {
      this.data.push(measure.number);//.number should be your field in firebase
    })
  })

this will fetch all list and search through all items and push your desired values to the array.


问:
ObjectNotFound Error while using cmdlet to access AWS IAM
I am trying to generate AWS API gateway access key through powershell. However, everytime I try to use any cmdlet it throws an error:

For example:

```<code> Get-AWSCredential -ListProfileDetail
</code>```

will result in an error like this:

Get-AWSCredential : The term 'Get-AWSCredential' is not recognized as
  the name of a cmdlet, function, script file, or operable program.
  Check the spelling of the name, or if a path was included, verify that
  the path is correct and try again. At line:1 char:1
  + Get-AWSCredential -ListProfileDetail
  + ~~~~~~~~~~~~~~~~~
      + CategoryInfo          : ObjectNotFound: (Get-AWSCredential:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException

When I display the list of commands through Get-Command the AWS cmdlets do not pop up.
Any idea what could be the problem?

答:
Long story short, run this: Install-Package -Name AWSPowerShell

You may need to run PS as an Administrator for the Install-Package command to work. Additionally, you may be prompted to install 'nuget', answer yes. If you receive the security warning about PSGallery, answer yes.

Here is Amazon's docs on PS cmdlets: http://docs.aws.amazon.com/powershell/latest/userguide/pstools-getting-set-up.html

Body:
I am trying to generate AWS API gateway access key through powershell. However, everytime I try to use any cmdlet it throws an error:

For example:

 Get-AWSCredential -ListProfileDetail

will result in an error like this:

Get-AWSCredential : The term 'Get-AWSCredential' is not recognized as
  the name of a cmdlet, function, script file, or operable program.
  Check the spelling of the name, or if a path was included, verify that
  the path is correct and try again. At line:1 char:1
  + Get-AWSCredential -ListProfileDetail
  + ~~~~~~~~~~~~~~~~~
      + CategoryInfo          : ObjectNotFound: (Get-AWSCredential:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException

When I display the list of commands through Get-Command the AWS cmdlets do not pop up.
Any idea what could be the problem?


问:
Immutable.js: Data structure to represent 2D game field
I'm wondering What data structure should I use to represent a square game board(consider each cell can have some color). The most natural idea is a two dimensional List, but it's hard to query and change it.

So, now use a Map where keys are ${x}.${y}(there is no tuples in JS:() and values are stings which represent colors
Something like this:

```<code>Map([['0.0', 'red'], ['0.1', 'red'], ['1.0', 'blue'], ['1.1', 'red']])
</code>```

Is it ok to use such data structure? Is there any better solution in terms of Immutable.js?

答:
I'm curious why you think a List of Lists is hard to query and change. You can use arrays of length 2 as an [x, y] pair, and pass this to the getIn, setIn, and updateIn methods.

```<code>let grid = Immutable.toJS([
    ['red', 'green'],
    ['blue', 'yellow']
]);

grid.getIn([0, 1]); // => 'green';
grid = grid.setIn([0, 1], 'purple');
grid.getIn([0, 1]); // => 'purple';
grid = grid.updateIn([0, 0], cell => cell.toUpperCase());
grid.getIn([0, 0]); // => 'RED';
</code>```

It's easy to apply some function to every cell in the grid with map(...):

```<code>grid.map((row, x) => row.map(cell, y) => x + cell + y);
grid.get([1, 1]); // => '1yellow1'
</code>```

One thing that might be trickier than with a Map is trying to find the coordinates of a value.

```<code>const x = grid.findIndex(row => row.contains('blue')); // => 1
const y = grid.get(x).indexOf('blue'); // => 0
grid.get([x, y]); // => blue
</code>```

Body:
I'm wondering What data structure should I use to represent a square game board(consider each cell can have some color). The most natural idea is a two dimensional List, but it's hard to query and change it.

So, now use a Map where keys are ${x}.${y}(there is no tuples in JS:() and values are stings which represent colors
Something like this:

Map([['0.0', 'red'], ['0.1', 'red'], ['1.0', 'blue'], ['1.1', 'red']])

Is it ok to use such data structure? Is there any better solution in terms of Immutable.js?

Body:
I'm curious why you think a List of Lists is hard to query and change. You can use arrays of length 2 as an [x, y] pair, and pass this to the getIn, setIn, and updateIn methods.

let grid = Immutable.toJS([
    ['red', 'green'],
    ['blue', 'yellow']
]);

grid.getIn([0, 1]); // => 'green';
grid = grid.setIn([0, 1], 'purple');
grid.getIn([0, 1]); // => 'purple';
grid = grid.updateIn([0, 0], cell => cell.toUpperCase());
grid.getIn([0, 0]); // => 'RED';

It's easy to apply some function to every cell in the grid with map(...):

grid.map((row, x) => row.map(cell, y) => x + cell + y);
grid.get([1, 1]); // => '1yellow1'

One thing that might be trickier than with a Map is trying to find the coordinates of a value.

const x = grid.findIndex(row => row.contains('blue')); // => 1
const y = grid.get(x).indexOf('blue'); // => 0
grid.get([x, y]); // => blue


问:
How to Generate Controller in Symfony 3.0?
Hope you are all fine, I am a beginner trying to learn Symfony 3.0, so I want to generate my controller in a folder called Bundles, but it is not created, here is the command I taped :

```<code>php bin/console generate:controller
</code>```

And this is fine, when I tape the controller name, that was what I wrote :

```<code>?[32mController name?[39m: Bundles/FrontBundle
</code>```

But their answer is :

```<code>?[37;41m The controller name must contain a : ("Bundles/FrontBundle"
given, expecting something like AcmeBlogBundle:Post) ?[39;49m
</code>```

I don't know if I have to do something before this to noy have such error.
Any Help would be much appreciated.

答: This is because controller name should be a combination of BundleName:ControllerName and you have provided a relative path to your bundle. If that doesn't work make sure you have your autloading properly setup and Symfony knows about your bundle

Body:
Hope you are all fine, I am a beginner trying to learn Symfony 3.0, so I want to generate my controller in a folder called Bundles, but it is not created, here is the command I taped :

php bin/console generate:controller

And this is fine, when I tape the controller name, that was what I wrote :

?[32mController name?[39m: Bundles/FrontBundle

But their answer is :

?[37;41m The controller name must contain a : ("Bundles/FrontBundle"
given, expecting something like AcmeBlogBundle:Post) ?[39;49m

I don't know if I have to do something before this to noy have such error.
Any Help would be much appreciated.


问:
Combining regexes using a loop in Perl 6
Here I make a regex manually from Regex elements of an array.

my Regex @reg =
  / foo /,
  / bar /,
  / baz /,
  / pun /
  ;

my $r0 = @reg[0];
my $r1 = @reg[1];

my Regex $r = / 0 $r0 | 1 $r1 /;

"0foo_1barz" ~~ m:g/<$r>/;
say $/;  # (｢0foo｣ ｢1bar｣)
```

How to do it with for @reg {...}?

答:
If a variable contains a regex, you can use it without further ado inside another regex.

The second trick is to use an array variable inside a regex, which is equivalent to the disjunction of the array elements:

```<code>my @reg =
  /foo/,
  /bar/,
  /baz/,
  /pun/
  ;

my @transformed = @reg.kv.map(-> $i, $rx { rx/ $i $rx /});

my @match =  "0foo_1barz" ~~ m:g/ @transformed /;

.say for @match;
</code>```

Body:
Here I make a regex manually from Regex elements of an array.

my Regex @reg =
  / foo /,
  / bar /,
  / baz /,
  / pun /
  ;

my $r0 = @reg[0];
my $r1 = @reg[1];

my Regex $r = / 0 $r0 | 1 $r1 /;

"0foo_1barz" ~~ m:g/<$r>/;
say $/;  # (｢0foo｣ ｢1bar｣)

How to do it with for @reg {...}?

Body:
If a variable contains a regex, you can use it without further ado inside another regex.

The second trick is to use an array variable inside a regex, which is equivalent to the disjunction of the array elements:

my @reg =
  /foo/,
  /bar/,
  /baz/,
  /pun/
  ;

my @transformed = @reg.kv.map(-> $i, $rx { rx/ $i $rx /});

my @match =  "0foo_1barz" ~~ m:g/ @transformed /;

.say for @match;


问:
Why do I get the error java.lang.IllegalStateException: instance not initialized?
I get the error

java.lang.IllegalStateException: instance not initialized

you can test it at https://www.dropbox.com/s/gxeok1fyttsl54u/MyMirror.zip?dl=0

It seems that the code operator fun getValue(thisRef: Any?, property: KProperty<*>)... in UIApp causes the error.

But the code is from a sample code, I hardly don't change, you can see source code at https://github.com/antoniolg/Kotlin-for-Android-Developers/blob/master/app/src/main/java/com/antonioleiva/weatherapp/ui/App.kt

and

https://github.com/antoniolg/Kotlin-for-Android-Developers/blob/master/app/src/main/java/com/antonioleiva/weatherapp/extensions/DelegatesExtensions.kt

Why?

```<code>java.lang.RuntimeException: Unable to start activity ComponentInfo{info.dodata.mirror/ui.UIMain}: java.lang.IllegalStateException: instance not initialized
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2107)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2132)
at android.app.ActivityThread.access$700(ActivityThread.java:140)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1238)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4918)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:994)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:761)
at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.IllegalStateException: instance not initialized
at ui.UIApp$NotNullSingleValueVar.getValue(UIApp.kt:23)
at ui.UIApp$Companion.getInstance(UIApp.kt)
at dal.DBSettingHelper.<init>(DBSettingHelper.kt:9)
at ui.UIMain.onCreate(UIMain.kt:14)
at android.app.Activity.performCreate(Activity.java:5185)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2071)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2132)?
at android.app.ActivityThread.access$700(ActivityThread.java:140)?
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1238)?
at android.os.Handler.dispatchMessage(Handler.java:99)?
at android.os.Looper.loop(Looper.java:137)?
at android.app.ActivityThread.main(ActivityThread.java:4918)?
at java.lang.reflect.Method.invokeNative(Native Method)?
at java.lang.reflect.Method.invoke(Method.java:511)?
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:994)?
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:761)?
at dalvik.system.NativeStart.main(Native Method)?
</code>```

UIMain

```<code>package ui
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import dal.DBSettingHelper
import info.dodata.mirror.R

class UIMain : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.layout_main)
        var ss= DBSettingHelper();
    }

}
</code>```

DBSettingHelper

```<code>package dal

import android.content.Context
import android.database.sqlite.SQLiteDatabase
import org.jetbrains.anko.db.*
import ui.UIApp

object DBSettingTable {
    val TableNAME = "SettingTable"

    val _ID = "_id"
    val Name = "name"
    val CreatedDate = "createdDate"
    val Description="description"
}

class DBSettingHelper(mContext: Context = UIApp.instance) : ManagedSQLiteOpenHelper(
        mContext,
        DB_NAME,
        null,
        DB_VERSION) {

    companion object {
        val DB_NAME = "setting.db"
        val DB_VERSION = 1
        val instance by lazy { DBSettingHelper() }
    }

    override fun onCreate(db: SQLiteDatabase) {
        db.createTable( DBSettingTable.TableNAME , true,
                DBSettingTable._ID to INTEGER + PRIMARY_KEY,
                DBSettingTable.Name to TEXT,
                DBSettingTable.CreatedDate to INTEGER,
                DBSettingTable.Description to TEXT
        )
    }

    override fun onUpgrade(db: SQLiteDatabase, oldVersion: Int, newVersion: Int) {
        db.dropTable(DBSettingTable.TableNAME, true)
        onCreate(db)
    }

}
</code>```

UIApp

```<code>package ui

import android.app.Application
import kotlin.reflect.KProperty

class UIApp : Application() {

    companion object {
        var instance: UIApp by NotNullSingleValueVar()
    }

    override fun onCreate() {
        super.onCreate()
        instance = this
    }

    class NotNullSingleValueVar<T> {

        private var value: T? = null

        operator fun getValue(thisRef: Any?, property: KProperty<*>): T =
                value ?: throw IllegalStateException("${property.name} not initialized")

        operator fun setValue(thisRef: Any?, property: KProperty<*>, value: T) {
            this.value = if (this.value == null) value
            else throw IllegalStateException("${property.name} already initialized")
        }
    }
</code>```

答:
onCreate function in UIApp class is never called and thus an instance of UIApp is never initialized. This is happening because you didn't add UIApp class to AndroidManifest and because of that your app did not realize that you have your custom Application class in a project.

```<code><?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="info.dodata.mirror">

    <application
        <!--Add line bellow to your manifest file and app will work just fine-->
        android:name="ui.UIApp"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">

        <activity android:name="ui.UIMain">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

    </application>

</manifest>
</code>```

Body:
I get the error

java.lang.IllegalStateException: instance not initialized

you can test it at https://www.dropbox.com/s/gxeok1fyttsl54u/MyMirror.zip?dl=0

It seems that the code operator fun getValue(thisRef: Any?, property: KProperty<*>)... in UIApp causes the error.

But the code is from a sample code, I hardly don't change, you can see source code at https://github.com/antoniolg/Kotlin-for-Android-Developers/blob/master/app/src/main/java/com/antonioleiva/weatherapp/ui/App.kt

and

https://github.com/antoniolg/Kotlin-for-Android-Developers/blob/master/app/src/main/java/com/antonioleiva/weatherapp/extensions/DelegatesExtensions.kt

Why?

java.lang.RuntimeException: Unable to start activity ComponentInfo{info.dodata.mirror/ui.UIMain}: java.lang.IllegalStateException: instance not initialized
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2107)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2132)
at android.app.ActivityThread.access$700(ActivityThread.java:140)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1238)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4918)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:994)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:761)
at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.IllegalStateException: instance not initialized
at ui.UIApp$NotNullSingleValueVar.getValue(UIApp.kt:23)
at ui.UIApp$Companion.getInstance(UIApp.kt)
at dal.DBSettingHelper.<init>(DBSettingHelper.kt:9)
at ui.UIMain.onCreate(UIMain.kt:14)
at android.app.Activity.performCreate(Activity.java:5185)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2071)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2132)?
at android.app.ActivityThread.access$700(ActivityThread.java:140)?
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1238)?
at android.os.Handler.dispatchMessage(Handler.java:99)?
at android.os.Looper.loop(Looper.java:137)?
at android.app.ActivityThread.main(ActivityThread.java:4918)?
at java.lang.reflect.Method.invokeNative(Native Method)?
at java.lang.reflect.Method.invoke(Method.java:511)?
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:994)?
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:761)?
at dalvik.system.NativeStart.main(Native Method)?

UIMain

package ui
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import dal.DBSettingHelper
import info.dodata.mirror.R

class UIMain : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.layout_main)
        var ss= DBSettingHelper();
    }

}

DBSettingHelper

package dal

import android.content.Context
import android.database.sqlite.SQLiteDatabase
import org.jetbrains.anko.db.*
import ui.UIApp

object DBSettingTable {
    val TableNAME = "SettingTable"

    val _ID = "_id"
    val Name = "name"
    val CreatedDate = "createdDate"
    val Description="description"
}

class DBSettingHelper(mContext: Context = UIApp.instance) : ManagedSQLiteOpenHelper(
        mContext,
        DB_NAME,
        null,
        DB_VERSION) {

    companion object {
        val DB_NAME = "setting.db"
        val DB_VERSION = 1
        val instance by lazy { DBSettingHelper() }
    }

    override fun onCreate(db: SQLiteDatabase) {
        db.createTable( DBSettingTable.TableNAME , true,
                DBSettingTable._ID to INTEGER + PRIMARY_KEY,
                DBSettingTable.Name to TEXT,
                DBSettingTable.CreatedDate to INTEGER,
                DBSettingTable.Description to TEXT
        )
    }

    override fun onUpgrade(db: SQLiteDatabase, oldVersion: Int, newVersion: Int) {
        db.dropTable(DBSettingTable.TableNAME, true)
        onCreate(db)
    }

}

UIApp

package ui

import android.app.Application
import kotlin.reflect.KProperty

class UIApp : Application() {

    companion object {
        var instance: UIApp by NotNullSingleValueVar()
    }

    override fun onCreate() {
        super.onCreate()
        instance = this
    }

    class NotNullSingleValueVar<T> {

        private var value: T? = null

        operator fun getValue(thisRef: Any?, property: KProperty<*>): T =
                value ?: throw IllegalStateException("${property.name} not initialized")

        operator fun setValue(thisRef: Any?, property: KProperty<*>, value: T) {
            this.value = if (this.value == null) value
            else throw IllegalStateException("${property.name} already initialized")
        }
    }

Body:
onCreate function in UIApp class is never called and thus an instance of UIApp is never initialized. This is happening because you didn't add UIApp class to AndroidManifest and because of that your app did not realize that you have your custom Application class in a project.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="info.dodata.mirror">

    <application
        <!--Add line bellow to your manifest file and app will work just fine-->
        android:name="ui.UIApp"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">

        <activity android:name="ui.UIMain">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

    </application>

</manifest>


问:
excel aggregate match return multiple values
I have been working on an excel project where I have a list of items with a description field that I am searching and on the second sheet a list of words to search for with associated numbers. If I match on one of the words in the description it returns the number from the second list. I actually found the answer on this on another post (If string contains word from list, return value adjacent to list value) but I am unable to figure out how to handle multiple matches. If possible I want to return all possible matches. I am too new to comment on that question in particular so I couldn't piggyback. any help?</p>

答:
Change the 1 at the end to COLUMN(A:A)

And make sure all other references are absolute:

```<code>=IFERROR(INDEX(Sheet1!$B$2:$B$5002,AGGREGATE(15,6,ROW($1:$5001)*SIGN(MATCH("*"&Sheet1!$A$2:$A$50002&"*",$C2,0)), COLUMN(A:A))),"")
</code>```

Put the formula in the first cell and copy over enough column to get all returns and down the rest of the data set.

Body:
Change the 1 at the end to COLUMN(A:A)

And make sure all other references are absolute:

=IFERROR(INDEX(Sheet1!$B$2:$B$5002,AGGREGATE(15,6,ROW($1:$5001)*SIGN(MATCH("*"&Sheet1!$A$2:$A$50002&"*",$C2,0)), COLUMN(A:A))),"")

Put the formula in the first cell and copy over enough column to get all returns and down the rest of the data set.


问:
split a word from string and save it in a variable
I've a question.
I have a string, like this:
hello, I am a string, -how are you?-.

And I want to put any text in - - sign in another variable and remove it from original string (in short: cut it!).

How can I do it? I should do it with preg_match or preg_split?

If you help me, I will grateful to you!

答:
A simple string split using explode (no regex needed) may help:

```<code>$s = 'hello, I am a string, -how are you?-';
$parts = explode('-', $s);
print_r($parts);

// Prints:
// Array
// (
//     [0] => hello, I am a string,
//     [1] => how are you?
//     [2] =>
// )
</code>```

You can also use trim functions to remove whitespace.

Body:
A simple string split using explode (no regex needed) may help:

$s = 'hello, I am a string, -how are you?-';
$parts = explode('-', $s);
print_r($parts);

// Prints:
// Array
// (
//     [0] => hello, I am a string,
//     [1] => how are you?
//     [2] =>
// )

You can also use trim functions to remove whitespace.