PDA

View Full Version : CGLIB error when using spring-flex in Spring dm



marshallmccain
May 11th, 2009, 04:16 PM
I am attempting to setup a flex remoting destination in a Spring dm Web bundle. The error is displayed during PAR deployment. It appears that the spring-flex integration is trying to create a bean and proxy an amf channel class instance. Has anybody else seen this. For reference, I've included the relevant parts of my web context and services-config files below.

BTW, I'm using the Spring Enterprise Repository bundles for BlazeDS. I manually copied the org.springframework.flex RC1 jar into the usr repository in Spring dm server.

Thanks,
Marshall

Error
---------------------------------------
...org.springframework.beans.factory.BeanCreationE xception: Error creating bean with name '_messageBrokerDefaultHandlerMapping': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name '_messageBroker': Invocation of init method failed; nested exception is org.springframework.aop.framework.AopConfigExcepti on: Could not generate CGLIB subclass of class [class flex.messaging.endpoints.AMFEndpoint]: Common causes of this problem include using a final class or a non-visible class; nested exception is net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null...

web-context (spring app context)
-----------------------------------------
<flex:message-broker>
<flex:mapping pattern="/messagebroker/*" />
<flex:remoting-service default-channels="news" />
</flex:message-broker>

<bean id="newsService" class="net.fractech.blazeds.news.NewsService" />

<flex:remoting-destination ref="newsService" />


services-config
-----------------------------------------------
<services>
<default-channels>
<channel ref="news"/>
</default-channels>
</services>

<channels>
<channel-definition id="news" class="mx.messaging.channels.AMFChannel">
<endpoint url="http://{server.name}:{server.port}/{context.root}/blazeds/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/>
</channel-definition>
</channels>

marshallmccain
May 11th, 2009, 04:55 PM
This error was fixed by importing the CGLIB library into my web bundle. I do not understand why this should be necessary.

Any ideas?

Thanks,
Marshall

ealogar
May 20th, 2009, 08:36 AM
Hi,
I was having the same problem (even with latest RC2 from Blaze DS) and was fixed adding the cglib as dependency in my pom.xml.
I have realized that this library is marked as optional in blaze pom.xml... I could imagina is related with this fixed already in RC2:
http://jira.springframework.org/browse/FLEX-47
And maybe

jeremyg484
May 20th, 2009, 08:42 AM
Right, CGLIB is still marked as optional because it's not technically always required depending on what features you are using. In practice though, I would imagine just about everyone is using the features that require it, so we'll consider going ahead and making it required for 1.0 final.

raulcd
May 20th, 2009, 09:14 AM
Maybe it would be better to have it as required and if is not needed exclude it in your own pom. I know is not allways required but almost.

I also have got this problem :P

Raśl