Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4645095

petstore will not work on JWSDP + RI

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P3 P3
    • None
    • 1.0
    • xml

      when the jwsdp is used on top of the J2EE RI version 1.3.1, the petstore does not work properly. For instance, when an order is submitted we get exceptions, probably due to the petstore using JAXP to manipulate xml docs. If I remove xalan.jar provided as part of JWSDP then it seems to work. But of course, not all of jax* will work without xalan.
      We need to ensure that the petstore and other applications can run on the j2ee RI 1.3.1 plus JWSDP.


      ###@###.### 2002-03-08

      I added this from an email Anne Hendry forwarded to me

      Just to let you know. The bug I filed last week on webservices pack is
      still occurring. I installed latest promoted build of webservice pack on
      j2ee1.3.1, and then installed petstore. It still does not work. Below is
      a description. If any questions tomorrow, I will be working 1/2 day
      tomorrow so am available before lunch but probably will be gone after
      that. Ramesh, Thierry, Edwin G., and I all looked at the bug. This bug
      is mostly a problem from blueprint's perspective since we plan to
      release a web service app that uses this J2EE1.3.1 RI + WSDPK as our
      "platform" so we are dependent. Also, since we want to start developing
      the app, we need the "platform" to let us tinker to meet our release. So
      the bug may not hurt us today, but may be a blocker soon. Other
      developers may face similiar problems, so it would be nice to make the
      webservice pack + j2ee a bit more stable and portable. Since this is not
      a CTS tested "platform", I think it would be good to get the petstore
      used as pre-release test in the future. I am guessing that some testing
      is done and the webservices sample apps are tested so maybe the petstore
      can be tested also. Hope that helps.
      Below is a report of the problem....
      Sorry for the bad news :-)
      Sean
                                         MORE DETAILS ABOUT BUG...
      My system is
           -windows 2000
           -J2ee1.3.1 downloaded from the public website a few days ago
           -jdk 1.4 downloaded from the public website a few days ago(i also
      ran it prevoisly on jdk 1.3.1 and it also got an error)
           -webservice pack promoted build #33
          -I ran the setup script to install the webservice pack on the J2ee
      RI.
          -the java petstore 1.3._01 downloaded from the public website a few
      days ago
           -ALL were Uninstalled and then fresh installations done.

       This is the error I get. When I shop for some pets, place them in cart,
      sign on, then finally click to place and commit the order, I get a stack
      trace at j2ee terminal window. It happens when the code tries to use
      JAXP to get an xml version of the Purchase Order and calls PO.toXML
      since this code uses our xml utility classes to do the work. You can see
      the location of the error below.

      ...........................
          at
      org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(TransformerFact
      oryImpl.java:804)

              at
      com.sun.j2ee.blueprints.xmldocuments.XMLDocumentUtils.toXML(XMLDocumentUtils.jav
      a:209)

              at com.sun.j2ee.blueprints.xmldocuments.PO.toXML(PO.java:385)
              at
      com.sun.j2ee.blueprints.petstore.controller.ejb.actions.OrderEJBAction.perform(O
      rderEJBAction.java:162)

              at
      com.sun.j2ee.blueprints.waf.controller.ejb.StateMachine.processEvent(StateMachin
      e.java:113)

              at
      com.sun.j2ee.blueprints.waf.controller.ejb.EJBClientControllerEJB.processEvent(E
      JBClientControllerEJB.java:76)

              at
      com.sun.j2ee.blueprints.petstore.controller.ejb.ShoppingClientControl
      ...................................................

      WORKAROUNDS
      Previous Errors:
      In the webservice pack downloaded from the web last week, I got same
      type of error. It had manual instructions for installing webservice pack
      on RI. But if I took the xalan.jar that came with the webservice pack
      out of the j2ee instruction steps, it was better. So the bug seemed to
      be a conflict with something in the xalan.jar from the webservice pack
      that I was instructed to stick in the j2ee RI.
      Current situation: If remove endorsed.jar from classpath of setenv.bat
      and j2ee.bat of j2ee ri(these scripts added the endorsed.jar when the
      webservice pack is installed) then petstore WILL work However, the
      webservice pack examples might not work without this jar?

      PETSTORE CODE SNIPPET from
      com.sun.j2ee.blueprints.xmldocuments.XMLDocumentUtils.java

      Below is the code that the petstore calls. It seems ok. I spoke with
      Ramesh, Thierry, and Edwin G. and everyone seemed to think the petstore
      code was valid, jsut standard JAXP stuff. See below for reference.
       public static void toXML(Document document, String dtdPublicId, String
      dtdSystemId, StreamResult result)
          throws XMLDocumentException {
            toXML(document, dtdPublicId, dtdSystemId, DEFAULT_ENCODING,
      result);
            return;
        }

        public static void toXML(Document document, String dtdPublicId, String
      dtdSystemId, String encoding, StreamResult result)
          throws XMLDocumentException {
            try {
              TransformerFactory transformerFactory =
      TransformerFactory.newInstance();
              Transformer transformer = transformerFactory.newTransformer();
              transformer.setOutputProperty(OutputKeys.METHOD, "xml");
              if (dtdSystemId != null) {
                transformer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM,
      dtdSystemId);
              }
              transformer.setOutputProperty(OutputKeys.DOCTYPE_PUBLIC,
      dtdPublicId);
              transformer.setOutputProperty(OutputKeys.ENCODING, encoding);
              transformer.setOutputProperty(OutputKeys.INDENT, "yes");
              transformer.transform(new DOMSource(document), result);
            } catch (Exception exception) {
              exception.printStackTrace(System.err);
              throw new XMLDocumentException(exception);
            }
            return;
        }

            gsharmasunw Gopal Sharma (Inactive)
            spbrydon Sean Brydon (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: