History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: XFIRE-159
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Dan Diephouse
Reporter: Igor Pavin
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
XFire

NullPointerException instead of error message

Created: 09/Nov/05 03:40 AM   Updated: 09/Nov/05 10:53 PM
Component/s: Aegis Module
Affects Version/s: 1.0-M5
Fix Version/s: 1.0-M6

Time Tracking:
Not Specified


 Description  « Hide
Let's take in example the following java-bean, which VIOLATES the java beans property names notation

public class GenericItemContainer {

protected boolean isGroup = false;

public void setIsGroup(boolean isGroup) { this.isGroup = isGroup; }

public boolean isGroup() { return isGroup; }
}

For such java-bean the class org.codehaus.xfire.aegis.type.java5.\AnnotatedTypeInfo performs the following:

protected boolean isAttribute(PropertyDescriptor desc)

{ return desc.getReadMethod().isAnnotationPresent(XmlAttribute.class); }

and throws NPE, because the desc.getReadMethod() is NULL:

org.codehaus.xfire.XFireRuntimeException: Error initializing parameters for method public java.lang.String uk.ltd.singles.datingengine.remoting.test.TestServiceImpl.echo(java.util.List,java.util.List,java.util.List,java.util.List,java.util.Set,java.lang.Integer,int,java.lang.Boolean,boolean): Couldn't create TypeInfo.. Nested exception is java.lang.NullPointerException: null
java.lang.NullPointerException
at org.codehaus.xfire.aegis.type.java5.AnnotatedTypeInfo.isAttribute(AnnotatedTypeInfo.java:22)
at org.codehaus.xfire.aegis.type.basic.BeanTypeInfo.initialize(BeanTypeInfo.java:52)
at org.codehaus.xfire.aegis.type.java5.AnnotatedTypeInfo.<init>(AnnotatedTypeInfo.java:17)
at org.codehaus.xfire.aegis.type.java5.AnnotatedType.<init>(AnnotatedType.java:15)
at org.codehaus.xfire.aegis.type.java5.Java5TypeCreator.createDefaultType(Java5TypeCreator.java:89)
at org.codehaus.xfire.aegis.type.AbstractTypeCreator.createTypeForClass(AbstractTypeCreator.java:82)
at org.codehaus.xfire.aegis.type.AbstractTypeCreator.createType(AbstractTypeCreator.java:238)
at org.codehaus.xfire.aegis.type.AbstractTypeCreator.createCollectionQName(AbstractTypeCreator.java:174)
at org.codehaus.xfire.aegis.type.AbstractTypeCreator.createCollectionType(AbstractTypeCreator.java:124)
at org.codehaus.xfire.aegis.type.java5.Java5TypeCreator.createCollectionType(Java5TypeCreator.java:83)
at org.codehaus.xfire.aegis.type.AbstractTypeCreator.createTypeForClass(AbstractTypeCreator.java:71)
at org.codehaus.xfire.aegis.type.AbstractTypeCreator.createType(AbstractTypeCreator.java:207)
at org.codehaus.xfire.aegis.AegisBindingProvider.getParameterType(AegisBindingProvider.java:184)
at org.codehaus.xfire.aegis.AegisBindingProvider.initializeMessage(AegisBindingProvider.java:128)
at org.codehaus.xfire.aegis.AegisBindingProvider.initialize(AegisBindingProvider.java:96)
at org.codehaus.xfire.service.binding.ObjectServiceFactory.create(ObjectServiceFactory.java:243)
at org.codehaus.xfire.annotations.AnnotationServiceFactory.create(AnnotationServiceFactory.java:117)
at org.codehaus.xfire.service.binding.ObjectServiceFactory.create(ObjectServiceFactory.java:150)
at org.codehaus.xfire.spring.remoting.Jsr181HandlerMapping.initApplicationContext(Jsr181HandlerMapping.java:66)

I guess, it would be better to throw another exception with the corresponding message (for example, "no read method defind in bean bla-bla-bla")



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Dan Diephouse - 09/Nov/05 11:32 AM
I can't reproduce this with CVS HEAD. So maybe try a M6-SNAPSHOT and let me know if that works for you.