You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by ce...@apache.org on 2004/05/21 12:50:39 UTC

cvs commit: logging-log4j/src/java/org/apache/log4j/db JNDIConnectionSource.java

ceki        2004/05/21 03:50:39

  Modified:    src/java/org/apache/log4j/xml XMLDecoder.java
               src/java/org/apache/log4j/db JNDIConnectionSource.java
  Log:
  
  The javax.rmi.PortableRemoteObject is not part of JDK 1.2. Stopped
  using it in JNDIConenctionSource.
  
  In o.a.l.xml.XMLDecoder failed to compile because it uses
  Collections.EMPTY_MAP to initialize the additionalProperties field. It was
  changed use a new HashMap().
  
  Revision  Changes    Path
  1.15      +2 -2      logging-log4j/src/java/org/apache/log4j/xml/XMLDecoder.java
  
  Index: XMLDecoder.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/xml/XMLDecoder.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- XMLDecoder.java	21 May 2004 06:19:32 -0000	1.14
  +++ XMLDecoder.java	21 May 2004 10:50:39 -0000	1.15
  @@ -21,7 +21,7 @@
   import java.io.LineNumberReader;
   import java.io.StringReader;
   import java.net.URL;
  -import java.util.Collections;
  +import java.util.HashMap;
   import java.util.Hashtable;
   import java.util.Map;
   import java.util.Vector;
  @@ -64,7 +64,7 @@
     private static final String RECORD_END = "</log4j:event>";
     private DocumentBuilderFactory dbf;
     private DocumentBuilder docBuilder;
  -  private Map additionalProperties = Collections.EMPTY_MAP;
  +  private Map additionalProperties = new HashMap();
     private String partialEvent;
     
     public XMLDecoder() {
  
  
  
  1.6       +7 -2      logging-log4j/src/java/org/apache/log4j/db/JNDIConnectionSource.java
  
  Index: JNDIConnectionSource.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/db/JNDIConnectionSource.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- JNDIConnectionSource.java	20 May 2004 15:37:59 -0000	1.5
  +++ JNDIConnectionSource.java	21 May 2004 10:50:39 -0000	1.6
  @@ -21,7 +21,9 @@
   import javax.naming.Context;
   import javax.naming.InitialContext;
   import javax.naming.NamingException;
  -import javax.rmi.PortableRemoteObject;
  +
  +// PortableRemoteObject was introduced in JDK 1.3. We won't use it.
  +// import javax.rmi.PortableRemoteObject;
   import javax.sql.DataSource;
   
   import org.apache.log4j.db.dialect.Util;
  @@ -154,7 +156,10 @@
       DataSource ds;
       Context ctx = new InitialContext();
       Object obj = ctx.lookup(jndiLocation);
  -    ds = (DataSource)PortableRemoteObject.narrow(obj, DataSource.class);
  +
  +    // PortableRemoteObject was introduced in JDK 1.3. We won't use it.
  +    //ds = (DataSource)PortableRemoteObject.narrow(obj, DataSource.class);
  +    ds = (DataSource) obj;
   
       if (ds == null) {
         throw new SQLException("Failed to obtain data source from JNDI location " + jndiLocation);
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org