You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Leo Blumencweig (JIRA)" <ji...@apache.org> on 2011/01/13 19:37:47 UTC

[jira] Created: (DISCOVERY-13) Problem with Oracle JVM classLoader

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.4, 0.2
         Environment: Oracle Java stored procedure (oracle versions 8i -> 11g) Any OS
            Reporter: Leo Blumencweig
            Priority: Minor
             Fix For: 0.4, 0.2


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.
-
You can reply to this email to add a comment to the issue online.


[jira] [Commented] (DISCOVERY-13) Problem with Oracle JVM classLoader

Posted by "Leo Blumencweig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DISCOVERY-13?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13018950#comment-13018950 ] 

Leo Blumencweig commented on DISCOVERY-13:
------------------------------------------

No joy.

It seems that the key is that the CodeSource is unable to obtain a "location" (ie, getLocation returns null)

I'm not quite sure why is that happening, but I'm trying to dig a little bit deeper (it's a hard to debug enviroment, only way to do it is's System.out.println(...) )

I think that for thusday I'll will have some more insights or (I hope) a solution

In the mean time, any ideas, no matter how improbale, will be VERY APPRECIATED!!!

> 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
>            Assignee: Simone Tripodi
>            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

[jira] [Commented] (DISCOVERY-13) Problem with Oracle JVM classLoader

Posted by "Sebb (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DISCOVERY-13?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13017844#comment-13017844 ] 

Sebb commented on DISCOVERY-13:
-------------------------------

I.e. Discovery is probably making an incorrect assumption about the behaviour of ClassLoader.getResource().

It appears that the Oracle embedded JVM is not breaking the API contract when it treats classes differently from resources; classes are rather different from resources.

> 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

[jira] [Commented] (DISCOVERY-13) Problem with Oracle JVM classLoader

Posted by "Simone Tripodi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DISCOVERY-13?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13025649#comment-13025649 ] 

Simone Tripodi commented on DISCOVERY-13:
-----------------------------------------

I had a pvt dialog with Leo and looks like the JVM he's using requires the {{jserver:/resource/schema/${schema}/${resource}}} pattern to resolve resources in the classpath.
I propose to overlook it for 0.5 release and postpone for newer versions.
WDYT?

> 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
>            Assignee: Simone Tripodi
>            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

[jira] [Commented] (DISCOVERY-13) Problem with Oracle JVM classLoader

Posted by "Leo Blumencweig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DISCOVERY-13?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13025788#comment-13025788 ] 

Leo Blumencweig commented on DISCOVERY-13:
------------------------------------------

I think that the problem it's restricted to only one JVM, that in fact appears to be broken.
If you people think that it's OK, I volunter for it, but I since it's my first contribution to the project, I will need some (a lot of) guidance.

BTW, I whish to thanks a lot to Simone for his patience and good mood.

> 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
>            Assignee: Simone Tripodi
>            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

[jira] [Commented] (DISCOVERY-13) Problem with Oracle JVM classLoader

Posted by "Simone Tripodi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DISCOVERY-13?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13017601#comment-13017601 ] 

Simone Tripodi commented on DISCOVERY-13:
-----------------------------------------

Any hint for this issue? I don't have an Oracle JVM and there is no chance I'll install one, any suggestion?

> 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

[jira] [Commented] (DISCOVERY-13) Problem with Oracle JVM classLoader

Posted by "Leo Blumencweig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DISCOVERY-13?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13025881#comment-13025881 ] 

Leo Blumencweig commented on DISCOVERY-13:
------------------------------------------

I agree with you. Where do you suggest to put that overridable method?

> 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
>            Assignee: Simone Tripodi
>            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

[jira] [Commented] (DISCOVERY-13) Problem with Oracle JVM classLoader

Posted by "Sebb (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DISCOVERY-13?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13025844#comment-13025844 ] 

Sebb commented on DISCOVERY-13:
-------------------------------

In my opinion, the fact that the Oracle JVM does not allow classes to be found using the getResource() method does not mean that the Oracle JVM is broken. Nor is it broken if ProtectionDomain#getCodeSource() returns null, as that is specifically allowed.

As far as I can tell, the fact that the current code works for some JVMs is a by-product of their implementation, rather than a requirement.

> 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
>            Assignee: Simone Tripodi
>            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

[jira] [Commented] (DISCOVERY-13) Problem with Oracle JVM classLoader

Posted by "Simone Tripodi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DISCOVERY-13?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13433163#comment-13433163 ] 

Simone Tripodi commented on DISCOVERY-13:
-----------------------------------------

Apologize but I feel confused. What

{code}
new URL(new URL("http://localhost/ClassLoader-" + loader.hashCode() + "/somewhere/"), resourceName);
{code}

that hardcoded URL should mean? Can you please clarify me the strategy?
TIA!
                
> 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.5
>         Environment: Oracle Java stored procedure (oracle versions 8i -> 11g) Any OS
>            Reporter: Leo Blumencweig
>            Assignee: Simone Tripodi
>            Priority: Minor
>             Fix For: 0.6
>
>         Attachments: commons-discovery-0.5-discoverclasses-dummyurl.patch, commons-discovery-0.5-discoverclasses-dummyurl.patch
>
>   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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DISCOVERY-13) Problem with Oracle JVM classLoader

Posted by "Leo Blumencweig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DISCOVERY-13?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13018838#comment-13018838 ] 

Leo Blumencweig commented on DISCOVERY-13:
------------------------------------------

I'm on it, but constructing the right enviroment is a little bit complicated. I'm sure it will be ready for tomorrow +/- 1 day

> 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
>            Assignee: Simone Tripodi
>            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

[jira] [Commented] (DISCOVERY-13) Problem with Oracle JVM classLoader

Posted by "Simone Tripodi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DISCOVERY-13?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13433079#comment-13433079 ] 

Simone Tripodi commented on DISCOVERY-13:
-----------------------------------------

Thanks a lot for the followup - could you please submit a patch? It would be easier for me checking the modifications in!
TIA!
                
> 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.5
>         Environment: Oracle Java stored procedure (oracle versions 8i -> 11g) Any OS
>            Reporter: Leo Blumencweig
>            Assignee: Simone Tripodi
>            Priority: Minor
>             Fix For: 0.6
>
>   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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DISCOVERY-13) Problem with Oracle JVM classLoader

Posted by "Sebb (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DISCOVERY-13?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13025785#comment-13025785 ] 

Sebb commented on DISCOVERY-13:
-------------------------------

I agree that this problem is not related to the current tidy-up of DISCOVERY, so fixing it can be postponed.

But given that the problem is now known, it should at least be mentioned in the release notes.

> 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
>            Assignee: Simone Tripodi
>            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

[jira] [Commented] (DISCOVERY-13) Problem with Oracle JVM classLoader

Posted by "Sebb (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DISCOVERY-13?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13017612#comment-13017612 ] 

Sebb commented on DISCOVERY-13:
-------------------------------

The Javadoc for ClassLoader#getResource() says

{quote}
 URL java.lang.ClassLoader.getResource(String name)

Finds the resource with the given name. A resource is some data (images, audio, text, etc) that can be accessed by class code in a way that is independent of the location of the code. 

The name of a resource is a '/'-separated path name that identifies the resource. 
{quote}

This does not mention classes, so it may just be chance that the Sun JVM treats classes the same way as resources.

> 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

[jira] [Commented] (DISCOVERY-13) Problem with Oracle JVM classLoader

Posted by "Simone Tripodi (JIRA)" <ji...@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

[jira] [Commented] (DISCOVERY-13) Problem with Oracle JVM classLoader

Posted by "Sebb (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DISCOVERY-13?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13017966#comment-13017966 ] 

Sebb commented on DISCOVERY-13:
-------------------------------

No, I don't think it's invalid.

This issue looks remarkably similar to DISCOVERY-6 which AFAICT is also about (not) finding a class with getResource().

Why not just use the protectionDomain method, i.e. don't bother with using getResource() for a class?

Or at least, if 

102 :     url = loader.getResource(resourceName);

returns null, then also try the protectionDomain method.

> 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
>            Assignee: Simone Tripodi
>            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

[jira] [Commented] (DISCOVERY-13) Problem with Oracle JVM classLoader

Posted by "Ruslan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DISCOVERY-13?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13433120#comment-13433120 ] 

Ruslan commented on DISCOVERY-13:
---------------------------------

Can`t attach path, here is a link http://pastebin.com/T9gjiedx
I grant license to ASF for inclusion in ASF works.
                
> 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.5
>         Environment: Oracle Java stored procedure (oracle versions 8i -> 11g) Any OS
>            Reporter: Leo Blumencweig
>            Assignee: Simone Tripodi
>            Priority: Minor
>             Fix For: 0.6
>
>         Attachments: commons-discovery-0.5-discoverclasses-dummyurl.patch, commons-discovery-0.5-discoverclasses-dummyurl.patch
>
>   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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DISCOVERY-13) Problem with Oracle JVM classLoader

Posted by "Simone Tripodi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DISCOVERY-13?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13017931#comment-13017931 ] 

Simone Tripodi commented on DISCOVERY-13:
-----------------------------------------

AFAIK when loading an URL with this (simplified) method

{code}
Class<?> clazz = ...;
String className = clazz.getName();
String resourceName = className.replace('.','/') + ".class";
URL resource = clazz.getClassLoader().getResource(resourceName);
{code}

the class is data resource, it shouldn't be different than loading a txt or jpg...

> 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

[jira] [Commented] (DISCOVERY-13) Problem with Oracle JVM classLoader

Posted by "Leo Blumencweig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DISCOVERY-13?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13025852#comment-13025852 ] 

Leo Blumencweig commented on DISCOVERY-13:
------------------------------------------

Sebb, it's not only that you can't use getResource() to found classes. In fact, I found absoutely no way to found the origin of some class. That is:

1) I load the class
2) I cannot tell from where the class came (network, jar, database, jar in the database ...).

There is only a partial form, that is assuming it's in some schema of the database and then finding the schema.

What do you think?

Thanks
   Leo


> 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
>            Assignee: Simone Tripodi
>            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

[jira] [Commented] (DISCOVERY-13) Problem with Oracle JVM classLoader

Posted by "Sebb (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DISCOVERY-13?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13025727#comment-13025727 ] 

Sebb commented on DISCOVERY-13:
-------------------------------

I take it you mean classes in the classpath, not resources in the classpath? Classes are not resources.

> 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
>            Assignee: Simone Tripodi
>            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

[jira] [Resolved] (DISCOVERY-13) Problem with Oracle JVM classLoader

Posted by "Simone Tripodi (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DISCOVERY-13?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Simone Tripodi resolved DISCOVERY-13.
-------------------------------------

    Resolution: Fixed

fixed on trunk, see DiscoverClasses r1090700 for review, thanks Seb for reviewing!

> 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
>            Assignee: Simone Tripodi
>            Priority: Minor
>             Fix For: 0.4, 0.2
>
>   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

[jira] [Commented] (DISCOVERY-13) Problem with Oracle JVM classLoader

Posted by "Sebb (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DISCOVERY-13?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13025861#comment-13025861 ] 

Sebb commented on DISCOVERY-13:
-------------------------------

If it's not possible using the defined Java API, it's not possible.

It does not seem right to add special code to support the Oracle JVM.

However, it might be possible to provide an overridable method to convert a class name into a form that works with getResource().

> 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
>            Assignee: Simone Tripodi
>            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

[jira] [Commented] (DISCOVERY-13) Problem with Oracle JVM classLoader

Posted by "Simone Tripodi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DISCOVERY-13?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13018765#comment-13018765 ] 

Simone Tripodi commented on DISCOVERY-13:
-----------------------------------------

Hola Leo, any update on it? Did the patch work?

> 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
>            Assignee: Simone Tripodi
>            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

[jira] [Commented] (DISCOVERY-13) Problem with Oracle JVM classLoader

Posted by "Simone Tripodi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DISCOVERY-13?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13433132#comment-13433132 ] 

Simone Tripodi commented on DISCOVERY-13:
-----------------------------------------

I see you attached patches twice, what's wrong with plain old files? Every user should be able to attach patches!

Thanks anyway, I'll review it as soon as I get the chance.
                
> 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.5
>         Environment: Oracle Java stored procedure (oracle versions 8i -> 11g) Any OS
>            Reporter: Leo Blumencweig
>            Assignee: Simone Tripodi
>            Priority: Minor
>             Fix For: 0.6
>
>         Attachments: commons-discovery-0.5-discoverclasses-dummyurl.patch, commons-discovery-0.5-discoverclasses-dummyurl.patch
>
>   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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (DISCOVERY-13) Problem with Oracle JVM classLoader

Posted by "Ruslan (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DISCOVERY-13?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ruslan updated DISCOVERY-13:
----------------------------

    Attachment: commons-discovery-0.5-discoverclasses-dummyurl.patch

Patch against 0.5 which uses safe to use loadClass() + some dummy URL construction.
                
> 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.5
>         Environment: Oracle Java stored procedure (oracle versions 8i -> 11g) Any OS
>            Reporter: Leo Blumencweig
>            Assignee: Simone Tripodi
>            Priority: Minor
>             Fix For: 0.6
>
>         Attachments: commons-discovery-0.5-discoverclasses-dummyurl.patch
>
>   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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (DISCOVERY-13) Problem with Oracle JVM classLoader

Posted by "Ruslan (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DISCOVERY-13?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ruslan updated DISCOVERY-13:
----------------------------

    Attachment: commons-discovery-0.5-discoverclasses-dummyurl.patch
    
> 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.5
>         Environment: Oracle Java stored procedure (oracle versions 8i -> 11g) Any OS
>            Reporter: Leo Blumencweig
>            Assignee: Simone Tripodi
>            Priority: Minor
>             Fix For: 0.6
>
>         Attachments: commons-discovery-0.5-discoverclasses-dummyurl.patch, commons-discovery-0.5-discoverclasses-dummyurl.patch
>
>   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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DISCOVERY-13) Problem with Oracle JVM classLoader

Posted by "Ruslan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DISCOVERY-13?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13433176#comment-13433176 ] 

Ruslan commented on DISCOVERY-13:
---------------------------------

It is unique URL for this class which should never be used. 

I believe there is no such case to actually call org.apache.commons.discovery.Resource.getResource() on org.apache.commons.discovery.ResourceClass instances. 

Maybe it is better to override getResource() and getResourceAsStream() in ResourceClass to make them throw NotSupportedOperationException. Maybe it is better to do only if real URL of class can`t be determined by using ProtectionDomain#getCodeSource().
                
> 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.5
>         Environment: Oracle Java stored procedure (oracle versions 8i -> 11g) Any OS
>            Reporter: Leo Blumencweig
>            Assignee: Simone Tripodi
>            Priority: Minor
>             Fix For: 0.6
>
>         Attachments: commons-discovery-0.5-discoverclasses-dummyurl.patch, commons-discovery-0.5-discoverclasses-dummyurl.patch
>
>   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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DISCOVERY-13) Problem with Oracle JVM classLoader

Posted by "Sebb (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DISCOVERY-13?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13017916#comment-13017916 ] 

Sebb commented on DISCOVERY-13:
-------------------------------

AIUI, classes are not data.

Also, resource names use /-separated path names - classes do not.

> 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

[jira] [Reopened] (DISCOVERY-13) Problem with Oracle JVM classLoader

Posted by "Phil Steitz (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DISCOVERY-13?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Phil Steitz reopened DISCOVERY-13:
----------------------------------


>From comments, it looks like this issue is actually still open and needs to be assigned a later release for resolution.

> 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
>            Assignee: Simone Tripodi
>            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

[jira] [Updated] (DISCOVERY-13) Problem with Oracle JVM classLoader

Posted by "Simone Tripodi (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DISCOVERY-13?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Simone Tripodi updated DISCOVERY-13:
------------------------------------

    Affects Version/s:     (was: 0.4)
                           (was: 0.2)
                       0.5
        Fix Version/s:     (was: 0.4)
                           (was: 0.2)
                       0.6

> 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.5
>         Environment: Oracle Java stored procedure (oracle versions 8i -> 11g) Any OS
>            Reporter: Leo Blumencweig
>            Assignee: Simone Tripodi
>            Priority: Minor
>             Fix For: 0.6
>
>   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

[jira] [Commented] (DISCOVERY-13) Problem with Oracle JVM classLoader

Posted by "Simone Tripodi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DISCOVERY-13?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13017962#comment-13017962 ] 

Simone Tripodi commented on DISCOVERY-13:
-----------------------------------------

Seb, sorry for the misunderstanding, I just realized I spoke about a totally different topic, apologizes :(
This issue should be closed as INVALID. WDYT?


> 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
>            Assignee: Simone Tripodi
>            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

[jira] [Commented] (DISCOVERY-13) Problem with Oracle JVM classLoader

Posted by "Leo Blumencweig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DISCOVERY-13?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13018094#comment-13018094 ] 

Leo Blumencweig commented on DISCOVERY-13:
------------------------------------------

Thank you people! I'll try it right now

> 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
>            Assignee: Simone Tripodi
>            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

[jira] [Commented] (DISCOVERY-13) Problem with Oracle JVM classLoader

Posted by "Simone Tripodi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DISCOVERY-13?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13025778#comment-13025778 ] 

Simone Tripodi commented on DISCOVERY-13:
-----------------------------------------

Hi Seb,
situation is that in DiscoverClasses:

{code}
final String resourceName = className.replace('.','/') + ".class";
...
URL url = null;

try {
    url = loader.getResource(resourceName);
} catch (UnsupportedOperationException e) {
    // ignore
}

if (url == null) {
    try {
        CodeSource codeSource = loader.loadClass(className)
            .getProtectionDomain()
            .getCodeSource();
        if (codeSource != null) {
            url = new URL(codeSource.getLocation(), resourceName);
        }
        // else keep url null
    } catch (Exception le) {
        // keep url null
    }
}
{code}

the fact is that inside Leo's JVM both methods fails; the only chance we can get it works, is modifying the resourceName prefix:
{code}
final String resourceName = "jserver:/resource/schema/${schema}/" + className.replace('.','/') + ".class";
{code}

since it could require some existing code modification, I suggest to postpone this issue for next release.
WDYT?

> 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
>            Assignee: Simone Tripodi
>            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

[jira] [Commented] (DISCOVERY-13) Problem with Oracle JVM classLoader

Posted by "Ruslan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DISCOVERY-13?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13433058#comment-13433058 ] 

Ruslan commented on DISCOVERY-13:
---------------------------------

Sybase Adaptive Enterprise Server (ASE) 15.5 have a similar problems:

- ClassLoader.getResource() for classes returns NULL.
- ProtectionDomain#getCodeSource() returns something which is not a valid URI.

I believe there is no point in calling ProtectionDomain#getCodeSource().
The only reason to store URI is to uniquely identify loaded class.
I propose following replacement:

{code:java}
Class cls = loader.loadClass(className);
if (cls != null) {
// Construct some synthetic never used URL
url = new URL(new URL("http://localhost/ClassLoader-" + loader.hashCode() + "/somewhere/"), resourceName);
}
{code}

                
> 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.5
>         Environment: Oracle Java stored procedure (oracle versions 8i -> 11g) Any OS
>            Reporter: Leo Blumencweig
>            Assignee: Simone Tripodi
>            Priority: Minor
>             Fix For: 0.6
>
>   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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (DISCOVERY-13) Problem with Oracle JVM classLoader

Posted by "Simone Tripodi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DISCOVERY-13?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13018841#comment-13018841 ] 

Simone Tripodi commented on DISCOVERY-13:
-----------------------------------------

thanks for your help!!! :)

> 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
>            Assignee: Simone Tripodi
>            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