Deprecated featureWebSphere Commerce Developer

Moving the WebSphere Commerce search EAR to a new application server profile

In your WebSphere Commerce development environment, you can separate your WebSphere Commerce search enterprise archive (EAR) to a different application server than your WebSphere Commerce EAR. If you want to separate your WebSphere Commerce store web archive (WAR) from the WebSphere Commerce EAR in your development environment, you must first move the WebSphere Commerce search EAR to a different application server.

When you separate your store WAR from the WebSphere Commerce EAR to be a new store EAR, you use shared libraries to handle files between the enterprise archives. When you use the shared library solution in your development environment, the search properties files and WebSphere Commerce properties files conflict. The WebSphere Commerce search EAR and WebSphere Commerce EAR cannot share the custom class loader that loads the shared library. You must create a WebSphere Application Server profile for the WebSphere Commerce search server and deploy the WebSphere Commerce search EAR to the new search server.

Before you begin

Ensure that you complete the following task:
  • Run the setdbtype utility to switch your development environment database from the provided Derby database.

    For example, you can switch your database to be a DB2 or Oracle database. In your development environment, the provided Derby database supports only one connection. If the WebSphere Commerce EAR and WebSphere Commerce search EAR are deployed to different application server profiles, the archives must still access the same database. To ensure that the archives can access the database, you must switch your development environment database to a database that supports multiple connections.

Procedure

  1. Create a WebSphere Application Server profile for the WebSphere Commerce search EAR.
    1. Open WebSphere Commerce Developer and switch to the Servers view.
    2. Expand WebSphere Commerce Test Server and right-click Search. Select New > Server. The New Server window opens.
    3. In the Define a New Server settings of the New Server window, choose the WebSphere Application Server type for your development environment. Click Next.

      New Server window

    4. In the WebSphere Application Server Settings options, click Configure profiles.
    5. In the Preferences settings, click Run Profile Management Tool. The Profile Management Tool window opens.
    6. In the Profile Management Tool window, click Launch Profile Management Tool.
    7. In the Launch Profile Management Tool window, click Create.
    8. In the Environment Selection settings, expand WebSphere Application Server and select Application server. Click Next.
    9. In the Profile Creation Options settings, select Typical profile creation. Click Next.
    10. In the Administrative Security settings, ensure that Enable administrative security is not selected to disable the login security. Click Next.
    11. Review the Profile Creation Summary. Record the ports information for the server profile and the profile name. Click Create > Finish. Your new server profile creates. For this task, the name AppSrv01 is used as an example profile name.
    12. Close the Profile Management Tool window.
    13. In the Preferences window, select your new search profile. Click OK. Your new profile now displays in the Profile name list for the WebSphere Application Server Settings options in the New Server window.
  2. Add the WebSphere Commerce search projects to your new WebSphere Application Server profile.
    1. In the WebSphere Application Server Settings options in the New Server window, select your new server profile from the Profile name list. Click Next.
    2. In the Add and Remove settings, select Search from the list of Available resources. Click Add.

      New Server Add and Remove window

    3. Click Finish. The search projects are added to the new WebSphere Application Server profile.
  3. Remove the WebSphere Commerce search projects from your WebSphere Commerce Test Server profile.
    1. In the Servers view for WebSphere Commerce Developer, Expand WebSphere Commerce Test Server.
    2. Right-click Search. Click Remove > OK.
  4. Configure the WebSphere Commerce search server
    1. Switch to the Enterprise Explorer view. Right-click the WebSphere Commerce EAR project, WC. Select Java EE > Open WebSphere Application Server Deployment.
    2. In the WebSphere Application Server Deployment tab, record the following information for the WebSphere Commerce EAR project
      • The information in the Data Sources section for EAR project. This information includes the JDBC provider, the data source that is defined in the JDBC provider, and the resource properties that are defined in the data source.
      • The JAAS authentication information in the Authentication section.
      • The variables that are defined in the Substitution Variables section.
    3. Right-click the WebSphere Commerce search EAR project, Search. Select Java EE > Open WebSphere Application Server Deployment.
    4. In the WebSphere Application Server Deployment, add the information for the WebSphere Commerce search EAR project. Use the values that you recorded for the WebSphere Commerce EAR project. Save the configuration.

      WebSphere Application Server Deployment settings

  5. Publish the applications.
    1. In the Servers view, start the WebSphere Commerce search server and the WebSphere Commerce Test Server.
    2. Right-click each server and click Publish to synchronize the configuration modification for the servers.
  6. Update the name space bindings for the WebSphere Commerce search server.
    1. In the Servers view, right-click the WebSphere Commerce search server and select Administration > Run administrative console. The WebSphere Application Server administration console opens.
    2. Expand Environment > Naming. Click Name space bindings.
    3. Click New. Select String for the Binding type and click Next.
    4. In the Specify basic properties settings, enter an identifier, relative name, and string value to configure a name space binding for the host name.
    5. Click Next. Review the summary of your new name space binding and click Finish.
    6. Repeat this step to create a name space binding for the data source.
    Use the information for the WebSphere Commerce Test Server to help you create these bindings. You can view the information in the WebSphere Application Server administration console for the WebSphere Commerce Test Server. For example, if your database is a DB2 database, your name space bindings can use the following information.
    Binding setting Host name binding Data source binding
    Binding type String String
    Binding identifier com.ibm.commerce.foundation.server.services.commerce.hostname com.ibm.commerce.foundation.server.services.search.datasource
    Name in name space relative to looup name prefix com.ibm.commerce.foundation.server.services.commerce.hostname com.ibm.commerce.foundation.server.services.search.datasource
    String value localhost jdbc/WebSphere Commerce DB2 DataSource demo
  7. Change the custom properties for the WebSphere Commerce search server JVM.
    1. In the WebSphere Application Server administrative console for the WebSphere Commerce search server, expand Servers > Server Types. Click WebSphere application servers. In the list of application servers, select your server.
    2. On the Configuration tab, expand Java and Process Management and click Process definition > Java Virtual Machine > custom properties.
    3. Click New. On the Configuration tab, enter the Name and Value for the WebSphere Commerce search home path.
      For example, set solr.solr.home as the name. The value for your home path can be WCDE_installdir/search/solr/home.

      Application server custom properties

    4. Feature Pack 8Click New. On the Configuration tab, enter the following name and value to enable the SolrResourceLoader to load files from an external server.
      Name Value
      solr.allow.unsafe.resourceloading true
      By default, the resource loader does not load files from an external server for security reasons.
    5. Click Apply > Save directly to the master configuration.
  8. Add the Virtual hosts for the WebSphere Commerce search server.
    1. In the WebSphere Application Server administrative console for the WebSphere Commerce search server, expand Environment and click Virtual hosts.
    2. Click New. On the Configurations tab, enter WC_default_host as the Name for the virtual host.
    3. Click Apply > Host Aliases > New. On the Configurations tab, enter the Host Name and Port for the virtual host. Enter the value for the port that the new WebSphere Commerce search server uses.
    4. Click Apply > Save directly to the master configuration.
    5. Expand Applications > Application Types. Click WebSphere enterprise applications > Search > Virtual hosts.
    6. In the list of virtual hosts, expand Apply Multiple Mappings. Change the value for the virtual host to be WC_default_host and select each web module. Click Apply.

      Search application virtual host mappings

  9. Configure the WebSphere Commerce search server JNDI binding.
    1. In the Servers view, restart the WebSphere Commerce search server and the WebSphere Commerce Test Server.
    2. Right-click the WebSphere Commerce Test Server and select Administration > Run administrative console.
    3. Expand Environment > Naming. Click Name space bindings.
    4. Configure the name space bindings for the search-related bindings to use the information for the new WebSphere Commerce search server. To configure a name space binding, click the binding name to open the Configuration tab for the binding. Change the configuration values to match the information for the WebSphere Commerce search server and click Apply > Save directly to the master configuration.
      Update the following name space bindings:
      • com.ibm.commerce.foundation.server.services.search.port

        The HTTP port of the new WebSphere Commerce search server.

      • com.ibm.commerce.foundation.server.services.search.preview.port
      • com.ibm.commerce.foundation.server.services.search.url

        The path of the new WebSphere Commerce search server. Change the value for the port to be the new port that is used, the default HTTP port of the search server.

  10. Review the contents of your SRCHCONFEXT and SRCHCONF database tables.
    Ensure that the data in the CONFIG column of the tables matches the values for the WebSphere Commerce search server host name and server port. If the values do not match, update the value in the database table column to use the correct value.
  11. Publish the configuration changes.
    1. In the Servers view, start the WebSphere Commerce search server and restart the WebSphere Commerce Test Server.
    2. Right-click each server and click Publish to synchronize the configuration changes.

What to do next

You can separate the store web archive (WAR) in your development environment from the WebSphere Commerce EAR to create a new store EAR. For more information, see Enabling store separation in a development environment.