java.lang.IllegalArgumentException: Method miss match: expect public java.lang.Object net.wendal.nutzbook.module.UserModule.headImg(javax.servlet.http.HttpSession,org.nutz.mvc.upload.TempFile,org.nutz.mvc.impl.AdaptorErrorContext,javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse) throws javax.servlet.ServletException,java.io.IOException but public java.lang.Object net.wendal.nutzbook.module.ContributeModule.contributeAdd(org.nutz.mvc.upload.TempFile[],org.nutz.mvc.impl.AdaptorErrorContext,java.lang.String,java.lang.String,javax.servlet.http.HttpSession). using Ioc? set singleton=false, pls
at org.nutz.mvc.upload.UploadAdaptor.adapt(UploadAdaptor.java:118)
at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor.java:28)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.ActionFiltersProcessor.process(ActionFiltersProcessor.java:40)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:119)
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.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:179)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:957)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1079)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:620)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318)
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)
@At
@AdaptBy(type=UploadAdaptor.class,args={"ioc:upload"})
public Object contributeAdd(@Param("file") TempFile[] tmp,AdaptorErrorContext err,@Param("title") String title,@Param("content")String content,HttpSession session){
int uid=(int)session.getAttribute("me");
/* String filepatname[] = null;*/
for (TempFile tempFile : tmp) {
System.out.println(">>>>>>>>>图片路径【IMG-INFO】:"+tempFile.getFile().getPath());
if(err!=null){
log.debug(err.getAdaptorErr());
return false;
}
File file=tempFile.getFile();
String uuid=UUID.randomUUID().toString().replaceAll("-","");
String dest=webPath(uuid)+"."+Files.getSuffixName(file).toLowerCase();
String smallPath=webPath(uuid)+"_128x128."+Files.getSuffix(file).toLowerCase();
try {
Images.zoomScale(file, new File(smallPath), 128, 128, Color.BLACK);//得到图片大小
file.renameTo(new File(dest));
} catch (Throwable e) {
log.info(e);
return "";
}
filepathnames[0]="/upload/images/" + uuid + "."+ Files.getSuffixName(file).toLowerCase();//图片的绝对路径
System.out.println("图片:>>>"+filepathnames);
}
boolean bo=new ContributeService().contributeAdd(uid, title, content.trim(),filepathnames[0],filepathnames[1],filepathnames[2],dao);
return CommonJson.commonJosnFormat(true, bo);
}