Announcement Announcement Module
Collapse
No announcement yet.
ContextLoaderListener and Oracle10gAS Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • ContextLoaderListener and Oracle10gAS

    Has anyone tried the ContextLoaderListener with a web app on Oracle10g App Server? (I couldn't use it in WebSphere). We're preparing to port our app and would rather use the Listener than the Servlet.

    Thanks.

    Going from Java 1.3 to 1.4 won't hurt my feelings, either.

  • #2
    No problem with this under JDK 1.4.2 and OC4J 10.0.3 or 9.0.4. Here are the relavent bits from my web.xml (basically as per the jPetStore example app):

    Code:
    	<!--
    	  - Location of the XML file that defines the root application context.
    	  -->
    	<context-param>
    		<param-name>contextConfigLocation</param-name>
    		<param-value>/WEB-INF/applicationContext.xml</param-value>
    	</context-param>
    
    	<listener>
    		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    	</listener>
    Chris

    Comment


    • #3
      Cool beans! 8) Thanks Chris.

      Comment


      • #4
        Originally posted by Chris
        No problem with this under JDK 1.4.2 and OC4J 10.0.3 or 9.0.4. Here are the relavent bits from my web.xml (basically as per the jPetStore example app):

        Code:
        	<!--
        	  - Location of the XML file that defines the root application context.
        	  -->
        	<context-param>
        		<param-name>contextConfigLocation</param-name>
        		<param-value>/WEB-INF/applicationContext.xml</param-value>
        	</context-param>
        
        	<listener>
        		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
        	</listener>
        Chris
        Hello Chris:

        Do you know anything about using this ContextLoaderListener in a WebLogic 6.1 (JDK 1.3.1) environment? I tried to set up both the listener and the init servlet (as the web.xml in the samples application state) and I keep getting an awful exception when the application server tries to startup:

        <9/12/2004 09:30:42 AM PST> <Error> <HTTP> <[WebAppServletContext(9248159,acrone
        t,/acronet)] Error loading servlet: "context"
        java.lang.NoSuchMethodError: org.springframework.core.io.AbstractResource: metho
        d getDescription()Ljava/lang/String; not found
        at java.lang.String.valueOf(String.java:1947)
        at java.lang.StringBuffer.append(StringBuffer
        .java:370)
        at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBea
        nDefinitions(XmlBeanDefinitionReader.java:117)
        at org.springframework.context.support.AbstractXmlApp licationContext.loa
        dBeanDefinitions(AbstractXmlApplicationContext.jav a:144)
        at org.springframework.context.support.AbstractXmlApp licationContext.ref
        reshBeanFactory(AbstractXmlApplicationContext.java :79)
        at org.springframework.context.support.AbstractApplic ationContext.refres
        h(AbstractApplicationContext.java:249)
        at org.springframework.web.context.support.XmlWebAppl icationContext.refr
        esh(XmlWebApplicationContext.java:131)
        at org.springframework.web.context.ContextLoader.crea teWebApplicationCon
        text(ContextLoader.java:167)
        at org.springframework.web.context.ContextLoader.init WebApplicationConte
        xt(ContextLoader.java:101)
        at org.springframework.web.context.ContextLoaderServl et.init(ContextLoad
        erServlet.java:80)
        at javax.servlet.GenericServlet.init(GenericServlet.j ava:258)
        at weblogic.servlet.internal.ServletStubImpl.createSe rvlet(ServletStubIm
        pl.java:731)
        at weblogic.servlet.internal.ServletStubImpl.createIn stances(ServletStub
        Impl.java:658)
        at weblogic.servlet.internal.ServletStubImpl.prepareS ervlet(ServletStubI
        mpl.java:603)
        at weblogic.servlet.internal.WebAppServletContext.pre loadServlet(WebAppS
        ervletContext.java:2360)
        at weblogic.servlet.internal.WebAppServletContext.pre loadServlets(WebApp
        ServletContext.java:2301)
        at weblogic.servlet.internal.HttpServer.preloadServle ts(HttpServer.java:
        558)
        at weblogic.servlet.internal.WebService.preloadServle ts(WebService.java:
        450)
        at weblogic.t3.srvr.ServletInitRunner.run(ServletInit Runner.java:49)
        at java.lang.Thread.run(Thread.java:484)
        >
        javax.servlet.ServletException: Servlet class: 'org.springframework.web.context.
        ContextLoaderServlet' could not be handled by the ClassLoader
        at weblogic.servlet.internal.ServletStubImpl.prepareS ervlet(ServletStubI
        mpl.java:637)
        at weblogic.servlet.internal.WebAppServletContext.pre loadServlet(WebAppS
        ervletContext.java:2360)
        at weblogic.servlet.internal.WebAppServletContext.pre loadServlets(WebApp
        ServletContext.java:2301)
        at weblogic.servlet.internal.HttpServer.preloadServle ts(HttpServer.java:
        558)
        at weblogic.servlet.internal.WebService.preloadServle ts(WebService.java:
        450)
        at weblogic.t3.srvr.ServletInitRunner.run(ServletInit Runner.java:49)
        at java.lang.Thread.run(Thread.java:484)

        Comment


        • #5
          Hi,

          I think you can ignore the horrible error at the top, it is just a consequence of the ContextLoaderServlet servlet failing to load at server startup (see bottom of your stack trace). The javadoc for this servlet makes interesting reading:

          http://www.springframework.org/docs/...erServlet.html

          I cannot help you specifically with this as we run WLS 8.1sp3 here. You should probably create a new Forum message with a title something like 'ContextLoaderServlet failure in Weblogic 6.1'.

          regards,
          Chris

          Comment


          • #6
            Thank you

            Thanks a lot Chris, I'll do what you told me...

            Carlos Morales

            Comment

            Working...
            X