struts2 log4j文件配置问题

如何用lo4j配置文件实现以下功能:

在每天凌晨生成文件。输出日志。

输出的日志以每天的日期为命名


  小弟百度,google了半天。没找到合适答案。。。求解

1个回答

[code="java"]
log4j.rootLogger=INFO,file

log4j.appender.file=org.apache.log4j.DailyRollingFileAppender
log4j.appender.file.File=app.log
log4j.appender.file.DatePattern='.'yyyy-MM-dd
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%-d{yyyy-MM-dd HH:mm:ss} [%c]-[%p] %m%n
[/code]

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
如何配置log4j

我的环境是struts2.1.6, 使用commons-logging-1.1.1.jar 我配置log4j的步骤如下: 1. 将log4j-1.2.9.jar拷贝到WEB-INF/lib目录下 2. 在WEB-INF/classes下建立log4j.properties文件,文件内容如下: [code="java"]log4j.rootLogger=ERROR, errfile log4j.appender.errfile=org.apache.log4j.DailyRollingFileAppender log4j.appender.errfile.File=D:\bugu_err.log log4j.appender.errfile.layout=org.apache.log4j.PatternLayout log4j.appender.errfile.layout.ConversionPattern=%d-[TS] %p %t %c - %m%n[/code] 3. java代码如下: [code="java"]public class ExceptionLogInterceptor extends AbstractInterceptor { private final Log log = LogFactory.getLog(getClass()); static Logger logger = Logger.getLogger(ExceptionLogInterceptor.class.getName()); public String intercept(ActionInvocation invocation) throws Exception { String result = ""; try { result = invocation.invoke(); } catch (Exception e) { System.out.print("exception log"); log.error("log4j:" + e.getMessage()); logger.error("test log4j 1.2.9"); } return result; } }[/code] 问题:运行程序之后并没有生成D:\bugu_err.log文件(控制台已打出"exception log"信息,即log.error("log4j:" + e.getMessage()) 和 logger.error("test log4j 1.2.9")有被执行到) 请教:应该如何正确配置log4j,以及代码里面应该如何正确调用log4j写log?谢谢! [b]问题补充:[/b] to lwx_1987: 怎样"在应用程序启动时对log4j进行初始化"?能否详细点?

Log4j配置文件路径问题

[color=red]为什么我在做练习的时候。Log4j的配置文件一定要放在工程的根目录下(就是src目录下)。放在其它的地方就不行.[/color] 我在运用当中是用一个Servlet去负责载入Log4j的配置文件。然后就不用在其它地方每次都去加载配置文件。(如我的InitLog4j.java)我在web.xml中配置了这个Servlet。并且给了一个初使化参数--就是log4j配置文件的路径(我没有放在src目录下。但路径是没有错的。否则启动Tomcat5.5进行加载的时候就会报找不到指定文件的异常。)。我让这个Servlet是一启动就自动加载的。如下是我的配置文件的相关信息: <servlet> <servlet-name>InitLog4j</servlet-name> <servlet-class>net.yaye.control.InitLog4j</servlet-class> <init-param> <param-name>log4j</param-name> <param-value>/WEB-INF/classes/net/yaye/conf/log4j.properties</param-value><!--我放在了一个conf包内,[color=red]路径没有错[/color];如果我把Log4j配置文件放在src根目录下,就不会出错--> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>InitLog4j</servlet-name> <url-pattern>/InitLog4j</url-pattern> </servlet-mapping> 但Tomcat启动完毕后。这个Servlet自动加载了。但却报错: log4j:WARN No appenders could be found for logger (org.apache.commons.digester.Digester). log4j:WARN Please initialize the log4j system properly. 然后我试着在应用程序中获取一个日志对象时,就会警告说没有初使化log4j: log4j:WARN No appenders could be found for logger (net.yaye.model.LoggerHandler). log4j:WARN Please initialize the log4j system properly. [color=red](如果我把Log4j配置文件放在src根目录下,就不会出错)[/color] [b]问题补充:[/b] [color=red]我在代码中也指定log4j的配置文件的相对应的路径[/color] [b]问题补充:[/b] 代码中是这样加载的: String basepath = getServletContext().getRealPath("/"); String configfile = getInitParameter("log4j"); PropertyConfigurator.configure(basepath+configfile); [b]问题补充:[/b] 如果我提供的路径不对的话,那Tomcat启动加载的时候就会报FileNotFoundException这个异常了,那我肯定会知道是路径不对拉! 负责加载的代码也执行了,我测试过的.但还是报这个警告错误: log4j:WARN No appenders could be found for logger (net.yaye.model.LoggerHandler). log4j:WARN Please initialize the log4j system properly. [b]问题补充:[/b] 经过我自己的反复试验,我发现一个现象:   只要你在工程的根目录(src目录)下有一个Log4j的配置文件(里面配置了Appender),即使你不手动去加载这个配置文件(意思就是说你什么前提工作都不用做,也照样可以取得日志记录器!),Log4j也会自动去加载这个配置文件的,但是前提是这个配置文件的名称一定要是log4j.properties这个名字!不知是不是对扩展名也有要求(我没有试过)?不过好象是区分大小的(因为我试过把这个名字的首字母大写了,就不行),反正我试过几个名字,就只有配置文件名为log4j.properties的才会通过。而且这个现象与框架无关,比如:struts、hibernate、spring。当然了,之后你自己再去手动加载也不会错的! 但记住,只要你的工程的根目录(src目录)下没有一个Log4j的配置文件(名叫log4j.properties),Tomcat启动加载应用程序时就会出现警告: log4j:WARN No appenders could be found for logger (org.apache.commons.digester.Digester). log4j:WARN Please initialize the log4j system properly. 但这个警告对实际上你已有过对log4j的配置文件进行加载的时候根本就是骗人的,因为之后你去获得一个一个日志记录器的时候,就不会出现警告说没有找到Appenders的话,因为你已经加载了嘛,所以这是个幻觉!! 我的理解就到这里,不知还有哪位高手能有更高深的见解。或者指出我的理解错误。 小生在这里抛砖引玉了! [b]问题补充:[/b] 我说的都是启动Tomcat时出现的信息!!

log4j控制台信息输出问题

#main log4j.properties log4j.rootLogger=INFO,fileout,file log4j.logger.org.apache.struts=ERROR log4j.logger.org.apache.commons=ERROR log4j.logger.org.hibernate=ERROR log4j.logger.org.springframework=ERROR log4j.logger.com.opensymphony=ERROR #Filelogfile log4j.appender.fileout=org.apache.log4j.DailyRollingFileAppender log4j.appender.fileout.MaxFileSize=512KB log4j.appender.fileout.MaxBackupIndex=3 log4j.appender.fileout.layout=org.apache.log4j.PatternLayout #log4j.appender.fileout.layout.ConversionPattern=%d{yyyy-MM-dd HH\:mm\:ss} %X{id},%X{name},[\u7528\u6237\:%X{loginName}],[\u7528\u6237\u767B\u5F55IP\:%X{userip}],[\u7528\u6237\u64CD\u4F5C\:%m] %C%l%n log4j.appender.fileout.layout.ConversionPattern= %d - %c -%-4r [%t] %-5p %c %x - %m%n #\u65E5\u5FD7\u6587\u4EF6\u7684\u8DEF\u5F84\uFF0C${catalina.home} \u5373Tomcat\u4E0B log4j.appender.fileout.File=E\:\\tomcatlog\\log-gymallPM.log #log4j.appender.fileout.DatePattern='.'yyyy-MM-dd log4j.appender.R.DatePattern='_'yyyy-MM-dd'.log' log4j.appender.fileout.Append=false log4j.appender.fileout.Threshold=INFO 这个配置文件里哪些是控制台输出信息的

log4j 与ssh框架日志输出问题

log4j我知道是日志软件,但我现在想不明白的是项目中加了log4j,然后在log4j配置文件中写它的输出格式,我的项目是ssh框架,spring,struts2输出的日志是按照log4j的格式输出,为什么hibernate没有??还有我就是想问这三大框架的日志也是log4j输出的吗

新手,使用Intellij Idea测试Struts2遇到的问题

Idea版本为2018.3,按照提示,Struts2版本为2.5.14,配置完毕,遇到了问题。 第一个问题就是log4j的错误,经过各种尝试,删除out-》artifact-》module-》web-inf-》web.xml,可以正常部署。 然后加入Struts2内容,跳转action时遇到404,请帮忙看看什么问题。 web.xml如下: ``` <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd" version="4.0"> <filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class> </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> </web-app> ``` struts.xml如下: ``` <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.5//EN" "http://struts.apache.org/dtds/struts-2.5.dtd"> <struts> <package name="first" namespace="/" extends="struts-default"> <action name="test" class="com.opensymphony.xwork2.ActionSupport" method="execute"> <result name="success">/success.jsp</result> </action> </package> </struts> ``` index.jsp如下: ``` <%@ page contentType="text/html;charset=UTF-8" language="java" %> <html> <head> <title>$Title$</title> </head> <body> <form action="test.action" method="post"><input type="submit"/></form> </body> </html> ```

请教:log4j 问题

我的log4j配置文件内容如下: [code="java"]log4j.rootLogger=ERROR, R log4j.logger.noModule=ERROR log4j.appender.R=org.apache.log4j.DailyRollingFileAppender log4j.appender.R.File=D:\\bugu_err.log log4j.appender.R.layout=org.apache.log4j.PatternLayout log4j.appender.R.layout.ConversionPattern=%d-[TS] %p %t %c - %m%n log4j.appender.R.MaxBackupIndex=1[/code] 现在的情况是:每天它都将产生一个新的bugu_err.log,但旧的log没有备份下来。我想将30天内的log文件都备份下来,如何配置?谢谢

struts2与hibernate的日志配置出错

#log4j.rootLogger=DEBUG,A1,R log4j.rootLogger=INFO,A1,R log4j.appender.A1=org.apache.log4j.ConsoleAppender log4j.appender.A1.layout=org.apache.log4j.PatternLayout log4j.appender.A1.layout.ConversionPattern=%-d{yyyy-MM-dd HH:mm:ss,SSS} [%c]-[%p] %m%n log4j.appender.R=org.apache.log4j.RollingFileAppender log4j.appender.R.File=mylog.log log4j.appender.R.MaxFileSize=500KB log4j.appender.R.MaxBackupIndex=10 log4j.appender.R.layout=org.apache.log4j.PatternLayout log4j.appender.R.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} [%t] [%c] [%p] - %m%n 这是我的log4j.properties文件, log.info("查询显示在主页左边上方的文章表内容"); List<News> list = id.selNews1(); log.info("查询显示在主页左边上方的文章表内容"); 为什么我的log.info里面的文字,不会在mylog.log的日志文件里出现呢?

诚信请教Log4输出日志文件问题,急,急,急

我用struts2+ibatis搭建的框架,在日志文件输出的时候遇到这个问题很是纠结,希望大家帮个忙解释哈……,谢谢了 首先我在log4的资源文件中配置如下: [img]http://dl.iteye.com/upload/attachment/533623/370df173-5525-3a13-925f-206474bedcce.jpg[/img] 然后我启动项目,我测试日志输出的代码写在登录方法里面代码如下: [img]http://dl.iteye.com/upload/attachment/533626/c9a12f46-cb94-39e0-a22a-7dc404790c17.jpg[/img] 然后运行发现:有日志文件在handlog.log文件在D:\workspace\.metadata\.me_tcat\webapps\Own_Project\log目录下面, 后面 我写了个测试类代码如下: [img]http://dl.iteye.com/upload/attachment/533628/a01a23f1-0579-3ec9-912c-156f0e7dc2c6.jpg[/img] 运行后发现:有日志文件在handlog.log文件在D:\workspace\.metadata\.me_tcat\webapps\Own_Project\log目录下面, log4的资源文件配置改成如下: [img]http://dl.iteye.com/upload/attachment/533630/0211c3c6-95d7-351c-a08b-fdfa88922707.jpg[/img] 最后,我改了登录方法代码如下: [img]http://dl.iteye.com/upload/attachment/533632/e61161cd-145e-35f4-a070-70ef6cefce30.jpg[/img] log4的配置文件和上面那个是一样的都是动态的那种,但是我怎么测试都输出不了日志文件???这是为什么呢???

Maven2 ibatis log4j配置时的问题

项目本来是用Maven2 管理的,用了struts2 ibatis 等等框架,今天做单元测试,发现ibatis不显示实际执行的SQL实在难过就网上搜了一下怎么才能显示,得知需要配置log4j,于是想正好就把日志啊什么的都添加上。 可是在pom中添加了commons-logging 和log4j依赖后,再次mvn test,就开始报错了。具体信息贴在下面。 我尝试删了出错的几个jar文件,让maven重新下载,但是没有作用。 -------------------------------------------------------------------------------------------------- [WARNING] POM for 'javax.jms:jms:pom:1.1:compile' is invalid. Its dependencies (if any) will NOT be available to the current build. [WARNING] POM for 'com.sun.jdmk:jmxtools:pom:1.2.1:compile' is invalid. Its dependencies (if any) will NOT be available to the current build. [WARNING] POM for 'com.sun.jmx:jmxri:pom:1.2.1:compile' is invalid. ... Failure executing javac, but could not parse the error: 错误:读取 F:\.m2\repository\javax\jms\jms\1.1\jms-1.1.jar 时出错; error in opening zip file 错误:读取 F:\.m2\repository\com\sun\jdmk\jmxtools\1.2.1\jmxtools-1.2.1.jar 时出错; error in opening zip file 错误:读取 F:\.m2\repository\com\sun\jmx\jmxri\1.2.1\jmxri-1.2.1.jar 时出错; error in opeing zip file 3 错误 ------------------------------------------------------------------------------------------------- 希望有知道怎么回事或者也曾遇到过类似问题的人能帮忙.谢谢 [color=red]该问题已经解决,只是将 log4j 的版本从1.2.15改成1.2.14,但是具体出错原因我还没有找到,希望有人能把解决方法贴到回复里面,我好做有满意答案结贴方便以后查找的人^_^[/color]

struts2导入多个xml,第一个没问题,第二个报错

struts.xml [code="xml"]<?xml version="1.0" encoding="UTF-8"?> <!-- 指定Struts 2配置文件的DTD信息 --> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1.7//EN" "http://struts.apache.org/dtds/struts-2.3.dtd"> <!-- Struts 2配置文件的根元素 --> <struts> <!-- struts2 默认配置文件,必须加进来 有这里看出,当前文件的路径是跟路径下classes路径,所以其他的文件要从classes这个路径开始找 --> <include file="struts-plugin.xml" /> <include file="struts-default.xml" /> <!-- 自己添加的配置文件 --> <include file="../struts2/struts_user.xml" /> <include file="../struts2/struts_sign.xml" /> </struts>[/code] struts_user.xml [code="xml"]<?xml version="1.0" encoding="UTF-8"?> <!-- 指定Struts 2配置文件的DTD信息 --> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1.7//EN" "http://struts.apache.org/dtds/struts-2.3.dtd"> <!-- Struts 2配置文件的根元素 --> <struts> <!-- 配置了系列常量 --> <constant name="struts.i18n.encoding" value="UTF-8" /> <constant name="struts.devMode" value="true" /> <package name="Aberic" extends="struts-default"> <!-- 定义处理用户请求的Action --> <action name="login" class="loginAction"> <!-- 为两个逻辑视图配置视图页面 --> <result name="error">/error.jsp</result> <result name="success">/admin/admin.jsp</result> <interceptor-ref name="sessionstack" /> </action> </package> </struts>[/code] struts_sign.xml [code="xml"]<?xml version="1.0" encoding="UTF-8"?> <!-- 指定Struts 2配置文件的DTD信息 --> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1.7//EN" "http://struts.apache.org/dtds/struts-2.3.dtd"> <!-- Struts 2配置文件的根元素 --> <struts> <!-- 配置了系列常量 --> <constant name="struts.i18n.encoding" value="UTF-8" /> <constant name="struts.devMode" value="true" /> <package name="Aberic" extends="struts-default"> <!-- 定义处理用户请求的Action --> <action name="sign" class="PhoneSignAction"> <!-- 因为仅提供手机签到,故不配置任何视图 --> <result type="stream"> <param name="contentType">text/html</param> <param name="inputName">inputStream</param> </result> </action> </package> </struts>[/code] web.xml [code="xml"]<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"> <servlet> <servlet-name>proxoolServletConfigurator</servlet-name> <servlet-class> org.logicalcobwebs.proxool.configuration.ServletConfigurator </servlet-class> <init-param> <param-name>xmlFile</param-name> <param-value>WEB-INF/proxool.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <context-param> <param-name>log4jConfigLocation</param-name> <param-value>/WEB-INF/log4j.properties</param-value> </context-param> <context-param> <param-name>log4jRefreshInterval</param-name> <param-value>60000</param-value> </context-param> <listener> <listener-class> org.springframework.web.util.Log4jConfigListener </listener-class> </listener> <context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/spring/applicationContext.xml</param-value> </context-param> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class> <init-param> <param-name>config</param-name> <param-value>struts-default.xml,struts-plugin.xml,../struts2/struts.xml</param-value> </init-param> </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <session-config> <session-timeout>30</session-timeout> </session-config> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> </web-app>[/code] 因为我配的有spring,所以action中class没有指定类而是交给spring管理了 现在有一个奇怪的问题就是当我把../struts2/struts_user.xml先include进去的时候,就能够成功加载进去,登陆操作无误 当我把../struts2/struts_sign.xml放在../struts2/struts_user.xml上面的时候,就成了签到成功,但登陆却提示找不到action了 总之就是只能有一个生效,这个问题纠结了好几天了 具体报错为There is no action …… namespace[/]……这种

struts2的xml内result导致项目访问404问题

<p>运性环境是:<br>       myeclipse5.5<br>      tocamt 5.5<br>      jdk 1.6</p> <p> </p> <p>问题查出来是因为 struts.xml内action里的result的问题 只要它存在就报错 不存在就正常 以下是配置文件相应代码和信息</p> <p> </p> <pre name="code" class="控制台信息">2010-4-9 13:55:12 org.apache.catalina.core.AprLifecycleListener lifecycleEvent 信息: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: D:\chen\Environment\Java\jdk1.6.0_02\bin;D:\chen\Environment\Tomcat 5.5\bin 2010-4-9 13:55:13 org.apache.coyote.http11.Http11BaseProtocol init 信息: Initializing Coyote HTTP/1.1 on http-8081 2010-4-9 13:55:13 org.apache.catalina.startup.Catalina load 信息: Initialization processed in 3047 ms 2010-4-9 13:55:13 org.apache.catalina.core.StandardService start 信息: Starting service Catalina 2010-4-9 13:55:13 org.apache.catalina.core.StandardEngine start 信息: Starting Servlet Engine: Apache Tomcat/5.5.25 2010-4-9 13:55:13 org.apache.catalina.core.StandardHost start 信息: XML validation disabled log4j:WARN No appenders could be found for logger (org.apache.commons.digester.Digester.sax). log4j:WARN Please initialize the log4j system properly. 2010-4-9 13:55:18 org.apache.catalina.core.StandardContext start 严重: Error filterStart 2010-4-9 13:55:18 org.apache.catalina.core.StandardContext start 严重: Context [/a] startup failed due to previous errors 2010-4-9 13:55:18 org.apache.catalina.core.ApplicationContext log 信息: org.apache.webapp.balancer.BalancerFilter: init(): ruleChain: [org.apache.webapp.balancer.RuleChain: [org.apache.webapp.balancer.rules.URLStringMatchRule: Target string: News / Redirect URL: http://www.cnn.com], [org.apache.webapp.balancer.rules.RequestParameterRule: Target param name: paramName / Target param value: paramValue / Redirect URL: http://www.yahoo.com], [org.apache.webapp.balancer.rules.AcceptEverythingRule: Redirect URL: http://jakarta.apache.org]] 2010-4-9 13:55:19 org.apache.catalina.core.ApplicationContext log 信息: ContextListener: contextInitialized() 2010-4-9 13:55:19 org.apache.catalina.core.ApplicationContext log 信息: SessionListener: contextInitialized() 2010-4-9 13:55:19 org.apache.catalina.core.ApplicationContext log 信息: ContextListener: contextInitialized() 2010-4-9 13:55:19 org.apache.catalina.core.ApplicationContext log 信息: SessionListener: contextInitialized() 2010-4-9 13:55:19 org.apache.coyote.http11.Http11BaseProtocol start 信息: Starting Coyote HTTP/1.1 on http-8081 2010-4-9 13:55:19 org.apache.jk.common.ChannelSocket init 信息: JK: ajp13 listening on /0.0.0.0:8009 2010-4-9 13:55:19 org.apache.jk.server.JkMain start 信息: Jk running ID=0 time=0/62 config=null 2010-4-9 13:55:19 org.apache.catalina.storeconfig.StoreLoader load 信息: Find registry server-registry.xml at classpath resource 2010-4-9 13:55:19 org.apache.catalina.startup.Catalina start 信息: Server startup in 6703 ms </pre> <p> </p> <pre name="code" class="struts.xml">&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"&gt; &lt;struts &gt; &lt;package name="add" namespace="/" abstract="struts-default"&gt; &lt;action name="addUser" class="com.chen.test.action.add.AddUserAction"&gt; &lt;!--问题就是下面这个result它存在就报错 不存在就没问题--&gt; &lt;result name="success"&gt;/index.jsp&lt;/result&gt; &lt;/action&gt; &lt;/package&gt; &lt;/struts&gt; </pre> <p> </p> <pre name="code" class="action类">package com.chen.test.action.add; import com.chen.test.dao.UserDAO; import com.chen.test.dao.impl.UserDAOImpl; import com.chen.test.pojo.User; import com.opensymphony.xwork2.ActionSupport; public class AddUserAction extends ActionSupport { private User user; private UserDAO userDAO=new UserDAOImpl(); public User getUser() { return user; } public void setUser(User user) { this.user = user; } @Override public String execute() throws Exception { return SUCCESS; } } </pre> <p> </p> <pre name="code" class="web.xml">&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"&gt; &lt;filter&gt; &lt;filter-name&gt;struts2&lt;/filter-name&gt; &lt;filter-class&gt;org.apache.struts2.dispatcher.FilterDispatcher&lt;/filter-class&gt; &lt;/filter&gt; &lt;filter-mapping&gt; &lt;filter-name&gt;struts2&lt;/filter-name&gt; &lt;url-pattern&gt;/*&lt;/url-pattern&gt; &lt;/filter-mapping&gt; &lt;welcome-file-list&gt; &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt; &lt;/welcome-file-list&gt; &lt;/web-app&gt; </pre> <p> </p>

一个用spring aop拦截struts action的问题

最近我需要在不改变原有的代码的前提下,记录到达struts action的HttpServletRequest和HttpServletResponse,我的第一想法就是用spring aop来做拦截。但是,这样做使得原来struts action无法获得struts上下文的内容信息,为了说明问题,我写了一个小原型,代码如下: [color=red]类SimpleAction,这个类是用来封装获得HttpServletRequest和HttpServletResponse的方法的,跟本主题关系不大,可以跳过。[/color] package action; import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts2.interceptor.ServletRequestAware; import org.apache.struts2.interceptor.ServletResponseAware; import org.apache.struts2.interceptor.SessionAware; import com.opensymphony.xwork2.ActionSupport; public class SimpleAction extends ActionSupport implements ServletRequestAware, ServletResponseAware ,SessionAware{ protected HttpServletRequest servletRequest; protected HttpServletResponse servletResponse; protected Map session; public Map getSession() { return session; } public void setSession(Map session) { this.session = session; } public void setServletRequest(HttpServletRequest request) { this.servletRequest = request; } public HttpServletRequest getServletRequest() { return this.servletRequest; } public void setServletResponse(HttpServletResponse response) { this.servletResponse = response; } public HttpServletResponse getServletResponse() { return this.servletResponse; } } 类LoginAction,这个类的execute就是struts处理action调用的方法,但是奇怪的是,在这个方法中,本应得到jsp传来的值得username和password为空(把spring aop相关配置注释掉之后,username和password能正常传值)。loginService.validate()用作判断username和password是否符合,不符合以抛出异常的方式来告知调用者。在加上spring aop后,由于[color=red]username和password为空[/color],所以就一直返回结果"usernameInvalid"。 package action; import org.apache.struts2.interceptor.ServletRequestAware; import org.apache.struts2.interceptor.ServletResponseAware; import org.apache.struts2.interceptor.SessionAware; import service.LoginService; import exception.*; public class LoginAction extends SimpleAction { private String username; private String password; private LoginService loginService; public LoginService getLoginService() { return loginService; } public void setLoginService(LoginService loginService) { this.loginService = loginService; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } @Override public void validate() { } @Override public String execute() { try{ this.getServletRequest().setAttribute("username", username); this.getServletRequest().setAttribute("password", password); System.out.println("username"+username); System.out.println("username"+getUsername()); boolean result = loginService.validate(username, password); }catch(UsernameException ue) { return "usernameInvalid"; }catch(PasswordException pe) { return "passwordInvalid"; }catch(Exception e) { e.printStackTrace(); return INPUT; } return SUCCESS; } } 下面是advice类,用来处理调用方法后的日志记录工作 package advice; import java.io.*; import java.lang.reflect.Method; import org.apache.log4j.Logger; import org.apache.log4j.PropertyConfigurator; import org.springframework.aop.AfterReturningAdvice; import org.springframework.aop.MethodBeforeAdvice; import org.springframework.aop.ThrowsAdvice; public class LogActionAdvice implements AfterReturningAdvice { public void afterReturning(Object arg0, Method arg1, Object[] arg2, Object target) { // TODO Auto-generated method stub try { PropertyConfigurator.configure("after.properties"); Logger logger = Logger.getLogger(target.getClass()); logger.debug("..."); }catch(Exception e) { e.printStackTrace(); } } } 下面是login页面,这个页面的username空间对应action的username属性,所以应该不是struts没有配alias的问题,这里是login.jsp代码 <%@ page language="java" pageEncoding="GB2312"%> <%@ taglib prefix="s" uri="/struts-tags"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//CN"> <html> <head> <title>login2</title> </head> <body> <s:form name="login" action="login" method="post" > <s:textfield name="username" label="帐号"></s:textfield> <s:password name="password" label="密码"></s:password> <s:submit></s:submit> </s:form> </body> </html> 下面是配置文件,首先是struts的配置文件struts.xml: <?xml version="1.0" encoding="GB2312" ?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"> <struts> <package name="struts2" extends="struts-default"> <action name="login" class="LoginAction"> <result name="success">/index.jsp</result> <result name="input">/login.jsp</result> <result name="usernameInvalid">/usernameInvalid.jsp</result> <result name="passwordInvalid">/passwordInvalid.jsp</result> </action> </package> </struts> 再来是spring的配置文件applicationContext.xml,红色部分是advice的配置,具体是匹配所有*Action的execute方法。 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:ehcache="http://www.springmodules.org/schema/ehcache" xmlns:context="http://www.springframework.org/schema/context" xmlns:aop="http://www.springframework.org/schema/aop" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.5.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd http://www.springmodules.org/schema/ehcache http://www.springmodules.org/schema/cache/springmodules-ehcache.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd" default-lazy-init="true" default-autowire="byName"> [color=red] <aop:config> <aop:advisor id="methodAroundAdviceAdvisor" advice-ref="logActionAdvice" pointcut="execution(* *..*Action.execute(..))" /> </aop:config> <bean id="logActionAdvice" class="advice.LogActionAdvice" />[/color] <bean name="loginService" class="service.LoginService" /> <bean name="LoginAction" class="action.LoginAction"> <property name="loginService"> <ref bean="loginService"/> </property> </bean> </beans> 最后是web.xml的源码: <?xml version="1.0" encoding="UTF-8"?> <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> <!-- 加载struts2核心 --> <filter> <filter-name>struts2</filter-name> <filter-class> org.apache.struts2.dispatcher.FilterDispatcher </filter-class> </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <!-- 指明spring配置文件在何处 --> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:applicationContext.xml</param-value> </context-param> <!-- 加载spring配置文件applicationContext.xml --> <listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener> </web-app> 在这个原型中出现的问题是,在LoginAction中,username和password为空,但是,[color=red]如果把它们set到 HttpServletRequest中,在页面usernameInvalid.jsp中却能够得到username和password的值。[/color]事先我查过一些资料,说用spring aop自动生成的代理无法获得struts上下文传递的变量值,但是我想不通为何把它们set到HttpServletRequest后却能够在前端页面显示出正确的值。 谢谢您的阅读和帮助!

struts2注解url没跳转到action里的方法,没报错也没跳转

我补下图片: ![图片说明](https://img-ask.csdn.net/upload/201509/21/1442781387_310218.png) package com.AppServer.action; import javax.annotation.Resource; import org.apache.struts2.convention.annotation.Action; import org.apache.struts2.convention.annotation.ExceptionMapping; import org.apache.struts2.convention.annotation.ExceptionMappings; import org.apache.struts2.convention.annotation.Namespace; import org.apache.struts2.convention.annotation.ParentPackage; import org.apache.struts2.convention.annotation.Result; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Controller; import org.springframework.stereotype.Service; import com.AppServer.bean.User; import com.AppServer.dao.UserDAO; import com.AppServer.service.UserService; import com.demo.interceptor.MethodCacheInterceptor; import com.opensymphony.xwork2.ActionSupport; import com.opensymphony.xwork2.ModelDriven; @Controller @ParentPackage("struts-default") @Namespace(value = "msgAction") @ExceptionMappings({ @ExceptionMapping(exception = "java.lange.RuntimeException", result = "error") }) public class MsgAction extends ActionSupport { private String username; private String password; @Resource private UserService userService; @Action(value = "msg" , results = { @Result(name = "success", location = "/success.jsp"), @Result(name = "failure", location = "/failure.jsp"), @Result(name = "error", location = "/login.jsp")}) //获取用户信息 public String getInfo() { System.out.println("进来玩"); return SUCCESS; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } } url访问如下:http://127.0.0.1:8080/AppServer_1.1/msgAction/msg.do 访问之后没报错,没进去getInfo这个方法 struts2.xml: <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN" "http://struts.apache.org/dtds/struts-2.3.dtd"> <struts> <!-- 指定Web应用的默认编码,相当于调用request的setCharacterEncoding方法 --> <constant name="struts.i18n.encoding" value="UTF-8" /> <!-- 设置浏览器是否缓存静态内容,默认值为true(生产环境下使用),开发阶段最好关闭 --> <constant name="struts.serve.static.browserCache" value="false" /> <!-- 当Struts2的配置文件修改后,系统是否自动重新加载配置文件,默认值为false(生产环境下使用),开发阶段最好打开 --> <constant name="struts.configuration.xml.reload" value="true" /> <!-- 开发模式下使用,这样可以打印出更详细的日志信息 --> <constant name="struts.devMode" value="true" /> <!-- 默认的视图主题 --> <constant name="struts.ui.theme" value="simple" /> <!-- 把Action对象交给Spring创建和管理 --> <constant name="struts.objectFactory" value="spring" /> <!-- Struts2处理的请求后缀,默认值是action --> <constant name="struts.action.extension" value="do" /> <!-- 国际化资源文件 <constant name="struts.custom.i18n.resources" value="globalMessages" /> --> <package name="msg" extends="struts-default"> <default-action-ref name="indexPage" /> <global-results> <result name="exceptionPage">/error/exceptionPage.jsp</result> </global-results> <global-exception-mappings> <exception-mapping result="exceptionPage" exception="java.lang.Exception" /> </global-exception-mappings> <action name="indexPage"> <result>/login.jsp</result> </action> <!-- <action name="msg" method="getInfo" class="com.AppServer.action.MsgAction"> <result name="success">/success.jsp</result> <result name="failure">/failure.jsp</result> <result name="error">/login.jsp</result> </action> --> </package> </struts> application.xml: <?xml version="1.0" encoding="UTF-8" ?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:p="http://www.springframework.org/schema/p" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd" default-autowire="byName" default-lazy-init="true"> <!-- 说明:下面有的Bean配置提供了多种方案,请根据需要采用某一种(别忘了注释掉其他同类方案) --> <!-- 自动扫描Spring注解配置 并保证@Required,@Autowired的属性被注入--> <context:component-scan base-package="com" /> <!-- 自动加载属性配置文件 --> <context:property-placeholder location="classpath:jdbc.properties" /> <!-- 配置数据源:方法一,使用C3P0方式(推荐) --> <!-- <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" --> <!-- destroy-method="close" --> <!-- p:driverClass="${jdbc.driverClassName}" --> <!-- p:jdbcUrl="${jdbc.url}" --> <!-- p:user="${jdbc.username}" --> <!-- p:password="${jdbc.password}" /> --> <!-- <context:property-placeholder location="classpath:jdbc.properties"/> --> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName" value="${jdbc.driverClassName}"/> <property name="url" value="${jdbc.url}"/> <property name="username" value="${jdbc.username}"/> <!-- property池启动时的初始值 --> <property name="password" value="${jdbc.password}"/> <!-- 连接name="initialSize" value="${initialSize}"/>--> <property name="initialSize" value="1"/> <!-- 连接池的最大值 --> <property name="maxActive" value="500"/> <!-- 最大空闲值.当经过一个高峰时间后,连接池可以慢慢将已经用不到的连接慢慢释放一部分,一直减少到maxIdle为止 --> <property name="maxIdle" value="2"/> <!-- 最小空闲值.当空闲的连接数少于阀值时,连接池就会预申请去一些连接,以免洪峰来时来不及申请 --> <property name="minIdle" value="1"/> </bean> <!-- 配置数据源:方法二,使用DBCP方式(不推荐) --> <!-- <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close" p:driverClassName="${jdbc.driverClassName}" p:url="${jdbc.url}" p:username="${jdbc.username}" p:password="${jdbc.password}" /> --> <!-- 配置数据源:方法三,使用JNDI方式 --> <!-- <jee:jndi-lookup id="dataSource" jndi-name="${jndi.name}" /> --> <!-- 配置Hibernate的数据源代理工厂:方法一,使用p属性通配符,按文件名搜索匹配的映射文件 --> <!-- <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean" p:dataSource-ref="dataSource" > <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">${hibernate.dialect}</prop> <prop key="hibernate.show_sql">${hibernate.show_sql}</prop> <prop key="hibernate.format_sql">${hibernate.format_sql}</prop> <prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop> <prop key="hibernate.cache.use_second_level_cache">${hibernate.cache.use_second_level_cache}</prop> <prop key="hibernate.cache.use_query_cache">${hibernate.cache.use_query_cache}</prop> <prop key="hibernate.cache.region.factory_class">${hibernate.cache.region.factory_class}</prop> </props> </property> 加载hibernate的jpa注解形式实体 <property name="packagesToScan"> <list> <value>com.xmm.demo.domain*</value> </list> </property> </bean> --> <!-- 配置Hibernate的数据源代理工厂:方法二,使用list集合,按文件名搜索匹配的映射文件 --> <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean" p:dataSource-ref="dataSource"> <property name="mappingLocations"> <list> <value>classpath*:/com/**/*.hbm.xml</value> </list> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">${hibernate.dialect}</prop> <prop key="hibernate.show_sql">${hibernate.show_sql}</prop> <prop key="hibernate.format_sql">${hibernate.format_sql}</prop> <prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop> <prop key="hibernate.cache.use_second_level_cache">${hibernate.cache.use_second_level_cache}</prop> <prop key="hibernate.cache.use_query_cache">${hibernate.cache.use_query_cache}</prop> <prop key="hibernate.cache.region.factory_class">${hibernate.cache.region.factory_class}</prop> </props> </property> </bean> <!-- 配置Hibernate的数据源代理工厂:方法三,使用p属性通配符,按目录搜索映射文件 --> <!-- <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean" p:dataSource-ref="dataSource" p:mappingDirectoryLocations="classpath*:/com/**/domain"> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">${hibernate.dialect}</prop> <prop key="hibernate.show_sql">${hibernate.show_sql}</prop> <prop key="hibernate.format_sql">${hibernate.format_sql}</prop> <prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop> <prop key="hibernate.cache.use_second_level_cache">${hibernate.cache.use_second_level_cache}</prop> <prop key="hibernate.cache.use_query_cache">${hibernate.cache.use_query_cache}</prop> <prop key="hibernate.cache.region.factory_class">${hibernate.cache.region.factory_class}</prop> </props> </property> </bean> --> <!-- 配置Hibernate的数据源代理工厂:方法四,使用hibernate.cfg.xml --> <!-- <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean" p:dataSource-ref="dataSource" p:configLocation="classpath:hibernate.cfg.xml"> </bean> --> <!-- 配置事务管理器 --> <bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager" p:sessionFactory-ref="sessionFactory" /> <!-- 配置声明式事务:方法一,在Service实现类或者public实现方法上使用注解@Transactional,则此类或方法就会启用事务机制 --> <!-- <tx:annotation-driven transaction-manager="transactionManager" /> --> <!-- 配置声明式事务:方法二,使用tx/aop命名空间的配置(其实还有方法三,由于快要过时不推荐使用了,这里就不给出方法三的配置了) --> <tx:advice id="txAdvice" transaction-manager="transactionManager"> <tx:attributes> <tx:method name="insert*" propagation="REQUIRED" /> <tx:method name="update*" propagation="REQUIRED" /> <tx:method name="edit*" propagation="REQUIRED" /> <tx:method name="save*" propagation="REQUIRED" /> <tx:method name="add*" propagation="REQUIRED" /> <tx:method name="new*" propagation="REQUIRED" /> <tx:method name="set*" propagation="REQUIRED" /> <tx:method name="remove*" propagation="REQUIRED" /> <tx:method name="delete*" propagation="REQUIRED" /> <tx:method name="change*" propagation="REQUIRED" /> <tx:method name="get*" propagation="REQUIRED" read-only="true" /> <tx:method name="find*" propagation="REQUIRED" read-only="true" /> <tx:method name="load*" propagation="REQUIRED" read-only="true" /> <tx:method name="search*" propagation="REQUIRED" read-only="true" /> <tx:method name="*" propagation="REQUIRED" read-only="true" /> </tx:attributes> </tx:advice> <aop:config> <aop:pointcut id="mypointcut" expression="execution(* com.**.service..*.*(..))" /> <aop:advisor advice-ref="txAdvice" pointcut-ref="mypointcut" /> </aop:config> <!-- 下面三个Bean的配置可有可无,但配置后用处更大,通常用于BaseDao类、其他Dao类或特殊工具类中 --> <bean id="hibernateTemplate" class="org.springframework.orm.hibernate4.HibernateTemplate" p:sessionFactory-ref="sessionFactory" /> <bean id="hibernateDaoSupport" class="org.springframework.orm.hibernate4.support.HibernateDaoSupport" p:hibernateTemplate-ref="hibernateTemplate" abstract="true"/> <bean id="sessionFactoryUtils" class="org.springframework.orm.hibernate4.SessionFactoryUtils" abstract="true"/> </beans> tomcat6.0:服务器运行正常: 九月 21, 2015 4:22:24 上午 org.apache.catalina.core.AprLifecycleListener init 信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: D:\Java\jdk1.7.0\bin;E:\tomcat6\bin 九月 21, 2015 4:22:25 上午 org.apache.coyote.http11.Http11Protocol init 信息: Initializing Coyote HTTP/1.1 on http-8080 九月 21, 2015 4:22:25 上午 org.apache.catalina.startup.Catalina load 信息: Initialization processed in 516 ms 九月 21, 2015 4:22:25 上午 org.apache.catalina.core.StandardService start 信息: Starting service Catalina 九月 21, 2015 4:22:25 上午 org.apache.catalina.core.StandardEngine start 信息: Starting Servlet Engine: Apache Tomcat/6.0.41 九月 21, 2015 4:22:25 上午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory AppServer_1.1 九月 21, 2015 4:22:25 上午 org.apache.catalina.loader.WebappClassLoader validateJarFile 信息: validateJarFile(E:\tomcat6\webapps\AppServer_1.1\WEB-INF\lib\servlet-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class 九月 21, 2015 4:22:26 上午 org.apache.catalina.core.ApplicationContext log 信息: Set web app root system property: 'webapp.root' = [E:\tomcat6\webapps\AppServer_1.1\] 九月 21, 2015 4:22:26 上午 org.apache.catalina.core.ApplicationContext log 信息: Initializing log4j from [classpath:log4j.properties] 九月 21, 2015 4:22:26 上午 org.apache.catalina.core.ApplicationContext log 信息: Initializing Spring root WebApplicationContext 九月 21, 2015 4:22:34 上午 org.apache.coyote.http11.Http11Protocol start 信息: Starting Coyote HTTP/1.1 on http-8080 九月 21, 2015 4:22:34 上午 org.apache.jk.common.ChannelSocket init 信息: JK: ajp13 listening on /0.0.0.0:8009 九月 21, 2015 4:22:34 上午 org.apache.jk.server.JkMain start 信息: Jk running ID=0 time=0/23 config=null 九月 21, 2015 4:22:34 上午 org.apache.catalina.startup.Catalina start 信息: Server startup in 9364 ms 测试定时任务:2015-09-21 04:30:00:074 测试定时任务:2015-09-21 04:40:00:004 url访问地址:http://127.0.0.1:8080/AppServer_1.1/msgAction/msg.do 没有进去action的getinfo方法,这是为什么?而且也没有任何的报错!!!!!!!!!!!

SSH搭建好了之后开始测试Struts的Action 转到自己写的404页面

按照李刚的struts讲义写的action 功能是输入用户名密码之后跳转到另外的jsp页面.但是每次都出来404页面.请问是哪边配置有问题? 如果另外ssh框架也没建好还请指正.以下是代码[code="web.xml"]<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"> <display-name>Archetype Created Web Application</display-name> <!-- 以下3项参数与log4j的配置相关 --> <listener> <listener-class> org.springframework.web.util.Log4jConfigListener </listener-class> </listener> <context-param> <param-name>log4jConfigLocation</param-name> <param-value>/WEB-INF/log4j.properties</param-value> </context-param> <context-param> <param-name>log4jRefreshInterval</param-name> <param-value>60000</param-value> </context-param> <!-- 默认情况下,会加载WEB-INF/applicationContext.xml这个文件,我们可以通过配置 contextConfigLocation参数改变配置文件的路径 --> <!-- Spring ApplicationContext配置文件的路径,可使用通配符,多个路径用,号分隔 此参数用于后面的Spring-Context loader --> <!-- 使容器启动时,自动加载applicationContext配置,因为它实现了ServletContextListener这个接口,容器启动时会自动执行它实现的方法。 --> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:*/ApplicationContext.xml,*/action-Servlet.xml</param-value> </context-param> <!-- 加载spring容器 --> <!-- 整合struts 加入中心拦截器 --> <filter> <filter-name>struts2</filter-name> <filter-class> org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter </filter-class> <init-param> <param-name>struts.action.extendion</param-name> <param-value>action</param-value> </init-param> </filter> <!-- <filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class> </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>--> <!-- Struts --> <servlet> <servlet-name>action</servlet-name> <servlet-class>org.apache.struts.action.ActionServlet</servlet-class> <init-param> <param-name>config</param-name> <param-value>/WEB-INF/struts.xml</param-value></init-param> <load-on-startup>2</load-on-startup> </servlet> <!-- session超时定义,单位为分钟 --> <session-config> <session-timeout>120</session-timeout> </session-config> <!-- 默认首页定义 --> <welcome-file-list> <welcome-file>login2.jsp</welcome-file> </welcome-file-list> <!-- Error Page定义 --> <error-page> <exception-type>java.lang.Throwable</exception-type> <location>/commons/error.jsp</location> </error-page> <error-page> <error-code>500</error-code> <location>/commons/error.jsp</location> </error-page> <error-page> <error-code>404</error-code> <location>/commons/404.jsp</location> </error-page> <error-page> <error-code>403</error-code> <location>/commons/403.jsp</location> </error-page> </web-app> [/code] [code="strut.xml"]<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"> <struts> <constant name="struts.devMode" value="true"/> <constant name="struts.objectFactory" value="spring" ></constant> <package name="calvin" extends="struts-default"> <action name="login" class="/loginAction"> <result name="error">index.jsp</result> <result name="success">/pages/index.jsp</result> </action> </package> </struts>[/code] [code="ApplicationContext.xml"]<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"> <!-- Spring容器配置文件 --> <!-- 告诉spring hibernate文件的位置 然后加载 --> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName" value="com.mysql.jdbc.Driver"/> <property name="url" value="jdbc:mysql://localhost:3306/policemanagement?autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=utf-8"/> <property name="username" value="root"/> <property name="password" value="rooot"/> <property name="maxActive" value="100"/> <property name="maxIdle" value="30"/> <property name="maxWait" value="1000"/> <property name="defaultAutoCommit" value="true"/> <property name="removeAbandoned" value="true"/> <property name="removeAbandonedTimeout" value="60"/> <property name="logAbandoned" value="true"/> </bean> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource" ref="dataSource"/> <property name="mappingResources" > <list> <value>calvin/po/pojo/hbm/arrestedPerson.hbm.xml</value> <value>calvin/po/pojo/hbm/caseRegisted.hbm.xml</value> <value>calvin/po/pojo/hbm/caseThread.hbm.xml</value> <value>calvin/po/pojo/hbm/caseVictim.hbm.xml</value> <value>calvin/po/pojo/hbm/policeOfficer.hbm.xml</value> <value>calvin/po/pojo/hbm/victimOffice.hbm.xml</value> </list> </property> <property name="hibernateProperties"> <props><prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop> <prop key="hbm2ddl.auto">create</prop> </props> </property> </bean> <!-- 为hibernte配置事务管理器 --> <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory" ref="sessionFactory" /> </bean> <!-- daoContext 配置原因 所以放在这边 --> <bean id="dao" class="calvin.dao.imp.BaseDAOHibernate"> <property name="sessionFactory" ref="sessionFactory" /></bean> <bean id="policeOfficerDAO" class="calvin.dao.imp.PoliceOfficerImp"> <property name="sessionFactory" ref="sessionFactory" /></bean> <bean id="arrestedPersonDAO" class="calvin.dao.imp.ArrestedPersonImp"> <property name="sessionFactory" ref="sessionFactory" /></bean> <bean id="caseRegisteredDAO" class="calvin.dao.imp.CaseRegisteredImp"> <property name="sessionFactory" ref="sessionFactory" /></bean> <bean id="caseThreadDAO" class="calvin.dao.imp.CaseThreadImp"> <property name="sessionFactory" ref="sessionFactory" /></bean> <bean id="caseVictimDAO" class="calvin.dao.imp.CaseVictimImp"> <property name="sessionFactory" ref="sessionFactory" /></bean> <bean id="victimOfficeDAO" class="calvin.dao.imp.VictimOfficeImp"> <property name="sessionFactory" ref="sessionFactory" /></bean> <!-- ENd --> <!-- IOC 注入机制 --> <!-- 定义事务模板类 --> <bean id="txProxyTemplate" abstract="true" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"> <!-- 注入事务管理器 --> <property name="transactionManager" ref="transactionManager"/> <property name="transactionAttributes"> <props> <prop key="save*">PROPAGATION_REQUIRED</prop> <prop key="remove*">PROPAGATION_REQUIRED</prop> <prop key="*">PROPAGATION_REQUIRED,readOnly</prop> </props> </property></bean> <!-- 配置具体业务逻辑层组件的事物代理 --> <bean id="manager" parent="txProxyTemplate"> <property name="target"> <bean class="calvin.service.BaseManager"> <property name="dao" ref="dao"/> </bean> </property> </bean> <!-- 配置具体的业务逻辑组件额事务代理 --> <!-- 配置业务逻辑组件的事务代理,使用了bean 的继承 --> <!-- 配置所需要的dao组件!!!即这里用的是dao的名字 --> <bean id="facadeManager" parent="txProxyTemplate"> <!-- 配置事务代理时,指定代理的目标,此处的目标是嵌套bean--> <property name="target"> <!-- 嵌套bean无须使用 id属性--> <bean class="calvin.service.imp.FacadeManagerImp"> <!-- 为业务逻辑组件注入DAO组件 --> <property name="victimOfficeDAO" ref="victimOfficeDAO"/> <property name="policeOfficerDAO" ref="policeOfficerDAO"/> <property name="caseVictimDAO" ref="caseVictimDAO"/> <property name="caseThreadDAO" ref="caseThreadDAO"/> <property name="caseRegisteredDAO" ref="caseRegisteredDAO"/> <property name="arrestedPersonDAO" ref="arrestedPersonDAO"/> </bean></property> </bean> <!-- action --> <bean id="myService" class="calvin.action.test.MyServiceImp"/> <bean name="/loginAction" class="calvin.action.LoginAction" scope="prototype"> <property name="ms" ref="myService"/> </bean> </beans>[/code] [code="LoginAction"]package calvin.action; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.junit.Test; import calvin.action.baseAction.BaseAction; import calvin.action.test.MyService; import calvin.po.pojo.PoliceOfficer; public class LoginAction extends BaseAction{ private String username; private String password; private MyService ms; public MyService getMs() { return ms; } public void setMs(MyService ms) { this.ms = ms; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } @Override public String execute() throws Exception{ System.out.println("AAA"); if(ms.valid(getUsername(),getPassword())){ return new String("success"); }else{ return "error";} } } [/code] [code="MyServiceImp"]package calvin.action.test; public class MyServiceImp implements MyService{ public boolean valid(String username,String pass){ return true; } } [/code] 首页配置就是一个很简单的登陆页面.

maven2 xml重复载入

<p>使用maven2时遇到问题<br>struts2报错:<br>Failed startup of context <a href="mailto:org.mortbay.jetty.webapp.WebAppContext@1aaa14a%7B/xun,src/main/webapp">org.mortbay.jetty.webapp.WebAppContext@1aaa14a{/xun,src/main/webapp</a>}<br>Unable to load configuration. - bean - jar:file:/F:/xun/src/main/webapp/WEB-INF/lib/struts2-core-2.1.8.jar!/struts-default.xml:29:72<br>Caused by: Bean type class com.opensymphony.xwork2.ObjectFactory with the name xwork has already been loaded by bean - jar:file<span style="color: #ff0000;"><span style="color: #000000;">:</span>/F:/Repository/org/apache/struts/struts2-core/2.1.8/struts2-core-2.1.8.jar!/struts-default.xml</span>:29:72 - bean - jar:file:<span style="color: #ff0000;">/F:/xun/src/main/webapp/WEB-INF/lib/struts2-core-2.1.8.jar!/struts-default.xml</span>:29:72<br>slf4j警告:<br>SLF4J: Class path contains multiple SLF4J bindings.<br>SLF4J: Found binding in [jar:file:<span style="color: #ff0000;">/F:/Repository/org/slf4j/slf4j-log4j12/1.5.11/slf4j-log4j12-1.5.11.jar!/org/slf4j/impl/StaticLoggerBinder.class</span>]<br>SLF4J: Found binding in [jar:file:<span style="color: #ff0000;">/F:/xun/src/main/webapp/WEB-INF/lib/slf4j-log4j12-1.5.11.jar!/org/slf4j/impl/StaticLoggerBinder.class</span>]</p> <p> </p> <p>看log好像是maven把这两个配置文件载入了两次,弄了好久也不知道怎么解决。。。</p>

每次修改eclipse里的web程序,tomcat就报错提醒,我该改什么配置

Publishing failed with multiple errors Could not delete D:\cui\tomcat-6.0.35-8280\webapps\ermsweb\WEB-INF\logs\debug\debug.log. May be locked by another process. Could not delete D:\cui\tomcat-6.0.35-8280\webapps\ermsweb\WEB-INF\logs\error\error.log. May be locked by another process. Could not delete D:\cui\tomcat-6.0.35-8280\webapps\ermsweb\WEB-INF\logs\info\info.log. May be locked by another process. Could not delete D:\cui\tomcat-6.0.35-8280\webapps\ermsweb\WEB-INF\logs\warn\warn.log. May be locked by another process. ![图片说明](https://img-ask.csdn.net/upload/201610/25/1477386085_48747.png)

struts2.3spring4.1hibernate4.3的集成问题

Error configuring application listener of class org.springframework.web.util.Log4jConfigListener java.lang.ClassNotFoundException: org.springframework.web.util.Log4jConfigListener Error configuring application listener of class org.springframework.web.context.ContextLoaderListener java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener Error configuring application listener of class org.springframework.web.context.request.RequestContextListener java.lang.ClassNotFoundException: org.springframework.web.context.request.RequestContextListener spring-web放在WEB-INF/lib下路径是问题的,不知道哪里出错 ``` <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0"> <display-name>S2316S411H436</display-name> <context-param> <param-name>log4jConfigLocation</param-name> <param-value>classpath:log4j.properties</param-value> </context-param> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:applicationContext.xml</param-value> </context-param> <listener> <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class> </listener> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <listener> <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class> </listener> <filter> <filter-name>encodingFilter</filter-name> <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> <init-param> <param-name>encoding</param-name> <param-value>UTF-8</param-value> </init-param> <init-param> <param-name>forceEncoding</param-name> <param-value>true</param-value> </init-param> </filter> <filter-mapping> <filter-name>encodingFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <filter> <filter-name>struts2Filter</filter-name> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class> </filter> <filter-mapping> <filter-name>struts2Filter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <filter> <filter-name>hibernate4Filter</filter-name> <filter-class>org.springframework.orm.hibernate4.support.OpenSessionInViewFilter</filter-class> </filter> <filter-mapping> <filter-name>hibernate4Filter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <welcome-file-list> <welcome-file>index.html</welcome-file> <welcome-file>index.htm</welcome-file> <welcome-file>index.jsp</welcome-file> <welcome-file>default.html</welcome-file> <welcome-file>default.htm</welcome-file> <welcome-file>default.jsp</welcome-file> </welcome-file-list> </web-app> ``` ``` <?xml version="1.0" encoding="UTF-8" ?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:p="http://www.springframework.org/schema/p" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd"> <!-- 说明:下面有的Bean配置提供了多种方案,请根据需要采用某一种(别忘了注释掉其他同类方案) --> <!-- 自动扫描Spring注解配置 --> <context:component-scan base-package="com" /> <!-- 自动加载属性配置文件 --> <context:property-placeholder location="classpath:jdbc.properties" /> <!-- 配置数据源:方法一,使用C3P0方式(推荐) --> <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close" p:driverClass="${jdbc.driverClassName}" p:jdbcUrl="${jdbc.url}" p:user="${jdbc.username}" p:password="${jdbc.password}" /> <!-- 配置数据源:方法二,使用DBCP方式(不推荐) --> <!-- <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close" p:driverClassName="${jdbc.driverClassName}" p:url="${jdbc.url}" p:username="${jdbc.username}" p:password="${jdbc.password}" /> --> <!-- 配置数据源:方法三,使用JNDI方式 --> <!-- <jee:jndi-lookup id="dataSource" jndi-name="${jndi.name}" /> --> <!-- 配置Hibernate的数据源代理工厂:方法一,使用p属性通配符,按文件名搜索匹配的映射文件 --> <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean" p:dataSource-ref="dataSource" p:mappingLocations="classpath*:/com/**/*.hbm.xml"> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">${hibernate.dialect}</prop> <prop key="hibernate.show_sql">${hibernate.show_sql}</prop> <prop key="hibernate.format_sql">${hibernate.format_sql}</prop> <prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop> <prop key="hibernate.cache.use_second_level_cache">${hibernate.cache.use_second_level_cache}</prop> <prop key="hibernate.cache.use_query_cache">${hibernate.cache.use_query_cache}</prop> <prop key="hibernate.cache.region.factory_class">${hibernate.cache.region.factory_class}</prop> </props> </property> </bean> <!-- 配置Hibernate的数据源代理工厂:方法二,使用list集合,按文件名搜索匹配的映射文件 --> <!-- <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean" p:dataSource-ref="dataSource"> <property name="mappingLocations"> <list> <value>classpath*:/com/**/*.hbm.xml</value> </list> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">${hibernate.dialect}</prop> <prop key="hibernate.show_sql">${hibernate.show_sql}</prop> <prop key="hibernate.format_sql">${hibernate.format_sql}</prop> <prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop> <prop key="hibernate.cache.use_second_level_cache">${hibernate.cache.use_second_level_cache}</prop> <prop key="hibernate.cache.use_query_cache">${hibernate.cache.use_query_cache}</prop> <prop key="hibernate.cache.region.factory_class">${hibernate.cache.region.factory_class}</prop> </props> </property> </bean> --> <!-- 配置Hibernate的数据源代理工厂:方法三,使用p属性通配符,按目录搜索映射文件 --> <!-- <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean" p:dataSource-ref="dataSource" p:mappingDirectoryLocations="classpath*:/com/**/domain"> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">${hibernate.dialect}</prop> <prop key="hibernate.show_sql">${hibernate.show_sql}</prop> <prop key="hibernate.format_sql">${hibernate.format_sql}</prop> <prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop> <prop key="hibernate.cache.use_second_level_cache">${hibernate.cache.use_second_level_cache}</prop> <prop key="hibernate.cache.use_query_cache">${hibernate.cache.use_query_cache}</prop> <prop key="hibernate.cache.region.factory_class">${hibernate.cache.region.factory_class}</prop> </props> </property> </bean> --> <!-- 配置Hibernate的数据源代理工厂:方法四,使用hibernate.cfg.xml --> <!-- <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean" p:dataSource-ref="dataSource" p:configLocation="classpath:hibernate.cfg.xml"> </bean> --> <!-- 配置事务管理器 --> <bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager" p:sessionFactory-ref="sessionFactory" /> <!-- 配置声明式事务:方法一,在Service实现类或者public实现方法上使用注解@Transactional,则此类或方法就会启用事务机制 --> <tx:annotation-driven transaction-manager="transactionManager" /> <!-- 配置声明式事务:方法二,使用tx/aop命名空间的配置(其实还有方法三,由于快要过时不推荐使用了,这里就不给出方法三的配置了) --> <!-- <tx:advice id="txAdvice" transaction-manager="transactionManager"> <tx:attributes> <tx:method name="insert*" propagation="REQUIRED" /> <tx:method name="update*" propagation="REQUIRED" /> <tx:method name="edit*" propagation="REQUIRED" /> <tx:method name="save*" propagation="REQUIRED" /> <tx:method name="add*" propagation="REQUIRED" /> <tx:method name="new*" propagation="REQUIRED" /> <tx:method name="set*" propagation="REQUIRED" /> <tx:method name="remove*" propagation="REQUIRED" /> <tx:method name="delete*" propagation="REQUIRED" /> <tx:method name="change*" propagation="REQUIRED" /> <tx:method name="get*" propagation="REQUIRED" read-only="true" /> <tx:method name="find*" propagation="REQUIRED" read-only="true" /> <tx:method name="load*" propagation="REQUIRED" read-only="true" /> <tx:method name="search*" propagation="REQUIRED" read-only="true" /> <tx:method name="*" propagation="REQUIRED" read-only="true" /> </tx:attributes> </tx:advice> <aop:config> <aop:pointcut id="mypointcut" expression="execution(* com.**.service..*.*(..))" /> <aop:advisor advice-ref="txAdvice" pointcut-ref="mypointcut" /> </aop:config> --> <!-- 下面三个Bean的配置可有可无,但配置后用处更大,通常用于BaseDao类、其他Dao类或特殊工具类中 --> <bean id="hibernateTemplate" class="org.springframework.orm.hibernate4.HibernateTemplate" p:sessionFactory-ref="sessionFactory" /> <bean id="hibernateDaoSupport" class="org.springframework.orm.hibernate4.support.HibernateDaoSupport" p:hibernateTemplate-ref="hibernateTemplate" abstract="true"/> <bean id="sessionFactoryUtils" class="org.springframework.orm.hibernate4.SessionFactoryUtils" abstract="true"/> </beans> ```

ssh2,启动tomcat,出现‘严重: Error listenerStart’错误

tomcat: [code="java"]严重: Error listenerStart 2010-2-28 13:00:26 org.apache.catalina.core.StandardContext start 严重: Context [/ssh2] startup failed due to previous errors 2010-2-28 13:00:29 org.apache.coyote.http11.Http11BaseProtocol start 信息: Starting Coyote HTTP/1.1 on http-8888 2010-2-28 13:00:29 org.apache.jk.common.ChannelSocket init[/code] log4j日志文件: [code="java"]2010-02-28 13:00:26 [org.springframework.web.context.ContextLoader]-[ERROR] Context initialization failed org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/applicationContext.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/applicationContext.xml][/code] web.xml文件: [code="java"]<?xml version="1.0" encoding="UTF-8"?> <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> <!-- 配置Spring <context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/classes/applicationContext.xml</param-value> </context-param> --> <!-- 配置struts2 --> <filter> <filter-name>struts-cleanup</filter-name> <filter-class>org.apache.struts2.dispatcher.ActionContextCleanUp</filter-class> </filter> <filter-mapping> <filter-name>struts-cleanup</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class> </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>*.action</url-pattern> </filter-mapping> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>*.html</url-pattern> </filter-mapping> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>*.jsp</url-pattern> </filter-mapping> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/struts/*</url-pattern> </filter-mapping> <!-- 配置Spring的监听 --> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <!-- 配置Spring的过滤器,解决乱码问题 --> <filter> <filter-name>encoding</filter-name> <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> <init-param> <param-name>encoding</param-name> <param-value>UTF-8</param-value> </init-param> </filter> <filter-mapping> <filter-name>encoding</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> </web-app>[/code] 有spring-web.jar包,asm2.2.3已经删了 启动时报错

使用spring2.5@AspectJ进行AOP编程时遇到的配置问题

想在原来的正常运行的SSH系统上通过Aspectj增加AOP功能,在原来的包基础上加上了Aspectj的相关包,但只要我在applictationContext.xml上配置了:<aop:aspectj-autoproxy></aop:aspectj-autoproxy>,tomcat启动正常,但只要访问提交数据就会出现下面的错误,google上也没有找到想类似的解决方面,请知道的朋友指点一下, 谢谢! applictationContext.xml 文件 <?xml version="1.0" encoding="UTF-8"?> <beans default-autowire="byName" default-lazy-init="true" xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd"> <!-- --> 注析掉下面一行就正常,当然AOP也没用了 <aop:aspectj-autoproxy></aop:aspectj-autoproxy> <!-- aopTest --> <bean id="msgAspect" class="com.ewf.util.aop.MsgAspect" ></bean> 包列表如下: antlr-2.7.6.jar aopalliance.jar asm.jar asm-util-2.2.3.jar asm-commons-2.2.3.jar aspectjrt.jar aspectjweaver.jar c3p0-0.9.1.2.jar cglib-nodep-2.1_3.jar common-dev.jar commons-beanutils-1.8.0.jar commons-collections-3.1.jar commons-digester-2.0.jar commons-fileupload-1.2.1.jar commons-io-1.3.2.jar commons-lang-2.3.jar commons-logging-1.1.1.jar dom4j-1.6.1.jar ehcache-1.6.0-beta5.jar ejb3-persistence-1.0.2GA.jar freemarker-2.3.13.jar hibernate-annotations-3.4.0GA.jar hibernate-commons-annotations-3.1.0GA.jar hibernate-core-3.3.0SP1.jar hibernate-ehcache-3.3.0.SP1.jar hibernate-entitymanager-3.4.0GA.jar hibernate-validator.jar javassist-3.4.jar jaxen-1.1-beta-7.jar jta.jar jtds-1.2.2.jar log4j-1.2.15.jar mysql-connector-java-5.1.6-bin.jar ognl-2.6.11.jar slf4j-api.jar slf4j-log4j12.jar spring-2.5.6.jar spring-security-core-2.0.4.jar struts2-core-2.1.2.jar struts2-spring-plugin-2.1.2.jar velocity-1.5.jar velocity-tools-1.4.jar velocity-tools-view-1.4.jar xwork-2.1.1.jar 错误提示如下:+++++++++++++ 2010-10-23 21:15:55,625 ERROR [com.ewf.util.ExceptionInterceptor] - java.lang.NullPointerException at com.opensymphony.xwork2.validator.ValidationInterceptor.doBeforeInvocation(ValidationInterceptor.java:208) at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:246) at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:49) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86) at sun.reflect.GeneratedMethodAccessor30.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(AbstractTraceInterceptor.java:113) at org.springframework.aop.interceptor.DebugInterceptor.invoke(DebugInterceptor.java:61) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy12.intercept(Unknown Source) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:456) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227) at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:124) at sun.reflect.GeneratedMethodAccessor30.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(AbstractTraceInterceptor.java:113) at org.springframework.aop.interceptor.DebugInterceptor.invoke(DebugInterceptor.java:61) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy12.intercept(Unknown Source) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:456) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227) at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:170) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(AbstractTraceInterceptor.java:113) at org.springframework.aop.interceptor.DebugInterceptor.invoke(DebugInterceptor.java:61) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy12.intercept(Unknown Source) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:456) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227) at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:170) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(AbstractTraceInterceptor.java:113) at org.springframework.aop.interceptor.DebugInterceptor.invoke(DebugInterceptor.java:61) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy12.intercept(Unknown Source) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:456) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227) at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:104) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(AbstractTraceInterceptor.java:113) at org.springframework.aop.interceptor.DebugInterceptor.invoke(DebugInterceptor.java:61) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy12.intercept(Unknown Source) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:456) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227) at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:84) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(AbstractTraceInterceptor.java:113) at org.springframework.aop.interceptor.DebugInterceptor.invoke(DebugInterceptor.java:61) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy12.intercept(Unknown Source) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:456) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227) at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:208) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(AbstractTraceInterceptor.java:113) at org.springframework.aop.interceptor.DebugInterceptor.invoke(DebugInterceptor.java:61) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy12.intercept(Unknown Source) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:456) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227) at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:88) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(AbstractTraceInterceptor.java:113) at org.springframework.aop.interceptor.DebugInterceptor.invoke(DebugInterceptor.java:61) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy12.intercept(Unknown Source) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:456) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227) at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:127) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(AbstractTraceInterceptor.java:113) at org.springframework.aop.interceptor.DebugInterceptor.invoke(DebugInterceptor.java:61) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy12.intercept(Unknown Source) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:456) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227) at org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(ProfilingActivationInterceptor.java:104) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(AbstractTraceInterceptor.java:113) at org.springframework.aop.interceptor.DebugInterceptor.invoke(DebugInterceptor.java:61) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy12.intercept(Unknown Source) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:456) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227) at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(AbstractTraceInterceptor.java:113) at org.springframework.aop.interceptor.DebugInterceptor.invoke(DebugInterceptor.java:61) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy12.intercept(Unknown Source) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:456) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227) at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:130) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(AbstractTraceInterceptor.java:113) at org.springframework.aop.interceptor.DebugInterceptor.invoke(DebugInterceptor.java:61) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy12.intercept(Unknown Source) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:456) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227) at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:143) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(AbstractTraceInterceptor.java:113) at org.springframework.aop.interceptor.DebugInterceptor.invoke(DebugInterceptor.java:61) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy12.intercept(Unknown Source) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:456) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227) at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:137) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(AbstractTraceInterceptor.java:113) at org.springframework.aop.interceptor.DebugInterceptor.invoke(DebugInterceptor.java:61) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy12.intercept(Unknown Source) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:456) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227) at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(AbstractTraceInterceptor.java:113) at org.springframework.aop.interceptor.DebugInterceptor.invoke(DebugInterceptor.java:61) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy13.intercept(Unknown Source) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:456) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227) at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:130) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(AbstractTraceInterceptor.java:113) at org.springframework.aop.interceptor.DebugInterceptor.invoke(DebugInterceptor.java:61) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy12.intercept(Unknown Source) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:456) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227) at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(AbstractTraceInterceptor.java:113) at org.springframework.aop.interceptor.DebugInterceptor.invoke(DebugInterceptor.java:61) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy12.intercept(Unknown Source) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:456) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227) at com.ewf.util.webwork.ExceptionInterceptor.intercept(ExceptionInterceptor.java:36) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(AbstractTraceInterceptor.java:113) at org.springframework.aop.interceptor.DebugInterceptor.invoke(DebugInterceptor.java:61) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy12.intercept(Unknown Source) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:230) at com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:229) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:456) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:227) at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52) at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:477) at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:467) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.ewf.util.filter.LoginFilter.doFilterInternal(LoginFilter.java:29) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:619) 2010-10-23 21:15:55,750 ERROR [com.opensymphony.xwork2.DefaultActionInvocation] - There was an exception while instantiating the result of type org.apache.struts2.dispatcher.VelocityResult Caught OgnlException while setting property 'location' on type '$Proxy26'. - Class: ognl.ObjectPropertyAccessor File: ObjectPropertyAccessor.java Method: setProperty Line: 132 - ognl/ObjectPropertyAccessor.java:132:-1 at com.opensymphony.xwork2.ognl.OgnlUtil.internalSetProperty(OgnlUtil.java:400) at com.opensymphony.xwork2.ognl.OgnlUtil.setProperties(OgnlUtil.java:87) at com.opensymphony.xwork2.ognl.OgnlReflectionProvider.setProperties(OgnlReflectionProvider.java:55) at com.opensymphony.xwork2.ObjectFactory.buildResult(ObjectFactory.java:215) at com.opensymphony.xwork2.DefaultActionInvocation.createResult(DefaultActionInvocation.java:201) at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:349) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:259) at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52) at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:477) at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:467) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.ewf.util.filter.LoginFilter.doFilterInternal(LoginFilter.java:29) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:619) Caused by: ognl.NoSuchPropertyException: $Proxy26.location at ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor.java:132) at com.opensymphony.xwork2.ognl.accessor.ObjectAccessor.setProperty(ObjectAccessor.java:27) at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1656) at ognl.ASTProperty.setValueBody(ASTProperty.java:101) at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177) at ognl.SimpleNode.setValue(SimpleNode.java:246) at ognl.Ognl.setValue(Ognl.java:476) at com.opensymphony.xwork2.ognl.OgnlUtil.setValue(OgnlUtil.java:197) at com.opensymphony.xwork2.ognl.OgnlUtil.internalSetProperty(OgnlUtil.java:393) ... 33 more

2019 AI开发者大会

2019 AI开发者大会(AI ProCon 2019)是由中国IT社区CSDN主办的AI技术与产业年度盛会。多年经验淬炼,如今蓄势待发:2019年9月6-7日,大会将有近百位中美顶尖AI专家、知名企业代表以及千余名AI开发者齐聚北京,进行技术解读和产业论证。我们不空谈口号,只谈技术,诚挚邀请AI业内人士一起共铸人工智能新篇章!

实现简单的文件系统

实验内容: 通过对具体的文件存储空间的管理、文件的物理结构、目录结构和文件操作的实现,加深对文件系统内部功能和实现过程的理解。 要求: 1.在内存中开辟一个虚拟磁盘空间作为文件存储器,在其上实现一个简

MIPS单周期CPU-组成原理实验-华中科技大学

使用logisim布线完成的MIPS单周期CPU,可支持28条指令。跑马灯的代码已经装入了寄存器,可以直接开启时钟运行。

2019数学建模A题高压油管的压力控制 省一论文即代码

2019数学建模A题高压油管的压力控制省一完整论文即详细C++和Matlab代码,希望对同学们有所帮助

基于QT和OpenCV的五子棋实现源码

一个简单的五子棋应用,基于QT和OpenCV的实现源码,通过相邻棋子判断是否获胜,不包含人工智能算法,适合新手入门

Git 实用技巧

这几年越来越多的开发团队使用了Git,掌握Git的使用已经越来越重要,已经是一个开发者必备的一项技能;但很多人在刚开始学习Git的时候会遇到很多疑问,比如之前使用过SVN的开发者想不通Git提交代码为什么需要先commit然后再去push,而不是一条命令一次性搞定; 更多的开发者对Git已经入门,不过在遇到一些代码冲突、需要恢复Git代码时候就不知所措,这个时候哪些对 Git掌握得比较好的少数人,就像团队中的神一样,在队友遇到 Git 相关的问题的时候用各种流利的操作来帮助队友于水火。 我去年刚加入新团队,发现一些同事对Git的常规操作没太大问题,但对Git的理解还是比较生疏,比如说分支和分支之间的关联关系、合并代码时候的冲突解决、提交代码前未拉取新代码导致冲突问题的处理等,我在协助处理这些问题的时候也记录各种问题的解决办法,希望整理后通过教程帮助到更多对Git操作进阶的开发者。 本期教程学习方法分为“掌握基础——稳步进阶——熟悉协作”三个层次。从掌握基础的 Git的推送和拉取开始,以案例进行演示,分析每一个步骤的操作方式和原理,从理解Git 工具的操作到学会代码存储结构、演示不同场景下Git遇到问题的不同处理方案。循序渐进让同学们掌握Git工具在团队协作中的整体协作流程。 在教程中会通过大量案例进行分析,案例会模拟在工作中遇到的问题,从最基础的代码提交和拉取、代码冲突解决、代码仓库的数据维护、Git服务端搭建等。为了让同学们容易理解,对Git简单易懂,文章中详细记录了详细的操作步骤,提供大量演示截图和解析。在教程的最后部分,会从提升团队整体效率的角度对Git工具进行讲解,包括规范操作、Gitlab的搭建、钩子事件的应用等。 为了让同学们可以利用碎片化时间来灵活学习,在教程文章中大程度降低了上下文的依赖,让大家可以在工作之余进行学习与实战,并同时掌握里面涉及的Git不常见操作的相关知识,理解Git工具在工作遇到的问题解决思路和方法,相信一定会对大家的前端技能进阶大有帮助。

实用主义学Python(小白也容易上手的Python实用案例)

原价169,限时立减100元! 系统掌握Python核心语法16点,轻松应对工作中80%以上的Python使用场景! 69元=72讲+源码+社群答疑+讲师社群分享会&nbsp; 【哪些人适合学习这门课程?】 1)大学生,平时只学习了Python理论,并未接触Python实战问题; 2)对Python实用技能掌握薄弱的人,自动化、爬虫、数据分析能让你快速提高工作效率; 3)想学习新技术,如:人工智能、机器学习、深度学习等,这门课程是你的必修课程; 4)想修炼更好的编程内功,优秀的工程师肯定不能只会一门语言,Python语言功能强大、使用高效、简单易学。 【超实用技能】 从零开始 自动生成工作周报 职场升级 豆瓣电影数据爬取 实用案例 奥运冠军数据分析 自动化办公:通过Python自动化分析Excel数据并自动操作Word文档,最终获得一份基于Excel表格的数据分析报告。 豆瓣电影爬虫:通过Python自动爬取豆瓣电影信息并将电影图片保存到本地。 奥运会数据分析实战 简介:通过Python分析120年间奥运会的数据,从不同角度入手分析,从而得出一些有趣的结论。 【超人气老师】 二两 中国人工智能协会高级会员 生成对抗神经网络研究者 《深入浅出生成对抗网络:原理剖析与TensorFlow实现》一书作者 阿里云大学云学院导师 前大型游戏公司后端工程师 【超丰富实用案例】 0)图片背景去除案例 1)自动生成工作周报案例 2)豆瓣电影数据爬取案例 3)奥运会数据分析案例 4)自动处理邮件案例 5)github信息爬取/更新提醒案例 6)B站百大UP信息爬取与分析案例 7)构建自己的论文网站案例

深度学习原理+项目实战+算法详解+主流框架(套餐)

深度学习系列课程从深度学习基础知识点开始讲解一步步进入神经网络的世界再到卷积和递归神经网络,详解各大经典网络架构。实战部分选择当下最火爆深度学习框架PyTorch与Tensorflow/Keras,全程实战演示框架核心使用与建模方法。项目实战部分选择计算机视觉与自然语言处理领域经典项目,从零开始详解算法原理,debug模式逐行代码解读。适合准备就业和转行的同学们加入学习! 建议按照下列课程顺序来进行学习 (1)掌握深度学习必备经典网络架构 (2)深度框架实战方法 (3)计算机视觉与自然语言处理项目实战。(按照课程排列顺序即可)

C/C++跨平台研发从基础到高阶实战系列套餐

一 专题从基础的C语言核心到c++ 和stl完成基础强化; 二 再到数据结构,设计模式完成专业计算机技能强化; 三 通过跨平台网络编程,linux编程,qt界面编程,mfc编程,windows编程,c++与lua联合编程来完成应用强化 四 最后通过基于ffmpeg的音视频播放器,直播推流,屏幕录像,

三个项目玩转深度学习(附1G源码)

从事大数据与人工智能开发与实践约十年,钱老师亲自见证了大数据行业的发展与人工智能的从冷到热。事实证明,计算机技术的发展,算力突破,海量数据,机器人技术等,开启了第四次工业革命的序章。深度学习图像分类一直是人工智能的经典任务,是智慧零售、安防、无人驾驶等机器视觉应用领域的核心技术之一,掌握图像分类技术是机器视觉学习的重中之重。针对现有线上学习的特点与实际需求,我们开发了人工智能案例实战系列课程。打造:以项目案例实践为驱动的课程学习方式,覆盖了智能零售,智慧交通等常见领域,通过基础学习、项目案例实践、社群答疑,三维立体的方式,打造最好的学习效果。

Java基础知识面试题(2020最新版)

文章目录Java概述何为编程什么是Javajdk1.5之后的三大版本JVM、JRE和JDK的关系什么是跨平台性?原理是什么Java语言有哪些特点什么是字节码?采用字节码的最大好处是什么什么是Java程序的主类?应用程序和小程序的主类有何不同?Java应用程序与小程序之间有那些差别?Java和C++的区别Oracle JDK 和 OpenJDK 的对比基础语法数据类型Java有哪些数据类型switc...

Python界面版学生管理系统

前不久上传了一个控制台版本的学生管理系统,这个是Python界面版学生管理系统,这个是使用pycharm开发的一个有界面的学生管理系统,基本的增删改查,里面又演示视频和完整代码,有需要的伙伴可以自行下

Vue.js 2.0之全家桶系列视频课程

基于新的Vue.js 2.3版本, 目前新全的Vue.js教学视频,让你少走弯路,直达技术前沿! 1. 包含Vue.js全家桶(vue.js、vue-router、axios、vuex、vue-cli、webpack、ElementUI等) 2. 采用笔记+代码案例的形式讲解,通俗易懂

linux“开发工具三剑客”速成攻略

工欲善其事,必先利其器。Vim+Git+Makefile是Linux环境下嵌入式开发常用的工具。本专题主要面向初次接触Linux的新手,熟练掌握工作中常用的工具,在以后的学习和工作中提高效率。

JAVA初级工程师面试36问(完结)

第三十一问: 说一下线程中sleep()和wait()区别? 1 . sleep()是让正在执行的线程主动让出CPU,当时间到了,在回到自己的线程让程序运行。但是它并没有释放同步资源锁只是让出。 2.wait()是让当前线程暂时退让出同步资源锁,让其他线程来获取到这个同步资源在调用notify()方法,才会让其解除wait状态,再次参与抢资源。 3. sleep()方法可以在任何地方使用,而wait()只能在同步方法或同步块使用。 ...

java jdk 8 帮助文档 中文 文档 chm 谷歌翻译

JDK1.8 API 中文谷歌翻译版 java帮助文档 JDK API java 帮助文档 谷歌翻译 JDK1.8 API 中文 谷歌翻译版 java帮助文档 Java最新帮助文档 本帮助文档是使用谷

我以为我对Mysql事务很熟,直到我遇到了阿里面试官

太惨了,面试又被吊打

智鼎(附答案).zip

并不是完整题库,但是有智鼎在线2019年9、10、11三个月的试题,有十七套以上题目,普通的网申行测题足以对付,可以在做题时自己总结一些规律,都不是很难

Visual Assist X 破解补丁

vs a's'sixt插件 支持vs2008-vs2019 亲测可以破解,希望可以帮助到大家

150讲轻松搞定Python网络爬虫

【为什么学爬虫?】 &nbsp; &nbsp; &nbsp; &nbsp;1、爬虫入手容易,但是深入较难,如何写出高效率的爬虫,如何写出灵活性高可扩展的爬虫都是一项技术活。另外在爬虫过程中,经常容易遇到被反爬虫,比如字体反爬、IP识别、验证码等,如何层层攻克难点拿到想要的数据,这门课程,你都能学到! &nbsp; &nbsp; &nbsp; &nbsp;2、如果是作为一个其他行业的开发者,比如app开发,web开发,学习爬虫能让你加强对技术的认知,能够开发出更加安全的软件和网站 【课程设计】 一个完整的爬虫程序,无论大小,总体来说可以分成三个步骤,分别是: 网络请求:模拟浏览器的行为从网上抓取数据。 数据解析:将请求下来的数据进行过滤,提取我们想要的数据。 数据存储:将提取到的数据存储到硬盘或者内存中。比如用mysql数据库或者redis等。 那么本课程也是按照这几个步骤循序渐进的进行讲解,带领学生完整的掌握每个步骤的技术。另外,因为爬虫的多样性,在爬取的过程中可能会发生被反爬、效率低下等。因此我们又增加了两个章节用来提高爬虫程序的灵活性,分别是: 爬虫进阶:包括IP代理,多线程爬虫,图形验证码识别、JS加密解密、动态网页爬虫、字体反爬识别等。 Scrapy和分布式爬虫:Scrapy框架、Scrapy-redis组件、分布式爬虫等。 通过爬虫进阶的知识点我们能应付大量的反爬网站,而Scrapy框架作为一个专业的爬虫框架,使用他可以快速提高我们编写爬虫程序的效率和速度。另外如果一台机器不能满足你的需求,我们可以用分布式爬虫让多台机器帮助你快速爬取数据。 &nbsp; 从基础爬虫到商业化应用爬虫,本套课程满足您的所有需求! 【课程服务】 专属付费社群+每周三讨论会+1v1答疑

JavaWEB商城项目(包括数据库)

功能描述:包括用户的登录注册,以及个人资料的修改.商品的分类展示,详情,加入购物车,生成订单,到银行支付等!另外还有收货地址的和我的收藏等常用操作.环境(JDK 1.7 ,mysql 5.5,Ecli

Python数据挖掘简易入门

&nbsp; &nbsp; &nbsp; &nbsp; 本课程为Python数据挖掘方向的入门课程,课程主要以真实数据为基础,详细介绍数据挖掘入门的流程和使用Python实现pandas与numpy在数据挖掘方向的运用,并深入学习如何运用scikit-learn调用常用的数据挖掘算法解决数据挖掘问题,为进一步深入学习数据挖掘打下扎实的基础。

一学即懂的计算机视觉(第一季)

图像处理和计算机视觉的课程大家已经看过很多,但总有“听不透”,“用不了”的感觉。课程致力于创建人人都能听的懂的计算机视觉,通过生动、细腻的讲解配合实战演练,让学生真正学懂、用会。 【超实用课程内容】 课程内容分为三篇,包括视觉系统构成,图像处理基础,特征提取与描述,运动跟踪,位姿估计,三维重构等内容。课程理论与实战结合,注重教学内容的可视化和工程实践,为人工智能视觉研发及算法工程师等相关高薪职位就业打下坚实基础。 【课程如何观看?】 PC端:https://edu.csdn.net/course/detail/26281 移动端:CSDN 学院APP(注意不是CSDN APP哦) 本课程为录播课,课程2年有效观看时长,但是大家可以抓紧时间学习后一起讨论哦~ 【学员专享增值服务】 源码开放 课件、课程案例代码完全开放给你,你可以根据所学知识,自行修改、优化 下载方式:电脑登录https://edu.csdn.net/course/detail/26281,点击右下方课程资料、代码、课件等打包下载

软件测试2小时入门

本课程内容系统、全面、简洁、通俗易懂,通过2个多小时的介绍,让大家对软件测试有个系统的理解和认识,具备基本的软件测试理论基础。 主要内容分为5个部分: 1 软件测试概述,了解测试是什么、测试的对象、原则、流程、方法、模型;&nbsp; 2.常用的黑盒测试用例设计方法及示例演示;&nbsp; 3 常用白盒测试用例设计方法及示例演示;&nbsp; 4.自动化测试优缺点、使用范围及示例‘;&nbsp; 5.测试经验谈。

初级玩转Linux+Ubuntu(嵌入式开发基础课程)

课程主要面向嵌入式Linux初学者、工程师、学生 主要从一下几方面进行讲解: 1.linux学习路线、基本命令、高级命令 2.shell、vi及vim入门讲解 3.软件安装下载、NFS、Samba、FTP等服务器配置及使用

2019 Python开发者日-培训

本次活动将秉承“只讲技术,拒绝空谈”的理念,邀请十余位身处一线的Python技术专家,重点围绕Web开发、自动化运维、数据分析、人工智能等技术模块,分享真实生产环境中使用Python应对IT挑战的真知灼见。此外,针对不同层次的开发者,大会还安排了深度培训实操环节,为开发者们带来更多深度实战的机会。

快速入门Android开发 视频 教程 android studio

这是一门快速入门Android开发课程,顾名思义是让大家能快速入门Android开发。 学完能让你学会如下知识点: Android的发展历程 搭建Java开发环境 搭建Android开发环境 Android Studio基础使用方法 Android Studio创建项目 项目运行到模拟器 项目运行到真实手机 Android中常用控件 排查开发中的错误 Android中请求网络 常用Android开发命令 快速入门Gradle构建系统 项目实战:看美图 常用Android Studio使用技巧 项目签名打包 如何上架市场

机器学习初学者必会的案例精讲

通过六个实际的编码项目,带领同学入门人工智能。这些项目涉及机器学习(回归,分类,聚类),深度学习(神经网络),底层数学算法,Weka数据挖掘,利用Git开源项目实战等。

4小时玩转微信小程序——基础入门与微信支付实战

这是一个门针对零基础学员学习微信小程序开发的视频教学课程。课程采用腾讯官方文档作为教程的唯一技术资料来源。杜绝网络上质量良莠不齐的资料给学员学习带来的障碍。 视频课程按照开发工具的下载、安装、使用、程序结构、视图层、逻辑层、微信小程序等几个部分组织课程,详细讲解整个小程序的开发过程

相关热词 c#框体中的退出函数 c# 按钮透明背景 c# idl 混编出错 c#在位置0处没有任何行 c# 循环给数组插入数据 c# 多线程死锁的例子 c# 钉钉读取员工排班 c# label 不显示 c#裁剪影像 c#工作进程更新ui
立即提问