Bom dia pessoal
Temos um sistema no qual dou suporte e estou com um problema que não tenho a menor ideia de como faço para descobrir o que está ocorrendo.
Tem um pagina que utiliza Ibatis, e da semana passada para cá ela começou a não funcionar corretamente.
Vou explicar o que o usuario faz e onde aparece o problema
Na pagina principal ele coloca a conta do cliente
Ele busca e mostra em baixo as opções
O usuario clica no cliente correto e neste momento é feito um carregamento de varios objetos: conta, distribuicoes de remessa e negociacoes do cliente
Carrega-se uma outra tela com todos esses dados.
O que esta acontecendo:
Essa outra pagina que deve ser carregada está vindo com os campos em branco e uma barra invertida no campo Cidade/Estado.
Como faço para descobrir onde está o erro?
Eu executei os selects que são executados pela aplicação para obter esses dados e todos estão retornando os dados que devem ser retornados mas na tela não está funcionando.
Consigo colocar um try/catch no JSP? Em qual parte?
:???:Obrigada
Uma página JSP vai virar um servlet quando for compilada, então você pode sim colocar um try catch, só tem que saber onde você vai jogar a exceção.
Eu não trabalhei muito com JSP, então não sei se existe uma maneira mais elegante de tratar exceções nestas páginas (já usei erros pages, mas elas não vão te ajudar a descobrir o erro no momento
)
Você pode jogar um try catch assim
<% try { %>
//seu cógio HTML, e taglibs
<%}catch(Exception e) {
// aqui recomendo gravar a exceção em um arquivo texto de log, fica mais fácil do que jogar na tela.
}
%>
Se estiver acontecendo realmente uma exceção você vai descobrir onde ela está, e vai poder resolver seu problema.
Abs
Obrigada Bruno, mas depois de analisar um pouco mais descobri que não é problema propriamente na pagina mas sim nos objetos que devem carregar ele.
Em alguns momentos ela vem um parte carregada e outra não
Em outros momentos ela vem tudo em branco como se o objeto estivesse vazio.
Como faço para verificar se essas conexoes estão apresentando erro?
O WebLogic lança esses problemas em alguma log
Você sabe em qual parte da aplicação posso colocar comandos que me ajue a diagnosticar esse problema.
Obrigada a quem puder me ajudar.
Heloisa
Heloísa,
pelo que você falou parece que o problema é quando esses objetos são preenchedos, ou seja quando as consultar ao banco retornam vazio. Mas como você mesmo disse você testou todas as queries e elas estavam todas funcionando. Tem certeza que estes dados estão no banco?
Eu pensei que o problema poderia ser no transporte do objeto, mas como você está trabalhando com JSP e Servlet (tem mais alguma tecnologia envolvida? EJB por exemplo?) e o código Java é todo processador server-side este problema não vai acontecer…
Não conheço nada sobre o WebLogic, mas o Tomcat por exemplo, guarda os logs em uma pasta chamada “logs” dentro do dirétorio do servidor web, não sei se no WebLogic é a mesma coisa.
Dá uma olhada nos dados que você está recebendo do banco através do Java. Você está usando JPA por acaso? Talvez seja algum problema no mapeamento do objeto.
Abs
Oi Bruno. Eu não sou expert em Java Web, mas o cara que estava me ajudando saiu de férias e ele me disse que essa pagina estava utilizando Ibatis e que eu encontraria de tudo no projeto, inclusive isso que voce falou.
Esse abaixo é o erro na log do servidor.
Como faço para identificar se problema mesmo no carregamento ou se é timeout. O ruim de tudo é que quando estou debugando o erro não aparece.
19/08/2008 - 18:35:32,095 [ERROR] AbstractAction - com.vivo.crystal.ce.agcob.action.consulta.ControlarContasClienteAction@5f7d3ac
at com.vivo.crystal.ce.agcob.business.ContaBO.getContaById(Ljava/lang/Long;)Lcom/vivo/crystal/ce/agcob/vo/Conta;(ContaBO.java:106)
at com.vivo.crystal.ce.agcob.ejb.session.ContasClienteSessionBean.getContaClienteById(Ljava/lang/Long;)Lcom/vivo/crystal/ce/agcob/vo/Conta;(ContasClienteSessionBean.java:128)
at com.vivo.crystal.ce.agcob.ejb.session.ContasClienteSessionBean_q04ary_EOImpl.getContaClienteById(Ljava/lang/Long;)Lcom/vivo/crystal/ce/agcob/vo/Conta;(ContasClienteSessionBean_q04ary_EOImpl.java:46)
at com.vivo.crystal.ce.agcob.ejb.session.ContasClienteSessionBean_q04ary_EOImpl_CBV.getContaClienteById(Ljava/lang/Long;)Lcom/vivo/crystal/ce/agcob/vo/Conta;(Unknown Source)
at com.vivo.crystal.ce.agcob.delegate.AgenciaCobrancaDelegate.getContaClienteById(Ljava/lang/Long;)Lcom/vivo/crystal/ce/agcob/vo/Conta;(AgenciaCobrancaDelegate.java:1149)
at com.vivo.crystal.ce.agcob.action.consulta.ControlarContasClienteAction.detalhar(Lorg/apache/struts/action/ActionMapping;Lorg/apache/struts/action/ActionForm;Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)Lorg/apache/struts/action/ActionForward;(ControlarContasClienteAction.java:113)
at jrockit.reflect.NativeMethodInvoker.invoke0(Ljava/lang/Object;ILjava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;(Unknown Source)
at jrockit.reflect.NativeMethodInvoker.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;(Optimized Method)
at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;(Optimized Method)
at java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;I)Ljava/lang/Object;(Optimized Method)
at org.apache.struts.actions.DispatchAction.dispatchMethod(Lorg/apache/struts/action/ActionMapping;Lorg/apache/struts/action/ActionForm;Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;Ljava/lang/String;)Lorg/apache/struts/action/ActionForward;(DispatchAction.java:270)
at org.apache.struts.actions.DispatchAction.execute(Lorg/apache/struts/action/ActionMapping;Lorg/apache/struts/action/ActionForm;Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)Lorg/apache/struts/action/ActionForward;(DispatchAction.java:187)
at com.vivo.crystal.commons.action.AbstractAction.execute(Lorg/apache/struts/action/ActionMapping;Lorg/apache/struts/action/ActionForm;Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)Lorg/apache/struts/action/ActionForward;(AbstractAction.java:131)
at org.apache.struts.action.RequestProcessor.processActionPerform(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;Lorg/apache/struts/action/Action;Lorg/apache/struts/action/ActionForm;Lorg/apache/struts/action/ActionMapping;)Lorg/apache/struts/action/ActionForward;(RequestProcessor.java:431)
at org.apache.struts.action.RequestProcessor.process(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V(RequestProcessor.java:236)
at org.apache.struts.action.ActionServlet.process(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doGet(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V(ActionServlet.java:414)
at javax.servlet.http.HttpServlet.service(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run()Ljava/lang/Object;(Optimized Method)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;Lweblo#-#gic/servlet/internal/FilterChainImpl;)V(Optimized Method)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V(Optimized Method)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run()Ljava/lang/Object;(WebAppServletContext.java:6981)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Lweblogic/security/subject/AbstractSubject;Ljava/security/PrivilegedAction;)Ljava/lang/Object;(Optimized Method)
at weblogic.security.service.SecurityManager.runAs(Lweblogic/security/acl/internal/AuthenticatedSubject;Lweblogic/security/acl/internal/AuthenticatedSubject;Ljava/security/PrivilegedAction;)Ljava/lang/Object;(Optimized Method)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(Lweblogic/servlet/internal/ServletRequestImpl;Lweblogic/servlet/internal/ServletResponseImpl;)V(Optimized Method)
at weblogic.servlet.internal.ServletRequestImpl.execute(Lweblogic/kernel/ExecuteThread;)V(Optimized Method)
at weblogic.kernel.ExecuteThread.execute(Lweblogic/kernel/ExecuteRequest;)V(Optimized Method)
at weblogic.kernel.ExecuteThread.run()V(ExecuteThread.java:183)
at java.lang.Thread.startThreadFromVM(Ljava/lang/Thread;)V(Unknown Source)
Caused by: com.vivo.crystal.commons.dao.DaoException: com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/vivo/crystal/ce/agcob/dao/ibatis/xml/Conta.xml.
--- The error occurred while applying a result map.
--- Check the Conta.getContaByIdMap.
--- Check the result mapping for the 'distribuicoesRemessa' property.
--- Cause: com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/vivo/crystal/ce/agcob/dao/ibatis/xml/DistribuicaoRemessa.xml.
--- The error occurred while applying a result map.
--- Check the DistribuicaoRemessa.distrRemessaContNegRodMap.
--- Check the result mapping for the 'agenciaCobranca' property.
--- Cause: com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/vivo/crystal/ce/agcob/dao/ibatis/xml/AgenciaCobranca.xml.
--- The error occurred while applying a parameter map.
--- Check the getAgenciaCobrancaById-InlineParameterMap.
--- Check the results (failed to retrieve results).
--- Cause: java.sql.SQLException: The transaction is no longer active - status: 'Marked rollback. [Reason=weblogic.transaction.internal.TimedOutException: Transaction timed out after 33 seconds
BEA1-059F147B089682DBFACF]'. No further JDBC access is allowed within this transaction.
Caused by: java.sql.SQLException: The transaction is no longer active - status: 'Marked rollback. [Reason=weblogic.transaction.internal.TimedOutException: Transaction timed out after 33 seconds
BEA1-059F147B089682DBFACF]'. No further JDBC access is allowed within this transaction.
Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/vivo/crystal/ce/agcob/dao/ibatis/xml/AgenciaCobranca.xml.
--- The error occurred while applying a parameter map.
--- Check the getAgenciaCobrancaById-InlineParameterMap.
--- Check the results (failed to retrieve results).
--- Cause: java.sql.SQLException: The transaction is no longer active - status: 'Marked rollback. [Reason=weblogic.transaction.internal.TimedOutException: Transaction timed out after 33 seconds
BEA1-059F147B089682DBFACF]'. No further JDBC access is allowed within this transaction.
Caused by: java.sql.SQLException: The transaction is no longer active - status: 'Marked rollback. [Reason=weblogic.transaction.internal.TimedOutException: Transaction timed out after 33 seconds
BEA1-059F147B089682DBFACF]'. No further JDBC access is allowed within this transaction.
Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/vivo/crystal/ce/agcob/dao/ibatis/xml/DistribuicaoRemessa.xml.
--- The error occurred while applying a result map.
--- Check the#-#DistribuicaoRemessa.distrRemessaContNegRodMap.
--- Check the result mapping for the 'agenciaCobranca' property.
--- Cause: com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/vivo/crystal/ce/agcob/dao/ibatis/xml/AgenciaCobranca.xml.
--- The error occurred while applying a parameter map.
--- Check the getAgenciaCobrancaById-InlineParameterMap.
--- Check the results (failed to retrieve results).
--- Cause: java.sql.SQLException: The transaction is no longer active - status: 'Marked rollback. [Reason=weblogic.transaction.internal.TimedOutException: Transaction timed out after 33 seconds
BEA1-059F147B089682DBFACF]'. No further JDBC access is allowed within this transaction.
Caused by: java.sql.SQLException: The transaction is no longer active - status: 'Marked rollback. [Reason=weblogic.transaction.internal.TimedOutException: Transaction timed out after 33 seconds
BEA1-059F147B089682DBFACF]'. No further JDBC access is allowed within this transaction.
Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/vivo/crystal/ce/agcob/dao/ibatis/xml/AgenciaCobranca.xml.
--- The error occurred while applying a parameter map.
--- Check the getAgenciaCobrancaById-InlineParameterMap.
--- Check the results (failed to retrieve results).
--- Cause: java.sql.SQLException: The transaction is no longer active - status: 'Marked rollback. [Reason=weblogic.transaction.internal.TimedOutException: Transaction timed out after 33 seconds
BEA1-059F147B089682DBFACF]'. No further JDBC access is allowed within this transaction.
Caused by: java.sql.SQLException: The transaction is no longer active - status: 'Marked rollback. [Reason=weblogic.transaction.internal.TimedOutException: Transaction timed out after 33 seconds
BEA1-059F147B089682DBFACF]'. No further JDBC access is allowed within this transaction.
at com.vivo.crystal.ce.agcob.dao.ibatis.AbstractIbatisDAO.getById(Ljava/lang/Long;)Lcom/vivo/crystal/commons/vo/IDataTransferObject;(AbstractIbatisDAO.java:146)
at com.vivo.crystal.ce.agcob.dao.ibatis.ContaDAOImpl.getConta(Ljava/lang/Long;)Lcom/vivo/crystal/ce/agcob/vo/Conta;(ContaDAOImpl.java:197)
at com.vivo.crystal.ce.agcob.business.ContaBO.getContaById(Ljava/lang/Long;)Lcom/vivo/crystal/ce/agcob/vo/Conta;(ContaBO.java:104)
...29 more
Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/vivo/crystal/ce/agcob/dao/ibatis/xml/Conta.xml.
--- The error occurred while applying a result map.
--- Check the Conta.getContaByIdMap.
--- Check the result mapping for the 'distribuicoesRemessa' property.
--- Cause: com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/vivo/crystal/ce/agcob/dao/ibatis/xml/DistribuicaoRemessa.xml.
--- The error occurred while applying a result map.
--- Check the DistribuicaoRemessa.distrRemessaContNegRodMap.
--- Check the result mapping for the 'agenciaCobranca' property.
--- Cause: com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/vivo/crystal/ce/agcob/dao/ibatis/xml/AgenciaCobranca.xml.
--- The error occurred while applying a parameter map.
--- Check the getAgenciaCobrancaById-InlineParameterMap.
--- Check the results (failed to retrieve results).
--- Cause: java.sql.SQLException: The transaction is no longer active - status: 'Marked rollback. [Reason=weblogic.transaction.internal.TimedOutException: Transaction timed out after 33 seconds
BEA1-059F147B089682DBFACF]'. No further JDBC access is allowed within this transaction.
Caused by: java.sql.SQLException: The transaction is no longer active - status: 'Marked rollback. [Reason=weblogic.transaction.internal.TimedOutException: Transaction timed out after 33 seconds
BEA1-059F147B089682DBFACF]'. No further JDBC access is allowed within this transaction.
Caused by: com.ibatis.common.jdbc.exception.NestedSQLException: