Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 78075 invoked from network); 9 Apr 2011 16:53:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 9 Apr 2011 16:53:46 -0000 Received: (qmail 69205 invoked by uid 500); 9 Apr 2011 16:53:46 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 69150 invoked by uid 500); 9 Apr 2011 16:53:46 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 69142 invoked by uid 99); 9 Apr 2011 16:53:46 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 09 Apr 2011 16:53:46 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 09 Apr 2011 16:53:43 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id B177D9992B for ; Sat, 9 Apr 2011 16:53:05 +0000 (UTC) Date: Sat, 9 Apr 2011 16:53:05 +0000 (UTC) From: "Simone Tripodi (JIRA)" To: issues@commons.apache.org Message-ID: <2053624876.46626.1302367985723.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <28707719.348781294943867455.JavaMail.jira@thor> Subject: [jira] [Commented] (DISCOVERY-13) Problem with Oracle JVM classLoader MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DISCOVERY-13?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13017905#comment-13017905 ] Simone Tripodi commented on DISCOVERY-13: ----------------------------------------- Classes are data, the JVM shouldn't discriminate resources by the type... the tense {quote} A resource is *some data* (images, audio, text, *etc*) {quote} is so generic that, even if it doesn't explicitly mention classes, it suggests that classes shouldn't be threaded in a different way... What did I loose? I googled a little but didn't find anything useful, any idea? > Problem with Oracle JVM classLoader > ----------------------------------- > > Key: DISCOVERY-13 > URL: https://issues.apache.org/jira/browse/DISCOVERY-13 > Project: Commons Discovery > Issue Type: Improvement > Affects Versions: 0.2, 0.4 > Environment: Oracle Java stored procedure (oracle versions 8i -> 11g) Any OS > Reporter: Leo Blumencweig > Priority: Minor > Fix For: 0.2, 0.4 > > Original Estimate: 504h > Remaining Estimate: 504h > > First of all, excuse my bad english (I'm an spanish speaker) > Starting in version 8i, Oracle provides an embedded JVM inside th databases, in order to develop a stored procedure inJava language, later to be invoked via PL/SQL. > Saddly, the JVM has some quirks, for example an somehow brain-damaged classLoader (oracle.aurora.rdbms.OracleClassLoader). > This JVM stores the classes inside table objects (very reasonable). > This leads to some problem: the resources haves some strange URL (example: jserver:/resource/schema/NAME_OF_THE_SCHEMA/ar.com.menhir.config.properties). > It will be not problema at all except because it's brain damage insist in telling that the above URL works only with RESOURCES and not with CLASSES!! > for example, the following example > private static void getData ( ClassLoader cl , String str ){ > System.out.println(str +".class" + "-> "+cl.getResource(str+".class")); > System.out.println(str +".class" + "-> "+ClassLoader.getSystemResource(str+".class")); > } > ... > getData(Test.class.getClassLoader(),"ar.com.menhir.wstest.Test"); > ... > gives this 2 results: > with normal classLoader ( sun.misc.Launcher$AppClassLoader) > ar/com/menhir/wstest/Test.class-> file:/C:/Users/LeoB/workspace2/prueba/bin/ar/com/menhir/wstest/Test.class > ar/com/menhir/wstest/Test.class-> file:/C:/Users/LeoB/workspace2/prueba/bin/ar/com/menhir/wstest/Test.class > with oracle classLoader (oracle.aurora.rdbms.OracleClassLoader) > ar/com/menhir/wstest/Test.class-> null > ar/com/menhir/wstest/Test.class-> null > The problem arises in org.apache.commons.discovery.resource.classes.DiscoverClasses, where the line 60 > final String resourceName = className.replace('.','/') + ".class"; > points to a nonexistente resource. > my workaround was to hack this class with the following: > final String resourceName = ar.com.menhir.oracle.resources.Utils.getResourcePrefix(className).replace('.','/') + ".class"; > where getResourcePrefix gets the correct prefix for this class. > You must note that this is a somehow brutal way of solving. I'm interested in contribute with the wright way, but I'm not very sure of where to start. > Could you please help me? > Thank you > Leo Blumencweig -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira