commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Igor Marakov" <igor...@ivmsystems.com>
Subject [betwixt] Exception suppression
Date Tue, 07 Mar 2006 16:13:13 GMT
I recently ran into the situation where betwixt is suppressing exceptions
during the translation.
I don't think it is a good idea. 
Enclosing application code should be aware that data that it expecting ain't
coming. Here is the example of the unsuccessful translation of the SQLJ
object that is coming from the DB and is supposed to be translated into the
normal java bean. Translation fails due to SQLException, but application
code is not getting any indication of it.

Question: Is there the way to switch this behavior off or limit it to
certain kinds of exceptions?

Thanks,
Igor

[DEBUG] com.my.framework.dao.bc4j.TranslatorImpl (translate) : START
translation com.my.framework.model.sqlj.MenuComponentC To java.util.List

[DEBUG] com.my.framework.dao.bc4j.TranslatorImpl (toXML) : Start toXML
translation

[ERROR] org.apache.commons.betwixt.expression.MethodExpression
(handleException) : [MethodExpression] Cannot evaluate expression 

java.lang.reflect.InvocationTargetException
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:585)
at
org.apache.commons.betwixt.expression.MethodExpression.evaluate(MethodExpres
sion.java:61)
at
org.apache.commons.betwixt.expression.IteratorExpression.evaluate(IteratorEx
pression.java:53)
at
org.apache.commons.betwixt.io.AbstractBeanWriter.writeElementContent(Abstrac
tBeanWriter.java:924)
at
org.apache.commons.betwixt.io.AbstractBeanWriter.writeElement(AbstractBeanWr
iter.java:738)
at
org.apache.commons.betwixt.io.AbstractBeanWriter.writeBean(AbstractBeanWrite
r.java:374)
at
org.apache.commons.betwixt.io.AbstractBeanWriter.writeBean(AbstractBeanWrite
r.java:243)
at
org.apache.commons.betwixt.io.AbstractBeanWriter.write(AbstractBeanWriter.ja
va:144)
at org.apache.commons.betwixt.io.BeanWriter.write(BeanWriter.java:190)
at com.my.framework.dao.bc4j.TranslatorImpl.toXML(TranslatorImpl.java:180)
at
com.my.framework.dao.bc4j.TranslatorImpl.translate(TranslatorImpl.java:135)
at
com.my.framework.dao.bc4j.DAOProxyInvocationHandler.invoke(DAOProxyInvocatio
nHandler.java:117)
at $Proxy0.getMenuComponents(Unknown Source)
at com.my.framework.dao.TestDAO_1.doMenuTest(TestDAO_1.java:125)
at com.my.framework.dao.TestDAO_1.doTests(TestDAO_1.java:73)
at com.my.framework.dao.TestDAO_1.main(TestDAO_1.java:54)

Caused by: java.sql.SQLException: Fail to construct descriptor: Invalid
arguments
at
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
at oracle.sql.StructDescriptor.createDescriptor(StructDescriptor.java:155)
at oracle.sql.StructDescriptor.createDescriptor(StructDescriptor.java:130)
at oracle.jpub.runtime.MutableStruct.toDatum(MutableStruct.java:115)
at
com.my.framework.model.sqlj.MenuComponentT.toDatum(MenuComponentT.sqlj:110)
at oracle.jpub.runtime.Util._convertToOracle(Util.java:160)
at oracle.jpub.runtime.Util.convertToOracle(Util.java:146)
at oracle.jpub.runtime.MutableArray.getDatumElement(MutableArray.java:1273)
at oracle.jpub.runtime.MutableArray.getOracleArray(MutableArray.java:639)
at oracle.jpub.runtime.MutableArray.getObjectArray(MutableArray.java:810)
at oracle.jpub.runtime.MutableArray.getObjectArray(MutableArray.java:816)
at
com.my.framework.model.sqlj.MenuComponentC.getArray(MenuComponentC.java:76)

            ... 19 more

[DEBUG] com.my.framework.dao.bc4j.TranslatorImpl (toXML) : Resulting XML
<?xml version='1.0' ?>
  <elements/>


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message