Announcement Announcement Module
Collapse
No announcement yet.
Problem in deploying Contacts in BEA WLS 8.1 Page Title Module
Move Remove Collapse
This topic is closed
X
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem in deploying Contacts in BEA WLS 8.1

    Hi,

    First of all, thank you for theses great pieces of work, I mean: Spring and Acegi Security. I have been trying and promoting the use of Spring and Acegi Security for new J2EE developments in my company.

    I have played around with Acegi Contacts app on Tomcat ( 5.0.28 ), changing authentication provider, etc: it works fine.

    On BEA WebLogic 8.1, I so far have not succeeded in deploying the original Contacts app. I have come accross several problems, including:
    • - I had to update to Spring 1.1.2 to avoid an exception related to htmlEscape from TransformTag in Spring Taglib.
    • - The beans declared in [contacts-servlet.xml] that reference 'contactManager' wouldn't be loaded correctly. The error message from the server is something like this "Can't resolve reference to bean 'contactManager' while setting property 'contactManager'".
      See (1) for further details.
    • - As a temporary solution, I move all of the beans related to 'contactManager' from [contacts-servlet.xml] to [applicationContext.xml]. The deployment process goes one step further. However I now have "Could not load user defined filter: net.sf.acegisecurity.util.FilterToBeanProxy."
      See (2) for further details.

    Have I missed something?

    Thank you in advance for your help.
    Cheers,

    -- Savrak


    PS:

    Code / message excerpts:

    (1)

    Code:
    ####<3 dc. 2004 14.21. h CET> <Error> <HTTP> <T008766> <serverWorkshop> <main> <<WLS Kernel>> <> <BEA-101216> <Servlet&#58; "contacts" failed to preload on startup in Web application&#58; "contacts".
    javax.servlet.ServletException&#58; Error creating bean with name 'publicIndexController' defined in resource &#91;/WEB-INF/contacts-servlet.xml&#93; of ServletContext&#58; Can't resolve reference to bean 'contactManager' while setting property 'contactManager'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException&#58; No bean named 'contactManager' is defined&#58; org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans &#91;publicIndexController,secureIndexController,secureDeleteController,urlMapping,addValidator,secureAddForm,viewResolver&#93;; Root of BeanFactory hierarchy
    	at weblogic.servlet.internal.ServletStubImpl.createServlet&#40;ServletStubImpl.java&#58;884&#41;
    	at weblogic.servlet.internal.ServletStubImpl.createInstances&#40;ServletStubImpl.java&#58;848&#41;
    ...

    (2)
    Code:
    ####<3 dc. 2004 14.50. h CET> <Error> <HTTP> <T008766> <serverWorkshop> <main> <<WLS Kernel>> <> <BEA-101165> <Could not load user defined filter&#58; net.sf.acegisecurity.util.FilterToBeanProxy.
    java.lang.IllegalStateException&#58; No WebApplicationContext found&#58; no ContextLoaderListener registered?
    	at org.springframework.web.context.support.WebApplicationContextUtils.getRequiredWebApplicationContext&#40;WebApplicationContextUtils.java&#58;83&#41;
    	at net.sf.acegisecurity.util.FilterToBeanProxy.getContext&#40;FilterToBeanProxy.java&#58;158&#41;
    	at net.sf.acegisecurity.util.FilterToBeanProxy.init&#40;FilterToBeanProxy.java&#58;98&#41;
    	at weblogic.servlet.internal.WebAppServletContext$FilterInitAction.run&#40;WebAppServletContext.java&#58;6379&#41;
    	at weblogic.security.acl.internal.AuthenticatedSubject.doAs&#40;AuthenticatedSubject.java&#58;317&#41;

  • #2
    Could you post your web.xml? Also, Contacts has been significantly refactored in the last month, so you might like to try it from CVS.

    Comment


    • #3
      Here is the [web.xml] (I have removed the caucho servlet).
      In the mean time, I'll give a try to Contacts from CVS.

      -- Savrak


      [web.xml]

      Code:
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE web-app PUBLIC '-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN' 'http&#58;//java.sun.com/dtd/web-app_2_3.dtd'>
      
      <!--
        - Contacts web application
        - $Id&#58; web.xml,v 1.9 2004/08/03 07&#58;18&#58;33 benalex Exp $
        - File will be copied into WAR's WEB-INF directory if NOT using container adapter
        -->
      
      <web-app>
      
          <display-name>Contacts Sample Application</display-name>
      
      	<description>
          	Example of an application secured using Acegi Security System for Spring.
          </description>
      
      	<!--
      	  - Location of the XML file that defines the root application context
      	  - Applied by ContextLoaderListener.
      	  -->
      	<context-param>
      		<param-name>contextConfigLocation</param-name>
      		<param-value>/WEB-INF/applicationContext.xml</param-value>
      	</context-param>
      
         <filter>
              <filter-name>Acegi Channel Processing Filter</filter-name>
              <filter-class>net.sf.acegisecurity.util.FilterToBeanProxy</filter-class>
              <init-param>
                  <param-name>targetClass</param-name>
                  <param-value>net.sf.acegisecurity.securechannel.ChannelProcessingFilter</param-value>
              </init-param>
          </filter>
      
          <filter>
              <filter-name>Acegi Authentication Processing Filter</filter-name>
              <filter-class>net.sf.acegisecurity.util.FilterToBeanProxy</filter-class>
              <init-param>
                  <param-name>targetClass</param-name>
                  <param-value>net.sf.acegisecurity.ui.webapp.AuthenticationProcessingFilter</param-value>
              </init-param>
          </filter>
      
          <filter>
              <filter-name>Acegi HTTP BASIC Authorization Filter</filter-name>
              <filter-class>net.sf.acegisecurity.util.FilterToBeanProxy</filter-class>
              <init-param>
                  <param-name>targetClass</param-name>
                  <param-value>net.sf.acegisecurity.ui.basicauth.BasicProcessingFilter</param-value>
              </init-param>
          </filter>
      
          <filter>
              <filter-name>Acegi Security System for Spring Auto Integration Filter</filter-name>
              <filter-class>net.sf.acegisecurity.util.FilterToBeanProxy</filter-class>
              <init-param>
                  <param-name>targetClass</param-name>
                  <param-value>net.sf.acegisecurity.ui.AutoIntegrationFilter</param-value>
              </init-param>
          </filter>
      
          <filter>
              <filter-name>Acegi HTTP Request Security Filter</filter-name>
              <filter-class>net.sf.acegisecurity.util.FilterToBeanProxy</filter-class>
              <init-param>
                  <param-name>targetClass</param-name>
                  <param-value>net.sf.acegisecurity.intercept.web.SecurityEnforcementFilter</param-value>
              </init-param>
          </filter>
      
      	<!-- Remove the comments from the following <filter-mapping> if you'd
      	     like to ensure secure URLs are only available over HTTPS -->
          <!--
          <filter-mapping>
            <filter-name>Acegi Channel Processing Filter</filter-name>
            <url-pattern>/*</url-pattern>
          </filter-mapping>
          -->
      
          <filter-mapping>
            <filter-name>Acegi Authentication Processing Filter</filter-name>
            <url-pattern>/*</url-pattern>
          </filter-mapping>
      
          <filter-mapping>
            <filter-name>Acegi HTTP BASIC Authorization Filter</filter-name>
            <url-pattern>/*</url-pattern>
          </filter-mapping>
      
          <filter-mapping>
            <filter-name>Acegi Security System for Spring Auto Integration Filter</filter-name>
            <url-pattern>/*</url-pattern>
          </filter-mapping>
      
          <filter-mapping>
            <filter-name>Acegi HTTP Request Security Filter</filter-name>
            <url-pattern>/*</url-pattern>
          </filter-mapping>
      
      	<!--
      	  - Loads the root application context of this web app at startup,
      	  - by default from "/WEB-INF/applicationContext.xml".
      	  - Use WebApplicationContextUtils.getWebApplicationContext&#40;servletContext&#41;
      	  - to access it anywhere in the web application, outside of the framework.
          -->
      	<listener>
      		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
      	</listener>
      
        <!--
          - Servlet that dispatches request to registered handlers &#40;Controller implementations&#41;.
          - Has its own application context, by default defined in "&#123;servlet-name&#125;-servlet.xml",
          - i.e. "contacts-servlet.xml".
          -
          - A web app can contain any number of such servlets.
          - Note that this web app does not have a shared root application context,
          - therefore the DispatcherServlet contexts do not have a common parent.
          -->
      	<servlet>
      		<servlet-name>contacts</servlet-name>
      		<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
      		<load-on-startup>1</load-on-startup>
      	</servlet>
      
      
        <!--
          - Maps the contacts dispatcher to /*.
          -
         -->
      	<servlet-mapping>
          	<servlet-name>contacts</servlet-name>
          	<url-pattern>*.htm</url-pattern>
       	</servlet-mapping>
      
      
       	<welcome-file-list>
      		<welcome-file>index.jsp</welcome-file>
      	</welcome-file-list>
      
        	<taglib>
            <taglib-uri>/spring</taglib-uri>
            <taglib-location>/WEB-INF/spring.tld</taglib-location>
        	</taglib>
      
      </web-app>

      Comment


      • #4
        A strange issue. Do you have any Spring or Acegi Security JARs in a different server classloader? Also try out the CVS version, as it should work and I'd prefer to debug the newer release if possible.

        Comment


        • #5
          - I checked the CLASSPATH, but it seems to be OK. I include the output from BEA (1) at the end of this message.
          - I tried to connect yesterday and today to the CVS using one of these commands:

          D:\bin\TortoiseCVS>cvs -dserver:[email protected]:/cvsroot/acegisecurity login

          D:\bin\TortoiseCVS>cvs -dserver:[email protected]:80/cvsroot/acegisecurity login

          D:\bin\TortoiseCVS>cvs -dserver:[email protected]:443/cvsroot/acegisecurity login

          All of them failed.
          Would it be possible you put the latest version of Acegi in a ZIP for download on the web site?

          Thanks.

          -- Savrak

          PS: (1)

          Code:
          Using java memory arguments&#58; -Xms256m -Xmx256m -XX&#58;CompileThreshold=8000 -XX&#58;Per
          mSize=32m  -XX&#58;MaxPermSize=128m
          WLS Production Mode=
          === Debugging ===
          This window is necessary for debugging code using WebLogic Workshop
          .
          .
          CLASSPATH=D&#58;\bin\bea\WEBLOG~1\server\lib\weblogic_knex_patch.jar;D&#58;\bin\bea\WEBL
          OG~1\common\lib\log4j.jar;D&#58;\bin\bea\WEBLOG~1\server\lib\debugging.jar;D&#58;\bin\be
          a\WEBLOG~1\server\lib\knex.jar;D&#58;\bin\bea\WEBLOG~1\javelin\lib\javelin.jar;D&#58;\bi
          n\bea\WEBLOG~1\server\lib\wlw-lang.jar;D&#58;\bin\bea\JDK141~1\lib\tools.jar;D&#58;\bin\
          bea\WEBLOG~1\server\lib\weblogic_sp.jar;D&#58;\bin\bea\WEBLOG~1\server\lib\weblogic.
          jar;D&#58;\bin\bea\WEBLOG~1\server\lib\ojdbc14.jar;D&#58;\bin\bea\WEBLOG~1\server\lib\an
          t\ant.jar;D&#58;\bin\bea\JDK141~1\jre\lib\rt.jar;;D&#58;\bin\bea\WEBLOG~1\common\eval\po
          intbase\lib\pbserver44.jar;D&#58;\bin\bea\WEBLOG~1\common\eval\pointbase\lib\pbclien
          t44.jar;D&#58;\bin\bea\WEBLOG~1\server\lib\webserviceclient.jar;D&#58;\bin\bea\WEBLOG~1\
          server\lib\webserviceclient+ssl.jar;D&#58;\bin\bea\WEBLOG~1\server\lib\xbean.jar;D&#58;\
          bin\bea\WEBLOG~1\server\lib\wlxbean.jar;D&#58;\bin\bea\WEBLOG~1\server\lib\xqrl.jar;
          D&#58;\bin\bea\WEBLOG~1\server\lib\netui\netui-compiler.jar;D&#58;\bin\bea\WEBLOG~1\serv
          er\lib\wli.jar;D&#58;\bin\bea\WEBLOG~1\server\lib\fop.jar;D&#58;\bin\bea\WEBLOG~1\integr
          ation\adapters\sample\lib\sample-eis.jar;
          .
          PATH=D&#58;\bin\bea\WEBLOG~1\server\bin;D&#58;\bin\bea\WEBLOG~1\server\bin;D&#58;\bin\bea\JD
          K141~1\jre\bin;D&#58;\bin\bea\JDK141~1\bin;D&#58;\bin\j2sdk1.4.2_05\bin;C&#58;\WINDOWS\syste
          m32;C&#58;\WINDOWS;C&#58;\WINDOWS\System32\Wbem;C&#58;\Program Files\ATI Technologies\ATI 
          Control Panel;C&#58;\Program Files\Attachmate\E!E2K\;H&#58;\Notes\Data;C&#58;\Program Files\Fi
          chiers communs\Roxio Shared\DLLShared;D&#58;\bin\bea\WEBLOG~1\server\bin\oci920_8
          .
          ***************************************************
          *  To start WebLogic Server, use a username and   *
          *  password assigned to an admin-level user.  For *
          *  server administration, use the WebLogic Server *
          *  console at http&#58;\\hostname&#58;port\console        *
          ***************************************************
          starting weblogic with Java version&#58;
          java version "1.4.1_05"
          Java&#40;TM&#41; 2 Runtime Environment, Standard Edition &#40;build 1.4.1_05-b01&#41;
          Java HotSpot&#40;TM&#41; Client VM &#40;build 1.4.1_05-b01, mixed mode&#41;
          Starting WLS with line&#58;
          D&#58;\bin\bea\JDK141~1\bin\java -client -Xdebug -Xnoagent -Xrunjdwp&#58;transport=dt_so
          cket,address=8453,server=y,suspend=n -Djava.compiler=NONE  -Xms256m -Xmx256m -XX
          &#58;CompileThreshold=8000 -XX&#58;PermSize=32m  -XX&#58;MaxPermSize=128m  -Xverify&#58;none -ea
           -da&#58;com.bea... -da&#58;javelin... -da&#58;weblogic... -Dplatform.home=D&#58;\bin\bea\WEBLOG
          ~1 -Dwls.home=D&#58;\bin\bea\WEBLOG~1\server -Dwli.home=D&#58;\bin\bea\WEBLOG~1\integrat
          ion  -Dlog4j.configuration=file&#58;D&#58;\bin\bea\WEBLOG~1\common\lib\workshopLogCfg.xm
          l -Dweblogic.management.discover=true  -Dweblogic.security.SSL.ignoreHostnameVer
          ify=false -Dwlw.iterativeDev=true -Dwlw.testConsole=true -Dwlw.logErrorsToConsol
          e=true -Dweblogic.Name=serverWorkshop -Dweblogic.ProductionModeEnabled= -Djava.s
          ecurity.policy=D&#58;\bin\bea\WEBLOG~1\server\lib\weblogic.policy   weblogic.Server
          <7 dc. 2004 09.23. h CET> <Info> <WebLogicServer> <BEA-000377> <Starting WebLog
          ic Server with Java HotSpot&#40;TM&#41; Client VM Version 1.4.1_05-b01 from Sun Microsys
          tems Inc.>
          <7 dc. 2004 09.23. h CET> <Info> <Configuration Management> <BEA-150016> <This
          server is being started as the administration server.>
          ...

          Comment


          • #6
            Did any of those classpath locations contain a spring*.jar or acegi*.jar? That might explain the error a little more.

            Re SourceForge, their CVS servers are widely known to have problems. They're doing an upgrade at present. There is no ZIP download available, only the full CVS tarball which isn't useful directly.

            I plan on releasing 0.7.0 very soon, so if you can wait for that, it might be easiest.

            The root cause of your problem is not an Acegi Security error. The exception is coming from FilterToBeanProxy which simply uses WebApplicationContextUtils.getRequiredWebApplicati onContext(). The WebApplicationContextUtils needs to find the application context, which it usually can because of your <listener> registration in web.xml.

            Perhaps try using ContextLoaderServlet (see Spring documentation) instead of ContextLoaderListener. Also see http://forum.springframework.org/sho...tloaderservlet and http://forum.springframework.org/sho...tloaderservlet and http://forum.springframework.org/sho...tloaderservlet.
            Last edited by robyn; May 14th, 2006, 05:40 PM.

            Comment


            • #7
              I have contacted BEA support and I have some good news:
              - Contacts 0.6.1 indeed does not work with BEA WebLogic 8.1 SP2
              - but does work (as is) with BEA WebLogic 8.1 SP3
              .... gees...
              It seems WebLogic 8.1 SP2 does not handle correctly the use of both Filters and Spring's Listener (or ContextLoaderServlet which I also tested).

              Thanks for your help and sorry for the inconvenience.

              Eager to try out Acegi 0.7 + LDAP stuff.

              Comment


              • #8
                Excellent! Thanks for letting us know it is a known issue what that particular version. Hope you find the project suits your needs now you can run it.

                Comment


                • #9
                  ?? Fix?

                  what did you have to do to get it working in WebLogic 8.1 SP2????
                  i can't upgrade to SP3 right now..
                  thanks

                  Comment


                  • #10
                    With SP2, you must use ContextLoaderServlet.

                    Comment

                    Working...
                    X