ok, opened https://issues.apache.org/jira/browse/TOMEE-1686
is adding a parameter to this method a quick workaround you can use? Romain Manni-Bucau @rmannibucau <https://twitter.com/rmannibucau> | Blog <http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> | LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber <http://www.tomitribe.com> 2015-12-24 10:16 GMT+01:00 seenu.atluri <[email protected]>: > Hi Romain, > > I have below finder method. > > <named-query name="TimeCategoryCMP.findDefaultTimeCategory"> > <query>SELECT OBJECT(o) from TimeCategoryCMP o WHERE > o.defaultFlag = 1</query> > </named-query> > > When it is called and there is no result for the given query, openEJB is > expected to throw ObjectNotFoundException, but it is throwing EJB exception > as below. > > javax.ejb.EJBException: The transaction has been marked rollback only > because the bean encountered a non-application exception > :java.lang.ArrayIndexOutOfBoundsException : 0 > > When i looked at the code, I think it is issue with below piece of code in > CmpContainer::findEJBObject() > > if (results.size() != 1) { > throw new ObjectNotFoundException("A Enteprise bean > with > deployment_id = " + > beanContext.getDeploymentID() + > " and primarykey = " + > args[0] + > " Does not exist"); > } > > When finder method don't have any args, args[0] will throw > ArrayIndexOutofBoundsException. I could catch EJBException in my code and > move forward, but transaction is marked for rollback since it is > non-application exception. > > We are almost done with the migration of our huge application from Weblogic > to TomEE with your timely help. Now we are seeing bunch of failures in our > nightly build due to this issue as we have lot of findAll and finder > methods > with no arguments. BTW, we are using "apache-tomee-plus-1.7.2". > > Can you please reply ASAP? Sorry to disturb you during holiday season. > > Thanks & Regards, > Srinivas Atluri. > > > > -- > View this message in context: > http://tomee-openejb.979440.n4.nabble.com/ArrayIndexOutofBoundsException-on-calling-finder-method-with-no-args-tp4677312.html > Sent from the TomEE Users mailing list archive at Nabble.com. >
