|
View:
New views
5 Messages
—
Rating Filter:
Alert me
|
|
|
PersistanceHi,
I marked an self-written object with the @Persist annotation but it seems that UNICORE does not persist it completely. Another Object where I did the same works fine. In this class, I declare a private HashMap<String, String> and private HashMap<String, List<TrustDelegation>> but between 2 independent calls on the same service instance the content of that HashMaps disappears. I think that all used Objects are Serializable. Must I use activate and passivate manually in this case? Thanks for the help, André -- André Höing Technische Universitaet Berlin Faculty of Electrical Engineering and Computer Science Department of Telecommunication Systems Complex and Distributed IT Systems Secr. EN 59 Einsteinufer 17 10587 Berlin Phone: +49 30 314 78946 Fax: +49 30 314 21114 e-mail: andre.hoeing@... WWW: http://www.cit.tu-berlin.de/ ------------------------------------------------------------------------------ Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf _______________________________________________ Unicore-support mailing list Unicore-support@... https://lists.sourceforge.net/lists/listinfo/unicore-support |
|
|
Re: Persistancehi,
would it be possible to condense this into a testcase? Maybe there is a problem with serialising the objects involved. Best regards, Bernd. On Do, 2009-10-01 at 14:05 +0200, André Höing wrote: > Hi, > > I marked an self-written object with the @Persist annotation but it > seems that UNICORE does not persist it completely. Another Object where > I did the same works fine. > > In this class, I declare a private HashMap<String, String> and private > HashMap<String, List<TrustDelegation>> but between 2 independent calls > on the same service instance the content of that HashMaps disappears. I > think that all used Objects are Serializable. > > Must I use activate and passivate manually in this case? > > Thanks for the help, > André > Dr. Bernd Schuller Distributed Systems and Grid Computing Juelich Supercomputing Centre, http://www.fz-juelich.de/jsc Phone: +49 246161-8736 (fax -8556) Personal blog: www.jroller.com/page/gridhaus ------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------ Forschungszentrum Juelich GmbH 52425 Juelich Sitz der Gesellschaft: Juelich Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498 Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender), Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt, Prof. Dr. Sebastian M. Schmidt ------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------ Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf _______________________________________________ Unicore-support mailing list Unicore-support@... https://lists.sourceforge.net/lists/listinfo/unicore-support |
|
|
Re: PersistanceHi Bernd,
I tried to create a testcase, but I do not know how to create a correct for WSRF Persistence testing. So I just tested the serializability and it seems to work. I attached the testcase and the Object that is empty after Unicore reloaded it. Thanks, André > hi, > > would it be possible to condense this into a testcase? > Maybe there is a problem with serialising the objects involved. > > Best regards, > Bernd. > > On Do, 2009-10-01 at 14:05 +0200, André Höing wrote: >> Hi, >> >> I marked an self-written object with the @Persist annotation but it >> seems that UNICORE does not persist it completely. Another Object where >> I did the same works fine. >> >> In this class, I declare a private HashMap<String, String> and private >> HashMap<String, List<TrustDelegation>> but between 2 independent calls >> on the same service instance the content of that HashMaps disappears. I >> think that all used Objects are Serializable. >> >> Must I use activate and passivate manually in this case? >> >> Thanks for the help, >> André >> > -- > Dr. Bernd Schuller > Distributed Systems and Grid Computing > Juelich Supercomputing Centre, http://www.fz-juelich.de/jsc > Phone: +49 246161-8736 (fax -8556) > Personal blog: www.jroller.com/page/gridhaus > > > ------------------------------------------------------------------------------------------------ > ------------------------------------------------------------------------------------------------ > Forschungszentrum Juelich GmbH > 52425 Juelich > Sitz der Gesellschaft: Juelich > Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498 > Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe > Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender), > Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt, > Prof. Dr. Sebastian M. Schmidt > ------------------------------------------------------------------------------------------------ > ------------------------------------------------------------------------------------------------ > > [TestSerializability.java] package de.dgrid.bisgrid.workflow.service; import java.io.ByteArrayInputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.util.LinkedList; import java.util.List; import javax.security.cert.X509Certificate; import junit.framework.TestCase; import xmlbeans.org.oasis.saml2.assertion.NameIDType; import de.dgrid.bisgrid.services.workflow.security.SecurityTokensManager; import de.fzj.unicore.uas.security.ProxyCertInHandler; import eu.unicore.samly2.SAMLConstants; import eu.unicore.security.etd.TrustDelegation; import eu.unicore.security.xfireutil.SecurityTokens; public class TestSerializability extends TestCase { public void test() throws Exception { SecurityTokensManager m = new SecurityTokensManager(); // create security token with a proxy cert and a saml trust delegation SecurityTokens s = new SecurityTokens(); s.getContext().put(ProxyCertInHandler.PROXY, getCertString()); List<TrustDelegation> tdTokens = new LinkedList<TrustDelegation>(); TrustDelegation td = new TrustDelegation("cn=proxy,1.2.840.113549.1.9.1=#161c756e69636f72652d737570706f7274406c697374732e73662e6e6574,c=de,o=unicore.eu,ou=testing,cn=unicore demo user"); NameIDType nameidType = NameIDType.Factory.newInstance(); X509Certificate cert = X509Certificate.getInstance(new ByteArrayInputStream(getCertString().getBytes())); nameidType.setStringValue(cert.getSubjectDN().toString()); nameidType.setFormat(SAMLConstants.NFORMAT_DN); td.setIssuer(nameidType); tdTokens.add(td); s.setTrustDelegationTokens(tdTokens); // insert the token into the manager m.insertToken(s); // serialize the object ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(new File("/tmp/test"))); oos.writeObject(m); oos.flush(); oos.close(); ObjectInputStream ois = new ObjectInputStream(new FileInputStream(new File("/tmp/test"))); Object readObject = ois.readObject(); // check content SecurityTokensManager copy = (SecurityTokensManager) readObject; String certNew = copy.getProxyCertHashMap().values().iterator().next(); assertTrue(certNew.equals(getCertString())); List<TrustDelegation> trustDelegationOfIssuer = copy.getTrustDelegationOfIssuer(cert.getSubjectDN().toString()); assertTrue(trustDelegationOfIssuer.get(0) != null); } private String getCertString() { return "-----BEGIN CERTIFICATE-----\n"+ "MIICgTCCAeqgAwIBAgIDAkwzMA0GCSqGSIb3DQEBBQUAMH0xGjAYBgNVBAMMEVVO\n"+ "SUNPUkUgZGVtbyB1c2VyMRAwDgYDVQQLDAdUZXN0aW5nMRMwEQYDVQQKDAp1bmlj\n"+ "b3JlLmV1MQswCQYDVQQGDAJERTErMCkGCSqGSIb3DQEJARYcdW5pY29yZS1zdXBw\n"+ "b3J0QGxpc3RzLnNmLm5ldDAeFw0wOTEwMDEwODM5MDVaFw0wOTEwMDExMDQ0MDVa\n"+ "MIGNMRowGAYDVQQDDBFVTklDT1JFIGRlbW8gdXNlcjEQMA4GA1UECwwHVGVzdGlu\n"+ "ZzETMBEGA1UECgwKdW5pY29yZS5ldTELMAkGA1UEBgwCREUxKzApBgkqhkiG9w0B\n"+ "CQEWHHVuaWNvcmUtc3VwcG9ydEBsaXN0cy5zZi5uZXQxDjAMBgNVBAMTBXByb3h5\n"+ "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDSJxUPYtPiRfGMp3r6GNEB83Pa\n"+ "a8mHcbj2d+aWVR8835fE33dOsuB45B0YNSboJcyfLBZ394i7G+y3ecnohAuwvKEC\n"+ "Fyiwkgud6OruhGgetnPppiWbXemK9lkAihPcWIJOH92txoAQYsPAIf3e91kNjTO4\n"+ "1B9k8xqReHT80rE3rQIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAI5/zVKIqQDXTLYG\n"+ "MRMtuIV6+Z8eeDKZwucwuL3HMojQ5aeqDUC23ouyFnPC07iwQRSmrkA/Jp0s6oMe\n"+ "9n8JyyKRb7vLXM0NsfLBCIwivxrD1wzM9/2XhfT1jbrzJM4vIxpJU2F10wkXKvaD\n"+ "Q0GvEC/VkgKHA4fjuJxDNqk7ol3B\n"+ "-----END CERTIFICATE-----\n"+ "-----BEGIN RSA PRIVATE KEY-----\n"+ "MIICXAIBAAKBgQDSJxUPYtPiRfGMp3r6GNEB83Paa8mHcbj2d+aWVR8835fE33dO\n"+ "suB45B0YNSboJcyfLBZ394i7G+y3ecnohAuwvKECFyiwkgud6OruhGgetnPppiWb\n"+ "XemK9lkAihPcWIJOH92txoAQYsPAIf3e91kNjTO41B9k8xqReHT80rE3rQIDAQAB\n"+ "AoGABegXTXFnpyp0GZHzgOgFp9ph3Te+WFI38qV4E62czSczqtLlFY8tg/hVYQLN\n"+ "byTw1WB12TVZ4HhudNG1fRWJBoecFI6Xmj45UgxzTUspqcLnxhvPnGUJ/nKUHwyq\n"+ "ZwLwRJBrFVG00gl6YjwUh4lqQpBwbJhf26F4B3ljeVYWEUECQQDtBZTXkudWYUdh\n"+ "LZQePK3LqtWdzvK1uwkkca/hWVIgGaCP+Wuqchp63PvOSXNNfHgf5rPReTSuOBTT\n"+ "tmTGV7apAkEA4vq+UaFYIMOYKQvF55DEgPKhkj65zNF2WBQePTwdEvwQsq97iY0F\n"+ "/GlyiumQXJ4LvX5aO5FXRuCwJZXpRfhPZQJAXUTN/kqLh/09tmrWF1PvW+68op21\n"+ "+ndAMLwf5sBcRc9v1Ffk2yyNaP2ehN14Zuxs5LjG184nQctFvs3OOBJ6CQJBAKFS\n"+ "G0BDTzKCMbxCjNcHUlJfoCwj/sQuv1Dcg518AyICGxAUntXlcDK08179n8fj4G4+\n"+ "xnz90K0kdq1P/eroD+0CQDxt0SdCiDSeN0YOWVXYgQUaKtHnHV52C0uk3zop63c0\n"+ "WlPPNJE1aMADXSFO5oj0PuJbg4QKRkulf2caMsYWmZE=\n"+ "-----END RSA PRIVATE KEY-----\n"+ "-----BEGIN CERTIFICATE-----\n"+ "MIICSDCCAbGgAwIBAgIBATANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJERTEh\n"+ "MB8GA1UEAxMYRGVtbyBDQSBmb3IgdGVzdGluZyBvbmx5MRMwEQYDVQQKEwpVTklD\n"+ "T1JFLkVVMRAwDgYDVQQLEwdUZXN0aW5nMB4XDTA3MTIzMTIzMDAwMFoXDTEyMTIz\n"+ "MDIzMDAwMFowfTEaMBgGA1UEAwwRVU5JQ09SRSBkZW1vIHVzZXIxEDAOBgNVBAsM\n"+ "B1Rlc3RpbmcxEzARBgNVBAoMCnVuaWNvcmUuZXUxCzAJBgNVBAYMAkRFMSswKQYJ\n"+ "KoZIhvcNAQkBFhx1bmljb3JlLXN1cHBvcnRAbGlzdHMuc2YubmV0MIGfMA0GCSqG\n"+ "SIb3DQEBAQUAA4GNADCBiQKBgQCVrCNiyUyVXMDJHWxB7Pt3sDROCUn6msnOmXg0\n"+ "/1MKyAaJaVw/eZACreOa8Tyqg+F/BFr1LdeikAjkZraYv4STCLDHlDV9KJI9XDB4\n"+ "6S8SqRlt+FsLsEgS23jtWYgZ2/GKidGEG7CfJ/TJIlsAk2Tc054FA3HXzJPdH/6y\n"+ "aQIWuQIDAQABMA0GCSqGSIb3DQEBBAUAA4GBAA+obQz9DSnTu4Kp6s23dWU3l7Jg\n"+ "oliMfINy6Omj9HXDQusY7G+hZ1t/HXwSB8fhiRp2G5AurvcwgFYQscCRgvewOTUN\n"+ "I+3IRWfpa3rtlsdiTzO+r2Kt/QJ+Y4WQmSDkqct05tGPy+8a6PSlaDJfSAEE/O3l\n"+ "DlwhxwqtDaUlq/Hp\n"+ "-----END CERTIFICATE-----"; } } [SecurityTokensManager.java] package de.dgrid.bisgrid.services.workflow.security; import java.io.ByteArrayInputStream; import java.io.Serializable; import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; import javax.security.auth.x500.X500Principal; import javax.security.cert.CertificateException; import javax.security.cert.X509Certificate; import org.apache.log4j.Logger; import de.fzj.unicore.uas.security.ProxyCertInHandler; import eu.unicore.security.etd.TrustDelegation; import eu.unicore.security.xfireutil.SecurityTokens; /** * stores all kind of TrustDelegation tokens so that they can be inserted into outgoing messages * @author ahoeing * */ public class SecurityTokensManager implements Serializable { public static final String testSubject= "CN=Test, OU=Test, O=Test Organisation, C=Testland"; public static Logger log = Logger.getLogger(SecurityTokensManager.class); private static final long serialVersionUID = -5411855919994811133L; private Map<String, List<TrustDelegation>> tokens = new HashMap<String, List<TrustDelegation>>(); private Map<String, String> proxyCerts = new HashMap<String, String>(); public SecurityTokensManager() { } /** * Inserts trust delegation tokens * @param t * @return saved the token */ public void insertToken(SecurityTokens t) { extractTrustDelegation(t); extractProxyCertificate(t); } private void extractProxyCertificate(SecurityTokens t) { String proxyCert = (String)t.getContext().get(ProxyCertInHandler.PROXY); if (proxyCert == null) { log.debug("no proxy cert included in call"); return; } try { X509Certificate cert = X509Certificate.getInstance(new ByteArrayInputStream(proxyCert.getBytes())); X500Principal proxyDN = new X500Principal(cert.getSubjectDN().getName()); if (proxyDN == null) { proxyDN = new X500Principal(testSubject); } proxyCerts.put(proxyDN.getName(X500Principal.CANONICAL), proxyCert); } catch (CertificateException e) { log.error("Can not parse cerificate",e); } } private void extractTrustDelegation(SecurityTokens t) { List<TrustDelegation> trustDelegationTokens = t.getTrustDelegationTokens(); if (trustDelegationTokens == null || trustDelegationTokens.isEmpty()) { log.debug("found no trust delegation information. Not saving this tokens"); return; } for (TrustDelegation td : trustDelegationTokens) { //log.debug("storing trust delegation: subject "+td.getSubjectDN()+" - issuer "+td.getIssuerDN()+" - custodian "+td.getCustodianDN()+" - user "+t.getUserName().getName()); X500Principal user = new X500Principal(td.getIssuerDN()); if (user == null) { user = new X500Principal(testSubject); } List<TrustDelegation> list = tokens.get(user.getName(X500Principal.CANONICAL)); if (list == null) { list = new LinkedList<TrustDelegation>(); } list.add(td); tokens.put(user.getName(X500Principal.CANONICAL), list); } } public Map<String, String> getProxyCertHashMap(){ return proxyCerts; } public List<TrustDelegation> getTrustDelegationOfIssuer(String issuerDN) { return tokens.get(new X500Principal(issuerDN).getName(X500Principal.CANONICAL)); } public String getProxyCertOfUser(String issuerDN) { return proxyCerts.get(new X500Principal(issuerDN).getName(X500Principal.CANONICAL)); } } ------------------------------------------------------------------------------ Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf _______________________________________________ Unicore-support mailing list Unicore-support@... https://lists.sourceforge.net/lists/listinfo/unicore-support |
|
|
Re: PersistanceHi Bernd, hi all,
I am not sure why, but I cannot reproduce the mistake any longer. I will write a new mail if I will run again into the problem. Thanks, André > Hi Bernd, > > I tried to create a testcase, but I do not know how to create a > correct for WSRF Persistence testing. So I just tested the > serializability and it seems to work. > > I attached the testcase and the Object that is empty after Unicore > reloaded it. > > Thanks, > André > >> hi, >> >> would it be possible to condense this into a testcase? >> Maybe there is a problem with serialising the objects involved. >> >> Best regards, >> Bernd. >> >> On Do, 2009-10-01 at 14:05 +0200, André Höing wrote: >>> Hi, >>> >>> I marked an self-written object with the @Persist annotation but it >>> seems that UNICORE does not persist it completely. Another Object where >>> I did the same works fine. >>> >>> In this class, I declare a private HashMap<String, String> and private >>> HashMap<String, List<TrustDelegation>> but between 2 independent calls >>> on the same service instance the content of that HashMaps disappears. I >>> think that all used Objects are Serializable. >>> >>> Must I use activate and passivate manually in this case? >>> >>> Thanks for the help, >>> André >>> >> -- >> Dr. Bernd Schuller >> Distributed Systems and Grid Computing >> Juelich Supercomputing Centre, http://www.fz-juelich.de/jsc >> Phone: +49 246161-8736 (fax -8556) >> Personal blog: www.jroller.com/page/gridhaus >> >> >> ------------------------------------------------------------------------------------------------ >> >> ------------------------------------------------------------------------------------------------ >> >> Forschungszentrum Juelich GmbH >> 52425 Juelich >> Sitz der Gesellschaft: Juelich >> Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498 >> Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe >> Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender), >> Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt, >> Prof. Dr. Sebastian M. Schmidt >> ------------------------------------------------------------------------------------------------ >> >> ------------------------------------------------------------------------------------------------ >> >> >> > -- André Höing Technische Universitaet Berlin Faculty of Electrical Engineering and Computer Science Department of Telecommunication Systems Complex and Distributed IT Systems Secr. EN 59 Einsteinufer 17 10587 Berlin Phone: +49 30 314 78946 Fax: +49 30 314 21114 e-mail: andre.hoeing@... WWW: http://www.cit.tu-berlin.de/ ------------------------------------------------------------------------------ Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf _______________________________________________ Unicore-support mailing list Unicore-support@... https://lists.sourceforge.net/lists/listinfo/unicore-support |
|
|
Re: Persistancehi,
one possibility might be that you need to set the "dirty" flag on the WSRFInstance, by calling "setDirty()" before the ws resource is persisted. So when you change the data to be persisted you need to make sure setDirty() is called. Best regards, Bernd. -- Dr. Bernd Schuller Distributed Systems and Grid Computing Juelich Supercomputing Centre, http://www.fz-juelich.de/jsc Phone: +49 246161-8736 (fax -8556) Personal blog: www.jroller.com/page/gridhaus ________________________________________ Von: André Höing [andre.hoeing@...] Gesendet: Montag, 5. Oktober 2009 12:52 An: Schuller, Bernd Cc: Unicore Support Betreff: Re: [Unicore-support] Persistance Hi Bernd, hi all, I am not sure why, but I cannot reproduce the mistake any longer. I will write a new mail if I will run again into the problem. Thanks, André > Hi Bernd, > > I tried to create a testcase, but I do not know how to create a > correct for WSRF Persistence testing. So I just tested the > serializability and it seems to work. > > I attached the testcase and the Object that is empty after Unicore > reloaded it. > > Thanks, > André > >> hi, >> >> would it be possible to condense this into a testcase? >> Maybe there is a problem with serialising the objects involved. >> >> Best regards, >> Bernd. >> >> On Do, 2009-10-01 at 14:05 +0200, André Höing wrote: >>> Hi, >>> >>> I marked an self-written object with the @Persist annotation but it >>> seems that UNICORE does not persist it completely. Another Object where >>> I did the same works fine. >>> >>> In this class, I declare a private HashMap<String, String> and private >>> HashMap<String, List<TrustDelegation>> but between 2 independent calls >>> on the same service instance the content of that HashMaps disappears. I >>> think that all used Objects are Serializable. >>> >>> Must I use activate and passivate manually in this case? >>> >>> Thanks for the help, >>> André >>> >> -- >> Dr. Bernd Schuller >> Distributed Systems and Grid Computing >> Juelich Supercomputing Centre, http://www.fz-juelich.de/jsc >> Phone: +49 246161-8736 (fax -8556) >> Personal blog: www.jroller.com/page/gridhaus >> >> >> ------------------------------------------------------------------------------------------------ >> >> ------------------------------------------------------------------------------------------------ >> >> Forschungszentrum Juelich GmbH >> 52425 Juelich >> Sitz der Gesellschaft: Juelich >> Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498 >> Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe >> Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender), >> Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt, >> Prof. Dr. Sebastian M. Schmidt >> ------------------------------------------------------------------------------------------------ >> >> ------------------------------------------------------------------------------------------------ >> >> >> > -- André Höing Technische Universitaet Berlin Faculty of Electrical Engineering and Computer Science Department of Telecommunication Systems Complex and Distributed IT Systems Secr. EN 59 Einsteinufer 17 10587 Berlin Phone: +49 30 314 78946 Fax: +49 30 314 21114 e-mail: andre.hoeing@... WWW: http://www.cit.tu-berlin.de/ ------------------------------------------------------------------------------ Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf _______________________________________________ Unicore-support mailing list Unicore-support@... https://lists.sourceforge.net/lists/listinfo/unicore-support |
| Free embeddable forum powered by Nabble | Forum Help |