PDA

View Full Version : Problem upgrading from M2 to RC1



jettro
May 9th, 2009, 04:41 PM
I am having some problems with the upgrade path to RC1. I have changed the version of the blazeds integration to RC1. I had to add the org.codehaus.jackson/jackson-core-asl dependency and change the flex:remote-service into flex:remoting-destination. I also use the service-id, which I had to change into destination-id. (Wrong in the documentation by the way).

Now I am starting the application and I am receiving the following message. Does someone have a clue what I need to change as well?

2009-05-09 23:26:00.560::WARN: Nested in javax.servlet.ServletException: org.springframework.beans.factory.NoSuchBeanDefini tionException: No bean named '_filterChainList' is defined:
org.springframework.beans.factory.NoSuchBeanDefini tionException: No bean named '_filterChainList' is defined
at org.springframework.beans.factory.support.DefaultL istableBeanFactory.getBeanDefinition(DefaultListab leBeanFactory.java:387)
at org.springframework.flex.config.SessionFixationPro tectionConfigurer.postProcessBeanFactory(SessionFi xationProtectionConfigurer.java:60)
at org.springframework.context.support.AbstractApplic ationContext.invokeBeanFactoryPostProcessors(Abstr actApplicationContext.java:553)
at org.springframework.context.support.AbstractApplic ationContext.invokeBeanFactoryPostProcessors(Abstr actApplicationContext.java:544)
at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:362)
at org.springframework.web.servlet.FrameworkServlet.c reateWebApplicationContext(FrameworkServlet.java:4 02)
at org.springframework.web.servlet.FrameworkServlet.i nitWebApplicationContext(FrameworkServlet.java:316 )
at org.springframework.web.servlet.FrameworkServlet.i nitServletBean(FrameworkServlet.java:282)
at org.springframework.web.servlet.HttpServletBean.in it(HttpServletBean.java:126)

jlawmi
May 10th, 2009, 08:59 AM
seems like it might be an issue with the springsecurity settings, but not sure yet

jlawmi
May 10th, 2009, 09:47 AM
If you turn off session fixation it will go away. Since i'm in dev this is ok for now:

<http auto-config="false" entry-point-ref="preAuthenticatedEntryPoint" session-fixation-protection="none">


FWIW, I tried what is suggested in the source code, but it didn't fix the prob:

if (filterList == null) {
log.warn("Spring Security filter chain could not be found. You must install the RequestContextFilter or RequestContextListener"
+ "manually in order for the flex session fixation protection integration to function as expected.");
return;
}

jettro
May 10th, 2009, 02:12 PM
You are absolutely right, that did the trick. Strange message for this problem, does seem like a bug to me. Did you already file this as a bug?

regards Jettro

jeremyg484
May 10th, 2009, 02:18 PM
I also use the service-id, which I had to change into destination-id. (Wrong in the documentation by the way).

Thanks for pointing it out...captured as http://jira.springframework.org/browse/FLEX-45.

jeremyg484
May 10th, 2009, 02:20 PM
You are absolutely right, that did the trick. Strange message for this problem, does seem like a bug to me. Did you already file this as a bug?

regards Jettro

You're right, it is definitely a bug...just created http://jira.springframework.org/browse/FLEX-46 to capture it. Fix will be committed shortly and I'll fire off a snapshot build so that you guys can test it out if you like...I'll update here when it's ready.

jeremyg484
May 10th, 2009, 05:25 PM
FLEX-46 is fixed. You should be able to run with the session fixation protection enabled now. The fix is available in build 148 (or later). http://s3.amazonaws.com/dist.springframework.org/snapshot/FLEX/spring-flex-1.0.0.CI-148.zip

Durden
May 11th, 2009, 05:44 AM
We got some exceptions:


2009-05-11 13:35:56 ERROR FrameworkServlet.java:290 Context initialization failed
org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name '_flexRemotingAnnotationPostProcessor': Instantiation of bean failed; nested exception is org.springfra
mework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.flex.config.json.JsonConfigMap PropertyEditor]: Constructor threw exception; nested exception is
java.lang.NoClassDefFoundError: org/codehaus/jackson/JsonFactory
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.instantiateBean(Abstrac tAutowireCapableBeanFactory.java:883)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBeanInstance(Abst ractAutowireCapableBeanFactory.java:839)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:440)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory$1.run(AbstractAutowireC apableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject(AbstractBeanFactory.java:2 64)
at org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry.getSingleton(DefaultSingleton BeanRegistry.java:222)
at org.springframework.beans.factory.support.Abstract BeanFactory.doGetBean(AbstractBeanFactory.java:261 )
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.context.support.AbstractApplic ationContext.getBean(AbstractApplicationContext.ja va:880)
at org.springframework.context.support.AbstractApplic ationContext.invokeBeanFactoryPostProcessors(Abstr actApplicationContext.java:542)
at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:362)
at org.springframework.web.servlet.FrameworkServlet.c reateWebApplicationContext(FrameworkServlet.java:4 02)
at org.springframework.web.servlet.FrameworkServlet.i nitWebApplicationContext(FrameworkServlet.java:316 )
at org.springframework.web.servlet.FrameworkServlet.i nitServletBean(FrameworkServlet.java:282)
at org.springframework.web.servlet.HttpServletBean.in it(HttpServletBean.java:126)
at javax.servlet.GenericServlet.init(GenericServlet.j ava:211)


Caused by: org.springframework.beans.BeanInstantiationExcepti on: Could not instantiate bean class [org.springframework.flex.config.json.JsonConfigMap PropertyEditor]: Constructor threw except
ion; nested exception is java.lang.NoClassDefFoundError: org/codehaus/jackson/JsonFactory
at org.springframework.beans.BeanUtils.instantiateCla ss(BeanUtils.java:115)
at org.springframework.beans.BeanUtils.instantiateCla ss(BeanUtils.java:78)


Caused by: java.lang.NoClassDefFoundError: org/codehaus/jackson/JsonFactory
at org.springframework.flex.config.json.JsonConfigMap PropertyEditor.<init>(JsonConfigMapPropertyEditor.java:41)
at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method)


[ERROR] StandardWrapper.Throwable
org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name '_flexRemotingAnnotationPostProcessor': Instantiation of bean failed; nested exception is org.springfra
mework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.flex.config.json.JsonConfigMap PropertyEditor]: Constructor threw exception; nested exception is
java.lang.NoClassDefFoundError: org/codehaus/jackson/JsonFactory
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.instantiateBean(Abstrac tAutowireCapableBeanFactory.java:883)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBeanInstance(Abst ractAutowireCapableBeanFactory.java:839)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:440)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory$1.run(AbstractAutowireC apableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)


Caused by: org.springframework.beans.BeanInstantiationExcepti on: Could not instantiate bean class [org.springframework.flex.config.json.JsonConfigMap PropertyEditor]: Constructor threw except
ion; nested exception is java.lang.NoClassDefFoundError: org/codehaus/jackson/JsonFactory
at org.springframework.beans.BeanUtils.instantiateCla ss(BeanUtils.java:115)

Is this a bug? This comes with default configuration. Were are using RC1 and Maven tomcat plugin.

jeremyg484
May 11th, 2009, 06:16 AM
Is this a bug? This comes with default configuration. Were are using RC1 and Maven tomcat plugin.

We added Jackson as a new dependency, but it looks like it got marked as optional in the maven POM:


<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>com.springsource.org.codehaus.jackson</artifactId>
<version>0.9.9.4</version>
<optional>true</optional>
</dependency>

even though it is actually required.

I've created http://jira.springframework.org/browse/FLEX-47 to correct this for 1.0. In the meantime, you'll have to add it manually.

Durden
May 11th, 2009, 06:31 AM
We added Jackson as a new dependency, but it looks like it got marked as optional in the maven POM:


<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>com.springsource.org.codehaus.jackson</artifactId>
<version>0.9.9.4</version>
<optional>true</optional>
</dependency>

even though it is actually required.

I've created http://jira.springframework.org/browse/FLEX-47 to correct this for 1.0. In the meantime, you'll have to add it manually.


Thanks for quick response :)

DrPedro
May 11th, 2009, 07:28 AM
thanks for the hint to migrate to RC1:

Another hint for people migrating from M2 to RC1, you may have to change your flex code that handle the login result event.

I was using the following code


// Handle successful login.
private function LoginResultEvent(event:ResultEvent, token:Object=null):void
{

switch (event.result)
{
case "success":
Alert.show("Login OK: ");
dispatcher.dispatchEvent(new LoginEvent(LoginEvent.LOGIN_SUCCESSFUL));
break;
default:
}
}

which does not work anymore in RC1 since user details are now returned by the server upon login
Extracted from reference documentation here is a code that works


var token:AsyncToken = myChannelSet.login("jeremy","atlanta");
token.addResponder(
new AsyncResponder(
function(event:ResultEvent, token:Object = null):void {
if (event.result.authorities.indexOf("ROLE_ADMIN") >= 0) {
displayAdminPanel(event.result.name);
} else {
displayUserPanel(event.result.name);
}
},
function(event:FaultEvent, token:Object = null):void {
displayErrorMessage("Login Failed: "+event.fault.faultString);
}
)
);



BTW Thanks for the RC1, I can't wait testing the messaging feature!

Pierre

eindh
May 11th, 2009, 08:59 AM
You should also add it to the documentation section "What Spring BlazeDS Integration requires to run". It would have helped me a bit :-P

maheshrox
Dec 28th, 2009, 01:20 PM
Hi everybody

I am a flex developer and struggling with my first flex spring integration example. I went through many links including the one suggested in this discussion but nothing seems giving me a solution. i am using spring-flex-1.0.1.RELEASE, is this problem related to the this spring-blazeDS integartion release ? In most of the examples they have been using Maven which i doesnt know about it.

Could anybody in this forum give me an insight about how to get out of this error ?