You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by jake123 <ja...@gmail.com> on 2007/01/30 17:18:02 UTC

Exception when trying to configure tapestry-acegi.jar

Hi,
I have some problems when I try to use the tapestry-acegi.jar. My Jboss
server starts up fine without any exceptions, but as soon as I try to access
my application I get this exception:

11:07:48,750 ERROR [[/]] mycompany: ServletException
javax.servlet.ServletException: Unable to construct service
tapestry.acegi.ExceptionTranslationFilter: Error building se
rvice tapestry.acegi.ExceptionTranslationFilter: Could not load class
com.javaforge.tapestry.acegi.filter.ExceptionTrans
lationFilter from WebappClassLoader
  delegate: false
  repositories:
----------> Parent Classloader:
java.net.FactoryURLClassLoader@c0b3d1
: com/javaforge/hivemind/util/HiveMindService
        at
org.apache.tapestry.services.impl.WebRequestServicerPipelineBridge.service(WebRequestServicerPipelineBridge.j
ava:60)... 

the entire Exception is in the attached file 
http://www.nabble.com/file/6115/exception.txt exception.txt 

In our hivemodule.xml we have this code:
 <contribution configuration-id="hivemind.ApplicationDefaults">
    	<default 
        	symbol="hivemind.acegi.dao.passwordEncoder"
        
value="org.acegisecurity.providers.encoding.PlaintextPasswordEncoder"/>
    	<default symbol="hivemind.acegi.dao.systemWideSalt" value="" />
    </contribution>

    <implementation service-id="hivemind.acegi.dao.UserDetailsService">
    	<invoke-factory service-id="hivemind.lib.SpringLookupFactory">
        	<lookup-bean name="jdbcDaoImpl" />
        </invoke-factory>
    </implementation>

    <contribution configuration-id="hivemind.acegi.AccessDecisionVoters">
    	<voter object="instance:org.acegisecurity.vote.RoleVoter" />
    </contribution>

In our web.xml we have this:
	<servlet>
        <servlet-name>MyCompany</servlet-name>
       
<servlet-class>org.apache.tapestry.ApplicationServlet</servlet-class>
        <load-on-startup>0</load-on-startup>
	</servlet>

    <servlet-mapping>
        <servlet-name>MyCompany</servlet-name>
        <url-pattern>/index.html</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>MyCompany</servlet-name>
        <url-pattern>*.html</url-pattern>
    </servlet-mapping>
    
    <servlet-mapping>
        <servlet-name>MyCompany</servlet-name>
        <url-pattern>*.direct</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>MyCompany</servlet-name>
        <url-pattern>*.sdirect</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>MyCompany</servlet-name>
        <url-pattern>*.svc</url-pattern>
    </servlet-mapping>

In our spring applicationContext.xml we have:

   <bean id="jdbcDaoImpl"
class="org.acegisecurity.userdetails.jdbc.JdbcDaoImpl">
		<property name="dataSource">
			<ref bean="dataSource"/>
		</property>
		<property name="usersByUsernameQuery">
			<value>
				SELECT user_name as username, user_password as password, enabled as
ENABLED  FROM app_user WHERE user_name=?
			</value>
		</property>
		<property name="authoritiesByUsernameQuery">
			<value>
				SELECT user_name as username, user_role as authority FROM app_user_role
WHERE user_name=?
			</value>
		</property>
   </bean>

We are using the folloing jar files for tapestry-ageci:
tapestry-acegi-0.1-20070126.164757-10.jar
hivemind-acegi-dao-0.1-20060608.022406-1.jar
hivemind-acegi-0.1-20060607.122705-3.jar

Does anybody know what we are doing wrong?

Thanks,
Jacob



-- 
View this message in context: http://www.nabble.com/Exception-when-trying-to-configure-tapestry-acegi.jar-tf3142373.html#a8709323
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Exception when trying to configure tapestry-acegi.jar

Posted by jake123 <ja...@gmail.com>.
Hi James,
Thanks for the answer.. you were right we needed the hivemind-utils.jar file
also.
I have two more questions:

1) Now our application works fine when we are browsing the public
(non-secured) pages and when we are testing one page with Secured annotation
we get the Basic Authentication Login form... we do not want to use this
later, but for testing if the authentication is working we try to login
using this and when we do so, we get an exception stating:

HTTP Status 500 -
type: Exception report
message: description The server encountered an internal error () that
prevented it from fulfilling this request.
exception: org.apache.hivemind.ApplicationRuntimeException: Unable to
construct service hivemind.acegi.dao.UserDetailsService: Property
'beanFactory' of <SingletonProxy for
hivemind.lib.DefaultSpringBeanFactoryHolder(org.apache.hivemind.lib.SpringBeanFactoryHolder)>
is null. [context:/WEB-INF/hivemodule.xml, line 59, column 68]

org.apache.hivemind.impl.servicemodel.AbstractServiceModelImpl.constructNewServiceImplementation(
AbstractServiceModelImpl.java:166)
...

Here is the acegi code in our hivemodule.xml:
    <contribution configuration-id="hivemind.ApplicationDefaults">
    	<default 
        	symbol="hivemind.acegi.dao.passwordEncoder"
        
value="org.acegisecurity.providers.encoding.PlaintextPasswordEncoder"/>
    	<default symbol="hivemind.acegi.dao.systemWideSalt" value="" />
    </contribution>

    <implementation service-id="hivemind.acegi.dao.UserDetailsService">
    	<invoke-factory service-id="hivemind.lib.SpringLookupFactory">
        	<lookup-bean name="jdbcDaoImpl" />
        </invoke-factory>
    </implementation>

    <contribution configuration-id="hivemind.acegi.AccessDecisionVoters">
    	<voter object="instance:org.acegisecurity.vote.RoleVoter" />
    </contribution>

And here is the spring bean:
   <bean id="jdbcDaoImpl"
class="org.acegisecurity.userdetails.jdbc.JdbcDaoImpl">
		<property name="dataSource">
			<ref bean="dataSource"/>
		</property>
		<property name="usersByUsernameQuery">
			<value>
				SELECT user_name as username, user_password as password, enabled as
ENABLED  FROM app_user WHERE user_name=?
			</value>
		</property>
		<property name="authoritiesByUsernameQuery">
			<value>
				SELECT user_name as username, user_role as authority FROM app_user_role
WHERE user_name=?
			</value>
		</property>
   </bean>


2) When we are doing the form validation we actually have another delicate
problem. We have a couple of entry points to our system (domain names) that
goes to a HomeDispatcher that redirects it to different pages depending on
the incoming Domain Name. Some of these goes to a couple of public pages
that each have a login component that takes these users to a admin area for
the public pages. The other entry point is for our in house application that
starts directly with a login page. The question is: What is the best way of
doing the form based login? I saw some postings between you and Robin
Ericsson where he said he sent you a working code for form based
authentication
I guess this is not included in tapestry-acegi project... could you post
this code here in the form until then... I think a lot of people are
interested in that solution.

Thanks again for your help
Cheers,
Jacob



-- 
View this message in context: http://www.nabble.com/Exception-when-trying-to-configure-tapestry-acegi.jar-tf3142373.html#a8731641
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Exception when trying to configure tapestry-acegi.jar

Posted by James Carman <ja...@carmanconsulting.com>.
I believe you need hivemind-utils.jar in your classpath.


On 1/30/07, jake123 <ja...@gmail.com> wrote:
>
> Hi,
> I have some problems when I try to use the tapestry-acegi.jar. My Jboss
> server starts up fine without any exceptions, but as soon as I try to access
> my application I get this exception:
>
> 11:07:48,750 ERROR [[/]] mycompany: ServletException
> javax.servlet.ServletException: Unable to construct service
> tapestry.acegi.ExceptionTranslationFilter: Error building se
> rvice tapestry.acegi.ExceptionTranslationFilter: Could not load class
> com.javaforge.tapestry.acegi.filter.ExceptionTrans
> lationFilter from WebappClassLoader
>   delegate: false
>   repositories:
> ----------> Parent Classloader:
> java.net.FactoryURLClassLoader@c0b3d1
> : com/javaforge/hivemind/util/HiveMindService
>         at
> org.apache.tapestry.services.impl.WebRequestServicerPipelineBridge.service(WebRequestServicerPipelineBridge.j
> ava:60)...
>
> the entire Exception is in the attached file
> http://www.nabble.com/file/6115/exception.txt exception.txt
>
> In out hivemodule.xml we have this code:
>  <contribution configuration-id="hivemind.ApplicationDefaults">
>         <default
>                 symbol="hivemind.acegi.dao.passwordEncoder"
>
> value="org.acegisecurity.providers.encoding.PlaintextPasswordEncoder"/>
>         <default symbol="hivemind.acegi.dao.systemWideSalt" value="" />
>     </contribution>
>
>     <implementation service-id="hivemind.acegi.dao.UserDetailsService">
>         <invoke-factory service-id="hivemind.lib.SpringLookupFactory">
>                 <lookup-bean name="jdbcDaoImpl" />
>         </invoke-factory>
>     </implementation>
>
>     <contribution configuration-id="hivemind.acegi.AccessDecisionVoters">
>         <voter object="instance:org.acegisecurity.vote.RoleVoter" />
>     </contribution>
>
> In our web.xml we have this:
>         <servlet>
>         <servlet-name>MyCompany</servlet-name>
>
> <servlet-class>org.apache.tapestry.ApplicationServlet</servlet-class>
>         <load-on-startup>0</load-on-startup>
>         </servlet>
>
>     <servlet-mapping>
>         <servlet-name>MyCompany</servlet-name>
>         <url-pattern>/index.html</url-pattern>
>     </servlet-mapping>
>
>     <servlet-mapping>
>         <servlet-name>MyCompany</servlet-name>
>         <url-pattern>*.html</url-pattern>
>     </servlet-mapping>
>
>     <servlet-mapping>
>         <servlet-name>MyCompany</servlet-name>
>         <url-pattern>*.direct</url-pattern>
>     </servlet-mapping>
>     <servlet-mapping>
>         <servlet-name>MyCompany</servlet-name>
>         <url-pattern>*.sdirect</url-pattern>
>     </servlet-mapping>
>     <servlet-mapping>
>         <servlet-name>MyCompany</servlet-name>
>         <url-pattern>*.svc</url-pattern>
>     </servlet-mapping>
>
> In our spring applicationContext.xml we have:
>
>    <bean id="jdbcDaoImpl"
> class="org.acegisecurity.userdetails.jdbc.JdbcDaoImpl">
>                 <property name="dataSource">
>                         <ref bean="dataSource"/>
>                 </property>
>                 <property name="usersByUsernameQuery">
>                         <value>
>                                 SELECT user_name as username, user_password as password, enabled as
> ENABLED  FROM app_user WHERE user_name=?
>                         </value>
>                 </property>
>                 <property name="authoritiesByUsernameQuery">
>                         <value>
>                                 SELECT user_name as username, user_role as authority FROM app_user_role
> WHERE user_name=?
>                         </value>
>                 </property>
>    </bean>
>
> We are using the folloing jar files for tapestry-ageci:
> tapestry-acegi-0.1-20070126.164757-10.jar
> hivemind-acegi-dao-0.1-20060608.022406-1.jar
> hivemind-acegi-0.1-20060607.122705-3.jar
>
> Does anybody know what we are doing wrong?
>
> Thanks,
> Jacob
>
>
>
> --
> View this message in context: http://www.nabble.com/Exception-when-trying-to-configure-tapestry-acegi.jar-tf3142373.html#a8709323
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org