NutzCN Logo
问答 markdowm转Html的时候报错了。。。。。
发布于 2785天前 作者 屠夫与 1457 次浏览 复制 上一个帖子 下一个帖子
标签:

09:34:07.588 WARN (FailProcessor.java:28) process - Error@/yvr/docs/firstsee/initialize :
java.lang.ArrayIndexOutOfBoundsException: 1
at gvitech.citymakerbook.module.yvr.YvrSeoModule.getpage(YvrSeoModule.java:167) ~[classes/:?]
at gvitech.citymakerbook.module.yvr.YvrSeoModule$$NUTZAOP._aop_invoke(YvrSeoModule.java:2) ~[nutz-1.r.59.jar:?]
at org.nutz.aop.InterceptorChain.invoke(InterceptorChain.java:77) ~[nutz-1.r.59.jar:?]
at org.nutz.aop.InterceptorChain.doChain(InterceptorChain.java:57) ~[nutz-1.r.59.jar:?]
at gvitech.citymakerbook.plugin.DynamicInterceptor.filter(DynamicInterceptor.java:36) ~[classes/:?]
at org.nutz.aop.InterceptorChain.doChain(InterceptorChain.java:60) ~[nutz-1.r.59.jar:?]
at gvitech.citymakerbook.module.yvr.YvrSeoModule$$NUTZAOP.getpage(YvrSeoModule.java:1) ~[nutz-1.r.59.jar:?]
at gvitech.citymakerbook.module.yvr.YvrSeoModule$$FASTCLASS._invoke(YvrSeoModule.java:1) ~[nutz-1.r.59.jar:?]
at org.nutz.lang.reflect.AbstractFastClass.invoke(AbstractFastClass.java:143) ~[nutz-1.r.59.jar:?]
at org.nutz.lang.reflect.FastClassFactory.invoke(FastClassFactory.java:67) ~[nutz-1.r.59.jar:?]
at org.nutz.mvc.impl.processor.MethodInvokeProcessor.process(MethodInvokeProcessor.java:27) ~[nutz-1.r.59.jar:?]
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) ~[nutz-1.r.59.jar:?]
at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor.java:33) ~[nutz-1.r.59.jar:?]
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) ~[nutz-1.r.59.jar:?]
at org.nutz.mvc.impl.processor.ActionFiltersProcessor.process(ActionFiltersProcessor.java:58) ~[nutz-1.r.59.jar:?]
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) ~[nutz-1.r.59.jar:?]
at org.nutz.integration.shiro.NutShiroProcessor.process(NutShiroProcessor.java:126) ~[nutz-integration-shiro-1.r.58.jar:?]
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) ~[nutz-1.r.59.jar:?]
at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:123) ~[nutz-1.r.59.jar:?]
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) ~[nutz-1.r.59.jar:?]
at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27) ~[nutz-1.r.59.jar:?]
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) ~[nutz-1.r.59.jar:?]
at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:15) ~[nutz-1.r.59.jar:?]
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) ~[nutz-1.r.59.jar:?]
at gvitech.citymakerbook.mvc.DailyUniqueUsersProcessor.process(DailyUniqueUsersProcessor.java:50) ~[classes/:?]
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) ~[nutz-1.r.59.jar:?]
at gvitech.citymakerbook.mvc.LogTimeProcessor.process(LogTimeProcessor.java:19) ~[classes/:?]
at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:44) [nutz-1.r.59.jar:?]
at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:67) [nutz-1.r.59.jar:?]
at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31) [nutz-1.r.59.jar:?]
at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:198) [nutz-1.r.59.jar:?]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [catalina.jar:8.0.39]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [catalina.jar:8.0.39]
at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:123) [druid-1.0.25.jar:1.0.25]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [catalina.jar:8.0.39]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [catalina.jar:8.0.39]
at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449) [shiro-web-1.3.2.jar:1.3.2]
at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365) [shiro-web-1.3.2.jar:1.3.2]
at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90) [shiro-core-1.2.3.jar:1.2.3]
at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83) [shiro-core-1.2.3.jar:1.2.3]
at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383) [shiro-core-1.2.3.jar:1.2.3]
at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362) [shiro-web-1.3.2.jar:1.3.2]
at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125) [shiro-web-1.3.2.jar:1.3.2]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [catalina.jar:8.0.39]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [catalina.jar:8.0.39]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212) [catalina.jar:8.0.39]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) [catalina.jar:8.0.39]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) [catalina.jar:8.0.39]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141) [catalina.jar:8.0.39]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) [catalina.jar:8.0.39]
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616) [catalina.jar:8.0.39]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) [catalina.jar:8.0.39]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:509) [catalina.jar:8.0.39]
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1104) [tomcat-coyote.jar:8.0.39]
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684) [tomcat-coyote.jar:8.0.39]
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2508) [tomcat-coyote.jar:8.0.39]
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2497) [tomcat-coyote.jar:8.0.39]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_51]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_51]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-util.jar:8.0.39]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_51]

5 回复

YvrSeoModule.getpage, 这个方法报错嘛,贴一下

@At({"/docs/*"})
@Ok("beetl:/yvr/website/citymakerbook.html")
public Object getpage(String type,String type2) throws IOException {
String path= "/doc/citymakerbook/" + type+ ".md";
if(type2!=null)
{
path = "/doc/citymakerbook/" + type+"/"+ type2+ ".md";
}
InputStream ins = getClass().getClassLoader().getResourceAsStream(path);
if (ins == null)
return HTTP_404;
String cnt = Streams.readAndClose(new InputStreamReader(ins, Encoding.CHARSET_UTF8));
String[] tmp = cnt.split("\n", 2);
String title = tmp[0].trim().split(" ", 2)[1].trim();

    return _map("title", title, "cnt", cnt,"current_user", fetch_userprofile(Toolkit.uid()));
}

这行报错?

String title = tmp[0].trim().split(" ", 2)[1].trim();

tmp[0]不包含空格的时候, split得到一个元素的数组, 取下标1,就报错啦, 判断一下完事

现在问题来了,markdown里面引用了图片怎么办?直接转成html之后,图片的地址还是markdown文件相对地址?

例如nutzcn的Markdowns类, 里面有个LinkRenderer的匿名内部类, 它有一个方法叫printImageTag, 覆盖它的行为就好了, 就是为那个匿名内部类再加个printImageTag方法,覆盖默认行为.

添加回复
请先登陆
回到顶部