Thanks Paul.

Its possible it is something to do with the annotations, but shouldn't be
too hard to chase down. Basically that ClassFieldInspector walks up the
inheritance tree, generating accessors to all the "fields" (things that
follow bean properties) to provide fast access in rules (and shadowing, in
the near future). Its possible that something is causing it to chose for an
EJB. If you can make a unit test, would be quite helpful (and put it in a
jira, as normal).

Michael.

On 4/3/06, Paul Smith <[EMAIL PROTECTED]> wrote:
>
> The domain object is actually an annotated ejb3 entity bean. It's a pretty
> simple one with just the usual few member variables and annotated
> getters/setters. As I stepped through the code, as far as I can tell it
> finds the class and seems to look at the
> javax.persistence.Entityannotation  and then somewhere after that it
> dies with the
> NullPointerException. I'll send the code through later as it's on my
> machine
> at home although I'm guessing it should be easy to reproduce with a
> lightweight ejb3 annotated entity bean.
>
> On 4/2/06, Michael Neale <[EMAIL PROTECTED]> wrote:
> >
> > Paul, can you send on your domain object that is causing it?
> >
> > On 4/2/06, Michael Neale <[EMAIL PROTECTED]> wrote:
> > >
> > > that is just ASM (latest version) that has been "jarjared" to have a
> > local
> > > name space, so you can get the source from ASM (Object Web) and it
> will
> > be
> > > the same.
> > >
> > >
> > > On 4/2/06, Paul Smith <[EMAIL PROTECTED]> wrote:
> > > >
> > > > Can someone point me to the source for:
> > > >
> > > > org.drools.asm.ClassReader
> > > >
> > > > It doesn't appear to be in the source that I've checkout out of
> > > > subversion
> > > > and I'm trying to track the source of a NullPointerException that's
> > > > coming
> > > > out of the following in ClassFieldInspector
> > > >
> > > >     private void processClass(Class clazz) throws IOException {
> > > >         String name = getResourcePath( clazz );
> > > >         InputStream stream = clazz.getResourceAsStream (name);
> > > >         ClassReader reader = new ClassReader(stream);
> > > >         ClassFieldVisitor visitor = new ClassFieldVisitor(clazz,
> > > > methods.size());
> > > >         reader.accept(visitor,
> > > > false);
> <-------
> > > > Throws a NullPointer
> > > >         this.methods.addAll( visitor.getPropertyGetters() );
> > > >         this.fieldNames.putAll( visitor.getFieldNameMap() );
> > > >         if (clazz.getSuperclass() != null) {
> > > >             processClass( clazz.getSuperclass());
> > > >         }
> > > >     }
> > > >
> > > > seems to be something in ClassReader.a()
> > > >
> > > > java.lang.NullPointerException
> > > >     at org.drools.asm.ClassReader.a(Unknown Source)
> > > >     at org.drools.asm.ClassReader.accept (Unknown Source)
> > > >     at org.drools.asm.ClassReader.accept(Unknown Source)
> > > >     at org.drools.util.asm.ClassFieldInspector.processClass(
> > > > ClassFieldInspector.java:48)
> > > >     at org.drools.util.asm.ClassFieldInspector .<init>(
> > > > ClassFieldInspector.java:39)
> > > >     at org.drools.util.asm.FieldAccessorGenerator.newInstanceFor(
> > > > FieldAccessorGenerator.java:64)
> > > >     at org.drools.util.asm.FieldAccessorGenerator.getInstanceFor(
> > > > FieldAccessorGenerator.java:50)
> > > >     at org.drools.base.ClassFieldExtractor.<init>(
> > > > ClassFieldExtractor.java
> > > > :28)
> > > >     at org.drools.semantics.java.RuleBuilder.getFieldExtractor(
> > > > RuleBuilder.java:789)
> > > >     at org.drools.semantics.java.RuleBuilder.build(RuleBuilder.java
> > :409)
> > > >     at org.drools.semantics.java.RuleBuilder.build(RuleBuilder.java
> > :329)
> > > >     at org.drools.semantics.java.RuleBuilder.build(RuleBuilder.java
> > :228)
> > > >
> > > >
> > >
> >
> >
>
>

Reply via email to