A solution to the warning message problem in struts2

Source: Internet
Author: User
Tags ssh jboss log4j

Recently played with the next SSH, compared to the previous version is not the same, but also stuts2 and struts1 some of the other are similar.

To get to the point:

After the normal operation of the project, there are many such as could not found property [Templatedir]

2008-9-1 12:16:01 Com.opensymphony.xwork2.util.logging.jdk.JdkLogger warn
Warning: Could not find property [Org.apache.catalina.jsp_file]
2008-9-1 12:16:01 Com.opensymphony.xwork2.util.logging.jdk.JdkLogger warn
Warning: Could not find property [Struts.valuestack]
2008-9-1 12:16:01 Com.opensymphony.xwork2.util.logging.jdk.JdkLogger warn
Warning: Could not find property [Templatedir]
2008-9-1 12:16:01 Com.opensymphony.xwork2.util.logging.jdk.JdkLogger warn
Warning: Could not find property [Templatedir]
2008-9-1 12:16:01 Com.opensymphony.xwork2.util.logging.jdk.JdkLogger warn
Warning: Could not find property [theme]
2008-9-1 12:16:01 Com.opensymphony.xwork2.util.logging.jdk.JdkLogger warn
Warning: Could not find property [theme]
2008-9-1 12:16:01 Com.opensymphony.xwork2.util.logging.jdk.JdkLogger warn
Warning: Could not find property [Templatedir]
2008-9-1 12:16:01 Com.opensymphony.xwork2.util.logging.jdk.JdkLogger warn
Warning: Could not find property [Templatedir]
2008-9-1 12:16:01 Com.opensymphony.xwork2.util.logging.jdk.JdkLogger warn
Warning: Could not find property [theme]
2008-9-1 12:16:01 Com.opensymphony.xwork2.util.logging.jdk.JdkLogger warn
Warning: Could not find property [theme]
2008-9-1 12:16:03 Com.opensymphony.xwork2.util.logging.jdk.JdkLogger warn
Warning: Could not find property [. freemarker. Request]
2008-9-1 12:16:03 Com.opensymphony.xwork2.util.logging.jdk.JdkLogger warn
Warning: Could not find property [. freemarker. Requestparameters]
2008-9-1 12:16:03 Com.opensymphony.xwork2.util.logging.jdk.JdkLogger warn
Warning: Could not find property [Actionerrors]
2008-9-1 12:16:03 Com.opensymphony.xwork2.util.logging.jdk.JdkLogger warn
Warning: Could not find property [Actionerrors]

......

and other warning messages.

Search a bit, have asked a lot of people, the solution is almost no, so came to the Apache website search A, it seems to mention this.

Reference Address: http://cwiki.apache.org/S2WIKI/troubleshooting-guide-migrating-from-struts-20x-to-21x.html# Troubleshootingguidemigratingfromstruts2.0.xto2.1.x-missingproperties

The main contents are as follows: Missing Properties

This message states the framework searched for a, the value stack and failed to find it.

2008-04-19 14:21:08,177 WARN  [Http-8443-processor25] [ognlvaluestack] could not find property [Templatedir]
2008-04-19 14:21:08,177 WARN  [Http-8443-processor25] [ognlvaluestack] could not find property [Templatedir]
2008-04-19 14:21:08,177 WARN  [Http-8443-processor25] [ognlvaluestack] could not find property [Templatedir]
2008-04-19 14:21:08,178 WARN  [Http-8443-processor25] [ognlvaluestack] could not find property [ Org.apache.catalina.jsp_file]

To hide this messages, turn off the WARN level logging for ognlvaluestack.

eg. Include a new limit category in your log4j.xml file (only log errors or worse):

(personal habits), considering that some friends are not familiar with log4j.
Put a little bit of code
Log4j.properties placed in the SRC directory is good, remember to set up on the system disk log4j.appender.logfile.File corresponding files.
# for Jboss:avoid to setup log4j outside $JBOSS _home/server/default/deploy/log4j.xml
# for all other servers:comment out of the log4j listener in Web.xml too
Log4j.rootlogger=error, console, logfile
#console
Log4j.appender.console=org.apache.log4j.consoleappender
Log4j.appender.console.layout=org.apache.log4j.patternlayout
log4j.appender.console.layout.conversionpattern=%d%p [%c]-<%m>%n
#log4j. Appender.console.layout.conversionpattern=%d{absolute}%5p%c{1}:%l-%m%n
#logfile
Log4j.appender.logfile=org.apache.log4j.dailyrollingfileappender
Log4j.appender.logfile.file=c:/ask/logs/ask.log
# log4j Max File Size
# LOG4J.APPENDER.LOGFILE.MAXFILESIZE=10MB
# log4j BackUp File Index
# log4j.appender.logfile.maxbackupindex=10
Log4j.appender.logfile.layout=org.apache.log4j.patternlayout
# to Output:date priority [Category]-<message>line_separator
log4j.appender.logfile.layout.conversionpattern=%d%p [%c]-<%m>%n
#log4j. Logger.org.hibernate=info
#log4j. Logger.org.hibernate=debug

### Log HQL Query parser activity
#log4j. Logger.org.hibernate.hql.ast.ast=debug

### Log just the SQL
#log4j. Logger.org.hibernate.sql=info

### log JDBC bind parameters ###
#log4j. Logger.org.hibernate.type=info
#log4j. Logger.org.hibernate.type=debug

### Log Schema Export/update ###
#log4j. Logger.org.hibernate.tool.hbm2ddl=debug

### Log HQL Parse trees
#log4j. Logger.org.hibernate.hql=info

### Log Cache Activity ###
#log4j. Logger.org.hibernate.cache=debug

### Log Transaction activity
#log4j. Logger.org.hibernate.transaction=debug

### Log JDBC Resource acquisition
#log4j. Logger.org.hibernate.jdbc=debug

### enable the following line if your want to track down connection ###
### leakages when using Drivermanagerconnectionprovider ###
#log4j. Logger.org.hibernate.connection.drivermanagerconnectionprovider=trace
Finish the work, continue to write code ... Is imitating www.javaeye.com/ask to do ssh practicing.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.