[jira] Created: (SOLR-13) patch to Config class; improves the loading of resources from classpath

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (SOLR-13) patch to Config class; improves the loading of resources from classpath

Hudson (Jira)
patch to Config class; improves the loading of resources from classpath
-----------------------------------------------------------------------

         Key: SOLR-13
         URL: http://issues.apache.org/jira/browse/SOLR-13
     Project: Solr
        Type: Improvement

 Environment: Mac OS 10.4.6, Java 1.5.0_06, JBoss 4.0.1
    Reporter: Mike Baranczak
    Priority: Minor


If config files aren't found in the expected places, Config attempts to find them on the classpath. The trouble is, it's using the current thread's context classpath, which means that the web application's own classpath is ignored.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (SOLR-13) patch to Config class; improves the loading of resources from classpath

Hudson (Jira)
     [ http://issues.apache.org/jira/browse/SOLR-13?page=all ]

Mike Baranczak updated SOLR-13:
-------------------------------

    Attachment: config.patch

patch submitted by Mike Baranczak of epublishing.com


> patch to Config class; improves the loading of resources from classpath
> -----------------------------------------------------------------------
>
>          Key: SOLR-13
>          URL: http://issues.apache.org/jira/browse/SOLR-13
>      Project: Solr
>         Type: Improvement

>  Environment: Mac OS 10.4.6, Java 1.5.0_06, JBoss 4.0.1
>     Reporter: Mike Baranczak
>     Priority: Minor
>  Attachments: config.patch
>
> If config files aren't found in the expected places, Config attempts to find them on the classpath. The trouble is, it's using the current thread's context classpath, which means that the web application's own classpath is ignored.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (SOLR-13) patch to Config class; improves the loading of resources from classpath

Hudson (Jira)
In reply to this post by Hudson (Jira)
    [ http://issues.apache.org/jira/browse/SOLR-13?page=comments#action_12375913 ]

Yonik Seeley commented on SOLR-13:
----------------------------------

Hmmm, I had used Config.class in the past, but I switched to the context classloader when I saw this Nutch bug:
http://issues.apache.org/jira/browse/NUTCH-142

It seems like these two bugs contradict.

Anyway, I'm inclined to commit your patch since it only tries the classloader for Config if the context classloader fails to find the resource.

> patch to Config class; improves the loading of resources from classpath
> -----------------------------------------------------------------------
>
>          Key: SOLR-13
>          URL: http://issues.apache.org/jira/browse/SOLR-13
>      Project: Solr
>         Type: Improvement

>  Environment: Mac OS 10.4.6, Java 1.5.0_06, JBoss 4.0.1
>     Reporter: Mike Baranczak
>     Priority: Minor
>  Attachments: config.patch
>
> If config files aren't found in the expected places, Config attempts to find them on the classpath. The trouble is, it's using the current thread's context classpath, which means that the web application's own classpath is ignored.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply | Threaded
Open this post in threaded view
|

Re: [jira] Commented: (SOLR-13) patch to Config class; improves the loading of resources from classpath

Mike Baranczak-2
Class loading in J2EE can get pretty weird, and I confess I still  
don't fully understand it. I looked into this matter further and I  
realized two things:

1) According to the J2EE specs, the context classloader is, in fact,  
the correct one to use in a situation like this.

2) I now can't replicate the bug that this patch was designed to fix.  
So I'm thinking I may have just made a mistake while setting up my  
web app, and put the config files in the wrong place.

So my patch probably won't do any harm, but I'm not sure if it's  
necessary.

-MB



On Apr 23, 2006, at 5:42 PM, Yonik Seeley (JIRA) wrote:

>     [ http://issues.apache.org/jira/browse/SOLR-13?
> page=comments#action_12375913 ]
>
> Yonik Seeley commented on SOLR-13:
> ----------------------------------
>
> Hmmm, I had used Config.class in the past, but I switched to the  
> context classloader when I saw this Nutch bug:
> http://issues.apache.org/jira/browse/NUTCH-142
>
> It seems like these two bugs contradict.
>
> Anyway, I'm inclined to commit your patch since it only tries the  
> classloader for Config if the context classloader fails to find the  
> resource.
>
>> patch to Config class; improves the loading of resources from  
>> classpath
>> ---------------------------------------------------------------------
>> --
>>
>>          Key: SOLR-13
>>          URL: http://issues.apache.org/jira/browse/SOLR-13
>>      Project: Solr
>>         Type: Improvement
>
>>  Environment: Mac OS 10.4.6, Java 1.5.0_06, JBoss 4.0.1
>>     Reporter: Mike Baranczak
>>     Priority: Minor
>>  Attachments: config.patch
>>
>> If config files aren't found in the expected places, Config  
>> attempts to find them on the classpath. The trouble is, it's using  
>> the current thread's context classpath, which means that the web  
>> application's own classpath is ignored.
>
> --
> This message is automatically generated by JIRA.
> -
> If you think it was sent incorrectly contact one of the  
> administrators:
>    http://issues.apache.org/jira/secure/Administrators.jspa
> -
> For more information on JIRA, see:
>    http://www.atlassian.com/software/jira
>

Reply | Threaded
Open this post in threaded view
|

[jira] Closed: (SOLR-13) patch to Config class; improves the loading of resources from classpath

Hudson (Jira)
In reply to this post by Hudson (Jira)
     [ http://issues.apache.org/jira/browse/SOLR-13?page=all ]
     
Yonik Seeley closed SOLR-13:
----------------------------

    Resolution: Cannot Reproduce
     Assign To: Yonik Seeley

Closing... user indicated they can't reproduce the class-not-found problem.

> patch to Config class; improves the loading of resources from classpath
> -----------------------------------------------------------------------
>
>          Key: SOLR-13
>          URL: http://issues.apache.org/jira/browse/SOLR-13
>      Project: Solr
>         Type: Improvement

>  Environment: Mac OS 10.4.6, Java 1.5.0_06, JBoss 4.0.1
>     Reporter: Mike Baranczak
>     Assignee: Yonik Seeley
>     Priority: Minor
>  Attachments: config.patch
>
> If config files aren't found in the expected places, Config attempts to find them on the classpath. The trouble is, it's using the current thread's context classpath, which means that the web application's own classpath is ignored.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira