DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 6 of 6

Thread: Jave/Websphere opening PDF document

  1. #1
    Join Date
    Jul 2005

    Question Jave/Websphere opening PDF document

    Hi There,

    I don't know if anyone has come across this problem before.

    I support a Web application (Java 1.2.2/WebSphere 3.5).

    One of the options this application offers is to create a PDF file
    containing the details of the transaction the user just completed. This is done by writing the PDF file using Etymon (and a PDF template file). This PDF file is displayed in another browser window (users mainly use Internet Explorer either v5 or v6).

    This is done via a submit button, which calls JavaScript, which
    opens a new internet browser window in which the created PDF file is displayed. This comes into our Web Server via a doGet method.

    This works for most users and they get a PDF file displayed in a new
    window, however some users get a NullPointerException in the doGet method (information ascertained from the stack trace).
    Having looked at the doGet the only real place that a NullPointerException
    can occur is when we get something out of the HttpServletRequest using

    So it looks like to me when the new window is opened the session is
    not "passed" to that new window and we cannot get anything from that session!?!

    As I said earlier this only occurs for certain users and it only
    happens when they try to create the new PDF file the rest of the application works fine (and the application requires cookies).
    To me it sounds like a browser issues as I have been able to log on
    as the user at different sites and different PCs and display the PDF file with no issues (ie: I do not get the NullPointerException).

    The user has the correct version of Adobe Reader and they can display
    a dummy PDF file in their browser, it just appears when they try to display the dynamic PDF created by the application that the error occurs.

    Any suggestions? Could it be something to do with the browser not
    allowing a new window to be displayed or the session to be passed to a new window. Cookies will be turned on in the browser otherwise the application would not work at all.

    Any help would be appreciated.

  2. #2
    Join Date
    Jun 2004
    It does sound like the browser.

    Do those users always get nullpointers?

    Try deploying your app to Tomcat or JBoss (depending on your application needs) or another "low cost" app server and test.

  3. #3
    Join Date
    Dec 2003
    I'll second that question. Is the behavior consistent? I.e. the good/bad users are consistently good/bad? I assume you load a page into the popup that makes the request for the PDF onload. Some browsers share instances between separate windows, some don't and some are configurable. If the browser launches a new window as a separate process, the new window will not share the existing session with the server. If this is the case it should be consistent for a given user.

    Do you not have an IDE with a WebSphere Test Environment so you can debug this in the container?

  4. #4
    Join Date
    Jul 2005
    The user's who have the problem get the problem consistently.

    The IDE we use is VisualAge for Java 3.5 which does have a WebSphere test environment and we also have some test servers that mirror our production environment with WebSphere 3.5.5 installed. Unfortunately in all our dev and test environments (including the clients that do not have the problem) this error cannot be recreated.

    They way the PDF works is that Etymon uses a PDF template and populates it with values and then displays the resultant PDF file. This is all done via a servlet on a doGet(). The doGet is invoked by a URL that is passed as a parameter to the JavaScript command.

    We are going to visit the client (ie: a client with the problem) to view their PC set up, and I was wondering if anyone would have any ideas as to what to look for.

    Some things I will be trying:
    1. Making our URL a trusted site and setting trusted sites to "Low" security
    2. Ensuring they check for newer versions of stored page everytime they load the web page
    3. Allowing the save of encrypted files to disk to see if IE will download the file instead of displaying on a page

    Anything I missed?

  5. #5
    Join Date
    Jun 2004
    The problem with VAJ 3.5 is that Websphere Test Environement is an emulation, of sorts, of WAS. So they don't function the same. WSAD (and beyond) has an actual instance of WAS. Also, at that point, the code bases for WAS between platforms was not the same.

    WAS did have alot of issues in the past. I would suggest, if you can do it, moving to Eclipse/RAD and a current version of WAS (or Tomcat/JBoss/Jonas/Geronimo). I don't think VAJ 3.5 and WAS 3.5 are supported anymore either.

  6. #6
    Join Date
    Dec 2003
    I don't think VAJ 3.5 and WAS 3.5 are supported anymore either.
    True. They've been out of support for almost two years.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center