AnsweredAssumed Answered

Problem loading users in extension

Question asked by Alberto Ruiz on Mar 8, 2017
Latest reply on Mar 21, 2017 by cf26721


I have developed a RenderingHook B2 and I have found that I get error when trying to load some users using their user Ids from their course memberships.


I've found a thread from Heitor Silva Temp where he faces a related issue but in an application, and the solution applies to the application manifest : Failed to create SimpleApplicationTool due to invalid arguments


Mine has not <application-defs> so I can't try that solution.


The B2 offers a series of endpoints for the ajax calls from the injected javascript using spring mvc. Here is the manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns=""

  <name value="" />
  <handle value="custom-messaging" />
  <description value="b2.description" />
  <default-locale value="en_US" />
  <webapp-type value="javaext" />

  <version value="1.0" />
  <bbversion value="9.1.201410.160373" />

  <id value="elea" />
  <name value="eLearning Media" />
  <url value="" />
  <description value="eLearning Media" />

  <definition namespace="es.elearningmedia">
  <extension id="mensajeriaRenderingHook" point="blackboard.platform.renderingHook"
  singleton="true" />

  <permission type="attribute" name="user.authinfo" actions="get" />
  <permission type="attribute" name="user.personalinfo"
  actions="get,set" />
  <permission type="" name="&lt;&lt;ALL FILES&gt;&gt;"
  actions="read,write,delete,execute" />
  <permission type="socket" name="*" actions="connect,resolve" />

  <permission type="java.lang.RuntimePermission" name="getenv.windir" />

  <permission type="java.util.logging.LoggingPermission"
  name="control" actions="" />

  <permission type="java.lang.RuntimePermission" name="injectRenderingHook" />

  <permission type="java.lang.RuntimePermission" name="setFactory" />

  <permission type="" name="setHostnameVerifier" />

  <permission type="java.lang.reflect.ReflectPermission"
  name="suppressAccessChecks" />
  <permission type="java.lang.RuntimePermission" name="accessDeclaredMembers" />
  <permission type="java.lang.RuntimePermission" name="createClassLoader" />
  <permission type="java.lang.RuntimePermission" name="setContextClassLoader" />
  <permission type="java.lang.RuntimePermission" name="getProtectionDomain" />
  <permission type="" name="${java.home}/lib/*"
  actions="read" />

  <requires-bean-introspection value="true" />



And this is the code that causes the exception to rise:

for(CourseMembership courseStudent:courseStudents) {
  if(courseStudent.getIsAvailable()) {
  String userId = courseStudent.getUserId().getExternalString();
  if(!recipientsCourse.containsKey(userId)) {
  try {
  User user = UserDbLoader.Default.getInstance().loadById(courseStudent.getUserId());
  if(user.getIsAvailable() && userEligible(user)) {
  recipientsCourse.put(userId, user);
  recipientsCoord.put(userId, user);
  } catch (Exception e) {



And this is the relevant part of the exception:

blackboard.persist.KeyNotFoundException: No se ha encontrado el objeto especificado.
at blackboard.persist.impl.NewBaseDbLoader.loadObject(
at blackboard.persist.user.impl.UserDbLoaderImpl.loadById(