[Lift] Problem with mapper exceptions and logging

2010-02-24 Thread Jeppe Nejsum Madsen
Hi,

It seems that when a mapper exception is thrown and logging is enabled
(with DB.addLogFunc) the logging proxy itself throws an error:

This is unfortunate since it can lead to different code paths if
logging is enabled or not.is this unfixable or should I file a
ticket?

java.lang.reflect.UndeclaredThrowableException: null
at $Proxy0.executeQuery(Unknown Source)
at 
net.liftweb.mapper.PostgreSqlDriver$$anonfun$performInsertWithGenKeys$2.apply(Driver.scala:267)
at 
net.liftweb.mapper.PostgreSqlDriver$$anonfun$performInsertWithGenKeys$2.apply(Driver.scala:265)
at net.liftweb.mapper.DB$$anonfun$runPreparedStatement$2.apply(DB.scala:548)
at net.liftweb.mapper.DB$$anonfun$runPreparedStatement$2.apply(DB.scala:547)
at net.liftweb.util.TimeHelpers$class.calcTime(TimeHelpers.scala:247)
at net.liftweb.util.Helpers$.calcTime(Helpers.scala:34)
at net.liftweb.mapper.DB$.runPreparedStatement(DB.scala:546)
at net.liftweb.mapper.DB$.prepareStatement(DB.scala:489)
at 
net.liftweb.mapper.PostgreSqlDriver$.performInsertWithGenKeys(Driver.scala:264)
at net.liftweb.mapper.DriverType.performInsert(Driver.scala:81)
at net.liftweb.mapper.MetaMapper$$anonfun$15.apply(MetaMapper.scala:743)
at net.liftweb.mapper.MetaMapper$$anonfun$15.apply(MetaMapper.scala:688)
at net.liftweb.mapper.DB$$anonfun$use$1.apply(DB.scala:570)
at net.liftweb.util.DynoVar$class.run(ThreadGlobal.scala:95)
at net.liftweb.mapper.DB$currentConn$.run(DB.scala:557)
at net.liftweb.mapper.DB$.use(DB.scala:567)
at net.liftweb.mapper.MetaMapper$class.save(MetaMapper.scala:687)

Caused by: java.lang.reflect.InvocationTargetException: null
at sun.reflect.GeneratedMethodAccessor164.invoke(Unknown Source)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at 
net.liftweb.mapper.DBLog$LoggedStatementHandler.chain(LoggingStatementWrappers.scala:330)
at 
net.liftweb.mapper.DBLog$LoggedPreparedStatementHandler$$anonfun$invoke$68.apply(LoggingStatementWrappers.scala:394)
at net.liftweb.util.TimeHelpers$class.calcTime(TimeHelpers.scala:247)
at net.liftweb.util.Helpers$.calcTime(Helpers.scala:34)
at 
net.liftweb.mapper.DBLog$class.logStatement(LoggingStatementWrappers.scala:53)
at 
net.liftweb.mapper.DBLog$LoggedStatementHandler.logStatement(LoggingStatementWrappers.scala:110)
at 
net.liftweb.mapper.DBLog$LoggedPreparedStatementHandler.invoke(LoggingStatementWrappers.scala:393)
... 269 common frames omitted
Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key
value violates unique constraint contracts_unique
at 
org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2062)
at 
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1795)
at 
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
at 
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:479)
at 
org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:367)
at 
org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:271)
... 279 common frames omitted

-- 
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.



Re: [Lift] Problem with mapper exceptions and logging

2010-02-24 Thread David Pollak
On Wed, Feb 24, 2010 at 1:01 PM, Jeppe Nejsum Madsen je...@ingolfs.dkwrote:

 Hi,

 It seems that when a mapper exception is thrown and logging is enabled
 (with DB.addLogFunc) the logging proxy itself throws an error:

 This is unfortunate since it can lead to different code paths if
 logging is enabled or not.is this unfixable or should I file a
 ticket?


It's fixable.  Please file a ticket... ideally with a repro case or even a
test.



 java.lang.reflect.UndeclaredThrowableException: null
at $Proxy0.executeQuery(Unknown Source)
at
 net.liftweb.mapper.PostgreSqlDriver$$anonfun$performInsertWithGenKeys$2.apply(Driver.scala:267)
at
 net.liftweb.mapper.PostgreSqlDriver$$anonfun$performInsertWithGenKeys$2.apply(Driver.scala:265)
at
 net.liftweb.mapper.DB$$anonfun$runPreparedStatement$2.apply(DB.scala:548)
at
 net.liftweb.mapper.DB$$anonfun$runPreparedStatement$2.apply(DB.scala:547)
at net.liftweb.util.TimeHelpers$class.calcTime(TimeHelpers.scala:247)
at net.liftweb.util.Helpers$.calcTime(Helpers.scala:34)
at net.liftweb.mapper.DB$.runPreparedStatement(DB.scala:546)
at net.liftweb.mapper.DB$.prepareStatement(DB.scala:489)
at
 net.liftweb.mapper.PostgreSqlDriver$.performInsertWithGenKeys(Driver.scala:264)
at net.liftweb.mapper.DriverType.performInsert(Driver.scala:81)
at net.liftweb.mapper.MetaMapper$$anonfun$15.apply(MetaMapper.scala:743)
at net.liftweb.mapper.MetaMapper$$anonfun$15.apply(MetaMapper.scala:688)
at net.liftweb.mapper.DB$$anonfun$use$1.apply(DB.scala:570)
at net.liftweb.util.DynoVar$class.run(ThreadGlobal.scala:95)
at net.liftweb.mapper.DB$currentConn$.run(DB.scala:557)
at net.liftweb.mapper.DB$.use(DB.scala:567)
at net.liftweb.mapper.MetaMapper$class.save(MetaMapper.scala:687)

 Caused by: java.lang.reflect.InvocationTargetException: null
at sun.reflect.GeneratedMethodAccessor164.invoke(Unknown Source)
at
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
 net.liftweb.mapper.DBLog$LoggedStatementHandler.chain(LoggingStatementWrappers.scala:330)
at
 net.liftweb.mapper.DBLog$LoggedPreparedStatementHandler$$anonfun$invoke$68.apply(LoggingStatementWrappers.scala:394)
at net.liftweb.util.TimeHelpers$class.calcTime(TimeHelpers.scala:247)
at net.liftweb.util.Helpers$.calcTime(Helpers.scala:34)
at
 net.liftweb.mapper.DBLog$class.logStatement(LoggingStatementWrappers.scala:53)
at
 net.liftweb.mapper.DBLog$LoggedStatementHandler.logStatement(LoggingStatementWrappers.scala:110)
at
 net.liftweb.mapper.DBLog$LoggedPreparedStatementHandler.invoke(LoggingStatementWrappers.scala:393)
... 269 common frames omitted
 Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key
 value violates unique constraint contracts_unique
at
 org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2062)
at
 org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1795)
at
 org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
at
 org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:479)
at
 org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:367)
at
 org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:271)
... 279 common frames omitted

 --
 You received this message because you are subscribed to the Google Groups
 Lift group.
 To post to this group, send email to lift...@googlegroups.com.
 To unsubscribe from this group, send email to
 liftweb+unsubscr...@googlegroups.comliftweb%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/liftweb?hl=en.




-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Surf the harmonics

-- 
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.