Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nullpointer exception in JAXB2 marshaller [SWS-621] #733

Closed
gregturn opened this issue May 27, 2010 · 3 comments
Closed

Nullpointer exception in JAXB2 marshaller [SWS-621] #733

gregturn opened this issue May 27, 2010 · 3 comments
Assignees

Comments

@gregturn
Copy link
Member

@gregturn gregturn commented May 27, 2010

Radim Kolar opened SWS-621 and commented

I am using Jaxb2 marshaller in groovy. It fails with NPE in marshelsendandreceive if no setClassesToBeBound or setContextPath is called. According to official springws documentation both settings are optional and it should not fail with NPE or at least it should provide some text message what is wrong.

def marshaller = new org.springframework.oxm.jaxb.Jaxb2Marshaller()
/*
marshaller.setClassesToBeBound([com.foois.ws.whois.Ipinfo.class,com.foois.ws.whois.Ipinforequest.class] as Class[])
*/
template.setMarshaller(marshaller)
template.setUnmarshaller(marshaller)

def ipinfo = new com.foois.ws.whois.Ipinforequest()
ipinfo.setIp(ip.ip)
com.foois.ws.whois.Ipinfo result1 = template.marshalSendAndReceive("http://127.0.0.1:4344/axis2/services/whois/ipinfo",ipinfo)


Affects: 1.5.8

@gregturn
Copy link
Member Author

@gregturn gregturn commented May 27, 2010

Arjen Poutsma commented

The Jaxb2Marshaller does show throw a IllegalArgumentException when afterPropertiesSet() is called (which happens by default when the marshaller is wired up in a Spring context).

In other words, make sure you call afterProperiesSet() when instantiating a marshaller in code. Not just because of this message, but also because it does other initialization.

@gregturn
Copy link
Member Author

@gregturn gregturn commented May 27, 2010

Radim Kolar commented

You are right, calling afterProperiesSet() throws IllegalArgumentException. but it should be mentioned in http://static.springsource.org/spring-ws/sites/1.5/reference/html/oxm.html section 8.5.2. Jaxb2Marshaller more clearly what configuration is required.

@gregturn
Copy link
Member Author

@gregturn gregturn commented May 4, 2012

Arjen Poutsma commented

Closing old issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.