Announcement Announcement Module
No announcement yet.
petclinic security with tomcat and weblogic Page Title Module
Move Remove Collapse
This topic is closed
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • petclinic security with tomcat and weblogic

    I have a simple security test with petclinic.

    I add security definitions to security-context-server.xml:

    <bean id="clinicSecurityInterceptor" class="net.sf.acegisecurity.intercept.method.Metho dSecurityInterceptor">
    <property name="authenticationManager"><ref bean="authenticationManager"/></property>
    <property name="accessDecisionManager"><ref bean="accessDecisionManager"/></property>
    <property name="runAsManager"><ref bean="runAsManager"/></property>
    <property name="objectDefinitionSource">
    <value>org.springframework.samples.petclinic.Clini c.getVets=ROLE_TELLER
    org.springframework.samples.petclinic.Clinic.getPe tTypes=ROLE_SUPERVISOR

    <bean id="autoProxyCreator" class="org.springframework.aop.framework.autoproxy .BeanNameAutoProxyCreator">
    <property name="interceptorNames">
    </property><property name="beanNames"><list><value>hsqlClinic</value></list>

    Then I test petclinic-server.war with tomcat4.1.29 and weblogic8.1 respectively

    With tomcat, I can get 'Authentication' from HttpSession and SecureContext on server side, so everything works well.

    however, the same petclinic-server.war with weblogic, the error is coming : A valid SecureContext was not provided in the

    Thanks for your help!

  • #2
    Is this from the Spring Rich project?

    Does it work if you just deploy a WAR built again CVS HEAD without modification?


    • #3
      yes,it is from RCP.

      if I deploy petclinic-server.war without modification, the error infomation are as following:

      <2004-10-25 下午16时29分14秒 CST> <Error> <HTTP> <BEA-101216> <Servlet: "ws" fai
      led to preload on startup in Web application: "petclinic-server".
      javax.servlet.ServletException: Error creating bean with name '/Clinic-hessian'
      defined in resource [/WEB-INF/ws-servlet.xml] of ServletContext: Can't resolve r
      eference to bean 'clinic' while setting property 'service'; nested exception is
      org.springframework.beans.factory.NoSuchBeanDefini tionException: No bean named '
      clinic' is defined: istableBea
      nFactory defining beans [/Clinic-hessian,/Clinic-burlap,/RemoteAuthenticationMan

      <2004-10-25 下午16时29分14秒 CST> <Error> <HTTP> <BEA-101165> <Could not load us
      er defined filter: net.sf.acegisecurity.util.FilterToBeanProxy.
      java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoade
      rListener registered?

      however, tomcat works well, no error.


      • #4
        It looks as if the root application context isn't getting loaded prior to the dispatcher servlet application context. Usually the ContextLoaderListener is used to load the root application context, or if unsupported by the container, ContextLoaderServlet is used. If ContextLoaderServlet is used, the FilterToBeanProxy definitions in web.xml should each have an "init" initialization parameter set to "lazy".

        Does the normal (Spring core) PetClinic WAR deploy successfully on your WebLogic server?