Uploaded image for project: 'JBoss Enterprise Application Platform 4 and 5'
  1. JBoss Enterprise Application Platform 4 and 5
  2. JBPAPP-405

Replace tasks for production config files don't work

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • 4.3.0.GA
    • 4.3.0.BETA3
    • Build
    • None

      It seems we use <replace> ant tasks to modify files in the source tree specific to the soa platform or specific to production config.
      Once the source file has been changed and the replacetoken pattern doesn't match, the entire replace fails.

      For ex: This replace task is no longer valid as the replacetoken pattern in server/src/main/org/jboss/metadata/serviceref/ServiceRefDelegate.java has changed.
      JBPAPP_4_2/build/build.xml

      <target name="patch.for.43" if="build.soa">

      <!-- Fix up the EOL characters for Windows files -->
      <antcall target="fixEOL"/>

      <replace file="../server/src/main/org/jboss/metadata/serviceref/ServiceRefDelegate.java"
      summary="true">

      <replacetoken><![CDATA[
      Kernel kernel = KernelLocator.getKernel();
      if (kernel != null)

      { KernelRegistry registry = kernel.getRegistry(); KernelRegistryEntry entry = registry.getEntry(ServiceRefHandler.BEAN_NAME); delegate = (ServiceRefHandler)entry.getTarget(); }

      else

      { String propName = ServiceRefHandler.class.getName(); String defaultImpl = "org.jboss.ws.core.client.ServiceRefHandlerImpl"; delegate = (ServiceRefHandler)FactoryLoader.loadFactory(propName, defaultImpl); }

      ]]></replacetoken>

      <replacevalue><![CDATA[
      SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
      delegate = spiProvider.getSPI(ServiceRefHandlerFactory.class).getServiceRefHandler();
      ]]></replacevalue>

      </replace>

      <replace file="../server/src/main/org/jboss/metadata/serviceref/ServiceRefDelegate.java"
      summary="true">
      <replacetoken><![CDATA[
      import org.jboss.logging.Logger;
      import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
      import org.jboss.wsf.spi.serviceref.ServiceRefElement;
      import org.jboss.wsf.spi.serviceref.ServiceRefHandler;
      ]]></replacetoken>

      <replacevalue><![CDATA[
      import org.jboss.logging.Logger;
      import org.jboss.wsf.spi.SPIProvider;
      import org.jboss.wsf.spi.SPIProviderResolver;
      import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
      import org.jboss.wsf.spi.serviceref.ServiceRefElement;
      import org.jboss.wsf.spi.serviceref.ServiceRefHandler;
      import org.jboss.wsf.spi.serviceref.ServiceRefHandlerFactory;
      ]]></replacevalue>
      </replace>

      <replace file="..//server/src/main/org/jboss/metadata/serviceref/ServiceRefDelegate.java"
      summary="true">

      <replacetoken><![CDATA[
      import javax.naming.Context;
      import javax.naming.NamingException;
      import javax.xml.soap.FactoryLoader;

      ]]></replacetoken>

      <replacevalue><![CDATA[
      import javax.naming.Context;
      import javax.naming.NamingException;

      ]]></replacevalue>
      </replace>
      </target>

              rhn-engineering-dbhole Deepak Bhole
              rrajasek@redhat.com Rajesh Rajasekaran
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: