简体   繁体   English

restSQL战争部署问题

[英]restSQL war deployment issue

I'm trying to deploy restSQL in my local tomcat installation based on this link. 我正在尝试基于此链接在我的本地tomcat安装中部署restSQL

From my tomcat webapps folder: 从我的tomcat webapps文件夹中:

webapps\\restsql-0.8\\WEB-INF\\classes\\resources\\properties web应用\\ restsql-0.8 \\ WEB-INF \\类\\资源\\属性

I have modified 'default-restsql.properties' to set the correct database connections 我修改了'default-restsql.properties'以设置正确的数据库连接

and retained the property 'sqlresources.dir=/resources/xml/sqlresources' while adding/creating the folder on that location. 并在该位置添加/创建文件夹时保留了属性'sqlresources.dir=/resources/xml/sqlresources'

I also modified in web.xml: 我也在web.xml中进行了修改:

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

I'm quite sure that the default.restsql.properties is loaded since when I access this resource: 我很确定自从访问此资源以来就加载了default.restsql.properties

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

I get this response: 我得到这个回应:

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

However when I access this resources 但是,当我访问此资源时

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

I get this response: 我得到这个回应:

SQL Resources directory /resources/xml/sqlresources does not exist ... please correct your sqlresources.dir property in your restsql.properties file SQL资源目录/ resources / xml / sqlresources不存在...请更正restsql.properties文件中的sqlresources.dir属性

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

What could be the problem? 可能是什么问题呢?

Sorry you're having trouble with deployment. 抱歉,您在部署时遇到了麻烦。 restSQL requires an absolute path to the main properties file. restSQL需要主属性文件的绝对路径。 It does not have the capability to search its WAR file or exploded web app dir, other than look in the classpath for the default. 除了在类路径中查找默认值之外,它无法搜索其WAR文件或展开的Web应用程序目录。

Most paths are to other files, referenced in the main restSQL properties files have to be absolute. 大多数路径都指向其他文件,主要restSQL属性文件中引用的路径必须是绝对的。 The only one that is relative is the logging.config. 唯一相对的是logging.config。 Please have a look at Deployment for all the nitty-gritty deployment instructions. 请查看Deployment的所有基本部署说明。

Hope that does the trick for you. 希望能帮到您。

When it rains it pours? 当鸣则已一鸣惊人?

Sounds like you had trouble running one of the database create scripts? 听起来您在运行数据库创建脚本之一时遇到麻烦? Is that in restsql-sdk/WebContent/database/postgresql? 是在restsql-sdk / WebContent / database / postgresql中吗? Did you have errors running create-sakila.bat? 您在运行create-sakila.bat时遇到错误吗? Perhaps your psql executable is not in your path. 也许您的psql可执行文件不在路径中。 You can edit the file to add it to your PATH environment variable temporarily. 您可以编辑该文件将其临时添加到您的PATH环境变量。

You won't get any 5xx errors if the resource query returns no data. 如果资源查询没有返回数据,你不会得到任何5XX错误。 You will get a 200 with an empty readResponse document. 您将得到一个200,其中的readResponse文档为空。

Your problem is likely a resource definition metadata issue. 您的问题可能是资源定义元数据问题。 Is country_id from the country table? 是来自国家/地区表的country_id吗? Is country defined as a table in the metadata? 国家/地区是否在元数据中定义为表格? Can you post the resource definition? 您可以发布资源定义吗?

Have you looked over the SQL resource rules at http://restsql.org/doc/SqlResourceRules.html ? 您是否在http://restsql.org/doc/SqlResourceRules.html上查看了SQL资源规则? Sorry, SQL Functions and views are not allowed. 抱歉,不允许使用SQL函数和视图。 You must use plain old columns and tables. 您必须使用普通的旧列和表。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM