Index: DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/pom.xml
===================================================================
--- DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/pom.xml	(revision 5385)
+++ DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/pom.xml	(revision 5393)
@@ -31,5 +31,5 @@
             <version>2.5</version>
             <scope>provided</scope>
-        </dependency>
+        </dependency>        
 <!--        <dependency>
             <groupId>com.sun.jersey</groupId>
Index: DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/Helpers.java
===================================================================
--- DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/Helpers.java	(revision 5385)
+++ DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/Helpers.java	(revision 5393)
@@ -23,4 +23,5 @@
 import java.io.InputStream;
 import java.util.Map;
+import java.util.UUID;
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
@@ -32,5 +33,5 @@
 import org.w3c.dom.ls.LSSerializer;
 import org.xml.sax.SAXException;
-
+import java.util.Random;
 /**
  *
@@ -40,6 +41,8 @@
 
     //exception messages
-    final static public String INVALID_BODY_EXCEPTION = "Invalide annotation body: both, text and xml options, are null.";
-
+    //final static public String INVALID_BODY_EXCEPTION = "Invalide annotation body: both, text and xml options, are null.";
+    final static String hexa = "ABCDEabcde";
+    final static int hexan= hexa.length();
+    
     public static String replace(String text, Map<String, ?> pairs) {
         StringBuilder result = new StringBuilder(text);
@@ -119,3 +122,16 @@
         return encoder.encodePassword(pswd, salt);
     }
+    
+    public static UUID generateUUID(){ 
+        UUID result = UUID.randomUUID();
+        char[] chars = result.toString().toCharArray();
+        if (chars[0] >= 'a'  && chars[0] <='z') {
+            return result;
+        } else {
+            Random r = new Random();
+            chars[0] = hexa.charAt(r.nextInt(hexan));
+            result = UUID.fromString(new String(chars));
+            return result;
+        }       
+    }
 }
Index: DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/impl/JdbcAnnotationDao.java
===================================================================
--- DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/impl/JdbcAnnotationDao.java	(revision 5385)
+++ DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/impl/JdbcAnnotationDao.java	(revision 5393)
@@ -464,5 +464,5 @@
 
         // generate a new annotation ID 
-        UUID externalID = UUID.randomUUID();
+        UUID externalID = Helpers.generateUUID();
         Map<String, Object> params = new HashMap<String, Object>();
         params.put("externalId", externalID.toString());
Index: DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/impl/JdbcCachedRepresentationDao.java
===================================================================
--- DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/impl/JdbcCachedRepresentationDao.java	(revision 5385)
+++ DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/impl/JdbcCachedRepresentationDao.java	(revision 5393)
@@ -18,4 +18,5 @@
 package eu.dasish.annotation.backend.dao.impl;
 
+import eu.dasish.annotation.backend.Helpers;
 import eu.dasish.annotation.backend.NotInDataBaseException;
 import eu.dasish.annotation.backend.dao.CachedRepresentationDao;
@@ -152,5 +153,5 @@
     public Number addCachedRepresentation(CachedRepresentationInfo cachedInfo, InputStream streamCached) throws NotInDataBaseException, IOException {
 
-        UUID externalIdentifier = UUID.randomUUID();
+        UUID externalIdentifier = Helpers.generateUUID();
         Map<String, Object> params = new HashMap<String, Object>();
         params.put("externalId", externalIdentifier.toString());
Index: DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/impl/JdbcNotebookDao.java
===================================================================
--- DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/impl/JdbcNotebookDao.java	(revision 5385)
+++ DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/impl/JdbcNotebookDao.java	(revision 5393)
@@ -18,4 +18,5 @@
 package eu.dasish.annotation.backend.dao.impl;
 
+import eu.dasish.annotation.backend.Helpers;
 import eu.dasish.annotation.backend.NotInDataBaseException;
 import eu.dasish.annotation.backend.dao.NotebookDao;
@@ -239,5 +240,5 @@
     public Number createNotebookWithoutAccesssAndAnnotations(Notebook notebook, Number ownerID) throws NotInDataBaseException {
 
-        UUID externalID = UUID.randomUUID();
+        UUID externalID = Helpers.generateUUID();
         Map<String, Object> params = new HashMap<String, Object>();
         params.put("externalId", externalID.toString());
Index: DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/impl/JdbcPrincipalDao.java
===================================================================
--- DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/impl/JdbcPrincipalDao.java	(revision 5385)
+++ DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/impl/JdbcPrincipalDao.java	(revision 5393)
@@ -197,5 +197,5 @@
     public Number addPrincipal(Principal principal, String remoteID) throws NotInDataBaseException {
 
-        UUID externalIdentifier = UUID.randomUUID();
+        UUID externalIdentifier = Helpers.generateUUID();
         String newExternalIdentifier = externalIdentifier.toString();
         Map<String, Object> params = new HashMap<String, Object>();
Index: DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/impl/JdbcTargetDao.java
===================================================================
--- DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/impl/JdbcTargetDao.java	(revision 5385)
+++ DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/dao/impl/JdbcTargetDao.java	(revision 5393)
@@ -18,4 +18,5 @@
 package eu.dasish.annotation.backend.dao.impl;
 
+import eu.dasish.annotation.backend.Helpers;
 import eu.dasish.annotation.backend.NotInDataBaseException;
 import eu.dasish.annotation.backend.dao.TargetDao;
@@ -188,5 +189,5 @@
     public Number addTarget(Target target) throws NotInDataBaseException {
 
-        UUID externalID = UUID.randomUUID();
+        UUID externalID = Helpers.generateUUID();
         String[] linkParts = splitLink(target.getLink());
         Map<String, Object> params = new HashMap<String, Object>();
Index: DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/webapp/WEB-INF/web.xml
===================================================================
--- DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/webapp/WEB-INF/web.xml	(revision 5385)
+++ DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/webapp/WEB-INF/web.xml	(revision 5393)
@@ -32,5 +32,5 @@
     <context-param>
         <param-name>eu.dasish.annotation.backend.schemaLocation</param-name>
-        <param-value>/Users/olhsha/repositories/DASISH/t5.6/schema/trunk/annotator-schema/src/main/resources/DASISH-schema.xsd</param-value>    
+        <param-value>http://lux17.mpi.nl/schemacat/schemas/s16/files/DASISH-schema.xsd</param-value>    
     </context-param>
     <context-param>
Index: DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/webapp/index.jsp
===================================================================
--- DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/webapp/index.jsp	(revision 5385)
+++ DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/webapp/index.jsp	(revision 5393)
@@ -54,5 +54,5 @@
         GET <a href="api/annotations?link=Sagrada_Fam%C3%ADlia">api/annotations?link=Sagrada_Fam%C3%ADlia</a>  <br>
         GET <a href="api/annotations?link=Antoni_Gaud%C3%AD">api/annotations?link=Antoni_Gaud%C3%AD</a>  <br>
-        GET <a href="api/annotations?after=2014-02-04 15:57:58.046908&before=2014-04-06 10:08:16.213186">api/annotations?after=2014-02-04 15:57:58.046908&before=2014-04-06 10:08:16.213186</a><br> 
+        GET <a href="api/annotations?after=2013-02-04 15:57:58.046908&before=2014-06-25 10:08:16.213186">api/annotations?after=2014-02-04 15:57:58.046908&before=2014-04-06 10:08:16.213186</a><br> 
 <!--        !Comment: What is "namespace" query parameter? Must be implemented and tested <br>-->
         GET <a href="api/annotations/00000000-0000-0000-0000-000000000022">api/annotations/00000000-0000-0000-0000-000000000022</a>  </br>
@@ -61,7 +61,9 @@
         GET <a href="api/targets/00000000-0000-0000-0000-000000000032">api/targets/00000000-0000-0000-0000-000000000032</a>  <br>
         GET <a href="api/targets/00000000-0000-0000-0000-000000000032/versions">api/targets/00000000-0000-0000-0000-000000000032/versions</a>   <br>
-        GET <a href="api/cached/654809f6-1202-4073-86b8-a1f6fe0f2409/metadata">api/cached/654809f6-1202-4073-86b8-a1f6fe0f2409/metadata</a><br>
-        GET <a href="api/cached/654809f6-1202-4073-86b8-a1f6fe0f2409/stream">api/cached/654809f6-1202-4073-86b8-a1f6fe0f2409/stream</a><br> 
+        GET <a href="api/cached/b0d3f18c-eecf-40ea-9979-eecbbdca7d68/metadata">api/cached/b0d3f18c-eecf-40ea-9979-eecbbdca7d68//metadata</a><br>
+        GET <a href="api/cached/b0d3f18c-eecf-40ea-9979-eecbbdca7d68/stream">api/cached/b0d3f18c-eecf-40ea-9979-eecbbdca7d68/stream</a><br> 
         GET <a href="api/cached/00000000-0000-0000-0000-000000000051/content">api/cached/00000000-0000-0000-0000-000000000051/content</a><br> 
+        GET <a href="api/cached/de82f9d5-6b84-4c9d-8b8a-0736c8b1dd79/stream">api/cached/de82f9d5-6b84-4c9d-8b8a-0736c8b1dd79/stream</a><br> 
+        
         
         
Index: DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/java/eu/dasish/annotation/backend/TestInstances.java
===================================================================
--- DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/java/eu/dasish/annotation/backend/TestInstances.java	(revision 5385)
+++ DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/java/eu/dasish/annotation/backend/TestInstances.java	(revision 5393)
@@ -87,5 +87,5 @@
 
     private Annotation makeAnnotationToAdd(String relativePath) {
-        Annotation result = makeAnnotation(relativePath, "<html><body>some html 3</body></html>", "text/plain", "Annotation to add to test DAO", "00000000-0000-0000-0000-000000000113",  UUID.randomUUID().toString());
+        Annotation result = makeAnnotation(relativePath, "<html><body>some html 3</body></html>", "text/plain", "Annotation to add to test DAO", "00000000-0000-0000-0000-000000000113",  Helpers.generateUUID().toString());
 
         TargetInfo TargetInfo = new TargetInfo();
Index: DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/java/eu/dasish/annotation/backend/dao/impl/DBDispatcherTest.java
===================================================================
--- DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/java/eu/dasish/annotation/backend/dao/impl/DBDispatcherTest.java	(revision 5385)
+++ DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/java/eu/dasish/annotation/backend/dao/impl/DBDispatcherTest.java	(revision 5393)
@@ -18,4 +18,5 @@
 package eu.dasish.annotation.backend.dao.impl;
 
+import eu.dasish.annotation.backend.Helpers;
 import eu.dasish.annotation.backend.NotInDataBaseException;
 import eu.dasish.annotation.backend.PrincipalCannotBeDeleted;
@@ -687,5 +688,5 @@
         String type = "text";
         String tool = "latex";
-        String externalID = UUID.randomUUID().toString();
+        String externalID = Helpers.generateUUID().toString();
         final CachedRepresentationInfo newCachedInfo = new CachedRepresentationInfo();
         newCachedInfo.setMimeType(mime);
@@ -754,5 +755,5 @@
         // test 2: adding a new Target
         TargetInfo testTargetTwo = new TargetInfo();
-        final String tempTargetID = "/api/targets/"+UUID.randomUUID().toString();
+        final String tempTargetID = "/api/targets/"+Helpers.generateUUID().toString();
         testTargetTwo.setHref(tempTargetID);
         testTargetTwo.setLink("http://www.sagradafamilia.cat/docs_instit/historia.php");
@@ -761,5 +762,5 @@
         mockTargetListTwo.add(testTargetTwo);
 
-        final UUID mockNewTargetUUID = UUID.randomUUID();
+        final UUID mockNewTargetUUID = Helpers.generateUUID();
         final NotInDataBaseException e = new NotInDataBaseException("target", "external ID", tempTargetID);
 
@@ -1653,5 +1654,5 @@
         final NotInDataBaseException e = new NotInDataBaseException("annotation", "external ID", "00000000-0000-0000-0000-000000000031");
         final String mockTempID = "00000000-0000-0000-0000-000000000031";
-        final UUID mockNewID = UUID.randomUUID();
+        final UUID mockNewID = Helpers.generateUUID();
         final PermissionList permissions = annotation.getPermissions();
 
Index: DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/java/eu/dasish/annotation/backend/dao/impl/JdbcAnnotationDaoTest.java
===================================================================
--- DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/java/eu/dasish/annotation/backend/dao/impl/JdbcAnnotationDaoTest.java	(revision 5385)
+++ DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/java/eu/dasish/annotation/backend/dao/impl/JdbcAnnotationDaoTest.java	(revision 5393)
@@ -66,5 +66,5 @@
         System.out.println("test stringURItoExternalID");
         jdbcAnnotationDao.setResourcePath("/api/annotations/");
-        String randomUUID = UUID.randomUUID().toString();
+        String randomUUID = Helpers.generateUUID().toString();
         String uri = "/api/annotations/" + randomUUID;
         String uuid = jdbcAnnotationDao.hrefToExternalID(uri);
@@ -80,5 +80,5 @@
         System.out.println("test externalIDtoHref");
         jdbcAnnotationDao.setResourcePath("/api/annotations/");
-        String randomUUID = UUID.randomUUID().toString();
+        String randomUUID = Helpers.generateUUID().toString();
         String uri = "/api/annotations/" + randomUUID;
         String uriResult = jdbcAnnotationDao.externalIDtoHref(randomUUID);
Index: DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/java/eu/dasish/annotation/backend/dao/impl/JdbcCachedRepresentationDaoTest.java
===================================================================
--- DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/java/eu/dasish/annotation/backend/dao/impl/JdbcCachedRepresentationDaoTest.java	(revision 5385)
+++ DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/java/eu/dasish/annotation/backend/dao/impl/JdbcCachedRepresentationDaoTest.java	(revision 5393)
@@ -18,4 +18,5 @@
 package eu.dasish.annotation.backend.dao.impl;
 
+import eu.dasish.annotation.backend.Helpers;
 import eu.dasish.annotation.backend.NotInDataBaseException;
 import eu.dasish.annotation.schema.CachedRepresentationInfo;
@@ -51,5 +52,5 @@
         System.out.println("test hrefToExternalID");
         jdbcCachedRepresentationDao.setResourcePath("/api/cached/");
-        String randomUUID = UUID.randomUUID().toString();
+        String randomUUID = Helpers.generateUUID().toString();
         String uri = "/api/cached/" + randomUUID;
         String check = jdbcCachedRepresentationDao.hrefToExternalID(uri);
@@ -65,5 +66,5 @@
         System.out.println("test stringURItoExternalID");
         jdbcCachedRepresentationDao.setResourcePath("/api/cached/");
-        String randomUUID = UUID.randomUUID().toString();
+        String randomUUID = Helpers.generateUUID().toString();
         String uri = "/api/cached/"+randomUUID;
         String uriResult = jdbcCachedRepresentationDao.externalIDtoHref(randomUUID);
@@ -191,7 +192,30 @@
         byte[] newBytes = new byte[blobBytes.length];
         is.read(newBytes);
-        assertEquals(blobString, new String(newBytes));
-        
-    }
+        String test =new String(newBytes); 
+        assertEquals(blobString, test);
+        
+    }
+    
+    @Test
+    public void testGetCachedRepresentationBlob() throws IOException{
+        System.out.println("test getCachedRepresentationBlob");
+        jdbcCachedRepresentationDao.setResourcePath("/api/cached/");
+        
+        InputStream is = jdbcCachedRepresentationDao.getCachedRepresentationBlob(7);
+        byte[] newBytes = new byte[2];
+        is.read(newBytes);
+        assertEquals("12", new String(newBytes));
+        
+    }
+    
+    @Test
+    public void testHelpersUUIDgeneration(){
+        for (int i=0; i<50; i++) {
+            String test = Helpers.generateUUID().toString();
+            char c = test.charAt(0);
+            assertTrue('a'<=c && c<='z');
+        }
+    }
+
    
 }
Index: DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/java/eu/dasish/annotation/backend/dao/impl/JdbcPrincipalDaoTest.java
===================================================================
--- DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/java/eu/dasish/annotation/backend/dao/impl/JdbcPrincipalDaoTest.java	(revision 5385)
+++ DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/java/eu/dasish/annotation/backend/dao/impl/JdbcPrincipalDaoTest.java	(revision 5393)
@@ -19,7 +19,7 @@
 
 
+import eu.dasish.annotation.backend.Helpers;
 import eu.dasish.annotation.backend.NotInDataBaseException;
 import eu.dasish.annotation.backend.PrincipalCannotBeDeleted;
-import eu.dasish.annotation.backend.TestInstances;
 import eu.dasish.annotation.schema.Access;
 import eu.dasish.annotation.schema.Principal;
@@ -53,5 +53,5 @@
         System.out.println("test hrefToExternalID");
         jdbcPrincipalDao.setResourcePath("/api/principals/");
-        String randomUUID = UUID.randomUUID().toString();
+        String randomUUID = Helpers.generateUUID().toString();
         String uri = "/api/principals/" + randomUUID;
         String externalID = jdbcPrincipalDao.hrefToExternalID(uri).toString();
@@ -67,5 +67,5 @@
         System.out.println("test stringURItoExternalID");
         jdbcPrincipalDao.setResourcePath("/api/principals/");
-        String randomUUID = UUID.randomUUID().toString();
+        String randomUUID = Helpers.generateUUID().toString();
         String uri = "/api/principals/"+randomUUID;
         String uriResult = jdbcPrincipalDao.externalIDtoHref(randomUUID);
Index: DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/java/eu/dasish/annotation/backend/dao/impl/JdbcResourceDaoTest.java
===================================================================
--- DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/java/eu/dasish/annotation/backend/dao/impl/JdbcResourceDaoTest.java	(revision 5385)
+++ DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/java/eu/dasish/annotation/backend/dao/impl/JdbcResourceDaoTest.java	(revision 5393)
@@ -18,4 +18,5 @@
 package eu.dasish.annotation.backend.dao.impl;
 
+import eu.dasish.annotation.backend.Helpers;
 import java.io.File;
 import java.io.FileNotFoundException;
@@ -32,4 +33,5 @@
 import org.springframework.test.context.ContextConfiguration;
 import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+import static org.junit.Assert.*;
 /**
  *
@@ -90,4 +92,5 @@
         
     }
-
+    
+    
 }
Index: DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/java/eu/dasish/annotation/backend/dao/impl/JdbcTargetDaoTest.java
===================================================================
--- DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/java/eu/dasish/annotation/backend/dao/impl/JdbcTargetDaoTest.java	(revision 5385)
+++ DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/java/eu/dasish/annotation/backend/dao/impl/JdbcTargetDaoTest.java	(revision 5393)
@@ -18,4 +18,5 @@
 package eu.dasish.annotation.backend.dao.impl;
 
+import eu.dasish.annotation.backend.Helpers;
 import eu.dasish.annotation.backend.NotInDataBaseException;
 import eu.dasish.annotation.schema.Target;
@@ -52,5 +53,5 @@
         System.out.println("test hrefToExternalID");
         jdbcTargetDao.setResourcePath("/api/targets/");
-        String randomUUID = UUID.randomUUID().toString();
+        String randomUUID = Helpers.generateUUID().toString();
         String uri = "/api/targets/" + randomUUID;
         String externalID = (jdbcTargetDao.hrefToExternalID(uri)).toString();
@@ -66,5 +67,5 @@
         System.out.println("test stringURItoExternalID");
         jdbcTargetDao.setResourcePath("/api/targets/");
-        String randomUUID = UUID.randomUUID().toString();
+        String randomUUID = Helpers.generateUUID().toString();
         String uri = "/api/targets/" + randomUUID;
         String uriResult = jdbcTargetDao.externalIDtoHref(randomUUID);
Index: DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/java/eu/dasish/annotation/backend/rest/AnnotationResourceTest.java
===================================================================
--- DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/java/eu/dasish/annotation/backend/rest/AnnotationResourceTest.java	(revision 5385)
+++ DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/java/eu/dasish/annotation/backend/rest/AnnotationResourceTest.java	(revision 5393)
@@ -18,4 +18,5 @@
 package eu.dasish.annotation.backend.rest;
 
+import eu.dasish.annotation.backend.Helpers;
 import eu.dasish.annotation.backend.NotInDataBaseException;
 import eu.dasish.annotation.backend.Resource;
@@ -42,5 +43,4 @@
 import org.springframework.test.context.ContextConfiguration;
 import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-import java.net.URI;
 import java.util.UUID;
 import org.springframework.mock.web.MockHttpServletRequest;
@@ -177,5 +177,5 @@
 
         final Annotation addedAnnotation = (new ObjectFactory()).createAnnotation(annotationToAdd).getValue();
-        String externalId = UUID.randomUUID().toString();
+        String externalId = Helpers.generateUUID().toString();
         addedAnnotation.setId(externalId);
         addedAnnotation.setHref("/backend/api/annotations/" + externalId);
Index: DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/resources/test-data/InsertTestData.sql
===================================================================
--- DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/resources/test-data/InsertTestData.sql	(revision 5385)
+++ DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/test/resources/test-data/InsertTestData.sql	(revision 5393)
@@ -83,5 +83,5 @@
 INSERT INTO cached_representation (external_id, mime_type, tool, type_, file_) VALUES ('00000000-0000-0000-0000-000000000055', 'image/jpg', 'photomaster', 'image', X'1005'); --5 
 INSERT INTO cached_representation (external_id, mime_type, tool, type_, file_) VALUES ('00000000-0000-0000-0000-000000000056', 'text/plain', 'some tool', 'text', X'1006'); --6  not used
-INSERT INTO cached_representation (external_id, mime_type, tool, type_, file_) VALUES ('00000000-0000-0000-0000-000000000057', 'text/html', 'some tool 2', 'text', X'1007'); --7 
+INSERT INTO cached_representation (external_id, mime_type, tool, type_, file_) VALUES ('00000000-0000-0000-0000-000000000057', 'text/html', 'some tool 2', 'text', X'3132'); --7 
 
  -- PostgreSQL --
