3 Replies Latest reply on Apr 17, 2013 3:08 PM by Nicklas Karlsson

    Determining WebService port at runtime

    Greg Jewell Apprentice

      Hello,

       

      I am attempting to update an application that ran in JBoss AS 6.1 to 7.1.1.  In this application, the web service port is discovered programmatically.  In JBoss 6, the following code achieved the desired result:

       

      int port = SPIProviderResolver.getInstance().getProvider().getSPI(ServerConfigFactory.class).getServerConfig().getWebServicePort();

       

      However, running this code in JBoss 7.1.1 yields the following exception:

       

      org.jboss.wsf.spi.WSFException: Failed to provide SPI:class org.jboss.wsf.spi.management.ServerConfigFactory

          at org.jboss.ws.common.spi.DefaultSPIProvider.getSPI(DefaultSPIProvider.java:102) [jbossws-common-2.0.2.GA.jar:2.0.2.GA]

          at org.jboss.wsf.spi.SPIProvider.getSPI(SPIProvider.java:41) [jbossws-spi-2.0.3.GA.jar:2.0.3.GA]

       

      I have added the following dependencies to the manifest of the jar containing this code:

      org.jboss.ws.common, org.jboss.ws.spi

       

      Is there a different way to acquire this information in AS 7.1.1?

       

       

      Thanks for any help!

      Greg Jewell