Skip to contentSkip to conversation

How to compile Java-Rados.

DISCUSSION ramu 3 participants 20 messages Jul 12, 2012 – Jul 20, 2012

lore
Share & tools
lore

ramu

author
#0 lore raw

Hi,

I want to compile java-rados against ceph-0.47.Please help me how to compile java-rados.

Thanks,
Ramu.

#1 lore raw

Hi Ramu,

I just pushed a patch that should fix your compile problems:

https://github.com/noahdesu/java-rados/commit/0a68aebe2360ca140d470f7dacfc555a618dd976

Note that you may need to change JAVA_HOME in src/native/Makefile.am for your distribution.

Hope things work for you. The bindings are old, but there isn't any reason they shouldn't still function correctly.

- Noah

Quoted 12 lines · ramu

Hi,

I want to compile java-rados against ceph-0.47.Please help me how to compile java-rados.

Thanks,
Ramu.

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

author
#2 lore raw

Hi Noah Watkins,

When I compiling Java-rados am getting following error,

compile-rados:
[javac] Compiling 8 source files to /home/vu/java-rados/build/java [javac] /home/vu/java-rados/src/java/net/newdream/ce
ph/rados/RadosObject.java:60: cannot find symbol
[javac] symbol : method writeFull(java.lang.String,byte[],long,long) [javac] location: class net.newdream.ceph.rados.IOContext
[javac] ioctx.writeFull(key, buf, len, off);
[javac] ^
[javac] 1 error

#3 lore raw

Ramu,

Eek, I guess I missed that one. I pushed this patch which should fix it for you. Please 'git pull' to update your tree.

Thanks,
- Noah

(quoted diff) +0 -0

b/src/java/net/newdream/ceph/rados/RadosObject.java index 851d2aa..6079f6c 100644

src/java/net/newdream/ceph/rados/RadosObject.java +0 -2
@@ -54,10 +54,9 @@ public class RadosObject {
      *
      * @param buf the data buffer
      * @param len the amount of data to write
-     * @param off the offset in the object at which to start writing
      */
-    public void writeFull(byte[] buf, long len, long off) throws

RadosException {
- ioctx.writeFull(key, buf, len, off);
+ public void writeFull(byte[] buf, long len) throws RadosException {

+        ioctx.writeFull(key, buf, len);
     }

     /**
Quoted 27 lines · ramu

Hi Noah Watkins,

When I compiling Java-rados am getting following error,

compile-rados:
[javac] Compiling 8 source files to /home/vu/java-rados/build/java [javac] /home/vu/java-rados/src/java/net/newdream/ce
ph/rados/RadosObject.java:60: cannot find symbol
[javac] symbol : method writeFull(java.lang.String,byte[],long,long) [javac] location: class net.newdream.ceph.rados.IOContext
[javac] ioctx.writeFull(key, buf, len, off);
[javac] ^
[javac] 1 error

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

author
#4 lore raw

Hi Noah,

When Iam running ant command Build successful,but in dist folder only librados.jar is came ,there is no libjavarados.a.

After i run the ant test ,it is showing error is,
makedir:

compile-rados:

compile-tests:

jar:

test:
[junit] Running ClusterStatsTest
[junit] Tests run: 1, Failures: 0, Errors: 2, Time elapsed: 0.026 sec

BUILD FAILED
/home/vu/java-rados/build.xml:134: Test ClusterStatsTest failed

Total time: 1 second

Thanks,
Ramu.

#5 lore raw

Hi Ramu,

The "libtool --mode=install" hack has apparently stopped working. You can get around this problem for the time being by copying the library files you want from src/native/.libs/ into the dist folder.

- Noah

Quoted 38 lines · ramu

Hi Noah,

When Iam running ant command Build successful,but in dist folder only librados.jar is came ,there is no libjavarados.a.

After i run the ant test ,it is showing error is,
makedir:

compile-rados:

compile-tests:

jar:

test:
[junit] Running ClusterStatsTest
[junit] Tests run: 1, Failures: 0, Errors: 2, Time elapsed: 0.026 sec

BUILD FAILED
/home/vu/java-rados/build.xml:134: Test ClusterStatsTest failed

Total time: 1 second

Thanks,
Ramu.

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

author
#6 lore raw

Hi Noah,

I copied all /src/native/.libs/ to dist folder and tried ant test iam getting this error,

Testsuite: ClusterStatsTest
Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0.04 sec

Testcase: test_ClusterStats took 0.022 sec
Caused an ERROR
conf_read_file: ret=-22 net.newdream.ceph.rados.RadosException: conf_read_file: ret=-22 at net.newdream.ceph.rados.Cluster.native_conf_read_file(Native Method) at net.newdream.ceph.rados.Cluster.readConfigFile(Unknown Source) at ClusterStatsTest.setup(Unknown Source)

Thanks,
Ramu.

#7 lore raw

Ramu,

Well, it looks like copying the library files worked. Did you

export CEPH_CONF_FILE=/path/to/ceph.conf

before running 'ant test' ?

- Noah

Quoted 23 lines · ramu

Hi Noah,

I copied all /src/native/.libs/ to dist folder and tried ant test iam getting this error,

Testsuite: ClusterStatsTest
Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0.04 sec

Testcase: test_ClusterStats took 0.022 sec
Caused an ERROR
conf_read_file: ret=-22 net.newdream.ceph.rados.RadosException: conf_read_file: ret=-22 at net.newdream.ceph.rados.Cluster.native_conf_read_file(Native Method) at net.newdream.ceph.rados.Cluster.readConfigFile(Unknown Source) at ClusterStatsTest.setup(Unknown Source)

Thanks,
Ramu.

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

author
#8 lore raw

Hi Noah,

I tried but am getting following error in terminal ,

Buildfile: /home/vu/java-rados/build.xml

makedir:

compile-rados:

compile-tests:

jar:

test:
[junit] Running ClusterStatsTest
[junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0.04 sec

BUILD FAILED
/home/vu/java-rados/build.xml:134: Test ClusterStatsTest failed

Total time: 1 second

and one more error file
is /home/vu/java-rados/TEST-ClusterStatsTest.txt in that file the text is like this,

Testsuite: ClusterStatsTest
Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0.04 sec

Testcase: test_ClusterStats took 0.022 sec
Caused an ERROR
conf_read_file: ret=-22
net.newdream.ceph.rados.RadosException: conf_read_file: ret=-22
at net.newdream.ceph.rados.Cluster.native_conf_read_file(Native Method) at net.newdream.ceph.rados.Cluster.readConfigFile(Unknown Source) at ClusterStatsTest.setup(Unknown Source)

Thanks,
Ramu.

#9 lore raw

Ramu,

I receive the same error code in my installation when the CEPH_CONF_FILE environment variable contains an invalid path. Could you please verify that the path you are using points to a valid Ceph configuration?

Thanks,
- Noah

Quoted 48 lines · ramu

Hi Noah,

I tried but am getting following error in terminal ,

Buildfile: /home/vu/java-rados/build.xml

makedir:

compile-rados:

compile-tests:

jar:

test:
[junit] Running ClusterStatsTest
[junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0.04 sec

BUILD FAILED
/home/vu/java-rados/build.xml:134: Test ClusterStatsTest failed

Total time: 1 second

and one more error file
is /home/vu/java-rados/TEST-ClusterStatsTest.txt in that file the text is like this,

Testsuite: ClusterStatsTest
Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0.04 sec

Testcase: test_ClusterStats took 0.022 sec
Caused an ERROR
conf_read_file: ret=-22
net.newdream.ceph.rados.RadosException: conf_read_file: ret=-22
at net.newdream.ceph.rados.Cluster.native_conf_read_file(Native Method) at net.newdream.ceph.rados.Cluster.readConfigFile(Unknown Source) at ClusterStatsTest.setup(Unknown Source)

Thanks,
Ramu.

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

author
#10 lore raw

Hi Noah,

I printed the CONF_FILE and file and states,the printed as following,these are in ClusterStatsTest.java.

test:

    [junit] Running ClusterStatsTest
    [junit] conffile--->/etc/ceph/ceph.conf
    [junit] state-->CONFIGURING
    [junit] file--->/etc/ceph/ceph.conf
    [junit] state-->CONFIGURING
    [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0.123 sec

BUILD FAILED
/home/ramu/java-rados/build.xml:134: Test ClusterStatsTest failed

#11 lore raw

Disregard that last message. Ok, I'm not sure where else EINVAL gets returned in the configuration path, but I can look into it this evening. I tested the wrappers on a clean install last night and they seem to be working for me. Can you turn on debug logging with CEPH_ARGS (as per Sage's last email)?

Quoted 23 lines · ramu

Hi Noah,

I printed the CONF_FILE and file and states,the printed as following,these are in ClusterStatsTest.java.

test:

    [junit] Running ClusterStatsTest
    [junit] conffile--->/etc/ceph/ceph.conf
    [junit] state-->CONFIGURING
    [junit] file--->/etc/ceph/ceph.conf
    [junit] state-->CONFIGURING
    [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0.123 sec

BUILD FAILED
/home/ramu/java-rados/build.xml:134: Test ClusterStatsTest failed

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#12 lore raw
In reply to Noah Watkins
Quoted 6 lines · Noah Watkins

Ramu,

I receive the same error code in my installation when the CEPH_CONF_FILE environment variable contains an invalid path. Could you please verify that the path you are using points to a valid Ceph configuration?

BTW it's CEPH_CONF for the config file (not CEPH_CONFG_FILE).

Alternatively, you can stick config options in the same format as the command line arguments in CEPH_ARGS. E.g.,

	CEPH_ARGS="--debug-ms 1 --log-file foo" some_command ...

sage

Quoted 59 lines

Thanks,
- Noah

Quoted 44 lines · ramu

Hi Noah,

I tried but am getting following error in terminal ,

Buildfile: /home/vu/java-rados/build.xml

makedir:

compile-rados:

compile-tests:

jar:

test:
[junit] Running ClusterStatsTest
[junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0.04 sec

BUILD FAILED
/home/vu/java-rados/build.xml:134: Test ClusterStatsTest failed

Total time: 1 second

and one more error file
is /home/vu/java-rados/TEST-ClusterStatsTest.txt in that file the text is like this,

Testsuite: ClusterStatsTest
Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0.04 sec

Testcase: test_ClusterStats took 0.022 sec
Caused an ERROR
conf_read_file: ret=-22
net.newdream.ceph.rados.RadosException: conf_read_file: ret=-22
at net.newdream.ceph.rados.Cluster.native_conf_read_file(Native Method) at net.newdream.ceph.rados.Cluster.readConfigFile(Unknown Source) at ClusterStatsTest.setup(Unknown Source)

Thanks,
Ramu.

Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#13 lore raw
Quoted 9 lines · Sage Weil
Quoted 6 lines · Noah Watkins

Ramu,

I receive the same error code in my installation when the CEPH_CONF_FILE environment variable contains an invalid path. Could you please verify that the path you are using points to a valid Ceph configuration?

BTW it's CEPH_CONF for the config file (not CEPH_CONFG_FILE).

It turns out to be quite awkward to tell the unit tests about the configuration location, and using an environment variable is convenient. However, I wasn't aware of CEPH_CONF, and in fact the unit test framework looks for CEPH_CONFIG_FILE. The later should definitely be removed (ramu, can you try CEPH_CONF?), and this isn't an issue in libcephfs wrappers -- the rados wrappers are incredibly old.

Thanks, Noah

Quoted 68 lines

Alternatively, you can stick config options in the same format as the command line arguments in CEPH_ARGS. E.g.,

        CEPH_ARGS="--debug-ms 1 --log-file foo" some_command ...

sage

Quoted 59 lines

Thanks,
- Noah

Quoted 44 lines · ramu

Hi Noah,

I tried but am getting following error in terminal ,

Buildfile: /home/vu/java-rados/build.xml

makedir:

compile-rados:

compile-tests:

jar:

test:
[junit] Running ClusterStatsTest
[junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0.04 sec

BUILD FAILED
/home/vu/java-rados/build.xml:134: Test ClusterStatsTest failed

Total time: 1 second

and one more error file
is /home/vu/java-rados/TEST-ClusterStatsTest.txt in that file the text is like this,

Testsuite: ClusterStatsTest
Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0.04 sec

Testcase: test_ClusterStats took 0.022 sec
Caused an ERROR
conf_read_file: ret=-22
net.newdream.ceph.rados.RadosException: conf_read_file: ret=-22
at net.newdream.ceph.rados.Cluster.native_conf_read_file(Native Method) at net.newdream.ceph.rados.Cluster.readConfigFile(Unknown Source) at ClusterStatsTest.setup(Unknown Source)

Thanks,
Ramu.

Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

author
#14 lore raw

Hi Noah,

I hardcoded CONF_FIL="/etc/ceph/ceph.conf"; and commented //System.getProperty("CEPH_CONF_FILE"); in RadosTestUtils.java. And run the ant and after run ant test,but iam getting same error.

Buildfile: /home/vu/java-rados/build.xml

makedir:

compile-rados:

compile-tests:
[javac] Compiling 1 source file to /home/vu/java-rados/build/test

jar:

test:
[junit] Running ClusterStatsTest
[junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0.068 sec

BUILD FAILED
/home/vu/java-rados/build.xml:134: Test ClusterStatsTest failed

Total time: 2 seconds
and in TEST-ClusterStatsTest.txt file also getting same errors,

Testsuite: ClusterStatsTest
Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0.068 sec

Testcase: test_ClusterStats took 0.036 sec
Caused an ERROR
rados_connect: ret=-1 net.newdream.ceph.rados.RadosException: rados_connect: ret=-1
at net.newdream.ceph.rados.Cluster.native_connect(Native Method) at net.newdream.ceph.rados.Cluster.connect(Unknown Source) at ClusterStatsTest.setup(Unknown Source)
-->How to give CEPH_ARGS.

Thanks,
Ramu.

#15 lore raw
Quoted 8 lines · ramu

Hi Noah,

Testcase: test_ClusterStats took 0.036 sec
Caused an ERROR
rados_connect: ret=-1 net.newdream.ceph.rados.RadosException: rados_connect: ret=-1
at net.newdream.ceph.rados.Cluster.native_connect(Native Method) at net.newdream.ceph.rados.Cluster.connect(Unknown Source)

That return code, -1, should correspond to -EPERM. I don't see this error code in the rados client code. Are you able to use the same ceph.conf file to connect and interact with RADOS using a interface other than the Java wrappers?

Checking the OSD logs might reveal the problem... do you have these available?

author
#16 lore raw

Hi Noah,

After reinstalled java-rados,when I run ant test now am getting follwing error in terminal,
Buildfile: /home/vutp/java-rados/build.xml

makedir:

compile-rados:

compile-tests:
[javac] Compiling 1 source file to /home/vutp/java-rados/build/test

jar:

test:
[junit] Running ClusterStatsTest
[junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 0.044 sec [junit] Running ClusterTest
[junit] Tests run: 7, Failures: 1, Errors: 0, Time elapsed: 6.569 sec

BUILD FAILED
/home/vutp/java-rados/build.xml:134: Test ClusterTest failed

Total time: 10 seconds

-->And also two txt files generated in Java-Rados directory one is TEST- ClusterStatsTest.txt in this file the text is ,
Testsuite: ClusterStatsTest
Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 0.044 sec
Testcase: test_ClusterStats took 0.027 sec

-->and one more txt file is TEST-ClusterTest.txt in this file the text is ,

Testsuite: ClusterTest
Tests run: 7, Failures: 1, Errors: 0, Time elapsed: 6.569 sec

Testcase: test_ConfigOption took 0.026 sec
FAILED

junit.framework.AssertionFailedError:
at ClusterTest.test_ConfigOption(Unknown Source)

Testcase: test_getClusterStats took 0.005 sec
Testcase: test_getInstancePointer took 0.004 sec
Testcase: test_getVersion took 0.005 sec
Testcase: test_PoolOperations took 1.821 sec
Testcase: test_openIOContext took 2.134 sec
Testcase: test_PoolList took 2.543 sec

Thanks,
Ramu.

#17 lore raw

Please 'git pull' to grab the following change which solved the same problem in my location tree:

src/test/ClusterTest.java +2 -2
index 9b6bcb6..8b83bdd 100644
@@ -25,13 +25,13 @@ public class ClusterTest {
         String val1, val2;
 
         /* set option to 2 and check that it set */
-        val1 = "2";
+        val1 = "true";
         cluster.setConfigOption(opt, val1);
         val2 = cluster.getConfigOption(opt);
         assertTrue(val1.compareTo(val2) == 0);
 
         /* make sure the option wasn't already 2 */
-        val1 = "1";
+        val1 = "false";
         cluster.setConfigOption(opt, val1);
         val2 = cluster.getConfigOption(opt);
         assertTrue(val1.compareTo(val2) == 0);
Quoted 4 lines · ramu

[junit] Running ClusterStatsTest
[junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 0.044 sec [junit] Running ClusterTest
[junit] Tests run: 7, Failures: 1, Errors: 0, Time elapsed: 6.569 sec

good, no errors.

Quoted 10 lines

BUILD FAILED
/home/vutp/java-rados/build.xml:134: Test ClusterTest failed

Total time: 10 seconds

-->And also two txt files generated in Java-Rados directory one is TEST- ClusterStatsTest.txt in this file the text is ,
Testsuite: ClusterStatsTest
Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 0.044 sec

no errors here either.

Quoted 4 lines

Testcase: test_ClusterStats took 0.027 sec

-->and one more txt file is TEST-ClusterTest.txt in this file the text is ,

Quoted 8 lines

Testsuite: ClusterTest
Tests run: 7, Failures: 1, Errors: 0, Time elapsed: 6.569 sec

Testcase: test_ConfigOption took 0.026 sec
FAILED

junit.framework.AssertionFailedError:
at ClusterTest.test_ConfigOption(Unknown Source)

So, it looks like we are down to one error?

Quoted 19 lines

Testcase: test_getClusterStats took 0.005 sec
Testcase: test_getInstancePointer took 0.004 sec
Testcase: test_getVersion took 0.005 sec
Testcase: test_PoolOperations took 1.821 sec
Testcase: test_openIOContext took 2.134 sec
Testcase: test_PoolList took 2.543 sec

Thanks,
Ramu.

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

author
#18 lore raw

Hi Noah,

Thank u for your reply,it is working fine but Iam getting one more error in terminal is,BUILD FAILED /home/vu/java-rados/build.xml:134: Test IOContextTest failed

Total time: 43 seconds

and in TEST-IOContextTest.txt file the error is,

Testsuite: IOContextTest
Tests run: 11, Failures: 1, Errors: 0, Time elapsed: 32.302 sec

Testcase: test_toString took 1.791 sec
Testcase: test_getCluster took 2.116 sec
Testcase: test_getPoolStats took 2.364 sec
Testcase: test_setLocatorKey took 2.046 sec
Testcase: test_write took 3.109 sec
Testcase: test_writeFull took 3.188 sec
Testcase: test_getLastVersion took 2.46 sec
Testcase: test_append took 3.505 sec
Testcase: test_truncate took 3.423 sec
Testcase: test_getsetAttribute took 3.161 sec
Testcase: test_getObjects took 5.101 sec
FAILED

junit.framework.AssertionFailedError:
at IOContextTest.test_getObjects(Unknown Source)

Thanks,
Ramu.

author
#19 lore raw

Hi Noah,

Thank you for fixes and suggestions of compilation of java-rados , It's working fine now.

Thanks,
Ramu.