[Zoo-discuss] Zoo Java Service example / docs

Alexander Kmoch alexander.kmoch at aut.ac.nz
Thu Mar 12 16:37:34 PDT 2015


Hi,

I am elaborating through the ZOO Java Services example. There are some 
confusing hints in the docs [1]:

The Java code shows:

 > public class HelloJava

but speaks of a HelloWorld.class :-) That doesn't match. So I renamed 
the the class to

 > public class HelloWorld

And also it is a bit complicated to figure the right HelloWorld.zcfg -> 
In fact I realised the ZCFG file should be calles HelloWorldJava.zcfg 
because it's the method within the HelloWorld.class that get's called by 
ZOO if I understoo it correctly

###snippet start###

[HelloWorldJava]
Title = Java Demo Hello World
...
serviceType = Java
serviceProvider = HelloWorld

<MetaData>
   title = Metadata title of your service
</MetaData>
<DataInputs>
...
</DataInputs>
<DataOutputs>
...
</DataOutputs>
###snippet end###

I finally have to resolve a java.lang.UnsatisfiedLinkError: no ZOO in 
java.library.path

This is the JAVA classpath thing I reckon, so I added some Env config to 
the Apache2 for the CGI:

###snippet start###
SetEnv JAVA_HOME /usr/lib/jvm/java-7-openjdk-amd64
         SetEnv JAVA_OPTS "-Xmx512m 
-Djava.library.path=/vol1/www/smart/includes/zoo-cgi-bin"

SetEnv CLASSPATH /vol1/www/smart/includes/zoo-cgi-bin

SetEnv LD_LIBRARY_PATH 
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server:/vol1/www/smart/includes/zoo-cgi-bin
###snippet end###

And it runs now.

Cheers,
Alex


[1] http://zoo-project.org/docs/services/howtos.html#java


More information about the Zoo-discuss mailing list