• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

JMagick 6.4.0 + IBM Websphere v6.1 + Ubuntu 10.10  RSS feed

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

First of all, I'm sorry if my english is not so good.

I'm trying to use JMagick in a J2EE web application. My servlet container is IBM Websphere v6.1 and OS is Ubuntu 10.10.

In installed ImageMagick and JMagick from Ubuntu repository: imagemagick version 7:6.6.2.6-1ubuntu1.1, libjmagick6-java version 6.2.6-0-6build1 and libjmagick6-jni version 6.2.6-0-6build1.

Can anyone tell me how to link jmagick jar and the native library (.so) to my web application or to servlet container?

For Websphere 6.1 running on Windows 7, I found this topic and it worked:

<<As the System Class Loader will delegate to the Extension Class Loader,
a simple alternative to the above is to drop the jmagick.jar file into
the directory [java]/jdk/jre/lib/ext

This should work without the need for any code modifications.

The jmagick.dll has to be in a directory that's in your PATH environment
variable. As the imagemagick directory (for example, C:\Program
Files\ImageMagick-6.2.4-Q16) is added to your PATH when you install
image magick, you can just drop the jmagick.dll into this directory.>>

Thanks
 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried putting the JAR and the .SO in the same directory where all other JARs are?

Rudy
 
Fabio Contigiani
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes.

Now I know (from JMagick sources) that thare are two ways to use jmagick:

1) loading it with system ClassLoader

2) or with application ClassLoader

Native code is loaded by class magick.Magick in jmagick.jar, which must be in the classpath. To switch between theese two ways, I have to call:

System.setProperty("jmagick.systemclassloader", "no");

Here is the static code that loads the dll/so library:



The native system library must be in Java library path. Websphere shows its property java.library.path in log files, when it starts.
To add libJmagick.so to library path, I set the system variable LD_LIBRARY_PATH=/usr/lib/jni in Websphere (from server console).

I re-compiled jmagick6.jar in /usr/share/java (because WAS JRE level is 1.5 and jmagick jar was Java 6 level compiled). I put it in my /WEB-INF/lib directory and set "jmagick.systemclassloader" to "no".

Now it seems to work...

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!