Results 1 to 4 of 4

Thread: Exception while creating user in Zimbra from java web application

Hybrid View

  1. #1
    Join Date
    Nov 2008
    Posts
    6
    Rep Power
    7

    Default Exception while creating user in Zimbra from java web application

    Hii all,

    I am trying to create an user in zimbra from my Java application (jdk1.6.0_02 and tomcat-5.5.26),i am getting the following exception::
    java.lang.RuntimeException: could not locate data
    at sun.text.normalizer.NormalizerImpl.<clinit>(Normal izerImpl.java:44)
    at sun.text.normalizer.NormalizerBase.decompose(Norma lizerBase.java:707)
    at sun.text.normalizer.NormalizerBase$NFKDMode.normal ize(NormalizerBase.java:348)
    at sun.text.normalizer.NormalizerBase.normalize(Norma lizerBase.java:1592)
    at sun.text.normalizer.NormalizerBase.normalize(Norma lizerBase.java:1573)
    at java.text.Normalizer.normalize(Normalizer.java:146 )
    at sun.security.x509.AVA.toRFC2253CanonicalString(AVA .java:986)
    at sun.security.x509.RDN.toRFC2253StringInternal(RDN. java:430)
    at sun.security.x509.RDN.toRFC2253String(RDN.java:409 )
    at sun.security.x509.X500Name.getRFC2253CanonicalName (X500Name.java:714)
    at sun.security.x509.X500Name.equals(X500Name.java:40 0)
    at sun.security.pkcs.PKCS7.getCertificate(PKCS7.java: 609)
    at sun.security.pkcs.SignerInfo.getCertificate(Signer Info.java:202)
    at sun.security.pkcs.SignerInfo.verify(SignerInfo.jav a:328)
    at sun.security.pkcs.PKCS7.verify(PKCS7.java:494)
    at sun.security.pkcs.PKCS7.verify(PKCS7.java:511)
    at sun.security.util.SignatureFileVerifier.processImp l(SignatureFileVerifier.java:199)
    at sun.security.util.SignatureFileVerifier.process(Si gnatureFileVerifier.java:176)
    at java.util.jar.JarVerifier.processEntry(JarVerifier .java:277)
    at java.util.jar.JarVerifier.update(JarVerifier.java: 188)
    at java.util.jar.JarFile.initializeVerifier(JarFile.j ava:321)
    at java.util.jar.JarFile.getInputStream(JarFile.java: 386)
    at sun.misc.URLClassPath$JarLoader$2.getInputStream(U RLClassPath.java:689)
    at sun.misc.Resource.cachedInputStream(Resource.java: 59)
    at sun.misc.Resource.getByteBuffer(Resource.java:154)
    at java.net.URLClassLoader.defineClass(URLClassLoader .java:249)
    at java.net.URLClassLoader.access$000(URLClassLoader. java:56)
    at java.net.URLClassLoader$1.run(URLClassLoader.java: 195)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.j ava:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:3 06)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:276)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:2 51)
    at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:319)
    at com.sun.net.ssl.internal.ssl.SSLContextImpl.engine Init(SSLContextImpl.java:63)
    at com.sun.net.ssl.internal.ssl.DefaultSSLContextImpl .<init>(DefaultSSLContextImpl.java:40)
    at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInsta nce(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Construc tor.java:513)
    at java.lang.Class.newInstance0(Class.java:355)
    at java.lang.Class.newInstance(Class.java:308)
    at java.security.Provider$Service.newInstance(Provide r.java:1221)
    at sun.security.jca.GetInstance.getInstance(GetInstan ce.java:220)
    at sun.security.jca.GetInstance.getInstance(GetInstan ce.java:147)
    at javax.net.ssl.SSLContext.getInstance(SSLContext.ja va:125)
    at javax.net.ssl.SSLContext.getDefault(SSLContext.jav a:68)
    at javax.net.ssl.SSLSocketFactory.getDefault(SSLSocke tFactory.java:102)
    at org.apache.commons.httpclient.protocol.SSLProtocol SocketFactory.createSocket(SSLProtocolSocketFactor y.java:81)
    at org.apache.commons.httpclient.protocol.SSLProtocol SocketFactory.createSocket(SSLProtocolSocketFactor y.java:126)
    at org.apache.commons.httpclient.HttpConnection.open( HttpConnection.java:706)
    at org.apache.commons.httpclient.HttpMethodDirector.e xecuteWithRetry(HttpMethodDirector.java:386)
    at org.apache.commons.httpclient.HttpMethodDirector.e xecuteMethod(HttpMethodDirector.java:170)
    at org.apache.commons.httpclient.HttpClient.executeMe thod(HttpClient.java:396)
    at org.apache.commons.httpclient.HttpClient.executeMe thod(HttpClient.java:324)
    at com.zimbra.common.soap.SoapHttpTransport.invoke(So apHttpTransport.java:234)
    at com.zimbra.common.soap.SoapTransport.invoke(SoapTr ansport.java:297)
    at com.zimbra.common.soap.SoapTransport.invoke(SoapTr ansport.java:261)
    at com.zimbra.cs.account.soap.SoapProvisioning.invoke (SoapProvisioning.java:185)
    at com.zimbra.cs.account.soap.SoapProvisioning.soapAd minAuthenticate(SoapProvisioning.java:145)
    at com.nated.app.calendar.zimbra.businessobject.Zimbr aCalendarBO.createUser(ZimbraCalendarBO.java:252)
    at com.nated.app.user.action.SignInAction.execute(Sig nInAction.java:69)
    at com.nated.app.user.servlet.UserServlet.moduleProce ss(UserServlet.java:511)
    at com.nated.app.user.servlet.UserServlet.process(Use rServlet.java:326)
    at com.nated.app.user.servlet.UserServlet.doPost(User Servlet.java:1049)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:710)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:803)
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:269)
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:188)
    at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:213)
    at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:174)
    at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:117)
    at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:108)
    at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:174)
    at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyo teHandler.java:200)
    at org.apache.jk.common.HandlerRequest.invoke(Handler Request.java:283)
    at org.apache.jk.common.ChannelSocket.invoke(ChannelS ocket.java:773)
    at org.apache.jk.common.ChannelSocket.processConnecti on(ChannelSocket.java:703)
    at org.apache.jk.common.ChannelSocket$SocketConnectio n.runIt(ChannelSocket.java:895)
    at org.apache.tomcat.util.threads.ThreadPool$ControlR unnable.run(ThreadPool.java:689)
    at java.lang.Thread.run(Thread.java:619)


    but from stand alone java application means from the main method if i try to create the user in zimbra directly,there is no issue in that.

    My create user method.....

    public static void createUser(String userId,String password) throws ServiceException {

    try {

    Map<String, Object> bbll = new HashMap<String,Object>();
    bbll.put(Provisioning.A_cn, "Offshore");

    System.setProperty("javax.net.ssl.trustStore", "natedcert");
    System.setProperty("javax.net.ssl.trustStorePasswo rd", "changeit");

    SoapProvisioning sp = new SoapProvisioning();
    sp.soapSetURI("https://171.11.24.150:7071/service/admin/soap/");
    try {
    sp.soapAdminAuthenticate("admin@inkolvmlnx01.xyz.c o.in", "admin123");
    } catch (Exception e){
    e.printStackTrace();
    }

    sp.createAccount(userId, password, bbll);
    } catch (RuntimeException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    }
    }



    Please help me in creating user from java Wb based application.
    Last edited by saman; 11-06-2008 at 11:52 PM.

  2. #2
    Join Date
    Nov 2008
    Posts
    7
    Rep Power
    7

    Default

    Hi Saman,

    I guess there is a mistake in the following code :

    sp.soapSetURI("https://171.11.24.150:7071/service/admin/soap/");

    please try

    sp.soapSetURI("https://171.11.24.150:7071/zimbraAdmin/service/admin/soap/");

    hope it helps ...!


    Regards
    Seshu

  3. #3
    Join Date
    Nov 2008
    Posts
    6
    Rep Power
    7

    Default Hii Seshu

    Hi Seshu,

    Thanks for your reply.
    My code is now running fine..
    I kept the code as it was previously,
    means,
    sp.soapSetURI("https://171.11.24.150:7071/service/admin/soap/");

    Actually the problem was there with my Eclipse IDE.

    I was trying to set the keystore path in the tomcat setting of Eclipse.But still i was getting the error.

    Now i have set the keystore path manually in Cataline.bat file

    set JAVA_OPTS=%JAVA_OPTS% -Djavax.net.ssl.trustStore="C:\cert.jks"

    Now it is working ...

    Thanks again for ur reply..

  4. #4
    Join Date
    Nov 2008
    Posts
    7
    Rep Power
    7

    Default

    Hi Saman,


    Thats good to hear from you.

    Now im stuck with SSL Handshake problem while changing my userPassword attribute. It gives the certificate for PKIX is not found in the path. Could you please let me know how can i set the certificate while using SoapProvisioning. Please let know the clear instructions of applying the certificate parameters. Please find my code as follows.

    public static void testChangePassword(String userName, String newPassword)
    throws Exception {
    ZimbraLog.test.debug("testDeleteAccount()");

    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.j ndi.ldap.LdapCtxFactory");
    env.put(Context.PROVIDER_URL, "ldap://IPADDRESS:389");
    env.put(Context.SECURITY_PRINCIPAL,"uid=zimbra,cn= admins,cn=zimbra");
    // env.put(Context.SECURITY_PROTOCOL,"ssl");
    // env.put(Context.SECURITY_PRINCIPAL,"uid=zimbra,cn= admins,cn=zimbra,dc=localhost,dc=localdomain");
    env.put(Context.SECURITY_AUTHENTICATION,"simple");
    env.put(Context.SECURITY_CREDENTIALS,"zimbra123");



    DirContext ctx = new InitialDirContext(env);
    System.setProperty("javax.net.ssl.trustStore", "mykeystore");
    System.setProperty("javax.net.ssl.trustStorePasswo rd", "123456");
    SoapProvisioning sp = new SoapProvisioning();
    sp.soapSetURI(SERVER_URL
    + ZimbraServlet.ADMIN_SERVICE_URI);
    sp.soapAdminAuthenticate("uid=zimbra,cn=admins,cn= zimbra,dc=test,dc=zmb,dc=com","zimbra123");

    Account account = sp.get(AccountBy.name, userName);
    String password = account.getAttr("userPassword");
    sp.changePassword(account, password, newPassword);
    }

    Could you please let me know what is the mistake in the above code.

    Its very urgent

    Thanks,
    Seshu

Similar Threads

  1. Initializing ldap...failed. (28416) on RHEL 5
    By Nicrad in forum Installation
    Replies: 35
    Last Post: 10-22-2012, 07:57 PM
  2. Replies: 31
    Last Post: 12-15-2007, 09:05 PM
  3. Zimbra Install Problem - getDirectContext
    By bsimzer in forum Installation
    Replies: 27
    Last Post: 07-19-2007, 11:12 AM
  4. Fedora Core 3, Clean Install - Not working!
    By pcjackson in forum Installation
    Replies: 17
    Last Post: 03-05-2006, 07:38 PM
  5. Network edition - strange behavior
    By goetzi in forum Installation
    Replies: 6
    Last Post: 11-16-2005, 03:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •