java.lang.NoSuchMethodError

java.lang.NoSuchMethodError

Forum member · Feb 7, 2008
I'm trying to run the jsp example using JDeveloper. I've added the library that correctly points to the DynamicPDF.jar file - so it recognizes the two import statments (import="com.cete.dynamicpdf.*, com.cete.dynamicpdf.pageelements.Label") It throws the above exception when I run it though. Here is the entire code for the jsp example: <%@ page language="java" import="com.cete.dynamicpdf.*, com.cete.dynamicpdf.pageelements.Label" contentType="application/pdf" session="false" %><% Document objDocument = new Document(); objDocument.setCreator("HelloWorldJSP.jsp"); objDocument.setAuthor("Your Name"); objDocument.setTitle("Hello World"); Page objPage = new Page(PageSize.LETTER, PageOrientation.PORTRAIT, 54.0f); String strText = "Hello World...\nFrom DynamicPDF Generator for Java\nDynamicPDF.com"; Label objLabel = new Label(strText, 0, 0, 504, 100, Font.getHelvetica(), 18, TextAlign.CENTER); objPage.getElements().add(objLabel); objDocument.getPages().add(objPage); ServletOutputStream sOut = response.getOutputStream(); objDocument.drawToWeb(request, response, sOut, "HelloWorldJSP.pdf"); sOut.flush(); %> It always throws that Exception on the first line: Document objDocument = new Document(); If I comment out that line (and all other lines that reference objDocument), then it runs w/o Exception (of course it doesn't do anything - but that is expected). Any help here is greatly appreciated.

Re: java.lang.NoSuchMethodError

Support · Feb 7, 2008
Hello, The error message indicates that the JAR files are not getting referenced correctly within your application. Do you get intellisense when adding the import statement? Thanks, ceTe Software Support Team

Re: java.lang.NoSuchMethodError

Forum member · Feb 7, 2008
The error messages that I was getting when the JAR file was not being referenced correctly was this: Error: (0) identifier com.cete.dynamicpdf.pageelements.Label not found. Error: (7) class Page not found in class oa_html.HelloWorld. Error: (7) class Page not found in class oa_html.HelloWorld. Error: (7) variable PageSize not found in class oa_html.HelloWorld. Error: (7) variable PageOrientation not found in class oa_html.HelloWorld. Error: (9) class Label not found in class oa_html.HelloWorld. Error: (9) class Label not found in class oa_html.HelloWorld. Error: (9) variable Font not found in class oa_html.HelloWorld. Error: (9) variable TextAlign not found in class oa_html.HelloWorld. When I was getting those errors I could not even compile the page let alone run it. After adding the Library correctly, I've been able to compile w/o errors. It's just now when I run it, it encounters the exception. Unfortunately because we are on Oracle 11.5.8, we are still using JDev 3.2.3 (hence no intellisense). Furthermore our current java stack is 1.3 - I'm now wondering if that might be an issue. Thanks for your help - looking forward to your response.

Re: java.lang.NoSuchMethodError

Support · Feb 7, 2008
Hello, Unfortunately we do not have full support of our product to work successfully with JDK 1.3. This is something we may add in the future but we do not have any immediate plans. The only solution would be to upgrade the version of JDK to v1.4 or higher. Our product is fully compatible with JDK 1.4 or higher. Thanks, ceTe Software Support Team

Re: java.lang.NoSuchMethodError

Forum member · Feb 7, 2008
As I was typing it I had a feeling that was it. Thanks again for all your help and prompt replies.