-
1. Re: javax.persistence.NoResultException: No entity found for query on wildfly8/9
swd847 Dec 22, 2014 5:27 PM (in response to masummymesingh)By default EJB's will log system exceptions, so the exception gets logged with it propagates from CustomerDetail. WF9 will have the option to disable this logging.
-
2. Re: javax.persistence.NoResultException: No entity found for query on wildfly8/9
masummymesingh Dec 28, 2014 12:51 PM (in response to swd847)i have found a solution : for handing no result exception
@TransactionAttribute(TransactionAttributeType.SUPPORTS)
public Customer listCustomerDetail(Integer id)throws Exception {
return customerGateway.CustomerDetail(id);
}
==========================================================
throws NoResultException -------------------throws Exception
########################################################################
How to disable log :
Caused by: javax.persistence.NoResultException: No entity found for query
at org.hibernate.jpa.internal.QueryImpl.getSingleResult(QueryImpl.java:498) [hibernate-entitymanager-4.3.6.Final.jar:4.3.6.Final]
at org.jboss.as.jpa.container.QueryNonTxInvocationDetacher.getSingleResult(QueryNonTxInvocationDetacher.java:69) [wildfly-jpa-9.0.0.Alpha1.jar:9.0.0.Alpha1]
-
3. Re: javax.persistence.NoResultException: No entity found for query on wildfly8/9
smarlow Jan 5, 2015 11:24 AM (in response to masummymesingh)You could catch the NoResultException in CustomerDetail(Integer id) and return null instead of throwing the exception, which you would have to test for everywhere that CustomerDetail(Integer id) is called.