1 2 Previous Next 19 Replies Latest reply on May 25, 2009 5:53 PM by Andrew Rubinger

    Upgrading jboss-bootstrap and WS

    Andrew Rubinger Master

      While upgrading jboss-bootstrap in AS to the new implementation, I've hit:

      Caused by: java.lang.NullPointerException
       at org.jboss.wsf.stack.jbws.WSDLFilePublisher.getPublishLocation(WSDLFilePublisher.java:338)
       at org.jboss.wsf.stack.jbws.WSDLFilePublisher.publishWsdlFiles(WSDLFilePublisher.java:103)
       at org.jboss.wsf.stack.jbws.PublishContractDeploymentAspect.start(PublishContractDeploymentAspect.java:50)
       at org.jboss.wsf.framework.deployment.DeploymentAspectManagerImpl.deploy(DeploymentAspectManagerImpl.java:129)
       at org.jboss.wsf.container.jboss50.deployer.ArchiveDeployerHook.deploy(ArchiveDeployerHook.java:76)


      Where WSDLFilePublisher@338:

      locationFile = new File(serverConfig.getServerDataDir().getCanonicalPath() + "/wsdl/" + archiveName);


      The "serverConfig" in place here is a org.jboss.wsf.spi.management.ServerConfig, which I'll need to retool to match up with:

      http://anonsvn.jboss.org/repos/jbossas/projects/bootstrap/trunk/spi-as/src/main/java/org/jboss/bootstrap/spi/as/config/JBossASServerConfig.java

      So the steps we need to take are:

      1) Identify the right version of WS subprojects to alter
      2) Make the changes
      3) Cut interim internal releases (ie. some *"-alpha-1")
      4) Bring the interim releases into AS component-matrix/pom.xml in my bootstrap upgrade branch[1].
      5) After we merge into AS Branch_5_x, cut new WS releases @ proper level (GA implicit).

      I'm happy to make the changes required, but given the extensive nature of the WS projects would like some assistance:

      1) Identifying where the changes should go
      2) Running the appropriate WS TestSuites

      Thanks. :)

      S,
      ALR

      [1] - http://anonsvn.jboss.org/repos/jbossas/branches/Branch_5_x_BootstrapLegacyRemoval/

        • 1. Re: Upgrading jboss-bootstrap and WS
          Alessio Soldano Master

          Hi Andrew,
          from component-matrix/pom.xml in Branch_5_x you get the tagged versions currently being used:

          <version.jboss.jbossws-common>1.1.0.GA</version.jboss.jbossws-common>
           <version.jboss.jbossws-framework>3.1.2.SP1</version.jboss.jbossws-framework>
           <version.jboss.jbossws-spi>1.1.2.GA</version.jboss.jbossws-spi>
           <version.jboss.jbossws>3.1.2.GA</version.jboss.jbossws>
          


          The repository for the subprojects are:

          https://svn.jboss.org/repos/jbossws/common
          https://svn.jboss.org/repos/jbossws/framework
          https://svn.jboss.org/repos/jbossws/spi
          https://svn.jboss.org/repos/jbossws/stack/native

          We did not expect to have further releases going to Branch_5_x before AS 5.1.0.GA release and the trunk of all these is meant to be for next JBossWS 3.2.0 which is going to have "major" changes. So we might want to recreate branches from the tags and release from there. Let me know which subproject you need to change and I'll do that.
          Regarding the testsuite, please read here: http://jbossws.jboss.org/mediawiki/index.php?title=Running_The_Test_Suites (Maven+Ant build)
          Basically, once you set up the profiles.xml and deploy your modified stack, it should be a matter of running:
          mvn -Ptestsuite,jboss510 test


          • 2. Re: Upgrading jboss-bootstrap and WS
            Andrew Rubinger Master

            OK, looks like the changes I need to make are to:

            org.jboss.wsf.common.management.AbstractServerConfig

            ie:

            public File getServerDataDir()
             {
             try
             {
             ObjectName oname = ObjectNameFactory.create("jboss.system:type=ServerConfig");
             File dir = (File)getMbeanServer().getAttribute(oname, "ServerDataDir");
             return dir;
             }
             catch (JMException e)
             {
             return null;
             }
             }


            ...where the ObjectNames and return types need to match the new bootstrap SPI.

            Would you mind creating a new branch for this project for me?

            S,
            ALR

            • 3. Re: Upgrading jboss-bootstrap and WS
              Andrew Rubinger Master

              And what's up with this?

              catch (JMException e)
               {
               return null;
               }


              My patches here instead will wrap the exception in an unchecked on and propagate up the chain. This null passing leads to my undescriptive NPEs below.

              S,
              ALR

              • 4. Re: Upgrading jboss-bootstrap and WS
                Andrew Rubinger Master

                And my (untested) patch looks like:

                Index: src/main/java/org/jboss/wsf/common/management/AbstractServerConfig.java
                ===================================================================
                --- src/main/java/org/jboss/wsf/common/management/AbstractServerConfig.java (revision 10049)
                +++ src/main/java/org/jboss/wsf/common/management/AbstractServerConfig.java (working copy)
                @@ -23,6 +23,8 @@
                
                 import java.io.File;
                 import java.net.InetAddress;
                +import java.net.URISyntaxException;
                +import java.net.URL;
                 import java.net.UnknownHostException;
                 import java.util.Set;
                
                @@ -45,6 +47,12 @@
                 public abstract class AbstractServerConfig implements AbstractServerConfigMBean, ServerConfig
                 {
                 private static final Logger log = Logger.getLogger(AbstractServerConfig.class);
                +
                + protected static final ObjectName OBJECT_NAME_SERVER_CONFIG;
                + static
                + {
                + OBJECT_NAME_SERVER_CONFIG = ObjectNameFactory.create("jboss.system:type=ServerConfig");
                + }
                
                 // The MBeanServer
                 private MBeanServer mbeanServer;
                @@ -110,44 +118,56 @@
                
                 public File getServerTempDir()
                 {
                - try
                - {
                - ObjectName oname = ObjectNameFactory.create("jboss.system:type=ServerConfig");
                - File dir = (File)getMbeanServer().getAttribute(oname, "ServerTempDir");
                - return dir;
                - }
                - catch (JMException e)
                - {
                - return null;
                - }
                + return this.getDirFromServerConfig("ServerTempLocation");
                 }
                
                 public File getHomeDir()
                 {
                + return this.getDirFromServerConfig("JBossHome");
                + }
                +
                + public File getServerDataDir()
                + {
                + return this.getDirFromServerConfig("ServerDataLocation");
                + }
                +
                + /**
                + * Obtains the specified attribute from the server configuration,
                + * represented as a {@link File}.
                + *
                + * @param attributeName
                + * @return
                + * @author ALR
                + */
                + protected File getDirFromServerConfig(final String attributeName)
                + {
                + // Define the ON to invoke upon
                + final ObjectName on = OBJECT_NAME_SERVER_CONFIG;
                +
                + // Get the URL location
                + URL location = null;
                 try
                 {
                - ObjectName oname = ObjectNameFactory.create("jboss.system:type=ServerConfig");
                - File dir = (File)getMbeanServer().getAttribute(oname, "HomeDir");
                - return dir;
                + location = (URL) getMbeanServer().getAttribute(on, attributeName);
                 }
                - catch (JMException e)
                + catch (final JMException e)
                 {
                - return null;
                + throw new RuntimeException("Could not obtain attribute " + attributeName + " from " + on, e);
                 }
                - }
                
                - public File getServerDataDir()
                - {
                + // Represent as a File
                + File dir = null;
                 try
                 {
                - ObjectName oname = ObjectNameFactory.create("jboss.system:type=ServerConfig");
                - File dir = (File)getMbeanServer().getAttribute(oname, "ServerDataDir");
                - return dir;
                + dir = new File(location.toURI());
                 }
                - catch (JMException e)
                + catch (final URISyntaxException urise)
                 {
                - return null;
                + throw new RuntimeException("Could not desired directory from URL: " + location, urise);
                 }
                +
                + // Return
                + return dir;
                 }
                
                 public int getWebServicePort()


                S,
                ALR

                • 5. Re: Upgrading jboss-bootstrap and WS
                  Andrew Rubinger Master

                  I'll just keep writing replies here. ;)

                  Another thing that occurs to me: instead of invoking over the JMX bus to get some freeform String attribute, maybe instead we should grab the jboss-bootstrap-spi-as JBossASServerConfig from the ObjectName, then perform typesafe operations upon it. Like:

                  JBossASServerConfig config = mbeanServer.get(ObjectName);
                  URL jbossHome = config.getJBossHome();


                  ...but I'll leave that impl detail up to you guys.

                  S,
                  ALR

                  • 7. Re: Upgrading jboss-bootstrap and WS
                    Andrew Rubinger Master

                    Thanks for the branches.

                    But adding my patch to "branches/jbossws-common-1.1.0 " gets us compile errors in AS when we integrate back in:

                    [javac] Compiling 48 source files to /home/alrubinger/business/jboss/wc/jbossas/branches/Branch_5_x_BootstrapLegacyRemoval/webservices/output/classes
                    /home/alrubinger/business/jboss/wc/jbossas/branches/Branch_5_x_BootstrapLegacyRemoval/webservices/src/main/org/jboss/wsf/container/jboss50/invocation/InvocationHandlerJSE.java:29: package org.jboss.wsf.common.javax does not exist
                    import org.jboss.wsf.common.javax.JavaxAnnotationHelper;
                     ^
                    /home/alrubinger/business/jboss/wc/jbossas/branches/Branch_5_x_BootstrapLegacyRemoval/webservices/src/main/org/jboss/wsf/container/jboss50/invocation/InvocationHandlerJSE.java:30: package org.jboss.wsf.common.javax does not exist
                    import org.jboss.wsf.common.javax.PreDestroyHolder;
                     ^
                    /home/alrubinger/business/jboss/wc/jbossas/branches/Branch_5_x_BootstrapLegacyRemoval/webservices/src/main/org/jboss/wsf/container/jboss50/deployment/metadata/EJBArchiveMetaDataAdapterEJB21.java:141: warning: [deprecation] determineJndiName() in org.jboss.metadata.ejb.jboss.JBossSessionBeanMetaData has been deprecated
                     targetBean.setJndiName(jbossSessionBean.determineJndiName());
                     ^
                    /home/alrubinger/business/jboss/wc/jbossas/branches/Branch_5_x_BootstrapLegacyRemoval/webservices/src/main/org/jboss/wsf/container/jboss50/deployment/metadata/EJBArchiveMetaDataAdapterEJB21.java:142: warning: [deprecation] determineLocalJndiName() in org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData has been deprecated
                     targetBean.setLocalJndiName(jbossBeansMetaData.determineLocalJndiName());
                     ^
                    /home/alrubinger/business/jboss/wc/jbossas/branches/Branch_5_x_BootstrapLegacyRemoval/webservices/src/main/org/jboss/wsf/container/jboss50/invocation/InvocationHandlerJSE.java:85: cannot find symbol
                    symbol : variable JavaxAnnotationHelper
                    location: class org.jboss.wsf.container.jboss50.invocation.InvocationHandlerJSE
                     JavaxAnnotationHelper.injectResources(targetBean, ep.getAttachment(InjectionsMetaData.class));
                     ^
                    /home/alrubinger/business/jboss/wc/jbossas/branches/Branch_5_x_BootstrapLegacyRemoval/webservices/src/main/org/jboss/wsf/container/jboss50/invocation/InvocationHandlerJSE.java:86: cannot find symbol
                    symbol : variable JavaxAnnotationHelper
                    location: class org.jboss.wsf.container.jboss50.invocation.InvocationHandlerJSE
                     JavaxAnnotationHelper.callPostConstructMethod(targetBean);
                     ^
                    /home/alrubinger/business/jboss/wc/jbossas/branches/Branch_5_x_BootstrapLegacyRemoval/webservices/src/main/org/jboss/wsf/container/jboss50/invocation/InvocationHandlerJSE.java:87: cannot find symbol
                    symbol : class PreDestroyHolder
                    location: class org.jboss.wsf.container.jboss50.invocation.InvocationHandlerJSE
                     ep.addAttachment(PreDestroyHolder.class, new PreDestroyHolder(targetBean));
                     ^
                    /home/alrubinger/business/jboss/wc/jbossas/branches/Branch_5_x_BootstrapLegacyRemoval/webservices/src/main/org/jboss/wsf/container/jboss50/invocation/InvocationHandlerJSE.java:87: cannot find symbol
                    symbol : class PreDestroyHolder
                    location: class org.jboss.wsf.container.jboss50.invocation.InvocationHandlerJSE
                     ep.addAttachment(PreDestroyHolder.class, new PreDestroyHolder(targetBean));


                    S,
                    ALR



                    • 8. Re: Upgrading jboss-bootstrap and WS
                      Andrew Rubinger Master

                      ...probably because of stuff added/changed inbetween 1.0.11.CR2 and 1.1.0...

                      [alrubinger@localhost Branch_5_x_BootstrapLegacyRemoval]$ svn di component-matrix/pom.xml
                      Index: component-matrix/pom.xml
                      ===================================================================
                      --- component-matrix/pom.xml (revision 88920)
                      +++ component-matrix/pom.xml (working copy)
                      @@ -33,7 +33,7 @@
                       <version.javax.faces>1.2_12</version.javax.faces>
                       <version.jboss.jaxr>1.2.1.GA</version.jboss.jaxr>
                       <version.jboss.jbossts>4.6.1.GA</version.jboss.jbossts>
                      - <version.jboss.jbossws-common>1.0.11.CR2</version.jboss.jbossws-common>
                      + <version.jboss.jbossws-common>1.1.0-SNAPSHOT</version.jboss.jbossws-common>
                       <version.jboss.jbossws-framework>3.1.2.CR2</version.jboss.jbossws-framework>
                       <version.jboss.jbossws-spi>1.1.2.CR2</version.jboss.jbossws-spi>
                       <version.jboss.jbossws>3.1.2.CR1</version.jboss.jbossws>


                      S,
                      ALR

                      • 9. Re: Upgrading jboss-bootstrap and WS
                        Alessio Soldano Master

                        That class has been refactored to other ones by Richard before 1.1.0.GA release. I suspect something's wrong with the dependencies; did you try cleaning thirdparty? I'd also svn up AS Branch_5_x before using the new snapshots, which are taken from the latest release.

                        • 10. Re: Upgrading jboss-bootstrap and WS
                          Andrew Rubinger Master

                          Yup, I nuked 3rdparty.

                          Hmm...haven't resynced my AS branch w/ Branch_5_x. Will look into that.

                          S,
                          ALR

                          • 11. Re: Upgrading jboss-bootstrap and WS
                            Andrew Rubinger Master

                            After resyncing my branch w/ the recent updates to Branch_5_x, I get:

                            [junit] Running org.jboss.test.webservice.jbws309.JBWS309TestCase
                             [junit] Tests run: 5, Failures: 0, Errors: 0, Time elapsed: 7.019 sec


                            So I committed r10067 for JBWS-2652 and have deployed a new SNAPSHOT containing my patch to:

                            https://snapshots.jboss.org/maven2/org/jboss/ws/jbossws-common/1.1.0-SNAPSHOT/jbossws-common-1.1.0-20090519.183219-3.jar

                            After confirming I've got nothing else to do (full AS TestSuite run on my Hudson), I might ask for a new release from the new branches/jbossws-common-1.1.0.

                            S
                            ALR



                            • 12. Re: Upgrading jboss-bootstrap and WS
                              Andrew Rubinger Master

                              Neat:

                              http://jboss.hudson.alrubinger.com/job/AS_TestSuite_Branch_5_x_BootstrapLegacyRemoval/6/testReport/

                              All the *ws failures are gone. 18 remaining, of which 9 were present before.

                              May we please have a jbossws-common-1.1.1-alpha-1 ?

                              I say 1.1.1-alpha-1 because I don't want to go to 1.1.0.CRx, only to find that we need to make more changes later and there's some officially-named release out there. So some internal release which can be promoted to GA or CR level would be nice first. But again, that kind of decision is for y'all.

                              S,
                              ALR

                              • 13. Re: Upgrading jboss-bootstrap and WS
                                Alessio Soldano Master

                                Hi Andrew,
                                we should expect failures running tests against Branch_5_x (not your branch) and the other AS tags/branches after installing the new snapshot, right? Asking as I see some failures here http://jbossws.jboss.org:8180/hudson/ ... Currently re-running to be sure of the failures, then I'll take a look more in details. Generally speaking we should come to something allowing us to run on all supported target container, but let's see the results first.

                                • 14. Re: Upgrading jboss-bootstrap and WS
                                  Andrew Rubinger Master

                                  Yep, these failures are expected:

                                  http://jbossws.jboss.org:8180/hudson/job/AS-Tests-AS-5.1.0/4/testReport/

                                  "alessio.soldano@jboss.com" wrote:
                                  Generally speaking we should come to something allowing us to run on all supported target container, but let's see the results first.


                                  That would depend upon a backwards-compatible new jboss-metadata implementation, and this is not; I intentionally changed APIs to strip out stuff we don't want in there and make the method names more uniform. So until jboss-metadata is updated in Branch_5_x, those will continue to fail. But that doesn't mean we need to switch jbossws-common in AS all at once.

                                  S,
                                  ALR

                                  1 2 Previous Next