NutzCN Logo
问答 nutz 集成 freemarker报错,详情如下,求解答
发布于 2024天前 作者 qq_5119e32c 1447 次浏览 复制 上一个帖子 下一个帖子
标签:

集成的插件是
nutz-plugins-views 1.b.52.preview jar包已加上

freemarker -2.3.16.jar 也加上了

在MainModule 中,添加了 @Views({ ExceptionViewMaker.class ,FreemarkerViewMaker.class})

我在 controller 中方法是 这样写的

@At("/main")
@Ok("fm:jsp.knowledgebase.botnet.ftl.03")
@Fail("fm:jsp.knowledgebase.botnet.ftl.03")
@Log(isEnabled = false)
public Map<String, Object> viewSearchTabsIndex() {
.......................................
}

报错如下,
严重: Exception starting filter nutz

org.nutz.mvc.LoadingException: java.lang.RuntimeException: Can not eval fm:jsp.knowledgebase.botnet.ftl.03("fm:jsp.knowledgebase.botnet.ftl.03") View for public java.util.Map com.venustech.tsoc.cupid.knowledgebase.botnet.controller.BotnetController.viewSearchTabsIndex()
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.nutz.lang.born.ConstructorBorning.born(ConstructorBorning.java:16)
at org.nutz.lang.born.BornContext.doBorn(BornContext.java:60)
at org.nutz.lang.Mirror.born(Mirror.java:923)
at org.nutz.lang.Lang.wrapThrow(Lang.java:157)
at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:109)
at com.venustech.tsoc.CupidNutLoading.load(SourceFile:22)
at org.nutz.mvc.ActionHandler.(ActionHandler.java:19)
at org.nutz.mvc.NutFilter.init(NutFilter.java:54)
at com.venustech.tsoc.CupidNutFilter.init(SourceFile:36)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:105)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4809)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5485)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:670)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1839)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.RuntimeException: Can not eval fm:jsp.knowledgebase.botnet.ftl.03("fm:jsp.knowledgebase.botnet.ftl.03") View for public java.util.Map com.venustech.tsoc.cupid.knowledgebase.botnet.controller.BotnetController.viewSearchTabsIndex()
at org.nutz.lang.Lang.makeThrow(Lang.java:92)
at org.nutz.mvc.impl.processor.ViewProcessor.evalView(ViewProcessor.java:84)
at org.nutz.mvc.impl.processor.ViewProcessor.init(ViewProcessor.java:26)
at org.nutz.mvc.impl.NutActionChainMaker.eval(NutActionChainMaker.java:34)
at org.nutz.mvc.impl.UrlMappingImpl.add(UrlMappingImpl.java:46)
at org.nutz.mvc.impl.NutLoading.evalUrlMapping(NutLoading.java:175)
at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:91)
... 20 more
目录 WEB-IN/jsp/knowledgebase/botnet/ftl/03.ftl 是存在的
不知道是怎么回事,求大神解答

7 回复

如果换上也是"一样"的错误, debug一下FreemarkerViewMaker,看看为啥没匹配上

@wendal 好的,正在部署项目

@wendal 换了之后还是包同样的错,项目启动时就报错,在 FreemarkerViewMaker 中 打断点 ,竟然进不出去,怎么感觉像是 没有被拦截到,真是醉了

顺序换一下

@Views({ ExceptionViewMaker.class ,FreemarkerViewMaker.class})

@wendal 还是不行,还是报同样的错,兽总 猜一下 这大概是什么原因导致的啊

猜? 无非就是@Views没生效

看启动日志, 会打印@Views的值

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