When I tried getRepositoryInfo with an anonymous repos, it worked fine. However, when I am explicitly specifying the repos creds as below, the call fails with com.sun.xml.wss.XWSSecurityException. Where could I be going wrong?
Code: uses apache chemistry's openCMIS
---------------------------------------------------------------
RepositoryInfo reposInfo = sess.getRepositoryInfo();
dumpReposInfo(reposInfo);
public
static Session getSOAPSession(String... args){Session sess =null;SessionFactory sessFact =null;Map<String, String> parameter =null;if((args == null) || (args.length<2)){throw new IllegalArgumentException("args can not be null or < 2");}String bsaeURL = args[0];//http://<host>:<port>/contextString reposId = args[1];String user =null;String password =null;if(args.length>=4){user = args[2];password = args[3];}sessFact = SessionFactoryImpl.newInstance();System.out.println("SessionFactory : f = "+sessFact);parameter =new HashMap<String, String>();// user credentialsparameter.put(SessionParameter.USER, "dmadmin");parameter.put(SessionParameter.PASSWORD, "******");// connection settingsparameter.put(SessionParameter.BINDING_TYPE, BindingType.WEBSERVICES.value());parameter.put(SessionParameter.REPOSITORY_ID, reposId);//remoteparameter.put(SessionParameter.WEBSERVICES_REPOSITORY_SERVICE, bsaeURL+"/services/RepositoryService?wsdl");parameter.put(SessionParameter.WEBSERVICES_VERSIONING_SERVICE, bsaeURL+"/services/VersioningService?wsdl");parameter.put(SessionParameter.WEBSERVICES_ACL_SERVICE, bsaeURL+"/services/ACLService?wsdl");parameter.put(SessionParameter.WEBSERVICES_DISCOVERY_SERVICE, bsaeURL+"/services/DiscoveryService?wsdl");parameter.put(SessionParameter.WEBSERVICES_MULTIFILING_SERVICE, bsaeURL+"/services/MultiFilingService?wsdl");parameter.put(SessionParameter.WEBSERVICES_NAVIGATION_SERVICE, bsaeURL+"/services/NavigationService?wsdl");parameter.put(SessionParameter.WEBSERVICES_OBJECT_SERVICE, bsaeURL+"/services/ObjectService?wsdl");parameter.put(SessionParameter.WEBSERVICES_POLICY_SERVICE, bsaeURL+"/services/PolicyService?wsdl");parameter.put(SessionParameter.WEBSERVICES_RELATIONSHIP_SERVICE, "/services/RelationshipService?wsdl");// session locale// parameter.put(SessionParameter.LOCALE_ISO3166_COUNTRY, "");// parameter.put(SessionParameter.LOCALE_ISO639_LANGUAGE, "en");// parameter.put(SessionParameter.LOCALE_VARIANT, "");// create sessionsess = sessFact.createSession(parameter);System.out.println("Session : sess = "+sess);return sess;}error-------- Error: com.sun.xml.wss.XWSSecurityException: The creation time is ahead of the current time.
org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException: Error: com.sun.xml.wss.XWSSecurityException: The creation time is ahead of the current time.
at org.apache.chemistry.opencmis.client.bindings.spi.webservices.RepositoryServiceImpl.getRepositoryInfo(RepositoryServiceImpl.java:107)
at org.apache.chemistry.opencmis.client.bindings.impl.RepositoryServiceImpl.getRepositoryInfo(RepositoryServiceImpl.java:69)
at org.apache.chemistry.opencmis.client.runtime.PersistentSessionImpl.connect(PersistentSessionImpl.java:673)
at org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl.createSession(SessionFactoryImpl.java:86)
at com.lexmark.poc.cmis.CommonUtil.getSOAPSession(CommonUtil.java:78)
at com.lexmark.poc.cmis.GenericTestClass.testSOAPBinding(GenericTestClass.java:70)
at com.lexmark.poc.cmis.GenericTestClass.main(GenericTestClass.java:39)
Caused by: javax.xml.ws.soap.SOAPFaultException: com.sun.xml.wss.XWSSecurityException: The creation time is ahead of the current time.
at com.sun.xml.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:189)
at com.sun.xml.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:122)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:119)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:89)
at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:118)
at $Proxy40.getRepositoryInfo(Unknown Source)
at org.apache.chemistry.opencmis.client.bindings.spi.webservices.RepositoryServiceImpl.getRepositoryInfo(RepositoryServiceImpl.java:103)
... 6 more