Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

How to load the repository workspace using load rule programatically??

Hello team

I have a load rule generated programmatically.

how can i load a repository work space using a load rule using client API's??

Thank You very much 

0 votes



One answer

Permanent link

You have to do the following

1) ILoadRuleFactory.getLoadRule(...)
2) ILoadRule2.getLoadOp(...)
3) ILoadOperation.run()

You could also use the scm command line to load using the load rule by running "scm load <workspace> --remote-rules <loadrulefile> or --local-rules <loadrulefile>". Run "scm help load" for more information.

0 votes

Comments

Hi ,i used the below code :

 String f = "D:/SCM/test"+".loadrule";
        InputStream ins = new FileInputStream(f);
        Reader xmlReader = new InputStreamReader(ins);
     ILoadRule2 rule = ILoadRuleFactory.loadRuleFactory.getLoadRule(StreamName, xmlReader, monitor);                                   
ILoadOperation loadoperator = rule.getLoadOp(sandbox, p, monitor);
 monitor.subTask("loading files from RTC server...");
 loadoperator.run(monitor);
But When i try to run i get the below error :
Exception in thread "main" com.ibm.team.filesystem.client.FileSystemException: Error parsing load rule: schema_reference: Failed to read schema document 'LoadRule.xsd', because 'file' access is not allowed due to restriction set by the accessExternalSchema property.
How can i use the reader parameter ?

<style type="text/css"> p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 16.0px; font: 14.0px 'Helvetica Neue'; color: #333333; -webkit-text-stroke: #333333} p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 16.0px; font: 14.0px 'Helvetica Neue'; color: #333333; -webkit-text-stroke: #333333; min-height: 16.0px} span.s1 {font-kerning: none} </style>

A bit of googling I found this link: https://stackoverflow.com/questions/23011547/webservice-client-generation-error-with-jdk8

Try out one of the solutions and see if it works.


By the way, you should check ILoadRuleFactory.isXMLLoadRule(xmlReader) and if it returns true then call ILoadRuleFactory.getLoadRule(wsConn, xmlReader, monitor). Also I see that you are passing a "StreamName" to the getLoadRule method but it should be a IWorkspaceConnection.

Hello Shashikant,

I am also gettign same error as above mentioned user but it is not solved even after placing ,

Create a file named jaxp.properties (if it doesn’t exist) under path to your "JDK version/jre/lib" and then add the following line in it.

javax.xml.accessExternalSchema = all. 

Any other solutions ?

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,930

Question asked: Jun 12 '17, 4:36 a.m.

Question was seen: 3,215 times

Last updated: Mar 30 '22, 10:42 a.m.

Confirmation Cancel Confirm