1 Reply Latest reply on Dec 3, 2009 11:17 AM by Poppy Javid

    JBoss 4.2.2 JDK1.5 Webservice user-defined Exception handlin

    Poppy Javid Newbie

      Hi

      I am trying to write a webservice, that throws a user-defined exception. I am using bottom-up approach and when I package and deploy the webservice in JBoss 4.2.2 AS, I am getting exceptions. Looks like it does not like the way the BaseErrorType (user-defined exception) is defined. How do I fix this issue?

      Here is my webservice:
      ServiceRequests.java

      @WebService
      public class ServiceRequests {

      public List GetNpaNxxList(
      @WebParam(name="postalCode") String postalCode,
      @WebParam(name="npa") String npa, @WebParam(name="npaNxx") String npaNxx,
      @WebParam(name="transactionId") String transactionId,
      @WebParam(name="restrictedFlag") boolean restrictedFlag)
      throws BaseErrorType
      {
      List list = new ArrayList();
      return list;
      }

      BaseErrorType.java

      import javax.xml.bind.annotation.XmlType;

      @XmlType(name="com.vzw.opc.ws.BaseErrorType")
      public class BaseErrorType extends java.lang.Exception{

      public BaseErrorType() {}

      public BaseErrorType(String msg)
      {
      super(msg);
      }

      }

      When I package and deploy my webservice in Jboss, I am getting this exception:

      2009-11-16 11:19:21,803 ERROR [org.jboss.deployment.MainDeployer] Could not start deployment: file:/opt/vzw/webserver/jboss-4.2.2.GA/server/provapi-ws/deploy/OnstarWebService.war
      javax.xml.ws.WebServiceException: @XmlType missing from fault bean: com.vzw.opc.ws.jaxws.BaseErrorTypeBean
      at org.jboss.ws.metadata.umdm.FaultMetaData.initializeFaultBean(FaultMetaData.java:256)
      at org.jboss.ws.metadata.umdm.FaultMetaData.eagerInitialize(FaultMetaData.java:226)
      at org.jboss.ws.metadata.umdm.OperationMetaData.eagerInitialize(OperationMetaData.java:464)
      at org.jboss.ws.metadata.umdm.EndpointMetaData.eagerInitializeOperations(EndpointMetaData.java:533)
      at org.jboss.ws.metadata.umdm.EndpointMetaData.initializeInternal(EndpointMetaData.java:519)
      at org.jboss.ws.metadata.umdm.EndpointMetaData.eagerInitialize(EndpointMetaData.java:507)
      at org.jboss.ws.metadata.umdm.ServiceMetaData.eagerInitialize(ServiceMetaData.java:429)