3 Replies Latest reply on Aug 23, 2007 8:21 AM by earniedyke

    Applet invoking a web service

    earniedyke

      Greetings all!!

      I have a problem I am hoping someone can help me solve. I have the following code in an APPLET

      URL url = new URL(webRoot + "/" + JBPM_WEBSERVICE + "?WSDL");
      QName qname = new QName("http://webservice.jbpm.abc.org","JbpmBeanService");
      ServiceFactory factory = ServiceFactory.newInstance();
      Service remote = factory.createService(url,qname);
      Jbpm proxy = (Jbpm)remote.getPort(Jbpm.class);
      String[] xml = proxy.getWorkFlow(name);
      


      When it is executed, I receive the following error in the Java Console:

      Exception in thread "AWT-EventQueue-2" java.security.AccessControlException: access denied (java.util.PropertyPermission javax.xml.rpc.ServiceFactory read)
       at java.security.AccessControlContext.checkPermission(Unknown Source)
       at java.security.AccessController.checkPermission(Unknown Source)
       at java.lang.SecurityManager.checkPermission(Unknown Source)
       at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
       at java.lang.System.getProperty(Unknown Source)
       at javax.xml.rpc.ServiceFactory$PropertyAccessAction.run(ServiceFactory.java:189)
       at java.security.AccessController.doPrivileged(Native Method)
       at javax.xml.rpc.ServiceFactory.newInstance(ServiceFactory.java:77)
       at org.ebsinc.jbpm.applet.Diagrammer$DrawingCanvas.actionPerformed(Diagrammer.java:727)
       at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
       at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
       at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
       at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
       at javax.swing.AbstractButton.doClick(Unknown Source)
       at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
       at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)
       at java.awt.Component.processMouseEvent(Unknown Source)
       at javax.swing.JComponent.processMouseEvent(Unknown Source)
       at java.awt.Component.processEvent(Unknown Source)
       at java.awt.Container.processEvent(Unknown Source)
       at java.awt.Component.dispatchEventImpl(Unknown Source)
       at java.awt.Container.dispatchEventImpl(Unknown Source)
       at java.awt.Component.dispatchEvent(Unknown Source)
       at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
       at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
       at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
       at java.awt.Container.dispatchEventImpl(Unknown Source)
       at java.awt.Component.dispatchEvent(Unknown Source)
       at java.awt.EventQueue.dispatchEvent(Unknown Source)
       at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
       at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
       at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
       at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
       at java.awt.EventDispatchThread.run(Unknown Source)
      


      My research leads me to believe the ServiceFactory in jboss-jaxrpc.jar is attempting to read a system property and this is causing the error. Anyone think of a way around this?

      Thanks in advance for any and all assistance!!!

      Earnie!

        • 1. Re: Applet invoking a web service
          earniedyke

          As an update, I was able to get around this by adding:

          permission java.util.PropertyPermission "javax.xml.rpc.ServiceFactory", "read"


          to my java.ploicy file but I don't want to have to do that for every client. So I am still looking for a workable solution.

          Earnie!

          • 2. Re: Applet invoking a web service
            thomas.diesler

            You could do

            new ServiceFactoryImpl()
            


            which would bind your client to a proprietary API call that is subject to change.

            • 3. Re: Applet invoking a web service
              earniedyke

              Thanks for the info Tom. Because of the large number of dependent jars required, I decided to create a servlet as a proxy which calls my web service from the server. This makes for a smaller applet and now I can deploy my web service anywhere not just to the server where the applet resides.

              Earnie!