[Zoo-discuss] Building kernel with Java support

rakesh prithiviraj rakeshuk at outlook.com
Wed Apr 27 10:54:51 PDT 2016


You are right. JVM initialization error. The error message was clear when running from command line. I appreciate your help.
I updated the main.cfg with [javax] ss=2m.
Now the Java service at least starts.  But how to define the java classpath for the service? I have ZOO.class under /usr/lib/cgi-bin but still when the service it complains "no ZOO in java classpath". I defined CLASSPATH path variable and restarted the terminal. But still the service cannot find ZOO.class
 <ows:ExceptionText>Unable to run your java process properly: Exception in thread "main" java.lang.UnsatisfiedLinkError: no ZOO in java.library.path        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1889)        at java.lang.Runtime.loadLibrary0(Runtime.java:849)        at java.lang.System.loadLibrary(System.java:1088)        at ZOO.<clinit>(ZOO.java:5)        at HelloJava.HelloWorldJava(HelloJava.java:33)</ows:ExceptionText>
regards

> Subject: Re: [Zoo-discuss] Building kernel with Java support
> From: gerald.fenoy at geolabs.fr
> Date: Wed, 27 Apr 2016 19:08:52 +0200
> CC: zoo-discuss at lists.osgeo.org
> To: rakeshuk at outlook.com
> 
> Races,
> thanks for the feedback.
> 
> It does not seem there is any issue with loading the library anymore. Note looks like an issue when initializing the JVM.
> 
> May I ask you to try running the same request from the command line please ? It should help to figure out what is the message about error occurred during initialization
> 
> Best regards,
> 
> 
> > Le 27 avr. 2016 à 17:33, rakesh prithiviraj <rakeshuk at outlook.com> a écrit :
> > 
> > Thanks for the support. It did solve the problem of missing libjvm but still I couldn't run a Java service. Execution of python service works fine.
> > 
> > In the apache logs, i am seeing a different error now which is "malformed header". Also looks like the error message is incomplete as it ends in "initiali".
> > 
> > [Wed Apr 27 16:28:59.579355 2016] [cgi:error] [pid 23178:tid 140126009673472] [client 193.128.33.248:63251] malformed header from script 'zoo_loader.cgi': Bad header: Error occurred during initiali
> > 
> > I rebuilt the kernel, Java zoo-api and Java helloworld service and restarted Apache. But it did not help.
> > 
> > regards
> > Rakesh
> > 
> > 
> > > Subject: Re: [Zoo-discuss] Building kernel with Java support
> > > From: gerald.fenoy at geolabs.fr
> > > Date: Wed, 27 Apr 2016 16:36:36 +0200
> > > CC: zoo-discuss at lists.osgeo.org
> > > To: rakeshuk at outlook.com
> > > 
> > > Hi,
> > > thanks for such a complete feedback.
> > > 
> > > There is one thing to modify on your local setup. You should add the path where the libjvm.so file is located to the path where ld is searching into. To achieve that, you can add a zoo-project.conf file in the following directory: /etc/ld.so.conf.d/ . Then run ldconfig and ldd again on your zoo_loader.cgi file and it should return the proper location.
> > > 
> > > I hope this helps you to solve the issue.
> > > 
> > > Best regards, 
> > > 
> > > > Le 27 avr. 2016 à 16:01, rakesh prithiviraj <rakeshuk at outlook.com> a écrit :
> > > > 
> > > > Hi,
> > > > 
> > > > I am trying to build zoo-kernel with Java support on 64 bit Ubuntu machine.
> > > > 
> > > > /configure --with-js --with-python --with-java=/usr/lib/jvm/java-7-openjdk-amd64/
> > > > 
> > > > "http://www.zoo-project.org/docs/install/installation.html#java-support-optional" assumes that the include/linux and jre/lib/i386/client/ subdirectories exist in /usr/lib/jvm/java-7-openjdk-amd64/, and that the include/linux directory contains the jni.h headers file and that the jre/lib/i386/client/ directory contains the libjvm.so file. 
> > > > 
> > > > As I am using OpenJDK (and not Oracle Java), 
> > > > 1. "include/linux" has 2 files (jawt_md.h, jni_md.h) and not jni.h asabove assumption
> > > > 2. libjvm.so is located under /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/ (it is not under jre/lib/i386/client/ as assumed by configure option).
> > > > 
> > > > The configure command did not throw any errors. Last few lines from console output are given below
> > > > 
> > > > checking jni.h usability... yes
> > > > checking jni.h presence... yes
> > > > checking for jni.h... yes
> > > > checking for JNI_CreateJavaVM in -ljvm... yes
> > > > configure: creating ./config.status
> > > > config.status: creating Makefile
> > > > config.status: creating ZOOMakefile.opts
> > > > 
> > > > Trying to access the Kernel CGI via Apache2 server did not work and apache logs shows the following error.
> > > > 
> > > > [Wed Apr 27 14:16:27.015884 2016] [cgi:error] [pid 16337:tid 140125807777536] [client 193.128.33.248:12614] AH01215: /usr/lib/cgi-bin/zoo_loader.cgi: error while loading shared libraries: libjvm.so: cannot open shared object file: No such file or directory
> > > > [Wed Apr 27 14:16:27.015950 2016] [cgi:error] [pid 16337:tid 140125807777536] [client 193.128.33.248:12614] End of script output before headers: zoo_loader.cgi
> > > > 
> > > > Also shared library dependencies command confirmed that 
> > > > ldd zoo_loader.cgi | grep jvm
> > > > libjvm.so => not found
> > > > 
> > > > Java is in the PATH as seen below.
> > > > 
> > > > $locate libjvm.so
> > > > /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so
> > > > $echo $JAVA_HOME
> > > > /usr/lib/jvm/java-7-openjdk-amd64/bin
> > > > $echo $JDK_HOME
> > > > /usr/lib/jvm/java-7-openjdk-amd64/
> > > >  
> > > > Please let me know if there a way to tell .configure command the path to libjvm.
> > > > 
> > > > regards
> > > > Rakesh
> > > > 
> > > > _______________________________________________
> > > > Zoo-discuss mailing list
> > > > Zoo-discuss at lists.osgeo.org
> > > > http://lists.osgeo.org/mailman/listinfo/zoo-discuss
> > > 
> > > 
> > > 
> > > Gérald Fenoy
> > > http://wiki.osgeo.org/wiki/User:Djay
> > > 
> > _______________________________________________
> > Zoo-discuss mailing list
> > Zoo-discuss at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/zoo-discuss
> 
> 
> 
> Gérald Fenoy
> http://wiki.osgeo.org/wiki/User:Djay
> 
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/zoo-discuss/attachments/20160427/75744946/attachment.html>


More information about the Zoo-discuss mailing list