1

在 tomcat 上运行 Web 服务时出现以下错误:

 HTTP Status 404 -

type Status report

message

description The requested resource () is not available.

Apache Tomcat/6.0.32

这是我收到错误的代码:

@SuppressWarnings("unchecked")
@WebMethod(operationName = "getTransactionDetails")
public List<MyTransactionWSBean> getTransactionDetails(
    @WebParam(name = "sessionId") long sessionId,
    @WebParam(name = "customerId") long customerId) throws PayboxFault {

MyTransactionWSBean bean = null;
List<MyTransactionWSBean> beanresponse = null;
WSAttribute response = null;
try {
    if (LOG.isInfoEnabled()) {
    LOG.info("Inside updateCustomerRole Service");
    }
    bean = new MyTransactionWSBean();
    WSAttribute wsAttribute = new WSAttribute();
    wsAttribute.setSessionID(sessionId);
    bean.setCustomerId(customerId);
    wsAttribute.setBeanObject(bean);
    wsAttribute.setOperationName("getTransactionDetails");
    IRequestHandler iRequestHandler = HBLUtil
        .getRequestHandler(RequestHandlerType.getTransactionDetailsRHandler);
    response = iRequestHandler.handleRequest(wsAttribute);

    if(wsAttribute.isSuccess())
    {
        beanresponse = (List<MyTransactionWSBean>) response.getBeanObject();
    }

} catch (Exception e) {
    throw handleException("getTransactionDetails", e);
}
return beanresponse;
} 

上面的代码正在调用我的处理程序,而处理程序正在调用持久性并将结果返回给该服务。这是我的持久性代码:

public class getTransactionDetailsPersistenceImpl extends BasePersistenceService {

protected final static Log LOG = LogFactory
        .getLog(getTransactionDetailsPersistenceImpl.class);

@Override
public WSAttribute createObject(WSAttribute wsAttribute) {

    LOG.info("Inside getTransactionDetailsPersistenceImpl");

    MyTransactionWSBean bean = null;
    String query = null;
    Session session = null;
    WSAttribute response = null;

    try
    {
        session = getHibernateSession();
    response = new WSAttribute();
    bean = (MyTransactionWSBean) wsAttribute.getBeanObject();
    long customerId = bean.getCustomerId();
    long sessionId = wsAttribute.getSessionID();

     query= "select id_txn,id_use_case,amnt_amount,str_text,id_payee,id_payer," +
            "(select str_identification from PBXMOB.customers_identifications " +
            "where ID_customer =" + customerId + " and ID_identification_type = 0) as payer_mobnum ," +
            "(select str_identification from PBXMOB.customers_identifications where " +
            "ID_customer = " + customerId + " and ID_identification_type = 8) as payer_sva " +
            "from pbxmon.mon_txns where id_payer = " + customerId;       

     @SuppressWarnings("unchecked")
     List<MyTransactionWSBean> resultList = session.createSQLQuery(query).list();
     LOG.info("after executing query");
     if(resultList.size() > 0)
     {
         LOG.info("Inside resultList.size()");
         response.setSuccess(true);
         response.setBeanObject(resultList);
     } 

    }
    catch (Exception e) {
        e.printStackTrace();
        LOG.error("Error while Updating Customer Role", e);
    }
    return response;

}
4

0 回答 0