Saturday, February 1, 2014

Solr with Websphere Commerce Server 6.0

Solr doesn't run out of the box on Websphere Application Server because does not support Java 5. The minimum version for Running Solar is WAS 6.1.x, cause WAS 6.0 doesn't support Java 5.
There are things needs required modifications for the apache-solr-1.3.0.war or latest solr version on WAS-6. This modifications should work with all versions of the the WAS 6.1 series.

Enabling Java 5 for JSP pages

Cause WAS-6.x is a J2EE 1.4 container, it doesn't support Java 5. We have to explicit enable Java 5 for the JSP compiler. To do this, we've got to create (or modify) 2 files:

  • WEB-INF/ibm-web-bnd.xmi
  • WEB-INF/ibm-web-ext.xmi
in ibm-web-bnd.xmi
<?xml version="1.0" encoding="UTF-8"?>
<webappbnd:WebAppBinding xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:webappbnd="webappbnd.xmi" xmi:id="WebAppBinding_1213147492785" virtualHostName="default_host">
  <webapp href="WEB-INF/web.xml#WebApp_ID"/>
</webappbnd:WebAppBinding>

in ibm-web-bnd.xmi

<?xml version="1.0" encoding="UTF-8"?>
<webappext:WebAppExtension xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:webappext="webappext.xmi" xmi:id="WebAppExtension_1213147492785" reloadInterval="3" reloadingEnabled="true" additionalClassPath="" fileServingEnabled="true" directoryBrowsingEnabled="false" serveServletsByClassnameEnabled="true">
  <webApp href="WEB-INF/web.xml#WebApp_ID"/>
  <jspAttributes xmi:id="JSPAttribute_1" name="jdkSourceLevel" value="15"/>
</webappext:WebAppExtension>

Adding index.jsp to Welcome File List

In the apache-solr-1.3.0.war or latest version, there is now welcome file section. WebSphere doesn't handle index.jsp as auto welcome file, so we've got to modify the web.xml to get a page displayed. Add the 'welcome-file' section add the bottom of the web.xml file.
web.xml.

Enable remote JMX monitoring on WebSphere and register Solr MBeans.

When you try to access Solr on WAS (with <jmx/> config enabled in solrconfig.xml) it fails to register beans (query, facet, etc) and throws"javax.management.InstanceAlreadyExitsException. We need to add following System property to your server (Application servers > server > Process definition > Java Virtual Machine > Custom properties)

javax.management.builder.initial=javax.management.MBeanServerBuilder

Restart the server and now WAS should not throw exception. To confirm that beans have been registered successfully make sure that you have following line in your logs.

org.apache.solr.core.JmxMonitoredMap <init> JMX monitoring is enabled. Adding Solr mbeans to JMX Server:

Once the beans registered we can connect and access Solr configurations and statistics via JMX remotely by adding following System properties to server.

com.sun.management.jmxremote.port="any unused port number"
com.sun.management.jmxremote.authenticate=false
com.sun.management.jmxremote.ssl=false

Restart the server and now we can use tool like JConsole to connect and access Solr configurations and statistics remotely via JMX by specifying the hostname and port.

2 comments:

  1. Websphere commerce server Online Training, http://www.21cssindia.com/courses/webspere-commerce-server-online-training-200.html Websphere commerce server Online Training, Websphere commerce server Training, Websphere commerce server, Websphere commerce server Online Training| Websphere commerce server Training| Websphere commerce server| "Courses at 21st Century Software Solutions
    Talend Online Training -Hyperion Online Training - IBM Unica Online Training - Siteminder Online Training - SharePoint Online Training - Informatica Online Training - SalesForce Online Training - Many more… | Call Us +917386622889 - +919000444287 - contact@21cssindia.com
    Visit: http://www.21cssindia.com/courses.html"

    ReplyDelete
  2. I really appreciate information shared above. It’s of great help. If someone want to learn Online (Virtual) instructor lead live training in APACHE SOLR, kindly contact us http://www.maxmunus.com/contact
    MaxMunus Offer World Class Virtual Instructor led training on APACHE SOLR. We have industry expert trainer. We provide Training Material and Software Support. MaxMunus has successfully conducted 100000+ trainings in India, USA, UK, Australlia, Switzerland, Qatar, Saudi Arabia, Bangladesh, Bahrain and UAE etc.
    For Demo Contact us.
    Saurabh Srivastava
    MaxMunus
    E-mail: saurabh@maxmunus.com
    Skype id: saurabhmaxmunus
    Ph:+91 8553576305 / 080 - 41103383
    http://www.maxmunus.com/


    ReplyDelete