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 girish <gi...@gmail.com> on 2019/01/27 08:17:06 UTC
Bad type on operand stack: SolrInputDocument not assignable to
SolrDocumentBase
I have been facing the below issue since yesterday, I get this error when
starting spring boot application using version 2.1.1 release and apache
solr-common 1.3.0. If anyone else has faced this issue please help me out.
Thanks in Advance.
Caused by: org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'solrTemplate' defined in class path resource
[com/myapp/config/SolrConfig.class]: Invocation of init method failed;
nested exception is java.lang.VerifyError: Bad type on operand stack
Exception Details:
Location:
org/springframework/data/solr/core/convert/MappingSolrConverter.lambda$write$1(Lorg/springframework/data/mapping/PersistentPropertyAccessor;Lorg/apache/solr/common/SolrDocumentBase;Lorg/springframework/data/solr/core/mapping/SolrPersistentProperty;)V
@215: invokevirtual
Reason:
Type 'org/apache/solr/common/SolrInputDocument' (current frame,
stack[2]) is not assignable to 'org/apache/solr/common/SolrDocumentBase'
Current Frame:
bci: @215
flags: { }
locals: {
'org/springframework/data/solr/core/convert/MappingSolrConverter',
'org/springframework/data/mapping/PersistentPropertyAccessor',
'org/apache/solr/common/SolrDocumentBase',
'org/springframework/data/solr/core/mapping/SolrPersistentProperty',
'java/lang/Object', 'java/util/List', 'java/util/Iterator',
'java/lang/Object', 'org/apache/solr/common/SolrInputDocument' }
stack: {
'org/springframework/data/solr/core/convert/MappingSolrConverter',
'java/lang/Object', 'org/apache/solr/common/SolrInputDocument',
'org/springframework/data/solr/core/mapping/SolrPersistentEntity' }
Bytecode:
0x0000000: 2b2d b900 6302 003a 0419 04c6 000c 2db9
0x0000010: 0064 0100 9900 04b1 2db9 0065 0100 9900
0x0000020: 312d b900 6601 009a 0028 bb00 6759 bb00
0x0000030: 6859 b700 6912 6ab6 006b 2db9 0035 0100
0x0000040: b600 6b12 6cb6 006b b600 6db7 006e bf2d
0x0000050: b900 6601 0099 001b 2db9 0065 0100 9900
0x0000060: 122a 2c2d 1904 c000 6fb7 0070 57a7 00c0
0x0000070: 2db9 0071 0100 9900 ae2d b900 2501 0099
0x0000080: 00a5 bb00 0a59 b700 363a 052d b900 4a01
0x0000090: 0099 0059 1904 b800 4bb9 004c 0100 3a06
0x00000a0: 1906 b900 0f01 0099 0040 1906 b900 1001
0x00000b0: 003a 07bb 002d 5903 bd00 4eb7 0072 3a08
0x00000c0: 2a19 0719 082a b400 082d b900 7301 00b9
0x00000d0: 0019 0200 c000 1ab6 0031 1905 1908 b900
0x00000e0: 1302 0057 a7ff bca7 0034 bb00 2d59 03bd
0x00000f0: 004e b700 723a 062a 1904 1906 2ab4 0008
0x0000100: 2db9 0073 0100 b900 1902 00c0 001a b600
0x0000110: 3119 0519 06b9 0013 0200 572c 1905 b600
0x0000120: 74a7 000c 2a2c 2d19 04b7 0075 57b1
Stackmap Table:
append_frame(@23,Object[#259])
same_frame(@24)
same_frame(@79)
same_frame(@112)
append_frame(@160,Object[#179],Object[#181])
chop_frame(@231,1)
same_frame(@234)
same_frame(@283)
chop_frame(@292,1)
same_frame(@301)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1745)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:576)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:498)
at
org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:367)
... 58 more
Caused by: java.lang.VerifyError: Bad type on operand stack
Exception Details:
Location:
org/springframework/data/solr/core/convert/MappingSolrConverter.lambda$write$1(Lorg/springframework/data/mapping/PersistentPropertyAccessor;Lorg/apache/solr/common/SolrDocumentBase;Lorg/springframework/data/solr/core/mapping/SolrPersistentProperty;)V
@215: invokevirtual
Reason:
Type 'org/apache/solr/common/SolrInputDocument' (current frame,
stack[2]) is not assignable to 'org/apache/solr/common/SolrDocumentBase'
Current Frame:
bci: @215
flags: { }
locals: {
'org/springframework/data/solr/core/convert/MappingSolrConverter',
'org/springframework/data/mapping/PersistentPropertyAccessor',
'org/apache/solr/common/SolrDocumentBase',
'org/springframework/data/solr/core/mapping/SolrPersistentProperty',
'java/lang/Object', 'java/util/List', 'java/util/Iterator',
'java/lang/Object', 'org/apache/solr/common/SolrInputDocument' }
stack: {
'org/springframework/data/solr/core/convert/MappingSolrConverter',
'java/lang/Object', 'org/apache/solr/common/SolrInputDocument',
'org/springframework/data/solr/core/mapping/SolrPersistentEntity' }
--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html
Re: Bad type on operand stack: SolrInputDocument not assignable to
SolrDocumentBase
Posted by Shawn Heisey <ap...@elyograg.org>.
On 1/28/2019 7:45 AM, Will Martin wrote:
> We are deployed across the globe in many regions with different use
> patterns.
>
> Spring-data-solr is front and center for us and has proven pretty darn
> stable.
>
> "There can be some very strange problems when trying to use SolrJ with
> Spring.”
I'll start off this reply by saying that I am in no way an expert on
Spring libraries. I've used them, but there's plenty that I do not know.
I think that if you're using spring-data-solr, then ONLY use
spring-data-solr. Do not try to load SolrJ itself as a dependency ...
it will be pulled in automatically. Using a different version of SolrJ
than spring-data-solr expects might break spring-data-solr. Accessing
SolrJ objects and methods directly in a way not explicitly recommended
by spring-data-solr might also cause problems.
When trying to use SolrJ directly and not through spring-data-solr, this
is required in the @SpringApplication annotation:
@SpringBootApplication(exclude = { SolrAutoConfiguration.class })
Yes, I have needed this in one of my own Spring Boot projects. Without
that, I got some WEIRD exceptions from my program. I no longer recall
what they were -- so I have no idea if the exceptions you're getting are
the same thing or not.
There may be other subtleties involved with Spring classes and SolrJ
that I have never personally encountered. Since you're using
spring-data-solr, you really need to talk to Spring first about any
problems you encounter, and only come to us if Spring says you need to.
Thanks,
Shawn
Re: Bad type on operand stack: SolrInputDocument not assignable to
SolrDocumentBase
Posted by Will Martin <wm...@urgent.ly>.
Hi Shawn:
We are deployed across the globe in many regions with different use patterns.
Spring-data-solr is front and center for us and has proven pretty darn stable.
"There can be some very strange problems when trying to use SolrJ with Spring.”
Could you expand on this, so that we might know what might be getting missed?
Will Martin
DEVOPS ENGINEER
540.454.9565
8609 WESTWOOD CENTER DR, SUITE 475
VIENNA, VA 22182
geturgently.com <http://geturgently.com/>
> On Jan 27, 2019, at 2:08 PM, Shawn Heisey <ap...@elyograg.org> wrote:
>
> There can be some very strange problems when trying to use SolrJ with Spring.
Re: Bad type on operand stack: SolrInputDocument not assignable to
SolrDocumentBase
Posted by girish <gi...@gmail.com>.
Thanks Shawn, it worked like charm removing the solr-common dependency. As
part of one the sample tutorial I referred for integrating with the
application it had the jar.
--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html
Re: Bad type on operand stack: SolrInputDocument not assignable to
SolrDocumentBase
Posted by Shawn Heisey <ap...@elyograg.org>.
On 1/27/2019 1:17 AM, girish wrote:
> I have been facing the below issue since yesterday, I get this error when
> starting spring boot application using version 2.1.1 release and apache
> solr-common 1.3.0. If anyone else has faced this issue please help me out.
I've never heard of a "solr-common" library ... and even if this project
did at one point make such a thing, 1.3.0 would be incredibly out of
date. Version 1.3.0 of Solr was released over ten years ago. If you're
seeing that library in a reasonably modern code project, I suspect it
did not come from the Solr project.
> Caused by: org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'solrTemplate' defined in class path resource
> [com/myapp/config/SolrConfig.class]: Invocation of init method failed;
> nested exception is java.lang.VerifyError: Bad type on operand stack
> Exception Details:
> Location:
>
> org/springframework/data/solr/core/convert/MappingSolrConverter.lambda$write$1(Lorg/springframework/data/mapping/PersistentPropertyAccessor;Lorg/apache/solr/common/SolrDocumentBase;Lorg/springframework/data/solr/core/mapping/SolrPersistentProperty;)V
This looks like a problem that you'll need to discuss with Spring. They
wrap SolrJ in their own library, one they call spring-data-solr. There
can be some very strange problems when trying to use SolrJ with Spring.
Thanks,
Shawn