Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Weird RuntimeException without message when caching enabled
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  9 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Mikael Nousiainen  
View profile  
 More options Sep 1 2012, 3:00 am
From: Mikael Nousiainen <mik...@incompleteopus.net>
Date: Sat, 1 Sep 2012 00:00:33 -0700 (PDT)
Local: Sat, Sep 1 2012 3:00 am
Subject: Weird RuntimeException without message when caching enabled

I tried to enable L2 caching for my entities, but I get a weird exception
without any explanation of the reason.

I also found out the exact source code line that was causing the exception,
and the code looks really weird, as it is just throwing an exception in
this particular case:
http://grepcode.com/file/repo1.maven.org/maven2/org.avaje/ebean/2.7.5...

What does the "embedded" boolean mean in that piece of code? And why is
RuntimeException thrown if embedded is true?

The full stack trace was:

(The bean that is being accessed is behind a LAZY OneToMany mapping and
caching was enabled for both beans.)

Caused by: java.lang.RuntimeException: null
    at
com.avaje.ebeaninternal.server.deploy.BeanPropertyAssocOne.getCacheDataValu e(BeanPropertyAssocOne.java:396)
~[ebean-2.7.5.jar:na]
    at
com.avaje.ebeaninternal.server.cache.CachedBeanDataFromBean.extract(CachedB eanDataFromBean.java:57)
~[ebean-2.7.5.jar:na]
    at
com.avaje.ebeaninternal.server.cache.CachedBeanDataFromBean.extract(CachedB eanDataFromBean.java:22)
~[ebean-2.7.5.jar:na]
    at
com.avaje.ebeaninternal.server.deploy.BeanDescriptor.cachePutBeanData(BeanD escriptor.java:1091)
~[ebean-2.7.5.jar:na]
    at
com.avaje.ebeaninternal.server.core.DefaultBeanLoader.loadBean(DefaultBeanL oader.java:382)
~[ebean-2.7.5.jar:na]
    at
com.avaje.ebeaninternal.server.core.DefaultServer.loadBean(DefaultServer.ja va:529)
~[ebean-2.7.5.jar:na]
    at
com.avaje.ebeaninternal.server.loadcontext.DLoadBeanContext.loadBean(DLoadB eanContext.java:203)
~[ebean-2.7.5.jar:na]
    at
com.avaje.ebean.bean.EntityBeanIntercept.loadBeanInternal(EntityBeanInterce pt.java:531)
~[ebean-2.7.5.jar:na]
    at
com.avaje.ebean.bean.EntityBeanIntercept.loadBean(EntityBeanIntercept.java: 499)
~[ebean-2.7.5.jar:na]
    at
com.avaje.ebean.bean.EntityBeanIntercept.preGetter(EntityBeanIntercept.java :625)
~[ebean-2.7.5.jar:na]


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mikael Nousiainen  
View profile  
 More options Sep 1 2012, 3:17 am
From: Mikael Nousiainen <mik...@incompleteopus.net>
Date: Sat, 1 Sep 2012 00:17:22 -0700 (PDT)
Local: Sat, Sep 1 2012 3:17 am
Subject: Re: Weird RuntimeException without message when caching enabled

Correction: The mapping was LAZY ManyToOne for the field:

  @ManyToOne(fetch = FetchType.LAZY, optional = true,
      cascade = CascadeType.ALL)
  @JoinColumn(name = "defaultWorkspacePermissionId", nullable = true)

A setter for a field with those mappings was called to cause the exception.

I can't see how anything called "embedded" would have anything to do with
the field...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mikael Nousiainen  
View profile  
 More options Sep 1 2012, 3:35 am
From: Mikael Nousiainen <mik...@incompleteopus.net>
Date: Sat, 1 Sep 2012 00:35:01 -0700 (PDT)
Local: Sat, Sep 1 2012 3:35 am
Subject: Re: Weird RuntimeException without message when caching enabled

I did some more searching in Ebean source code (without really knowing my
way around), and I found only these places where setEmbedded is used:
http://grepcode.com/search/usages?type=method&id=repo1.maven.org%24mav...@org.avaje%24eb...@2.7.5@com%24avaje%24ebeaninternal%24server%24deploy%24meta@DeployBeanPrope rty@setEmbedded%28boolean%29&k=u

All the cases are related to either using @Embedded, @EmbeddedId or @Id, so
I wonder why @ManyToOne with @JoinColumn would have it set.
One thing worth mentioning might be that I am using @Embedded in *another*field in the same class, but I guess that should not have any effect to
other fields.

Additionally, (this might be totally unrelated), does setEmbedded(true)
make sense for @Id, as I found it in one place, but not in another --
compare these:
- setEmbbedded(true) for @Id
  -
http://grepcode.com/file/repo1.maven.org/maven2/org.avaje/ebean/2.7.5...<http://grepcode.com/file/repo1.maven.org/maven2/org.avaje/ebean/2.7.5...>
- no setEmbedded call for @Id
  -
http://grepcode.com/file/repo1.maven.org/maven2/org.avaje/ebean/2.7.5...<http://grepcode.com/file/repo1.maven.org/maven2/org.avaje/ebean/2.7.5...>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mikael Nousiainen  
View profile  
 More options Sep 4 2012, 5:57 am
From: Mikael Nousiainen <mik...@incompleteopus.net>
Date: Tue, 4 Sep 2012 02:57:47 -0700 (PDT)
Local: Tues, Sep 4 2012 5:57 am
Subject: Re: Weird RuntimeException without message when caching enabled

Rob,

Do you have any idea why this exception gets thrown?
Even a little hint towards the right direction would be appreciated :)

Thanks!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rob Bygrave  
View profile  
 More options Sep 4 2012, 6:18 am
From: Rob Bygrave <robin.bygr...@gmail.com>
Date: Tue, 4 Sep 2012 22:18:38 +1200
Local: Tues, Sep 4 2012 6:18 am
Subject: Re: [ebean] Re: Weird RuntimeException without message when caching enabled

*>> Do you have any idea why this exception gets thrown?
*
That code where the exception is thrown ... indicates to me that the
feature to support embedded beans in the caching wasn't finished - which is
a bit pants.

It would seem that one of the types or fields is annotated with Embedded or
EmbeddedId ?  You suggest that is not the case though so it is not obvious
at this point why you are hitting this issue.

Cheers, Rob.

On 4 September 2012 21:57, Mikael Nousiainen <mik...@incompleteopus.net>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mikael Nousiainen  
View profile  
 More options Sep 4 2012, 6:59 am
From: Mikael Nousiainen <mik...@incompleteopus.net>
Date: Tue, 4 Sep 2012 03:59:51 -0700 (PDT)
Local: Tues, Sep 4 2012 6:59 am
Subject: Re: [ebean] Re: Weird RuntimeException without message when caching enabled

Ok. Actually, I *am* using @Embedded in one of the fields in both classes:
the one containing the collection, and the one in the collection.

So are you suggesting that caching will not work if any of the fields *
inside* a cached entity are @Embedded?
(Meaning that the types that are cached are not embedded, but some of the
fields inside them are.)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rob Bygrave  
View profile  
 More options Sep 4 2012, 7:35 am
From: Rob Bygrave <robin.bygr...@gmail.com>
Date: Tue, 4 Sep 2012 23:35:44 +1200
Local: Tues, Sep 4 2012 7:35 am
Subject: Re: [ebean] Re: Weird RuntimeException without message when caching enabled

*>> So are you suggesting that caching will not work if any of the fields
inside a cached entity are @Embedded**?
*
Yes.

It is a bit (enter a bad word / less than ideal) but yes.  Throwing that
exception should be replaced with actual implementation (that I managed to
forget / miss etc). The bean cache has got 'arrays of values' rather than
actual beans in it ... and the missing implementation should convert an
embedded bean into a 'value'.

On 4 September 2012 22:59, Mikael Nousiainen <mik...@incompleteopus.net>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mikael Nousiainen  
View profile  
 More options Sep 6 2012, 6:32 am
From: Mikael Nousiainen <mik...@incompleteopus.net>
Date: Thu, 6 Sep 2012 03:32:55 -0700 (PDT)
Local: Thurs, Sep 6 2012 6:32 am
Subject: Re: [ebean] Re: Weird RuntimeException without message when caching enabled

Allright. I'll manage for a while without caching, so it's not a
showstopper for me :)

Would this be a terribly demanding feature to implement?
Is it on the roadmap for next releases?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rob Bygrave  
View profile  
 More options Sep 9 2012, 5:40 am
From: Rob Bygrave <robin.bygr...@gmail.com>
Date: Sun, 9 Sep 2012 21:40:30 +1200
Local: Sun, Sep 9 2012 5:40 am
Subject: Re: [ebean] Re: Weird RuntimeException without message when caching enabled

I have logged a bug for this:  BUG 422 : L2 Cache not working for embedded
beans - RuntimeException

>> Is it on the roadmap for next releases?

It definately needs to be fixed.  I'm just struggling time wise at the
moment (big projects, none of which use Ebean).

On 6 September 2012 22:32, Mikael Nousiainen <mik...@incompleteopus.net>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »