You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by "Benson Margulies (JIRA)" <ji...@apache.org> on 2009/09/11 22:32:57 UTC

[jira] Created: (SOLR-1425) Better exception messages for classloader mishaps

Better exception messages for classloader mishaps
-------------------------------------------------

                 Key: SOLR-1425
                 URL: https://issues.apache.org/jira/browse/SOLR-1425
             Project: Solr
          Issue Type: New Feature
          Components: search
    Affects Versions: 1.3
            Reporter: Benson Margulies


If an idiot such as myself tries to specify a filter or such that lives in a parent classloader, such as the system classloader of a servlet container, Solr will fail to load it. The JVM is prone to create an exception that mentions some Solr interface as being missing instead of the filter itself. It would be less confusing for the miscreant if Solr were to try/catch ClassNotFound and NoClassDefError and throw its own exception with the name of the thing specified in the schema included in the message.



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-1425) Better exception messages for classloader mishaps

Posted by "Benson Margulies (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-1425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12754527#action_12754527 ] 

Benson Margulies commented on SOLR-1425:
----------------------------------------

I think it would be less work for me to make you a patch than to help you diagnose this.

> Better exception messages for classloader mishaps
> -------------------------------------------------
>
>                 Key: SOLR-1425
>                 URL: https://issues.apache.org/jira/browse/SOLR-1425
>             Project: Solr
>          Issue Type: New Feature
>          Components: search
>    Affects Versions: 1.3
>            Reporter: Benson Margulies
>
> If an idiot such as myself tries to specify a filter or such that lives in a parent classloader, such as the system classloader of a servlet container, Solr will fail to load it. The JVM is prone to create an exception that mentions some Solr interface as being missing instead of the filter itself. It would be less confusing for the miscreant if Solr were to try/catch ClassNotFound and NoClassDefError and throw its own exception with the name of the thing specified in the schema included in the message.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-1425) Better exception messages for classloader mishaps

Posted by "Benson Margulies (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-1425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12754589#action_12754589 ] 

Benson Margulies commented on SOLR-1425:
----------------------------------------

Here's some relevant backtrace.

Launcher$AppClassLoader(ClassLoader).loadClass(String, boolean) line: 347	
Launcher$AppClassLoader.loadClass(String, boolean) line: 330	
Launcher$AppClassLoader(ClassLoader).loadClass(String) line: 254	
WebAppClassLoader.loadClass(String, boolean) line: 379	
WebAppClassLoader.loadClass(String) line: 341	
WebAppClassLoader(ClassLoader).loadClassInternal(String) line: 399	
Class<T>.forName0(String, boolean, ClassLoader) line: not available [native method]	
Class<T>.forName(String, boolean, ClassLoader) line: 247	
SolrResourceLoader.findClass(String, String...) line: 257	
SolrResourceLoader.newInstance(String, String...) line: 278	
IndexSchema$4(AbstractPluginLoader<T>).create(ResourceLoader, String, String, Node) line: 83	
IndexSchema$4(AbstractPluginLoader<T>).load(ResourceLoader, NodeList) line: 140	


> Better exception messages for classloader mishaps
> -------------------------------------------------
>
>                 Key: SOLR-1425
>                 URL: https://issues.apache.org/jira/browse/SOLR-1425
>             Project: Solr
>          Issue Type: New Feature
>          Components: search
>    Affects Versions: 1.3
>            Reporter: Benson Margulies
>
> If an idiot such as myself tries to specify a filter or such that lives in a parent classloader, such as the system classloader of a servlet container, Solr will fail to load it. The JVM is prone to create an exception that mentions some Solr interface as being missing instead of the filter itself. It would be less confusing for the miscreant if Solr were to try/catch ClassNotFound and NoClassDefError and throw its own exception with the name of the thing specified in the schema included in the message.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-1425) Better exception messages for classloader mishaps

Posted by "Hoss Man (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-1425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12754483#action_12754483 ] 

Hoss Man commented on SOLR-1425:
--------------------------------

(FWIW: this is an offshoot of SOLR-1419)

Benson: can you post the *FULL* stacktrace of what you see in your VM when you encounter a problem like this?

The stack trace you posted in SOLR-1419 is only partial (note that it starts with "Caused by" ... there should have been more before that)  SolrResourceLoader already catches ClassNotFound and logs appropriate info -- so that stack trace you posted should have started with something more useful.


> Better exception messages for classloader mishaps
> -------------------------------------------------
>
>                 Key: SOLR-1425
>                 URL: https://issues.apache.org/jira/browse/SOLR-1425
>             Project: Solr
>          Issue Type: New Feature
>          Components: search
>    Affects Versions: 1.3
>            Reporter: Benson Margulies
>
> If an idiot such as myself tries to specify a filter or such that lives in a parent classloader, such as the system classloader of a servlet container, Solr will fail to load it. The JVM is prone to create an exception that mentions some Solr interface as being missing instead of the filter itself. It would be less confusing for the miscreant if Solr were to try/catch ClassNotFound and NoClassDefError and throw its own exception with the name of the thing specified in the schema included in the message.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-1425) Better exception messages for classloader mishaps

Posted by "Benson Margulies (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-1425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12754528#action_12754528 ] 

Benson Margulies commented on SOLR-1425:
----------------------------------------

Are there existing test cases in this area?


> Better exception messages for classloader mishaps
> -------------------------------------------------
>
>                 Key: SOLR-1425
>                 URL: https://issues.apache.org/jira/browse/SOLR-1425
>             Project: Solr
>          Issue Type: New Feature
>          Components: search
>    Affects Versions: 1.3
>            Reporter: Benson Margulies
>
> If an idiot such as myself tries to specify a filter or such that lives in a parent classloader, such as the system classloader of a servlet container, Solr will fail to load it. The JVM is prone to create an exception that mentions some Solr interface as being missing instead of the filter itself. It would be less confusing for the miscreant if Solr were to try/catch ClassNotFound and NoClassDefError and throw its own exception with the name of the thing specified in the schema included in the message.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.