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 "Luke Forehand (JIRA)" <ji...@apache.org> on 2009/09/03 22:28:57 UTC

[jira] Created: (SOLR-1408) Allow classes from ${solr.home}/lib to be loaded by the same classloader as solr war to prevent ClassCastException

Allow classes from ${solr.home}/lib to be loaded by the same classloader as solr war to prevent ClassCastException
------------------------------------------------------------------------------------------------------------------

                 Key: SOLR-1408
                 URL: https://issues.apache.org/jira/browse/SOLR-1408
             Project: Solr
          Issue Type: Improvement
          Components: clients - java
    Affects Versions: 1.3
            Reporter: Luke Forehand


When extending org.apache.solr.handler.dataimport.DataSource, I would like to package my extended class in ${solr.home}/lib to that I can keep the vanilla copy of my solr.war intact.  The problem is I encounter a ClassCastException when Solr tries to create a newInstance of my extended class, which I suspect has to do with the DataSource and my extended class being loaded from different classloaders.

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


Re: [jira] Closed: (SOLR-1408) Classes in ${solr.home}/lib are not able to extend classes loaded by solr war - ClassCastException

Posted by Avlesh Singh <av...@gmail.com>.
It is generally a good idea to cross check for a bug on the user/dev mailing
list and then create the issue, Luke.

Cheers
Avlesh

On Sat, Sep 5, 2009 at 9:37 AM, Luke Forehand (JIRA) <ji...@apache.org>wrote:

>
>     [
> https://issues.apache.org/jira/browse/SOLR-1408?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel]
>
> Luke Forehand closed SOLR-1408.
> -------------------------------
>
>    Resolution: Invalid
>
> This is not a bug.  The problem was that my extending classes were being
> compiled onto the testing classpath and they were also packaged into the jar
> within ${solr.home}/lib.  They were being loaded by junit before being
> loaded by solr and that was causing the ClassCastException.  When I removed
> the extending classes from the test classpath, everything worked.
>
> > Classes in ${solr.home}/lib are not able to extend classes loaded by solr
> war - ClassCastException
> >
> --------------------------------------------------------------------------------------------------
> >
> >                 Key: SOLR-1408
> >                 URL: https://issues.apache.org/jira/browse/SOLR-1408
> >             Project: Solr
> >          Issue Type: Bug
> >          Components: contrib - DataImportHandler
> >    Affects Versions: 1.3
> >            Reporter: Luke Forehand
> >
> > When extending org.apache.solr.handler.dataimport.DataSource, I would
> like to package my extended class in ${solr.home}/lib to that I can keep the
> vanilla copy of my solr.war intact.  The problem is I encounter a
> ClassCastException when Solr tries to create a newInstance of my extended
> class.
> > Although the parent classloader of ${solr.home}/lib classloader loads
> DataSource, I am still getting a ClassCastException when a class in
> ${solr.home}/lib extends DataSource.
> > The solr instance is being deployed to a jetty plus server that is
> running inside a unit test.
>
> --
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
>
>

[jira] Commented: (SOLR-1408) Classes in ${solr.home}/lib are not able to extend classes loaded by solr war - ClassCastException

Posted by "Avlesh Singh (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-1408?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12751684#action_12751684 ] 

Avlesh Singh commented on SOLR-1408:
------------------------------------

bq. I am starting the jetty server from within a unit test for integration testing purposes. 
Does it fail in unit testing?

I too suspect that there is a problem. I too have similar extensions of DIH and UpdateProcessors, which lie in the "lib". I have never faced any such issue on any of the platforms.


> Classes in ${solr.home}/lib are not able to extend classes loaded by solr war - ClassCastException
> --------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-1408
>                 URL: https://issues.apache.org/jira/browse/SOLR-1408
>             Project: Solr
>          Issue Type: Bug
>          Components: contrib - DataImportHandler
>    Affects Versions: 1.3
>            Reporter: Luke Forehand
>
> When extending org.apache.solr.handler.dataimport.DataSource, I would like to package my extended class in ${solr.home}/lib to that I can keep the vanilla copy of my solr.war intact.  The problem is I encounter a ClassCastException when Solr tries to create a newInstance of my extended class.
> Although the parent classloader of ${solr.home}/lib classloader loads DataSource, I am still getting a ClassCastException when a class in ${solr.home}/lib extends DataSource.
> The solr instance is being deployed to a jetty plus server that is running inside a unit test.

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


[jira] Commented: (SOLR-1408) Allow classes from ${solr.home}/lib to be loaded by the same classloader as solr war to prevent ClassCastException

Posted by "Luke Forehand (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-1408?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12751487#action_12751487 ] 

Luke Forehand commented on SOLR-1408:
-------------------------------------

This is also happening when I try to extend EventListener, I get the mysterious ClassCastException from within Solr.  I am running solr from a jetty server, specifying solr.home using JNDI, and I am starting the jetty server from within a unit test for integration testing purposes.

> Allow classes from ${solr.home}/lib to be loaded by the same classloader as solr war to prevent ClassCastException
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-1408
>                 URL: https://issues.apache.org/jira/browse/SOLR-1408
>             Project: Solr
>          Issue Type: Improvement
>          Components: contrib - DataImportHandler
>    Affects Versions: 1.3
>            Reporter: Luke Forehand
>
> When extending org.apache.solr.handler.dataimport.DataSource, I would like to package my extended class in ${solr.home}/lib to that I can keep the vanilla copy of my solr.war intact.  The problem is I encounter a ClassCastException when Solr tries to create a newInstance of my extended class, which I suspect has to do with the DataSource and my extended class being loaded from different classloaders.

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


[jira] Closed: (SOLR-1408) Classes in ${solr.home}/lib are not able to extend classes loaded by solr war - ClassCastException

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

Luke Forehand closed SOLR-1408.
-------------------------------

    Resolution: Invalid

This is not a bug.  The problem was that my extending classes were being compiled onto the testing classpath and they were also packaged into the jar within ${solr.home}/lib.  They were being loaded by junit before being loaded by solr and that was causing the ClassCastException.  When I removed the extending classes from the test classpath, everything worked.

> Classes in ${solr.home}/lib are not able to extend classes loaded by solr war - ClassCastException
> --------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-1408
>                 URL: https://issues.apache.org/jira/browse/SOLR-1408
>             Project: Solr
>          Issue Type: Bug
>          Components: contrib - DataImportHandler
>    Affects Versions: 1.3
>            Reporter: Luke Forehand
>
> When extending org.apache.solr.handler.dataimport.DataSource, I would like to package my extended class in ${solr.home}/lib to that I can keep the vanilla copy of my solr.war intact.  The problem is I encounter a ClassCastException when Solr tries to create a newInstance of my extended class.
> Although the parent classloader of ${solr.home}/lib classloader loads DataSource, I am still getting a ClassCastException when a class in ${solr.home}/lib extends DataSource.
> The solr instance is being deployed to a jetty plus server that is running inside a unit test.

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


[jira] Updated: (SOLR-1408) Allow classes from ${solr.home}/lib to be loaded by the same classloader as solr war to prevent ClassCastException

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

Noble Paul updated SOLR-1408:
-----------------------------

    Component/s:     (was: clients - java)
                 contrib - DataImportHandler

> Allow classes from ${solr.home}/lib to be loaded by the same classloader as solr war to prevent ClassCastException
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-1408
>                 URL: https://issues.apache.org/jira/browse/SOLR-1408
>             Project: Solr
>          Issue Type: Improvement
>          Components: contrib - DataImportHandler
>    Affects Versions: 1.3
>            Reporter: Luke Forehand
>
> When extending org.apache.solr.handler.dataimport.DataSource, I would like to package my extended class in ${solr.home}/lib to that I can keep the vanilla copy of my solr.war intact.  The problem is I encounter a ClassCastException when Solr tries to create a newInstance of my extended class, which I suspect has to do with the DataSource and my extended class being loaded from different classloaders.

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


[jira] Issue Comment Edited: (SOLR-1408) Allow classes from ${solr.home}/lib to be loaded by the same classloader as solr war to prevent ClassCastException

Posted by "Noble Paul (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-1408?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12751293#action_12751293 ] 

Noble Paul edited comment on SOLR-1408 at 9/3/09 9:17 PM:
----------------------------------------------------------

I suspect that this should not be the problem . DataSource.class is loaded by the parent classloader of ${solr.home}/lib classloader. So by design it is not supposed to throw a ClassCastException

      was (Author: noble.paul):
    I suspect that this should not be a problem . DataSource.class is loaded by the parent classloader of ${solr.home}/lib classloader. So by design it is not supposed to throw a ClassCastException
  
> Allow classes from ${solr.home}/lib to be loaded by the same classloader as solr war to prevent ClassCastException
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-1408
>                 URL: https://issues.apache.org/jira/browse/SOLR-1408
>             Project: Solr
>          Issue Type: Improvement
>          Components: contrib - DataImportHandler
>    Affects Versions: 1.3
>            Reporter: Luke Forehand
>
> When extending org.apache.solr.handler.dataimport.DataSource, I would like to package my extended class in ${solr.home}/lib to that I can keep the vanilla copy of my solr.war intact.  The problem is I encounter a ClassCastException when Solr tries to create a newInstance of my extended class, which I suspect has to do with the DataSource and my extended class being loaded from different classloaders.

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


[jira] Updated: (SOLR-1408) Classes in ${solr.home}/lib are not able to extend classes loaded by solr war - ClassCastException

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

Luke Forehand updated SOLR-1408:
--------------------------------

    Description: 
When extending org.apache.solr.handler.dataimport.DataSource, I would like to package my extended class in ${solr.home}/lib to that I can keep the vanilla copy of my solr.war intact.  The problem is I encounter a ClassCastException when Solr tries to create a newInstance of my extended class.

Although the parent classloader of ${solr.home}/lib classloader loads DataSource, I am still getting a ClassCastException when a class in ${solr.home}/lib extends DataSource.

The solr instance is being deployed to a jetty plus server that is running inside a unit test.

  was:When extending org.apache.solr.handler.dataimport.DataSource, I would like to package my extended class in ${solr.home}/lib to that I can keep the vanilla copy of my solr.war intact.  The problem is I encounter a ClassCastException when Solr tries to create a newInstance of my extended class, which I suspect has to do with the DataSource and my extended class being loaded from different classloaders.

     Issue Type: Bug  (was: Improvement)
        Summary: Classes in ${solr.home}/lib are not able to extend classes loaded by solr war - ClassCastException  (was: Allow classes from ${solr.home}/lib to be loaded by the same classloader as solr war to prevent ClassCastException)

> Classes in ${solr.home}/lib are not able to extend classes loaded by solr war - ClassCastException
> --------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-1408
>                 URL: https://issues.apache.org/jira/browse/SOLR-1408
>             Project: Solr
>          Issue Type: Bug
>          Components: contrib - DataImportHandler
>    Affects Versions: 1.3
>            Reporter: Luke Forehand
>
> When extending org.apache.solr.handler.dataimport.DataSource, I would like to package my extended class in ${solr.home}/lib to that I can keep the vanilla copy of my solr.war intact.  The problem is I encounter a ClassCastException when Solr tries to create a newInstance of my extended class.
> Although the parent classloader of ${solr.home}/lib classloader loads DataSource, I am still getting a ClassCastException when a class in ${solr.home}/lib extends DataSource.
> The solr instance is being deployed to a jetty plus server that is running inside a unit test.

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


[jira] Commented: (SOLR-1408) Allow classes from ${solr.home}/lib to be loaded by the same classloader as solr war to prevent ClassCastException

Posted by "Noble Paul (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-1408?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12751293#action_12751293 ] 

Noble Paul commented on SOLR-1408:
----------------------------------

I suspect that this should not be a problem . DataSource.class is loaded by the parent classloader of ${solr.home}/lib classloader. So by design it is not supposed to throw a ClassCastException

> Allow classes from ${solr.home}/lib to be loaded by the same classloader as solr war to prevent ClassCastException
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-1408
>                 URL: https://issues.apache.org/jira/browse/SOLR-1408
>             Project: Solr
>          Issue Type: Improvement
>          Components: contrib - DataImportHandler
>    Affects Versions: 1.3
>            Reporter: Luke Forehand
>
> When extending org.apache.solr.handler.dataimport.DataSource, I would like to package my extended class in ${solr.home}/lib to that I can keep the vanilla copy of my solr.war intact.  The problem is I encounter a ClassCastException when Solr tries to create a newInstance of my extended class, which I suspect has to do with the DataSource and my extended class being loaded from different classloaders.

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