Announcement Announcement Module
Collapse
No announcement yet.
Tapestry Public Pages thr' Acegi Page Title Module
Move Remove Collapse
This topic is closed
X
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Tapestry Public Pages thr' Acegi

    Hello Everyone,

    We are using Acegi 1.0.1 with Tapestry 4.0.2, Spring 2.0 and Hibernate 3.1
    And Java 1.5.

    We have implemented the Acegi security in our application. We have some public pages that can be accessed with and/or without Login into the application.

    Problem is when the User logs in and then tries to access these public pages, it takes too long to load up and when I see the error logs, i see this error :
    java.sql.SQLException: Io exception: The Network Adapter could not establish the connection

    This happens only of user is logged in.

    Also these public pages do not have any Secured annotation. I tried with ROLE_ANONYMOUS but it did not help.

    Any idea how to make the public pages work fine with both the scenario of User Logged in / not logged in.

    Thanks,
    Jacob

  • #2
    I'm guessing this is probably a problem related to your JDBC connection. Is it possible to see the stacktrace your getting?

    Comment


    • #3
      Originally posted by karldmoore View Post
      I'm guessing this is probably a problem related to your JDBC connection. Is it possible to see the stacktrace your getting?
      At this point this is all we can see:
      java.sql.SQLException: Io exception: The Network Adapter could not establish the connection

      We are trying to debug it to find what causes this...

      Jacob

      Comment


      • #4
        I would have thought there should be more information on the console or in one of the logs. Regardless, is it possible to see your dataSource configuration. I would also google the exception it's quite a common one.

        Comment


        • #5
          Originally posted by karldmoore View Post
          I would have thought there should be more information on the console or in one of the logs. Regardless, is it possible to see your dataSource configuration. I would also google the exception it's quite a common one.
          Hi again,
          Here is my configuration for the datasource and for JdbcDaoImpl:

          <bean id="jdbcDaoImpl" class="org.acegisecurity.userdetails.jdbc.JdbcDaoI mpl">
          <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>


          <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryB ean">
          <property name="jndiName">
          <value>java:OracleDS</value>
          </property>
          </bean>


          I will google the exception and see if we come up with something new...

          Thanks
          Jacob

          Comment


          • #6
            You are going to get lots of results if you google this, it's a pretty common problem. Basically the dataSource can't get you a database connection.
            e.g.
            http://forum.java.sun.com/thread.jsp...sageID=1981277

            Comment


            • #7
              Originally posted by karldmoore View Post
              You are going to get lots of results if you google this, it's a pretty common problem. Basically the dataSource can't get you a database connection.
              e.g.
              http://forum.java.sun.com/thread.jsp...sageID=1981277
              Hi again,
              actually I still not get it... my jdbcDaoImpl is using my dataSource that the rest of my entire application is using without any problem. So why do I only get this Exception when we are using Acegi?
              Or is the problem somewhere else... I am using the tapestry-acegi project for integrating the two frameworks with the folowing defined in my hivemodule.xml:

              <!-- TAPESTRY - ACEGI CONFIGURATION -->
              <service-point id="FormProcessingFilter" interface="com.mycompany.ui.web.filters.FormProces sor">
              <invoke-factory>
              <construct class="com.mycompany.ui.web.filters.FormProcessing Filter" initialize-method="afterPropertiesSet">
              <set property="authenticationFailureUrl" value="/Home.html" />
              <set property="defaultTargetUrl" value="/LoginRedirect.html" />
              <set property="filterProcessesUrl" value="/j_acegi_security_check" />
              <set property="continueChainBeforeSuccessfulAuthenticat ion" value="true" />
              </construct>
              </invoke-factory>
              </service-point>

              <service-point id="FormAuthenticationEntryPoint" interface="org.acegisecurity.ui.AuthenticationEntr yPoint">
              <invoke-factory>
              <construct class="com.mycompany.ui.web.filters.FormAuthentica tionEntryPoint">
              <set property="loginFormUrl" value="/RedirectToLoginPage.html" />
              <set property="forceHttps" value="false" />
              </construct>
              </invoke-factory>
              </service-point>

              <implementation service-id="hivemind.acegi.dao.UserDetailsService">
              <invoke-factory service-id="hivemind.lib.SpringLookupFactory">
              <!-- <construct class="com.mycompany.business.service.userdetail.U serDetailsServiceImpl"/> -->
              <lookup-bean name="jdbcDaoImpl" />
              </invoke-factory>
              </implementation>

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

              <contribution configuration-id="hivemind.ApplicationDefaults">
              <default symbol="tapestry.acegi.authenticationProcessingFil ter" value="MyCompany.FormProcessingFilter"/>
              <default symbol="tapestry.acegi.authenticationEntryPoint" value="MyCompany.FormAuthenticationEntryPoint"/>
              <default symbol="hivemind.acegi.dao.passwordEncoder" value="org.acegisecurity.providers.encoding.Plaint extPasswordEncoder"/>
              <default symbol="hivemind.acegi.dao.systemWideSalt" value=""/>
              </contribution>


              Do I need any AnonomousAutheticationFilters or anything like that to make this work... The problem only occures for the public pages we have when we are logged in... as soon as we log out everything is fast loading again...

              Thanks
              Jacob

              Comment


              • #8
                I'm sorry I don't really have anymore answers. If there was more information in the log then that would really help. Given the nature of the exception it does seem to be related to the dataSource. Other than that I'm not really sure.

                Comment

                Working...
                X