4 Replies Latest reply on Feb 5, 2008 7:58 AM by Mod Kota

    SchemaTypeCreator.introspectJavaProperties Exception w/ POJO

    Adam Schmidt Newbie

      Hi,

      I've created a simple POJO web service which has a method that returns a generated data type from an XML schema (using xjc). On deploying the web application that contains the service, I get the following exception:

      java.lang.NullPointerException
       at org.jboss.ws.tools.schema.SchemaTypeCreator.introspectJavaProperties(SchemaTypeCreator.java:578)
       at org.jboss.ws.tools.schema.SchemaTypeCreator.generateNewType(SchemaTypeCreator.java:332)
       at org.jboss.ws.tools.schema.SchemaTypeCreator.getType(SchemaTypeCreator.java:273)
       at org.jboss.ws.tools.schema.SchemaTypeCreator.generateType(SchemaTypeCreator.java:132)
       at org.jboss.ws.tools.schema.SchemaTypeCreator.generateType(SchemaTypeCreator.java:127)
       at org.jboss.ws.tools.schema.SchemaTypeCreator.createFieldParticle(SchemaTypeCreator.java:607)
       at org.jboss.ws.tools.schema.SchemaTypeCreator.introspectJavaProperties(SchemaTypeCreator.java:592)
       at org.jboss.ws.tools.schema.SchemaTypeCreator.generateNewType(SchemaTypeCreator.java:332)
       at org.jboss.ws.tools.schema.SchemaTypeCreator.getType(SchemaTypeCreator.java:273)
       at org.jboss.ws.tools.schema.SchemaTypeCreator.generateType(SchemaTypeCreator.java:132)
       at org.jboss.ws.tools.schema.SchemaTypeCreator.generateType(SchemaTypeCreator.java:127)
       at org.jboss.ws.tools.schema.SchemaTypeCreator.createFieldParticle(SchemaTypeCreator.java:607)
       at org.jboss.ws.tools.schema.SchemaTypeCreator.introspectJavaProperties(SchemaTypeCreator.java:592)
       at org.jboss.ws.tools.schema.SchemaTypeCreator.generateNewType(SchemaTypeCreator.java:332)
       at org.jboss.ws.tools.schema.SchemaTypeCreator.getType(SchemaTypeCreator.java:273)
       at org.jboss.ws.tools.schema.SchemaTypeCreator.generateType(SchemaTypeCreator.java:132)
       at org.jboss.ws.tools.JavaToXSD.generateForSingleType(JavaToXSD.java:109)
       at org.jboss.ws.tools.helpers.JavaToWSDLHelper.generateType(JavaToWSDLHelper.java:556)
       at org.jboss.ws.tools.helpers.JavaToWSDLHelper.generateTypesForXSD(JavaToWSDLHelper.java:141)
       at org.jboss.ws.tools.JavaToWSDL11.handleJavaToWSDLGeneration(JavaToWSDL11.java:245)
       at org.jboss.ws.tools.JavaToWSDL11.generate(JavaToWSDL11.java:168)
       at org.jboss.ws.tools.JavaToWSDL.generate(JavaToWSDL.java:318)
       at org.jboss.ws.deployment.JSR181MetaDataBuilder.processOrGenerateWSDL(JSR181MetaDataBuilder.java:289)
       at org.jboss.ws.deployment.JSR181MetaDataBuilder.setupEndpointFromAnnotations(JSR181MetaDataBuilder.java:231)
       at org.jboss.ws.deployment.JSR181MetaDataBuilderJSE.buildMetaData(JSR181MetaDataBuilderJSE.java:72)
       at org.jboss.ws.deployment.ServiceEndpointDeployer.create(ServiceEndpointDeployer.java:92)
       at org.jboss.ws.integration.jboss.DeployerInterceptor.create(DeployerInterceptor.java:80)
       at org.jboss.ws.integration.jboss.DeployerInterceptorJSE.create(DeployerInterceptorJSE.java:74)
       at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.create(SubDeployerInterceptorSupport.java:180)
       at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:91)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
       at $Proxy105.create(Unknown Source)
       at org.jboss.deployment.MainDeployer.create(MainDeployer.java:969)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:818)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
       at sun.reflect.GeneratedMethodAccessor103.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
       at $Proxy8.deploy(Unknown Source)
       at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
       at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:610)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)


      Schema is as follows (classes generated with package com.example.message):

      <?xml version="1.0" encoding="UTF-8"?>
      <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.org/MessageService" xmlns:tns="http://www.example.org/MessageService" elementFormDefault="qualified">
      
       <complexType name="ComplexMessageType">
       <sequence>
       <element name="MessageContent" type="string"></element>
       <element name="ServerTime" type="dateTime"></element>
       </sequence>
       </complexType>
      
       <element name="ComplexMessage" type="tns:ComplexMessageType"></element>
      </schema>


      POJO Web service code is as follows:

      package com.example.service;
      
      import java.util.GregorianCalendar;
      
      import javax.jws.*;
      import javax.xml.datatype.*;
      import com.example.message.*;
      
      @WebService(name="Example", serviceName="ExampleService", targetNamespace="http://www.example.org/MessageService")
      public class ExampleService implements ExampleServiceSEI {
      
       @WebMethod(operationName="EchoMessage")
       public @WebResult(name="OutMessage") String echoMessage(@WebParam(name="InMessage") String message) {
       return "Hello, " + message;
       }
      
       @WebMethod(operationName="EchoComplexMessage")
       public @WebResult(name="OutMessage") ComplexMessageType echoComplexMessage(@WebParam(name="InMessage") String message) {
       ComplexMessageType result = new ObjectFactory().createComplexMessageType();
       result.setMessageContent("Hello, " + message);
       try {
       result.setServerTime(DatatypeFactory.newInstance().newXMLGregorianCalendar(new GregorianCalendar()));
       } catch (DatatypeConfigurationException e) {
       // TODO Auto-generated catch block
       e.printStackTrace();
       }
       return result;
       }
      
      }
      


      This deployment was done on a clean install of jboss-4.0.5.GA from the jems-installer-1.2.0.GA installer package.

      Is there something I've missed, or is this feature slated for the next JBossWS release? If there's something that needs to be done re: configuration or updating software, what is it?

      Has anyone else experienced this problem?

      Thanks in advance.

        • 1. Re: SchemaTypeCreator.introspectJavaProperties Exception w/
          Jon Goldberg Newbie

          Hi-

          Did you ever resolve this issue? I'm seeing the same error.

          thanks.

          • 3. Re: SchemaTypeCreator.introspectJavaProperties Exception w/
            Adam Schmidt Newbie

            Adding a "serializable" child element to the "globalBindings" xjc annotation in the schema seemed to resolve the problem. For compatibility with .NET apps, I also added the following annotation to element collections throughout the schema, as generic collections didn't seem to be picked up when adding a web reference to a project.

            <jxb:property collectionType="indexed"/>


            Given that I found a workaround, I haven't taken the opportunity to see if this issue is resolved without the workaround in jbossws 1.2, but I would hope that it's been resolved either inherently or as a bugfix.

            • 4. Re: SchemaTypeCreator.introspectJavaProperties Exception w/
              Mod Kota Newbie

              Hi ,

              I am getting fallowing exception while making a service as webserice from JbossIDE. Can any one know what is the probelm actually.
              Thanks in advance


              Exception in thread "main" java.lang.NullPointerException
              at org.jboss.ws.tools.schema.SchemaTypeCreator.introspectJavaProperties(SchemaTypeCreator.java:578)
              at org.jboss.ws.tools.schema.SchemaTypeCreator.generateNewType(SchemaTypeCreator.java:332)
              at org.jboss.ws.tools.schema.SchemaTypeCreator.getType(SchemaTypeCreator.java:273)
              at org.jboss.ws.tools.schema.SchemaTypeCreator.generateType(SchemaTypeCreator.java:132)
              at org.jboss.ws.tools.schema.SchemaTypeCreator.generateType(SchemaTypeCreator.java:127)
              at org.jboss.ws.tools.schema.SchemaTypeCreator.createFieldParticle(SchemaTypeCreator.java:607)
              at org.jboss.ws.tools.schema.SchemaTypeCreator.introspectJavaProperties(SchemaTypeCreator.java:592)
              at org.jboss.ws.tools.schema.SchemaTypeCreator.generateNewType(SchemaTypeCreator.java:332)
              at org.jboss.ws.tools.schema.SchemaTypeCreator.getType(SchemaTypeCreator.java:273)
              at org.jboss.ws.tools.schema.SchemaTypeCreator.generateType(SchemaTypeCreator.java:132)
              at org.jboss.ws.tools.schema.SchemaTypeCreator.generateType(SchemaTypeCreator.java:127)
              at org.jboss.ws.tools.schema.SchemaTypeCreator.createFieldParticle(SchemaTypeCreator.java:607)
              at org.jboss.ws.tools.schema.SchemaTypeCreator.introspectJavaProperties(SchemaTypeCreator.java:592)
              at org.jboss.ws.tools.schema.SchemaTypeCreator.generateNewType(SchemaTypeCreator.java:332)
              at org.jboss.ws.tools.schema.SchemaTypeCreator.getType(SchemaTypeCreator.java:273)
              at org.jboss.ws.tools.schema.SchemaTypeCreator.generateType(SchemaTypeCreator.java:132)
              at org.jboss.ws.tools.JavaToXSD.generateForSingleType(JavaToXSD.java:109)
              at org.jboss.ws.tools.helpers.JavaToWSDLHelper.generateType(JavaToWSDLHelper.java:556)
              at org.jboss.ws.tools.helpers.JavaToWSDLHelper.generateTypesForXSD(JavaToWSDLHelper.java:141)
              at org.jboss.ws.tools.JavaToWSDL11.handleJavaToWSDLGeneration(JavaToWSDL11.java:245)
              at org.jboss.ws.tools.JavaToWSDL11.generate(JavaToWSDL11.java:168)
              at org.jboss.ws.tools.JavaToWSDL.generate(JavaToWSDL.java:318)
              at org.jboss.ws.tools.helpers.ToolsHelper.handleJavaToWSDLGeneration(ToolsHelper.java:122)
              at org.jboss.ws.tools.WSTools.process(WSTools.java:132)
              at org.jboss.ws.tools.WSTools.generate(WSTools.java:120)
              at org.jboss.ws.tools.WSTools.main(WSTools.java:61)


              I hope this is not the problem with my code. Is there any configuration issues for this? This kind of exception I am getting for one service. But if I do a small service and making it as webservice from Jboss IDE I did not get any errors. Can anyone know what might the problem?