docs: protected synchronized Servlet loadServlet() throws Exception {
          // end 280649 SERVICE: clean up separation of core and shell
          // WASCC.web.webcontainer : reuse with other ServletWrapper impls.
          if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE)) // 306998.15
              logger.entering(CLASS_NAME, "loadServlet, className-->[" + servletConfig.getClassName() + "], servletName["
                      + servletConfig.getServletName() + "]"); // 569469
          // logger.logp(Level.FINE, CLASS_NAME,"loadServlet",
          // "entry className-->["+servletConfig.getClassName()+"], servletName["+servletConfig.getServletName()+"]");
          if (target != null) {
  			if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE))  
  					logger.exiting(CLASS_NAME,"loadServlet, Found target for className-->["+servletConfig.getClassName()+"], servletName["+servletConfig.getServletName()+"]"); //PM01373
              return target;
          }
  
          Servlet servlet = servletConfig.getServlet();
          if (servlet != null) {
          	target = servlet;
              return target;
          }
  
          // load the servlet
          final Class<? extends Servlet> servletClass = servletConfig.getServletClass();
          final String className = servletConfig.getClassName();
          final String servletName = servletConfig.getServletName();
  
          if (className == null) {
              logger.logp(Level.WARNING, CLASS_NAME, "run", "servlet.classname.is.null", new Object []{servletName});
              return null;
          }
          
          ClassLoader origClassLoader = null;
  
          Object token = ThreadIdentityManager.runAsServer();
          try {
  
              origClassLoader = ThreadContextHelper.getContextClassLoader();
  
              final ClassLoader loader;
              if (targetLoader == null) {
                  loader = context.getClassLoader();
                  setTargetClassLoader(loader);
              } else {
                  loader = targetLoader;
              }
  
              if (loader != origClassLoader) {
                  ThreadContextHelper.setClassLoader(loader);
              } else {
                  origClassLoader = null;
              }
  
              AccessController.doPrivileged(new PrivilegedExceptionAction() {
                  public Object run() throws ServletException {
                      try {
                          Servlet s = null;
                         
                              if (className.equals("com.ibm.ws.webcontainer.servlet.SimpleFileServlet")) {
                                  s = context.getSimpleFileServlet();
                                  createTarget(s);
                              } else if (className.equals("com.ibm.ws.webcontainer.servlet.DirectoryBrowsingServlet")) {
                                  s = context.getDirectoryBrowsingServlet();
                                  createTarget(s);
                              } else if (servletClass != null) {
                                  if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE)) { // 306998.15
                                      logger.logp(Level.FINE, CLASS_NAME, "loadServlet:run", "Use CDI to create servlet from servletClass:" + servletClass);
                                  }
                                  createTarget(servletClass);
                              } else {
                                  // If a serialized version of the servlet exists create a new object from it by using Beans.instantiate.
                                  // otherwise use a ManagedObject factory to create it for cdi 1.2 support.
                                  String serializedName = className.replace('.','/').concat(".ser");
                                  // Try to find a serialized object with this name
                                  if (loader.getResourceAsStream(serializedName)!=null) {
                                      if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE)) { // 306998.15
                                          logger.logp(Level.FINE, CLASS_NAME, "loadServlet:run", "A serialized object exists. Create an instance of it : " + serializedName);
                                      }
                                      s = (javax.servlet.Servlet) Beans.instantiate(loader, className);
                                      createTarget(s);
                                  } else {
                                      if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE)) { // 306998.15
                                          logger.logp(Level.FINE, CLASS_NAME, "loadServlet:run", "use CDI to create servlet from className:" + className);
                                      }
                                      Class<?> sclass = loader.loadClass(className);
                                      createTarget(sclass);  
                                  }    
                              }
                      } catch (ClassNotFoundException e) {
                          com.ibm.wsspi.webcontainer.util.FFDCWrapper.processException(e,
                                  "com.ibm.ws.webcontainer.servlet.ServletWrapper.loadServlet", "208", this);
                          // log the error
                          logger.logp(Level.SEVERE, CLASS_NAME, "run", "classnotfoundexception.loading.servlet.class", e);
                          throw new UnavailableException(MessageFormat.format(nls.getString("Servlet.Could.not.find.required.servlet.class",
                                  "Servlet [{0}]: Could not find required servlet - {1}"), new Object[] { className, e.getMessage() }));
                      } catch (ClassCastException e) {
                          com.ibm.wsspi.webcontainer.util.FFDCWrapper.processException(e,
                                  "com.ibm.ws.webcontainer.servlet.ServletWrapper.loadServlet", "213", this);
                          throw new UnavailableException(MessageFormat.format(nls.getString("Servlet.not.a.servlet.class",
                                  "Servlet [{0}]: not a servlet class"), new Object[] { className }));
                      } catch (NoClassDefFoundError e) {
                          com.ibm.wsspi.webcontainer.util.FFDCWrapper.processException(e,
                                  "com.ibm.ws.webcontainer.servlet.ServletWrapper.loadServlet", "218", this);
                          throw new UnavailableException(
                                  MessageFormat.format(nls.getString("Servlet.was.found.but.is.missing.another.required.class",
                                          "Servlet [{0}]: {1} was found, but is missing another required class.\n"), new Object[] { servletName,
                                          className })
                                          + nls
                                                  .getString(
                                                          "This.error.implies.servlet.was.originally.compiled.with.classes.which.cannot.be.located.by.server",
                                                          "This error typically implies that the servlet was originally compiled with classes which cannot be located by the server.\n")
                                          + nls.getString("Check.your.classpath.ensure.all.classes.present",
                                                  "Check your classpath to ensure that all classes required by the servlet are present.\n")
                                          + nls
                                                  .getString(
                                                          "be.debugged.by.recompiling.the.servlet.using.only.the.classes.in.the.application's.runtime.classpath",
                                                          "\n  This problem can be debugged by recompiling the servlet using only the classes in the application's runtime classpath\n")
                                          + MessageFormat.format(nls.getString("Application.classpath", "Application classpath=[{0}]"),
                                                  new Object[] { context.getClasspath() }));
                      } catch (ClassFormatError e) {
                          com.ibm.wsspi.webcontainer.util.FFDCWrapper.processException(e,
                                  "com.ibm.ws.webcontainer.servlet.ServletWrapper.loadServlet", "227", this);
                          throw new UnavailableException(
                                  MessageFormat.format(nls.getString("Servlet.found.but.corrupt", "Servlet [{0}]: {1} was found, but is corrupt:\n"),
                                          new Object[] { servletName, className })
                                          + nls.getString("class.resides.in.proper.package.directory",
                                                  "1. Check that the class resides in the proper package directory.\n")
                                          + nls
                                                  .getString("classname.defined.in.server.using.proper.case.and.fully.qualified.package",
                                                          "2. Check that the classname has been defined in the server using the proper case and fully qualified package.\n")
                                          + nls.getString("class.transfered.using.binary.mode",
                                                  "3. Check that the class was transfered to the filesystem using a binary tranfer mode.\n")
                                          + nls.getString("class.compiled.using.proper.case",
                                                  "4. Check that the class was compiled using the proper case (as defined in the class definition).\n")
                                          + nls.getString("class.not.renamed.after.compiled",
                                                  "5. Check that the class file was not renamed after it was compiled."));
                      } catch (IOException e) {
                          com.ibm.wsspi.webcontainer.util.FFDCWrapper.processException(e,
                                  "com.ibm.ws.webcontainer.servlet.ServletWrapper.loadServlet", "1349", this);
                          throw new ServletException(
                                  MessageFormat.format(nls.getString("IOException.loading.servlet"),
                                          new Object[] { servletName, className }), e);
                      }  
                      catch (InjectionException ie) {	//596191 Start	
                          com.ibm.ws.ffdc.FFDCFilter.processException(ie, "com.ibm.ws.webcontainer.servlet.ServletWrapper.loadServlet", "228", this);
                          logger.logp(Level.SEVERE, CLASS_NAME, "init",
                                      "Servlet.found.but.injection.failure",
                                      new Object[] { servletName, className, ie.getLocalizedMessage() });
                          // Liberty - convert to UnavailableException, so a 404, instead of a 500, error will be returned to the client
                          String string = nls.getString("Servlet.found.but.injection.failure",
                                          "SRVE0319E: For the [{0}] servlet, {1} servlet class was found, but a resource injection failure has occurred. {2}");
                          String s = MessageFormat.format(string, new Object[] { servletName, className, ie.getLocalizedMessage() });
                          throw new UnavailableException(s);
                       }//596191 End 
                      catch (IllegalAccessException e) {
                      	com.ibm.wsspi.webcontainer.util.FFDCWrapper.processException(e,
                                  "com.ibm.ws.webcontainer.servlet.ServletWrapper.loadServlet", "1349", this);
                          throw new ServletException(
                                  MessageFormat.format(nls.getString("IllegalAccessException.loading.servlet"),
                                          new Object[] { servletName, className }), e);
                      } catch (InstantiationException e) {
                      	com.ibm.wsspi.webcontainer.util.FFDCWrapper.processException(e,
                                  "com.ibm.ws.webcontainer.servlet.ServletWrapper.loadServlet", "1349", this);
                          throw new ServletException(
                                  MessageFormat.format(nls.getString("InstantiationException.loading.servlet"),
                                          new Object[] { servletName, className }), e);
                      } 
                      if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE))
                          logger.exiting(CLASS_NAME, "loadServlet"); // 569469
  
                      return null;
                  }
              });
  
          } catch (PrivilegedActionException e) {
              Throwable th = e.getCause();
              if (th instanceof Exception)
                  throw ((Exception) th);
              throw new Exception(th);
          } catch (Throwable t) {
              throw new Exception(t);
          } finally {
              ThreadIdentityManager.reset(token);
  
              if (origClassLoader != null) {
                  final ClassLoader fOrigClassLoader = origClassLoader;
                  ThreadContextHelper.setClassLoader(fOrigClassLoader);
              }
              if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE)) // 306998.15
                  logger.exiting(CLASS_NAME, "loadServlet"); // 569469
  
          }
  
          return target;
      }