No serializer found for class error when I try to create a Web Service

匿名 (未验证) 提交于 2019-12-03 09:06:55

问题:

I create a web service and it works fine when the return is List like this:

@WebService public class IndicatorWSImpl extends SpringBeanAutowiringSupport implements IndicatorWS {  @Autowired private HomeIndicadoresReportService homeIndicadoresReportService;   @Override public List<String> entidades() {      homeIndicadoresReportService.buildValuesToGraph(resultMesAtual, selectedEntity, selectedBS, selectedTS,             selectedFunctionality, filter, false);      List<String> lista = new ArrayList<String>();      for (EntityIndicatorVO entityIndicatorVO : resultMesAtual) {         lista.add(entityIndicatorVO.getName());     }       return lista; }  } 

But when I change the return for the List they can not create this list on the return and come with this error:

mai 04, 2017 9:44:20 AM org.apache.axis.Message writeTo GRAVE: java.io.IOException: AxisFault  faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException  faultSubcode:   faultString: java.io.IOException: No serializer found for class     com.santander.portalcio.backend.services.bsts.indicators.EntityIndicatorVO in registry org.apache.axis.encoding.TypeMappingDelegate@6186d47d  faultActor:   faultNode:   faultDetail:  {http://xml.apache.org/axis/}stackTrace:java.io.IOException: No serializer found for class com.santander.portalcio.backend.services.bsts.indicators.EntityIndicatorVO in registry org.apache.axis.encoding.TypeMappingDelegate@6186d47d at org.apache.axis.encoding.SerializationContext.serializeActual(SerializationContext.java:1507) at org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:980) at org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:734) at org.apache.axis.encoding.ser.ArraySerializer.serialize(ArraySerializer.java:425) at org.apache.axis.encoding.SerializationContext.serializeActual(SerializationContext.java:1504) at  

This are the class with List return:

@WebService public class IndicatorWSImpl extends SpringBeanAutowiringSupport implements IndicatorWS {  @Autowired private HomeIndicadoresReportService homeIndicadoresReportService;  @Override public List<EntityIndicatorVO> entidades() {      homeIndicadoresReportService.buildValuesToGraph(resultMesAtual, selectedEntity, selectedBS, selectedTS,             selectedFunctionality, filter, false);       return resultMesAtual; }  } 

this is the VO class:

public class EntityIndicatorVO extends IndicatorVO implements Serializable {  private static final long serialVersionUID = 1L;  private List<BSIndicatorVO> bsList;   public EntityIndicatorVO(Long id, String name) {     super(id, name, 0d); }  public EntityIndicatorVO() { }  public void copy(EntityIndicatorVO entityInd) {     super.copy(entityInd);     setBsList(entityInd.getBsList()); }  public List<BSIndicatorVO> getBsList() {     if (bsList == null) {         bsList = new ArrayList<BSIndicatorVO>();     }     return bsList; }  public void setBsList(List<BSIndicatorVO> bsList) {     this.bsList = bsList; }  } 

Could you help me?

回答1:

Did you configure a serializer in Axis? If not you need to configure it. Axis comes with BeanSerializer.

Configuring your bean mapping BeanSerializer



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!