Index: /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/nb-configuration.xml
===================================================================
--- /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/nb-configuration.xml	(revision 4208)
+++ /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/nb-configuration.xml	(revision 4209)
@@ -20,14 +20,5 @@
         <config-files>
             <config-file>src/main/resources/spring-config/applicationContext-security.xml</config-file>
-            <config-file>src/main/resources/spring-config/securityDataSource.xml</config-file>
-            <config-file>src/test/resources/spring-test-config/jaxbMarshallerFactory.xml</config-file>
-            <config-file>src/test/resources/spring-integrity-test-config/dataSource.xml</config-file>
-            <config-file>src/test/resources/spring-integrity-test-config/annotationDao.xml</config-file>
-            <config-file>src/test/resources/spring-integrity-test-config/userDao.xml</config-file>
-            <config-file>src/test/resources/spring-integrity-test-config/targetDao.xml</config-file>
-            <config-file>src/test/resources/spring-integrity-test-config/cachedRepresentationDao.xml</config-file>
-            <config-file>src/test/resources/spring-integrity-test-config/componentscan.xml</config-file>
-            <config-file>src/test/resources/spring-integrity-test-config/dbIntegrityService.xml</config-file>
-            <config-file>src/test/resources/spring-integrity-test-config/JaxbMarshallerFactory.xml</config-file>
+            <config-file>src/main/resources/spring-config/bCryptPasswordEncoder.xml</config-file>
         </config-files>
         <config-file-groups/>
Index: /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/pom.xml
===================================================================
--- /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/pom.xml	(revision 4208)
+++ /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/pom.xml	(revision 4209)
@@ -246,5 +246,5 @@
     <properties>
         <jersey.version>1.17.1</jersey.version>
-        <spring.version>3.0.0.RELEASE</spring.version>
+        <spring.version>3.2.0.RELEASE</spring.version>
         <slf4j.version>1.7.5</slf4j.version>
         <glassfish.version>3.1.1</glassfish.version>
Index: /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/AnnotationResource.java
===================================================================
--- /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/AnnotationResource.java	(revision 4208)
+++ /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/AnnotationResource.java	(revision 4209)
@@ -124,5 +124,5 @@
             return rootElement;
         } else {
-            httpServletResponse.sendError(HttpServletResponse.SC_FORBIDDEN);
+            httpServletResponse.sendError(HttpServletResponse.SC_FORBIDDEN, "The logged-in user cannot read the annotation.");
             return null;
         }
@@ -145,5 +145,5 @@
             return new ObjectFactory().createTargetList(TargetList);
         } else {
-            httpServletResponse.sendError(HttpServletResponse.SC_UNAUTHORIZED);
+            httpServletResponse.sendError(HttpServletResponse.SC_FORBIDDEN, "The logged-in user cannot read the annotation.");
             return null;
         }
@@ -188,5 +188,5 @@
             return new ObjectFactory().createPermissionList(permissionList);
         } else {
-            httpServletResponse.sendError(HttpServletResponse.SC_UNAUTHORIZED);
+            httpServletResponse.sendError(HttpServletResponse.SC_FORBIDDEN, "The logged-in user cannot read the annotation.");
             return null;
         }
@@ -209,5 +209,5 @@
             return result + " annotation(s) deleted.";
         } else {
-            httpServletResponse.sendError(HttpServletResponse.SC_UNAUTHORIZED);
+            httpServletResponse.sendError(HttpServletResponse.SC_FORBIDDEN, "The logged-in user cannot delete the annotation. Only the owner can delete the annotation.");
             return null;
         }
Index: /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/resources/spring-config/applicationContext-security.xml
===================================================================
--- /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/resources/spring-config/applicationContext-security.xml	(revision 4208)
+++ /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/resources/spring-config/applicationContext-security.xml	(revision 4209)
@@ -25,5 +25,5 @@
            http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
            http://www.springframework.org/schema/security
-           http://www.springframework.org/schema/security/spring-security-3.0.xsd">    
+           http://www.springframework.org/schema/security/spring-security-3.2.xsd">    
 
 
@@ -36,8 +36,8 @@
 </http>
 
-
 <authentication-manager>
     <authentication-provider>
-        <jdbc-user-service data-source-ref="securityDataSource"/>
+        <password-encoder ref="bCryptPasswordEncoder"/>
+        <jdbc-user-service data-source-ref="dataSource"/>
     </authentication-provider>
 </authentication-manager>
Index: /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/resources/spring-config/bCryptPasswordEncoder.xml
===================================================================
--- /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/resources/spring-config/bCryptPasswordEncoder.xml	(revision 4209)
+++ /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/resources/spring-config/bCryptPasswordEncoder.xml	(revision 4209)
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Copyright (C) 2013 DASISH
+
+    This program is free software; you can redistribute it and/or
+    modify it under the terms of the GNU General Public License
+    as published by the Free Software Foundation; either version 2
+    of the License, or (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+-->
+<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-3.0.xsd">    
+
+<bean id='bCryptPasswordEncoder' class='org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder'/>
+
+</beans>
Index: /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/resources/spring-config/cachedRepresentationDao.xml
===================================================================
--- /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/resources/spring-config/cachedRepresentationDao.xml	(revision 4208)
+++ /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/resources/spring-config/cachedRepresentationDao.xml	(revision 4209)
@@ -21,5 +21,4 @@
 <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-3.0.xsd
 ">
Index: SISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/resources/spring-config/securityDataSource.xml
===================================================================
--- /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/resources/spring-config/securityDataSource.xml	(revision 4208)
+++ 	(revision )
@@ -1,32 +1,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
-    Copyright (C) 2013 DASISH
-
-    This program is free software; you can redistribute it and/or
-    modify it under the terms of the GNU General Public License
-    as published by the Free Software Foundation; either version 2
-    of the License, or (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
--->
-<beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xmlns:context="http://www.springframework.org/schema/context"
-
-       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
-          http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
-">
-    <bean id="securityDataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
-        <property name="jndiName" value="java:comp/env/jdbc/DASISHSecurity"/>   
-        <property name="resourceRef" value="true" />
-    </bean>
-</beans>
Index: /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/java/eu/dasish/annotation/backend/rest/AnnotationsTest.java
===================================================================
--- /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/java/eu/dasish/annotation/backend/rest/AnnotationsTest.java	(revision 4208)
+++ /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/java/eu/dasish/annotation/backend/rest/AnnotationsTest.java	(revision 4209)
@@ -250,3 +250,5 @@
 	return resource.header(HttpHeaders.AUTHORIZATION, "Basic "  + new String(Base64.encode(DummyPrincipal.DUMMY_PRINCIPAL.getName()+":olhapassword")));
     }
+    
+    
 }
Index: /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/java/eu/dasish/annotation/backend/rest/BCryptTestUserPasswordEncoder.java
===================================================================
--- /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/java/eu/dasish/annotation/backend/rest/BCryptTestUserPasswordEncoder.java	(revision 4209)
+++ /DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/java/eu/dasish/annotation/backend/rest/BCryptTestUserPasswordEncoder.java	(revision 4209)
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2013 DASISH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+package eu.dasish.annotation.backend.rest;
+
+import java.util.HashMap;
+import java.util.Map;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
+/**
+ *
+ * @author olhsha
+ */
+@RunWith(value = SpringJUnit4ClassRunner.class)
+@ContextConfiguration({"/spring-test-config/dataSource.xml"})
+public class BCryptTestUserPasswordEncoder {
+    
+    final   Map<String, String> userPassword= new HashMap<String, String>();
+    private Map<String, String> passwordHash= new HashMap<String, String>();
+    private BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
+    
+    
+    public BCryptTestUserPasswordEncoder(){
+        userPassword.put("olha", "olha"+"password");
+        userPassword.put("stephanie", "stephanie"+"password");
+        userPassword.put("olof", "olof"+"password");
+        userPassword.put("twan", "twan"+"password");
+        userPassword.put("peter", "peter"+"password");
+        userPassword.put("przemek", "przemek"+"password");
+        userPassword.put("daan", "daan"+"password");
+        userPassword.put("menzo", "menzo"+"password");
+        userPassword.put("eric", "eric"+"password");
+    }
+    
+    
+    @Test
+    public void generateHashes(){
+        System.out.println("Passwords -- hashes:");
+        for (String user:userPassword.keySet()){
+            String hash = passwordEncoder.encode(userPassword.get(user));
+            System.out.println(userPassword.get(user)+" -- "+hash);
+            passwordHash.put(userPassword.get(user), hash);
+        }
+    }
+}
