4 Replies Latest reply on Mar 23, 2004 2:47 AM by didi1976

    ejb and java web start problem

    chemapo

      Hi,

      I'am developing a client side component for our J2EE application. We want to download and launch this client from the app server (jboss) using Java Web Start. We have defined the jnlp file like this:

      <?xml version="1.0" encoding="utf-8"?>
      <!-- JNLP File for klwebspy Demo Application -->


      KLWebSpy
      Keld Electronics.

      KLWebSpy
      KLWebSpy.


      <all-permissions/>


      <j2se version="1.4"/>



      <applet-desc
      documentBase="http://172.26.0.14:8080/klwebspy/lib"
      name="KLWebSpy"
      main-class="klwebspy.applets.KLWebSpy"
      width="800"
      height="600">

      </applet-desc>



      And we have signed the jar file. When we try to launch the client we get the following exception in the java console:

      java.security.AccessControlException: access denied (java.net.SocketPermission 172.26.0.14:1098 connect,resolve)
      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.checkConnect(Unknown Source)
      at sun.rmi.transport.tcp.TCPChannel.checkConnectPermission(Unknown Source)
      at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
      at sun.rmi.server.UnicastRef.invoke(Unknown Source)
      at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:528)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:507)
      at javax.naming.InitialContext.lookup(Unknown Source)
      at klwebspy.locator.ServiceLocator.getHome(ServiceLocator.java:53)
      at klwebspy.applets.KLWebSpy.jbInit(KLWebSpy.java:111)
      at klwebspy.applets.KLWebSpy.init(KLWebSpy.java:97)
      at klwebspy.applets.KLWebSpy.main(KLWebSpy.java:482)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at com.sun.javaws.Launcher.executeApplication(Unknown Source)
      at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
      at com.sun.javaws.Launcher.continueLaunch(Unknown Source)
      at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
      at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
      at com.sun.javaws.Launcher.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)

      This exception is thrown when the client tries to connect to the ejb components, this components are in the same server that the client jar file. We don't know why this exception is thrown because we have signed the jar and we have provide all permissions in the jnlp file. Can you help?

      Thanks in advance

      Regards

        • 1. Re: ejb and java web start problem (real jnlp file, sorry)
          chemapo

          The jnlp is loke this:

          <?xml version="1.0" encoding="utf-8"?>
          <!-- JNLP File for klwebspy Demo Application -->


          KLWebSpy
          Keld Electronics.

          KLWebSpy
          KLWebSpy.


          <all-permissions/>


          <j2se version="1.4"/>



          <applet-desc
          documentBase="http://172.26.0.14:8080/klwebspy/lib"
          name="KLWebSpy"
          main-class="klwebspy.applets.KLWebSpy"
          width="800"
          height="600">

          </applet-desc>

          • 2. Re: ejb and java web start problem
            didi1976

            Did you also sign the jbossall-client.jar? Or did you include all classes in your jar-File?

            • 3. Re: ejb and java web start problem
              chemapo

              Hi,

              I have include the needed jbossall-client.jar classes in my jar. Then i have signed the jar.

              I'am having some problems to post the jnlp fiel due to the xml tags. I have include all-permissions in this file.

              security
              all-permissions
              security


              Thanks in advance and regards. Chema

              • 4. Re: ejb and java web start problem
                didi1976

                Here is an example of our JNLP-Files. We have signed the jbossall-client.jar and put it into an separate JNLP-File. In our case it is an application and not an applet so I do not know if that matters.

                I hope that helps.

                (?xml version="1.0" encoding="utf-8"?)
                (jnlp
                 spec="1.0+"
                 codebase="$$codebase"
                 href="myapp.jnlp")
                 (information)
                 (title)MyApp(/title)
                 (vendor)Softsolution EDV GmbH(/vendor)
                 (homepage href="index.html"/)
                 (description)MyApp(/description)
                 (description kind="short")MyDescription(/description)
                 (icon href="image/soso.gif"/)
                 (icon kind="splash" href="image/splash.jpg"/)
                 (/information)
                 (security)
                 (all-permissions/)
                 (/security)
                 (resources)
                 (j2se version="1.4+" max-heap-size="256M"/)
                 (jar href="lib/myclient.jar" version="1.0"/)
                 (extension href="jbossclient.jnlp"/)
                 (/resources)
                 (application-desc main-class="at.softsolution.scd.MyApp"/)
                (/jnlp)
                


                (?xml version="1.0" encoding="utf-8"?)
                (jnlp
                 spec="1.0+"
                 codebase="$$codebase"
                 href="jbossclient.jnlp")
                 (information)
                 (title)JBoss Client Library(/title)
                 (vendor)JBoss.org(/vendor)
                 (homepage href="index.html"/)
                 (description)JBoss Client Library(/description)
                 (description kind="short")JBoss Client Library(/description)
                 (/information)
                 (security)
                 (all-permissions/)
                 (/security)
                 (resources)
                 (j2se version="1.4+"/)
                 (jar href="lib/jbossall-client.jar" version="3.2.1"/)
                 (jar href="lib/log4j.jar" version="3.2.1"/)
                 (/resources)
                 (component-desc/)
                (/jnlp)
                


                We are using the Servlet which is available from SUN to do version based distribution of the jar-Files. You can omit that if you don't need that part.