EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Callback File System and “no jnicbfs in java.library.path” error

Also by EldoS: RawDisk
Access locked and protected files in Windows, read and write disks and partitions and more.
#19606
Posted: 03/28/2012 08:05:54
by szagriichuk  (Basic support level)
Joined: 03/28/2012
Posts: 51

I've created a simple code for mount virtual disk into system using example from standart instalation package. Java Example. So, After it I've created a few unit tests, the first is mounting disc into system and check that disck was mounted the second trying to mount disk and try to create simple file for check/handle events of creating/open and so on files, so, if I am using just a one test all is working good, if two I'm receiving error no jnicbfs in java.library.path Could some one help me to fix this problem ? P.S. - License is trial - Simple code below
Code
  @Override
    public boolean createVirtualDisk(Stri ng diskLetter) {

        CallbackFileSystem callbackFileSystem;
        boolean isCreated = true;

        try {

            // create CbFS instance
            callbackFileSystem = new CallbackFileSystem(new CloudFileSystemEventHandler());

            //initialize system properties
            initCallBackFileSystemProperties(diskLetter, callbackFileSystem);

            // mount point
            callbackFileSystem.mountMedia(0);

        } catch (ECBFSError e) {
            LOGGER.error(e.getMessage(), e);
            isCreated = false;
        }

        return isCreated;
    }

    private void initCallBackFileSystemProperties(Stri ng volumeKey, CallbackFileSystem callbackFileSystem) throws ECBFSError {
        callbackFileSystem.setRegistrationKey(cloudFileSystemProperties.getLicenseKey());
        callbackFileSystem.setSerializeCallbacks(cloudFileSystemProperties.isSerializeCallbacks());
        callbackFileSystem.setThreadPoolSize(cloudFileSystemProperties.getThreadPoolSize());
        callbackFileSystem.setProcessRestrictionsEnabled(cloudFileSystemProperties.isProcessRestrictionsEnabled());
        callbackFileSystem.createStorage();
        callbackFileSystem.disableMetaDataCache(cloudFileSystemProperties.isMetaDataCacheDisable());
        callbackFileSystem.addMountingPoint(volumeKey);
    }

tests 1:
        CbFSProperties cbFSProperties = createCloudFileSystemProperties();
        // create CloudFileSystemImpl context
        CloudFileSystemContext cloudFileSystemContext = new CloudFileSystemContext(cbFSProperties);


        // create volume
        CloudFileSystem cloudFileSystem = new CloudFileSystemImpl(cloudFileSystemContext);
//
        boolean isCreated = cloudFileSystem.createVirtualDisk("R:");

        // check if volume was created correctly
        CallbackFileSystem callbackFileSystem = new CallbackFileSystem();
        callbackFileSystem.setRegistrationKey(cbFSProperties.getLicenseKey());

        // check created or not
        Assert.assertEquals(true, isCreated);

        // the same assertion
        Assert.assertEquals("R", callbackFileSystem.getMountingPoint(0));

2:
CbFSProperties cbFSProperties = createCloudFileSystemProperties();
// create CloudFileSystemImpl context
CloudFileSystemContext cloudFileSystemContext = new CloudFileSystemContext(cbFSProperties);

// create volume
CloudFileSystem cloudFileSystem = new CloudFileSystemImpl(cloudFileSystemContext);

boolean isCreated = cloudFileSystem.createVirtualDisk("S:");

if (isCreated)
    createFileOnDisk("S:\\test.txt");
else
    Assert.assertTrue("The disk was not created.", false);
#19624
Posted: 03/29/2012 04:16:25
by  shevchenko
Hi,

1. The tests that you show us is incomplete so I can't configure its for runnable state.

2. So I'm just used VDisk sample to run it with two threads (each one in separate thread) all works smooth. Another internal test (with two threads/drives) also works good.

3. Did you try to use as an base example %programs%\EldoS\Callback File System\Samples\Java\VDisk\ ?

Best regards,
Taras.
#19664
Posted: 04/04/2012 07:05:12
by szagriichuk  (Basic support level)
Joined: 03/28/2012
Posts: 51

Quote
shevchenko wrote:
Hi,

1. The tests that you show us is incomplete so I can't configure its for runnable state. 2. So I'm just used VDisk sample to run it with two threads (each one in separate thread) all works smooth. Another internal test (with two threads/drives) also works good. 3. Did you try to use as an base example %programs%\EldoS\Callback File System\Samples\Java\VDisk\ ? Best regards,Taras.


Hi Taras, Thank you for answer, yep, I've checked VDisk example and all is ok, I've found problem in maven configuration of system properties, fixed it, all is working.
Thanks

Reply

Statistics

Topic viewed 997 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!