您可以在Web应用程序根源文件夹(src)中将其删除。不要把它放在任何包装中。对我来说,空文件已经解决了。虽然它也在其他地方搜索过。你可以参考以下日志 -
Attempting to load ESAPI.properties via file I/O. Attempting to load ESAPI.properties as resource file via file I/O. Not found in 'org.owasp.esapi.resources' directory or file not readable: /Applications/Eclipse.app/Contents/MacOS/ESAPI.properties Not found in SystemResource Directory/resourceDirectory: .esapi/ESAPI.properties Not found in 'user.home' (/Users/athakur) directory: /Users/athakur/esapi/ESAPI.properties Loading ESAPI.properties via file I/O failed. Exception was: java.io.FileNotFoundException Attempting to load ESAPI.properties via the classpath. SUCCESSFULLY LOADED ESAPI.properties via the CLASSPATH from '/ (root)' using current thread context class loader! SecurityConfiguration for Validator.ConfigurationFile not found in ESAPI.properties. Using default: validation.properties Attempting to load validation.properties via file I/O. Attempting to load validation.properties as resource file via file I/O. Not found in 'org.owasp.esapi.resources' directory or file not readable: /Applications/Eclipse.app/Contents/MacOS/validation.properties Not found in SystemResource Directory/resourceDirectory: .esapi/validation.properties Not found in 'user.home' (/Users/athakur) directory: /Users/athakur/esapi/validation.properties Loading validation.properties via file I/O failed. Attempting to load validation.properties via the classpath. validation.properties could not be loaded by any means. fail. Exception was: java.lang.IllegalArgumentException: Failed to load ESAPI.properties as a classloader resource. SecurityConfiguration for ESAPI.printProperties not found in ESAPI.properties. Using default: false SecurityConfiguration for Encryptor.CipherTransformation not found in ESAPI.properties. Using default: AES/CBC/PKCS5Padding SecurityConfiguration for ESAPI.Encoder not found in ESAPI.properties. Using default: org.owasp.esapi.reference.DefaultEncoder SecurityConfiguration for ESAPI.Logger not found in ESAPI.properties. Using default: org.owasp.esapi.reference.JavaLogFactory SecurityConfiguration for Logger.LogApplicationName not found in ESAPI.properties. Using default: true SecurityConfiguration for Logger.LogServerIP not found in ESAPI.properties. Using default: true SecurityConfiguration for Logger.ApplicationName not found in ESAPI.properties. Using default: DefaultName
基于以上日志,我在源文件夹的根目录中创建了一个空的ESAPI.properties文件,并在其中添加了以下内容 -
ESAPI.printProperties=true Encryptor.CipherTransformation=AES/CBC/PKCS5Padding ESAPI.Encoder=org.owasp.esapi.reference.DefaultEncoder # Log4JFactory Requires log4j.xml or log4j.properties in classpath - http://www.laliluna.de/log4j-tutorial.html ESAPI.Logger=org.owasp.esapi.reference.Log4JLogFactory # Determines whether ESAPI should log the application name. This might be clutter in some single-server/single-app environments. Logger.LogApplicationName=true # Determines whether ESAPI should log the server IP and port. This might be clutter in some single-server environments. Logger.LogServerIP=true # Set the application name if these logs are combined with other applications Logger.ApplicationName=ExampleApplication
解决了,我只需要在我的classpath项目中添加具有属性文件并且刚刚工作的文件夹,现在我有一个不同的错误但是没关系