You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Asanka Sanjaya Herath <an...@gmail.com> on 2016/01/11 07:56:48 UTC

Bad return type exception

Hi,

I tried to create a solr client using following code.

​ solrClient = new CloudSolrClient(zkHost);
 solrClient.setDefaultCollection(solrCollection);
​
Solr4j version:5.4.0

​Project built successfully but in run time I get following error.​ Any
help is appreciated.

Main class [org.apache.oozie.action.hadoop.JavaMain], main() threw
exception, java.lang.VerifyError: Bad return type
Exception Details:
  Location:

org/apache/solr/client/solrj/impl/HttpClientUtil.createClient(Lorg/apache/solr/common/params/SolrParams;Lorg/apache/http/conn/ClientConnectionManager;)Lorg/apache/http/impl/client/CloseableHttpClient;
@58: areturn
  Reason:
    Type 'org/apache/http/impl/client/DefaultHttpClient' (current frame,
stack[0]) is not assignable to
'org/apache/http/impl/client/CloseableHttpClient' (from method signature)
  Current Frame:
    bci: @58
    flags: { }
    locals: { 'org/apache/solr/common/params/SolrParams',
'org/apache/http/conn/ClientConnectionManager',
'org/apache/solr/common/params/ModifiableSolrParams',
'org/apache/http/impl/client/DefaultHttpClient' }
    stack: { 'org/apache/http/impl/client/DefaultHttpClient' }
  Bytecode:
    0000000: bb00 0359 2ab7 0004 4db2 0005 b900 0601
    0000010: 0099 001e b200 05bb 0007 59b7 0008 1209
    0000020: b600 0a2c b600 0bb6 000c b900 0d02 002b
    0000030: b800 104e 2d2c b800 0f2d b0
  Stackmap Table:
    append_frame(@47,Object[#143])

org.apache.oozie.action.hadoop.JavaMainException: java.lang.VerifyError:
Bad return type
Exception Details:
  Location:

org/apache/solr/client/solrj/impl/HttpClientUtil.createClient(Lorg/apache/solr/common/params/SolrParams;Lorg/apache/http/conn/ClientConnectionManager;)Lorg/apache/http/impl/client/CloseableHttpClient;
@58: areturn
  Reason:
    Type 'org/apache/http/impl/client/DefaultHttpClient' (current frame,
stack[0]) is not assignable to
'org/apache/http/impl/client/CloseableHttpClient' (from method signature)
  Current Frame:
    bci: @58
    flags: { }
    locals: { 'org/apache/solr/common/params/SolrParams',
'org/apache/http/conn/ClientConnectionManager',
'org/apache/solr/common/params/ModifiableSolrParams',
'org/apache/http/impl/client/DefaultHttpClient' }
    stack: { 'org/apache/http/impl/client/DefaultHttpClient' }
  Bytecode:
    0000000: bb00 0359 2ab7 0004 4db2 0005 b900 0601
    0000010: 0099 001e b200 05bb 0007 59b7 0008 1209
    0000020: b600 0a2c b600 0bb6 000c b900 0d02 002b
    0000030: b800 104e 2d2c b800 0f2d b0
  Stackmap Table:
    append_frame(@47,Object[#143])

at org.apache.oozie.action.hadoop.JavaMain.run(JavaMain.java:59)
at org.apache.oozie.action.hadoop.LauncherMain.run(LauncherMain.java:47)
at org.apache.oozie.action.hadoop.JavaMain.main(JavaMain.java:35)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at
org.apache.oozie.action.hadoop.LauncherMapper.map(LauncherMapper.java:236)
at org.apache.hadoop.mapred.MapRunner.run(MapRunner.java:54)
at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:453)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:343)
at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:164)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:415)
at
org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1657)
at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158)
Caused by: java.lang.VerifyError: Bad return type
Exception Details:
  Location:

org/apache/solr/client/solrj/impl/HttpClientUtil.createClient(Lorg/apache/solr/common/params/SolrParams;Lorg/apache/http/conn/ClientConnectionManager;)Lorg/apache/http/impl/client/CloseableHttpClient;
@58: areturn
  Reason:
    Type 'org/apache/http/impl/client/DefaultHttpClient' (current frame,
stack[0]) is not assignable to
'org/apache/http/impl/client/CloseableHttpClient' (from method signature)
  Current Frame:
    bci: @58
    flags: { }
    locals: { 'org/apache/solr/common/params/SolrParams',
'org/apache/http/conn/ClientConnectionManager',
'org/apache/solr/common/params/ModifiableSolrParams',
'org/apache/http/impl/client/DefaultHttpClient' }
    stack: { 'org/apache/http/impl/client/DefaultHttpClient' }
  Bytecode:
    0000000: bb00 0359 2ab7 0004 4db2 0005 b900 0601
    0000010: 0099 001e b200 05bb 0007 59b7 0008 1209
    0000020: b600 0a2c b600 0bb6 000c b900 0d02 002b
    0000030: b800 104e 2d2c b800 0f2d b0
  Stackmap Table:
    append_frame(@47,Object[#143])

at
org.apache.solr.client.solrj.impl.CloudSolrClient.<init>(CloudSolrClient.java:197)
at
com.sonasoft.sonacloud.retention.SolrOperations.<init>(SolrOperations.java:26)
at
com.sonasoft.sonacloud.retention.SolrOperations.getInstance(SolrOperations.java:32)
at com.sonasoft.sonacloud.retention.MainClass.main(MainClass.java:19)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.oozie.action.hadoop.JavaMain.run(JavaMain.java:56)
... 15 more

Oozie Launcher failed, finishing Hadoop job gracefully



-- 
Thanks,
Regards,
ASH

Re: Bad return type exception

Posted by Asanka Sanjaya Herath <an...@gmail.com>.
Hi Shawn,

Thank you for your explanation. Yes, without Oozie the project runs
successfully.

On Mon, Jan 11, 2016 at 1:03 PM, Shawn Heisey <ap...@elyograg.org> wrote:

> On 1/10/2016 11:56 PM, Asanka Sanjaya Herath wrote:
> > I tried to create a solr client using following code.
> >
> > ​ solrClient = new CloudSolrClient(zkHost);
> >  solrClient.setDefaultCollection(solrCollection);
> > ​
> > Solr4j version:5.4.0
> >
> > ​Project built successfully but in run time I get following error.​ Any
> > help is appreciated.
> >
> > Main class [org.apache.oozie.action.hadoop.JavaMain], main() threw
> > exception, java.lang.VerifyError: Bad return type
> > Exception Details:
> >   Location:
>
> I'm guessing that this is happening because Oozie includes a dependency
> on commons-httpclient, or httpclient 3.x, and SolrJ 4.0 and later has a
> dependency on httpcomponents -- httpclient 4.x.  It is very likely that
> SolrJ is seeing the classes provided by the 3.x jars, and that the
> method signatures are incompatible with what SolrJ expects.
>
> It is very possible that you will be unable to make Oozie work with
> SolrJ 4.0 or later, and since you are using CloudSolrClient, you have no
> choice but the newer SolrJ version.
>
> I believe that the reason it compiles successfully is because the SolrJ
> code you are using does not expose anything having to do with HttpClient
> at all.  That interaction only happens deeper down, within SolrJ.
>
> Thanks,
> Shawn
>
>


-- 
Thanks,
Regards,
ASH

Re: Bad return type exception

Posted by Shawn Heisey <ap...@elyograg.org>.
On 1/10/2016 11:56 PM, Asanka Sanjaya Herath wrote:
> I tried to create a solr client using following code.
> 
> ​ solrClient = new CloudSolrClient(zkHost);
>  solrClient.setDefaultCollection(solrCollection);
> ​
> Solr4j version:5.4.0
> 
> ​Project built successfully but in run time I get following error.​ Any
> help is appreciated.
> 
> Main class [org.apache.oozie.action.hadoop.JavaMain], main() threw
> exception, java.lang.VerifyError: Bad return type
> Exception Details:
>   Location:

I'm guessing that this is happening because Oozie includes a dependency
on commons-httpclient, or httpclient 3.x, and SolrJ 4.0 and later has a
dependency on httpcomponents -- httpclient 4.x.  It is very likely that
SolrJ is seeing the classes provided by the 3.x jars, and that the
method signatures are incompatible with what SolrJ expects.

It is very possible that you will be unable to make Oozie work with
SolrJ 4.0 or later, and since you are using CloudSolrClient, you have no
choice but the newer SolrJ version.

I believe that the reason it compiles successfully is because the SolrJ
code you are using does not expose anything having to do with HttpClient
at all.  That interaction only happens deeper down, within SolrJ.

Thanks,
Shawn