Jetty JDBCLoginService在mysql请求中使用null [英] Jetty JDBCLoginService using null in mysql request
本文介绍了Jetty JDBCLoginService在mysql请求中使用null的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试在Jetty中使用JDBCLoginService,但是当我的应用程序使用JDBCLoginService时,我会在日志中收到此错误:
i'm trying to use a JDBCLoginService in Jetty but when it's used by my app i get this error in the logs:
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'null where null = 'admin'' at line 1
就像码头不使用属性文件中的列一样
like if jetty wasn't using the columns in the properties file
jetty.xml部分:
the jetty.xml part:
<Call name="addBean">
<Arg>
<New class="org.eclipse.jetty.security.JDBCLoginService">
<Set name="name">gateway_jndi</Set>
<Set name="config">/usr/local/jetty/etc/jdbcRealm.properties</Set>
</New>
</Arg>
</Call>
/usr/local/jetty/etc/jdbcRealm.properties已更改为777,似乎已被使用,因为路径错误我会得到一个错误.
/usr/local/jetty/etc/jdbcRealm.properties has been chmoded to 777 and seems to be used since with a wrong path i get an error.
jdbcRealm.properties内容:
jdbcRealm.properties content:
jdbcdriver = org.gjt.mm.mysql.Driver
url = jdbc:mysql://mydatabasefqdb:3306/mydatabasename
username = mydatabaseuser
password = mydatabasepassword
userTable = gateway_users
userTableKey = ID
userTableUserField = USERNAME
userTablePasswordField = PASSWORD
roleTable = gateway_roles
roleTableKey = ID
roleTableRoleField = NAME
userRoleTableName = gateway_users_roles
userRoleTableUserKey = user_id
userRoleTableRoleKey = role_id
cachetime = 300
版本:
码头:9.3.2
jetty: 9.3.2
jre:8
mysql:5.5
mysql: 5.5
推荐答案
这是属性文件中的大写字母...
it was the caps in the properties file...
与它一起工作:
jdbcdriver = org.gjt.mm.mysql.Driver
url = jdbc:mysql://mydatabasefqdn:3306/mydatabasename
username = mydatabaseuser
password = mydatabasepassword
usertable = gateway_users
usertablekey = ID
usertableuserfield = USERNAME
usertablepasswordfield = PASSWORD
roletable = gateway_roles
roletablekey = ID
roletablerolefield = NAME
userroletable = gateway_users_roles
userroletableuserkey = user_id
userroletablerolekey = role_id
cachetime = 300
这篇关于Jetty JDBCLoginService在mysql请求中使用null的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文