This section covers problems you might encounter while compiling a SQL-NS instance for the first time or when updating an instance after it has been created. The guidance given in this section is the same, regardless of whether you use the command-line
nscontrol
create
and
nscontrol update
commands, or Management Studio's New Notification Services Instance and Update Instance commands, to compile your instance.
This section covers compilation problems that result from errors in ICFs and ADFs.
Malformed
XML
Symptom:
The compiler
reports
an error message of the following form:
<filename>(<line>,<position>)
: error NS9037: An error occurred when parsing the XML file.
<error description text>
Cause:
The ICF passed to the compiler, or one of the ADFs referenced by it, contains malformed XML. The error message usually indicates the
name
of the file containing the error, the line and position on which the error occurs, and some descriptive text indicating the nature of the problem.
Action:
Correct the XML errors indicated in the error message and run the create or update command again. Opening the offending file in an XML editor (such as Management Studio) can sometimes be helpful if the nature of the error is not obvious from the message. XML editors typically offer features such as syntax highlighting and well-
formedness
checking that can help you find XML errors.
XML Schema Compliance Errors
Symptom:
The compiler reports an error message of the following form:
<filename>(<line>,<position>)
: error NS9047: The XML does not match the XSD schema.
ProblemDescription: <error description text>
Cause:
ICFs and ADFs must conform to XSD schemas provided by SQL-NS. This error occurs if one of the XML documents
processed
by the compiler does not conform to the corresponding XSD schema. The document may contain well-
formed
XML but may
violate
restrictions and constraints defined in the schema. For example, the document may contain elements not defined in the schema, or multiple instances of an element defined as a singleton in the schema.
Note
The XSD schemas for the ICF and ADF can be found in the
XML Schemas
directory of your SQL-NS installation. If you installed SQL Server in the default location, the full
path
to this directory is
C:\Program Files\Microsoft SQL Server\90\NotificationServices\9.0.242\XML Schemas
.
In the
XML Schemas
directory, the ICF schema is defined in the file
ConfigurationFileSchema.xsd
, and the ADF schema is defined in the file
ApplicationDefinitionFileSchema.xsd
.
Action:
Correct the XML errors indicated in the error message and run the create or update command again. XML editors (such as Management Studio) can sometimes help identify schema compliance errors.
Missing Parameter Values
Symptom:
The compiler reports an error message of one of the following forms:
[View full width]
[View full width]
<filename>(<line>,<position>): error NS9008: A required element in the instance
configuration is missing.
MissingParameter: <parameter name>
or
[View full width]
[View full width]
<filename>(<line>,<position>): error NS9023: A required element in the application
definition is missing.
MissingParameter: <parameter name>
Cause:
You did not supply a value for a parameter used in the ICF or ADF.
Action:
For every parameter in the ICF, specify a value in one of the following ways:
-
Pass a value for the parameter on the command line if you're using
nscontrol create
or
nscontrol update
.
-
Specify a value for the parameter using the parameters grid in the New Notification Services Instance dialog box or the Update Instance dialog box if you're using Management Studio.
-
Supply a default value for the parameter in the
<ParameterDefaults>
element of the ICF.
For every parameter used in the ADF, specify a value in one of the following ways:
-
Declare the parameter and supply a value in the
<Parameters>
element within the application's
<Application>
declaration in the ICF.
-
Supply a default value for the parameter in the
<ParameterDefaults>
element of the ADF.
For more information on parameters, see the "Parameters" section (p. 104) in Chapter 4, "Working with SQL-NS Instances."
SQL Errors During Compilation
Compiling an instance for the first time involves creating the instance and application database objects from the information in the ICF and ADFs. Updating an instance involves altering the database objects
themselves
or the information in them. It's possible that the compiler may experience problems connecting to the SQL Server or creating the required database objects. This section covers SQL-
related
problems that you might encounter during the compilation of an instance.
Unable to Connect or Log In to the SQL Server
Symptom:
The compiler reports an error message indicating problems connecting to the SQL Server. The error message has the following form:
Notification Services failed to open a connection to SQL Server.
Server Name: <sql server instance>
Failed to connect to server <sql server instance>.
<error description text>
Cause:
The create or update command failed to connect to the SQL Server instance specified in the
<SqlServerSystem>
element of the ICF.
Action:
The first step in diagnosing connectivity problems is to attempt to connect to the SQL Server instance using Management Studio. When doing so, make sure that you attempt the connection with the same credentials that the create or update command uses (either the credentials of the
user
running the command, if you're using Windows Authentication, or the development account's SQL username and password if you're using SQL Server Authentication).
If you are able to connect using Management Studio, you should do the following:
-
Verify that the SQL Server name is specified correctly in the
<SqlServerSystem>
element of the ICF (if you're using a named instance of SQL Server, be sure to include the instance name).
-
If you're using the command-line tools and SQL Server Authentication, verify that the correct SQL username and password are passed to the
nscontrol create
or
nscontrol update
command.
-
If you're using Management Studio and SQL Server Authentication, verify that the Object Explorer from which you're launching the SQL-NS commands is connected to the SQL Server with the correct username and password.
If you are not able to connect to the server from Management Studio, perform the following checks:
If you are able to reach the SQL server from Management Studio but are not able to log in, make sure that the account you're using to connect has been granted login access to the server. For information on granting login access and other permissions, see the "Granting Permissions" section (p. 92) in Chapter 4.
Permission
Denied
Errors During Compilation
Symptom:
The compiler reports an error message indicating that permission to create a database object was denied. The error message will vary in form, depending on the object being created.
Cause:
The account that the create or update command is using to connect to the SQL Server does not have sufficient permissions to create the necessary database objects.
Action:
Make sure the account that the create or update command uses to connect to the database is a member of the
sysadmin
fixed server role. See the section "The Development Account" (p. 35) in Chapter 2, "Getting Set Up," for information on how to create a development account and grant
sysadmin
membership.