Hi,
We are working on an web calendar application,
webical<http://webical.org/twiki>.
We ran into a problem today while deploying a new demo. When I try to access
the application I get the following exception:
2006-12-16 18:23:29,805 ERROR StandardWrapperValve - Allocate exception for
servlet wicket
java.lang.IllegalStateException: WicketServlet cannot be changed once it is
set
at wicket.protocol.http.WebApplication.setWicketServlet(
WebApplication.java:400)
at wicket.protocol.http.WicketServlet.init(WicketServlet.java:283)
at javax.servlet.GenericServlet.init(GenericServlet.java:211)
at org.apache.catalina.core.StandardWrapper.loadServlet(
StandardWrapper.java:1091)
at org.apache.catalina.core.StandardWrapper.allocate(
StandardWrapper.java:750)
at org.apache.catalina.core.StandardWrapperValve.invoke(
StandardWrapperValve.java:130)
at org.apache.catalina.core.StandardContextValve.invoke(
StandardContextValve.java:178)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(
AuthenticatorBase.java:514)
at org.apache.catalina.core.StandardHostValve.invoke(
StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(
ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(
StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(
CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(
Http11Processor.java:868)
at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection
(Http11BaseProtocol.java:663)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(
PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(
LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(
ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
The app runs just fine in eclipse with wtp, but when I create a war with
maven it doesn't work. We are using wicket 1.2.3 with spring 2.0. I've
attached our pom.xml, web.xml and applicationContext.xml. The code is also
accessible in svn <http://webical.svn.sourceforge.net/viewvc/webical/trunk/>
.
Does anybody know what the problem could be? I can't find this problem
anywhere on google..
Thanks in advance,
Ivo van Dongen
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<!--
The WebApplication bean, injected into the wicket servlet
-->
<bean id="wicketApplication" class="org.webical.web.app.WebicalWebApplication">
<!-- additional resourcePaths -->
<property name="resourcePaths">
<map>
<!-- Default entry -->
<entry>
<key><value>additionalResources</value></key>
<value type="java.lang.Boolean">TRUE</value>
</entry>
</map>
</property>
</bean>
<!--
Plugin system
-->
<!-- The Plugin intializer -->
<bean id="pluginSystemInitializer" class="org.webical.plugin.registration.PluginSystemInitializer">
<!-- Set to use the plugins
<property name="pluginPaths">
<list>
<value>/path/to/the/plugin/packages</value>
</list>
</property>
-->
<property name="pluginWorkPath"><value>/tmp</value></property>
<property name="webicalWebApplication"><ref bean="wicketApplication" /></property>
<property name="pluginPackageExtension"><value>.zip</value></property>
<property name="pluginManifestReader"><ref bean="pluginManifestReader" /></property>
<property name="daoFactory"><ref bean="daoFactory" /></property>
</bean>
<!-- The manifest reader -->
<bean id="pluginManifestReader" class="org.webical.plugin.xml.PluginManifestReader">
<!-- Resource property, relative to the webroot -->
<property name="webicalPluginSchemaSource"><value>/xsd/plugin.xsd</value></property>
</bean>
<!-- Cleans up the working directories on context stop (uncomment to cleanup on shutdown)
<bean id="pluginCleanupApplicationListener" class="org.webical.plugin.file.PluginCleanupApplicationListener">
<property name="pluginSystemInitializer"><ref bean="pluginSystemInitializer"/></property>
</bean>
-->
<!--
Reference tot the datasource for hibernate in the jndi context, configurable in the Context
-->
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName"><value>java:comp/env/jdbc/calendarDataBase</value></property>
</bean>
<!--
Hibernate configuration
-->
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource"><ref bean="dataSource"/></property>
<!-- List of mapping files, use the relative path. All mapping files must be placed in the resources folder -->
<property name="mappingResources">
<list>
<value>org/webical/User.hbm.xml</value>
<value>org/webical/Calendar.hbm.xml</value>
<value>org/webical/Event.hbm.xml</value>
<value>org/webical/RecurrenceRule.hbm.xml</value>
</list>
</property>
<!-- General hibernate settings -->
<property name="hibernateProperties">
<props>
<!-- Sets the dialect for the database, change this to the appropriate dialect -->
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
<prop key="hibernate.query.substitutions">true=1 false=0</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.format_sql">true</prop>
<prop key="hibernate.max_fetch_depth">1</prop>
<!-- set to validate for production -->
<prop key="hibernate.hbm2ddl.auto">validate</prop>
<prop key="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</prop>
</props>
</property>
</bean>
<!--
Transactionmanager setup
-->
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory"><ref bean="sessionFactory"/></property>
</bean>
<!--
Managers
-->
<bean id="calendarManager" class="org.webical.manager.impl.CalendarManagerImpl">
<property name="daoFactory"><ref bean="daoFactory"/></property>
<property name="calendarDao"><ref bean="calendarDao" /></property>
</bean>
<bean id="userManager" class="org.webical.manager.impl.UserManagerImpl">
<property name="userDao"><ref bean="userDao" /></property>
</bean>
<bean id="eventManager" class="org.webical.manager.impl.EventManagerImpl">
<property name="daoFactory"><ref bean="daoFactory" /></property>
<property name="calendarManager"><ref bean="calendarManager" /></property>
</bean>
<!--
Daos
-->
<bean id="calendarDao" class="org.webical.dao.impl.CalendarDaoHibernateImpl" >
<property name="sessionFactory"><ref bean="sessionFactory" /></property>
</bean>
<bean id="userDao" class="org.webical.dao.impl.UserDaoHibernateImpl" >
<property name="sessionFactory"><ref bean="sessionFactory" /></property>
</bean>
<bean id="eventDaoWebDavHibernateBufferedImpl" class="org.webical.dao.impl.EventDaoWebDavHibernateBufferedImpl">
<property name="sessionFactory"><ref bean="sessionFactory" /></property>
<property name="calendarRefreshTimeMs" value="300000"></property>
</bean>
<!--
DaoFactory, can be initialized with an initial list of Dao registrations
-->
<bean id="daoFactory" singleton="true" class="org.webical.dao.factory.DaoFactory">
<property name="eventDaoRegistrations">
<map>
<entry key="ical-webdav" value-ref="eventDaoWebDavHibernateBufferedImpl" />
</map>
</property>
</bean>
</beans>
<?xml version="1.0" encoding="UTF-8"?>
<web-app 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>webiCal</display-name>
<!--
Wicket configuration, the application class is injected by spring
-->
<servlet>
<servlet-name>wicket</servlet-name>
<servlet-class>wicket.protocol.http.WicketServlet</servlet-class>
<init-param>
<param-name>applicationFactoryClassName</param-name>
<param-value>wicket.spring.SpringWebApplicationFactory</param-value>
</init-param>
<init-param>
<param-name>environment</param-name>
<param-value>deployment</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>wicket</servlet-name>
<url-pattern>/app/*</url-pattern>
</servlet-mapping>
<!--
Spring configuration
-->
<!-- Configure the location of the Spring configuration file (multiple files can be used) -->
<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>
<!-- OpenSessionInViewFilter -->
<filter>
<filter-name>sessionFilter</filter-name>
<filter-class>org.webical.web.util.WriteableOpenSessionInViewFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>sessionFilter</filter-name>
<url-pattern>/app/*</url-pattern>
</filter-mapping>
<!--
Security configuration
-->
<login-config>
<!-- form based authentication, works with the authentication realm -->
<auth-method>FORM</auth-method>
<realm-name>Webical Calendar Application</realm-name>
<form-login-config>
<form-login-page>/login.jsp</form-login-page>
<form-error-page>/fail_login.html</form-error-page>
</form-login-config>
</login-config>
<security-constraint>
<web-resource-collection>
<web-resource-name>SecurityRestriction</web-resource-name>
<description>Webical security</description>
<url-pattern>/app/*</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>webicaluser</role-name>
</auth-constraint>
</security-constraint>
<security-role>
<description>Webical User</description>
<role-name>webicaluser</role-name>
</security-role>
<!-- JNDI resources, configured in the J2EE container (WSAS / Tomcat / ..) -->
<resource-env-ref>
<description>DB Connection</description>
<resource-env-ref-name>jdbc/calendarDataBase</resource-env-ref-name>
<resource-env-ref-type>javax.sql.DataSource</resource-env-ref-type>
</resource-env-ref>
</web-app>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.webical.calendar</groupId>
<artifactId>webical</artifactId>
<packaging>war</packaging>
<version>0.1</version>
<name>webical</name>
<url>http://webical.org/twiki</url>
<developers>
<developer>
<id>paul</id>
<name>Paul Maarschalkerweerd</name>
<email>[EMAIL PROTECTED]</email>
<organization>HU</organization>
<organizationUrl>http://www.hu.nl</organizationUrl>
<roles>
<role>Senior Developer</role>
</roles>
</developer>
<developer>
<id>jochem</id>
<name>Jochem Kolthof</name>
<email>[EMAIL PROTECTED]</email>
<organization>HU</organization>
<organizationUrl>http://www.hu.nl</organizationUrl>
<roles>
<role>Senior Developer</role>
</roles>
</developer>
<developer>
<id>ivo</id>
<name>Ivo van Dongen</name>
<email>[EMAIL PROTECTED]</email>
<organization>Func. Internet Integration</organization>
<organizationUrl>http://www.func.nl</organizationUrl>
<roles>
<role>Senior Developer</role>
</roles>
</developer>
</developers>
<!--
svn connectivity
use: mvn scm:update to update the project sources
use: mvn scm:checkin to commit the project sources
-->
<scm>
<connection>
scm:svn:https://svn.sourceforge.net/svnroot/webical/trunk
</connection>
</scm>
<!-- used repositories -->
<repositories>
<repository>
<id>Codehaus</id>
<name>Codehaus</name>
<url>http://repository.codehaus.org</url>
</repository>
<repository>
<id>Ibiblio</id>
<name>Ibiblio</name>
<url>http://www.ibiblio.org/maven2</url>
</repository>
</repositories>
<!-- the build configuration -->
<build>
<finalName>ROOT</finalName>
<plugins>
<!-- Inform the compiler we use java 1.5 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<!--
Jaxb source generation
-->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>xjc</goal>
</goals>
</execution>
</executions>
<configuration>
<packageName>org.webical.plugin.jaxb</packageName> <!-- The name of your generated source package -->
<schemaDirectory>${basedir}/src/main/webapp/xsd</schemaDirectory>
</configuration>
</plugin>
</plugins>
</build>
<!-- used dependencies -->
<dependencies>
<!--
Test dependencies
-->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>dbunit</groupId>
<artifactId>dbunit</artifactId>
<version>2.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-configuration</groupId>
<artifactId>commons-configuration</artifactId>
<version>1.2</version>
<scope>test</scope>
</dependency>
<!--
Runtime dependencies
-->
<!-- wicket -->
<dependency>
<groupId>wicket</groupId>
<artifactId>wicket</artifactId>
<version>1.2.3</version>
</dependency>
<dependency>
<groupId>wicket</groupId>
<artifactId>wicket-spring</artifactId>
<version>1.2.3</version>
</dependency>
<dependency>
<groupId>wicket</groupId>
<artifactId>wicket-spring-annot</artifactId>
<version>1.2.3</version>
</dependency>
<dependency>
<groupId>wicket</groupId>
<artifactId>wicket-extensions</artifactId>
<version>1.2.3</version>
</dependency>
<!-- MySQL -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.0.3</version>
</dependency>
<!-- Hibernate 3 -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
<version>3.1.3</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.1</version>
</dependency>
<!-- WebDAV -->
<dependency>
<groupId>slide</groupId>
<artifactId>slide-webdavlib</artifactId>
<version>2.1</version>
</dependency>
<!-- iCal4J -->
<dependency>
<groupId>ical4j</groupId>
<artifactId>ical4j</artifactId>
<version>0.9.20</version>
</dependency>
<!-- Jaxb -->
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.0.3</version>
</dependency>
</dependencies>
</project>
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user