Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Persist data to mssql is not working. #44

Closed
ensecoz opened this issue Jun 4, 2018 · 10 comments
Closed

Persist data to mssql is not working. #44

ensecoz opened this issue Jun 4, 2018 · 10 comments
Labels

Comments

@ensecoz
Copy link

ensecoz commented Jun 4, 2018

Hi,

I cannot setup para to be backed by mssql server. the following is my config.

para.dao = "SqlDAO"
para.sql.driver = "com.microsoft.sqlserver.jdbc.SQLServerDriver"
para.sql.url = "jdbc:sqlserver://server\sub;databaseName=xxx"
para.sql.user = "user"
para.sql.password = "password"

FYI:
at para server, i have these files
/para/para-war-1.29.1.war
/para/application.conf
/para/lib/para-dao-sql-1.29.0-shaded.jar
/para/lib/mssql-jdbc-6.4.0.jre8.jar

when running para, there is warn message "[WARN ] Para configuration file 'application.(conf|json|properties)' is missing from classpath"

I am not sure why? but if I remove para.dao, everything is working fine again (without WARN message)

@albogdano
Copy link
Member

Ok, I'll check if this is actually a bug or something else. In the meantime try running it again with -Dconfig.file=./application.conf

@ensecoz
Copy link
Author

ensecoz commented Jun 4, 2018

i'm running use your Dockerfile as base.

java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -Dconfig.file=./application.conf -jar para-*.war

@albogdano
Copy link
Member

The url should not start with jdbc: as that is prefix is added automatically

@albogdano
Copy link
Member

Also that \sub; in the URL is breaking the parsing of the config file.

@ensecoz
Copy link
Author

ensecoz commented Jun 4, 2018

I removed jdbc: prefixed and update \sub to \\sub.

Now the error is much better.

[ERROR] Error loading SQL driver "com.microsoft.jdbc.sqlserver.SQLServerDriver", class not found.

Is it correct to put the driver file here?
/para/lib/mssql-jdbc-6.4.0.jre8.jar

@albogdano
Copy link
Member

Yes, it should be put in ./lib but I'm also getting the same error... 🤔

@albogdano
Copy link
Member

It must be a classloading issue, which I will investigate further.

@albogdano albogdano added the bug label Jun 4, 2018
@ensecoz
Copy link
Author

ensecoz commented Jun 4, 2018

@albogdano thank you for helping.

I hacked the WAR file and include the mssql-jdbc-6.4.0.jre8.jar inside the WEB-INF.

finally I get it to load driver correctly but look like the mssql syntax is not compatible with other-sql (e.g. mysql, postgresql)

This is the error i get:

Failed to create a new table for appid 'app-para' in the SQL database [Incorrect syntax near the keyword 'IF'. (Error Code: 156, SQLState: S0001)]

@albogdano
Copy link
Member

Thanks for the report, this plugin is still kinda buggy because I haven't had the chance to fully test it with SQL Server. It's a fairly new plugin and needs some more work.

@albogdano
Copy link
Member

albogdano commented Jun 15, 2018

This should be fixed in 1.30.0 https://github.com/Erudika/para-dao-sql/releases/tag/1.30.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants