glassfish
  1. glassfish
  2. GLASSFISH-16195

Web Services that declare exception cause class load failure with Java Web Start

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1
    • Fix Version/s: 3.1.1_b01
    • Component/s: standalone_client
    • Labels:
      None
    • Environment:

      linux, gf 3.1, java se 6u24

      Description

      I have created a sample project to demonstrate the issue.

      Basically if a web service method declares a throws clause (say that its going to throw a custom exception), the generated web service client code fails to run from java web start.

      Steps to reproduce:
      1) create a simple ee project (ear, ejb, app client).
      2) Create a simple @WebSerbice @Stateless @Webmethod class and deploy
      3) generate the web service client code in the app client project using wsimport from java se 6 (or from glassfish, but that's a whole different problem)
      4) create the main class to call the web service method.
      5) deploy again
      6) javaws http://localhost:8080/Tester-ear-1.0.0-SNAPSHOT/Tester-client-jaxws

      Crash when trying to create port. The project has steps 1-4 already done. It is a maven project. Should be able to just:

      1. mvn clean install
      2. asadmin deploy Tester-ear/target/Tester-ear-1.0.0-SNAPSHOT.ear
      3. javaws http://localhost:8080/Tester-ear-1.0.0-SNAPSHOT/Tester-client-jaxws

      The web service client works fine if you run it run it as an appclient

      1. appclient -client Tester-client-jaxws/target/Tester-client-jaxws-1.0.0-SNAPSHOT.jar

      The web service client works fine if the web service end point doesn't have any methods that declare a throw.

      Note the project also has the JMS client also, you can just ignore that client.

      Let me know if I can be of any further help.

      -Geoff

        Activity

        Hide
        Tim Quinn added a comment -

        Using a very simple example app with a web service (with a method that throws a user exception) and an app client I can reproduce the problem.

        The ACC, when run under Java Web Start, takes steps to make sure that classes and resources provided by the endorsed GlassFish JARs are resolved from those JARs instead of the system JARs. This is particularly important for JAX-WS items because GlassFish usually ships with later versions of those than are in the standard Java SE runtime.

        Unfortunately, the ACC is not doing this correctly and certain classes that should come from GlassFish JARs are instead being loaded from the Java SE system JARs.

        I am testing a fix, but it will take some time to make sure it induces no bad side effects.

        Show
        Tim Quinn added a comment - Using a very simple example app with a web service (with a method that throws a user exception) and an app client I can reproduce the problem. The ACC, when run under Java Web Start, takes steps to make sure that classes and resources provided by the endorsed GlassFish JARs are resolved from those JARs instead of the system JARs. This is particularly important for JAX-WS items because GlassFish usually ships with later versions of those than are in the standard Java SE runtime. Unfortunately, the ACC is not doing this correctly and certain classes that should come from GlassFish JARs are instead being loaded from the Java SE system JARs. I am testing a fix, but it will take some time to make sure it induces no bad side effects.
        Hide
        Tim Quinn added a comment -

        Fix checked in.

        Project: glassfish
        Repository: svn
        Revision: 45806
        Author: tjquinn
        Date: 2011-03-31 07:38:42 UTC
        Link:

        Log Message:
        ------------
        Fix for 16195

        The Java Web Start-aware app client container must make sure that certain classes which are present in both the Java SE installation and in a GlassFish-provided JAR are loaded from the GlassFish JAR. This behavior was not working correctly because the Java Web Start-aware ACC used the MaskingClassLoader from the core/bootstrap module. That implementation did not do what the ACC needs.

        This change uses a fine-tuned masking class loader which works as the ACC needs in this scenario.

        Tests: app client launches via Java Web Start of an app containing a web service method which throws a user exception (the user-provided scenario which triggered the error)

        Revisions:
        ----------
        45806

        Modified Paths:
        ---------------
        trunk/v3/appclient/client/acc/src/main/java/org/glassfish/appclient/client/JWSAppClientContainerMain.java

        Added Paths:
        ------------
        trunk/v3/appclient/client/acc/src/main/java/org/glassfish/appclient/client/JWSACCMaskingClassLoader.java

        Show
        Tim Quinn added a comment - Fix checked in. Project: glassfish Repository: svn Revision: 45806 Author: tjquinn Date: 2011-03-31 07:38:42 UTC Link: Log Message: ------------ Fix for 16195 The Java Web Start-aware app client container must make sure that certain classes which are present in both the Java SE installation and in a GlassFish-provided JAR are loaded from the GlassFish JAR. This behavior was not working correctly because the Java Web Start-aware ACC used the MaskingClassLoader from the core/bootstrap module. That implementation did not do what the ACC needs. This change uses a fine-tuned masking class loader which works as the ACC needs in this scenario. Tests: app client launches via Java Web Start of an app containing a web service method which throws a user exception (the user-provided scenario which triggered the error) Revisions: ---------- 45806 Modified Paths: --------------- trunk/v3/appclient/client/acc/src/main/java/org/glassfish/appclient/client/JWSAppClientContainerMain.java Added Paths: ------------ trunk/v3/appclient/client/acc/src/main/java/org/glassfish/appclient/client/JWSACCMaskingClassLoader.java

          People

          • Assignee:
            Tim Quinn
            Reporter:
            gcruscoe
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: