The top of your SqlMap.config file should look something like this: <?xml version="1.0" encoding="UTF-8" ?>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > The top of your sqlMap files should look like this: <?xml version="1.0" encoding="UTF-8" ?> <sqlMap namespace="Customer" xmlns="http://ibatis.apache.org/mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> ----- Original Message ---- From: "Hoffman, Ira" <[EMAIL PROTECTED]> To: "[email protected]" <[email protected]> Sent: Wednesday, December 14, 2005 6:25:25 AM Subject: iBatis and Visual Studio 2005 Woes All, I am trying to develop a .NET 2.0 middle-tier that leverages iBatis. I have used iBatis before, in the Java world, and greatly enjoyed it. However, I am having problems getting the most basic configuration working with Visual Studio 2005 and iBatis. I have created a new ASP .NET Web Service Project and am unable to read the sqlMap.config properties file. Here is the error message: IBatisNet.Common.Exceptions.ConfigurationException: - The error occurred while Validate SqlMap config. - The error occurred in The 'file' attribute is not declared. The 'useFullyQualifiedStatementNames' attribute is not declared. The 'file' attribute is not declared. . ---> IBatisNet.Common.Exceptions.ConfigurationException: Invalid SqlMap.config document. cause :The 'file' attribute is not declared. The 'useFullyQualifiedStatementNames' attribute is not declared. The 'file' attribute is not declared. at IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.ValidateSchema(XmlNode section, String schemaFileName) at IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.Build(XmlDocument document, DataSource dataSource, Boolean useConfigFileWatcher, Boolean isCallFromDao) --- End of inner exception stack trace --- at IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.Build(XmlDocument document, DataSource dataSource, Boolean useConfigFileWatcher, Boolean isCallFromDao) at IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.ConfigureAndWatch(String resource, ConfigureHandler configureDelegate) at IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.ConfigureAndWatch(Config ureHandler configureDelegate) at MerckSAS.Library.Services.Mapper.InitMapper() in c:\Inetpub\wwwroot\MerckSAS\App_Code\Mapper.cs:line 25 at MerckSAS.Library.Services.Mapper.Instance() in c:\Inetpub\wwwroot\MerckSAS\App_Code\Mapper.cs:line 36 at MerckSAS.Library.Services.Mapper.Get() in c:\Inetpub\wwwroot\MerckSAS\App_Code\Mapper.cs:line 45 at MerckSasService..ctor() in c:\Inetpub\wwwroot\MerckSAS\App_Code\MerckSasService.cs:line 23 Here is my sqlMap.config file: <?xml version="1.0" encoding="utf-8" ?> <sqlMapConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:noNamespaceSchemaLocation="SqlMapConfig.xsd"> <properties file="database.properties" /> <settings> <setting useFullyQualifiedStatementNames="false" /> <setting cacheModelsEnabled="true" /> </settings> <database> <provider name="oracle9.2" /> <dataSource name="REMP" connectionString="user id=${username};password=${password};data source=${datasource};connection reset=false;connection lifetime=5;min pool size=1;max pool size=50" /> </database> <sqlMaps> <sqlMap file="Maps/SqlMap.xml" /> </sqlMaps> </sqlMapConfig> Here is my SqlMap.xml file: <?xml version='1.0'?> <sqlMap namespace="Remp" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:noNamespaceSchemaLocation="..\SqlMap.xsd"> <resultMaps> <resultMap id="getSubstanceLibraryMap" class="subtanceLibrary"> <result property="projectId" column="project_id"/> <result property="projectName" column="project_name"/> <result property="projectShortName" column="project_short_name"/> <result property="dlcAssayId" column="dlc_assay_id"/> <result property="sourceProjectPlateLayoutId" column="source_plate_layout_id"/> <result property="destinationProjectPlateLayoutId" column="destination_plate_layout_id"/> <result property="dlcProtocolVersion" column="dlc_protocol_version"/> </resultMap> <resultMap id="getCompoundMap" class="compound"> <result property="CompoundId" column="CPD_ID"/> <result property="Name" column="NAME"/> <result property="AlternateName" column="ALTERNATENAME"/> <result property="MolecularWeight" column="MOLWEIGHT"/> <result property="MutDateTime" column="MUT_DATETIME"/> </resultMap> </resultMaps> <statements> <select id="selectSubstanceLibrary" resultMap="getSubstanceLibraryMap"> select * from subst_library </select> <select id="selectCompound" resultMap="getCompoundMap"> select * from compound </select> </statements> </sqlMap> I wasn't too sure about the directory location of the SqlMap.config file...any ideas abou this error? Thanks, Ira ------------------------------------------------------------------------------ Notice: This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp & Dohme or MSD and in Japan, as Banyu) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system. ------------------------------------------------------------------------------

