Win a copy of liveProject: Build an ML Recommender System this week in the Artificial Intelligence and Machine Learning forum!

Anup Bansal

Ranch Hand
+ Follow
since Sep 12, 2006
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

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,

9 years ago

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

<action path="/actions/firstAction"
<forward name="success"
<forward name="failure"

<action path="/actions/secondAction"
<forward name="success" page="/pages/businessPage.jsp"/>

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?
9 years ago
How can I achieve this format conversion? Is there any other jars available for the same?
10 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?
10 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?
10 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
10 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:
10 years ago
I am using RAD 7.5 version. It does not contain the class
Where can I find the jar file wih the plugin for TIFF?
10 years ago
I have upgraded the driver to Ojdbc14.jar but still facing the same issue
Any ideas??

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 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 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,
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?
10 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(
at org.apache.pdfbox.pdmodel.font.PDFont.getFontWidthFromAFMFile(
at org.apache.pdfbox.pdmodel.font.PDSimpleFont.getFontWidth(
at org.apache.pdfbox.util.PDFStreamEngine.processEncodedText(
at org.apache.pdfbox.util.operator.ShowText.process(
at org.apache.pdfbox.util.PDFStreamEngine.processOperator(
at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(
at org.apache.pdfbox.util.PDFStreamEngine.processStream(
at org.apache.pdfbox.pdfviewer.PageDrawer.drawPage(
at org.apache.pdfbox.pdmodel.PDPage.convertToImage(
at org.apache.pdfbox.util.PDFImageWriter.writeImage(
Caused by: java.lang.ClassNotFoundException: org.apache.fontbox.afm.FontMetric
at java.lang.ClassLoader.loadClass(
at sun.misc.Launcher$AppClassLoader.loadClass(
at java.lang.ClassLoader.loadClass(
... 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 . Where can I find the correct fontbox.jar?

Thanks & regards,
10 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?
10 years ago

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,
10 years ago