Installing Java Advanced Imaging In Tomcat.

2010-04-23 Thread aditya siram
Hi all,
I am having issues using jai [1]  with a Tomcat webapp. I am running
the tomcat6 package installed from the Ubuntu repos.

The webapp does some image decompression and is unable to detect
CLibJpegImageReader which is a class in the jai_imageio.jar.

I have copied this jar file to my WEB-INF/lib directory and also to
/var/lib/tomcat6/lib and /usr/share/tomcat6/lib hoping that it would
work from one of these locations. Additionally it is in my
JAVA_HOME/jre/lib/ext directory so it should be available after the
bootstrap phase.

I know that JAI is installed correctly because a stand-alone app is
able to access the required class.

Any help is appreciated
-deech

[1] http://java.sun.com/javase/technologies/desktop/media/jai/

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Installing Java Advanced Imaging In Tomcat.

2010-04-23 Thread Pid
On 23/04/2010 21:31, aditya siram wrote:
> Hi all,
> I am having issues using jai [1]  with a Tomcat webapp. I am running
> the tomcat6 package installed from the Ubuntu repos.
> 
> The webapp does some image decompression and is unable to detect
> CLibJpegImageReader which is a class in the jai_imageio.jar.
> 
> I have copied this jar file to my WEB-INF/lib directory and also to
> /var/lib/tomcat6/lib and /usr/share/tomcat6/lib hoping that it would
> work from one of these locations. Additionally it is in my
> JAVA_HOME/jre/lib/ext directory so it should be available after the
> bootstrap phase.
> 
> I know that JAI is installed correctly because a stand-alone app is
> able to access the required class.

The jar should only be present in one location at any given time,
multiple locations will almost certainly produce unexpected conditions.

Which version of Java are you using?


p

> [1] http://java.sun.com/javase/technologies/desktop/media/jai/
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 




signature.asc
Description: OpenPGP digital signature


Re: Installing Java Advanced Imaging In Tomcat.

2010-04-23 Thread aditya siram
1.6.0_15.

I originally started off without anything in the WEB-INF/lib file
because I thought my original install in JAVA_HOME would be found.

-deech

On 4/23/10, Pid  wrote:
> On 23/04/2010 21:31, aditya siram wrote:
>> Hi all,
>> I am having issues using jai [1]  with a Tomcat webapp. I am running
>> the tomcat6 package installed from the Ubuntu repos.
>>
>> The webapp does some image decompression and is unable to detect
>> CLibJpegImageReader which is a class in the jai_imageio.jar.
>>
>> I have copied this jar file to my WEB-INF/lib directory and also to
>> /var/lib/tomcat6/lib and /usr/share/tomcat6/lib hoping that it would
>> work from one of these locations. Additionally it is in my
>> JAVA_HOME/jre/lib/ext directory so it should be available after the
>> bootstrap phase.
>>
>> I know that JAI is installed correctly because a stand-alone app is
>> able to access the required class.
>
> The jar should only be present in one location at any given time,
> multiple locations will almost certainly produce unexpected conditions.
>
> Which version of Java are you using?
>
>
> p
>
>> [1] http://java.sun.com/javase/technologies/desktop/media/jai/
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>
>
>
>

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Installing Java Advanced Imaging In Tomcat.

2010-04-23 Thread Pid
On 23/04/2010 22:09, aditya siram wrote:
> I just uninstalled JAI and my stand-alone app could not find a
> suitable image reader. I put the jars back in and the problem goes
> away.
> 
> BTW thanks for getting back to me so quick!

So are you relying on specific classes from the JAI jars?
Are equivalents not available in the JDK itself?


p

> -deech
> 
> On 4/23/10, Pid  wrote:
>> On 23/04/2010 21:53, aditya siram wrote:
>>> 1.6.0_15.
>>
>> Isn't JAI/IIO part of that JDK now?
>> I don't think you need to add the older jars do you?
>>
>>
>> p
>>
>>> I originally started off without anything in the WEB-INF/lib file
>>> because I thought my original install in JAVA_HOME would be found.
>>>
>>> -deech
>>>
>>> On 4/23/10, Pid  wrote:
 On 23/04/2010 21:31, aditya siram wrote:
> Hi all,
> I am having issues using jai [1]  with a Tomcat webapp. I am running
> the tomcat6 package installed from the Ubuntu repos.
>
> The webapp does some image decompression and is unable to detect
> CLibJpegImageReader which is a class in the jai_imageio.jar.
>
> I have copied this jar file to my WEB-INF/lib directory and also to
> /var/lib/tomcat6/lib and /usr/share/tomcat6/lib hoping that it would
> work from one of these locations. Additionally it is in my
> JAVA_HOME/jre/lib/ext directory so it should be available after the
> bootstrap phase.
>
> I know that JAI is installed correctly because a stand-alone app is
> able to access the required class.

 The jar should only be present in one location at any given time,
 multiple locations will almost certainly produce unexpected conditions.

 Which version of Java are you using?


 p

> [1] http://java.sun.com/javase/technologies/desktop/media/jai/
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>



>>
>>
>>






signature.asc
Description: OpenPGP digital signature


Re: Installing Java Advanced Imaging In Tomcat.

2010-04-23 Thread Thad Humphries
I agree with Pidster--remove the other JAI jars.

I use JAI and JAI ImageIO in my application.  I have three JAI jar files in
my WEB-INF/lib directory:  jai_codec.jar, jai_core.jar, and jai_imageio.jar

If you need JAI in $JAVA_HOME, I recommend you install a second copy of the
JDK without JAI, and use this for launching Tomcat.  While I have JAI
installed in my Java 6 tree, I start Tomcat with a Java 5 tree that does not
have JAI installed.  At the start of $CATALINA_HOME/bin/catalina.sh, I've
added

JAVA_HOME=/local/jdk1.5.0_noJAI
JRE_HOME=$JAVA_HOME/jre
JAVA_OPTS="-Djava.awt.headless=true -Dcom.sun.management.jmxremote=true
-Xmx256m"

This second JDK could be Java 6, but I run Tomcat with Java 5 (and set javac
source and target to 1.5) because my application must run on older
Macintoshes that do not support Java 6.  (Headless is set because my
application also must run on systems without a DISPLAY.)

My application installs and runs in Tomcat on Linux, Mac, and Windows.

On Fri, Apr 23, 2010 at 4:48 PM, Pid  wrote:

> On 23/04/2010 21:31, aditya siram wrote:
> > Hi all,
> > I am having issues using jai [1]  with a Tomcat webapp. I am running
> > the tomcat6 package installed from the Ubuntu repos.
> >
> > The webapp does some image decompression and is unable to detect
> > CLibJpegImageReader which is a class in the jai_imageio.jar.
> >
> > I have copied this jar file to my WEB-INF/lib directory and also to
> > /var/lib/tomcat6/lib and /usr/share/tomcat6/lib hoping that it would
> > work from one of these locations. Additionally it is in my
> > JAVA_HOME/jre/lib/ext directory so it should be available after the
> > bootstrap phase.
> >
> > I know that JAI is installed correctly because a stand-alone app is
> > able to access the required class.
>
> The jar should only be present in one location at any given time,
> multiple locations will almost certainly produce unexpected conditions.
>
> Which version of Java are you using?
>
>
> p
>
> > [1] http://java.sun.com/javase/technologies/desktop/media/jai/
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> > For additional commands, e-mail: users-h...@tomcat.apache.org
> >
>
>
>


-- 
"Hell hath no limits, nor is circumscrib'd In one self-place; but where we
are is hell, And where hell is, there must we ever be" --Christopher
Marlowe, 'Doctor Faustus' (v, 121-24)


Re: Installing Java Advanced Imaging In Tomcat.

2010-04-26 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Deech,

On 4/23/2010 4:31 PM, aditya siram wrote:
> I know that JAI is installed correctly because a stand-alone app is
> able to access the required class.

Good. You didn't mention your platform, and so a missing native library
could have been the problem (not sure how much of JAI is native these
days). Since it works outside of Tomcat, you're probably okay.

I agree with Pid and Thad: try not to install anything extra into the
system classpath by putting libraries like JAI into JRE_HOME/anything.
It's best to bundle them with your webapp and/or use "-classpath" when
launching non-webapp code.

Finally, I'd just like to mention that uses of JAI (or really any Java
image I/O) tends to reach the limits of scalability rather quickly
unless you are careful about things like image size and numbers of
simultaneous operations on images. Consider the fact that images are
rather large and can consume a lot of memory, especially with many
potential simultaneous users. If you are doing operations that don't
actually require that you actually decode the entire image (such as
determining image metadata, etc.) consider avoiding a full-image
operation. Also consider a batch-processing model where your webapp
records the desired operations and another process comes along and
actually performs those operations. That can often give the user a
better experience and also give you a more stable system.

Good luck,
- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvV0joACgkQ9CaO5/Lv0PC+GwCfdBYxUuErFjpAp3dXYLyeK9yw
HqYAoLlPzIgu23u/C3AutaA/h4GHoruG
=tQPK
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Installing Java Advanced Imaging In Tomcat.

2010-04-26 Thread Stephen Souness
aditya siram  gmail.com> writes:

> 
> Hi all,
> I am having issues using jai [1]  with a Tomcat webapp. I am running
> the tomcat6 package installed from the Ubuntu repos.
> 
> The webapp does some image decompression and is unable to detect
> CLibJpegImageReader which is a class in the jai_imageio.jar.
> 
> I have copied this jar file to my WEB-INF/lib directory and also to
> /var/lib/tomcat6/lib and /usr/share/tomcat6/lib hoping that it would
> work from one of these locations. Additionally it is in my
> JAVA_HOME/jre/lib/ext directory so it should be available after the
> bootstrap phase.
> 
> I know that JAI is installed correctly because a stand-alone app is
> able to access the required class.
> 
> Any help is appreciated
> -deech


I think someone reported something similar a few weeks back.

The response that worked for them was:

Try disabling the JreMemoryLeakPreventionListener in conf/server.xml, just in
case it was interfering with the JAI registration.



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Installing Java Advanced Imaging In Tomcat.

2010-04-26 Thread Thad Humphries
That was me, but I had a different problem.  (1) I was running Tomcat
6.0.26; and (2) my servlet could find the classes, but the
Iterator returned by ImageIO.
getImageReadersByFormatName("tiff") returned false for hasNext().

On Mon, Apr 26, 2010 at 6:49 PM, Stephen Souness  wrote:

> ...
>
> I think someone reported something similar a few weeks back.
>
> The response that worked for them was:
>
> Try disabling the JreMemoryLeakPreventionListener in conf/server.xml, just
> in
> case it was interfering with the JAI registration.
>
>

-- 
"Hell hath no limits, nor is circumscrib'd In one self-place; but where we
are is hell, And where hell is, there must we ever be" --Christopher
Marlowe, 'Doctor Faustus' (v, 121-24)