java.lang.ArrayIndexOutOfBoundsException: 4

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF Merger for Java (v4)  /  java.lang.ArrayIndexOutOfBoundsException: 4

DynamicPDF Merger for Java (v4) Forum

Hello,

I am facing below issues with the below line of code and this issue happens only for that particular pdf file. Could you please help me out ?

ImportedPage page = new ImportedPage("sometest.pdf");

java.lang.ArrayIndexOutOfBoundsException: 4
        at com.cete.dynamicpdf.merger.ac.a(Unknown Source)
        at com.cete.dynamicpdf.merger.ac.d(Unknown Source)
        at com.cete.dynamicpdf.merger.ac.a(Unknown Source)
        at com.cete.dynamicpdf.merger.ac.a(Unknown Source)
        at com.cete.dynamicpdf.merger.zb.a(Unknown Source)
        at com.cete.dynamicpdf.merger.zb.a(Unknown Source)
        at com.cete.dynamicpdf.merger.w.b(Unknown Source)
        at com.cete.dynamicpdf.merger.w.a(Unknown Source)
        at com.cete.dynamicpdf.merger.w.a(Unknown Source)
        at com.cete.dynamicpdf.merger.PdfDocument.g(Unknown Source)
        at com.cete.dynamicpdf.merger.PdfDocument.<init>(Unknown Source)
        at com.cete.dynamicpdf.merger.PdfDocument.<init>(Unknown Source)
        at com.cete.dynamicpdf.merger.ImportedPage.<init>(Unknown Source)

FYI, i am using DynamicPDF.jar version 4.0 ,sun jdk 1.4 and Acrobat 9.4.6 version.

awaiting for your response.

Thanks,
Karthik
Posted by a ceTe Software moderator - Commonly asked question
Hello Karthik,

Can you please try using the latest version 4 DynamicPDF jar file in your application and see if it works for you? You can download the latest DynamicPDF jar file by logging into our CustomerArea: http://www.dynamicpdf.com/CustomerArea using your version 4 product serial number. Remove reference for the old DynamicPDF jar file and reference the latest DynamicPDF jar file in your application.

If you continue getting the error even after using the latest DynamicPDF jar file in your application then please send over the following details to our support team at: support@cete.com so that they can look into it further.

1.        Input PDF document with which you are getting error.
2.        Sample code which you are using.
3.        Full stack trace of error message.
4.        Exact version and build number of the DynamicPDF jar file(if you are unable to locate the build number for the DynamicPDF jar file then you can send over the DynamicPDF jar file which you are using in your application)

Thanks,
ceTe Software Support Team.
Hello team,

Thanks for your response. it works for me after using version 6 (tried with free version) in windows.

I downloaded same version (free version) for Linux and used in my Solaris box. I got different application exception rather than ArrayIndexOutofBound exception. Do I need to use only licensed version in Solaris box?

Can you please let me know where we can get the serial number from existing DynamicPDF.jar to download latest version? As this code was developed by someone i don't have license information with me.

Thanks in Advance.

Thanks,
Karthik
Posted by a ceTe Software moderator
Hello Karthik,

The DynamicPDF jar file which is on our website for download is fully functional edition and only difference between licensed version and trial version is trial version will produce watermark on the generated PDF document. You need not have to use the licensed version of DynamicPDF jar file to make the application work.

Please send over the following details to our support team at: support@cete.com so that they can look into it further.

1.        Are you getting error while merging specific PDF document or with all PDFs?
2.        What JDK(Sun,IBM...) and version of JDK(1.4,1.5…) you are using?
3.        Full stack trace of the error message.
4.        Input PDF document which you are using for merging.
5.        Sample code which you are using for merging.

Our sales team will send product serial number to the registered email address at the time of purchase of the product. You can contact our support team by sending the license key which you are using in your current application so that they can send you the product registration details.

Thanks,
ceTe Software Support.
Hello team,

I would like to try with version 4.0.2 or 4.0.3 because currently Implementation-Version: 4.0.1 build_61129 is being used in my application. Could you please let me know where can i get those earlier versions of DynamicPDF.jar, as i don't find earlier versions in your website.

I tried with version 6 in solaris, but its giving some other issue. So I feel ,its better to proceed with next version of 4.0.1 to avoid code changes and make the current code to work.


Please help us.

For your queries...

1.        Are you getting error while merging specific PDF document or with all PDFs? No, seems error is not related to pdf
2.        What JDK(Sun,IBM...) and version of JDK(1.4,1.5…) you are using? sun jdk 1.4
3.        Full stack trace of the error message.
Microsoft.XLANGs.Core.XlangSoapException: java.lang.reflect.InvocationTargetException Message ID: {BDCA1520-10A1-4833-B233-4E2866264224} Instance ID: {C4FD5271-373B-4600-93E0-C817396C9D29}

4.        Input PDF document which you are using for merging. We are not supposed to share clients related document.
5.        Sample code which you are using for merging

ImportedPage page = new ImportedPage("test.pdf"); in this i got arrayindex outof bound exception.





Posted by a ceTe Software moderator
Hello Tony,

Can you please contact our support team at: support@cete.com by sending the current version 4 DynamicPDF jar file which you are using in your application so that they can provide you the link to download the latest version 4.0.3 DynamicPDF jar file?

Thanks,
ceTe Software Support Team.
Hi,

How to find out the jar is pdf generator or pdf merger? because both have same name DynamicPDF.jar In my application, this jar is used but not sure its merger or generator?

Please advise me.

Thanks
Karthik
Posted by a ceTe Software moderator
Hello Karthik,

We do not have separate DynamicPDF jar file for DynamicPDF Generator for Java and DynamicPDF Merger for Java product. You can refer the feature chart for version 4 DynamicPDF Generator for Java product at: http://www.dynamicpdf.com/Support/Java_Help_Documentation_07_03/user-manual/VersionFeatures.html and make sure you are using features associated with the license you own.

Please note that our DynamicPDF for Java product will not throw any exception if you use any other features which are not included in your license but it will add watermark to the output PDF document depending on the features you are using and license you purchased.

Thanks,
ceTe Software Support Team.
Hi,
Thanks for your reply.

Initially i got ArrayIndexOutOfBoundException due to v4.0.1 and it was resolved by using 4.0.3v. But i am getting java.lang.reflect.InvocationTargetException by using this jar without any code changes. I am trying to trace the actual exception. But I am not able to find. Do you have any idea? In which case, we may get this exception in this version?

Thanks in advance.
Hi,

I got the exact exception. Again i am getting ArrayIndexOutOfBoundsException: 4 in v4.0.3 also. I suspect the problem might the with the pdf. Because it contains 71 pages. out of 71, page no 11 and 12 are looks like same. That means duplicate. Can you please let me know is there any way to remove or skip this duplicate page?

waiting for your reply.

Thanks,
Karthik
Could you please help me on the above issue.
Posted by a ceTe Software moderator
Hello Karthik,
 
From the code and stack trace posted above it seems like this error is being caused as soon as the PDF document is imported using our API and it does seem like an issue with the PDF document itself. As you are unable to import the original document itself, it is not possible to skip the duplicate pages and create a new one. Also there is no method or property available in the API that will automatically skip the duplicate pages.

Please send over the PDF document to our support team at: support@cete.com so that they can look into it further.

Thanks,
ceTe Software Support.
Hi,
Thanks for your response. Yes, I will get in touch with your support team. before that I have a question.

Can duplicate pages in a pdf causes ArrayIndexOutOfBound Exception or any other issues?

Please clarify.


Thanks,
Karthi
Hi,
Thanks for your response. Yes, I will get in touch with your support team. before that I have couple of questions.

1. Initially I got array index out of bound exception with v4.0.1 and later it is resolved by v4.0.3 and v6.0. But it happens only in my local windows environment. But still am getting same exception in Solaris box (it is the actual dev environment). Anything else i have to do to make it work in Solaris box?
2. Can duplicate pages in a pdf causes ArrayIndexOutOfBoundException or any other issues?

Please clarify.


Thanks,
Karthi
Posted by a ceTe Software moderator
Hello Karthik,

1.        Please download and install the version 4.x DynamicPDF for Java product on your development machine and try running the sample examples downloaded with the product download. If sample examples works fine then try with your PDF.
2.        No, our DynamicPDF Merger for Java product won't throw any exception if the PDF document is having duplicate pages in it.

If you face any problem then please send over the full stack trace of error message and input PDF document which you are using for merging to our support team at: support@cete.com so that they can look into it further.

Thanks,
ceTe Software Support Team.
Hello CeTe team,

Thanks for your extreme support to fix this issue. It works fine with DynamicPDF_4.0.3 developer edition for windows.

I am fine with this edition in windows environment but I am not sure how same version is working in Sun Solaris environment. Because edition of this version says its for windows.

Please note that dev and server editions of Linux of this version is not working in Solaris.

Please clarify.

Thanks,
Karthik

All times are US Eastern Standard time. The time now is 8:18 PM.