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 _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions
