I have the following Mule App, which i'm trying to securing it with Spring Security using a database to provide the users (jdbc-provider).
I correctly configured the mysql database and the mysql jdbc driver in the classpath of the Mule App, but when i try to login i am getting the following error:
Could not get JDBC Connection; nested exception is java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/test (org.springframework.jdbc.CannotGetJdbcConnectionException) org.springframework.jdbc.datasource.DataSourceUtils:80 (null)
Mule App (Based in Mule ESB 3.6.1):
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:http="http://ift.tt/1cFdM1N" xmlns="http://ift.tt/1atROtw" xmlns:doc="http://ift.tt/18e498t"
xmlns:spring="http://ift.tt/GArMu6" version="EE-3.6.1"
xmlns:xsi="http://ift.tt/ra1lAU"
xmlns:mule-ss="http://ift.tt/1qWrZQx"
xmlns:ss="http://ift.tt/1c8inpe"
xsi:schemaLocation="http://ift.tt/GArMu6 http://ift.tt/1bzZcnw
http://ift.tt/1atROtw http://ift.tt/18e498A
http://ift.tt/1cFdM1N http://ift.tt/1cFdOXb
http://ift.tt/18e47h2 http://ift.tt/18e47xm
http://ift.tt/1qWrZQx http://ift.tt/1FUt42C
http://ift.tt/1c8inpe http://ift.tt/1fChGbz
http://ift.tt/1yl2vfe http://ift.tt/1FUt42I
http://ift.tt/GArMu6 http://ift.tt/QEDs1e
http://ift.tt/1wZOTYs http://ift.tt/1qWrYfl">
<spring:beans>
<spring:bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<spring:property name="driverClassName" value="com.mysql.jdbc.Driver"/>
<spring:property name="url" value="jdbc:mysql://localhost:3306/test"/>
<spring:property name="username" value="root"/>
<spring:property name="password" value="sonar"/>
</spring:bean>
<ss:authentication-manager alias="authenticationManager">
<ss:authentication-provider>
<ss:jdbc-user-service data-source-ref="dataSource"
users-by-username-query=
"select username,password, enabled from users where username=?"
authorities-by-username-query=
"select username, role from user_roles where username =? " />
</ss:authentication-provider>
</ss:authentication-manager>
</spring:beans>
<mule-ss:security-manager>
<mule-ss:delegate-security-provider name="jdbc-provider" delegate-ref="authenticationManager" />
</mule-ss:security-manager>
<http:listener-config name="HTTP_Listener_Configuration" host="localhost" port="8081" doc:name="HTTP Listener Configuration" />
<flow name="SpringExample">
<http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>
<logger level="INFO" message="## received" doc:name="Logger"/>
<http:basic-security-filter realm="mule-realm" securityProviders="jdbc-provider"/>
<logger level="INFO" message="## passed security" doc:name="Logger"/>
</flow>
</mule>
Stack Trace:
INFO 2015-03-27 21:31:04,255 [[spring-security-maven].HTTP_Listener_Configuration.worker.01] org.mule.api.processor.LoggerMessageProcessor: ## received
ERROR 2015-03-27 21:31:04,299 [[spring-security-maven].HTTP_Listener_Configuration.worker.01] org.mule.exception.DefaultMessagingExceptionStrategy:
********************************************************************************
Message : Authentication Attempt Failed. Message payload is of type: NullPayload
Code : MULE_ERROR--2
--------------------------------------------------------------------------------
Exception stack is:
1. No suitable driver found for jdbc:mysql://localhost:3306/test (java.sql.SQLException)
java.sql.DriverManager:596 (null)
2. Could not get JDBC Connection; nested exception is java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/test (org.springframework.jdbc.CannotGetJdbcConnectionException)
org.springframework.jdbc.datasource.DataSourceUtils:80 (null)
3. Could not get JDBC Connection; nested exception is java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/test (org.springframework.security.authentication.AuthenticationServiceException)
org.springframework.security.authentication.dao.DaoAuthenticationProvider:85 (null)
4. Authentication Attempt Failed. Message payload is of type: NullPayload (org.mule.api.security.UnauthorisedException)
org.mule.security.MuleSecurityManager:91 (http://ift.tt/1yl2xnu)
--------------------------------------------------------------------------------
Root Exception stack trace:
java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/test
at java.sql.DriverManager.getConnection(DriverManager.java:596)
at java.sql.DriverManager.getConnection(DriverManager.java:187)
at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriverManager(DriverManagerDataSource.java:173)
+ 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
********************************************************************************
Aucun commentaire:
Enregistrer un commentaire