You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Cyrille37 <cy...@gmail.com> on 2006/11/23 10:07:48 UTC
Hivemind and Spring application context...
Hello,
I'm very sorry to could not get running Tapestry+Spring by my self.
I've read some posts on forums and references documents but startup
steel throwing an exception:
org.apache.hivemind.ApplicationRuntimeException: Could not locate the
Spring application context. Most likely, you did not initialize a
ContextLoaderListener inside your web.xml deployment descriptor.
at
com.javaforge.tapestry.spring.SpringApplicationInitializer.initialize(SpringApplicationInitializer.java:45)
Here are my configuration files :
=========== web.xml ===========
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>Tapestry02</display-name>
<!-- Beg: Spring integration -->
<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>
<!-- End: Spring integration -->
<filter>
<filter-name>redirect</filter-name><filter-class>org.apache.tapestry.RedirectFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>redirect</filter-name><url-pattern>/</url-pattern>
</filter-mapping>
<servlet>
<servlet-name>tapestry02AppServlet</servlet-name>
<servlet-class>org.apache.tapestry.ApplicationServlet</servlet-class>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>tapestry02AppServlet</servlet-name>
<url-pattern>/app</url-pattern>
</servlet-mapping>
<!-- Beg: Friendly URLs -->
<servlet-mapping>
<servlet-name>tapestry02AppServlet</servlet-name><url-pattern>*.html</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>tapestry02AppServlet</servlet-name><url-pattern>*.direct</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>tapestry02AppServlet</servlet-name><url-pattern>*.sdirect</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>tapestry02AppServlet</servlet-name><url-pattern>*.svc</url-pattern>
</servlet-mapping>
<!-- End: Friendly URLs -->
<welcome-file-list>
<welcome-file>Home.html</welcome-file>
</welcome-file-list>
</web-app>
=========== hivemodule.xml ===========
<?xml version="1.0" encoding="UTF-8"?>
<module id="tapestry02" version="1.0.0" package="tapestry02">
<!-- Beg: Spring integration -->
<service-point
id="SpringApplicationInitializer"
interface="org.apache.tapestry.services.ApplicationInitializer"
visibility="private">
<invoke-factory>
<construct
class="com.javaforge.tapestry.spring.SpringApplicationInitializer">
<set-object
property="beanFactoryHolder"
value="service:hivemind.lib.DefaultSpringBeanFactoryHolder"/>
</construct>
</invoke-factory>
</service-point>
<!--Hook the Spring setup into the overall application
initialization.-->
<contribution
configuration-id="tapestry.init.ApplicationInitializers">
<command
id="spring-context"
object="service:SpringApplicationInitializer"/>
</contribution>
<!-- End: Spring integration -->
<!-- Friendly URLs -->
<contribution configuration-id="tapestry.url.ServiceEncoders">
<page-service-encoder id="page" extension="html" service="page"/>
<direct-service-encoder id="direct" stateless-extension="direct"
stateful-extension="sdirect"/>
<extension-encoder id="extension" extension="svc" after="*"/>
</contribution>
</module>
=========== tapestry02AppServlet.application ===========
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE application PUBLIC
"-//Apache Software Foundation//Tapestry Specification 4.0//EN"
"http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd">
<application>
<meta key="org.apache.tapestry.page-class-packages"
value="tapestry02.pages"/>
<meta key="org.apache.tapestry.component-class-packages"
value="tapestry02.components"/>
<meta key="org.apache.tapestry.bean-class-packages"
value="tapestry02.beans"/>
<!-- developpement specific
also add a JVM option for the Server start :
-Dorg.apache.tapestry.disable-caching=true
look at http://wiki.apache.org/tapestry/HowToSetupEclipseWtp
chapter "8. Disable Caching of Tapestry files"
-->
<meta key="org.apache.tapestry.disable-caching" value="true"/>
<library id="contrib"
specification-path="classpath:/org/apache/tapestry/contrib/Contrib.library"/>
</application>
=========== applicationContext.xml ===========
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTDBEAN2.0//EN"
"http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
</beans>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Hivemind and Spring application context...
Posted by Bill Holloway <bi...@gmail.com>.
I'm not sure that in your context-param in web.xml that "globbing" is
supported -- namely putting the "*" wildcard character in
applicationContext*.xml.
You can include other spring bean context fields from
applicationContext.xml. I'd try that as a first approach.
Cheers,
Bill
On 11/23/06, Cyrille37 <cy...@gmail.com> wrote:
> Hi,
>
> The following exception is occurring at startup, but bean injection is
> working fine.
>
> I'd forgot to tell my software configuration : Tapestry 4.0.2 + Spring 2
> + TapestrySpring 1.0.0SNAPSHOT
>
> The startup exception is :
>
> org.apache.hivemind.ApplicationRuntimeException: Could not locate the
> Spring application context. Most likely, you did not initialize a
> ContextLoaderListener inside your web.xml deployment descriptor.
> at
> com.javaforge.tapestry.spring.SpringApplicationInitializer.initialize(SpringApplicationInitializer.java:45)
>
>
> Cyrille.
>
> Cyrille37 a écrit :
> > Hello,
> > I'm very sorry to could not get running Tapestry+Spring by my self.
> > I've read some posts on forums and references documents but startup
> > steel throwing an exception:
> >
> > org.apache.hivemind.ApplicationRuntimeException: Could not locate the
> > Spring application context. Most likely, you did not initialize a
> > ContextLoaderListener inside your web.xml deployment descriptor.
> > at
> > com.javaforge.tapestry.spring.SpringApplicationInitializer.initialize(SpringApplicationInitializer.java:45)
> >
> >
> > Here are my configuration files :
> >
> > =========== web.xml ===========
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <web-app id="WebApp_ID" version="2.4"
> > xmlns="http://java.sun.com/xml/ns/j2ee"
> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> > xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
> > http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
> >
> > <display-name>Tapestry02</display-name>
> >
> > <!-- Beg: Spring integration -->
> > <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>
> > <!-- End: Spring integration -->
> >
> >
> > <filter>
> >
> > <filter-name>redirect</filter-name><filter-class>org.apache.tapestry.RedirectFilter</filter-class>
> >
> > </filter>
> > <filter-mapping>
> > <filter-name>redirect</filter-name><url-pattern>/</url-pattern>
> > </filter-mapping>
> >
> > <servlet>
> > <servlet-name>tapestry02AppServlet</servlet-name>
> > <servlet-class>org.apache.tapestry.ApplicationServlet</servlet-class>
> > <load-on-startup>0</load-on-startup>
> > </servlet>
> >
> > <servlet-mapping>
> > <servlet-name>tapestry02AppServlet</servlet-name>
> > <url-pattern>/app</url-pattern>
> > </servlet-mapping>
> >
> > <!-- Beg: Friendly URLs -->
> > <servlet-mapping>
> >
> > <servlet-name>tapestry02AppServlet</servlet-name><url-pattern>*.html</url-pattern>
> >
> > </servlet-mapping>
> > <servlet-mapping>
> >
> > <servlet-name>tapestry02AppServlet</servlet-name><url-pattern>*.direct</url-pattern>
> >
> > </servlet-mapping>
> > <servlet-mapping>
> >
> > <servlet-name>tapestry02AppServlet</servlet-name><url-pattern>*.sdirect</url-pattern>
> >
> > </servlet-mapping>
> > <servlet-mapping>
> >
> > <servlet-name>tapestry02AppServlet</servlet-name><url-pattern>*.svc</url-pattern>
> >
> > </servlet-mapping>
> > <!-- End: Friendly URLs -->
> >
> > <welcome-file-list>
> > <welcome-file>Home.html</welcome-file>
> > </welcome-file-list>
> >
> > </web-app>
> >
> > =========== hivemodule.xml ===========
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> >
> > <module id="tapestry02" version="1.0.0" package="tapestry02">
> >
> > <!-- Beg: Spring integration -->
> > <service-point
> > id="SpringApplicationInitializer"
> > interface="org.apache.tapestry.services.ApplicationInitializer"
> > visibility="private">
> > <invoke-factory>
> > <construct
> >
> > class="com.javaforge.tapestry.spring.SpringApplicationInitializer">
> > <set-object
> > property="beanFactoryHolder"
> >
> > value="service:hivemind.lib.DefaultSpringBeanFactoryHolder"/>
> > </construct>
> > </invoke-factory>
> > </service-point>
> > <!--Hook the Spring setup into the overall application
> > initialization.-->
> > <contribution
> > configuration-id="tapestry.init.ApplicationInitializers">
> > <command
> > id="spring-context"
> > object="service:SpringApplicationInitializer"/>
> > </contribution>
> > <!-- End: Spring integration -->
> >
> > <!-- Friendly URLs -->
> > <contribution configuration-id="tapestry.url.ServiceEncoders">
> > <page-service-encoder id="page" extension="html" service="page"/>
> > <direct-service-encoder id="direct"
> > stateless-extension="direct" stateful-extension="sdirect"/>
> > <extension-encoder id="extension" extension="svc" after="*"/>
> > </contribution>
> >
> > </module>
> >
> > =========== tapestry02AppServlet.application ===========
> >
> > <?xml version="1.0" encoding="UTF-8" ?>
> > <!DOCTYPE application PUBLIC
> > "-//Apache Software Foundation//Tapestry Specification 4.0//EN"
> > "http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd">
> >
> > <application> <meta key="org.apache.tapestry.page-class-packages"
> > value="tapestry02.pages"/>
> > <meta key="org.apache.tapestry.component-class-packages"
> > value="tapestry02.components"/>
> > <meta key="org.apache.tapestry.bean-class-packages"
> > value="tapestry02.beans"/>
> >
> > <!-- developpement specific
> > also add a JVM option for the Server start :
> > -Dorg.apache.tapestry.disable-caching=true
> > look at http://wiki.apache.org/tapestry/HowToSetupEclipseWtp
> > chapter "8. Disable Caching of Tapestry files"
> > -->
> > <meta key="org.apache.tapestry.disable-caching" value="true"/>
> >
> > <library id="contrib"
> > specification-path="classpath:/org/apache/tapestry/contrib/Contrib.library"/>
> >
> >
> > </application>
> >
> > =========== applicationContext.xml ===========
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <!DOCTYPE beans PUBLIC "-//SPRING//DTDBEAN2.0//EN"
> > "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
> > <beans>
> > </beans>
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
--
"Budgets are moral documents."
-- Ann Richards
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Hivemind and Spring application context...
Posted by Cyrille37 <cy...@gmail.com>.
Hi,
The following exception is occurring at startup, but bean injection is
working fine.
I'd forgot to tell my software configuration : Tapestry 4.0.2 + Spring 2
+ TapestrySpring 1.0.0SNAPSHOT
The startup exception is :
org.apache.hivemind.ApplicationRuntimeException: Could not locate the
Spring application context. Most likely, you did not initialize a
ContextLoaderListener inside your web.xml deployment descriptor.
at
com.javaforge.tapestry.spring.SpringApplicationInitializer.initialize(SpringApplicationInitializer.java:45)
Cyrille.
Cyrille37 a écrit :
> Hello,
> I'm very sorry to could not get running Tapestry+Spring by my self.
> I've read some posts on forums and references documents but startup
> steel throwing an exception:
>
> org.apache.hivemind.ApplicationRuntimeException: Could not locate the
> Spring application context. Most likely, you did not initialize a
> ContextLoaderListener inside your web.xml deployment descriptor.
> at
> com.javaforge.tapestry.spring.SpringApplicationInitializer.initialize(SpringApplicationInitializer.java:45)
>
>
> Here are my configuration files :
>
> =========== web.xml ===========
>
> <?xml version="1.0" encoding="UTF-8"?>
> <web-app id="WebApp_ID" version="2.4"
> xmlns="http://java.sun.com/xml/ns/j2ee"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
> http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
>
> <display-name>Tapestry02</display-name>
>
> <!-- Beg: Spring integration -->
> <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>
> <!-- End: Spring integration -->
>
>
> <filter>
>
> <filter-name>redirect</filter-name><filter-class>org.apache.tapestry.RedirectFilter</filter-class>
>
> </filter>
> <filter-mapping>
> <filter-name>redirect</filter-name><url-pattern>/</url-pattern>
> </filter-mapping>
>
> <servlet>
> <servlet-name>tapestry02AppServlet</servlet-name>
> <servlet-class>org.apache.tapestry.ApplicationServlet</servlet-class>
> <load-on-startup>0</load-on-startup>
> </servlet>
>
> <servlet-mapping>
> <servlet-name>tapestry02AppServlet</servlet-name>
> <url-pattern>/app</url-pattern>
> </servlet-mapping>
>
> <!-- Beg: Friendly URLs -->
> <servlet-mapping>
>
> <servlet-name>tapestry02AppServlet</servlet-name><url-pattern>*.html</url-pattern>
>
> </servlet-mapping>
> <servlet-mapping>
>
> <servlet-name>tapestry02AppServlet</servlet-name><url-pattern>*.direct</url-pattern>
>
> </servlet-mapping>
> <servlet-mapping>
>
> <servlet-name>tapestry02AppServlet</servlet-name><url-pattern>*.sdirect</url-pattern>
>
> </servlet-mapping>
> <servlet-mapping>
>
> <servlet-name>tapestry02AppServlet</servlet-name><url-pattern>*.svc</url-pattern>
>
> </servlet-mapping>
> <!-- End: Friendly URLs -->
>
> <welcome-file-list>
> <welcome-file>Home.html</welcome-file>
> </welcome-file-list>
>
> </web-app>
>
> =========== hivemodule.xml ===========
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <module id="tapestry02" version="1.0.0" package="tapestry02">
>
> <!-- Beg: Spring integration -->
> <service-point
> id="SpringApplicationInitializer"
> interface="org.apache.tapestry.services.ApplicationInitializer"
> visibility="private">
> <invoke-factory>
> <construct
>
> class="com.javaforge.tapestry.spring.SpringApplicationInitializer">
> <set-object
> property="beanFactoryHolder"
>
> value="service:hivemind.lib.DefaultSpringBeanFactoryHolder"/>
> </construct>
> </invoke-factory>
> </service-point>
> <!--Hook the Spring setup into the overall application
> initialization.-->
> <contribution
> configuration-id="tapestry.init.ApplicationInitializers">
> <command
> id="spring-context"
> object="service:SpringApplicationInitializer"/>
> </contribution>
> <!-- End: Spring integration -->
>
> <!-- Friendly URLs -->
> <contribution configuration-id="tapestry.url.ServiceEncoders">
> <page-service-encoder id="page" extension="html" service="page"/>
> <direct-service-encoder id="direct"
> stateless-extension="direct" stateful-extension="sdirect"/>
> <extension-encoder id="extension" extension="svc" after="*"/>
> </contribution>
>
> </module>
>
> =========== tapestry02AppServlet.application ===========
>
> <?xml version="1.0" encoding="UTF-8" ?>
> <!DOCTYPE application PUBLIC
> "-//Apache Software Foundation//Tapestry Specification 4.0//EN"
> "http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd">
>
> <application> <meta key="org.apache.tapestry.page-class-packages"
> value="tapestry02.pages"/>
> <meta key="org.apache.tapestry.component-class-packages"
> value="tapestry02.components"/>
> <meta key="org.apache.tapestry.bean-class-packages"
> value="tapestry02.beans"/>
>
> <!-- developpement specific
> also add a JVM option for the Server start :
> -Dorg.apache.tapestry.disable-caching=true
> look at http://wiki.apache.org/tapestry/HowToSetupEclipseWtp
> chapter "8. Disable Caching of Tapestry files"
> -->
> <meta key="org.apache.tapestry.disable-caching" value="true"/>
>
> <library id="contrib"
> specification-path="classpath:/org/apache/tapestry/contrib/Contrib.library"/>
>
>
> </application>
>
> =========== applicationContext.xml ===========
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE beans PUBLIC "-//SPRING//DTDBEAN2.0//EN"
> "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
> <beans>
> </beans>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org