|
|
| 1 2 |
|
taltu
|
Hi,
I tried to run Person dao tutorial for appfuse 2. I have been using m3 and m4 without result: I get following error: TestFindPersonByLastName(net.jsync.dao.PersonDaoTest) Time elapsed: 0.579 sec <<< ERROR! org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in URL [jar:file:/E:/Workspace/Repositories/m2/org/appfuse/appfuse-hibernate/2.0-m4-SNAPSHOT/appfuse-hibernate-2.0-m4-SNAPSHOT.jar!/applicationContext-dao.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'dataSource' is defined Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'dataSource' is defined at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:340) Thx. |
||||||||||||||||
|
viggo
|
This issue is related to this one: http://www.nabble.com/Error-creating-bean-with-name-%27sessionFactory%22-tf3196130s2369.html
I think, if I'm not wrong, that you have to update this dependency in pom.xml: <dependency> <groupId>org.appfuse</groupId> <artifactId>appfuse-service</artifactId> <version>2.0-m4-SNAPSHOT</version> </dependency> I guess you have the m3 snapshot? And Matt wrote this to me in an email: 1. Moved applicationContext.xml from web module to core/src/main/resources. 2. Changed applicationContext-resources.xml to use a DriverManagerDataSource instead of DBCP - I believe I sent this to the mailing list. 3. Changed PersonDaoTest to load the additional applicationContext.xml file from src/main/resources. I run a spring modular, that's why I have a core module.
|
||||||||||||||||
|
Matt Raible-3
|
In reply to this post
by taltu
Did you start with m3 or are you trying to upgrade from m2?
Matt On 2/10/07, Tuncay A. <[hidden email]> wrote:
-- http://raibledesigns.com |
||||||||||||||||
|
taltu
|
1. I made a new fresh checkout of achetype m3 and got the problem.
Then in super-pom modified the version of appfuse to use m4-SNAPSHOT and still get the prob. 2. Another issue is the tutorial about the testing part of Hibernate dao using Person example. The part of the tutorial that is about creating a custom dao it involves e.g. extending GenericHibernateDao and define the personDao as depending on Generic classes which don't makes sense since it is about to create a custom dao. Could someone please write an ordered list of how temporary fixing the above issues.
|
|
Matt Raible-3
|
On 2/10/07, Tuncay A. <[hidden email]> wrote:
You're using a modular project correct? 2. Another issue is the tutorial about the testing part of Hibernate dao 1. Copy the attached file to your core/src/test/resources directory. 2. Copy web/src/main/resources/mail.properties to core/src/test/resources. Let me know if you get any errors after making this change. Matt Matt Raible-3 wrote: -- http://raibledesigns.com <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="locations"> <list> <value>classpath:jdbc.properties</value> <value>classpath:mail.properties</value> </list> </property> </bean> <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName" value="${jdbc.driverClassName}"/> <property name="url" value="${jdbc.url}"/> <property name="username" value="${jdbc.username}"/> <property name="password" value="${jdbc.password}"/> </bean> </beans> --------------------------------------------------------------------- To unsubscribe, e-mail: [hidden email] For additional commands, e-mail: [hidden email] |
||||||||||||||||
|
Matt Raible-3
|
In reply to this post
by taltu
On 2/10/07, Tuncay A. <[hidden email]> wrote:
I think this is a good way to do things because it allows you to override the CRUD methods you need to, and leave the other ones intact. Matt Could someone please write an ordered list of how temporary fixing the above -- http://raibledesigns.com |
||||||||||||||||
|
taltu
|
In reply to this post
by Matt Raible-3
Thx Guys!,
It works now :-) The way it works: 1. Checkout a fresh archetype jsf-moduler for m4-SNAPSHOT. 2. Moved applicationContext.xml from core web module to core/src/main/resources. 3. Created an applicationContext-resources.xml inside core/src/test/resources/ and changed to use a DriverManagerDataSource instead of DBCP 4. In applicationContext.xml and hibernate.cfg.xml I define a mapping to POJO person couldn't work without having define it in applicationContext.xml too. 5. Changed PersonDaoTest to load the additional applicationContext.xml file from src/main/resources. 6. Changed the Person.java class annotation to: @Entity 7. Wow - works! :-) But..... Now when I try running the webapp in Tomcat inside IntelliJ. I get following: ? javax.servlet.jsp.JspException: Error initializing Velocity: org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource 'WEB-INF/classes/cssHorizontalMenu.vm' at net.sf.navigator.taglib.DisplayMenuTag.doStartTag(DisplayMenuTag.java:105) at net.sf.navigator.taglib.el.DisplayMenuTag.doStartTag(DisplayMenuTag.java:45) at org.apache.jsp.common.menu_jsp._jspx_meth_menu_displayMenu_0(menu_jsp.java:258) at org.apache.jsp.common.menu_jsp._jspx_meth_menu_useMenuDisplayer_0(menu_jsp.java:148) at org.apache.jsp.common.menu_jsp._jspService(menu_jsp.java:93) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334) at org.apache.jasper.servlet.JspServlet.serviceJspFile(Jsp
|
||||||||||||||||
|
Matt Raible-3
|
On 2/10/07, Tuncay A. <[hidden email]> wrote:
> > Thx Guys!, > > It works now :-) > > The way it works: > > 1. Checkout a fresh archetype jsf-moduler for m4-SNAPSHOT. > 2. Moved applicationContext.xml from core web module to > core/src/main/resources. > 3. Created an applicationContext-resources.xml inside > core/src/test/resources/ and changed to use a DriverManagerDataSource > instead of DBCP > 4. In applicationContext.xml and hibernate.cfg.xml I define a mapping to > POJO person couldn't work without having define it in > applicationContext.xml too. > 5. Changed PersonDaoTest to load the additional applicationContext.xml file > from src/main/resources. > 6. Changed the Person.java class annotation to: @Entity > 7. Wow - works! :-) > > But..... > > Now when I try running the webapp in Tomcat inside IntelliJ. I get > following: ? I haven't tried to use IDEA's built-in server support - but my guess is it doesn't resolve this artifact properly from the classpath. You might try to use "mvn package" and then point IDEA/Tomcat at the exploded directory structure in your "target" directory. Matt > > javax.servlet.jsp.JspException: Error initializing Velocity: > org.apache.velocity.exception.ResourceNotFoundException: Unable to find > resource 'WEB-INF/classes/cssHorizontalMenu.vm' > at > net.sf.navigator.taglib.DisplayMenuTag.doStartTag(DisplayMenuTag.java:105) > at > net.sf.navigator.taglib.el.DisplayMenuTag.doStartTag(DisplayMenuTag.java:45) > at > org.apache.jsp.common.menu_jsp._jspx_meth_menu_displayMenu_0(menu_jsp.java:258) > at > org.apache.jsp.common.menu_jsp._jspx_meth_menu_useMenuDisplayer_0(menu_jsp.java:148) > at org.apache.jsp.common.menu_jsp._jspService(menu_jsp.java:93) > at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) > at > org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334) > at org.apache.jasper.servlet.JspServlet.serviceJspFile(Jsp > > > > Matt Raible-3 wrote: > > > > On 2/10/07, Tuncay A. <[hidden email]> wrote: > >> > >> > >> 1. I made a new fresh checkout of achetype m3 and got the problem. > >> Then in super-pom modified the version of appfuse to use m4-SNAPSHOT and > >> still get the prob. > > > > > > You're using a modular project correct? > > > > 2. Another issue is the tutorial about the testing part of Hibernate dao > >> using Person example. > >> The part of the tutorial that is about creating a custom dao it involves > >> e.g. extending GenericHibernateDao and define the personDao as depending > >> on > >> Generic classes which don't makes sense since it is about to create a > >> custom > >> dao. > >> > >> Could someone please write an ordered list of how temporary fixing the > >> above > >> issues. > > > > > > 1. Copy the attached file to your core/src/test/resources directory. > > 2. Copy web/src/main/resources/mail.properties to core/src/test/resources. > > > > Let me know if you get any errors after making this change. > > > > Matt > > > > Matt Raible-3 wrote: > >> > > >> > Did you start with m3 or are you trying to upgrade from m2? > >> > > >> > Matt > >> > > >> > On 2/10/07, Tuncay A. <[hidden email]> wrote: > >> >> > >> >> > >> >> Hi, > >> >> > >> >> I tried to run Person dao tutorial for appfuse 2. I have been using m3 > >> >> and > >> >> m4 without result: > >> >> > >> >> I get following error: > >> >> > >> >> TestFindPersonByLastName(net.jsync.dao.PersonDaoTest) Time elapsed: > >> >> 0.579 > >> >> sec <<< ERROR! > >> >> org.springframework.beans.factory.BeanCreationException: Error > >> creating > >> >> bean > >> >> with name 'sessionFactory' defined in URL > >> >> > >> >> > >> [jar:file:/E:/Workspace/Repositories/m2/org/appfuse/appfuse-hibernate/2.0-m4-SNAPSHOT/appfuse- > >> >> hibernate-2.0-m4-SNAPSHOT.jar!/applicationContext-dao.xml]: > >> >> Cannot resolve reference to bean 'dataSource' while setting bean > >> property > >> >> 'dataSource'; nested exception is > >> >> org.springframework.beans.factory.NoSuchBeanDefinitionException: No > >> bean > >> >> named 'dataSource' is defined > >> >> Caused by: > >> >> org.springframework.beans.factory.NoSuchBeanDefinitionException > >> >> : > >> >> No bean named 'dataSource' is defined > >> >> at > >> >> > >> >> > >> org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition > >> >> (DefaultListableBeanFactory.java:340) > >> >> > >> >> Thx. > >> >> -- > >> >> View this message in context: > >> >> > >> http://www.nabble.com/Appfuse-2-tutorial-for-DaoTest-tf3205568s2369.html#a8901509 > >> >> Sent from the AppFuse - User mailing list archive at Nabble.com. > >> >> > >> >> --------------------------------------------------------------------- > >> >> To unsubscribe, e-mail: [hidden email] > >> >> For additional commands, e-mail: [hidden email] > >> >> > >> >> > >> > > >> > > >> > -- > >> > http://raibledesigns.com > >> > > >> > > >> > >> -- > >> View this message in context: > >> http://www.nabble.com/Appfuse-2-tutorial-for-DaoTest-tf3205568s2369.html#a8903741 > >> Sent from the AppFuse - User mailing list archive at Nabble.com. > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: [hidden email] > >> For additional commands, e-mail: [hidden email] > >> > >> > > > > > > -- > > http://raibledesigns.com > > > > <?xml version="1.0" encoding="UTF-8"?> > > <beans xmlns="http://www.springframework.org/schema/beans" > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > > xsi:schemaLocation="http://www.springframework.org/schema/beans > > http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> > > > > <bean id="propertyConfigurer" > > class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> > > <property name="locations"> > > <list> > > <value>classpath:jdbc.properties</value> > > <value>classpath:mail.properties</value> > > </list> > > </property> > > </bean> > > > > <bean id="dataSource" > > class="org.springframework.jdbc.datasource.DriverManagerDataSource"> > > <property name="driverClassName" value="${jdbc.driverClassName}"/> > > <property name="url" value="${jdbc.url}"/> > > <property name="username" value="${jdbc.username}"/> > > <property name="password" value="${jdbc.password}"/> > > </bean> > > </beans> > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [hidden email] > > For additional commands, e-mail: [hidden email] > > > > -- > View this message in context: http://www.nabble.com/Appfuse-2-tutorial-for-DaoTest-tf3205568s2369.html#a8904765 > Sent from the AppFuse - User mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [hidden email] > For additional commands, e-mail: [hidden email] > > -- http://raibledesigns.com --------------------------------------------------------------------- To unsubscribe, e-mail: [hidden email] For additional commands, e-mail: [hidden email] |
||||||||||||||||
|
taltu
|
Thx, will give a try.
However, it is very very painful for lot of developers to work with AppFuse using Maven instead of it's favorite IDE. Soon, I hope AppFuse 2.0 could 100% working with IDEs and a detail documentation for it could be written. This could be very helpful for a lot and more pleasure to work with AppFuse framework! When do you think this importent feature could be realistic ? //tua
|
||||||||||||||||
|
Matt Raible-3
|
I agree - it would be nice if it worked 100% with the IDEs. The good
news is it works much better than 1.x did (mainly due to XDoclet issues). I think it *can* work, it's just a matter of figuring out the configuration. You could probably setup an external tool configuration to launch "mvn jetty:run-war" from the IDE. If you'd like to enter an issue in JIRA - that will make it easier for us to track and add your desired feature(s). Matt On 2/11/07, Tuncay A. <[hidden email]> wrote: > > Thx, will give a try. > > However, it is very very painful for lot of developers to work with AppFuse > using Maven instead of it's favorite IDE. > > Soon, I hope AppFuse 2.0 could 100% working with IDEs and a detail > documentation for it could be written. > > This could be very helpful for a lot and more pleasure to work with AppFuse > framework! > > When do you think this importent feature could be realistic ? > > //tua > > > Matt Raible-3 wrote: > > > > On 2/10/07, Tuncay A. <[hidden email]> wrote: > >> > >> Thx Guys!, > >> > >> It works now :-) > >> > >> The way it works: > >> > >> 1. Checkout a fresh archetype jsf-moduler for m4-SNAPSHOT. > >> 2. Moved applicationContext.xml from core web module to > >> core/src/main/resources. > >> 3. Created an applicationContext-resources.xml inside > >> core/src/test/resources/ and changed to use a DriverManagerDataSource > >> instead of DBCP > >> 4. In applicationContext.xml and hibernate.cfg.xml I define a mapping to > >> POJO person couldn't work without having define it in > >> applicationContext.xml too. > >> 5. Changed PersonDaoTest to load the additional applicationContext.xml > >> file > >> from src/main/resources. > >> 6. Changed the Person.java class annotation to: @Entity > >> 7. Wow - works! :-) > >> > >> But..... > >> > >> Now when I try running the webapp in Tomcat inside IntelliJ. I get > >> following: ? > > > > I haven't tried to use IDEA's built-in server support - but my guess > > is it doesn't resolve this artifact properly from the classpath. You > > might try to use "mvn package" and then point IDEA/Tomcat at the > > exploded directory structure in your "target" directory. > > > > Matt > > > >> > >> javax.servlet.jsp.JspException: Error initializing Velocity: > >> org.apache.velocity.exception.ResourceNotFoundException: Unable to find > >> resource 'WEB-INF/classes/cssHorizontalMenu.vm' > >> at > >> net.sf.navigator.taglib.DisplayMenuTag.doStartTag(DisplayMenuTag.java:105) > >> at > >> net.sf.navigator.taglib.el.DisplayMenuTag.doStartTag(DisplayMenuTag.java:45) > >> at > >> org.apache.jsp.common.menu_jsp._jspx_meth_menu_displayMenu_0(menu_jsp.java:258) > >> at > >> org.apache.jsp.common.menu_jsp._jspx_meth_menu_useMenuDisplayer_0(menu_jsp.java:148) > >> at org.apache.jsp.common.menu_jsp._jspService(menu_jsp.java:93) > >> at > >> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) > >> at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) > >> at > >> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334) > >> at org.apache.jasper.servlet.JspServlet.serviceJspFile(Jsp > >> > >> > >> > >> Matt Raible-3 wrote: > >> > > >> > On 2/10/07, Tuncay A. <[hidden email]> wrote: > >> >> > >> >> > >> >> 1. I made a new fresh checkout of achetype m3 and got the problem. > >> >> Then in super-pom modified the version of appfuse to use m4-SNAPSHOT > >> and > >> >> still get the prob. > >> > > >> > > >> > You're using a modular project correct? > >> > > >> > 2. Another issue is the tutorial about the testing part of Hibernate > >> dao > >> >> using Person example. > >> >> The part of the tutorial that is about creating a custom dao it > >> involves > >> >> e.g. extending GenericHibernateDao and define the personDao as > >> depending > >> >> on > >> >> Generic classes which don't makes sense since it is about to create a > >> >> custom > >> >> dao. > >> >> > >> >> Could someone please write an ordered list of how temporary fixing the > >> >> above > >> >> issues. > >> > > >> > > >> > 1. Copy the attached file to your core/src/test/resources directory. > >> > 2. Copy web/src/main/resources/mail.properties to > >> core/src/test/resources. > >> > > >> > Let me know if you get any errors after making this change. > >> > > >> > Matt > >> > > >> > Matt Raible-3 wrote: > >> >> > > >> >> > Did you start with m3 or are you trying to upgrade from m2? > >> >> > > >> >> > Matt > >> >> > > >> >> > On 2/10/07, Tuncay A. <[hidden email]> wrote: > >> >> >> > >> >> >> > >> >> >> Hi, > >> >> >> > >> >> >> I tried to run Person dao tutorial for appfuse 2. I have been using > >> m3 > >> >> >> and > >> >> >> m4 without result: > >> >> >> > >> >> >> I get following error: > >> >> >> > >> >> >> TestFindPersonByLastName(net.jsync.dao.PersonDaoTest) Time > >> elapsed: > >> >> >> 0.579 > >> >> >> sec <<< ERROR! > >> >> >> org.springframework.beans.factory.BeanCreationException: Error > >> >> creating > >> >> >> bean > >> >> >> with name 'sessionFactory' defined in URL > >> >> >> > >> >> >> > >> >> > >> [jar:file:/E:/Workspace/Repositories/m2/org/appfuse/appfuse-hibernate/2.0-m4-SNAPSHOT/appfuse- > >> >> >> hibernate-2.0-m4-SNAPSHOT.jar!/applicationContext-dao.xml]: > >> >> >> Cannot resolve reference to bean 'dataSource' while setting bean > >> >> property > >> >> >> 'dataSource'; nested exception is > >> >> >> org.springframework.beans.factory.NoSuchBeanDefinitionException: No > >> >> bean > >> >> >> named 'dataSource' is defined > >> >> >> Caused by: > >> >> >> org.springframework.beans.factory.NoSuchBeanDefinitionException > >> >> >> : > >> >> >> No bean named 'dataSource' is defined > >> >> >> at > >> >> >> > >> >> >> > >> >> > >> org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition > >> >> >> (DefaultListableBeanFactory.java:340) > >> >> >> > >> >> >> Thx. > >> >> >> -- > >> >> >> View this message in context: > >> >> >> > >> >> > >> http://www.nabble.com/Appfuse-2-tutorial-for-DaoTest-tf3205568s2369.html#a8901509 > >> >> >> Sent from the AppFuse - User mailing list archive at Nabble.com. > >> >> >> > >> >> >> > >> --------------------------------------------------------------------- > >> >> >> To unsubscribe, e-mail: [hidden email] > >> >> >> For additional commands, e-mail: [hidden email] > >> >> >> > >> >> >> > >> >> > > >> >> > > >> >> > -- > >> >> > http://raibledesigns.com > >> >> > > >> >> > > >> >> > >> >> -- > >> >> View this message in context: > >> >> > >> http://www.nabble.com/Appfuse-2-tutorial-for-DaoTest-tf3205568s2369.html#a8903741 > >> >> Sent from the AppFuse - User mailing list archive at Nabble.com. > >> >> > >> >> --------------------------------------------------------------------- > >> >> To unsubscribe, e-mail: [hidden email] > >> >> For additional commands, e-mail: [hidden email] > >> >> > >> >> > >> > > >> > > >> > -- > >> > http://raibledesigns.com > >> > > >> > <?xml version="1.0" encoding="UTF-8"?> > >> > <beans xmlns="http://www.springframework.org/schema/beans" > >> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > >> > xsi:schemaLocation="http://www.springframework.org/schema/beans > >> > http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> > >> > > >> > <bean id="propertyConfigurer" > >> > > >> class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> > >> > <property name="locations"> > >> > <list> > >> > <value>classpath:jdbc.properties</value> > >> > <value>classpath:mail.properties</value> > >> > </list> > >> > </property> > >> > </bean> > >> > > >> > <bean id="dataSource" > >> > class="org.springframework.jdbc.datasource.DriverManagerDataSource"> > >> > <property name="driverClassName" > >> value="${jdbc.driverClassName}"/> > >> > <property name="url" value="${jdbc.url}"/> > >> > <property name="username" value="${jdbc.username}"/> > >> > <property name="password" value="${jdbc.password}"/> > >> > </bean> > >> > </beans> > >> > --------------------------------------------------------------------- > >> > To unsubscribe, e-mail: [hidden email] > >> > For additional commands, e-mail: [hidden email] > >> > > >> > >> -- > >> View this message in context: > >> http://www.nabble.com/Appfuse-2-tutorial-for-DaoTest-tf3205568s2369.html#a8904765 > >> Sent from the AppFuse - User mailing list archive at Nabble.com. > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: [hidden email] > >> For additional commands, e-mail: [hidden email] > >> > >> > > > > > > -- > > http://raibledesigns.com > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [hidden email] > > For additional commands, e-mail: [hidden email] > > > > > > > > -- > View this message in context: http://www.nabble.com/Appfuse-2-tutorial-for-DaoTest-tf3205568s2369.html#a8915485 > Sent from the AppFuse - User mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [hidden email] > For additional commands, e-mail: [hidden email] > > -- http://raibledesigns.com --------------------------------------------------------------------- To unsubscribe, e-mail: [hidden email] For additional commands, e-mail: [hidden email] |
||||||||||||||||
|
taltu
|
Ok.
|
||||||||||||||||
|
jloken
|
In reply to this post
by Matt Raible-3
Some javascript/style in this post has been disabled (why?)
Hi
all,
Just a
quick question regarding Acegi authentication.
How
can I disable authentication for particular jsp pages. These jsp pages should
then be freely accessible without being redirected to login.jsp. With
Acegi/Appfuse being so flexible I would not be surprised if this can be done
declaratively.
At the
moment the set of freely accessible jsp pages reside under folder
/pages/static/.
Inserting line:
/static/*.html*=ROLE_ANONYMOUS
in
bean 'filterInvocationInterceptor'
in file security.xml is not
sufficient.
A non
declarative solution may that all requests pass by a filter that
gives all users role 'ROLE_ANONYMOUS'?
I
would normally do more research before posting here, but need to resolve this
fairly soon.
Many
thanks,
Jon
L.
______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information visit http://www.virtual-email.net/messagelabs.htm |
||||||||||||||||
|
Mike Horwitz
|
Some javascript/style in this post has been disabled (why?)
You could simply exclude them from Acegi processing altoghether by changing the configuration of the filterChainProxy in sercurity.xml?
Mike.
On 2/13/07, Jon Loken <[hidden email]> wrote:
|
||||||||||||||||
|
jloken
|
Some javascript/style in this post has been disabled (why?)
Hi again,
I've had a closer look at filterChainProxy, but cannot see
any immediate way to disable a small set of jsp's from being authenticated.
Has anyone experience with preventing a small set of
jps from going through the Acegi login sequence? The jps pages in question are
static, but cater for i18n.
Regards
Jon From: Michael Horwitz [mailto:[hidden email]] Sent: 13 February 2007 11:28 To: [hidden email] Subject: Re: [appfuse-user] acegi - disable authentication for particular jsp pages (using spring MVC) You could simply exclude them from Acegi processing altoghether by changing
the configuration of the filterChainProxy in sercurity.xml?
Mike.
On 2/13/07, Jon Loken
<[hidden email]>
wrote:
This email has been scanned by Netintelligence http://www.netintelligence.com/email ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information visit http://www.virtual-email.net/messagelabs.htm ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information visit http://www.virtual-email.net/messagelabs.htm |
||||||||||||||||
|
Joao Nelas-2
|
Some javascript/style in this post has been disabled (why?)
In the filterInvocationInterceptor you can say that they are restricted to the ROLE_ANONYMOUS.On 2/13/07, Jon Loken <[hidden email]> wrote:
|
||||||||||||||||
|
Matt Raible-3
|
In reply to this post
by jloken
In the filterChainProxy bean, you could use the #NONE# keyword like we
do for images and such: <property name="filterInvocationDefinitionSource"> <value> CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON PATTERN_TYPE_APACHE_ANT /images/**=#NONE# /scripts/**=#NONE# /styles/**=#NONE# /**=httpSessionContextIntegrationFilter,authenticationProcessingFilter,securityContextHolderAwareRequestFilter,rememberMeProcessingFilter,anonymousProcessingFilter,exceptionTranslationFilter,filterInvocationInterceptor </value> Or in the filterInvocationInterceptor, add your pattern as the first one with ROLE_ANONYMOUS: <property name="objectDefinitionSource"> <value> PATTERN_TYPE_APACHE_ANT /yourjsppattern.jsp*=ROLE_ANONYMOUS /activeUsers.*=admin /clickstreams.jsp*=admin /flushCache.*=admin /passwordHint.html*=ROLE_ANONYMOUS,admin,user /reload.*=admin /signup.html*=ROLE_ANONYMOUS,admin,user /users.html*=admin /**/*.html*=admin,user </value> On 2/13/07, Jon Loken <[hidden email]> wrote: > > > Hi again, > I've had a closer look at filterChainProxy, but cannot see any immediate way > to disable a small set of jsp's from being authenticated. > > > Has anyone experience with preventing a small set of jps from going through > the Acegi login sequence? The jps pages in question are static, but cater > for i18n. > > Regards > Jon > > > ________________________________ > From: Michael Horwitz [mailto:[hidden email]] > Sent: 13 February 2007 11:28 > To: [hidden email] > Subject: Re: [appfuse-user] acegi - disable authentication for particular > jsp pages (using spring MVC) > > > > You could simply exclude them from Acegi processing altoghether by changing > the configuration of the filterChainProxy in sercurity.xml? > > Mike. > > On 2/13/07, Jon Loken <[hidden email]> wrote: > > > > > > Hi all, > > > > Just a quick question regarding Acegi authentication. > > > > How can I disable authentication for particular jsp pages. These jsp pages > should then be freely accessible without being redirected to login.jsp. With > Acegi/Appfuse being so flexible I would not be surprised if this can be done > declaratively. > > > > At the moment the set of freely accessible jsp pages reside under folder > /pages/static/. > > Inserting line: > > /static/*.html*=ROLE_ANONYMOUS > > in bean 'filterInvocationInterceptor' in file security.xml is not > sufficient. > > > > A non declarative solution may that all requests pass by a filter that > gives all users role 'ROLE_ANONYMOUS'? > > > > I would normally do more research before posting here, but need to resolve > this fairly soon. > > > > Many thanks, > > Jon L. > > > ______________________________________________________________________ > > This email has been scanned by the MessageLabs Email Security System. > > For more information visit > http://www.virtual-email.net/messagelabs.htm > > > > > ________________________________ > This email has been scanned by Netintelligence > http://www.netintelligence.com/email > ________________________________ > > > ______________________________________________________________________ > This email has been scanned by the MessageLabs Email Security System. > For more information visit > http://www.virtual-email.net/messagelabs.htm > > ______________________________________________________________________ > This email has been scanned by the MessageLabs Email Security System. > For more information visit > http://www.virtual-email.net/messagelabs.htm > -- http://raibledesigns.com --------------------------------------------------------------------- To unsubscribe, e-mail: [hidden email] For additional commands, e-mail: [hidden email] |
||||||||||||||||
|
jloken
|
Thanks all for your help,
The second suggestion worked fine, namely to place /yourjsppattern.jsp*=ROLE_ANONYMOUS AT THE TOP of the value list. Before this line was at the bottom of the list, hence the problem. Much appreciated, Jon -----Original Message----- From: Matt Raible [mailto:[hidden email]] Sent: 13 February 2007 18:48 To: [hidden email] Subject: Re: [appfuse-user] acegi - disable authentication for particular jsp pages (using spring MVC) In the filterChainProxy bean, you could use the #NONE# keyword like we do for images and such: <property name="filterInvocationDefinitionSource"> <value> CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON PATTERN_TYPE_APACHE_ANT /images/**=#NONE# /scripts/**=#NONE# /styles/**=#NONE# /**=httpSessionContextIntegrationFilter,authenticationProcessingFilter,s ecurityContextHolderAwareRequestFilter,rememberMeProcessingFilter,anonym ousProcessingFilter,exceptionTranslationFilter,filterInvocationIntercept or </value> Or in the filterInvocationInterceptor, add your pattern as the first one with ROLE_ANONYMOUS: <property name="objectDefinitionSource"> <value> PATTERN_TYPE_APACHE_ANT /yourjsppattern.jsp*=ROLE_ANONYMOUS /activeUsers.*=admin /clickstreams.jsp*=admin /flushCache.*=admin /passwordHint.html*=ROLE_ANONYMOUS,admin,user /reload.*=admin /signup.html*=ROLE_ANONYMOUS,admin,user /users.html*=admin /**/*.html*=admin,user </value> ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information visit http://www.virtual-email.net/messagelabs.htm --------------------------------------------------------------------- To unsubscribe, e-mail: [hidden email] For additional commands, e-mail: [hidden email] |
||||||||||||||||
|
taltu
|
In reply to this post
by taltu
Hi,
Using M4-snapshot and fixing problems with dao and manager. Now, I get following error running PersonListTest for generic dao and manager. org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'personManager' is defined at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:340) -thx
|
||||||||||||||||
|
Matt Raible-3
|
Do you have a personManager bean definition in
src/main/webapp/WEB-INF/applicationContext.xml? If you're using a modular archetype, this should be in core/src/main/resources/applicationContext.xml. Matt On 2/15/07, Tuncay A. <[hidden email]> wrote: > > Hi, > > Using M4-snapshot and fixing problems with dao and manager. Now, I get > following error running PersonListTest for generic dao and manager. > > org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean > named 'personManager' is defined > at > org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:340) > > -thx > > > Tuncay A. wrote: > > > > Ok. > > > > > > > > Matt Raible-3 wrote: > >> > >> I agree - it would be nice if it worked 100% with the IDEs. The good > >> news is it works much better than 1.x did (mainly due to XDoclet > >> issues). I think it *can* work, it's just a matter of figuring out > >> the configuration. You could probably setup an external tool > >> configuration to launch "mvn jetty:run-war" from the IDE. If you'd > >> like to enter an issue in JIRA - that will make it easier for us to > >> track and add your desired feature(s). > >> > >> Matt > >> > >> On 2/11/07, Tuncay A. <[hidden email]> wrote: > >>> > >>> Thx, will give a try. > >>> > >>> However, it is very very painful for lot of developers to work with > >>> AppFuse > >>> using Maven instead of it's favorite IDE. > >>> > >>> Soon, I hope AppFuse 2.0 could 100% working with IDEs and a detail > >>> documentation for it could be written. > >>> > >>> This could be very helpful for a lot and more pleasure to work with > >>> AppFuse > >>> framework! > >>> > >>> When do you think this importent feature could be realistic ? > >>> > >>> //tua > >>> > >>> > >>> Matt Raible-3 wrote: > >>> > > >>> > On 2/10/07, Tuncay A. <[hidden email]> wrote: > >>> >> > >>> >> Thx Guys!, > >>> >> > >>> >> It works now :-) > >>> >> > >>> >> The way it works: > >>> >> > >>> >> 1. Checkout a fresh archetype jsf-moduler for m4-SNAPSHOT. > >>> >> 2. Moved applicationContext.xml from core web module to > >>> >> core/src/main/resources. > >>> >> 3. Created an applicationContext-resources.xml inside > >>> >> core/src/test/resources/ and changed to use a DriverManagerDataSource > >>> >> instead of DBCP > >>> >> 4. In applicationContext.xml and hibernate.cfg.xml I define a mapping > >>> to > >>> >> POJO person couldn't work without having define it in > >>> >> applicationContext.xml too. > >>> >> 5. Changed PersonDaoTest to load the additional > >>> applicationContext.xml > >>> >> file > >>> >> from src/main/resources. > >>> >> 6. Changed the Person.java class annotation to: @Entity > >>> >> 7. Wow - works! :-) > >>> >> > >>> >> But..... > >>> >> > >>> >> Now when I try running the webapp in Tomcat inside IntelliJ. I get > >>> >> following: ? > >>> > > >>> > I haven't tried to use IDEA's built-in server support - but my guess > >>> > is it doesn't resolve this artifact properly from the classpath. You > >>> > might try to use "mvn package" and then point IDEA/Tomcat at the > >>> > exploded directory structure in your "target" directory. > >>> > > >>> > Matt > >>> > > >>> >> > >>> >> javax.servlet.jsp.JspException: Error initializing Velocity: > >>> >> org.apache.velocity.exception.ResourceNotFoundException: Unable to > >>> find > >>> >> resource 'WEB-INF/classes/cssHorizontalMenu.vm' > >>> >> at > >>> >> > >>> net.sf.navigator.taglib.DisplayMenuTag.doStartTag(DisplayMenuTag.java:105) > >>> >> at > >>> >> > >>> net.sf.navigator.taglib.el.DisplayMenuTag.doStartTag(DisplayMenuTag.java:45) > >>> >> at > >>> >> > >>> org.apache.jsp.common.menu_jsp._jspx_meth_menu_displayMenu_0(menu_jsp.java:258) > >>> >> at > >>> >> > >>> org.apache.jsp.common.menu_jsp._jspx_meth_menu_useMenuDisplayer_0(menu_jsp.java:148) > >>> >> at > >>> org.apache.jsp.common.menu_jsp._jspService(menu_jsp.java:93) > >>> >> at > >>> >> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) > >>> >> at > >>> javax.servlet.http.HttpServlet.service(HttpServlet.java:802) > >>> >> at > >>> >> > >>> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334) > >>> >> at org.apache.jasper.servlet.JspServlet.serviceJspFile(Jsp > >>> >> > >>> >> > >>> >> > >>> >> Matt Raible-3 wrote: > >>> >> > > >>> >> > On 2/10/07, Tuncay A. <[hidden email]> wrote: > >>> >> >> > >>> >> >> > >>> >> >> 1. I made a new fresh checkout of achetype m3 and got the problem. > >>> >> >> Then in super-pom modified the version of appfuse to use > >>> m4-SNAPSHOT > >>> >> and > >>> >> >> still get the prob. > >>> >> > > >>> >> > > >>> >> > You're using a modular project correct? > >>> >> > > >>> >> > 2. Another issue is the tutorial about the testing part of > >>> Hibernate > >>> >> dao > >>> >> >> using Person example. > >>> >> >> The part of the tutorial that is about creating a custom dao it > >>> >> involves > >>> >> >> e.g. extending GenericHibernateDao and define the personDao as > >>> >> depending > >>> >> >> on > >>> >> >> Generic classes which don't makes sense since it is about to > >>> create a > >>> >> >> custom > >>> >> >> dao. > >>> >> >> > >>> >> >> Could someone please write an ordered list of how temporary fixing > >>> the > >>> >> >> above > >>> >> >> issues. > >>> >> > > >>> >> > > >>> >> > 1. Copy the attached file to your core/src/test/resources > >>> directory. > >>> >> > 2. Copy web/src/main/resources/mail.properties to > >>> >> core/src/test/resources. > >>> >> > > >>> >> > Let me know if you get any errors after making this change. > >>> >> > > >>> >> > Matt > >>> >> > > >>> >> > Matt Raible-3 wrote: > >>> >> >> > > >>> >> >> > Did you start with m3 or are you trying to upgrade from m2? > >>> >> >> > > >>> >> >> > Matt > >>> >> >> > > >>> >> >> > On 2/10/07, Tuncay A. <[hidden email]> wrote: > >>> >> >> >> > >>> >> >> >> > >>> >> >> >> Hi, > >>> >> >> >> > >>> >> >> >> I tried to run Person dao tutorial for appfuse 2. I have been > >>> using > >>> >> m3 > >>> >> >> >> and > >>> >> >> >> m4 without result: > >>> >> >> >> > >>> >> >> >> I get following error: > >>> >> >> >> > >>> >> >> >> TestFindPersonByLastName(net.jsync.dao.PersonDaoTest) Time > >>> >> elapsed: > >>> >> >> >> 0.579 > >>> >> >> >> sec <<< ERROR! > >>> >> >> >> org.springframework.beans.factory.BeanCreationException: Error > >>> >> >> creating > >>> >> >> >> bean > >>> >> >> >> with name 'sessionFactory' defined in URL > >>> >> >> >> > >>> >> >> >> > >>> >> >> > >>> >> > >>> [jar:file:/E:/Workspace/Repositories/m2/org/appfuse/appfuse-hibernate/2.0-m4-SNAPSHOT/appfuse- > >>> >> >> >> hibernate-2.0-m4-SNAPSHOT.jar!/applicationContext-dao.xml]: > >>> >> >> >> Cannot resolve reference to bean 'dataSource' while setting > >>> bean > >>> >> >> property > >>> >> >> >> 'dataSource'; nested exception is > >>> >> >> >> > >>> org.springframework.beans.factory.NoSuchBeanDefinitionException: No > >>> >> >> bean > >>> >> >> >> named 'dataSource' is defined > >>> >> >> >> Caused by: > >>> >> >> >> org.springframework.beans.factory.NoSuchBeanDefinitionException > >>> >> >> >> : > >>> >> >> >> No bean named 'dataSource' is defined > >>> >> >> >> at > >>> >> >> >> > >>> >> >> >> > >>> >> >> > >>> >> > >>> org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition > >>> >> >> >> (DefaultListableBeanFactory.java:340) > >>> >> >> >> > >>> >> >> >> Thx. > >>> >> >> >> -- > >>> >> >> >> View this message in context: > >>> >> >> >> > >>> >> >> > >>> >> > >>> http://www.nabble.com/Appfuse-2-tutorial-for-DaoTest-tf3205568s2369.html#a8901509 > >>> >> >> >> Sent from the AppFuse - User mailing list archive at > >>> Nabble.com. > >>> >> >> >> > >>> >> >> >> > >>> >> --------------------------------------------------------------------- > >>> >> >> >> To unsubscribe, e-mail: [hidden email] > >>> >> >> >> For additional commands, e-mail: > >>> [hidden email] > >>> >> >> >> > >>> >> >> >> > >>> >> >> > > >>> >> >> > > >>> >> >> > -- > >>> >> >> > http://raibledesigns.com > >>> >> >> > > >>> >> >> > > >>> >> >> > >>> >> >> -- > >>> >> >> View this message in context: > >>> >> >> > >>> >> > >>> http://www.nabble.com/Appfuse-2-tutorial-for-DaoTest-tf3205568s2369.html#a8903741 > >>> >> >> Sent from the AppFuse - User mailing list archive at Nabble.com. > >>> >> >> > >>> >> >> > >>> --------------------------------------------------------------------- > >>> >> >> To unsubscribe, e-mail: [hidden email] > >>> >> >> For additional commands, e-mail: [hidden email] > >>> >> >> > >>> >> >> > >>> >> > > >>> >> > > >>> >> > -- > >>> >> > http://raibledesigns.com > >>> >> > > >>> >> > <?xml version="1.0" encoding="UTF-8"?> > >>> >> > <beans xmlns="http://www.springframework.org/schema/beans" > >>> >> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > >>> >> > > >>> xsi:schemaLocation="http://www.springframework.org/schema/beans > >>> >> > http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> > >>> >> > > >>> >> > <bean id="propertyConfigurer" > >>> >> > > >>> >> > >>> class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> > >>> >> > <property name="locations"> > >>> >> > <list> > >>> >> > <value>classpath:jdbc.properties</value> > >>> >> > <value>classpath:mail.properties</value> > >>> >> > </list> > >>> >> > </property> > >>> >> > </bean> > >>> >> > > >>> >> > <bean id="dataSource" > >>> >> > > >>> class="org.springframework.jdbc.datasource.DriverManagerDataSource"> > >>> >> > <property name="driverClassName" > >>> >> value="${jdbc.driverClassName}"/> > >>> >> > <property name="url" value="${jdbc.url}"/> > >>> >> > <property name="username" value="${jdbc.username}"/> > >>> >> > <property name="password" value="${jdbc.password}"/> > >>> >> > </bean> > >>> >> > </beans> > >>> >> > > >>> --------------------------------------------------------------------- > >>> >> > To unsubscribe, e-mail: [hidden email] > >>> >> > For additional commands, e-mail: [hidden email] > >>> >> > > >>> >> > >>> >> -- > >>> >> View this message in context: > >>> >> > >>> http://www.nabble.com/Appfuse-2-tutorial-for-DaoTest-tf3205568s2369.html#a8904765 > >>> >> Sent from the AppFuse - User mailing list archive at Nabble.com. > >>> >> > >>> >> --------------------------------------------------------------------- > >>> >> To unsubscribe, e-mail: [hidden email] > >>> >> For additional commands, e-mail: [hidden email] > >>> >> > >>> >> > >>> > > >>> > > >>> > -- > >>> > http://raibledesigns.com > >>> > > >>> > --------------------------------------------------------------------- > >>> > To unsubscribe, e-mail: [hidden email] > >>> > For additional commands, e-mail: [hidden email] > >>> > > >>> > > >>> > > >>> > >>> -- > >>> View this message in context: > >>> http://www.nabble.com/Appfuse-2-tutorial-for-DaoTest-tf3205568s2369.html#a8915485 > >>> Sent from the AppFuse - User mailing list archive at Nabble.com. > >>> > >>> --------------------------------------------------------------------- > >>> To unsubscribe, e-mail: [hidden email] > >>> For additional commands, e-mail: [hidden email] > >>> > >>> > >> > >> > >> -- > >> http://raibledesigns.com > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: [hidden email] > >> For additional commands, e-mail: [hidden email] > >> > >> > >> > > > > > > -- > View this message in context: http://www.nabble.com/Appfuse-2-tutorial-for-DaoTest-tf3205568s2369.html#a8983916 > Sent from the AppFuse - User mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [hidden email] > For additional commands, e-mail: [hidden email] > > -- http://raibledesigns.com --------------------------------------------------------------------- To unsubscribe, e-mail: [hidden email] For additional commands, e-mail: [hidden email] |
||||||||||||||||
|
taltu
|
Using jsf-modular and having applicationContext.xml inside core/src/main/resources/ - it doesn't work.
BasePageTestCase doesn't know about the applicationContext.xml. I made modification to PersonListTest to include applicationContext.xml from classpath like other *.xml files the BasePageTestCase does. It seems to be found, but I get another error saying the entity: net.company.model.Person in unknown. ?? The applicationContext.xml is configured as: <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> <bean id="personDao" class="org.appfuse.dao.hibernate.GenericDaoHibernate"> <constructor-arg value="net.company.model.Person"/> <property name="sessionFactory" ref="sessionFactory"/> </bean> <bean id="personManager" class="org.appfuse.service.impl.GenericManagerImpl"> <constructor-arg> <bean class="org.appfuse.dao.hibernate.GenericDaoHibernate" autowire="byType"> <constructor-arg value="net.company.model.Person"/> </bean> </constructor-arg> </bean> </beans>
|
||||||||||||||||
| Free Embeddable Forum Powered by Nabble | Help |