The function conf_read_file() throws an FileNotFoundException (see source ceph/src/java/com/ceph/fs/CephMount.java) This exception must be caught or the function calling it has to also throw the same exception.

Here's a slightly different version of you code that compiles in my sandbox:

package com.ceph.fs;
import java.io.FileNotFoundException;

public class Test{
  public static void main(String[] args) {
    CephMount mount;
    try{
      mount = new CephMount();
      mount.conf_read_file("/etc/ceph/ceph.conf");
      mount.mount("/");
    } catch( Exception e ) {
      System.out.println("Caught exception " + e.toString());
    }
  }
}



On 10/15/2013 02:13 AM, ? wrote:
 Hi all;
I want to test java Interface, and I make the ceph by ./configure --enadble-cephfs-java make make install. the resurt is libcephfs.jar lie in /ceph/src/java and libcephfs_jin.so lie in /usr/local/lib.
        so, I cord the java file vim Test.java
/package com.ceph.fs;
     &nbs p;  import com.ceph.crush.Bucket;
public class Test {
public static void main (String [] args){
                CephMount mount = new Ceph CephMount();
mount.conf_read_file("/etc/ceph/ceph.conf");
           }
}/


     and when I build it !

/   #  javac -classpath ../libcephfs.jar com/ceph/fs/Test.java
com/ceph/fs/Test:9:unreported exception java.io.FileNotFoundException;
  must be caught or declared to be throw
mount.conf_read_file("/ect/ceph/ceph.conf");
^
  error 1./

  Thanks vary much!
  pengft



















_______________________________________________
ceph-users mailing list
ceph-users@lists.ceph.com
http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com

_______________________________________________
ceph-users mailing list
ceph-users@lists.ceph.com
http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com

Reply via email to