I’m trying to deploy restSQL in my local tomcat installation based on this link.
From my tomcat webapps folder:
webapps\restsql-0.8\WEB-INF\classes\resources\properties
I have modified 'default-restsql.properties' to set the correct database connections
and retained the property 'sqlresources.dir=/resources/xml/sqlresources' while adding/creating the folder on that location.
I also modified in 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:
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
Although the folder do exist: 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. 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.
Most paths are to other files, referenced in the main restSQL properties files have to be absolute. The only one that is relative is the logging.config. Please have a look at Deployment for all the nitty-gritty deployment instructions.
Hope that does the trick for you.