Ok, here is what I am trying to do... I am
working on refactoring Apache Cocoon 2.1. I am using an aspect to make my
class, AbstractServerPage implement an interface,
CacheableProcessingComponent. This also means introducing two
methods, getValidity() and generateKey() required for the
interface.
I have tried weaving two ways:
1) I weave using a build list including my
aspect and the package I am modifying. I run the build on this and recieve
the null pointer exception below.
2) Weaving the entire project/Application.
The project weave completes, but I have two new errors. They are both from
classes that are subclasses of AbstractServerPage, for
example:
JSGenerator which extends XSPGenerator which
extends AbstractServerPage. However, XSPGenerator does not have
a build error in it and so I am a bit puzzled as to why JSGenerator has an
error while XSPGenerator doesn't. Any suggestions?
Null Pointer exception from weaving mentioned in
(1):
nts.language.generator.CompiledComponent,
org.apache.avalon.framework.component. Recomposable,
org.apache.cocoon.caching.CacheableProcessingComponent: protected long
dateCreated protected java.io.File[] dependencies public
void
<init>():
ALOAD_0 //
org.apache.cocoon.generation.AbstractServerPa ge this (line
77)
INVOKESPECIAL org.apache.cocoon.generation.ServletGenerator. <init>
()V constructor-execution(void
org.apache.cocoon.generation.AbstractServerPage.< init>())
|
ALOAD_0 //
org.apache.cocoon.generation.AbstractServerPa ge this (line
95)
|
LDC2_W -1 | field-set(long
org.apache.cocoon.generation.AbstractServerPage.dateCreated )
| |
PUTFIELD org.apache.cocoon.generation.AbstractServerPage.dat eCreated
J | field-set(long
org.apache.cocoon.generation.AbstractServerPage.dateCreated )
|
ALOAD_0 //
org.apache.cocoon.generation.AbstractServerPa ge this (line
97)
|
ACONST_NULL | field-set(java.io.File[]
org.apache.cocoon.generation.AbstractServerPage.d ependencies)
| |
PUTFIELD org.apache.cocoon.generation.AbstractServerPage.dep endencies
[Ljava/io/File; | field-set(java.io.File[]
org.apache.cocoon.generation.AbstractServerPage.d ependencies)
|
RETURN (line 77) constructor-execution(void
org.apache.cocoon.generation.AbstractServerPage.< init>())
end public void <init>()
public void
recompose(org.apache.avalon.framework.component.ComponentManager) throws
org.apache.avalon.framework.component.ComponentException:
method-execution(void
org.apache.cocoon.generation.AbstractServerPage.recomp ose(org.apache.avalon.framework.component.ComponentManager))
|
ALOAD_0 //
org.apache.cocoon.generation.AbstractServerPa ge this (line
104)
|
ALOAD_1 //
org.apache.avalon.framework.component.Compone ntManager
manager |
field-set(org.apache.avalon.framework.component.ComponentManager
org.apach e.cocoon.generation.ComposerGenerator.manager)
| |
PUTFIELD org.apache.cocoon.generation.ComposerGenerator.mana ger
Lorg/apache/avalon/framework/component/ComponentManager; |
field-set(org.apache.avalon.framework.component.ComponentManager
org.apach e.cocoon.generation.ComposerGenerator.manager)
|
RETURN (line 105) method-execution(void
org.apache.cocoon.generation.AbstractServerPage.recomp ose(org.apache.avalon.framework.component.ComponentManager))
end public void
recompose(org.apache.avalon.framework.component.ComponentManag er) throws
org.apache.avalon.framework.component.ComponentException
public boolean
modifiedSince(long): method-execution(boolean
org.apache.cocoon.generation.AbstractServerPage.mod ifiedSince(long))
|
LLOAD_1 // long arg0 (line
114)
|
LCONST_0
|
LCMP
|
IFEQ L0
|
ALOAD_0 //
org.apache.cocoon.generation.AbstractServerPa ge this |
field-get(long
org.apache.cocoon.generation.AbstractServerPage.dateCreated )
| |
GETFIELD org.apache.cocoon.generation.AbstractServerPage.dat eCreated
J | field-get(long
org.apache.cocoon.generation.AbstractServerPage.dateCreated )
|
LLOAD_1 // long arg0
|
LCMP
|
IFGE L1
| L0:
ICONST_1 (line 115)
|
IRETURN
| L1:
ICONST_0 (line 118)
|
ISTORE_3
|
GOTO L4
| L2:
ALOAD_0 //
org.apache.cocoon.generation.AbstractServerPa ge this (line
119) | field-get(long
org.apache.cocoon.generation.AbstractServerPage.dateCreated )
| |
GETFIELD org.apache.cocoon.generation.AbstractServerPage.dat eCreated
J | field-get(long
org.apache.cocoon.generation.AbstractServerPage.dateCreated )
|
ALOAD_0 //
org.apache.cocoon.generation.AbstractServerPa ge this |
field-get(java.io.File[]
org.apache.cocoon.generation.AbstractServerPage.d ependencies)
| |
GETFIELD org.apache.cocoon.generation.AbstractServerPage.dep endencies
[Ljava/io/File; | field-get(java.io.File[]
org.apache.cocoon.generation.AbstractServerPage.d ependencies)
|
ILOAD_3 // int i
|
AALOAD | method-call(long
java.io.File.lastModified()) |
|
INVOKEVIRTUAL java.io.File.lastModified ()J |
method-call(long java.io.File.lastModified())
|
LCMP
|
IFGE L3
|
ICONST_1 (line 120)
|
IRETURN
| L3: IINC 3
1 // int i (line 118)
| L4:
ILOAD_3 // int i
|
ALOAD_0 //
org.apache.cocoon.generation.AbstractServerPa ge this |
field-get(java.io.File[]
org.apache.cocoon.generation.AbstractServerPage.d ependencies)
| |
GETFIELD org.apache.cocoon.generation.AbstractServerPage.dep endencies
[Ljava/io/File; | field-get(java.io.File[]
org.apache.cocoon.generation.AbstractServerPage.d ependencies)
|
ARRAYLENGTH
|
IF_ICMPLT L2
|
ICONST_0 (line 124)
|
IRETURN method-execution(boolean
org.apache.cocoon.generation.AbstractServerPage.mod ifiedSince(long))
end public boolean modifiedSince(long)
public boolean
hasContentChanged(org.apache.cocoon.environment.Request):
method-execution(boolean
org.apache.cocoon.generation.AbstractServerPage.has ContentChanged(org.apache.cocoon.environment.Request))
|
ICONST_1 (line 138)
|
IRETURN method-execution(boolean
org.apache.cocoon.generation.AbstractServerPage.has ContentChanged(org.apache.cocoon.environment.Request))
end public boolean
hasContentChanged(org.apache.cocoon.environment.Request)
protected void
attribute(org.xml.sax.helpers.AttributesImpl, String,
String): method-execution(void
org.apache.cocoon.generation.AbstractServerPage.attrib ute(org.xml.sax.helpers.AttributesImpl,
java.lang.String, java.lang.String))
|
ALOAD_1 // org.xml.sax.helpers.AttributesImpl
attr (li ne 177)
|
LDC ""
|
ALOAD_2 // java.lang.String arg1
|
ALOAD_2 // java.lang.String arg1
|
LDC "CDATA"
|
ALOAD_3 // java.lang.String arg2 |
method-call(void
org.xml.sax.helpers.AttributesImpl.addAttribute(java.lang .String,
java.lang.String, java.lang.String, java.lang.String,
java.lang.String) ) |
|
INVOKEVIRTUAL org.xml.sax.helpers.AttributesImpl.addAttribut e
(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava /lang/String;)V
| method-call(void
org.xml.sax.helpers.AttributesImpl.addAttribute(java.lang .String,
java.lang.String, java.lang.String, java.lang.String,
java.lang.String) )
|
RETURN (line 178) method-execution(void
org.apache.cocoon.generation.AbstractServerPage.attrib ute(org.xml.sax.helpers.AttributesImpl,
java.lang.String, java.lang.String)) end protected void
attribute(org.xml.sax.helpers.AttributesImpl, String, Strin g)
protected void start(String,
org.xml.sax.helpers.AttributesImpl) throws
org.xm l.sax.SAXException: method-execution(void
org.apache.cocoon.generation.AbstractServerPage.start( java.lang.String,
org.xml.sax.helpers.AttributesImpl))
|
ALOAD_0 //
org.apache.cocoon.generation.AbstractServerPa ge this (line
187) | field-get(org.xml.sax.ContentHandler
org.apache.cocoon.xml.AbstractXMLProd ucer.contentHandler)
| |
GETFIELD org.apache.cocoon.xml.AbstractXMLProducer.contentHa ndler
Lorg/xml/sax/ContentHandler; |
field-get(org.xml.sax.ContentHandler
org.apache.cocoon.xml.AbstractXMLProd ucer.contentHandler)
|
LDC ""
|
ALOAD_1 // java.lang.String name
|
ALOAD_1 // java.lang.String name
|
ALOAD_2 // org.xml.sax.helpers.AttributesImpl
arg1 | method-call(void
org.xml.sax.ContentHandler.startElement(java.lang.String, java.lang.String,
java.lang.String, org.xml.sax.Attributes)) |
|
INVOKEINTERFACE org.xml.sax.ContentHandler.startElement
(Lja va/lang/String;Ljava/lang/String;Ljava/lang/String;Lorg/xml/sax/Attributes;)V
| method-call(void
org.xml.sax.ContentHandler.startElement(java.lang.String, java.lang.String,
java.lang.String, org.xml.sax.Attributes))
|
ALOAD_2 // org.xml.sax.helpers.AttributesImpl
arg1 (li ne 188) | method-call(void
org.xml.sax.helpers.AttributesImpl.clear()) |
|
INVOKEVIRTUAL org.xml.sax.helpers.AttributesImpl.clear ()V
| method-call(void
org.xml.sax.helpers.AttributesImpl.clear())
|
RETURN (line 189) method-execution(void
org.apache.cocoon.generation.AbstractServerPage.start( java.lang.String,
org.xml.sax.helpers.AttributesImpl)) end protected void start(String,
org.xml.sax.helpers.AttributesImpl) throws
or g.xml.sax.SAXException
protected void end(String) throws
org.xml.sax.SAXException: method-execution(void
org.apache.cocoon.generation.AbstractServerPage.end(ja va.lang.String))
|
ALOAD_0 //
org.apache.cocoon.generation.AbstractServerPa ge this (line
197) | field-get(org.xml.sax.ContentHandler
org.apache.cocoon.xml.AbstractXMLProd ucer.contentHandler)
| |
GETFIELD org.apache.cocoon.xml.AbstractXMLProducer.contentHa ndler
Lorg/xml/sax/ContentHandler; |
field-get(org.xml.sax.ContentHandler
org.apache.cocoon.xml.AbstractXMLProd ucer.contentHandler)
|
LDC ""
|
ALOAD_1 // java.lang.String arg0
|
ALOAD_1 // java.lang.String arg0 |
method-call(void org.xml.sax.ContentHandler.endElement(java.lang.String,
j ava.lang.String, java.lang.String)) |
|
INVOKEINTERFACE org.xml.sax.ContentHandler.endElement
(Ljava /lang/String;Ljava/lang/String;Ljava/lang/String;)V
| method-call(void org.xml.sax.ContentHandler.endElement(java.lang.String,
j ava.lang.String, java.lang.String))
|
RETURN (line 198) method-execution(void
org.apache.cocoon.generation.AbstractServerPage.end(ja va.lang.String))
end protected void end(String) throws org.xml.sax.SAXException
protected void characters(String) throws
org.xml.sax.SAXException: method-execution(void
org.apache.cocoon.generation.AbstractServerPage.charac ters(java.lang.String))
|
ALOAD_0 //
org.apache.cocoon.generation.AbstractServerPa ge this (line
206) | field-get(org.xml.sax.ContentHandler
org.apache.cocoon.xml.AbstractXMLProd ucer.contentHandler)
| |
GETFIELD org.apache.cocoon.xml.AbstractXMLProducer.contentHa ndler
Lorg/xml/sax/ContentHandler; |
field-get(org.xml.sax.ContentHandler
org.apache.cocoon.xml.AbstractXMLProd ucer.contentHandler)
|
ALOAD_1 // java.lang.String arg0 |
method-call(char[] java.lang.String.toCharArray()) |
|
INVOKEVIRTUAL java.lang.String.toCharArray ()[C |
method-call(char[] java.lang.String.toCharArray())
|
ICONST_0
|
ALOAD_1 // java.lang.String arg0 |
method-call(int java.lang.String.length()) |
|
INVOKEVIRTUAL java.lang.String.length ()I |
method-call(int java.lang.String.length()) |
method-call(void org.xml.sax.ContentHandler.characters(char[], int,
int)) |
|
INVOKEINTERFACE org.xml.sax.ContentHandler.characters
([CII) V | method-call(void
org.xml.sax.ContentHandler.characters(char[], int, int))
|
RETURN (line 207) method-execution(void
org.apache.cocoon.generation.AbstractServerPage.charac ters(java.lang.String))
end protected void characters(String) throws
org.xml.sax.SAXException
protected void comment(String) throws
org.xml.sax.SAXException: method-execution(void
org.apache.cocoon.generation.AbstractServerPage.comment(java.lang.String))
|
ALOAD_0 //
org.apache.cocoon.generation.AbstractServerPage this (line
215) | field-get(org.xml.sax.ext.LexicalHandler
org.apache.cocoon.xml.AbstractXMLProducer.lexicalHandler)
| |
GETFIELD org.apache.cocoon.xml.AbstractXMLProducer.lexicalHandler
Lorg/xml/sax/ext/LexicalHandler; |
field-get(org.xml.sax.ext.LexicalHandler
org.apache.cocoon.xml.AbstractXMLProducer.lexicalHandler)
|
ALOAD_1 // java.lang.String arg0 |
method-call(char[] java.lang.String.toCharArray()) |
|
INVOKEVIRTUAL java.lang.String.toCharArray ()[C |
method-call(char[] java.lang.String.toCharArray())
|
ICONST_0
|
ALOAD_1 // java.lang.String arg0 |
method-call(int java.lang.String.length()) |
|
INVOKEVIRTUAL java.lang.String.length ()I |
method-call(int java.lang.String.length()) |
method-call(void org.xml.sax.ext.LexicalHandler.comment(char[], int,
int))
|
|
INVOKEINTERFACE org.xml.sax.ext.LexicalHandler.comment
([CII)V | method-call(void
org.xml.sax.ext.LexicalHandler.comment(char[], int, int))
|
RETURN (line 216) method-execution(void
org.apache.cocoon.generation.AbstractServerPage.comment(java.lang.String))
end protected void comment(String) throws org.xml.sax.SAXException
end public abstract class
org.apache.cocoon.generation.AbstractServerPage null java.lang.NullPointerException
at
org.aspectj.weaver.AsmRelationshipProvider.checkerMunger(AsmRelationshipProvider.java:51)
at
org.aspectj.weaver.Checker.match(Checker.java:58)
at
org.aspectj.weaver.bcel.BcelClassWeaver.match(BcelClassWeaver.java:985)
at
org.aspectj.weaver.bcel.BcelClassWeaver.match(BcelClassWeaver.java:791)
at
org.aspectj.weaver.bcel.BcelClassWeaver.weave(BcelClassWeaver.java:291)
at
org.aspectj.weaver.bcel.BcelClassWeaver.weave(BcelClassWeaver.java:77)
at
org.aspectj.weaver.bcel.BcelWeaver.weave(BcelWeaver.java:417)
at
org.aspectj.weaver.bcel.BcelWeaver.weave(BcelWeaver.java:390)
at
org.aspectj.weaver.bcel.BcelWeaver.weave(BcelWeaver.java:327)
at
org.aspectj.ajdt.internal.core.builder.AjBuildManager.weaveAndGenerateClassFiles(AjBuildManager.java:256)
at
org.aspectj.ajdt.internal.core.builder.AjBuildManager.doBuild(AjBuildManager.java:156)
at
org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:70)
at
org.aspectj.ajde.internal.CompilerAdapter.compile(CompilerAdapter.java:103)
at
org.aspectj.ajde.internal.AspectJBuildManager$CompilerThread.run(AspectJBuildManager.java:165)
|