?? jndi-dsml-ext.html
字號:
<HTML><HEAD><title>DSML v1 Service Provider for JNDI 1.2 Optional Package</title></HEAD><BODY BGCOLOR="#FFFFFF" TEXT=#000000 LINK=#0000ff VLINK=#000077ALINK=#ff0000><hr SIZE=3 NOSHADE WIDTH="100%"><center><h1>DSML v1 Service Provider for the <br>Java Naming and Directory Interface<font size=4><sup>TM</sup></font> (JNDI) 1.2<br>Optional Package</h1></center><hr SIZE=3 NOSHADE WIDTH="100%"><P><FONT SIZE=-1>Please send feedback to <a href="mailto:jndi@java.sun.com">jndi@java.sun.com</a></FONT><P><P><I>Table of Contents</I><UL><LI><A HREF="#INTRO">Introduction</A></LI><LI> <A HREF="#JDK14">Java<sup>TM</sup> 2 SDK, Standard Edition, v 1.4.x</A></LI><LI> <A HREF="#JDK13">Java<sup>TM</sup> 2 SDK, Standard Edition, v 1.3.x</A></LI><LI> <A HREF="#JDK12">Java<sup>TM</sup> 2 SDK, Standard Edition, v 1.2.x</A></LI> <LI><A HREF="#JDK11">JDK<sup>TM</sup> 1.1.x</A></LI><LI><A HREF="#LDAPBP">Special Note for LDAP 1.2.2 Users</A></LI></UL><P><HR><P><A NAME="INTRO"><H2>Introduction</H2><p>This document describes how to use the DSML v1 service providerwith the Java 2 SDK, Standard Edition, v 1.4.x, v 1.3.x, v 1.2.x,and the JDK 1.1.x.It is a companion to the main<a href=jndi-dsml.html>DSML v1 Service Provider</a>document.<hr><p><A NAME="JDK14"><H2>Java 2 SDK, Standard Edition, v 1.4.x</H2><h4>Software Installation</h4><ol><li>Unzip the distribution file to get a <tt>lib</tt> directory. <li>If you are installing the DSML v1 provider as an <em>installed</em>extension, copy the JARs <tt>dsml.jar</tt> and <tt>providerutil.jar</tt>from the <tt>lib</tt> directory to the <tt>$JAVA_HOME/jre/lib/ext</tt> directory.<li>If you are not installing the DSML v1 provider as an installed extension,copy the JARs <tt>dsml.jar</tt> and <tt>providerutil.jar</tt> to their permanent location and add the location to your classpath.</ol><h4>Security Considerations</h4>The DSML v1 provider reads input from a URL. When a security manager has been installed, you must grant to the application using JNDI permission toaccess the data indicated by the URL. For example, if you are using a"file" URL, you need to grant the appropriate<tt>java.io.FilePermission</tt> for reading the file. If you are usingan "http" or "ldap" URL, you need to grant the appropriate<tt>java.net.SocketPermission</tt>.<p><pre>permission java.net.SocketPermission "<em>host</em>[:<em>port</em>]", "connect";</pre><blockquote> For the <em>host</em>/<em>port</em> identified in the <tt>java.naming.provider.url</tt> property.</blockquote><p><pre>permission java.io.FilePermission "<em>file</em>", "read";</pre><blockquote> <em>file</em> is the file identified in the <tt>java.naming.provider.url</tt> property.</blockquote><p>If you have installed the DSML v1 service provider as aninstalled extension, that is, <tt>dsml.jar</tt> has been installed in the<tt>$JAVA_HOME/jre/lib/ext</tt> directory, you need to take no furtheraction.<p><p>Otherwise, perform the following additional step:<ul><li>Grant the permissions listed aboveto the DSML v1 service provider (<tt>dsml.jar</tt>).</ol><hr><p><A NAME="JDK13"><H2>Java 2 SDK, Standard Edition, v 1.3.x</H2><p><em>Note</em>: If you plan on using the DSML v1 provider in a production environment,Sun recommends that you use J2SDK, v 1.4.x if at all possible, andonly use the following procedure as an interim measure until you canmigrate to v 1.4.x.<p><h4>Software Dependencies</h4><ul><li><a href=http://java.sun.com/xml/download.html/>Java API for XML Parsing, 1.1 or higher</a>.<br>Add the JAXP JARs to your execution classpath.</ul><h4>Software Installation</h4><ol><li>Unzip the distribution file to get a <tt>lib</tt> directory. <li>If you are installing the DSML v1 provider as an <em>installed</em>extension, copy the JARs <tt>dsml.jar</tt> and <tt>providerutil.jar</tt>from the <tt>lib</tt> directory to the <tt>$JAVA_HOME/jre/lib/ext</tt> directory.<li>If you are not installing the DSML v1 provider as an installed extension,copy the JARs <tt>dsml.jar</tt> and <tt>providerutil.jar</tt> to their permanent location and add the location to your classpath.</ol><h4>Runtime Instructions</h4>The <tt>providerutil.jar</tt> archive that comes with the DSML v1 provideris newer than the one in the Java 2 SDK, v 1.3.x. To use the DSML v1 provider,you need to override the version in the Java 2 SDK by usingthe <tt>-Xbootclasspath</tt> option as shown in the following example.<blockquote><pre>$JAVA_HOME/bin/java -Xbootclasspath/p:$JNDI_HOME/lib/providerutil.jar YourProgram</pre></blockquote>This configuration is not recommended for use in productionenvironments. For production environments, use the configuration forJ2SDK, v 1.4.x.<h4>Security Considerations</h4>The DSML v1 provider reads input from a URL. When a security manager has been installed, you must grant to the application using JNDI permission toaccess the data indicated by the URL. For example, if you are using a"file" URL, you need to grant the appropriate<tt>java.io.FilePermission</tt> for reading the file. If you are usingan "http" or "ldap" URL, you need to grant the appropriate<tt>java.net.SocketPermission</tt>.<p><pre>permission java.net.SocketPermission "<em>host</em>[:<em>port</em>]", "connect";</pre><blockquote> For the <em>host</em>/<em>port</em> identified in the <tt>java.naming.provider.url</tt> property.</blockquote><p><pre>permission java.io.FilePermission "<em>file</em>", "read";</pre><blockquote> <em>file</em> is the file identified in the <tt>java.naming.provider.url</tt> property.</blockquote><p>If you have installed the DSML v1 service provider as aninstalled extension, that is, <tt>dsml.jar</tt> has been installed in the<tt>$JAVA_HOME/jre/lib/ext</tt> directory, you need to take no furtheraction.<p><p>Otherwise, perform the following additional step:<ul><li>Grant the permissions listed aboveto the DSML v1 service provider (<tt>dsml.jar</tt>).</ol><hr><p><A NAME="JDK12"><H2>Java 2 SDK, Standard Edition, v 1.2.x</H2><p><h4>Software Dependencies</h4><ul><li><a href=http://java.sun.com/products/jndi/#download>JNDI 1.2</a>.<br>Add <tt>jndi.jar</tt> to your classpath or JRE installation.<li><a href=http://java.sun.com/products/jndi/#download>JNDI LDAP Provider 1.2.x</a>.<br>Add <tt>ldap.jar</tt> and <tt>providerutil.jar</tt>to your classpath or JRE installation.See the <a href=#LDAPBP>Special Note for LDAP 1.2.2 Users</a> section for further instructions if you are using the LDAP 1.2.2 provider.<li><a href=http://java.sun.com/xml/download.html/>Java API for XML Parsing, 1.1 or higher</a>.<br>Add the JAXP JARs to your execution classpath.</ul><h4>Software Installation</h4><ol><li>Unzip the distribution file to get a <tt>doc</tt> and<tt>lib</tt> directory. <li>If you are using JNDI as an <em>installed</em>extension, copy the JARs (<tt>dsml.jar</tt> and <tt>providerutil.jar</tt>)from the <tt>lib</tt> directory to the <tt>$JAVA_HOME/jre/lib/ext</tt> directory.<li>If you are not using JNDI as an installed extension,copy the JARs to their permanent locations and add their locationsto your classpath.</ol> <h4>Security Considerations</h4>The DSML v1 provider reads input from a URL. When a security manager has been installed, you must grant to the application using JNDI permission toaccess the data indicated by the URL. For example, if you are using a"file" URL, you need to grant the appropriate<tt>java.io.FilePermission</tt> for reading the file. If you are usingan "http" or "ldap" URL, you need to grant the appropriate<tt>java.net.SocketPermission</tt>.<p><pre>permission java.net.SocketPermission "<em>host</em>[:<em>port</em>]", "connect";</pre><blockquote> For the <em>host</em>/<em>port</em> identified in the <tt>java.naming.provider.url</tt> property.</blockquote><p><pre>permission java.io.FilePermission "<em>file</em>", "read";</pre><blockquote> <em>file</em> is the file identified in the <tt>java.naming.provider.url</tt> property.</blockquote><p>If you have installed the DSML v1 service provider as aninstalled extension, that is, <tt>dsml.jar</tt> has been installed in the<tt>$JAVA_HOME/jre/lib/ext</tt> directory, you need to take no furtheraction.<p><p>Otherwise, perform the following additional step:<ul><li>Grant the permissions listed aboveto the DSML v1 service provider (<tt>dsml.jar</tt>).<li>Grant the permissions listed in<a href="../jndi-ext.html#SEC">the JNDI 1.2 Optional Package document</a>.</ol><hr><p><A NAME="JDK11"><H2>JDK 1.1.x</h2><p><h4>Software Dependencies</h4><ul><li><a href=http://java.sun.com/products/jndi/#download>JNDI 1.2</a>.<br>Add <tt>jndi.jar</tt> to your classpath.<li><a href=http://java.sun.com/products/jndi/#download>JNDI LDAP Provider 1.2.x</a>.<br>Add <tt>ldap.jar</tt> and <tt>providerutil.jar</tt>to your classpath or JRE installation.See the <a href=#LDAPBP>Special Note for LDAP 1.2.2 Users</a> section for further instructions if you are using the LDAP 1.2.2 provider.<br><li><a href=http://java.sun.com/xml/download.html/>Java API for XML Parsing, 1.1 or higher</a>.<br>Add the JAXP JARs to your execution classpath.</ul><h4>Software Installation</h4><ol><li>Unzip the distribution file to get a <tt>lib</tt> directory. <li>Copy the JARs (<tt>dsml.jar</tt> and <tt>providerutil.jar</tt>)from the <tt>lib</tt> directory to their permanent location.<li>Add the location of the JARs to your classpath.</ol> <h4>Security Considerations</h4>Follow the instructions in<a href="../jndi-ext.html#JDK11">the JNDI Optional Package document</a>.<p>If you are using JNDI and the DSML v1 service provider from anapplet, you need to grant the applet permission toaccess the data indicated by the URL. <hr><p><A NAME="LDAPBP"><H2>Special Note for LDAP 1.2.2 Users</H2><em>Note 1</em>:This section applies only if you are using <tt>ldapbp.jar</tt>from the LDAP 1.2.2 release. If you are using LDAP 1.2.3 or higher releases, or if you are not using <tt>ldapbp.jar</tt>,you do not need to follow these instructions.<p><em>Note 2</em>:If you plan on using the DSML v1 provider in a production environment,Sun recommends that you upgrade your LDAP provider version to the latestrelease, or use J2SDK, v 1.4.x if at all possible, and only use the following procedure as an interim measure.<p>LDAP 1.2.2 has an outdated <tt>URLStreamHandler</tt> for the LDAP protocol.If you want to use an LDAP URL as the <tt>Context.PROVIDER_URL</tt>for configuring the DSML v1 provider, thenyou should use the <tt>URLStreamHandler</tt> that is included with the DSML v1 provider.To ensure that you use the correct <tt>URLStreamHandler</tt>,you must remove it from <tt>ldapbp.jar</tt> byfirst extracting the contents of the archiveand then recreating the archive without the <tt>URLStreamHandler</tt>,as follows. (The class files for the LDAP<tt>URLStreamHandler</tt> are located in the<tt>sun/net/www/protocol/ldap</tt> directory.)<blockquote><pre># jar -xf ldapbp.jar# jar -cfm ldapbp.jar META-INF/MANIFEST.MF com</pre></blockquote><p>After updating <tt>ldapbp.jar</tt>, to use the ldap <tt>URLStreamHandler</tt>,you must include the DSML v1 provider, following the instructions listedpreviously in this document.<HR SIZE=3 NOSHADE WIDTH=100%><br><i>Copyright © 2002 Sun Microsystems, Inc., All Rights Reserved.</i> </body></html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -