[code]
2006-12-06 12:15:20,746 ERROR [de.mindmatters.faces.spring.context.ContextLoader] - <Context initialization failed>
org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [de.mindmatters.faces.spring.factory.aspectj.JsfBeanConfigurerAspect] for bean with name 'de.mindmatters.faces.spring.factory.aspectj.JsfBeanConfigurerAspect' defined in URL [jar:file:/F:/jboss-4.0.5/server/default/lib/jsf-spring-aspects.jar!/META-INF/faces-spring-context.xml]; nested exception is java.lang.ClassNotFoundException: de.mindmatters.faces.spring.factory.aspectj.JsfBeanConfigurerAspect
Caused by:
java.lang.ClassNotFoundException: de.mindmatters.faces.spring.factory.aspectj.JsfBeanConfigurerAspect
[/code]
Thanks and regards
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Getting to the Test object in UserAddCommand is where I am struggling. I have tried to declare the bean in spring appCtx and faces-config but without luck.
I have also tried adding it into 'faces-spring-context'...still no joy.
Any thoughts?
kind regards.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
don't get me wrong but i do not see any piece of code where a user ist created (neither a 'new User()' nor a <bean id="myUser" class="abc.User"...> or something similar).
Kindly regards
Andy
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
My mistake inthe previous post, test should of been user..
-----------------------------------------------------------------------------------------
public class UserAddCommand .. {
private User user;
private String text;
//get/sets
}
public class User .. {
private String text;
//get/sets
}
--Configure spring beans in appCtx
<bean name="userAddCommand" class="abc.UserAddCommand" scope="prototype" />
<bean name="user" class="abc.User" scope="prototype" /> <---------- ### CORRECTION ####
Which jar am i missing?
[code]
2006-12-06 12:15:20,746 ERROR [de.mindmatters.faces.spring.context.ContextLoader] - <Context initialization failed>
org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [de.mindmatters.faces.spring.factory.aspectj.JsfBeanConfigurerAspect] for bean with name 'de.mindmatters.faces.spring.factory.aspectj.JsfBeanConfigurerAspect' defined in URL [jar:file:/F:/jboss-4.0.5/server/default/lib/jsf-spring-aspects.jar!/META-INF/faces-spring-context.xml]; nested exception is java.lang.ClassNotFoundException: de.mindmatters.faces.spring.factory.aspectj.JsfBeanConfigurerAspect
Caused by:
java.lang.ClassNotFoundException: de.mindmatters.faces.spring.factory.aspectj.JsfBeanConfigurerAspect
[/code]
Thanks and regards
inside jsf-spring-aspects.jar there is a AJ File.
Is this correct, is there some further config I am missing?
JSF/SWF/JBoss
Hello James,
if you want to use the jsf-spring-aspects.jar you have to compile/recompile your sources (and your JSF implementation btw) with AspectJ. It's a moot point whether you need to deploy the jsf-spring-aspects.jar. If you want to inject dependencies on UIComponents, Validators or Converters you have to. For further information please have a look at http://jsf-spring.sourceforge.net/schema/jsf/jsf-spring.xsd and http://jsf-spring.sourceforge.net/4.0RC1/de/mindmatters/faces/spring/factory/aspectj/package-summary.html.
I'm new to this so I'm not exactly sure what I need right now.
What I am trying to achieve is quite simple, but made a little more complex because I'm using Spring Web Flow.
Bascially in my facelet I have an expression which is trying to bind a nested property but isnt working.
#{parent.value1} <- OK
#{parent.child.value2} <- FAILS
I was hoping that jsf-spring would solve my problem...and I correct?.
Hi James,
i need to know the type of 'parent'! If it's of type UIComponent it won't work (neither with jsf-spring).
parent is a bean. Here's a clear example which should help.
public class UserAddCommand .. {
private User user;
private String text;
//get/sets
}
public class User .. {
private String text;
//get/sets
}
--Configure spring beans in appCtx
<bean name="userAddCommand" class="abc.UserAddCommand" scope="prototype" />
<bean name="test" class="abc.Test" scope="prototype" />
I've tried adding the User into faces-config.xml but without success.
#{userAddCommand.text} works.
#{userAddCommand.user.text} fails.
THANKS.
Hi James,
the User of the UserAddCommand is null. You have to set a User programmatically or via DI in the config file.
The UserAddCommand is declared in spring.
Using JSF-EL to extract a string also works, problems arise when getting nested elements:
--user add command obj.
<bean
id="userAddFormAction"
class="org.springframework.webflow.action.FormAction">
<property name="formObjectName" value="userAddCommand" />
<property name="formObjectClass" value="abc.UserAddCommand" />
<property name="formObjectScope" value="FLOW" />
</bean>
Getting to the Test object in UserAddCommand is where I am struggling. I have tried to declare the bean in spring appCtx and faces-config but without luck.
I have also tried adding it into 'faces-spring-context'...still no joy.
Any thoughts?
kind regards.
Hi James,
don't get me wrong but i do not see any piece of code where a user ist created (neither a 'new User()' nor a <bean id="myUser" class="abc.User"...> or something similar).
Kindly regards
Andy
Add this kind of config in the faces-config.xml.
<managed-bean>
<managed-bean-name>userAddCommand</managed-bean-name>
<managed-bean-class>UserAddCommand</managed-bean-class>
<managed-property>
<property-name>user</property-name>
<value>#{user}</value>
</managed-property>
</managed-bean>
<managed-bean>
<managed-bean-name>user</managed-bean-name>
<managed-bean-class>User</managed-bean-class>
</managed-bean>
No worries ;)
My mistake inthe previous post, test should of been user..
-----------------------------------------------------------------------------------------
public class UserAddCommand .. {
private User user;
private String text;
//get/sets
}
public class User .. {
private String text;
//get/sets
}
--Configure spring beans in appCtx
<bean name="userAddCommand" class="abc.UserAddCommand" scope="prototype" />
<bean name="user" class="abc.User" scope="prototype" /> <---------- ### CORRECTION ####
<bean
id="userAddFormAction"
class="org.springframework.webflow.action.FormAction">
<property name="formObjectName" value="userAddCommand" />
<property name="formObjectClass" value="abc.UserAddCommand" />
<property name="formObjectScope" value="FLOW" />
</bean>
I've tried adding the User into faces-config.xml but without success.
#{userAddCommand.text} works.
#{userAddCommand.user.text} fails.
-----------------------------------------------------------------------------------------
This is all spring config. I have tried declaing user in faces-config, but without success.
Thanks again, really need to solve this one quickly.
try this:
<bean name="userAddCommand" class="abc.UserAddCommand" scope="prototype">
<property name="user" ref="user"/>
</bean>
<bean name="user" class="abc.User" scope="prototype" />
Yes that has resolved it. Cant believe i missed that.
Thanks so much.