Hi Carlos. I've been working with OJB for about a year on a very large Swing application, and today I believe two things about OJB:
1) There are few, little, specific bugs in OJB. I've found only one my self during the time I've been working, but even this one is specific to EmptyCacheImpl (thats unable to handle recursive references - but the excetion thrown, in this case, is related to OutOfMemoty). 2) Your stacktrace is the first point to get solution to your problem, but you must use a debbugging version, or we can't know where the problem is (since there is no line numbers in non-debbugging version). The other way is download source code of OJB, and debug it! It's not so hard (specially if you don't use proxies). If you use proxies, use Eclipse to debug - it understand better the proxy way of work. Just kicking away, you have: a) same number of foreign keys in collection-descriptors that you have as primary keys? b) you are declaring the foreign keys in same order as they appear in class-descriptor of the referenced table? c) all your tables has primary keys? d) all fields in referencing table used as foreign key are of same type (and precision, where aplicable) than the fields in referenced table, and declared as primary keys? e) are you using some king of conversion class, or row reader? f) I had some trouble to get my programmers start working with OJB just because they change the order of transparent M:N mappings. Have you done a double check? Remember, I'm just trying. Send the stack trace - with debbuging version - and we can double check. Best regards, Edson Richter > > Hi, > > I sending this error because i have no clues about how to solve it. it seems to be > inside the OJB code while store an object. > > here is the extract of the error I got: > > org.apache.ojb.broker.PersistenceBrokerException: > java.lang.ArithmeticException: / by zero > > this is the stacktrace : > > Original Exception: org.apache.ojb.broker.PersistenceBrokerException: > java.lang.ArithmeticException: / by zero > at > org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(Unknown Source) > at > org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(Unknown Source) > at > org.apache.ojb.broker.core.QueryReferenceBroker.retrieveCollection(Unknown Source) > at > org.apache.ojb.broker.core.QueryReferenceBroker.retrieveCollections(Unknown Source) > at org.apache.ojb.broker.core.PersistenceBrokerImpl.getDBObject(Unknown Source) > at > org.apache.ojb.broker.core.PersistenceBrokerImpl.getObjectByIdentity(Unknown Source) > at > org.apache.ojb.broker.core.PersistenceBrokerImpl.getObjectByQuery(Unknown Source) > at > org.apache.ojb.broker.core.DelegatingPersistenceBroker.getObjectByQuery(Unknown > Source) > at > org.apache.ojb.broker.core.DelegatingPersistenceBroker.getObjectByQuery(Unknown > Source) > at > net.agssa.sga.forms.prounidad.ProunidadHandler.retrieve(ProunidadHandler.java:30) at > net.agssa.sga.forms.producto.ProductoHandler.crearProducto(ProductoHandler.java:296) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:324) > at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:230) at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1244) at > org.mozilla.javascript.continuations.ContinuationInterpreter.interpret(ContinuationInterpreter.java:1105) at > org.mozilla.javascript.continuations.ContinuationInterpreter.interpret(ContinuationInterpreter.java:190) at > org.mozilla.javascript.continuations.ContinuationInterpreter.interpret(ContinuationInterpreter.java:138) at > org.mozilla.javascript.continuations.InterpretedFunctionImpl.call(InterpretedFunctionImpl.java:121) at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1244) at > org.apache.cocoon.components.flow.javascript.fom.FOM_JavaScriptInterpreter.callFunction(FOM_JavaScriptInterpreter.java:522) at > org.apache.cocoon.components.treeprocessor.sitemap.CallFunctionNode.invoke(CallFunctionNode.java:166) at > org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:84) at > org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:164) at > org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:108) at > org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:163) at > org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:108) at > org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:152) at > org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:354) > at > org.apache.cocoon.components.treeprocessor.TreeProcessor.handleCocoonRedirect(TreeProcessor.java:411) at > org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:363) > at > org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:307) > at > org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(MountNode.java:133) > at > org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:84) at > org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:164) at > org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:108) at > org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:163) at > org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:108) at > org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:152) at > org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:354) > at > org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:307) at org.apache.cocoon.Cocoon.process(Cocoon.java:656) > at org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:1112) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) > at > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256) > at > org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at > org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) > at > org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417) at > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) at > org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at > org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171) > at > org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172) at > org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174) at > org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:193) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:781) at > org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:549) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:589) at > org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:666) at java.lang.Thread.run(Thread.java:534) > Caused by: java.lang.ArithmeticException: / by zero > at org.apache.ojb.broker.accesslayer.BasePrefetcher.<init>(Unknown Source) at > org.apache.ojb.broker.accesslayer.RelationshipPrefetcherImpl.<init>(Unknown Source) > at org.apache.ojb.broker.accesslayer.CollectionPrefetcher.<init>(Unknown Source) > at > org.apache.ojb.broker.accesslayer.RelationshipPrefetcherFactory.createRelationshipPrefetcher(Unknown Source) > at > org.apache.ojb.broker.core.QueryReferenceBroker.performRetrievalTasks(Unknown Source) > at > org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(Unknown Source) > ... 75 more > > > -- > Carlos Ch�vez. > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
