Skip to end of metadata
Go to start of metadata

About

This post describe how to install and configure Apache Solr 4 under IBM WebSphere Application Server v8.

 

Resume about Solr's Installation in WebSphere Application Server v8

Apache Solr's installation in WebSphere is somewhat complicated and full of hacks, there are a lot of JAR's that are used but which already exist in WebSphere with a different versions and cause conflicts in several methods and classes, so it is necessary to modify the WAR and finally an EAR will be generated and is going to be deployed into WAS.

For these hacks we will need:

For more information about Apache Solr, please visit the next links:

Download and first hack

Solr package link

 

  1. Unzip the file and open it with WinRar ${solar unzipped}/dist/solr-4.3.1.war 

  2. Copy all the JAR's file from ${solar unzipped}/dist into the folder WEB-INF/lib that you have opened in WinRar

  3. Copy from ${solar unzipped}/dist/solrj-lib into WEB-INF/lib that you have opened in WinRar following files: 
    • slf4j-ap1-1.6.6.jar
    • slf4j-log4j12-1.6.6.jar
    • jcl-over-slf4j-1.6.6.jar
    • jul-to-slf4j-1.6.6.jar.jar
    • log4j-1.2.16.jar




  4. Rename the file solr-4.3.1.war to solr.war 

Building an EAR file

 

  1. Open IBM Rational and create a new project



  2. Select Dynamic Web Project



  3. Project Name "solr", Target Runtime WebSphere Portal v7.0, Dynamic web module 2.5, Default Configuration for WebSphere Portal v7.0 and check AddProject to an EAR



  4. Click Finish
  5. Under Enterprise Explorer view right click in solrEAR->JavaEE->Open WebSphere Application Server Deployment



  6. In the section Application, select Classloader mode: "PARENT_LAST", WAR classloader policy: "APPLICATION", save the changes



  7. Under Enterprise Explorer view, right click in solrEAR->Export->EAR File



  8. Uncheck Optimize for a specific server runtime option, select a destination directory and click Finish

  9. Open with WinRar solr.war file that we modified in the previous hack, navigate to WEB-INF folder.

  10. Browse to the Solr Rational project directory that you created in the step 3, in my case the path is c:\workspace\solr\, inside solr project copy the files ibm-web-bnd.xml y ibm-web-ext.xml that are in the folder \WebContent\WEB-INF  into the solr.war you have opened in the previous step




  11. Browse to the solrEAR.ear file generated in the step 7 and open it with WinRar



  12. Delete the current solr.war file and copy the solr.war that you previously modified, steps 1-4, into the EAR

Setup Solr work directory

 

  1. Open WebSphere administration console and navigate to Server->Server Types-> WebSphere application servers

  2. Select your instance of WebSphere Portal-> Java and Process Management



  3. Select Java Virtual Machine-> Custom properties

  4. Click into New button
  5. Fill the fields with Name: solr.solr.home, value c:\solr, that is my case, you can select another one if you wish

  6. Click Ok and save to the master configuration
  7. Bounce your WebSphere Portal instance to pick up the changes
  8. Copy the content of the directory ${solar unzipped}/examples/solr into the new folder you defined in the step 5

Solr Deployment

  1. Open WebSphere Administration Console
  2. Go to Applications->Application Types-> WebSphere enterprise applications



  3. Click in install, and select the file solrEAR.ear, that you created in the previous section and click next



  4. Select Fast Path
  5. On the installation options view in WAS, under File Permissions, select all three options
    1. Allow all files to be read but not written to
    2. Allow executables to execute 
    3. Allow HTML and image files to be read by everyone 


  6. Select the Cell and nodes, check the checkbox and click in the apply button
  7. Next, Next, Finish, save
  8. Look for the application in list and check the check box and click in the start button


  9. In a web browser go to http://yourdomain:port/solr



About the author

Marco Balderas

Marco is a skilled web developer that provides consultancy, solution design and PM techniques - most specifically for J2EE Web content and portals. He has had experience with over five years in Web, desktop and mobile development. Lately, he has been responsible for provide and develop Web content solutions that require the use of his experience, knowledge and his very good understanding of technology trend. Has part of his assignments in all his work history Marco use to understand and solve clients day to day issues, feed back on project time line, also to establish change agreements, define and re-define scope. His industry exposure includes: oil, financial services, stock management, education, and retail.