jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • XFire
  • XFIRE-919

xsd:base64Binary in response type cause NPE on deployment

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Critical Critical
  • Resolution: Unresolved
  • Affects Version/s: 1.2.5
  • Fix Version/s: None
  • Component/s: JAX-WS, JAXB 2.0
  • Labels:
    None
  • Testcase included:
    yes

Description

A WSDL-first service using the JAX-WS profile in XFire 1.2.5 fails if one of the response types includes an element of type xsd:base64Binary. This bug is not present in XFire 1.2.4.

The attached project demonstrates the bug. An example stack trace can be found at the end of this description.

This bug can be demonstrated by running "mvn install" or "mvn test". If you comment out the "NewMenu" element in the "OrderPizzaResponseType", you'll see that the test then runs successfully. The test also runs successfully if you change the dependencies in the POM.xml to use XFire 1.2.4.

Maven test result with stack trace:

-------------------------------------------------------------------------------
Test set: com.mypizzaco.service.PizzaServiceTestCase
-------------------------------------------------------------------------------
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.172 sec <<< FAILURE!
warning(junit.framework.TestSuite$1) Time elapsed: 0 sec <<< FAILURE!
junit.framework.AssertionFailedError: Exception in constructor: testPizzaServiceWithClient (org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pizzaService' defined in class path resource [spring-config.xml]: Invocation of init method failed; nested exception is org.codehaus.xfire.XFireRuntimeException: Couldn't load provider.. Nested exception is java.lang.NullPointerException: null
Caused by: org.codehaus.xfire.XFireRuntimeException: Couldn't load provider.. Nested exception is java.lang.NullPointerException: null
java.lang.NullPointerException
at org.codehaus.xfire.jaxb2.JaxbTypeCreator.isJaxbType(JaxbTypeCreator.java:92)
at org.codehaus.xfire.jaxws.type.JAXWSTypeCreator.createTypeForClass(JAXWSTypeCreator.java:31)
at org.codehaus.xfire.jaxws.type.JAXWSTypeCreator.createHolderType(JAXWSTypeCreator.java:51)
at org.codehaus.xfire.aegis.type.AbstractTypeCreator.createTypeForClass(AbstractTypeCreator.java:101)
at org.codehaus.xfire.jaxws.type.JAXWSTypeCreator.createTypeForClass(JAXWSTypeCreator.java:38)
at org.codehaus.xfire.aegis.type.AbstractTypeCreator.createType(AbstractTypeCreator.java:356)
at org.codehaus.xfire.aegis.AegisBindingProvider.getParameterType(AegisBindingProvider.java:283)
at org.codehaus.xfire.aegis.AegisBindingProvider.initializeMessage(AegisBindingProvider.java:138)
at org.codehaus.xfire.service.binding.AbstractBindingProvider.initialize(AbstractBindingProvider.java:41)
at org.codehaus.xfire.aegis.AegisBindingProvider.initialize(AegisBindingProvider.java:126)
at org.codehaus.xfire.service.binding.ObjectServiceFactory.create(ObjectServiceFactory.java:460)
at org.codehaus.xfire.annotations.AnnotationServiceFactory.create(AnnotationServiceFactory.java:256)
at org.codehaus.xfire.service.binding.ObjectServiceFactory.create(ObjectServiceFactory.java:224)
at org.codehaus.xfire.service.binding.ObjectServiceFactory.create(ObjectServiceFactory.java:184)
at org.codehaus.xfire.annotations.AnnotationServiceFactory.create(AnnotationServiceFactory.java:410)
at org.codehaus.xfire.spring.ServiceBean.afterPropertiesSet(ServiceBean.java:172)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1057)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1024)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:421)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:245)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:140)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:242)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:156)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:273)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:346)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:92)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:77)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:68)
at com.mypizzaco.service.PizzaServiceTestCase.<init>(PizzaServiceTestCase.java:17)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at junit.framework.TestSuite.createTest(TestSuite.java:131)
at junit.framework.TestSuite.addTestMethod(TestSuite.java:114)
at junit.framework.TestSuite.<init>(TestSuite.java:75)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at org.apache.maven.surefire.junit.JUnitTestSet.constructTestObject(JUnitTestSet.java:148)
at org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:194)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:135)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:122)
at org.apache.maven.surefire.Surefire.run(Surefire.java:129)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:225)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:747)
)
at junit.framework.Assert.fail(Assert.java:47)
at junit.framework.TestSuite$1.runTest(TestSuite.java:263)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:210)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:135)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:122)
at org.apache.maven.surefire.Surefire.run(Surefire.java:129)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:225)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:747)

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Hide
    Zip Archive
    pizza_service_npe_bug.zip
    19/Mar/07 3:49 PM
    9 kB
    Chris Moesel
    1. XML File
      pizza_service_npe_bug/pom.xml 4 kB
    2. Text File
      pizza_service_npe_bug/readme.txt 8 kB
    3. XML File
      pizza_service_npe_bug/.../custom-schema.xml 0.4 kB
    4. File
      pizza_service_npe_bug/.../log4j.properties 0.3 kB
    5. XML File
      pizza_service_npe_bug/src/.../pizza.wsdl 3 kB
    6. XML File
      pizza_service_npe_bug/.../spring-config.xml 2 kB
    7. File
      pizza_service_npe_bug/src/.../index.jsp 0.2 kB
    8. XML File
      pizza_service_npe_bug/src/.../web.xml 1 kB
    9. Java Source File
      pizza_service_npe_bug/.../PizzaServiceTestCase.java 1 kB
    Download Zip
    Show
    Zip Archive
    pizza_service_npe_bug.zip
    19/Mar/07 3:49 PM
    9 kB
    Chris Moesel

Activity

  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Chris Moesel added a comment - 27/Mar/07 2:12 PM

Oooh! A new discovery!

If you change the WSDL so that the xsd:base64Binary element is the first element in the response wrapper, then the bug disappears!

The main difference is that when it is the first element, it becomes the return type of the generated Java interface. When it is not the first element, it is contained in a Holder object in the interface-- and this is when it fails.

Hope this extra information helps!

Show
Chris Moesel added a comment - 27/Mar/07 2:12 PM Oooh! A new discovery! If you change the WSDL so that the xsd:base64Binary element is the first element in the response wrapper, then the bug disappears! The main difference is that when it is the first element, it becomes the return type of the generated Java interface. When it is not the first element, it is contained in a Holder object in the interface-- and this is when it fails. Hope this extra information helps!

People

  • Assignee:
    Dan Diephouse
    Reporter:
    Chris Moesel
Vote (0)
Watch (0)

Dates

  • Created:
    19/Mar/07 3:49 PM
    Updated:
    27/Mar/07 2:12 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.