I burst into tears, finally, I finally completed part of ExtJS.
(It will be beneficial to have a solid foundation, which will be reflected during troubleshooting)
Let’s make some troubleshooting notes on Ext.Direct:
Error 1 :
Severe: StandardWrapper.Throwable
java.lang .ArrayIndexOutOfBoundsException: 1
at com.softwarementors.extjs.djn.api.RegisteredStandardMethod.isValidFormHandlingMethod(RegisteredStandardMethod.java:53)
at com.softwarementors.extjs.djn.scanner.Scanner.scanAndRegisterActionClass(Scan ner.java: 206)
at com.softwarementors.extjs.djn.scanner.Scanner.scanAndRegisterApiConfiguration(Scanner.java:105)
at com.softwarementors.extjs.djn.scanner.Scanner.scanAndRegisterApiConfiguration(Scanner.java:82)
at com.softwarementors.extjs.djn.scanner.Scanner.scanAndRegisterApiConfigurations(Scanner.java:64)
at com.softwarementors.extjs.djn.servlet.DirectJNgineServlet.createDirectJNgineRouter(DirectJNgineServlet.java:182)
at com.softwarementors.extjs.djn.servlet.DirectJNgineServlet.init(DirectJNgineServlet.java:155)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1280)
at org. apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1193)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1088)
at org.apache.catalina.core. StandardContext.loadOnStartup(StandardContext.java:5033)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5317)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase. java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java: 1549)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$ Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
2013-3-28 17 :43:52 org.apache.catalina.core.StandardContext loadOnStartup
Why is this?
Answer:
@DirectFormPostMethod
This is wrong, this produces the above error, change it to: @DirectMethod
Delete it at the same time, the output generated by @DirectFormPostMethod:
import com.softwarementors.extjs.djn.config.annotations.DirectFormPostMethod;
Error two:
ERROR: com.softwarementors.extjs.djn.router.processor.standard.json.JsonRequestProcessor - "(Controlled) server error: 1 for Method 'FormAction.submitData'" (rid=1000)
java.lang.ArrayIndexOutOfBoundsException: 1
at com.softwarementors.extjs.djn.router.processor.standard.json.JsonRequestProcessor.checkJsonMethodParameterTypes(JsonRequestProcessor.java:352)
at com.softwarementors.extjs.djn.router.processor.standard.json.JsonRequestProcessor.getIndividualRequestParameters(JsonRequestProcessor.java:247)
at com.softwarementors.extjs.djn.router.processor.standard.json.JsonRequestProcessor.processIndividualRequest(JsonRequestProcessor.java:404)
at com.softwarementors.extjs.djn.router.processor.standard.json.JsonRequestProcessor.processIndividualRequestsInThisThread(JsonRequestProcessor.java:143)
at com.softwarementors.extjs.djn.router.processor.standard.json.JsonRequestProcessor.process(JsonRequestProcessor.java:126)
at com.softwarementors.extjs.djn.router.RequestRouter.processJsonRequest(RequestRouter.java:83)
at com.softwarementors.extjs.djn.servlet.DirectJNgineServlet.processRequest(DirectJNgineServlet.java:617)
at com.softwarementors.extjs.djn.servlet.DirectJNgineServlet.doPost(DirectJNgineServlet.java:580)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
控制层出错,也就是逻辑上不对,我的函数里面要求传入的参数,和提交的参数不对,
放心,不是xml配置问题,是传入的参数问题。所以重点在参数上,也就是语法。
我的错误原因:
Java要求传入的参数为两个:
public Info submitData(String name,String password)
而我在ExtJS 中实际传入的参数是一个:
var params= username.getValue() Password.getValue();
FormAction.submitData(params,function(result,e){}
改写一下就行了:
FormAction.submitData(username.getValue(),Password.getValue(),function(result,e){}
错误三:
FATAL: com.softwarementors.extjs.djn.servlet.DirectJNgineServlet - "Unable to find class 'com.softwarementors.extjs.djn.test.config.GsonBuilderConfiguratorForTesting'" ()
com.softwarementors.extjs.djn.servlet.ServletConfigurationException: Unable to find class 'com.softwarementors.extjs.djn.test.config.GsonBuilderConfiguratorForTesting'
at com.softwarementors.extjs.djn.servlet.ServletConfigurationException.forClassNotFound(ServletConfigurationException.java:63)
at com.softwarementors.extjs.djn.servlet.DirectJNgineServlet.getGsonBuilderConfiguratorClass(DirectJNgineServlet.java:362)
at com.softwarementors.extjs.djn.servlet.DirectJNgineServlet.createGlobalConfiguration(DirectJNgineServlet.java:324)
at com.softwarementors.extjs.djn.servlet.DirectJNgineServlet.createDirectJNgineRouter(DirectJNgineServlet.java:164)
at com.softwarementors.extjs.djn.servlet.DirectJNgineServlet.init(DirectJNgineServlet.java:155)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1280)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1193)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1088)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5033)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5317)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: com.softwarementors.extjs.djn.test.config.GsonBuilderConfiguratorForTesting
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1713)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1558)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.softwarementors.extjs.djn.servlet.DirectJNgineServlet.getGsonBuilderConfiguratorClass(DirectJNgineServlet.java:353)
... 16 more
2013-3-28 17:59:39 org.apache.catalina.core.ApplicationContext log
严重: StandardWrapper.Throwable
com.softwarementors.extjs.djn.servlet.ServletConfigurationException: Unable to find class 'com.softwarementors.extjs.djn.test.config.GsonBuilderConfiguratorForTesting'
at com.softwarementors.extjs.djn.servlet.ServletConfigurationException.forClassNotFound(ServletConfigurationException.java:63)
at com.softwarementors.extjs.djn.servlet.DirectJNgineServlet.getGsonBuilderConfiguratorClass(DirectJNgineServlet.java:362)
at com.softwarementors.extjs.djn.servlet.DirectJNgineServlet.createGlobalConfiguration(DirectJNgineServlet.java:324)
at com.softwarementors.extjs.djn.servlet.DirectJNgineServlet.createDirectJNgineRouter(DirectJNgineServlet.java:164)
at com.softwarementors.extjs.djn.servlet.DirectJNgineServlet.init(DirectJNgineServlet.java:155)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1280)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1193)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1088)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5033)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5317)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: com.softwarementors.extjs.djn.test.config.GsonBuilderConfiguratorForTesting
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1713)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1558)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.softwarementors.extjs.djn.servlet.DirectJNgineServlet.getGsonBuilderConfiguratorClass(DirectJNgineServlet.java:353)
... 16 more
2013-3-28 17:59:39 org.apache.catalina.core.StandardContext loadOnStartup
严重: Servlet /DirectJS threw load() exception
java.lang.ClassNotFoundException: com.softwarementors.extjs.djn.test.config.GsonBuilderConfiguratorForTesting
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1713)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1558)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.softwarementors.extjs.djn.servlet.DirectJNgineServlet.getGsonBuilderConfiguratorClass(DirectJNgineServlet.java:353)
at com.softwarementors.extjs.djn.servlet.DirectJNgineServlet.createGlobalConfiguration(DirectJNgineServlet.java:324)
at com.softwarementors.extjs.djn.servlet.DirectJNgineServlet.createDirectJNgineRouter(DirectJNgineServlet.java:164)
at com.softwarementors.extjs.djn.servlet.DirectJNgineServlet.init(DirectJNgineServlet.java:155)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1280)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1193)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1088)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5033)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5317)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
原因是里面没有这个类:
com.softwarementors.extjs.djn.test.config.GsonBuilderConfiguratorForTesting
这个错误在web.xml里面,把它们删了就行了:
registryConfiguratorClass
com.softwarementors.extjs.djn.test.servlet.config.RegistryConfiguratorForTesting
gsonBuilderConfiguratorClass
com.softwarementors.extjs.djn.test.config.GsonBuilderConfiguratorForTesting
大概就这三个,我的情况就是这样。
(MLGBD,我在百度发博文被封杀了,已经是第四篇了,我再也不再百度写博客了,R百度)
给我的样例URL吧:
http://www.kuaipan.cn/file/id_22384145481082698.htm