You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Benson Margulies <be...@basistech.com> on 2015/01/12 17:29:02 UTC

Same code in bundle and system bundle results in verify error

Due to a bug, I've got a bundle installed in my container that exports a
package that is also exported from the system bundle. Here's the effect.

Questions: is this supposed to be wrong? is this supposed to be the
diagnosis?


381  [main] INFO  com.basistech.rlije.osgi.impl.RliServiceFactory  -
Provisioning root.
Exception in thread "main" java.lang.VerifyError: Bad type on operand stack
Exception Details:
  Location:

com/basistech/rlije/osgi/impl/RliServiceFactory$RliComponentFactory.createComponent(Ljava/io/InputStream;)Lcom/basistech/rosette/osgi/RosetteComponent;
@27: invokevirtual
  Reason:
    Type 'com/basistech/rosette/dm/EnumModule' (current frame, stack[1]) is
not assignable to 'com/fasterxml/jackson/databind/Module'
  Current Frame:
    bci: @27
    flags: { }
    locals: {
'com/basistech/rlije/osgi/impl/RliServiceFactory$RliComponentFactory',
'java/io/InputStream', top, 'com/fasterxml/jackson/databind/ObjectMapper' }
    stack: { 'com/fasterxml/jackson/databind/ObjectMapper',
'com/basistech/rosette/dm/EnumModule' }
  Bytecode:
    0000000: 2bc6 0039 bb00 0759 bb00 0859 b700 09b7
    0000010: 000a 4e2d bb00 0b59 b700 0cb6 000d 572d
    0000020: 2b13 000e b600 0fc0 0010 4d2c 2ab4 0004
    0000030: b800 11b6 0012 57a7 0012 bb00 1059 2ab4
    0000040: 0004 b800 11b7 0013 4da7 000f 4ebb 0015
    0000050: 5912 162d b700 17bf 2c2a b400 06b6 0018
    0000060: 57bb 0019 592a 2cb7 001a b0
  Exception Handler Table:
    bci [0, 73] => handler: 76
  Stackmap Table:
    same_frame(@58)
    append_frame(@73,Object[#60])
    full_frame(@76,{Object[#61],Object[#62]},{Object[#63]})
    append_frame(@88,Object[#60])

at
com.basistech.rlije.osgi.impl.RliServiceFactory.factory(RliServiceFactory.java:174)
at
com.basistech.rlije.osgi.impl.RliServiceFactory.access$000(RliServiceFactory.java:53)
at
com.basistech.rlije.osgi.impl.RliServiceFactory$1.createFactory(RliServiceFactory.java:92)
at com.basistech.osgi.tools.AnnotateCommand.run(AnnotateCommand.java:112)
at com.basistech.osgi.tools.Subcommand.perform(Subcommand.java:47)
at com.basistech.osgi.tools.RosetteOsgi.doMain(RosetteOsgi.java:168)
at com.basistech.osgi.tools.RosetteOsgi.main(RosetteOsgi.java:118)

Re: Same code in bundle and system bundle results in verify error

Posted by Benson Margulies <be...@basistech.com>.
On Mon, Jan 12, 2015 at 11:52 AM, Richard S. Hall <he...@ungoverned.org>
wrote:

> On 1/12/15 11:42 , Benson Margulies wrote:
>
>> My idea that this has to do with system bundle versus not is wrong. I'm
>> still debugging.
>>
>>
> Is it a single package you are talking about or is it a couple of packages
> with "uses" constraints among them?
>

I now think I know where the tangle comes from.

There is single package, 'com.basistech.dm', that contains both a data
model and some utilities for reading and writing it with Jackson.

I am building an application that embeds Felix, and passes objects from
this package in and out of the container.

So, com.basistech.dm's implementation is in the overall application
classpath, and is listed as an exported package of the system bundle.

However, I neglected to also include the Jackson packages in the system
bundle. (In fact, I don't want them there.) So, I ended up with dueling
Class objects for Jackson classes.

My bad, though I do wonder if the diagnosis could be clearer.





>
> -> richard
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

Re: Same code in bundle and system bundle results in verify error

Posted by "Richard S. Hall" <he...@ungoverned.org>.
On 1/12/15 11:42 , Benson Margulies wrote:
> My idea that this has to do with system bundle versus not is wrong. I'm
> still debugging.
>

Is it a single package you are talking about or is it a couple of 
packages with "uses" constraints among them?

-> richard

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Same code in bundle and system bundle results in verify error

Posted by Benson Margulies <be...@basistech.com>.
My idea that this has to do with system bundle versus not is wrong. I'm
still debugging.