Hi, there,
 
I just started to use Castor API DSML package.  I tried to use importer in a servlet (running on Tomcat) to import or overwrite entries in the LDAP server (NOVELL).  I was able to import new entries; however I got exceptions when the imported item previously exists.  Error Message as follows:
 
org.exolab.castor.dsml.ImportExportException: Nested exception: javax.naming.dir
ectory.SchemaViolationException: [LDAP: error code 65 - NDS error: object class
violation (-628)]; remaining name 'cn=Test30'
        at org.exolab.castor.dsml.jndi.JNDIImporter.importEntries(JNDIImporter.j
ava:205)
        at org.exolab.castor.dsml.Importer.importDocument(Importer.java:137)
        at org.exolab.castor.dsml.Importer.importDocument(Importer.java:111)
        at DisplayUser.create(DisplayUser.java:111)
        at DisplayUser.doGet(DisplayUser.java:65)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 &nb! sp;      at org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServl
et.java:446)
 
Test30 is the entry I just put in.  My code is as follows:
       
        Importer importer =new JNDIImporter(ctx);
        PrintImportListener printer;
        StringWriter out=new StringWriter();
        try{
            printer=new PrintImportListener( new PrintWriter(out));
            importer.setImportEventListener(printer);
            importer.readImportDescriptor(DisplayUser.class.getResourceAsStream( "import.xml" ));
            importer.importDocument(DisplayUser.class.getResourceAsStream(dsml));
        }catch(Exception e){
            e.printStackTrace();
        }
 
The import.xml is:
<dsml>
  <import-policies>
     <import-policy dn="ou=chinglingling, ou=User, o=NOVELL" delete-empty="true"
                    replace-attr="true" refresh-only="false"/>
  </import-policies>
</dsml>
 
Is this behavior by design or my import.xml is wrong?  Thanks.
 
Regards,
Qing


Send and receive Hotmail on your mobile device: Click Here
----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev

Reply via email to