我正在尝试基于此link.在我的本地tomcat安装中部署restSQL

从我的tomcat webapps文件夹中:


  webapps \ restsql-0.8 \ WEB-INF \ classes \ resources \ properties


我修改了'default-restsql.properties'以设置正确的数据库连接

并在该位置添加/创建文件夹时保留属性'sqlresources.dir=/resources/xml/sqlresources'

我也在web.xml中进行了修改:

<context-param>
    <param-name>org.restsql.properties</param-name>
    <param-value>/WEB-INF/resources/properties/default-restsql.properties</param-value>
</context-param>


我很确定自从访问此资源以来,已加载default.restsql.properties

http://localhost:8080/restsql-0.8/conf


我得到这个回应:

Properties loaded from /resources/properties/default-restsql.properties:
log4j.configuration = resources/properties/default-log4j.properties
org.restsql.security.Authorizer = org.restsql.security.impl.AuthorizerImpl
org.restsql.core.RequestLogger = org.restsql.core.impl.RequestLoggerImpl
**sqlresources.dir = /resources/xml/sqlresources**
database.driverClassName = com.mysql.jdbc.Driver
logging.config = resources/properties/default-log4j.properties
database.user = root
org.restsql.core.Factory.ResponseSerializerFactory = org.restsql.core.impl.ResponseSerializerFactoryImpl
org.restsql.core.SqlBuilder = org.restsql.core.impl.SqlBuilderImpl
database.password = root
org.restsql.core.Factory.ConnectionFactory = org.restsql.core.impl.ConnectionFactoryImpl
org.restsql.core.SqlResourceMetaData = org.restsql.core.impl.SqlResourceMetaDataMySql
org.restsql.core.HttpRequestAttributes = org.restsql.core.impl.HttpRequestAttributesImpl
logging.facility = log4j
response.useXmlSchema = false
org.restsql.core.Factory.RequestFactory = org.restsql.core.impl.RequestFactoryImpl
database.url = jdbc:mysql://localhost:3306/
logging.dir = /var/log/restsql
org.restsql.core.Factory.SqlResourceFactory = org.restsql.core.impl.SqlResourceFactoryImpl
request.useXmlSchema = false
response.useXmlDirective = false
org.restsql.core.Factory.RequestDeserializerFactory = org.restsql.core.impl.RequestDeserializerFactoryImpl

Properties using defaults:
org.restsql.core.Factory.Connection = org.restsql.core.impl.ConnectionFactoryImpl
java.util.logging.config.file = resources/properties/default-logging.properties
request.useXmlDirective = false
org.restsql.properties = /resources/properties/default-restsql.properties


但是,当我访问此资源时

http://localhost:8080/restsql-0.8/res/


我得到这个回应:


  SQL资源目录/ resources / xml / sqlresources不存在...请
  更正restsql.properties文件中的sqlresources.dir属性


尽管该文件夹确实存在:webapps\restsql-0.8\WEB-INF\classes\resources\xml\sqlresources

可能是什么问题呢?

最佳答案

抱歉,您在部署时遇到了麻烦。 restSQL需要主属性文件的绝对路径。除了在类路径中查找默认值外,它无法搜索其WAR文件或展开的Web应用程序目录。

大多数路径都指向其他文件,在主restSQL属性文件中引用的路径必须是绝对的。唯一相对的是logging.config。请查看Deployment以获取所有详细的部署说明。

希望能帮到您。

08-08 02:09