开发者

CCNx Java Code Help (ProcessBuilder)

Has anyone played around with the CCNx code over from http://www.ccnx.org/.

I unzip the project and loading the .project file in the javasrc directory into Eclipse. The project builds with no errors.

I'm guess I need to start the CCNDaemon (org.ccnx.ccn.impl.support.CCNDaemon) but I get an error at:

java.io.IOException: Cannot run progr开发者_Python百科am "../ccnd/agent/ccnd": error=2, No such file or directory
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:460)
    at org.ccnx.ccn.impl.support.CCNDaemon$CCNDWorkerThread.initialize(CCNDaemon.java:93)
    at org.ccnx.ccn.impl.support.Daemon$WorkerThread.run(Daemon.java:125)

It looks like its trying to build a new process with

private static final String DEFAULT_CCND_COMMAND_STRING = "../ccnd/agent/ccnd";
protected String _command = DEFAULT_CCND_COMMAND_STRING;
...
ProcessBuilder pb = new ProcessBuilder(_command);

I don't have the ccnd operating system process. Do I need to build the C++ code? Or is there some way to run this with pure java? Thanks for the help!


Based on my findings, it turns out that all CCN applications require a CCNx Daemon. This is only based in C right now. So you have to build the C code with all the dependencies. The Java code actually calls the ccnd (CCN Daemon) to run with the ProcessBuilder.

I wrote up a blog post about how I got it to work for Ubuntu... but its basically.

C Source Dependencies:
sudo apt-get install git-core python-dev libssl-dev libpcap-dev libexpat1-dev athena-jot

Run:
./configure

Build CCN with:
make

Test with:
make test

Start the ccnd:
ccndstart

The blog post has more details.


If you add -start in the arguments block in the "Run configuration" dialog in Eclipse before you run the CCNDaemon, there should be no errors.

————————————————————————————————————————————
2011-10-5 19:49:39 org.ccnx.ccn.impl.support.Daemon startDaemon

信息: Starting daemon with command line: java -Djava.library.path=.:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java -cp /Users/thomas/Downloads/ccnx-0.4.1/javasrc /bin:/Applications/eclipse/plugins/org.junit_4.8.2.v4_8_2_v20110321-1705/junit.jar:/Applications/eclipse/plugins/org.hamcrest.core_1.1.0.v20090501071000.jar:/Users/thomas/Downloads/ccnx-0.4.1/javasrc/lib/bcprov-jdk16-143.jar:/Users/thomas/Downloads/ccnx-0.4.1/javasrc/lib/junit-4.3.1.jar:/Users/thomas/Downloads/ccnx-0.4.1/javasrc/lib/kxml2-2.3.0.jar org.ccnx.ccn.impl.support.CCNDaemon -daemon

Started daemon ccnd. PID 3127

2011-10-5 19:49:40 org.ccnx.ccn.impl.support.Daemon startDaemon

信息: Started daemon ccnd. PID 3127 ——————————————————————————————————————————————————————————————————————————

(blank lines introduced for clarity)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜