Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: JNDI Failure - OutOfMemoryError

Re: JNDI Failure - OutOfMemoryError

From: Doeni <doeni_at_evhr.net>
Date: 22 Feb 2002 21:09:44 +0100
Message-ID: <87wux5s2gn.fsf@evhr.net>

Works for me (Well, I get an error because I have no LDAP server. But I do not get the OutOfMemory exception)

I am using 8.1.7.0 on Linux.
SVRMGR> show parameter pool_size

NAME                                TYPE    VALUE
----------------------------------- ------- ------------------------------
java_pool_size                      string  41943040                      
large_pool_size                     string  1024000                       
shared_pool_size                    string  52428800                      

As far as I remember, JNDI does not work on JServer on anything less than 8.1.7.

"Richard Williams" <rwilliam_at_cst-hsv.com> writes:

> Has anyone seen the problem below -
>
> When I first started trying to do this I was getting failures to instantiate
> LDAPCtxFactory errors. I resolved this by NOT loading the jndi.jar,
> ldap.jar, and providerutil.jar classes to my schema, but relying on the ones
> already in the Oracle JServer.
>
> I have been given JAVASYSPRIV and have also tried using
> dbms_java.grant_permission for the setFactory java.lang.RuntimePermission
> and granting the java.net.SocketPermission for connect and resolve to my
> explicit ldap url.
>
> I'm really stumped.
>
> Here is the Java Code
>
> =================================================================
>
> package com.cst.portal.security;
>
> import javax.naming.*;
>
> import javax.naming.directory.*;
>
> import java.util.*;
>
> public class LDAPTest {
>
> public static void main (String[] args) {
>
> System.out.println(getInitialDirContext());
>
> }
>
> public static String getInitialDirContext () {
>
> String result = "";
>
> Hashtable env = new Hashtable();
>
> env.put(Context.INITIAL_CONTEXT_FACTORY,
>
> "com.sun.jndi.ldap.LdapCtxFactory");
>
> env.put(Context.PROVIDER_URL,
>
> "ldap://myserver.mycompany.com:389");
>
> try {
>
> // Where the code dies
>
> DirContext ctx = new InitialDirContext(env);
>
> return "SUCCESS";
>
> }
>
> catch (Exception e) {
>
> System.out.println (e.getMessage());
>
> return "FAILURE - " + e.getMessage();
>
> }
>
> }
>
> }
>
>
>
> =================================================================
>
> This gets published to the database as the following package
>
> =================================================================
>
> PACKAGE EXTAUTH AUTHID CURRENT_USER AS
>
> FUNCTION GETINITIALDIRCONTEXT RETURN VARCHAR2
>
> AS LANGUAGE JAVA
>
> NAME 'com.cst.portal.security.LDAPTest.getInitialDirContext() return
> java.lang.String';
>
> END EXTAUTH;
>
> =================================================================
>
> When the Java Stored procedure is called with this PL/SQL
>
> =================================================================
>
> DECLARE
>
> result VARCHAR2(255);
>
> BEGIN
>
> dbms_java.SET_OUTPUT(2000);
>
> result := EXTAUTH.getInitialDirContext();
>
> dbms_output.put_line(result);
>
> END;
>
> =================================================================
>
> This is the result on dbms_out
>
> =================================================================
>
> java.lang.OutOfMemoryError
>
> at java.lang.Thread.start(Thread.java)
>
> at com.sun.jndi.ldap.Connection.<init>(Connection.java:170)
>
> at com.sun.jndi.ldap.LdapClient.<init>(LdapClient.java:85)
>
> at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2251)
>
> at com.sun.jndi.ldap.LdapCtx.<init>(LdapCtx.java:210)
>
> at
> com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:83)
>
> at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java)
>
> at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java)
>
> at javax.naming.InitialContext.init(InitialContext.java)
>
> at javax.naming.InitialContext.<init>(InitialContext.java)
>
> at javax.naming.directory.InitialDirContext.<init>(InitialDirContext.java)
>
> at com.cst.portal.security.LDAPTest.getInitialDirContext(LDAPTest.java:20)
>
>
>
>
>
> Richard Williams
>
> CTO
>
> Computer Systems Technology, Inc.
>
> Huntsville, AL
>
> Voice: 256-890-3076
>
> Email: rwilliam_at_cst-hsv.com
>
>
>
>

-- 
		 L'homme sage apprend de ses erreurs.
	  L'homme plus sage apprend des erreurs des autres.
Received on Fri Feb 22 2002 - 14:09:44 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US