NutzCN Logo
问答 学习nutz入门手册中CaptchaModule出错导致启动报错
发布于 2958天前 作者 Memory 2254 次浏览 复制 上一个帖子 下一个帖子
标签:

java代码:

package net.wendal.nutzbook.action;

import java.awt.image.BufferedImage;

import javax.servlet.http.HttpSession;


import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;

import cn.apiclub.captcha.Captcha;
import cn.apiclub.captcha.backgrounds.GradiatedBackgroundProducer;
import cn.apiclub.captcha.gimpy.FishEyeGimpyRenderer;
import net.wendal.nutzbook.utils.Toolkit;

@IocBean
@At("/captcha")
public class CaptchaAction {

    @At
    @Ok("raw:png")
    public BufferedImage next(HttpSession session, @Param("w") int w, @Param("h") int h) {
        if (w * h < 1) { //长或宽为0?重置为默认长宽.
            w = 200;
            h = 60;
        }
        Captcha captcha = new Captcha.Builder(w, h)
                                .addText().addBackground(new GradiatedBackgroundProducer())
//                                .addNoise(new StraightLineNoiseProducer()).addBorder()
                                .gimp(new FishEyeGimpyRenderer())
                                .build();
        String text = captcha.getAnswer();
        session.setAttribute(Toolkit.captcha_attr, text);
        return captcha.getImage();
    }
}

启动日志:

十月 20, 2016 3:14:43 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin
警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:nutzbook' did not find a matching property.
十月 20, 2016 3:14:43 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server version:        Apache Tomcat/8.0.37
十月 20, 2016 3:14:43 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server built:          Sep 1 2016 10:01:52 UTC
十月 20, 2016 3:14:43 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server number:         8.0.37.0
十月 20, 2016 3:14:43 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS Name:               Windows 7
十月 20, 2016 3:14:43 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS Version:            6.1
十月 20, 2016 3:14:43 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Architecture:          amd64
十月 20, 2016 3:14:43 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Java Home:             C:\Program Files\Java\jre1.8.0_101
十月 20, 2016 3:14:43 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM Version:           1.8.0_101-b13
十月 20, 2016 3:14:43 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM Vendor:            Oracle Corporation
十月 20, 2016 3:14:43 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: CATALINA_BASE:         D:\nutzbook\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
十月 20, 2016 3:14:43 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: CATALINA_HOME:         D:\nutzbook\apache-tomcat-8.0.37
十月 20, 2016 3:14:43 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:64696
十月 20, 2016 3:14:43 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcatalina.base=D:\nutzbook\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
十月 20, 2016 3:14:43 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcatalina.home=D:\nutzbook\apache-tomcat-8.0.37
十月 20, 2016 3:14:43 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dwtp.deploy=D:\nutzbook\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps
十月 20, 2016 3:14:43 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Djava.endorsed.dirs=D:\nutzbook\apache-tomcat-8.0.37\endorsed
十月 20, 2016 3:14:43 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dfile.encoding=UTF-8
十月 20, 2016 3:14:43 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre1.8.0_101\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre1.8.0_101/bin/server;C:/Program Files/Java/jre1.8.0_101/bin;C:/Program Files/Java/jre1.8.0_101/lib/amd64;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\NetSarang;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Java\jdk1.8.0_101\bin;C:\Program Files\Java\jdk1.8.0_101\jre\bin;C:\Windows\system32\config\systemprofile\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;D:\Program Files\Git\cmd;D:\Program Files\TortoiseSVN\bin;.;;.;;C:\Windows\system32;;.
十月 20, 2016 3:14:43 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["http-nio-8080"]
十月 20, 2016 3:14:43 下午 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
信息: Using a shared selector for servlet write/read
十月 20, 2016 3:14:43 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["ajp-nio-8009"]
十月 20, 2016 3:14:43 下午 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
信息: Using a shared selector for servlet write/read
十月 20, 2016 3:14:43 下午 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 1084 ms
十月 20, 2016 3:14:43 下午 org.apache.catalina.core.StandardService startInternal
信息: Starting service Catalina
十月 20, 2016 3:14:43 下午 org.apache.catalina.core.StandardEngine startInternal
信息: Starting Servlet Engine: Apache Tomcat/8.0.37
十月 20, 2016 3:14:45 下午 org.apache.jasper.servlet.TldScanner scanJars
信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
log4j:WARN No such property [maxfilesize] in org.apache.log4j.DailyRollingFileAppender.
log4j:WARN No such property [maxbackupindex] in org.apache.log4j.DailyRollingFileAppender.
log4j:WARN No such property [maxfilesize] in org.apache.log4j.DailyRollingFileAppender.
log4j:WARN No such property [maxbackupindex] in org.apache.log4j.DailyRollingFileAppender.
十月 20, 2016 3:14:45 下午 org.apache.catalina.core.ApplicationContext log
信息: Initializing Shiro environment
2016-10-20 15:14:45,898 [localhost-startStop-1] INFO  org.apache.shiro.web.env.EnvironmentLoader - Starting Shiro environment initialization.
2016-10-20 15:14:45,913 [localhost-startStop-1] DEBUG org.apache.shiro.web.env.IniWebEnvironment - Checking any specified config locations.
2016-10-20 15:14:45,913 [localhost-startStop-1] DEBUG org.apache.shiro.web.env.IniWebEnvironment - No INI instance or config locations specified.  Trying default config locations.
2016-10-20 15:14:45,918 [localhost-startStop-1] DEBUG org.apache.shiro.io.ResourceUtils - Opening resource from class path [shiro.ini]
2016-10-20 15:14:45,923 [localhost-startStop-1] DEBUG org.apache.shiro.config.Ini - Parsing [main]
2016-10-20 15:14:45,924 [localhost-startStop-1] DEBUG org.apache.shiro.config.Ini - Parsing [urls]
2016-10-20 15:14:45,925 [localhost-startStop-1] DEBUG org.apache.shiro.web.env.IniWebEnvironment - Discovered non-empty INI configuration at location 'classpath:shiro.ini'.  Using for configuration.
2016-10-20 15:14:45,930 [localhost-startStop-1] DEBUG org.apache.shiro.config.IniFactorySupport - Creating instance from Ini [sections=urls]
2016-10-20 15:14:46,142 [localhost-startStop-1] DEBUG org.apache.shiro.config.IniFactorySupport - Creating instance from Ini [sections=urls]
2016-10-20 15:14:46,148 [localhost-startStop-1] DEBUG org.apache.shiro.web.filter.mgt.DefaultFilterChainManager - Creating chain [/*] from String definition [anon]
2016-10-20 15:14:46,148 [localhost-startStop-1] DEBUG org.apache.shiro.web.filter.mgt.DefaultFilterChainManager - Attempting to apply path [/*] to filter [anon] with config [null]
2016-10-20 15:14:46,150 [localhost-startStop-1] DEBUG org.apache.shiro.web.env.EnvironmentLoader - Published WebEnvironment as ServletContext attribute with name [org.apache.shiro.web.env.EnvironmentLoader.ENVIRONMENT_ATTRIBUTE_KEY]
2016-10-20 15:14:46,150 [localhost-startStop-1] INFO  org.apache.shiro.web.env.EnvironmentLoader - Shiro environment initialized in 251 ms.
2016-10-20 15:14:46,198 [localhost-startStop-1] INFO  net.wendal.nutzbook.mvc.NutzBookNutFilter - NutFilter[nutz] starting ...
2016-10-20 15:14:46,267 [localhost-startStop-1] DEBUG org.nutz.resource.Scans - Locations for Scans:
[Dir[path=C:\Windows\System32], Jar[path=D:\nutzbook\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\nutzbook\WEB-INF\lib\nutz-1.r.58.jar], Dir[path=D:\nutzbook\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\nutzbook\WEB-INF\classes], Jar[path=D:\nutzbook\apache-tomcat-8.0.37\bin\bootstrap.jar], Jar[path=D:\nutzbook\apache-tomcat-8.0.37\bin\tomcat-juli.jar]]
2016-10-20 15:14:46,527 [localhost-startStop-1] DEBUG org.nutz.resource.Scans - Locations for Scans:
{C:\Windows\System32=Dir[path=C:\Windows\System32], D:\nutzbook\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\nutzbook\WEB-INF\lib\nutz-1.r.58.jar=Jar[path=D:\nutzbook\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\nutzbook\WEB-INF\lib\nutz-1.r.58.jar], D:\nutzbook\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\nutzbook\WEB-INF\classes=Dir[path=D:\nutzbook\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\nutzbook\WEB-INF\classes], D:\nutzbook\apache-tomcat-8.0.37\bin\bootstrap.jar=Jar[path=D:\nutzbook\apache-tomcat-8.0.37\bin\bootstrap.jar], D:\nutzbook\apache-tomcat-8.0.37\bin\tomcat-juli.jar=Jar[path=D:\nutzbook\apache-tomcat-8.0.37\bin\tomcat-juli.jar], D:\nutzbook\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\nutzbook\WEB-INF\lib\nutz-integration-shiro-1.b.53.r2.jar=Jar[path=D:\nutzbook\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\nutzbook\WEB-INF\lib\nutz-integration-shiro-1.b.53.r2.jar], D:\nutzbook\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\nutzbook\WEB-INF\lib\druid-1.0.16.jar=Jar[path=D:\nutzbook\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\nutzbook\WEB-INF\lib\druid-1.0.16.jar], D:\nutzbook\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\nutzbook\WEB-INF\lib\nutz-integration-quartz-1.b.53.r3.jar=Jar[path=D:\nutzbook\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\nutzbook\WEB-INF\lib\nutz-integration-quartz-1.b.53.r3.jar], D:\nutzbook\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\nutzbook\WEB-INF\lib\taglibs-standard-impl-1.2.5.jar=Jar[path=D:\nutzbook\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\nutzbook\WEB-INF\lib\taglibs-standard-impl-1.2.5.jar], D:\nutzbook\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\nutzbook\WEB-INF\lib\commons-beanutils-1.9.3.jar=Jar[path=D:\nutzbook\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\nutzbook\WEB-INF\lib\commons-beanutils-1.9.3.jar], D:\nutzbook\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\nutzbook\WEB-INF\lib\taglibs-standard-compat-1.2.5.jar=Jar[path=D:\nutzbook\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\nutzbook\WEB-INF\lib\taglibs-standard-compat-1.2.5.jar], D:\nutzbook\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\nutzbook\WEB-INF\lib\quartz-jobs-2.2.3.jar=Jar[path=D:\nutzbook\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\nutzbook\WEB-INF\lib\quartz-jobs-2.2.3.jar], D:\nutzbook\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\nutzbook\WEB-INF\lib\javax.mail-1.5.2.jar=Jar[path=D:\nutzbook\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\nutzbook\WEB-INF\lib\javax.mail-1.5.2.jar], D:\nutzbook\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\nutzbook\WEB-INF\lib\nutz-web-1.a.1.jar=Jar[path=D:\nutzbook\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\nutzbook\WEB-INF\lib\nutz-web-1.a.1.jar], D:\nutzbook\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\nutzbook\WEB-INF\lib\commons-logging-1.2.jar=Jar[path=D:\nutzbook\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\nutzbook\WEB-INF\lib\commons-logging-1.2.jar], D:\nutzbook\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\nutzbook\WEB-INF\lib\taglibs-standard-spec-1.2.5.jar=Jar[path=D:\nutzbook\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\nutzbook\WEB-INF\lib\taglibs-standard-spec-1.2.5.jar], D:\nutzbook\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\nutzbook\WEB-INF\lib\quartz-2.2.3.jar=Jar[path=D:\nutzbook\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\nutzbook\WEB-INF\lib\quartz-2.2.3.jar], D:\nutzbook\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\nutzbook\WEB-INF\lib\log4j-1.2.17.jar=Jar[path=D:\nutzbook\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\nutzbook\WEB-INF\lib\log4j-1.2.17.jar], D:\nutzbook\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\nutzbook\WEB-INF\lib\javax.servlet.jsp.jstl.jar=Jar[path=D:\nutzbook\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\nutzbook\WEB-INF\lib\javax.servlet.jsp.jstl.jar], D:\nutzbook\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\nutzbook\WEB-INF\lib\taglibs-standard-jstlel-1.2.5.jar=Jar[path=D:\nutzbook\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\nutzbook\WEB-INF\lib\taglibs-standard-jstlel-1.2.5.jar], D:\nutzbook\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\nutzbook\WEB-INF\lib\ojdbc6.jar=Jar[path=D:\nutzbook\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\nutzbook\WEB-INF\lib\ojdbc6.jar], D:\nutzbook\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\nutzbook\WEB-INF\lib\simplecaptcha-1.2.2.jar=Jar[path=D:\nutzbook\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\nutzbook\WEB-INF\lib\simplecaptcha-1.2.2.jar], D:\nutzbook\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\nutzbook\WEB-INF\lib\slf4j-api-1.7.7.jar=Jar[path=D:\nutzbook\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\nutzbook\WEB-INF\lib\slf4j-api-1.7.7.jar], D:\nutzbook\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\nutzbook\WEB-INF\lib\commons-email-1.3.3.jar=Jar[path=D:\nutzbook\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\nutzbook\WEB-INF\lib\commons-email-1.3.3.jar], D:\nutzbook\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\nutzbook\WEB-INF\lib\shiro-all-1.3.2.jar=Jar[path=D:\nutzbook\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\nutzbook\WEB-INF\lib\shiro-all-1.3.2.jar], D:\nutzbook\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\nutzbook\WEB-INF\lib\slf4j-log4j12-1.7.7.jar=Jar[path=D:\nutzbook\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\nutzbook\WEB-INF\lib\slf4j-log4j12-1.7.7.jar]}
2016-10-20 15:14:46,641 [localhost-startStop-1] DEBUG org.nutz.castor.Castors - Using 94 castor for Castors
2016-10-20 15:14:46,685 [localhost-startStop-1] DEBUG org.nutz.mvc.config.AbstractNutConfig - Loading by class org.nutz.mvc.impl.NutLoading
2016-10-20 15:14:46,690 [localhost-startStop-1] INFO  org.nutz.mvc.impl.NutLoading - Nutz Version : 1.r.58 
2016-10-20 15:14:46,690 [localhost-startStop-1] INFO  org.nutz.mvc.impl.NutLoading - Nutz.Mvc[nutz] is initializing ...
2016-10-20 15:14:46,690 [localhost-startStop-1] DEBUG org.nutz.mvc.impl.NutLoading - Web Container Information:
2016-10-20 15:14:46,692 [localhost-startStop-1] DEBUG org.nutz.mvc.impl.NutLoading -  - Default Charset : UTF-8
2016-10-20 15:14:46,692 [localhost-startStop-1] DEBUG org.nutz.mvc.impl.NutLoading -  - Current . path  : C:\Windows\system32\.
2016-10-20 15:14:46,692 [localhost-startStop-1] DEBUG org.nutz.mvc.impl.NutLoading -  - Java Version    : 1.8.0_101
2016-10-20 15:14:46,692 [localhost-startStop-1] DEBUG org.nutz.mvc.impl.NutLoading -  - File separator  : \
2016-10-20 15:14:46,693 [localhost-startStop-1] DEBUG org.nutz.mvc.impl.NutLoading -  - Timezone        : Asia/Shanghai
2016-10-20 15:14:46,694 [localhost-startStop-1] DEBUG org.nutz.mvc.impl.NutLoading -  - OS              : Windows 7 amd64
2016-10-20 15:14:46,694 [localhost-startStop-1] DEBUG org.nutz.mvc.impl.NutLoading -  - ServerInfo      : Apache Tomcat/8.0.37
2016-10-20 15:14:46,694 [localhost-startStop-1] DEBUG org.nutz.mvc.impl.NutLoading -  - Servlet API     : 3.1
2016-10-20 15:14:46,694 [localhost-startStop-1] DEBUG org.nutz.mvc.impl.NutLoading -  - ContextPath     : /nutzbook
2016-10-20 15:14:46,694 [localhost-startStop-1] DEBUG org.nutz.mvc.impl.NutLoading -  - context.tempdir : D:\nutzbook\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\work\Catalina\localhost\nutzbook
2016-10-20 15:14:46,695 [localhost-startStop-1] DEBUG org.nutz.mvc.impl.NutLoading -  - MainModule      : net.wendal.nutzbook.MainModule
2016-10-20 15:14:46,698 [localhost-startStop-1] DEBUG org.nutz.mvc.impl.NutLoading - >> app.root = D:/nutzbook/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/nutzbook
2016-10-20 15:14:46,700 [localhost-startStop-1] DEBUG org.nutz.mvc.impl.NutLoading - @IocBy(type=org.nutz.mvc.ioc.provider.ComboIocProvider, args=["*js", "ioc/", "*anno", "net.wendal.nutzbook", "*tx", "*org.nutz.integration.quartz.QuartzIocLoader"],init=[])
2016-10-20 15:14:46,739 [localhost-startStop-1] DEBUG org.nutz.resource.Scans - Found 2 resource by src( ioc/ ) , regex( ^(.+[.])(js|json)$ )
2016-10-20 15:14:46,740 [localhost-startStop-1] DEBUG org.nutz.ioc.loader.json.JsonLoader - loading ioc js config from [dao.js]
2016-10-20 15:14:46,746 [localhost-startStop-1] DEBUG org.nutz.ioc.loader.json.JsonLoader - loading ioc js config from [mail.js]
2016-10-20 15:14:46,748 [localhost-startStop-1] DEBUG org.nutz.ioc.loader.json.JsonLoader - Loaded 5 bean define from path=[ioc/] --> [conf, dao, emailAuthenticator, dataSource, htmlEmail]
2016-10-20 15:14:46,759 [localhost-startStop-1] DEBUG org.nutz.resource.Scans - Found 12 resource by src( net/wendal/nutzbook/ ) , regex( ^.+[.]class$ )
2016-10-20 15:14:46,776 [localhost-startStop-1] DEBUG org.nutz.ioc.loader.annotation.AnnotationIocLoader - Found @IocBean : class net.wendal.nutzbook.action.CaptchaAction
2016-10-20 15:14:46,785 [localhost-startStop-1] DEBUG org.nutz.ioc.loader.annotation.AnnotationIocLoader - Found @IocBean : class net.wendal.nutzbook.action.EmailService
2016-10-20 15:14:46,802 [localhost-startStop-1] DEBUG org.nutz.ioc.loader.annotation.AnnotationIocLoader - Found @IocBean : class net.wendal.nutzbook.action.UserAction
2016-10-20 15:14:46,866 [localhost-startStop-1] DEBUG org.nutz.ioc.loader.annotation.AnnotationIocLoader - Found @IocBean : class net.wendal.nutzbook.quartz.job.Task
2016-10-20 15:14:46,871 [localhost-startStop-1] INFO  org.nutz.ioc.loader.annotation.AnnotationIocLoader - Found 4 classes in 1 base-packages!
beans = ["userAction", "captchaAction", "task", "emailService"]
2016-10-20 15:14:46,875 [localhost-startStop-1] DEBUG org.nutz.ioc.loader.json.JsonLoader - Loaded 5 bean define from reader --
[txREPEATABLE_READ, txSERIALIZABLE, txNONE, txREAD_UNCOMMITTED, txREAD_COMMITTED]
2016-10-20 15:14:46,877 [localhost-startStop-1] DEBUG org.nutz.ioc.loader.json.JsonLoader - Loaded 0 bean define from path=[] --> []
2016-10-20 15:14:46,885 [localhost-startStop-1] INFO  org.nutz.ioc.impl.NutIoc - NutIoc init begin ...
2016-10-20 15:14:46,894 [localhost-startStop-1] INFO  org.nutz.ioc.impl.NutIoc - ... NutIoc init complete
2016-10-20 15:14:46,899 [localhost-startStop-1] INFO  org.nutz.mvc.impl.NutLoading - Build URL mapping by org.nutz.mvc.impl.UrlMappingImpl ...
2016-10-20 15:14:46,902 [localhost-startStop-1] DEBUG org.nutz.mvc.impl.NutLoading - @Views(DefaultViewMaker.class)
2016-10-20 15:14:46,916 [localhost-startStop-1] DEBUG org.nutz.resource.Scans - Found 1 resource by src( mvc/nutzbook-mvc-chain.js ) , regex( ^(.+[.])(js|json)$ )
2016-10-20 15:14:46,925 [localhost-startStop-1] DEBUG org.nutz.mvc.impl.chainconfig.JsonActionChainMakerConfiguretion - ActionChain Config:
{
   "default": {
      "ps": ["net.wendal.nutzbook.mvc.LogTimeProcessor", "org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor", "org.nutz.mvc.impl.processor.EncodingProcessor", "org.nutz.mvc.impl.processor.ModuleProcessor", "org.nutz.mvc.impl.processor.ActionFiltersProcessor", "org.nutz.mvc.impl.processor.AdaptorProcessor", "org.nutz.mvc.impl.processor.MethodInvokeProcessor", "org.nutz.mvc.impl.processor.ViewProcessor"],
      "error": "org.nutz.mvc.impl.processor.FailProcessor"
   }
}
2016-10-20 15:14:46,925 [localhost-startStop-1] DEBUG org.nutz.mvc.impl.NutLoading - @ChainBy(org.nutz.mvc.impl.NutActionChainMaker)
2016-10-20 15:14:46,931 [localhost-startStop-1] DEBUG org.nutz.mvc.impl.Loadings - module class location 'file:/D:/nutzbook/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/nutzbook/WEB-INF/classes/'
2016-10-20 15:14:46,931 [localhost-startStop-1] DEBUG org.nutz.mvc.impl.Loadings -  > scan 'net.wendal.nutzbook'
2016-10-20 15:14:46,937 [localhost-startStop-1] DEBUG org.nutz.resource.Scans - Found 12 resource by src( net/wendal/nutzbook/ ) , regex( ^.+[.]class$ )
2016-10-20 15:14:46,938 [localhost-startStop-1] DEBUG org.nutz.mvc.impl.Loadings -    >> add 'net.wendal.nutzbook.action.CaptchaAction'
2016-10-20 15:14:46,939 [localhost-startStop-1] DEBUG org.nutz.mvc.impl.Loadings -    >> add 'net.wendal.nutzbook.action.UserAction'
2016-10-20 15:14:46,967 [localhost-startStop-1] DEBUG org.nutz.ioc.impl.NutIoc - Get 'json'<interface org.nutz.mvc.View>
2016-10-20 15:14:46,969 [localhost-startStop-1] DEBUG org.nutz.ioc.aop.SimpleAopMaker - Load AopConfigure for anno=org.nutz.ioc.aop.Aop by type=org.nutz.ioc.aop.config.impl.AnnotationAopConfigration
2016-10-20 15:14:46,970 [localhost-startStop-1] DEBUG org.nutz.ioc.impl.NutIoc - 	 >> Load definition name=json
2016-10-20 15:14:46,973 [localhost-startStop-1] DEBUG org.nutz.mvc.impl.NutActionChainMaker - Eval FAIL!! : public java.awt.image.BufferedImage net.wendal.nutzbook.action.CaptchaAction.next(javax.servlet.http.HttpSession,int,int)
org.nutz.ioc.IocException: [json] # For object [json] - type:[interface org.nutz.mvc.View]
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:218)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:239)
	at org.nutz.mvc.view.DefaultViewMaker.make(DefaultViewMaker.java:65)
	at org.nutz.mvc.view.ViewZone.makeView(ViewZone.java:86)
	at org.nutz.mvc.impl.processor.ViewProcessor.evalView(ViewProcessor.java:89)
	at org.nutz.mvc.impl.processor.FailProcessor.init(FailProcessor.java:22)
	at org.nutz.mvc.impl.NutActionChainMaker.eval(NutActionChainMaker.java:44)
	at org.nutz.mvc.impl.UrlMappingImpl.add(UrlMappingImpl.java:54)
	at org.nutz.mvc.impl.NutLoading.evalUrlMapping(NutLoading.java:204)
	at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:108)
	at org.nutz.mvc.ActionHandler.<init>(ActionHandler.java:19)
	at org.nutz.mvc.NutFilter._init(NutFilter.java:87)
	at org.nutz.mvc.NutFilter.init(NutFilter.java:65)
	at net.wendal.nutzbook.mvc.NutzBookNutFilter.init(NutzBookNutFilter.java:22)
	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.<init>(ApplicationFilterConfig.java:105)
	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4700)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5340)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1407)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1397)
	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: org.nutz.ioc.ObjectLoadException: Object 'json' without define!
	at org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:174)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:180)
	... 25 more
2016-10-20 15:14:46,977 [localhost-startStop-1] ERROR org.nutz.mvc.impl.NutLoading - Error happend during start serivce!
org.nutz.ioc.IocException: [json] # For object [json] - type:[interface org.nutz.mvc.View]
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:218)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:239)
	at org.nutz.mvc.view.DefaultViewMaker.make(DefaultViewMaker.java:65)
	at org.nutz.mvc.view.ViewZone.makeView(ViewZone.java:86)
	at org.nutz.mvc.impl.processor.ViewProcessor.evalView(ViewProcessor.java:89)
	at org.nutz.mvc.impl.processor.FailProcessor.init(FailProcessor.java:22)
	at org.nutz.mvc.impl.NutActionChainMaker.eval(NutActionChainMaker.java:44)
	at org.nutz.mvc.impl.UrlMappingImpl.add(UrlMappingImpl.java:54)
	at org.nutz.mvc.impl.NutLoading.evalUrlMapping(NutLoading.java:204)
	at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:108)
	at org.nutz.mvc.ActionHandler.<init>(ActionHandler.java:19)
	at org.nutz.mvc.NutFilter._init(NutFilter.java:87)
	at org.nutz.mvc.NutFilter.init(NutFilter.java:65)
	at net.wendal.nutzbook.mvc.NutzBookNutFilter.init(NutzBookNutFilter.java:22)
	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.<init>(ApplicationFilterConfig.java:105)
	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4700)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5340)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1407)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1397)
	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: org.nutz.ioc.ObjectLoadException: Object 'json' without define!
	at org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:174)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:180)
	... 25 more
2016-10-20 15:14:46,978 [localhost-startStop-1] ERROR org.nutz.mvc.impl.NutLoading - try to depose ioc
2016-10-20 15:14:46,982 [localhost-startStop-1] INFO  org.nutz.ioc.impl.NutIoc - org.nutz.ioc.impl.NutIoc@1220804499 is closing. startup date [16-10-20 15:14:46.889]
2016-10-20 15:14:46,982 [localhost-startStop-1] INFO  org.nutz.ioc.impl.NutIoc - org.nutz.ioc.impl.NutIoc@1220804499 is deposed. startup date [16-10-20 15:14:46.889]
十月 20, 2016 3:14:46 下午 org.apache.catalina.core.StandardContext filterStart
严重: Exception starting filter nutz
org.nutz.mvc.LoadingException: org.nutz.ioc.IocException: [json] # For object [json] - type:[interface org.nutz.mvc.View]
	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:17)
	at org.nutz.lang.born.BornContext.doBorn(BornContext.java:60)
	at org.nutz.lang.Mirror.born(Mirror.java:990)
	at org.nutz.lang.Lang.wrapThrow(Lang.java:198)
	at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:135)
	at org.nutz.mvc.ActionHandler.<init>(ActionHandler.java:19)
	at org.nutz.mvc.NutFilter._init(NutFilter.java:87)
	at org.nutz.mvc.NutFilter.init(NutFilter.java:65)
	at net.wendal.nutzbook.mvc.NutzBookNutFilter.init(NutzBookNutFilter.java:22)
	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.<init>(ApplicationFilterConfig.java:105)
	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4700)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5340)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1407)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1397)
	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: org.nutz.ioc.IocException: [json] # For object [json] - type:[interface org.nutz.mvc.View]
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:218)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:239)
	at org.nutz.mvc.view.DefaultViewMaker.make(DefaultViewMaker.java:65)
	at org.nutz.mvc.view.ViewZone.makeView(ViewZone.java:86)
	at org.nutz.mvc.impl.processor.ViewProcessor.evalView(ViewProcessor.java:89)
	at org.nutz.mvc.impl.processor.FailProcessor.init(FailProcessor.java:22)
	at org.nutz.mvc.impl.NutActionChainMaker.eval(NutActionChainMaker.java:44)
	at org.nutz.mvc.impl.UrlMappingImpl.add(UrlMappingImpl.java:54)
	at org.nutz.mvc.impl.NutLoading.evalUrlMapping(NutLoading.java:204)
	at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:108)
	... 16 more
Caused by: org.nutz.ioc.ObjectLoadException: Object 'json' without define!
	at org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:174)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:180)
	... 25 more

十月 20, 2016 3:14:46 下午 org.apache.catalina.core.StandardContext startInternal
严重: One or more Filters failed to start. Full details will be found in the appropriate container log file
十月 20, 2016 3:14:46 下午 org.apache.catalina.core.StandardContext startInternal
严重: Context [/nutzbook] startup failed due to previous errors
十月 20, 2016 3:14:46 下午 org.apache.catalina.core.ApplicationContext log
信息: Cleaning up Shiro Environment
十月 20, 2016 3:14:46 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-nio-8080"]
十月 20, 2016 3:14:47 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["ajp-nio-8009"]
十月 20, 2016 3:14:47 下午 org.apache.catalina.startup.Catalina start
信息: Server startup in 3369 ms

如果将java代码注释掉,那么启动正常

8 回复

MainModule的@Fail写错了

@wendal
//添加模块类自动扫描
@Modules(scanPackage=true)
@Ok("ioc:json")
@Fail("ioc:json")
@IocBy(type=ComboIocProvider.class, args={"*js", "ioc/",
"*anno", "net.wendal.nutzbook",
"*tx",
"*org.nutz.integration.quartz.QuartzIocLoader"})
@ChainBy(args="mvc/nutzbook-mvc-chain.js")
@SetupBy(StartSetup.class)
public class MainModule {

}

这是哪里抄来的??

@Ok("ioc:json")
@Fail("ioc:json")

改成

@Ok("json")
@Fail("json")

这个是我们公司已上线的一个项目里写的。此项目中有使用过@Ok("raw")的注释,没见有问题啊

这两种写法有什么区别吗

ioc:json 是需要ioc js里面配了一个叫json的bean

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