You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Shelli Orton <Sh...@sjrb.ca> on 2010/09/29 00:49:55 UTC
Deploy Wicket App as Liferay Portlet
I am trying to deploy a Wicket application as a portlet in Liferay 5.2.3
bundled with Tomcat 6.0. I found this which has been very helpful:
http://mail-archives.apache.org/mod_mbox/wicket-users/201001.mbox/browse
r
<http://mail-archives.apache.org/mod_mbox/wicket-users/201001.mbox/brows
er>
When I tried to add the application to my portal, this error was thrown:
Sep 28, 2010 4:42:18 PM org.apache.catalina.core.ApplicationDispatcher
invoke
SEVERE: Servlet.service() for servlet MyApp threw exception
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1937)
at
org.apache.wicket.protocol.http.portlet.PortletServletRequestWrapper.mak
eServletPath(PortletServletRequestWrapper.java:71)
...
I thought this may have something to do with the url-pattern on my
filter-mapping. Initially I set my web.xml to have this:
<filter-mapping>
<filter-name>MyApp</filter-name>
<url-pattern>/myApp</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>INCLUDE</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>
and my portlet.xml to have:
<portlet>
<description>My App</description>
<portlet-name>MyApp</portlet-name>
<display-name>MyApp</display-name>
<portlet-class>org.apache.wicket.protocol.http.portlet.WicketPortlet</po
rtlet-class>
<init-param>
<name>wicketFilterPath</name>
<value>/myApp</value>
</init-param>
...
</portlet>
So, I changed my web.xml to:
<filter-mapping>
<filter-name>MyApp</filter-name>
<url-pattern>/myApp</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>INCLUDE</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>
and my portlet.xml to:
<portlet>
<description>My App</description>
<portlet-name>MyApp</portlet-name>
<display-name>MyApp</display-name>
<portlet-class>org.apache.wicket.protocol.http.portlet.WicketPortlet</po
rtlet-class>
<init-param>
<name>wicketFilterPath</name>
<value>/myApp</value>
</init-param>
...
</portlet>
Unfortunately, that resulted in this error when trying to deploy the
application (and then it gets undeployed):
SEVERE: Exception starting filter MyApp
java.lang.IllegalArgumentException: <filter-mapping> for WicketFilter
"MyApp" must start with '/' and end with '*'.
at
org.apache.wicket.protocol.http.WicketFilter.getFilterPath(WicketFilter.
java:944)
at
org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:682)
at
org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFi
lterConfig.java:275)
at
org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(Applicatio
nFilterConfig.java:397)
at
org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilte
rConfig.java:108)
at
org.apache.catalina.core.StandardContext.filterStart(StandardContext.jav
a:3709)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4363
)
at
org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:11
16)
at
org.apache.catalina.startup.HostConfig.check(HostConfig.java:1214)
at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:29
3)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSu
pport.java:117)
at
org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.j
ava:1337)
at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.proc
essChildren(ContainerBase.java:1601)
at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.proc
essChildren(ContainerBase.java:1610)
at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(
ContainerBase.java:1590)
at java.lang.Thread.run(Thread.java:619)
Does anyone know what could have caused the initial error assuming it
wasn't caused by the url-pattern/wicketFilterPath?
Any insight is great appreciated,
Shelli
RE: Deploy Wicket App as Liferay Portlet
Posted by Shelli Orton <Sh...@sjrb.ca>.
Of course, as soon as I send this, I find the solution...
Apparently Wicket portlets require a URL pattern like this:
<url-pattern>/myApp/*</url-pattern>
Shelli
-----Original Message-----
From: Shelli Orton
Sent: Tuesday, September 28, 2010 4:50 PM
To: users@wicket.apache.org
Subject: Deploy Wicket App as Liferay Portlet
I am trying to deploy a Wicket application as a portlet in Liferay 5.2.3
bundled with Tomcat 6.0. I found this which has been very helpful:
http://mail-archives.apache.org/mod_mbox/wicket-users/201001.mbox/browse
r
<http://mail-archives.apache.org/mod_mbox/wicket-users/201001.mbox/brows
er>
When I tried to add the application to my portal, this error was thrown:
Sep 28, 2010 4:42:18 PM org.apache.catalina.core.ApplicationDispatcher
invoke
SEVERE: Servlet.service() for servlet MyApp threw exception
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1937)
at
org.apache.wicket.protocol.http.portlet.PortletServletRequestWrapper.mak
eServletPath(PortletServletRequestWrapper.java:71)
...
I thought this may have something to do with the url-pattern on my
filter-mapping. Initially I set my web.xml to have this:
<filter-mapping>
<filter-name>MyApp</filter-name>
<url-pattern>/myApp</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>INCLUDE</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>
and my portlet.xml to have:
<portlet>
<description>My App</description>
<portlet-name>MyApp</portlet-name>
<display-name>MyApp</display-name>
<portlet-class>org.apache.wicket.protocol.http.portlet.WicketPortlet</po
rtlet-class>
<init-param>
<name>wicketFilterPath</name>
<value>/myApp</value>
</init-param>
...
</portlet>
So, I changed my web.xml to:
<filter-mapping>
<filter-name>MyApp</filter-name>
<url-pattern>/myApp</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>INCLUDE</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>
and my portlet.xml to:
<portlet>
<description>My App</description>
<portlet-name>MyApp</portlet-name>
<display-name>MyApp</display-name>
<portlet-class>org.apache.wicket.protocol.http.portlet.WicketPortlet</po
rtlet-class>
<init-param>
<name>wicketFilterPath</name>
<value>/myApp</value>
</init-param>
...
</portlet>
Unfortunately, that resulted in this error when trying to deploy the
application (and then it gets undeployed):
SEVERE: Exception starting filter MyApp
java.lang.IllegalArgumentException: <filter-mapping> for WicketFilter
"MyApp" must start with '/' and end with '*'.
at
org.apache.wicket.protocol.http.WicketFilter.getFilterPath(WicketFilter.
java:944)
at
org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:682)
at
org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFi
lterConfig.java:275)
at
org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(Applicatio
nFilterConfig.java:397)
at
org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilte
rConfig.java:108)
at
org.apache.catalina.core.StandardContext.filterStart(StandardContext.jav
a:3709)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4363
)
at
org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:11
16)
at
org.apache.catalina.startup.HostConfig.check(HostConfig.java:1214)
at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:29
3)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSu
pport.java:117)
at
org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.j
ava:1337)
at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.proc
essChildren(ContainerBase.java:1601)
at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.proc
essChildren(ContainerBase.java:1610)
at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(
ContainerBase.java:1590)
at java.lang.Thread.run(Thread.java:619)
Does anyone know what could have caused the initial error assuming it
wasn't caused by the url-pattern/wicketFilterPath?
Any insight is great appreciated,
Shelli
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org