Anup Bansal

Ranch Hand
+ Follow
since Sep 12, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Anup Bansal

Hi All,

I am trying to invoke a webservice which is deployed in a JAX-RPC way using a JAX-WS client.
When I run it in my local workspace in RAD, this works.
However when invoking the service deployed on a test envrionment (Unix machine), it fails to run.
I always receive a null response.
When i intercept the request/ response via a TCP/IP monitor, i am able to see that the reponse is proper but somehow the
response DTO is always null.

Since this works on local, i am sure it is possible to call a JAX-RPC Webservice using a JAX-WS client, but do not understand why it fails when the server is deployed on the Unix machine.

Thanks & regards,
Anup


13 years ago
Hi,

I have two questions w.r.t struts. Following is an example of my action mapping:

<action path="/actions/firstAction"
type="example.SecurityAction"
scope="request">
<forward name="success"
path="/actions/secondAction.do"/>
<forward name="failure"
path="/pages/login.jsp"/>
</action>

<action path="/actions/secondAction"
type="example.BusinessAction"
scope="request">
<forward name="success" page="/pages/businessPage.jsp"/>
</action>

1. How can i pass objects from one action class to another? Say from FirstAction to SecondAction
Can i use request.setattribute in the first action class to set the object and get in the second action using request.getattribute, which i can then set in the form of the seconAction?
If i define a third action class, will the object set in the first action also be accessible in the third action class (without me setting it again explicitly in the second action class)?
Are there any implications of using request.setattribute?

2. Is it better to set the object in some database on form submission in the first action class and then retrieve it in the second action class from the database, set it in the form bean for display in the jsp?
13 years ago
How can I achieve this format conversion? Is there any other jars available for the same?
14 years ago
I tried iText by first reading a PDF and then re-creating the PDF with the PDF version set 10 1.4 and conformance set to PDF-1A.
I validated the generated PDF using an external tool but it gave some issues.

Following is the snippet of the code:


Could you please suggest me other ways of achieveing this?
14 years ago
I need to convert PDF files to conform to PDF/A format.
How can I achieve this? Can I use iText.jar for this?
14 years ago
I have one question with regards to flushing and Commit.
I want to insert around 50000 records using hibernate in a single trnasaction. The suggested apporach is:


My question is: will the records flushed by the call to session.flush() (Line 1) and before the commit is perfomred (Line 2) be visible in the database from another applicaiton/session?
Ok thanks for your inputs!
I can use the approach as mentioned in the discussion thread to convert PDF to PNG and then to TIFF.
I want to convert a multipage PDF to TIFF.
What would be the best apporach -> to split the final TIFF or to first split PDF and then create the individual TIFFs.
Is there a better approach?
Also, at the following link I found a different approach (using Jpedal)
Are there any differences/downsides of using it?
Link using Jpedal
14 years ago
I am able to convert PNG format to TIFF, howerver the TIFF file created is large.
How can i compress the TIFF file?

Following is a snippet of my Code:
14 years ago
I am using RAD 7.5 version. It does not contain the class com.sun.media.imageioimpl.plugins.tiff.TIFFImageWriterSpi.
Where can I find the jar file wih the plugin for TIFF?
14 years ago
I have upgraded the driver to Ojdbc14.jar but still facing the same issue
Any ideas??
Hi,

I want to insert BLOB data > 4k into the database. I am using the package oracle.sql.blob.
We are using classes12.jar for the drivers.

Attached is the snippet of the code:



The above worked fine on WAS 5.1 with JDK 1.4.2 and classes12.zip. The oracle version being used is 10g
However we recently migrated to WAS 6.1. The JDK version being used is 1.5.1 and the driver calsses were replaced from classwes 12.zip to classes12.jar whcih is compatible with Oracle 10g
The database version is the same
However we observe that under load conditions, the query where we are inserting the empty blob takes an awfully long time and sometimes the session even hangs.
The method BLOB.empty_blob() is deprecated in the new calsses12.jar and so is the method getBinaryOutputStream().
Can this be cause of these delayed performance?

What methods can be used insted of the deprecated ones? (Java doc for Oracle.sql is not very exhausitve)

Can we use ojdbc.jar to get rid of this issue?

Kindly advise.

Thanks & regards,
Anup
Thanks got the correct version.
I would like to convert the PDF file to a tiff file. So as mentioned the first step is to convert it into PNG file and then using JAI convert the PNG into TIFF.

In the PDFBox, the PDFImageWriter calss is used to convert the PDF to the desired PNG file. However, the PNG file is created in the Filesystem.
As i need to convert this further to a TIFF file, I would like to know if it is possible to have a byte array of the PNG file without actually it being creatd in the FileSystem which I can use as an input for the ImageIO classes?
14 years ago
I get the following error when i use the PDFToImage class:
Throwable occurred: java.lang.NoClassDefFoundError: org.apache.fontbox.afm.FontMetric
at org.apache.pdfbox.pdmodel.font.PDFont.getAFM(PDFont.java:313)
at org.apache.pdfbox.pdmodel.font.PDFont.getFontWidthFromAFMFile(PDFont.java:262)
at org.apache.pdfbox.pdmodel.font.PDSimpleFont.getFontWidth(PDSimpleFont.java:175)
at org.apache.pdfbox.util.PDFStreamEngine.processEncodedText(PDFStreamEngine.java:323)
at org.apache.pdfbox.util.operator.ShowText.process(ShowText.java:45)
at org.apache.pdfbox.util.PDFStreamEngine.processOperator(PDFStreamEngine.java:552)
at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:248)
at org.apache.pdfbox.util.PDFStreamEngine.processStream(PDFStreamEngine.java:207)
at org.apache.pdfbox.pdfviewer.PageDrawer.drawPage(PageDrawer.java:106)
at org.apache.pdfbox.pdmodel.PDPage.convertToImage(PDPage.java:698)
at org.apache.pdfbox.util.PDFImageWriter.writeImage(PDFImageWriter.java:137)
at com.abnarmo.nl.scan.pdfconvertor.split.PDFToImage.main(PDFToImage.java:204)
Caused by: java.lang.ClassNotFoundException: org.apache.fontbox.afm.FontMetric
at java.net.URLClassLoader.findClass(URLClassLoader.java:419)
at java.lang.ClassLoader.loadClass(ClassLoader.java:643)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:300)
at java.lang.ClassLoader.loadClass(ClassLoader.java:609)
... 12 more

It seems that the class, org.apache.fontbox.afm.FontMetric is not present. When I check the fontbox-0.1.0.jar, i cannot find this class. Insted i find the class as org.fontbox.afm.FontMetric. (without the apache in it)
I had downloaded this jar from http://pdfbox.apache.org/ . Where can I find the correct fontbox.jar?

Thanks & regards,
Anup
14 years ago
The PDFBOx seems to me more like a command based utility solution than an API based solution.
Is there an API based solution to realise this?
14 years ago
Hi,

I need to convert multipage PDF files to Single page Tiff files.
Can I achieve this using the JAI library?
What other ways can i realise this?

Thanks & regards,
Anup
14 years ago