0
我做在Sun ONE LDAP對象的查找和下面給出得到的異常:Java的LDAP錯誤,而這樣做的查找
javax.naming.NamingException中:使用對象工廠問題產生的對象[根
異常是java.lang.IllegalAccessException:類javax.naming.spi.NamingManager可以
不訪問具有修飾符「public」]的com.ldap.java.LDAPFactory類的成員;其餘 名CN =喜愛,DC = XXX,DC = ABC,DC = CDF」
的異常被拋出下面的代碼中,其中給出的 「閱讀對象回到」:
Fruit fruit = new Fruit("orange", "sweet and sour");
// Perform bind
ctx.bind("cn=favorite,dc=xxx,dc=abc,dc=cdf", fruit);
logger.info("Entry bind...Complete");
// Read object back
Object f2 = ctx.lookup("cn=favorite,dc=xxx,dc=abc,dc=cdf");
logger.info("Fruit = " + f2);
// Read attributes to see encoding
Attributes attrs =
ctx.getAttributes("cn=favorite,dc=xxx,dc=abc,dc=cdf");
logger.info("Atrributes = " + attrs);
// Close the context when we're done
ctx.close()
誰能告訴我,我在代碼中出了什麼問題?
-
韓國社交協會 巴拉特
似乎有些罐子在classpath中失蹤。 – kosa
我不認爲有任何罐子丟失。如果jar丟失,那麼異常應該像classnotfoundexception。 – Bharat
它正在嘗試反思,根據java文檔,它可能是由於classdef沒有找到http://docs.oracle.com/javase/6/docs/api/java/lang/IllegalAccessException.html – kosa