This project is read-only.

Slam.config Problem

Apr 5, 2010 at 6:20 PM

i was install SLAM 1.3, but i have a little problem.

My config work great in SLAM 1.2.0.6

I have this Error in Slam Control Panel

Welcome to the SLAM Control Panel!

SLAM has encountered the following error: 

System.TypeInitializationException: The type initializer for 'AWS.SLAM.ComponentService' threw an exception.
 ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.UnauthorizedAccessException: 
Access to the path 'C:\Inetpub\wwwroot\wss\VirtualDirectories\80\slam.config' is denied. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) 
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy) 
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize) 
at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials) 
at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn) 
at System.Xml.XmlReader.Create(String inputUri, XmlReaderSettings settings, XmlParserContext inputContext) 
at System.Xml.XmlReader.Create(String inputUri, XmlReaderSettings settings) 
at System.Xml.Linq.XDocument.Load(String uri, LoadOptions options) 
at System.Xml.Linq.XDocument.Load(String uri) at AWS.SLAM.Configuration.XmlConfigurationManager..ctor() 
at AWS.SLAM.StructureMap.SLAMRegistry.configure() at StructureMap.Configuration.DSL.Registry..ctor() 
at AWS.SLAM.StructureMap.ComponentFactory.Initialize() at AWS.SLAM.StructureMap.ComponentFactory..ctor() 
--- End of inner exception stack trace --- 
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck) 
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache) 
at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache) 
at System.Activator.CreateInstance(Type type, Boolean nonPublic) at System.Activator.CreateInstance(Type type) 
at AWS.SLAM.ComponentService..cctor() --- End of inner exception stack trace --- at AWS.SLAM.ComponentService.ClearInstances() 
at AWS.SLAM.Administration.SLAMControlPanel.Page_Load(Object sender, EventArgs e) 
Slam.config
<?xml version="1.0" encoding="utf-8" ?>
<Configuration>
  
 <!--STRING DE CONEXION A BD GESTIÓN DE ENTRENAMIENTOS-->
  
  <ConnectionStrings Default="SLAM">
    <add Name="SLAM" ConnectionString="Database=CLSCL_GESTION_ENTRENAMIENTO_TEST;Data Source=DB02;User Id=CLSCL_WSS_Slam;Password=****" />
  </ConnectionStrings>

<!--MAPING ENTRE LISTAS DE WSS Y TABLAS EN SQL SERVER-->
  
  <DataMapping DataSchema="SLAM">
    <!--LISTA AGENDAR CLASES-->
    <List Site="/fcastillo/ge/" Name="Agendar Clases" ActivationOrder="1">
      <Fields>
        <Field Name="Curso" SqlType="varchar(255)" SPType="Text" Required="true"></Field>
        <Field Name="Fecha Inicio" SqlType="datetime" SPType="DateTime" Required="false"></Field>
        <Field Name="Fecha Termino" SqlType="datetime" SPType="DateTime" Required="false"></Field>
        <Field Name="Tema" SqlType="varchar(255)" SPType="Choice" Required="false"></Field>
        <Field Name="Sala" SqlType="varchar(255)" SPType="Choice" Required="false"></Field>
        <Field Name="Instructor Interno" SqlType="varchar(255)" SPType="Person" Required="false"></Field>
        <Field Name="Instructor Externo" SqlType="varchar(255)" SPType="Choice" Required="false"></Field>
        <Field Name="Notificar a Instructor" SqlType="bit" SPType="Boolean" Required="false"></Field>
        <Field Name="IDCURSO" SqlType="varchar(255)" SPType="Text" Required="false"></Field>
        <Field Name="IDTEMA" SqlType="varchar(255)" SPType="Text" Required="false"></Field>
        <Field Name="str_Tema" SqlType="varchar(255)" SPType="Text" Required="false"></Field>
        <Field Name="xCursosAgendados" SqlType="int" SPType="Number" Required="false"></Field>
        <Field Name="Activo" SqlType="bit" SPType="Boolean" Required="false"></Field>
		<Field Name="Cupo" SqlType="int" SPType="Number" Required="false"></Field>
     </Fields>
    </List>

<!--LISTA INSCRITOS POR CURSO-->
    
    <List Site="/fcastillo/ge/" Name="Inscritos por Curso" ActivationOrder="2">
      <Fields>
        <Field Name="Estado" SqlType="varchar(255)" SPType="Choice" Required="false"></Field>
        <Field Name="Observaciones" SqlType="varchar(255)" SPType="Text" Required="false"></Field>
        <Field Name="Curso Agendado" SqlType="varchar(255)" SPType="Choice" Required="false"></Field>
        <Field Name="Alumnos" SqlType="varchar(255)" SPType="Person" Required="false"></Field>
        <Field Name="Activo" SqlType="bit" SPType="Boolean" Required="false"></Field>
      </Fields>
    </List>

<!--LISTA INSCRIPCIÓN-->
    
    <List Site="/fcastillo/ge/" Name="Inscripcion" ActivationOrder="3">
      <Fields>
        <Field Name="Curso Agendado" SqlType="varchar(255)" SPType="Choice" Required="false"></Field>
        <Field Name="Tema" SqlType="varchar(255)" SPType="Choice" Required="false"></Field>
        <Field Name="Title" SqlType="varchar(255)" SPType="Text" Required="false"></Field>
        <Field Name="Fecha Inicio" SqlType="datetime" SPType="DateTime" Required="false"></Field>
        <Field Name="Fecha Termino" SqlType="datetime" SPType="DateTime" Required="false"></Field>
        <Field Name="Observacion" SqlType="varchar(255)" SPType="Text" Required="false"></Field>
        <Field Name="Sala" SqlType="varchar(255)" SPType="Choice" Required="false"></Field>
        <Field Name="Activo" SqlType="bit" SPType="Boolean" Required="false"></Field>
        <Field Name="Asistencia" SqlType="bit" SPType="Boolean" Required="false"></Field>
        <Field Name="Instructor Interno" SqlType="varchar(255)" SPType="User" Required="false"></Field>
        <Field Name="Instructor Externo" SqlType="varchar(255)" SPType="Lookup" Required="false"></Field>
        <Field Name="xInscritosPorCurso" SqlType="int" SPType="Number" Required="false"></Field>
        <Field Name="Alumno" SqlType="varchar(255)" SPType="Person" Required="false"></Field>
      </Fields>
    </List> 

<!--LISTA REGISTRO DE ENTRENAMIENTOS-->
    
    <List Site="/fcastillo/ge/" Name="Registro de Entrenamientos" ActivationOrder="5">
      <Fields>
        <Field Name="Title" SqlType="varchar(255)" SPType="Text" Required="false"></Field>
        <Field Name="Alumno" SqlType="varchar(255)" SPType="Person" Required="false"></Field>
        <Field Name="Cargo" SqlType="varchar(255)" SPType="Text" Required="false"></Field>
        <Field Name="Curso" SqlType="varchar(255)" SPType="Choice" Required="false"></Field>
        <Field Name="Cantidad de Horas" SqlType="varchar(255)" SPType="Text" Required="false"></Field>
        <Field Name="Inicio Curso" SqlType="datetime" SPType="DateTime" Required="false"></Field>
        <Field Name="Termino Curso" SqlType="datetime" SPType="DateTime" Required="false"></Field>
        <Field Name="CursoAgendado" SqlType="varchar(255)" SPType="Choice" Required="false"></Field>      
      </Fields>
    </List>

<!--LISTA DE ALUMNOS NO APROBADOS-->
    
    <List Site="/fcastillo/ge/" Name="Alumnos No Aprobados" ActivationOrder="6">
      <Fields>
        <Field Name="Alumno" SqlType="varchar(255)" SPType="Text" Required="false"></Field>
        <Field Name="Curso" SqlType="varchar(255)" SPType="Choice" Required="false"></Field>
        <Field Name="Alumno_" SqlType="varchar(255)" SPType="Person" Required="false"></Field>
        <Field Name="Horas" SqlType="varchar(255)" SPType="Text" Required="false"></Field>
        <Field Name="Cargo" SqlType="varchar(255)" SPType="Text" Required="false"></Field>
        <Field Name="Inicio Curso" SqlType="datetime" SPType="DateTime" Required="false"></Field>
        <Field Name="Termino Curso" SqlType="datetime" SPType="DateTime" Required="false"></Field>
        <Field Name="CursoAgendado" SqlType="varchar(255)" SPType="Choice" Required="false"></Field>
      </Fields>
    </List>

<!--LISTA SELECCION DE ASISTENTES-->
   
    <List Site="/fcastillo/ge/" Name="Seleccion de Asistentes" ActivationOrder="7">
      <Fields>
        <Field Name="Title" SqlType="varchar(255)" SPType="Text" Required="false"></Field>
        <Field Name="Estado Envío" SqlType="varchar(255)" SPType="Choice" Required="false"></Field>
        <Field Name="Curso" SqlType="varchar(255)" SPType="Choice" Required="false"></Field>
        <Field Name="Evaluacion Curso" SqlType="varchar(255)" SPType="Choice" Required="false"></Field>
        <Field Name="Activo" SqlType="bit" SPType="Boolean" Required="false"></Field>
        <Field Name="Curso Evaluado" SqlType="varchar(255)" SPType="Text" Required="false"></Field>
        <Field Name="Lista de asistentes" SqlType="varchar(255)" SPType="Person" Required="false"></Field>
        <Field Name="Notificación a los usuarios" SqlType="varchar(255)" SPType="Choice" Required="false"></Field> 
      </Fields>
    </List>

    
  </DataMapping>
</Configuration>

Developer
Apr 6, 2010 at 3:51 PM

Is your site using FBA?  Usually when using forms auth the slam.config needs authenticated users added to its read permissions.  I expect doing will fix your issue anyway, but if your site is AD, with Users (etc) having read access should be sufficient.

Apr 7, 2010 at 5:58 PM

i can fix this problem with up level privileges.

 

But i have a new problem, look this event report error. Help Please

Event Type: Error
Event Source: SLAM
Event Category: None
Event ID: 0
Date: 07/04/2010
Time: 12:11:31 PM
User: N/A
Computer: CLSCLAPT01
Description:
System.NullReferenceException: Object reference not set to an instance of an object.
   at AWS.SLAM.ListItemEventManager.<>c__DisplayClass4.b__0()
   at Microsoft.SharePoint.SPSecurity.CodeToRunElevatedWrapper(Object state)
   at Microsoft.SharePoint.SPSecurity.<>c__DisplayClass4.b__2()
   at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode)
   at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(WaitCallback secureCode, Object param)
   at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(CodeToRunElevated secureCode)
   at AWS.SLAM.ListItemEventManager.ItemAdded(SPItemEventProperties properties)

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

 

 

 

 

Developer
Apr 8, 2010 at 5:49 PM

I am not sure what the problem is, but I will point what is potentially the issue.  The real problem as far as I can tell is that any object reference that will throw this error at that stage in the code is SharePoint populated.  Here are the candidates:

SPWeb site is null.  This is resolved using properties.OpenWeb(), so unless the incoming SPItemEventProperties have bad references, this is likely not the issue.

SPWeb elevatedSite is null.  This is derived from "site" as derived from the incoming properties.  Again, unless SPItemEventProperties has bad references this is likely not the issue.

SPWeb elevatedWeb is null.  Even if the SPWeb couldn't be opened it wouldn't be null but its "Exists" flag would be false.  This is likely not the issue, but perhaps if again SPItemEventProperties has bad references.

properties.ListItem or properties.ListItem.ParentList is null.  In the first case, SPItemEventProperties would have a bad reference and in the second the item for some reason would not be able to get its containing list.  These cases still seem unlikely.

SPList elevatedList is null.  If the previous items are fine, then elevatedList wouldn't be null, and if the ID of the containing list for the SPListItem under processing does not match a List in the containing SPWeb then you would see a different error, not a null reference.

If these all check out, the next candidates follow after the "elevatedListItem" is successfully created.  So that leaves us with:

elevatedSite.ServerRelativeUrl, or elevatedList.ID are null properties.  Both cases are obviously SharePoint populated.  The only other guess would be the IItemCreator is null, but ComponentService.GetInstance will throw an exception if a component cannot be found and will not return null.  So creator.Create should not be the culprit.

 

In other words, I think you should either use the code and debug or try it on different lists, on different sites if all lists are doing this, maybe even a different application?  Because I do not know which of the above is the case I cannot guess what to do to correct it.