Empty Box exception in MetaMapper

6 views
Skip to first unread message

Jim McBeath

unread,
Nov 12, 2009, 8:43:32 PM11/12/09
to lif...@googlegroups.com
When I try to save a record in my table from the Create form built by
CRUDify, I am getting a "Trying to open an empty Box" exception from
within MetaMapper.scala, line 617 (in 1.1M7), which is this line:

findApplier(indexMap.open_!, rs.getObject(1)) match {

It appears that indexMap is initialized to Empty at line 888
and is set to Full at line 985, but the latter happens only if
dbPrimaryKey_? and dbAutogenerated? are both true. In my case I
have set dbAutogenerated_? = false for my primary key, so indexMap
will always be Empty, and the code at line 617 will always throw
an exception.

Is this a bug, or am I misunderstanding or misusing something?

My primary field in my KeyedMapper class looks essentially like this:

object pk extends MappedStringIndex(this,1) {
override def dbColumnName = "TABLENAME_PK"
override def dbDisplay_? = true
override def writePermission_? = true
override def dbAutogenerated_? = false
override lazy val defaultValue = ""
}

--
Jim

P.S. Thanks for the OracleDriver fix, Dave.

David Pollak

unread,
Nov 12, 2009, 10:28:24 PM11/12/09
to lif...@googlegroups.com
If you can create a reproducible case, we're look into it.
--
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

Jim McBeath

unread,
Nov 13, 2009, 12:08:29 AM11/13/09
to lif...@googlegroups.com
Assuming I prune it down to an example that requires only a few
files, which would probably include an SQL script for creating a test
database that has the appropriate schema in it, is there a procedure
for submitting such a test case? Should I just post source code
to this group? Make a jar file with sources and put it somewhere?
If someone can point me to a wiki page or some other reference to clue
me in as to standard procedure for doing this, that would be nice.

--
Jim

On Thu, Nov 12, 2009 at 07:28:24PM -0800, David Pollak wrote:
> Date: Thu, 12 Nov 2009 19:28:24 -0800
> From: David Pollak <feeder.of...@gmail.com>
> To: lif...@googlegroups.com
> Subject: [Lift] Re: Empty Box exception in MetaMapper
>
> If you can create a reproducible case, we're look into it.
>
> On Thu, Nov 12, 2009 at 5:43 PM, Jim McBeath <goo...@j.jimmc.org>
> wrote:
>
> When I try to save a record in my table from the Create form built
> by
> CRUDify, I am getting a "Trying to open an empty Box" exception from
> within MetaMapper.scala, line 617 (in 1.1M7), which is this line:
> Â Â findApplier(indexMap.open_!, rs.getObject(1)) match {
> It appears that indexMap is initialized to Empty at line 888
> and is set to Full at line 985, but the latter happens only if
> dbPrimaryKey_? and dbAutogenerated? are both true. Â In my case I
> have set dbAutogenerated_? = false for my primary key, so indexMap
> will always be Empty, and the code at line 617 will always throw
> an exception.
> Is this a bug, or am I misunderstanding or misusing something?
> My primary field in my KeyedMapper class looks essentially like
> this:
> Â Â object pk extends MappedStringIndex(this,1) {
> Â Â Â Â override def dbColumnName = "TABLENAME_PK"
> Â Â Â Â override def dbDisplay_? = true
> Â Â Â Â override def writePermission_? = true
> Â Â Â Â override def dbAutogenerated_? = false
> Â Â Â Â override lazy val defaultValue = ""
> Â Â }

David Pollak

unread,
Nov 13, 2009, 6:43:41 PM11/13/09
to lif...@googlegroups.com
On Thu, Nov 12, 2009 at 9:08 PM, Jim McBeath <goo...@j.jimmc.org> wrote:

Assuming I prune it down to an example that requires only a few
files, which would probably include an SQL script for creating a test
database that has the appropriate schema in it, is there a procedure
for submitting such a test case?  Should I just post source code
to this group?  Make a jar file with sources and put it somewhere?
If someone can point me to a wiki page or some other reference to clue
me in as to standard procedure for doing this, that would be nice.

Please open a ticket at http://github.com/dpp/liftweb/issues and if there's example code, the best thing is to create a GitHub project... the second best thing is to email me a tarball of the example.
 

opyate

unread,
Nov 19, 2009, 4:52:21 AM11/19/09
to Lift
PS reproducible issue created here: http://github.com/dpp/liftweb/issues/#issue/199


On Nov 13, 11:43 pm, David Pollak <feeder.of.the.be...@gmail.com>
wrote:
> On Thu, Nov 12, 2009 at 9:08 PM, Jim McBeath <goo...@j.jimmc.org> wrote:
>
> > Assuming I prune it down to an example that requires only a few
> > files, which would probably include an SQL script for creating a test
> > database that has the appropriate schema in it, is there a procedure
> > for submitting such a test case?  Should I just post source code
> > to this group?  Make a jar file with sources and put it somewhere?
> > If someone can point me to a wiki page or some other reference to clue
> > me in as to standard procedure for doing this, that would be nice.
>
> Please open a ticket athttp://github.com/dpp/liftweb/issuesand if there's
> example code, the best thing is to create a GitHub project... the second
> best thing is to email me a tarball of the example.
>
>
>
>
>
>
>
> > --
> > Jim
>
> > On Thu, Nov 12, 2009 at 07:28:24PM -0800, David Pollak wrote:
> > > Date: Thu, 12 Nov 2009 19:28:24 -0800
> > > From: David Pollak <feeder.of.the.be...@gmail.com>
> > >    Beginning Scalahttp://www.apress.com/book/view/1430219890
> > >    Follow me:http://twitter.com/dpp
> > >    Surf the harmonics
>
> --
> Lift, the simply functional web frameworkhttp://liftweb.net
> Beginning Scalahttp://www.apress.com/book/view/1430219890

David Pollak

unread,
Nov 19, 2009, 9:26:03 AM11/19/09
to lif...@googlegroups.com
On Thu, Nov 19, 2009 at 1:52 AM, opyate <opy...@gmail.com> wrote:
PS reproducible issue created here: http://github.com/dpp/liftweb/issues/#issue/199


Thanks!
 
--

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





--
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Reply all
Reply to author
Forward
0 new messages