Viewing job metrics in MCS fails With NoClassDefFoundError

Document created by mufeed Employee on Feb 7, 2016
Version 1Show Document
  • View in full screen mode

Author: Mufeed Usman

 

Original Publication Date: May 7, 2015

 

Environment:

All versions of MapR from 2.x and higher

 

Symptom:

In MCS, trying to view the job metrics throws the following in /opt/mapr/logs/adminuiapp.log:

 

2015-03-03 05:22:42,686 ERROR com.mapr.adminuiapp.controllers.JobManagerController service [1542689802@qtp-1944210063-22]: Throwable caught while trying to process a request

java.lang.NoClassDefFoundError: Could not initialize class com.mapr.adminuiapp.common.HibernateUtil

  at com.mapr.adminuiapp.jobmanagement.hibernate.HibernateJobRepository.getAllJobs(HibernateJobRepository.java:61)

  at com.mapr.adminuiapp.jobmanagement.query.exec.JobQueryProcessor.executeGridQuery(JobQueryProcessor.java:69)

  at com.mapr.adminuiapp.jobmanagement.query.exec.AbstractQueryProcessor.executeQuery(AbstractQueryProcessor.java:20)

  at com.mapr.adminuiapp.controllers.JobManagerController.service(JobManagerController.java:108)

  at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)

  at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)

  at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1221)

  at com.mapr.adminuiapp.common.DefaultHeaders.doFilter(DefaultHeaders.java:32)

Root Cause:

Inadvertently removing the file hibernate.cfg.xml from under /opt/mapr/conf/. Certain class definition parameters are configured in hibernate.cfg.xml and need to be available under /opt/mapr/conf from where the MCS application reads them.

 

Solution:

Issue can be resolved by doing the following.

$ cp /opt/mapr/adminuiapp/webapp/resources/hibernate.cfg.xml /opt/mapr/conf
  • Apply the appropriate values to the following properties.
<property name="connection.url">jdbc:mysql://localhost:3306/metrics</property> 
<property name="connection.username">root</property>
  • Restart the web services.
$ maprcli node services -webserver restart -nodes <node1>,<node2>,...<nodeN>
  • Re-enter the metrics DB credentials in MCS.

Attachments

    Outcomes