Datameer will not start after an installation or upgrade: UnsatisfiedDependencyException

Problem

Attempting to start Datameer for the first time after an upgrade, installation, or server maintenance fails with the following exception.

 

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'b' defined in file [/opt/datameer/Datameer-/webapps/conductor/WEB-INF/classes/datameer/dap/common/license/data/b.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'o' defined in file [/opt/datameer/Datameer-/webapps/conductor/WEB-INF/classes/datameer/dap/common/license/o.class]: Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'v' defined in file [/opt/datameer/Datameer-/webapps/conductor/WEB-INF/classes/datameer/dap/common/license/v.class]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [datameer.dap.common.license.v]: Constructor threw exception; nested exception is java.lang.ExceptionInInitializerError
	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749)
	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:189)
	
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [datameer.dap.common.license.v]: Constructor threw exception; nested exception is java.lang.ExceptionInInitializerError
	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:154)
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:122)
	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:271)
	... 100 more
Caused by: java.lang.ExceptionInInitializerError
	at datameer.dap.conductor.license.DatameerPreferencesStore.getPreferences(DatameerPreferencesStore.java:19)
	at datameer.dap.common.license.v.b(Unknown Source)
	at datameer.dap.common.license.v.(Unknown Source)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:142)
	... 102 more
Caused by: java.lang.IllegalArgumentException: The supplied preference folder need to be a folder.
	at datameer.com.google.common.base.Preconditions.checkArgument(Preconditions.java:122)
	at datameer.dap.common.license.w.(Unknown Source)
	at datameer.dap.common.license.w.(Unknown Source)
	at datameer.dap.conductor.license.DatameerPreferencesStore$PreferencesHolder.(DatameerPreferencesStore.java:26)

 

Cause

 

By default, Datameer stores license related information in a directory named .datameer, under the Datameer service user home folder.  For a service user named datameer, the path would be ~/datameer/.datameer.

If no home folder is available, not created or not set within the /etc/passwd file, Datameer throws the seen UnsatisfiedDependencyException.

 

Solution

 

  • Ensure that home directory for Datameer service user exists.
  • Ensure that Datameer service user has full permissions access to its home folder.
  • Ensure that home folder is assigned to Datameer service user at /etc/passwd file (if the server is not configured in different way).

 

If for some reason the home folder for Datameer's service user can't be created (e.g. as per security constraints), it's possible to override the directory where Datameer stores license related information by specifying the -Duser.home JAVA option, set within the /<Datameer installation folder>/etc/das-env.sh file.

 

Example. Set Datameer's installation folder as the user home.

 

# WARNING: Path variables that may contain blanks should be added to jetty.sh start_das() method (see DAP-6342) 
export JAVA_OPTIONS="-Xmx3072m -Xms256m -XX:MaxNewSize=448m -XX:SurvivorRatio=6 -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=80 -XX:+HeapDumpOnOutOfMemoryError -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled"
export JAVA_OPTIONS="$JAVA_OPTIONS -Dfile.encoding=utf-8 -Duser.home=/opt/datameer/Datameer-7.2.6-cdh-5.15.1"

 

Note: A Datameer restart is required for a change to the das-env.sh to take effect.