Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
No replies
Michel Eisenmann
Michel Eisenmann
1 Post
ACCEPTED ANSWER

Pinned topic Deleting an asset just after creating it causes strange error

‏2010-01-21T10:51:53Z |
Hi

I'm using RAM 7.1 and the java client API to create and delete assets.

I have a java UNIT test that creates and deletes an asset in a sequence.
The asset creation goes well but when the deletion is supposed to be
executed, I receive the following error:

ERROR Failed to create the asset assets/education/schooltimetabling_1.0/version_test_assethttp://3.0 -- RAMSession

com.ibm.ram.common.data.exception.RAMRuntimeException: c:\demeter\iram_upload_dir\assets\education\assets\schooltimetabling\version_test_asset\version_test_asset_3.0.owl (The system cannot find the path specified)
at com.ibm.ram.client.LocalFileArtifact.getContents(LocalFileArtifact.java:53)
at com.ibm.ram.client.RAMAsset.createLocalArchiveArtifactRootFile(RAMAsset.java:2664)
at com.ibm.ram.client.RAMAsset.getLocalArtifactArchiveFile(RAMAsset.java:2559)
at com.ibm.ram.client.RAMSession.putAsset(RAMSession.java:1875)
at com.ibm.ram.client.RAMSession.put(RAMSession.java:3527)
at cps.protege.PtgIRAMHelper.commit(PtgIRAMHelper.java:141)
at cps.protege.PtgIRAMHelper.deleteAssets(PtgIRAMHelper.java:225)
at cps.protege.PtgIRAMHelper.clearRepository(PtgIRAMHelper.java:209)

Caused by: java.io.FileNotFoundException: c:\demeter\iram_upload_dir\assets\education\assets\schooltimetabling\version_test_asset\version_test_asset_3.0.owl (The system cannot find the path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at com.ibm.ram.client.LocalFileArtifact.getContents(LocalFileArtifact.java:47)
... 26 more

The file that is not found is an artifact that is associated with the asset I now want to delete.

Note that if I re-run the code that deletes the asset from a different session, it performs quite well.

It seems that doing in sequence creation and deletion is causing the issue...

Any idea?

Thanks
Michel
PS: the code to delete is very simple

asset.setAction(RAMAction.DELETE);
getSession().put(asset, new NullProgressMonitor());