Hi all,
This is my first post to this forum. So kind of expecting help. Its urgently needed.
I am using ImageMagick 6.4.4 and JMagick 6.4.0 in my web application. I have these libraries present in my tomcat lib folder.
ImageMagick-ld-library-path
JMagick-ld-library-path
libJMagick-6.4.0.so
libMagickCore.la
libMagickCore.so.1
libMagick++.la
libMagick++.so.1
libMagickWand.la
libMagickWand.so.1
libJMagick.so
libMagickCore.so
libMagickCore.so.1.0.0
libMagick++.so
libMagick++.so.1.0.0
libMagickWand.so
libMagickWand.so.1.0.0
jmagick-6.4.0.jar
ImageMagick-6.4.4:
config modules-Q16
But When I try to use any class of JMagick, It gives following error.
.../jdk/jre/bin/java: symbol lookup error: .../Linux-2.6c2.5-i686/JMagick/JMagick-5.0-0/lib/libJMagick.so: undefined symbol: MagickCoreGenesis
Could anybody please help me here. I am stuck here for past 3 days.
Thanks in advance
Jitendra
Undefined symbol : MagickCoreGenesis
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Undefined symbol : MagickCoreGenesis
Knowning a little development history of IM it seems obvious to me that your JMagick Module does not match your ImageMagick Library. They were built with different versions of IM.
The latest release of IM is libMagickCore.so.4.0.1 ditto for MagickWand
Actually I doubt the version listed library is from IM v6.4.4! Are you sure you don't have a IM installed in some other place?
Perhaps JMagick installed its own library, and the LD_LIBRARY_PATH does not find that library before the system version.
if your system is Linux, try typing: locate libMagickCore
and see what versions are installed.
The latest release of IM is libMagickCore.so.4.0.1 ditto for MagickWand
Actually I doubt the version listed library is from IM v6.4.4! Are you sure you don't have a IM installed in some other place?
Perhaps JMagick installed its own library, and the LD_LIBRARY_PATH does not find that library before the system version.
if your system is Linux, try typing: locate libMagickCore
and see what versions are installed.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: Undefined symbol : MagickCoreGenesis
Hi Anthony,
Thanks for reply and sorry for my late follow up.
To simplify testing, I have written a very simple program that is working on my alpha box but fails on all other boxes. My program is like this.
I have a directory /tmp/imagemagick where all lib files of Imagemagick and JMagick which I posted in my question are present.
On My Alpha box, I run this program as follows.
$javac -cp jmagick-6.4.0.jar:. JMagickTest.java
$java -cp jmagick-6.4.0.jar:. -Djava.library.path=/tmp/imagemagick JMagickTest
/tmp/imagemagick
Success.
On my beta box when I copied directory /tmp/imagemagick to same location as in alpha and ran same program but It fails.
$javac -cp jmagick-6.4.0.jar:. JMagickTest.java
$java -cp jmagick-6.4.0.jar:. -Djava.library.path=/tmp/imagemagick JMagickTest
/tmp/imagemagick
java: symbol lookup error: /tmp/imagemagick/libJMagick.so: undefined symbol: MagickCoreGenesis
I am explicitly setting java.library.path to my directory. Is it possible that other locations are being referred on my alpha box for linking. Also can I somehow find, in which file MagickCoreGenesis is defined?
Also locate command doesn't seem to work on my both boxes.
Thanks for your patience.
Jitendra
Thanks for reply and sorry for my late follow up.
To simplify testing, I have written a very simple program that is working on my alpha box but fails on all other boxes. My program is like this.
Code: Select all
import magick.MagickImage;
public class JMagickTest {
public static void main(String[] args){
System.setProperty("jmagick.systemclassloader","false");
System.out.println(System.getProperty("java.library.path"));
MagickImage image = new MagickImage();
System.out.println("Success");
}
}
On My Alpha box, I run this program as follows.
$javac -cp jmagick-6.4.0.jar:. JMagickTest.java
$java -cp jmagick-6.4.0.jar:. -Djava.library.path=/tmp/imagemagick JMagickTest
/tmp/imagemagick
Success.
On my beta box when I copied directory /tmp/imagemagick to same location as in alpha and ran same program but It fails.
$javac -cp jmagick-6.4.0.jar:. JMagickTest.java
$java -cp jmagick-6.4.0.jar:. -Djava.library.path=/tmp/imagemagick JMagickTest
/tmp/imagemagick
java: symbol lookup error: /tmp/imagemagick/libJMagick.so: undefined symbol: MagickCoreGenesis
I am explicitly setting java.library.path to my directory. Is it possible that other locations are being referred on my alpha box for linking. Also can I somehow find, in which file MagickCoreGenesis is defined?
Also locate command doesn't seem to work on my both boxes.
Thanks for your patience.
Jitendra
Re: Undefined symbol : MagickCoreGenesis
Hi anthony n all,
I cleaned my previous installation of imagemagick and jmagick by 'sudo make uninstall' from source directory and installed freshly. I used default installation directory for both. I can see shared files in /usr/local/lib/ directory.
ImageMagick 6.4.0 and JMagick 6.4.0.
Now when I run my program, I get following error
/usr/local/lib
magick.MagickException: Unable to retrieve handle
at magick.MagickImage.getBackgroundColor(Native Method)
at JMagickTest.main(JMagickTest.java:19)
Could anyone help me with this error. Is it due to multiple instances of ImageMagick installation. If yes, Could anyone suggest a way to remove all installations of ImageMagick, So that I can install fresh.
Thanks in advance
Jitendra
I cleaned my previous installation of imagemagick and jmagick by 'sudo make uninstall' from source directory and installed freshly. I used default installation directory for both. I can see shared files in /usr/local/lib/ directory.
ImageMagick 6.4.0 and JMagick 6.4.0.
Now when I run my program, I get following error
Code: Select all
public static void main(String[] args) {
try {
System.setProperty("jmagick.systemclassloader", "false");
System.out.println(System.getProperty("java.library.path"));
ImageInfo info = new ImageInfo("/home/jrajput/blue_bg.jpg");
MagickImage image = new MagickImage(info);
System.out.println(image.getBackgroundColor());
} catch (Exception e) {
e.printStackTrace();
}
}
magick.MagickException: Unable to retrieve handle
at magick.MagickImage.getBackgroundColor(Native Method)
at JMagickTest.main(JMagickTest.java:19)
Could anyone help me with this error. Is it due to multiple instances of ImageMagick installation. If yes, Could anyone suggest a way to remove all installations of ImageMagick, So that I can install fresh.
Thanks in advance
Jitendra
Re: Undefined symbol : MagickCoreGenesis
Hi,
I just noticed something unusual. When I try to configure imagemagick on my alpha box..it prints something like this.
./configure
configuring ImageMagick 6.4.0
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu....
..
..
-------------------------------------------------------------
checking for JPEG...
checking jconfig.h usability... yes
..
checking if JPEG package is complete... yes
...
-------------------------------------------------------------
Delegate Configuration:
..
JPEG v1 --with-jpeg=yes yes
..
while when I try to configure on beta box, It says..
..
..
checking for JPEG...
..
checking if JPEG package is complete... no
Delegate Configuration:
JPEG v1 --with-jpeg=yes no..
Why is it happening? May be this is cause of "Unable to retrieve handler" error. I am using same package on both machines.
Complete configure output is here:
Beta machine : http://pastebin.com/ZG1XJWNJ
Alpha Machine: http://pastebin.com/yptLuChL
Sorry for so many posts. Its just that, I am not able to find solution.
Thanks
Jitendra
I just noticed something unusual. When I try to configure imagemagick on my alpha box..it prints something like this.
./configure
configuring ImageMagick 6.4.0
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu....
..
..
-------------------------------------------------------------
checking for JPEG...
checking jconfig.h usability... yes
..
checking if JPEG package is complete... yes
...
-------------------------------------------------------------
Delegate Configuration:
..
JPEG v1 --with-jpeg=yes yes
..
while when I try to configure on beta box, It says..
..
..
checking for JPEG...
..
checking if JPEG package is complete... no
Delegate Configuration:
JPEG v1 --with-jpeg=yes no..
Why is it happening? May be this is cause of "Unable to retrieve handler" error. I am using same package on both machines.
Complete configure output is here:
Beta machine : http://pastebin.com/ZG1XJWNJ
Alpha Machine: http://pastebin.com/yptLuChL
Sorry for so many posts. Its just that, I am not able to find solution.
Thanks
Jitendra
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Undefined symbol : MagickCoreGenesis
That typically means that it was not able to find all the libraries (runtime) and includes (development) IM needs to build the JPEG coder. Make sure you have the development JPEG package installed.jrajput wrote:Why is it happening?Code: Select all
checking for JPEG... .. checking if JPEG package is complete... no Delegate Configuration: JPEG v1 --with-jpeg=yes no..
NOTE: am not java programmer.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/