Validate XML file errs out when run

I am setting up a multiforest ldap server on Windows 2016 Server. Running the following command produces the error below: The xml file is validated via XML Validator but will not run without the error.

Ideas???




Adamsync /install  localhost:52512 Ms-AdamSyncConf.xml /logs logs\install.log

Open in new window



<Error>
Establishing connection to target server localhost:52512.

Updating configuration file on MS-AdamSyncConf.

Reading Configuration File from MS-AdamSyncConf

An error occured while attempting to open file MS-AdamSyncConf for read.

Error parsing XML File. XML document must have a top level element.

. Line 0, Position 0 in (null)

Error parsing XML File. XML document must have a top level element.

. Line 0, Position 0 in (null)

Open in new window



XML being run:

<?xml version="1.0"?>
<doc>	
 <configuration>		
  <description>sample Adamsync configuration file</description>		
  <security-mode>object</security-mode>	        
  <source-ad-name>domain</source-ad-name>		
  <source-ad-partition>dc=Domain,dc=k12,DC=MN,DC=US</source-ad-partition>
  <source-ad-account></source-ad-account>                
  <account-domain></account-domain>
  <target-dn>dc=multiforest,dc=local</target-dn>		
  <query>			
   <base-dn>dc=Domain,dc=k12,dc=k12,dc=mn,dc=us</base-dn>
   <object-filter>(objectClass=*)</object-filter>			
   <attributes>				
    <include></include>				
    <exclude>extensionName</exclude>
    <exclude>displayNamePrintable</exclude>				
    <exclude>flags</exclude>				
    <exclude>isPrivelegeHolder</exclude>				
    <exclude>msCom-UserLink</exclude>				
    <exclude>msCom-PartitionSetLink</exclude>				
    <exclude>reports</exclude>			
    <exclude>serviceprincipalname</exclude>
    <exclude>accountExpires</exclude>
    <exclude>adminCount</exclude>
    <exclude>primarygroupid</exclude>
    <exclude>userAccountControl</exclude>
    <exclude>codePage</exclude>
    <exclude>countryCode</exclude>
    <exclude>logonhours</exclude>
    <exclude>lockoutTime</exclude>
   </attributes>		
  </query>		
  <schedule>			
   <aging>				
    <frequency>0</frequency>				
    <num-objects>0</num-objects>			
   </aging>			
   <schtasks-cmd></schtasks-cmd>		
  </schedule>	
 </configuration>	
 <synchronizer-state>		
  <dirsync-cookie></dirsync-cookie>		
  <status></status>		
  <authoritative-adam-instance></authoritative-adam-instance>		
  <configuration-file-guid></configuration-file-guid>		
  <last-sync-attempt-time></last-sync-attempt-time>		
  <last-sync-success-time></last-sync-success-time>		
  <last-sync-error-time></last-sync-error-time>		
  <last-sync-error-string></last-sync-error-string>		
  <consecutive-sync-failures></consecutive-sync-failures>		
  <user-credentials></user-credentials>		
  <runs-since-last-object-update></runs-since-last-object-update>		
  <runs-since-last-full-sync></runs-since-last-full-sync>	
 </synchronizer-state>
</doc>

Open in new window

Raymond NortonWAN AdminAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ste5anSenior DeveloperCommented:
Well, it seems to be well-formed. But there are possible things:

1. Does the file have the correct encoding (UTF) and does it contain a BOM?
2. Is the expected input XML really without schema?
1
Raymond NortonWAN AdminAuthor Commented:
It was produced automatically when adding the LDAP Multiforest instance. Not sure if it has the proper coding, etc.. I just entered in the info from a past .xml file. I am not skilled in xml files so am unsure about your schema question.

As a test, I uninstalled the multiforest instance, removed ldap and then reinstalled, after deleting the ADAM folder. All files were created again with the new install. I then validated the xml file and ran adamsync without making any changes to the file. I did not open the file either. I received the same error as the previous version I had edited.
0
Raymond NortonWAN AdminAuthor Commented:
This older version runs without any xml errors

<?xml version="1.0"?>
<doc>
<configuration>
<description>domain.k12.mn.us</description>

<security-mode>object</security-mode>
<source-ad-name>domain.k12.mn.us</source-ad-name>
<source-ad-partition>dc=domain,dc=k12,dc=mn,dc=us</source-ad-partition>
<source-ad-account></source-ad-account>
<account-domain></account-domain>

<target-dn>dc=domain,dc=k12,dc=mn,dc=us</target-dn>
<query>
<base-dn>dc=domain,dc=k12,dc=mn,dc=us</base-dn>
<object-filter>
(&#124;(&amp;(objectClass=user)(objectCategory=person))
(&amp;(objectClass=user)(isDeleted=TRUE)))
</object-filter>

<attributes>
<include>objectSID</include>
<include>mail</include>
<include>userPrincipalName</include>
<include>middleName</include>

<include>manager</include>
<include>givenName</include>
<include>sn</include>
<include>department</include>
<include>telephoneNumber</include>
<include>ipPhone</include>

<include>title</include>
<include>homephone</include>
<include>mobile</include>
<include>pager</include>
<include>msDS-UserAccountDisabled</include>

<include>samAccountName</include>
<include>employeeNumber</include>
<exclude></exclude>
</attributes>
</query>
<user-proxy>

<source-object-class>user</source-object-class>
<target-object-class>userProxy</target-object-class>
</user-proxy>
<schedule>
<aging>
<frequency>0</frequency>

<num-objects>0</num-objects>
</aging>
<schtasks-cmd></schtasks-cmd>
</schedule>
</configuration>
<synchronizer-state>
<dirsync-cookie></dirsync-cookie>

<status></status>
<authoritative-adam-instance></authoritative-adam-instance>
<configuration-file-guid></configuration-file-guid>
<last-sync-attempt-time></last-sync-attempt-time>
<last-sync-success-time></last-sync-success-time>
<last-sync-error-time></last-sync-error-time>

<last-sync-error-string></last-sync-error-string>
<consecutive-sync-failures></consecutive-sync-failures>
<user-credentials></user-credentials>
<runs-since-last-object-update></runs-since-last-object-update>
<runs-since-last-full-sync></runs-since-last-full-sync>
</synchronizer-state>

</doc>

Open in new window

0
Starting with Angular 5

Learn the essential features and functions of the popular JavaScript framework for building mobile, desktop and web applications.

Raymond NortonWAN AdminAuthor Commented:
I opened the original (default) file in Linux and save with edits. It worked this time, without errors.

Testing
0
ste5anSenior DeveloperCommented:
Then I guess: see point 1.
0
Raymond NortonWAN AdminAuthor Commented:
The log files are erroneous. The error occurs when the target file is not found. I.E

AdamSync /install localhost:50512 C:\Windows\ADAM\non-existant.xml /log C:\windows\adam\logs\install.log, produces the same error log:

<Log>
Establishing connection to target server localhost:52512.

Updating configuration file on c:\windows\ADAM\none-existant.xml.

Reading Configuration File from c:\windows\ADAM\none-existant.xml

An error occured while attempting to open file c:\windows\ADAM\none-existant.xml for read.

Error parsing XML File. XML document must have a top level element.

. Line 0, Position 0 in (null)

Error parsing XML File. XML document must have a top level element.

. Line 0, Position 0 in (null)

Running the same command, confirming the file name works without errors
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows OS

From novice to tech pro — start learning today.