I think this is maybe a problem with the version of hibernate you are using.   
As part of this simplified configuration feature, the assembler is going into 
the metadata for hibernate and it seems like the protection-level on that 
method has changed or is different in the version you are using than the one we 
compiled against.   We are using 3.2.5 I believe.

You should not need to change any configuration as it is compatible with the 
old format.   You can remove the metadata section entirely and it will generate 
the id properties and lazy=true associations for each hibernate association.    
You can then add assoc tags as needed to change the defaults.    Any associated 
destinations which are not defined are not directly accessible via clients 
though they are created so you don't have to declare all destinations in your 
model - just the ones you use fill or getItem calls on.

Back to the original error, I guess the other spring configuration you were 
using was generating some proxy class which did not extend HibernateAssembler?  
 What version of spring are you using?

Jeff

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of foobone9
Sent: Thursday, March 05, 2009 6:01 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: LCDS Upgrade Problems


That is correct; I have a destination who's source is a derived object of 
HibernateAssembler (Just to shutoff autoRefreshFill). My assember is then a 
bean in the Spring container.

Obviously something is wrong with this bean because if I force CGLib proxies in 
my container (to avoid the proxy cast error; even though my derived assembler 
implements an interface) I get the following error:

17:45:18,606 ERROR [STDERR] **** MessageBrokerServlet failed to initialize due 
to runtime exception: Error: java.lang.IllegalAccessError: tried to access 
method 
org.hibernate.persister.entity.AbstractEntityPersister.getEntityMetamodel()Lorg/hibernate/tuple/entity/EntityMetamodel;
 from class flex.data.assemblers.HibernateType
at flex.data.assemblers.HibernateType.start(HibernateType.java:247)
at flex.data.assemblers.HibernateAssembler.start(HibernateAssembler.java:216)

Would I need to update my data-management-config.xml file for 2.6? I am under 
the impression that it can be greatly simplified (from 2.5.1 config) by 
removing the hibernate object mappings; but it doesn't need to for backward 
compatibility.

I am using hibernate config files, not annotations, and an example destination 
I have (one with no relationships) is:

<destination id="testycle.hibernate">
<adapter ref="java-dao" />
<properties>
<factory>spring</factory>
<source>TestCycleBean</source>
<use-transactions>true</use-transactions>
<scope>application</scope>
<metadata>
<identity property="id"/>
</metadata>
<network>
<session-timeout>0</session-timeout>
<paging enabled="false" pageSize="10"/>
<throttle-inbound policy="ERROR" max-frequency="500"/>
<throttle-outbound policy="REPLACE" max-frequency="500"/>
</network>
<server>
<hibernate-entity>com.xxx.ics.dto.TestCycle</hibernate-entity>
<update-conflict-mode>PROPERTY</update-conflict-mode>
<delete-conflict-mode>OBJECT</delete-conflict-mode>
<fill-method>
<name>fill</name>
<params>java.util.List</params>
</fill-method>
<fill-configuration>
<use-query-cache>false</use-query-cache>
<allow-hql-queries>true</allow-hql-queries>
</fill-configuration>
</server>
</properties>
<channels>
<channel ref="my-rtmp"/>
</channels>
</destination>

and the simple bean definition is:

<bean id="TestCycleBean" class="com.xxx.ics.assembler.MyHibernateAssembler"/>

I commented everything else out in my data-management-config.xml.

--- In flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com>, Jeff 
Vroom <jvr...@...> wrote:
>
> I am thinking your spring configuration must be wrapping the 
> HibernateAssembler in a proxy. The code is getting an error here:
>
> HibernateAssembler assembler = (HibernateAssembler) 
> destination.getFactoryInstance().lookup();
>
> when trying to use the factory to get the assembler component from the 
> destination. Usually when you generate a proxy though, it would extend the 
> class being proxied? Does that make sense as to what is going on? Maybe we 
> need to unwrap that proxy in the SpringFactory...
>
> I should also have mentioned, the source for the hibernate assembler is in 
> the product. It in resources/samples/assemblers in 
> flex-messaging-dist-src.zip.
>
> Jeff
>
> From: flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com> 
> [mailto:flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com>] On 
> Behalf Of foobone9
> Sent: Thursday, March 05, 2009 1:39 PM
> To: flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com>
> Subject: [flexcoders] Re: LCDS Upgrade Problems
>
>
> Actually, as it turns out now, I had reverted back to the version on Adobe 
> Exchange thinking it was a newer version because I was having the following 
> problem (with what I now know is the newest SpringFactory):
>
> 13:32:44,873 INFO [STDOUT] [Flex]MessageBroker failed to start: Exception: 
> java.lang.ClassCastException: $Proxy53 cannot be cast to 
> flex.data.assemblers.HibernateAssembler
> at flex.data.assemblers.HibernateType.start(HibernateType.java:237)
> at flex.data.assemblers.HibernateAssembler.start(HibernateAssembler.java:216)
>
> --- In 
> flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com><mailto:flexcoders%40yahoogroups.com>,
>  Jeff Vroom <jvroom@> wrote:
> >
> > I think the problem is that the HibernateAssembler.initialize is not 
> > getting called. If you are using the SpringFactory you probably just need a 
> > new version of that. I tried putting this up on the adobe component 
> > exchange a long time ago but apparently it never made it as I just checked 
> > and they still have the old version. I'll try to get that resolved but in 
> > the meantime, I put up a copy of the new source file here:
> >
> > http://www.jvroom.com/SpringFactory.java
> >
> > Jeff
> >
> > From: 
> > flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com><mailto:flexcoders%40yahoogroups.com>
> >  
> > [mailto:flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com><mailto:flexcoders%40yahoogroups.com>]
> >  On Behalf Of foobone9
> > Sent: Thursday, March 05, 2009 11:34 AM
> > To: 
> > flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com><mailto:flexcoders%40yahoogroups.com>
> > Subject: [flexcoders] LCDS Upgrade Problems
> >
> >
> > I am upgrading LCDS from 2.5.1 to 2.6. I have quite a few assemblers that 
> > extend the Hibernate assembler and use the Spring factory.
> >
> > On start up the MessageBroker is croaking because of a Null pointer 
> > exception in HibernateAssembler line 211. Is the Hibernate assembler code 
> > provided in 2.6 as it previously was? (I didn't see it in the install) Has 
> > anyone seen this problem or know of any thing to try?
> >
>

<<inline: image001.jpg>>

<<inline: image002.jpg>>

Reply via email to