Hi Paulo,
Thanks for your advice but where I can get the source code for
itext-1.3.jar to recompile in jdk1.2 ?
Regards
Rajesh
----- Original Message -----
From: "Paulo Soares" <[EMAIL PROTECTED]>
To: <[email protected]>
Cc: "Rajesh" <[EMAIL PROTECTED]>
Sent: Sunday, May 08, 2005 3:36 PM
Subject: Re: [iText-questions] iText-lplanet-SSJS - Pdf Creation Problem-2
> iText supports 1.2 but the jar is compiled with 1.4. Compile it yourself
> with 1.2.
>
> ----- Original Message -----
> From: "Rajesh" <[EMAIL PROTECTED]>
> To: "Paulo Soares" <[EMAIL PROTECTED]>
> Sent: Sunday, May 08, 2005 10:46 AM
> Subject: Re: [iText-questions] iText-lplanet-SSJS - Pdf Creation Problem-2
>
>
> > Hi Paulo,
> > Can you please tell me which jdk version(minimum) iText
supports
> > fully ? I am using Iplanet 4.1 webserver and its jdk version is 1.2. I
> think
> > certain classes like Image.class and Printwriter.class may have some
> > functionalities that are not supported by jdk1.2 because the
> > ExceptionInInitializerError exception is raised when I call either
> > PrintWriter class or Image class. That is why I was succesfully able to
> add
> > a paragraph in a Hrml file using the HtmlWriter class and Paragraph
class.
> > Also I got an error that the getCause method is not defined when I tried
> > with the piece of code you send me earlier.
> >
> > catch (Throwable t) {
> > t.printStackTrace();
> > t = t.getCause();
> > if (t != null)
> > t.printStackTrace();
> > }
> >
> > Because getCause is not supported in the earlier version. So I am afraid
> > some what same thing is happening when I use PrinteWriter class or Image
> > class :( .
> > Hope to get ur reply soon. Also please have your thoughts on what could
be
> > done next. And thank you very much for your attention so far. :)
> >
> > Regards
> > Rajesh
> >
> > ----- Original Message -----
> > From: "Paulo Soares" <[EMAIL PROTECTED]>
> > To: "Rajesh" <[EMAIL PROTECTED]>
> > Cc: <[email protected]>
> > Sent: Thursday, May 05, 2005 3:03 PM
> > Subject: RE: [iText-questions] iText-lplanet-SSJS - Pdf Creation
Problem-2
> >
> >
> > Make sure that you have enough permissions for the classloader to load
> > resources.
> >
> > > -----Original Message-----
> > > From: Rajesh [mailto:[EMAIL PROTECTED]
> > > Sent: Thursday, May 05, 2005 10:11 AM
> > > To: Paulo Soares
> > > Cc: [email protected]
> > > Subject: Re: [iText-questions] iText-lplanet-SSJS - Pdf
> > > Creation Problem-2
> > >
> > > Hi Paulo.
> > > At last a little progress I think in my attempts .. :-) .
> > > I created a
> > > class file to write in to a html file using the iText
> > > HtmlWriter class and
> > > called the java class in ssjs file. And It worked.. So it
> > > seems the problem
> > > is with the PdfWriter class.
> > >
> > > Cheers
> > > Rajesh
> > >
> > > ----- Original Message -----
> > > From: "Rajesh" <[EMAIL PROTECTED]>
> > > To: "Paulo Soares" <[EMAIL PROTECTED]>
> > > Cc: <[email protected]>
> > > Sent: Thursday, May 05, 2005 9:33 AM
> > > Subject: Re: [iText-questions] iText-lplanet-SSJS - Pdf
> > > Creation Problem-2
> > >
> > >
> > > > Hi Paulo.
> > > > I still cant sort out the problem. ;-( I created a class
> > > file to write in
> > > to
> > > > a text file using the standard java libraries and called
> > > the java class in
> > > > ssjs file.
> > > > Then I could write to the file with out any problem. So
> > > this helped me get
> > > > in to a conclusion that exception
> > > java.lang.ExceptionInInitializerError
> > > > occured in pdf program in document.add() method not because
> > > of any rights
> > > > access issue of iplanet webserver or not due to the problem
> > > with the ssjs
> > > > program calling the java class file. Do you have any
> > > idea/suggestions
> > > > regarding this issue ? Why this exception taking place ?
> > > >
> > > > Regards
> > > > Rajesh
> > > >
> > > > ----- Original Message -----
> > > > From: "Paulo Soares" <[EMAIL PROTECTED]>
> > > > To: "Rajesh" <[EMAIL PROTECTED]>
> > > > Cc: <[email protected]>
> > > > Sent: Tuesday, May 03, 2005 8:29 PM
> > > > Subject: RE: [iText-questions] iText-lplanet-SSJS - Pdf
> > > Creation Problem-2
> > > >
> > > >
> > > > iText doesn't create threads.
> > > >
> > > > > -----Original Message-----
> > > > > From: Rajesh [mailto:[EMAIL PROTECTED]
> > > > > Sent: Tuesday, May 03, 2005 3:42 PM
> > > > > To: Paulo Soares
> > > > > Subject: Re: [iText-questions] iText-lplanet-SSJS - Pdf
> > > > > Creation Problem-2
> > > > >
> > > > > Hi,
> > > > >
> > > > > The exception occured because t.getCause is supported in
> > > > > jdk1.4 only and the
> > > > > iplanet is running in a lower version. So I tried this
> > > > > option instead.
> > > > >
> > > > > catch(ExceptionInInitializerError ioe)
> > > > > {
> > > > > //System.err.println(ioe.getMessage());
> > > > > //return ioe.toString();
> > > > > Throwable t = ioe.getException();
> > > > > return t.toString();
> > > > >
> > > > > }
> > > > >
> > > > > Then I got the exception in ssjs as
> > > > > java.lang.IllegalMonitorStateException: current thread not owner
> > > > >
> > > > > I felt after going through many user group messages that it
> > > > > is something
> > > > > related with the font of the text I want to insert in
> > > paragraph so i
> > > > > tried to insert an jpg image instead of paragraph in the pdf
> > > > > doc. Then again
> > > > > i got the same exception :-(
> > > > >
> > > > > Regards
> > > > > Rajesh
> > > > >
> > > > > ----- Original Message -----
> > > > > From: "Rajesh" <[EMAIL PROTECTED]>
> > > > > To: "Paulo Soares" <[EMAIL PROTECTED]>
> > > > > Sent: Tuesday, May 03, 2005 6:01 PM
> > > > > Subject: Re: [iText-questions] iText-lplanet-SSJS - Pdf
> > > > > Creation Problem-2
> > > > >
> > > > >
> > > > > > Hi,
> > > > > > I tried with the piece of code you send. Then in the
> > > > > ssjs code in
> > > > > which
> > > > > > I am calling the java class, I got the error message as
> > > > > > java.lang.NoSuchMethodError: java.lang.Throwable: method
> > > > > > getCause()Ljava/lang/Throwable; not found
> > > > > > As I am quite new to the java paltform,I am not sure
> > > > > whether in the web
> > > > > > environment, printStackTrace() function will work.So I
> > > > > tried with this
> > > > > piece
> > > > > > of code
> > > > > > for exception
> > > > > > catch (Throwable t)
> > > > > > {
> > > > > > return t.getMessage();
> > > > > >
> > > > > > }
> > > > > >
> > > > > > Then In the ssjs page, I got t.getMessage() = null;
> > > > > > As I told before, I can create the pdf file
> > > in local jdk
> > > > > > environment with the same java class but when I deploy it
> > > > > in the iplanet
> > > > > and
> > > > > > calling the class
> > > > > > file in SSJS, I am getting this exception.
> > > > > >
> > > > > > ----- Original Message -----
> > > > > > From: "Paulo Soares" <[EMAIL PROTECTED]>
> > > > > > To: "Rajesh" <[EMAIL PROTECTED]>
> > > > > > Cc: <[email protected]>
> > > > > > Sent: Tuesday, May 03, 2005 4:53 PM
> > > > > > Subject: RE: [iText-questions] iText-lplanet-SSJS - Pdf
> > > > > Creation Problem-2
> > > > > >
> > > > > >
> > > > > > (Keep on the mailing list)
> > > > > >
> > > > > > The stack trace is used to know where the problem is.
> > > If you don't
> > > > > > provide the stack trace you won't get any answer.
> > > > > >
> > > > > > > -----Original Message-----
> > > > > > > From: Rajesh [mailto:[EMAIL PROTECTED]
> > > > > > > Sent: Tuesday, May 03, 2005 12:22 PM
> > > > > > > To: Paulo Soares
> > > > > > > Subject: Re: [iText-questions] iText-lplanet-SSJS - Pdf
> > > > > > > Creation Problem-2
> > > > > > >
> > > > > > > Hi,
> > > > > > > I have got the exception as
> > > > > > > java.lang.ExceptionInInitializerError . But I
> > > > > > > dont know why the problem occured and what need to be
> > > > > done to fix the
> > > > > > > matter.
> > > > > > > Please see the code given below.
> > > > > > >
> > > > > > >
> > > > > > > public String getValue()
> > > > > > > {
> > > > > > > Rectangle pageSize = new Rectangle(0,0,2382,3369);
> > > > > > > Document document = new Document(pageSize);
> > > > > > > Paragraph p = new Paragraph(" Hi, this is your PDF
> > > file! :-) ");
> > > > > > >
> > > > > > > try
> > > > > > > {
> > > > > > > PdfWriter.getInstance(document, new
> > > > > > > FileOutputStream("c:\\tadpdf\\filename1.pdf"));
> > > > > > > document.open();
> > > > > > > document.add(p);
> > > > > > >
> > > > > > > document.close();
> > > > > > >
> > > > > > > }
> > > > > > >
> > > > > > > }
> > > > > > >
> > > > > > > In this function, the exception is occuring in the line
> > > > > > > document.add(p);
> > > > > > > The code works fine in jdk in my localmechine but it is
> > > > > > > creating the problem
> > > > > > > when I am calling the java class from ssjs in iPlanet.
> > > > > > >
> > > > > > > Regards
> > > > > > > Rajesh
> > > > > > >
> > > > > > >
> > > > > > > ----- Original Message -----
> > > > > > > From: "Paulo Soares" <[EMAIL PROTECTED]>
> > > > > > > To: "Rajesh" <[EMAIL PROTECTED]>;
> > > > > > > <[email protected]>
> > > > > > > Sent: Tuesday, May 03, 2005 4:22 PM
> > > > > > > Subject: RE: [iText-questions] iText-lplanet-SSJS - Pdf
> > > > > > > Creation Problem-2
> > > > > > >
> > > > > > >
> > > > > > > Catch the exception with:
> > > > > > >
> > > > > > > catch (Throwable t) {
> > > > > > > t.printStackTrace();
> > > > > > > t = t.getCause();
> > > > > > > if (t != null)
> > > > > > > t.printStackTrace();
> > > > > > > }
> > > > > > >
> > > > > > > > -----Original Message-----
> > > > > > > > From: [EMAIL PROTECTED]
> > > > > > > > [mailto:[EMAIL PROTECTED] On
> > > > > > > > Behalf Of Rajesh
> > > > > > > > Sent: Tuesday, May 03, 2005 11:37 AM
> > > > > > > > To: [email protected]
> > > > > > > > Subject: [iText-questions] iText-lplanet-SSJS - Pdf
> > > > > > > Creation Problem-2
> > > > > > > >
> > > > > > > > Hi
> > > > > > > >
> > > > > > > > I found that the problem is due to
> > > > > > > > java.lang.ExceptionInInitializerError taking place at
> > > > > > > > document.add(). But why is this happening and how can I
> > > > > fix it ? .
> > > > > > > >
> > > > > > > > Thanks for you attention :-)
> > > > > > > >
> > > > > > > > Regards
> > > > > > > > RAJESH
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > ----- Original Message -----
> > > > > > > >
> > > > > > > > From: Rajesh <mailto:[EMAIL PROTECTED]>
> > > > > > > > To: [email protected]
> > > > > > > > Sent: Tuesday, May 03, 2005 12:16 PM
> > > > > > > > Subject: iText-lplanet-SSJS - Pdf Creation Problem
> > > > > > > >
> > > > > > > > Hi,
> > > > > > > > I am using Iplanet Webserver 4.1 and I am
> > > > > > > > calling a java class file from ssjs to create pdf file using
> > > > > > > > itext library. I created a pdf document in my local system
> > > > > > > > but when I tried in iplanet, (ssjs calling java file), the
> > > > > > > > file is created but after that I cant add any content to the
> > > > > > > > doc using the document.add() method. I am not getting any
> > > > > > > > exception also from java class file. I dont think there is
> > > > > > > > any file access problem as there is no restriction in its
> > > > > > > > folder. Please have a look at the issue and kindly have your
> > > > > > > > thoughts on this. The java file and the ssjs file
> > > calling the
> > > > > > > > java file codes are given below.
> > > > > > > >
> > > > > > > > Java file
> > > > > > > >
> > > > > > > > mport java.io.FileOutputStream;
> > > > > > > > import java.io.IOException;
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > import com.lowagie.text.pdf.PdfWriter;
> > > > > > > > import com.lowagie.text.*;
> > > > > > > > import netscape.javascript.*;
> > > > > > > > import netscape.server.serverenv.*;
> > > > > > > >
> > > > > > > > public class Testcase {
> > > > > > > > public String getValue()
> > > > > > > > {
> > > > > > > > String sRes = "Pdf Created";
> > > > > > > > Rectangle pageSize = new Rectangle(0,0,2382,3369);
> > > > > > > >
> > > > > > > > Document document = new Document(pageSize);
> > > > > > > >
> > > > > > > > try
> > > > > > > > {
> > > > > > > > PdfWriter.getInstance(document, new
> > > > > > > > FileOutputStream("c:\\tadpdf\\filename1.pdf"));
> > > > > > > > document.open();
> > > > > > > > document.add(new Paragraph("Hi, this is your
> > > > > > > > PDF file! :-) ")); // the problem seems to be in this line
> > > > > > > >
> > > > > > > > }
> > > > > > > > catch(DocumentException de)
> > > > > > > > {
> > > > > > > > //System.err.println(de.getMessage());
> > > > > > > > return de.toString();
> > > > > > > > }
> > > > > > > > catch(IOException ioe)
> > > > > > > > {
> > > > > > > > //System.err.println(ioe.getMessage());
> > > > > > > > return ioe.toString();
> > > > > > > > }
> > > > > > > > document.close();
> > > > > > > >
> > > > > > > > return sRes;
> > > > > > > > }
> > > > > > > >
> > > > > > > >
> > > > > > > > }
> > > > > > > >
> > > > > > > > SSJS File calling the java class
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > <SERVER>
> > > > > > > > write('<HTML>');
> > > > > > > > write('<HEAD>');
> > > > > > > > write('<TITLE>Call 3 Java</TITLE>');
> > > > > > > >
> > > > > > > > write('</HEAD>');
> > > > > > > > write('<BODY>');
> > > > > > > > write('<form name=form1>');
> > > > > > > > write('<h3>Javascript calling java</h3><br>');
> > > > > > > >
> > > > > > > > var iVal = "No Value";
> > > > > > > >
> > > > > > > > var sObj = new Packages.Testcase;
> > > > > > > > write('<b>Object created</b><br>');
> > > > > > > >
> > > > > > > > //If there is an exception in java class file, then
> > > > > > > > iVal will get it.
> > > > > > > > //Otherwise the result is returned from the java class
> > > > > > > > var iVal = sObj.getValue();
> > > > > > > >
> > > > > > > > write('<b>method called</b><br>');
> > > > > > > > write('<b>'+iVal+'</b>');
> > > > > > > >
> > > > > > > > write('</form>');
> > > > > > > > write('</BODY>');
> > > > > > > > write('</HTML>');
> > > > > > > > </SERVER>
> > > > > > > >
> > > > > > > > Regards
> > > > > > > > RAJESH.R
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > >
> > >
> >
>
>
-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions