NutzCN Logo
问答 帮忙看看参数不匹配的异常啊 NUTZBOOK
发布于 3111天前 作者 qq_4596d506 4252 次浏览 复制 上一个帖子 下一个帖子
标签:

session.setAttribute("me", user.getId()); session SET进去了
QQ截图20160616141435_jpg

访问这个方法

@At("/")
    @GET
    @Ok("fm:view.user.profile")
    public PbUserProfile index(@Attr(scope=Scope.SESSION, value="me")Integer userId) {
        return get(userId);
    }

异常信息

2016-06-16 14:14:01,928 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:92) DEBUG - Found mapping for [GET] path=/login/goto/login : LoginModule.tologin(LoginModule.java:28)
2016-06-16 14:14:01,928 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'loginModule'<class com.cc.template.module.LoginModule>
2016-06-16 14:14:01,929 freemarker.log._Log4jLoggerFactory$Log4jLogger.debug(_Log4jLoggerFactory.java:45) DEBUG - TemplateLoader.findTemplateSource("view/login_zh_CN.ftl"): Not found
2016-06-16 14:14:01,930 freemarker.log._Log4jLoggerFactory$Log4jLogger.debug(_Log4jLoggerFactory.java:45) DEBUG - TemplateLoader.findTemplateSource("view/login_zh.ftl"): Not found
2016-06-16 14:14:01,931 freemarker.log._Log4jLoggerFactory$Log4jLogger.debug(_Log4jLoggerFactory.java:45) DEBUG - TemplateLoader.findTemplateSource("view/login.ftl"): Found
2016-06-16 14:14:01,932 freemarker.log._Log4jLoggerFactory$Log4jLogger.debug(_Log4jLoggerFactory.java:45) DEBUG - "view/login.ftl"("zh_CN", UTF-8, parsed): using cached since D:\DEVELOP\JAVA\IDEASOURCE\nutz-template\target\nutz-template\WEB-INF\view\login.ftl hasn't changed.
2016-06-16 14:14:01,935 com.cc.template.mvc.LogTimeProcessor.process(LogTimeProcessor.java:31) DEBUG - [ GET]URI=/login/goto/login 7ms
2016-06-16 14:14:43,759 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:92) DEBUG - Found mapping for [GET] path=/user/profile : UserProfileModule.index(UserProfileModule.java:127)
2016-06-16 14:14:43,760 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'userProfileModule'<class com.cc.template.module.UserProfileModule>
2016-06-16 14:14:43,761 com.cc.template.mvc.LogTimeProcessor.process(LogTimeProcessor.java:31) DEBUG - [ GET]URI=/user/profile 1ms
2016-06-16 14:14:43,761 org.nutz.mvc.impl.processor.FailProcessor.process(FailProcessor.java:28) WARN  - Error@/user/profile :
java.lang.IllegalArgumentException: argument type mismatch
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at org.nutz.mvc.impl.processor.MethodInvokeProcessor.process(MethodInvokeProcessor.java:25)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor.java:33)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.ActionFiltersProcessor.process(ActionFiltersProcessor.java:58)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:123)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:15)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at com.cc.template.mvc.LogTimeProcessor.process(LogTimeProcessor.java:26)
	at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:44)
	at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:67)
	at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31)
	at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:196)
	at com.cc.template.mvc.NutzTemplateNutFilter.doFilter(NutzTemplateNutFilter.java:45)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:123)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:617)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:668)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1527)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1484)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:745)
2016-06-16 14:14:43,763 freemarker.log._Log4jLoggerFactory$Log4jLogger.debug(_Log4jLoggerFactory.java:45) DEBUG - TemplateLoader.findTemplateSource("view/error/500_zh_CN.ftl"): Not found
2016-06-16 14:14:43,763 freemarker.log._Log4jLoggerFactory$Log4jLogger.debug(_Log4jLoggerFactory.java:45) DEBUG - TemplateLoader.findTemplateSource("view/error/500_zh.ftl"): Not found
2016-06-16 14:14:43,765 freemarker.log._Log4jLoggerFactory$Log4jLogger.debug(_Log4jLoggerFactory.java:45) DEBUG - TemplateLoader.findTemplateSource("view/error/500.ftl"): Found
2016-06-16 14:14:43,766 freemarker.log._Log4jLoggerFactory$Log4jLogger.debug(_Log4jLoggerFactory.java:45) DEBUG - "view/error/500.ftl"("zh_CN", UTF-8, parsed): using cached since D:\DEVELOP\JAVA\IDEASOURCE\nutz-template\target\nutz-template\WEB-INF\view\error\500.ftl hasn't changed.

2 回复

放在session里面的me的类型是啥?用object收,打印一下类型

来自炫酷的 NutzCN

@wendal 我错了 ,,类型错了

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