SQL Delete query is not working in apache camel - sql

SQL Delete query is not working in camel, as it stuck at the SQL query and nothing happens. Have tried to execute same query in DB directly, it is working fine as expected.
Below is the glimpse of code.
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
<bean class="org.apache.commons.dbcp2.BasicDataSource"
destroy-method="close" id="OracleConnection">
<property name="driverClassName"
value="${Oracle.DB.DriverClassName}" />
<property name="url" value="${Oracle.DB.Url}" />
<property name="username" value="${Oracle.DB.Username}" />
<property name="password" value="${Oracle.DB.Password}" />
<property name="initialSize" value="${Oracle.DB.InitialSize}" />
<property name="maxTotal" value="${Oracle.DB.MaxTotal}" />
<property name="minIdle" value="${Oracle.DB.MinIdle}" />
<property name="maxIdle" value="${Oracle.DB.MaxIdle}" />
<property name="testOnBorrow" value="true" />
<property name="testOnReturn" value="true" />
<property name="removeAbandonedOnMaintenance" value="true" />
<property name="defaultAutoCommit" value="true" />
<property name="maxWaitMillis"
value="${Oracle.DB.MaxWaitMillis}" />
</bean>
<!-- configure the Camel SQL component to use the JDBC data source -->
<bean class="org.apache.camel.component.sql.SqlComponent" id="sql">
<property name="dataSource" ref="OracleConnection" />
</bean>
<camelContext id="GenerateOTPContext"
xmlns="http://camel.apache.org/schema/spring">
<route id="GenerateOTPMainRoute" streamCache="true">
<from id="_from1"
uri="restlet:http://localhost:9092/ESB/dbserviceapi/generateOTP?restletMethod=POST" />
<setHeader headerName="deleteQuery" id="_setHeader2">
<simple>sql:DELETE FROM MOBILE_OTP_DETAILS WHERE created_dt < SYSDATE - INTERVAL '20' MINUTE</simple>
</setHeader>
<log id="_log2" message="Delete query ${header.deleteQuery}" />
<recipientList delimiter="~" id="_recipientList2"
ignoreInvalidEndpoints="true">
<simple>${header.deleteQuery}</simple>
</recipientList>
<onException id="_onException1" useOriginalMessage="true">
<exception>java.sql.SQLException</exception>
<exception>java.lang.Exception</exception>
<handled>
<constant>true</constant>
</handled>
<log id="_log3"
message="ESBUUID : ${exchangeId} Exception occurred in GenerateOTPAdapter : ${exception.stacktrace}" />
</onException>
</route>
</camelContext>
</beans>
I'm using dbcp2, pool2 and camel-sql components to connect to DB.
Any suggestions please?

Have found the issue, I had created my own table but missed to grant the delete permission, so it was not deleting the data in DB from camel components so I granted the permission for my table and it worked.

Related

GET ALL LDAP USERS WITH LDAP BEAN

I am currently devloping a java web application based on activiti and i want to use ldap as an authentification system.
I Configured ldap as it its 's shown,but when i write this command in java System.out.println(processEngine.getIdentityService().createGroupQuery().list().size()); i got an error "This query is not supported by the LDAPGroupManager".So what can i do ?
Thank you in advance.
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<bean id="dataSource" class="org.springframework.jdbc.datasource.SimpleDriverDataSource">
<property name="driverClass" value="org.h2.Driver" />
<property name="url" value="jdbc:h2:mem:activiti;DB_CLOSE_DELAY=1000" />
<property name="username" value="sa" />
<property name="password" value="" />
</bean>
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean>
<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
<property name="dataSource" ref="dataSource" />
<property name="transactionManager" ref="transactionManager" />
<property name="databaseSchemaUpdate" value="true" />
<property name="jobExecutorActivate" value="false" />
<property name="configurators">
<list>
<bean class="org.activiti.ldap.LDAPConfigurator">
<!-- Server connection params -->
<property name="server" value="ldap://localhost" />
<property name="port" value="10389" />
<property name="user" value="uid=admin,ou=system" />
<property name="password" value="secret" />
<!-- Query params -->
<property name="baseDn" value="o=mojo" />
<property name="queryUserByUserId" value="(&(objectClass=inetOrgPerson)(uid={0}))" />
<property name="queryUserByFullNameLike" value="(&(objectClass=inetOrgPerson)(|({0}=*{1}*)({2}=*{3}*)))" />
<property name="queryGroupsForUser" value="(&(objectClass=groupOfUniqueNames)(uniqueMember={0}))" />
<!-- Attribute config -->
<property name="userIdAttribute" value="uid" />
<property name="userFirstNameAttribute" value="cn" />
<property name="userLastNameAttribute" value="sn" />
<property name="groupIdAttribute" value="cn" />
<property name="groupNameAttribute" value="cn" />
</bean>
</list>
</property>
</bean>
<bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean">
<property name="processEngineConfiguration" ref="processEngineConfiguration" />
</bean>
<bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService" />
<bean id="runtimeService" factory-bean="processEngine" factory-method="getRuntimeService" />
<bean id="taskService" factory-bean="processEngine" factory-method="getTaskService" />
<bean id="historyService" factory-bean="processEngine" factory-method="getHistoryService" />
<bean id="managementService" factory-bean="processEngine" factory-method="getManagementService" />
</beans>
we can't get all the ldap users with the bean this is not supported by the LDAPGroupManager

How to call many databases without hard-coding?

I have following scenario:
There are many sites/departments and every site has it's own ServiceMix and different number of databases. Those databases are grouped, for example there are two groups: production_one and production_two.
On every site I deployed bundles as a datasource, one datasource for every database.
Datasource: blueprint.xml
<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cxf="http://camel.apache.org/schema/blueprint/cxf"
xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
xsi:schemaLocation="
http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd">
<!-- Properties -->
<!-- blueprint property placeholders, that will use etc/datasources.cfg as the properties file -->
<cm:property-placeholder id="db.placeholder" persistent-id="datasources">
</cm:property-placeholder>
<!-- Datasource -->
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<property name="driverClassName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver" />
<property name="url"
value="jdbc:sqlserver://${bundle_ds_1_db_host}:${bundle_ds_1_db_port};databaseName=${bundle_ds_1_db_database};" />
<property name="username" value="${bundle_ds_1_db_username}" />
<property name="password" value="${bundle_ds_1_db_password}" />
</bean>
<!-- Init database-->
<bean id="initDatabase"
class="com.xyz.mssql.ds.DatabaseInitBean"
init-method="create" destroy-method="destroy">
<property name="ds" ref="dataSource" />
</bean>
<service ref="dataSource" interface="javax.sql.DataSource">
<service-properties>
<entry key="datasource.name" value="${bundle_ds_1_ds_name}" />
<entry key="datasource.type" value="${bundle_ds_1_ds_type}" />
<entry key="datasource.id" value="${bundle_ds_1_ds_id}" />
<entry key="datasource.group_id" value="${bundle_ds_1_ds_group_id}" />
</service-properties>
</service>
There is also bundle, which receives a SOAP message via cxf and process it by calling database:
CXF: blueprint.xml
<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cxf="http://camel.apache.org/schema/blueprint/cxf"
xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
xsi:schemaLocation="
http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
http://camel.apache.org/schema/blueprint/cxf http://camel.apache.org/schema/blueprint/cxf/camel-cxf.xsd
http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd">
<cxf:cxfEndpoint id="processXEndpoint" address="/mssql-soap1/"
serviceClass="com.xyz.mssql.soap1.ProcessXService" />
<bean id="saveDataProcessor"
class="com.xyz.mssql.soap1.SaveDataProcessor">
<property name="ds" ref="dataSource" />
</bean>
<bean id="getDataProcessor"
class="com.xyz.mssql.soap1.GetDataProcessor">
<property name="ds" ref="dataSource" />
</bean>
<!-- DataSource -->
<reference id="dataSource" interface="javax.sql.DataSource"
filter="(datasource.name=mssql-ds-1)">
<reference-listener bind-method="onBind"
unbind-method="onUnbind">
<bean class="com.xyz.mssql.soap1.ListenerBean" />
</reference-listener>
</reference>
<!-- Camel Context -->
<camelContext xmlns="http://camel.apache.org/schema/blueprint">
<route id="cxf">
<from uri="cxf:bean:processXEndpoint" />
<recipientList>
<simple>direct:${header.operationName}</simple>
</recipientList>
</route>
<route id="saveRoute">
<from uri="direct:saveData" />
<log message="Calling saveData" />
<process ref="saveDataProcessor" />
</route>
<route id="getRoute">
<from uri="direct:getData" />
<log message="Call getData" />
<process ref="getDataProcessor" />
</route>
</camelContext>
</blueprint>
The problem is, that following code inject to bean (ex: SaveDataProcessor) only one datasource resolved by it's name "datasource.name=mssql-ds-1", but I need to call many databases and on every servicemix installation there will be different number of them.
I need to call all databases (datasources) which have same type, for example "datasource.type=production_one".
Is it possible? How to do it?
How to pass to bean an array of datasources, or call this bean against every datasource which meet same conditions (name, type and so on).

How to config activiti.org to work with IBM Domino LDAP groups

I work on integration IBM Domino with activiti.org workflow engine. I need to connect Activiti with Domino LDAP in order to retrive users and groups.
I already can log in with my Domino credentials but I'm not able to resolve user groups. My user is a member of ACTIVITI_ADMINS domino group but he doesn't see activiti-explorer administration menu (the one that default kermit user see). I've made the following modifications in Activiti xml config files. What should I add/rewrite in my config files in order to resolve user groups?
activiti-custom-context.xml
<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
<!--...-->
<property name="configurators">
<list>
<bean class="org.activiti.ldap.LDAPConfigurator">
<!-- Server connection params -->
<property name="server" value="ldap://myDominoLdapServer" />
<property name="port" value="389" />
<property name="user" value="cn=User Ldap, ou=myUnit1, ou=myUnit2, o=myCompany" />
<property name="password" value="myPassword" />
<!-- Query params -->
<property name="baseDn" value="o=myCompany" />
<property name="queryUserByUserId" value="(&(objectClass=inetOrgPerson)(displayname={0}))" />
<property name="queryUserByFullNameLike" value="(&(objectClass=inetOrgPerson)(|({0}=*{1}*)({2}=*{3}*)))" />
<property name="queryGroupsForUser" value="(&(objectClass=groupOfUniqueNames)(uniqueMember={0}))" />
<!-- Attribute config -->
<property name="userIdAttribute" value="displayname" />
<property name="userFirstNameAttribute" value="GivenName" />
<property name="userLastNameAttribute" value="sn" />
<property name="userEmailAttribute" value="mail" />
<property name="groupIdAttribute" value="cn" />
<property name="groupNameAttribute" value="cn" />
</bean>
</list>
</property>
</bean>
activiti-ui-context.xml
<bean name="explorerApp" class="org.activiti.explorer.ExplorerApp" scope="session">
<property name="environment" value="${activiti.ui.environment}" />
<property name="useJavascriptDiagram" value="${activiti.ui.jsdiagram}" />
<property name="i18nManager" ref="i18nManager" />
<property name="viewManager" ref="viewManager" />
<property name="notificationManager" ref="notificationManager" />
<property name="attachmentRendererManager" ref="attachmentRendererManager" />
<property name="formPropertyRendererManager" ref="formPropertyRendererManager" />
<property name="variableRendererManager" ref="variableRendererManager" />
<property name="applicationMainWindow" ref="mainWindow" />
<property name="componentFactories" ref="componentFactories" />
<property name="workflowDefinitionConversionFactory" ref="workflowDefinitionConversionFactory" />
<property name="loginHandler" ref="activitiLoginHandler" />
<property name="simpleWorkflowJsonConverter" ref="simpleWorkflowJsonConverter" />
<property name="adminGroups">
<list>
<value>ACTIVITI_ADMINS</value>
</list>
</property>
<property name="userGroups">
<list>
<value>user</value>
</list>
</property>
</bean>
Your configuration looks right so the problem must have something to do with the LDAP query used to retrieved the groups for the user:
<property name="queryGroupsForUser" value="(&(objectClass=groupOfUniqueNames)(uniqueMember={0}))" />
Is this query returning the ACTIVITI_ADMIN group?
Well, I've found that the baseDN entry was the reason of my problem. I set empty value and Activiti is resolving my group now. The activiti-custom-context.xml file contains the following code:
<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
<!--...-->
<property name="configurators">
<list>
<bean class="org.activiti.ldap.LDAPConfigurator">
<!-- Server connection params -->
<property name="server" value="ldap://myDominoLdapServer" />
<property name="port" value="389" />
<property name="user" value="cn=User Ldap, ou=myUnit1, ou=myUnit2, o=myCompany" />
<property name="password" value="myPassword" />
<!-- Query params -->
<!--MY CHANGE START-->
<property name="baseDn" value="" />
<!--MY CHANGE END-->
<property name="queryUserByUserId" value="(&(objectClass=inetOrgPerson)(displayname={0}))" />
<property name="queryUserByFullNameLike" value="(&(objectClass=inetOrgPerson)(|({0}=*{1}*)({2}=*{3}*)))" />
<property name="queryGroupsForUser" value="(&(objectClass=groupOfUniqueNames)(uniqueMember={0}))" />
<!-- Attribute config -->
<property name="userIdAttribute" value="displayname" />
<property name="userFirstNameAttribute" value="GivenName" />
<property name="userLastNameAttribute" value="sn" />
<property name="userEmailAttribute" value="mail" />
<property name="groupIdAttribute" value="cn" />
<property name="groupNameAttribute" value="cn" />
</bean>
</list>
</property>
</bean>

get error :cannot commit a resource enlisted in a global transaction in activemq

Could you please help to solve the problem with XA transactions on Activemq and Oracle and Bitronix.
I have a activemq and using camel.xml embeded in for routing message from one queue to oracle db.
this is the content of camel.xml file in conf folder of standalone Activemq.
<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
<route id="partnerToDB">
<from uri="activemqXa:example.A" />
<transacted ref="PROPAGATION_REQUIRED"/>
<transform>
<simple>insert into tbl_1(body,type) values('${in.body}','P') </simple>
</transform>
<to uri="jdbc:dataSource" />
</route>
</camelContext>
<!-- TX configuration -->
<bean id="jtaTransactionManager" class="org.springframework.transaction.jta.JtaTransactionManager">
<property name="transactionManager" ref="transactionManager"/>
<property name="userTransaction" ref="transactionManager" />
</bean>
<bean id="btmConfig" factory-method="getConfiguration" class="bitronix.tm.TransactionManagerServices">
<property name="serverId" value="spring-btm" />
</bean>
<bean id="transactionManager" factory-method="getTransactionManager" class="bitronix.tm.TransactionManagerServices" depends-on="btmConfig" destroy-method="shutdown" />
<bean id="PROPAGATION_REQUIRED" class="org.apache.camel.spring.spi.SpringTransactionPolicy">
<property name="transactionManager" ref="jtaTransactionManager"/>
<property name="propagationBehaviorName" value="PROPAGATION_REQUIRED"/>
</bean>
<!-- JMS configuration -->
<bean id="resourceManager" class="org.apache.activemq.pool.ActiveMQResourceManager" init-method="recoverResource">
<property name="transactionManager" ref="transactionManager" />
<property name="connectionFactory" ref="pooledJmsXaConnectionFactory" />
<property name="resourceName" value="activemq.default,java/testDS1" />
</bean>
<bean id="pooledJmsXaConnectionFactory" class="bitronix.tm.resource.jms.PoolingConnectionFactory" init-method="init" destroy-method="close" >
<property name="className" value="org.apache.activemq.ActiveMQXAConnectionFactory" />
<property name="uniqueName" value="activemq" />
<property name="maxPoolSize" value="8" />
<property name="driverProperties">
<props>
<prop key="brokerURL">tcp://172.16.9.17:61617</prop>
</props>
</property>
</bean>
<bean id="activemqXa" class="org.apache.activemq.camel.component.ActiveMQComponent">
<!-- because of https://issues.apache.org/jira/browse/AMQ-3251, we cannot use the XaPooledConnectionFactory in AMQ 5.5.1 -->
<property name="connectionFactory" ref="pooledJmsXaConnectionFactory"/>
<property name="transacted" value="false"/>
<property name="transactionManager" ref="jtaTransactionManager"/>
</bean>
<!-- JDBC configuration -->
<bean id="dataSource" class="bitronix.tm.resource.jdbc.PoolingDataSource"
init-method="init" destroy-method="close">
<property name="className" value="bitronix.tm.resource.jdbc.lrc.LrcXADataSource" />
<property name="uniqueName" value="java/testDS1" />
<property name="maxPoolSize" value="5" />
<property name="minPoolSize" value="0" />
<property name="allowLocalTransactions" value="false" />
<property name="testQuery" value="SELECT 1 FROM DUAL" />
<property name="driverProperties">
<props>
<prop key="user">test</prop>
<prop key="password">test</prop>
<prop key="url">jdbc:oracle:thin:#db1sh:1521/org.amin.org</prop>
<prop key="driverClassName">oracle.jdbc.OracleDriver</prop>
</props>
</property>
</bean>
when I run Activemq and send a message to example.A queue, nothing is inserted on db and message is dequeued from queue, I get this error in activemq log:
[org.apache.camel.RuntimeCamelException - java.sql.SQLException: cannot commit a resource
enlisted in a global transaction]
Also I have run these SQL scripts for Oracle DataBase:
$ORACLE_HOME/javavm/install/initxa.sql
$ORACLE_HOME/javavm/install/initjvm.sql
and the following grant statments:
grant select on pending_trans$ to public;
grant select on dba_2pc_pending to public;
grant select on dba_pending_transactions to public;
grant execute on dbms_system to <user>;
Any ideas/solutions are welcome!
Thanks
Looking at the first lines in the camel jdbc component docs I find this information box
This component can not be used as a Transactional Client. If you need transaction support in your route, you should use the SQL component instead.

Do I need to manually set authenticationManager in spring?

After loading ApplicationContext I got a warning like this:
_ INFO: No authentication manager set. Reauthentication of users when changing passwords will not be performed. _
My Context.XML file is like this:
<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:sec="http://www.springframework.org/schema/security"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.6.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-3.1.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">
<!-- =============== Security =============== -->
<sec:method-security-metadata-source
id="method-security-metadata-source">
<sec:protect access="MyAccess"
method="springsecuritytest._00_base.AuthenticationTester.*" />
</sec:method-security-metadata-source>
<sec:global-method-security
access-decision-manager-ref="accessDecisionManager"
secured-annotations="enabled" pre-post-annotations="enabled"
proxy-target-class="true">
<sec:protect-pointcut
expression="execution(* springsecuritytest._00_base.AuthenticationTester.*(..))"
access="ROLE_USER_BASIC_099" />
<!-- <sec:protect-pointcut access="ROLE_USER_BASIC_099" expression="execution(*
springsecuritytest._00_base.AuthenticationTester.* (..))" /> -->
</sec:global-method-security>
<sec:authentication-manager alias="authenticationManager"
erase-credentials="true">
<sec:authentication-provider>
<sec:jdbc-user-service data-source-ref="dataSource" />
<!-- role-prefix="ROLE_" /> -->
</sec:authentication-provider>
</sec:authentication-manager>
<bean id="accessDecisionManager" class="org.springframework.security.access.vote.UnanimousBased">
<property name="decisionVoters">
<list>
<bean class="org.springframework.security.access.vote.RoleVoter" />
<!-- <bean class="org.springframework.security.access.vote.AuthenticatedVoter"/> -->
</list>
</property>
</bean>
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver" />
<property name="url" value="jdbc:mysql://localhost:3306/spring_security" />
<property name="username" value="root" />
<property name="password" value="" />
</bean>
any body can help me?
I found it, it seems to be caused by the bean definition model I used.
I too was experiencing this nebulous message in the log. I had to add a reference to my authentication manager in the http and UserDetailsManager in the xml configuration file. This will depend on how Spring security is configured, but hopefully it will help!
<security:http auto-config="true" authentication-manager-ref="authenticationManager" use-expressions="true">
<security:remember-me data-source-ref="dataSource" user-service-ref="userDetailsManagerDao" />
<security:intercept-url pattern="/" access="permitAll" />
<security:intercept-url pattern="/home" access="permitAll" />
<security:intercept-url pattern="/login" access="permitAll" />
<security:intercept-url pattern="/registration" access="permitAll" />
<security:intercept-url pattern="/**" access="hasRole('ROLE_USER')" />
<security:form-login login-page="/login" default-target-url="/default" login-processing-url="/login/authenticate"
username-parameter="username" password-parameter="password" authentication-failure-url="/login?error" />
<security:logout logout-url="/logout" logout-success-url="/login?logout" />
</security:http>
<bean id="userDetailsManagerDao" class="com.alphatek.tylt.repository.UserDetailsManagerJdbcDao">
<property name="dataSource" ref="dataSource" />
<property name="enableAuthorities" value="false" />
<property name="enableGroups" value="true" />
<property name="authenticationManager" ref="authenticationManager" />
</bean>
<security:authentication-manager id="authenticationManager">
<security:authentication-provider user-service-ref="userDetailsManagerDao">
<security:password-encoder ref="passwordEncoder" />
</security:authentication-provider>
</security:authentication-manager>