You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by IainM <ia...@live.co.uk> on 2009/06/11 15:52:01 UTC

Error when deploying portlets beside a normal Struts2 web app?

Hi,

I have an existing Struts2 (2.1.6) web app which I would like to add a
couple of portlets to. I have added the portlet plugin and a portel.xml file
and developed a couple of plugins which I have successfully run in JBOSS
Portal. My problem is that the addition of the portlet plugin
(struts2-portlet-plugin-2.1.6) seems to break my existing web pages. For
example, when I have an action which forwards onto a very plain jsp file
that shows a form (using <s:form>) I get a NullPointerException as below:

org.apache.jasper.JasperException: java.lang.NullPointerException

org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:521)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:415)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
       etc...

root cause

java.lang.NullPointerException
	org.apache.struts2.components.UIBean.evaluateParams(UIBean.java:792)
	org.apache.struts2.components.UIBean.end(UIBean.java:510)

org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:42)

org.apache.jsp.cardSearch_jsp._jspx_meth_s_005ftextfield_005f0(cardSearch_jsp.java:583)

org.apache.jsp.cardSearch_jsp._jspx_meth_s_005fform_005f0(cardSearch_jsp.java:530)
	org.apache.jsp.cardSearch_jsp._jspService(cardSearch_jsp.java:296)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:154)

org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:186)
        etc.....

If I remove the portlet plugin (and the portlet.xml file which points to one
of the classes from the plugin) all of my original webpages work without any
issues so it's definetly the plugin that's causing a conflict.

Can I not deploy a struts2 application that includes both normal web pages
and portlets? Or is there a way around this problem. 

Any help would be greatly appreciated.

Iain.
-- 
View this message in context: http://www.nabble.com/Error-when-deploying-portlets-beside-a-normal-Struts2-web-app--tp23981728p23981728.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Error when deploying portlets beside a normal Struts2 web app?

Posted by phillips1021 <bp...@ku.edu>.
Nils-H

  Ignore my previous reply.  I was able to get the struts2-portlet-plugin
2.1.8-SNAPSHOT to build successfully and install into my local maven
repository.

  I tested the 2.1.8-SNAPSHOT in my example applications and everything
worked very well.

  Thanks again.  We look forward to the 2.1.8 release.


-- 
View this message in context: http://www.nabble.com/Error-when-deploying-portlets-beside-a-normal-Struts2-web-app--tp23981728p24228017.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Error when deploying portlets beside a normal Struts2 web app?

Posted by phillips1021 <bp...@ku.edu>.
Nils-H

Thank you for fixing this issue so quickly.

I was able to check out from subversion the Struts 2 trunk using

   svn checkout http://svn.apache.org/repos/asf/struts/struts2/trunk 

The struts2-core 2.1.8-SNAPSHOT was created by mvn install just fine.

However I got the following error when doing the mvn install on the
struts2-portlet-plugin

[ERROR] BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO] Compilation failure
C:\struts2\trunk\plugins\portlet\src\main\java\org\apache\struts2\portlet\servle
t\PortletServletContext.java:[42,7]
org.apache.struts2.portlet.servlet.PortletSe
rvletContext is not abstract and does not override abstract method
getContextPat
h() in javax.servlet.ServletContext


C:\struts2\trunk\plugins\portlet\src\main\java\org\apache\struts2\portlet\servle
t\PortletServletContext.java:[42,7]
org.apache.struts2.portlet.servlet.PortletSe
rvletContext is not abstract and does not override abstract method
getContextPat
h() in javax.servlet.ServletContext


So I could not build and install the 2.1.8-SNAPSHOT of the
struts2-portlet-plugin.

Bruce

It should be fixed now in trunk. Let me now if it works or not.

Nils-H



-- 
View this message in context: http://www.nabble.com/Error-when-deploying-portlets-beside-a-normal-Struts2-web-app--tp23981728p24227671.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Error when deploying portlets beside a normal Struts2 web app?

Posted by Nils-Helge Garli Hegvik <ni...@gmail.com>.
It should be fixed now in trunk. Let me now if it works or not.

Nils-H

On Wed, Jun 24, 2009 at 6:01 PM, phillips1021<bp...@ku.edu> wrote:
>
> I added to the Jira bug report another example application that demonstrates
> the problem.  The example application is a simple Struts 2 (using 2.1.6)
> application that has both normal actions and Portlet actions.
>
> You can also download this example application (an archive of an Eclipse
> Dynamic Web Project that uses Maven) at
> http://www.brucephillips.name/struts/StrutsExample.zip.
>
> Unzip the example application and the open a command window.  Navigate to
> where you unzipped the application.
>
> Run "mvn clean" at the command prompt
>
> Run "mvn jetty:run" at the command prompt
>
> When you see the message [INFO] Started Jetty Server open your web browser
> and navigate to
>
> http://localhost:8080/StrutsExample/index.jsp
>
> Click on link for normal Struts 2 action and you should see "Hello from
> Struts 2"
>
> Click on link for Hello from portlet action and you should see "Hello from
> Struts 2"
>
> Click on link for Run Run a normal Struts 2 action that loads a JSP with a
> search form built using s:form tag and you'll get the exception discussed
> earlier.
>
> Type control C in the command prompt window to stop Jetty server
>
> Edit the pom.xml file:
>   Change the Struts 2 to version 2.0.11
>   Comment out the dependency on struts2-portlet-plugin
>
> Save the pom.xml file
>
> In command window run "mvn clean" and then "mvn jetty:run"
>
> When you see the message [INFO] Started Jetty Server open your web browser
> and navigate to
>
> http://localhost:8080/StrutsExample/index.jsp
>
> Click on link for normal Struts 2 action and you should see "Hello from
> Struts 2"
>
> Click on link for Hello from portlet action and you should see "Hello from
> Struts 2"
>
> Click on link for Run Run a normal Struts 2 action that loads a JSP with a
> search form built using s:form tag and you'll see the simple search form
> built using the s:form tag
>
> Click on the link Click here to start the search form example as a portlet
> and you'll also see the simple search form
>
> It seems that the s:form tag is causing a problem when using the
> struts2-portlet-plugin version 2.1.6 with struts 2 core version 2.1.6.
>
> We hope this is fixed in the upcoming release of version 2.1.7 as we would
> like to use the current release of Struts 2 to build web applications that
> can be used as standalone applications and as portlet within a portlet
> container.
>
>
>
> --
> View this message in context: http://www.nabble.com/Error-when-deploying-portlets-beside-a-normal-Struts2-web-app--tp23981728p24187641.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Error when deploying portlets beside a normal Struts2 web app?

Posted by phillips1021 <bp...@ku.edu>.
I added to the Jira bug report another example application that demonstrates
the problem.  The example application is a simple Struts 2 (using 2.1.6)
application that has both normal actions and Portlet actions.

You can also download this example application (an archive of an Eclipse
Dynamic Web Project that uses Maven) at
http://www.brucephillips.name/struts/StrutsExample.zip.

Unzip the example application and the open a command window.  Navigate to
where you unzipped the application.  

Run "mvn clean" at the command prompt

Run "mvn jetty:run" at the command prompt

When you see the message [INFO] Started Jetty Server open your web browser
and navigate to 

http://localhost:8080/StrutsExample/index.jsp

Click on link for normal Struts 2 action and you should see "Hello from
Struts 2"

Click on link for Hello from portlet action and you should see "Hello from
Struts 2"

Click on link for Run Run a normal Struts 2 action that loads a JSP with a
search form built using s:form tag and you'll get the exception discussed
earlier.

Type control C in the command prompt window to stop Jetty server

Edit the pom.xml file:
   Change the Struts 2 to version 2.0.11
   Comment out the dependency on struts2-portlet-plugin

Save the pom.xml file

In command window run "mvn clean" and then "mvn jetty:run"

When you see the message [INFO] Started Jetty Server open your web browser
and navigate to 

http://localhost:8080/StrutsExample/index.jsp

Click on link for normal Struts 2 action and you should see "Hello from
Struts 2"

Click on link for Hello from portlet action and you should see "Hello from
Struts 2"

Click on link for Run Run a normal Struts 2 action that loads a JSP with a
search form built using s:form tag and you'll see the simple search form
built using the s:form tag

Click on the link Click here to start the search form example as a portlet
and you'll also see the simple search form

It seems that the s:form tag is causing a problem when using the
struts2-portlet-plugin version 2.1.6 with struts 2 core version 2.1.6.

We hope this is fixed in the upcoming release of version 2.1.7 as we would
like to use the current release of Struts 2 to build web applications that
can be used as standalone applications and as portlet within a portlet
container.



-- 
View this message in context: http://www.nabble.com/Error-when-deploying-portlets-beside-a-normal-Struts2-web-app--tp23981728p24187641.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Error when deploying portlets beside a normal Struts2 web app?

Posted by phillips1021 <bp...@ku.edu>.
Nils-H:

I did some more trouble-shooting and think I may have found what is causing
the problem.

I noticed that the originator of this thread said his action was causing a
jsp to render that included the s:form tag.

My application's action that would cause the NullPointerException also was
causing a jsp to render that included the s:form tag

I removed the s:form from the jsp and I no longer get the
NullPointerException when using the Struts 2.1.6 plugin.

Some of the exception stack trace seems to indicate the problem is with the
s:form tag when using the Struts 2.1.6 Portlet Plugin:

java.lang.NullPointerException 
    org.apache.struts2.components.UIBean.evaluateParams(UIBean.java:792)
    org.apache.struts2.components.UIBean.end(UIBean.java:510)
   
org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:42)
   
org.apache.jsp.jsp.employeeForm_jsp._jspx_meth_s_005ftextfield_005f0(employeeForm_jsp.java:424)
   
org.apache.jsp.jsp.employeeForm_jsp._jspx_meth_s_005fform_005f0(employeeForm_jsp.java:359)
   
org.apache.jsp.jsp.employeeForm_jsp._jspService(employeeForm_jsp.java:121)




phillips1021 wrote:
> 
> Nils-H:
> 
>    I created a Jira Issue (WW-3164) and attached a sample app that you can
> use to duplicate the problem I'm encountering.
> 
> Bruce
> 
> 
> Nils-Helge Garli wrote:
>> 
>> It would be helpful if you could create a sample app and attach it to
>> a JIRA issue. Then I'll have a look at it.
>> 
>> Nils-H
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Error-when-deploying-portlets-beside-a-normal-Struts2-web-app--tp23981728p24124806.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Error when deploying portlets beside a normal Struts2 web app?

Posted by phillips1021 <bp...@ku.edu>.
Nils-H:

   I created a Jira Issue (WW-3164) and attached a sample app that you can
use to duplicate the problem I'm encountering.

Bruce


Nils-Helge Garli wrote:
> 
> It would be helpful if you could create a sample app and attach it to
> a JIRA issue. Then I'll have a look at it.
> 
> Nils-H
> 
> 

-- 
View this message in context: http://www.nabble.com/Error-when-deploying-portlets-beside-a-normal-Struts2-web-app--tp23981728p24124720.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Error when deploying portlets beside a normal Struts2 web app?

Posted by Nils-Helge Garli Hegvik <ni...@gmail.com>.
It would be helpful if you could create a sample app and attach it to
a JIRA issue. Then I'll have a look at it.

Nils-H

On Fri, Jun 19, 2009 at 9:52 PM, phillips1021<bp...@ku.edu> wrote:
>
> Nils-H (or anyone else):
>
> I've duplicated this problem with 2.1.6 and portlets as follows:
>
> Created a Struts 2 web/portlet application with a pom.xml having a
> dependency on struts2-core-2.0.11.2.jar.  Works both as a normal web
> application and as a portlet application.
>
> Changed the dependencies to be struts2-core-2.1.6.jar and
> struts2-portlet-plugin-2.1.6.jar.  Running the application as a web
> application in Tomcat 6 results in a org.apache.jasper.JasperException:
> java.lang.NullPointerException whenever a Struts 2 action is called.
>
> Removed the dependency on struts2-portlet-plugin-2.1.6.jar and the
> application runs fine as a normal Struts 2 web application.
>
> I can provide the code that demonstrates the problem if it would be helpful.
>
> Is anyone on the Struts 2 development team researching the cause of this
> problem and a potential fix?
>
> Any insight into if this is an actual bug in 2.1.6 that will be fixed in a
> future release would be helpful.
>
> BTW the maven archtype specified here:
>
>    http://struts.apache.org/2.1.6/docs/struts-2-portlet-tutorial.html
>
> for the portlet tutorial doesn't work.
>
> Thanks for taking a look at this issue.  We had hope to develop Struts 2
> applications that can work as both a standalone web application and as a
> portlet in a portal container.
>
> Bruce
>
>
> If you're using portlets, your package must extend
> "struts-portlet-default" instead of "struts-default". It should be
> possible to run servlet actions and portlet actions in the same
> application.
>
> Nils-H
>
>
>
> --
> View this message in context: http://www.nabble.com/Error-when-deploying-portlets-beside-a-normal-Struts2-web-app--tp23981728p24117787.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Error when deploying portlets beside a normal Struts2 web app?

Posted by phillips1021 <bp...@ku.edu>.
Nils-H (or anyone else):

I've duplicated this problem with 2.1.6 and portlets as follows:

Created a Struts 2 web/portlet application with a pom.xml having a
dependency on struts2-core-2.0.11.2.jar.  Works both as a normal web
application and as a portlet application.

Changed the dependencies to be struts2-core-2.1.6.jar and
struts2-portlet-plugin-2.1.6.jar.  Running the application as a web
application in Tomcat 6 results in a org.apache.jasper.JasperException:
java.lang.NullPointerException whenever a Struts 2 action is called.

Removed the dependency on struts2-portlet-plugin-2.1.6.jar and the
application runs fine as a normal Struts 2 web application.

I can provide the code that demonstrates the problem if it would be helpful.

Is anyone on the Struts 2 development team researching the cause of this
problem and a potential fix?  

Any insight into if this is an actual bug in 2.1.6 that will be fixed in a
future release would be helpful.

BTW the maven archtype specified here:

    http://struts.apache.org/2.1.6/docs/struts-2-portlet-tutorial.html

for the portlet tutorial doesn't work.  

Thanks for taking a look at this issue.  We had hope to develop Struts 2
applications that can work as both a standalone web application and as a
portlet in a portal container.

Bruce


If you're using portlets, your package must extend
"struts-portlet-default" instead of "struts-default". It should be
possible to run servlet actions and portlet actions in the same
application.

Nils-H



-- 
View this message in context: http://www.nabble.com/Error-when-deploying-portlets-beside-a-normal-Struts2-web-app--tp23981728p24117787.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: Error when deploying portlets beside a normal Struts2 web app?

Posted by "Kofford, C Todd" <tk...@ku.edu>.
I am experiencing the exact same problem ever since I moved to struts 2.1.6. 

This was not a problem in struts 2.0.14, and in fact, we've stayed with struts 2.0.14 for this very reason.

Todd Kofford
tkofford@ku.edu
University of Kansas - IT
 

-----Original Message-----
From: IainM [mailto:iain.millar@live.co.uk] 
Sent: Friday, June 12, 2009 4:04 AM
To: user@struts.apache.org
Subject: Re: Error when deploying portlets beside a normal Struts2 web app?


We have struts.xml set up so that the portlet package extends
struts-portlet-default and the normal actions extend struts-default. The
problem manifests even if all we do is add the portlet-plugin jar into the
WEB-INF/lib directory and do no other setup of portlets. So there seems to
be something in the portlet plugin which is affecting normal action
functionality.

Iain.


Nils-Helge Garli wrote:
> 
> If you're using portlets, your package must extend
> "struts-portlet-default" instead of "struts-default". It should be
> possible to run servlet actions and portlet actions in the same
> application.
> 
> Nils-H
> 
> 
> On Thu, Jun 11, 2009 at 3:52 PM, IainM<ia...@live.co.uk> wrote:
>>
>> Hi,
>>
>> I have an existing Struts2 (2.1.6) web app which I would like to add a
>> couple of portlets to. I have added the portlet plugin and a portel.xml
>> file
>> and developed a couple of plugins which I have successfully run in JBOSS
>> Portal. My problem is that the addition of the portlet plugin
>> (struts2-portlet-plugin-2.1.6) seems to break my existing web pages. For
>> example, when I have an action which forwards onto a very plain jsp file
>> that shows a form (using <s:form>) I get a NullPointerException as below:
>>
>> org.apache.jasper.JasperException: java.lang.NullPointerException
>>
>> org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:521)
>>
>> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:415)
>>      
>>  org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)
>>        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
>>        javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>>       etc...
>>
>> root cause
>>
>> java.lang.NullPointerException
>>      
>>  org.apache.struts2.components.UIBean.evaluateParams(UIBean.java:792)
>>        org.apache.struts2.components.UIBean.end(UIBean.java:510)
>>
>> org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:42)
>>
>> org.apache.jsp.cardSearch_jsp._jspx_meth_s_005ftextfield_005f0(cardSearch_jsp.java:583)
>>
>> org.apache.jsp.cardSearch_jsp._jspx_meth_s_005fform_005f0(cardSearch_jsp.java:530)
>>        org.apache.jsp.cardSearch_jsp._jspService(cardSearch_jsp.java:296)
>>        org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
>>        javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>>
>> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
>>      
>>  org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)
>>        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
>>        javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>>
>> org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:154)
>>
>> org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:186)
>>        etc.....
>>
>> If I remove the portlet plugin (and the portlet.xml file which points to
>> one
>> of the classes from the plugin) all of my original webpages work without
>> any
>> issues so it's definetly the plugin that's causing a conflict.
>>
>> Can I not deploy a struts2 application that includes both normal web
>> pages
>> and portlets? Or is there a way around this problem.
>>
>> Any help would be greatly appreciated.
>>
>> Iain.
>> --
>> View this message in context:
>> http://www.nabble.com/Error-when-deploying-portlets-beside-a-normal-Struts2-web-app--tp23981728p23981728.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Error-when-deploying-portlets-beside-a-normal-Struts2-web-app--tp23981728p23995311.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Error when deploying portlets beside a normal Struts2 web app?

Posted by IainM <ia...@live.co.uk>.
We have struts.xml set up so that the portlet package extends
struts-portlet-default and the normal actions extend struts-default. The
problem manifests even if all we do is add the portlet-plugin jar into the
WEB-INF/lib directory and do no other setup of portlets. So there seems to
be something in the portlet plugin which is affecting normal action
functionality.

Iain.


Nils-Helge Garli wrote:
> 
> If you're using portlets, your package must extend
> "struts-portlet-default" instead of "struts-default". It should be
> possible to run servlet actions and portlet actions in the same
> application.
> 
> Nils-H
> 
> 
> On Thu, Jun 11, 2009 at 3:52 PM, IainM<ia...@live.co.uk> wrote:
>>
>> Hi,
>>
>> I have an existing Struts2 (2.1.6) web app which I would like to add a
>> couple of portlets to. I have added the portlet plugin and a portel.xml
>> file
>> and developed a couple of plugins which I have successfully run in JBOSS
>> Portal. My problem is that the addition of the portlet plugin
>> (struts2-portlet-plugin-2.1.6) seems to break my existing web pages. For
>> example, when I have an action which forwards onto a very plain jsp file
>> that shows a form (using <s:form>) I get a NullPointerException as below:
>>
>> org.apache.jasper.JasperException: java.lang.NullPointerException
>>
>> org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:521)
>>
>> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:415)
>>      
>>  org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)
>>        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
>>        javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>>       etc...
>>
>> root cause
>>
>> java.lang.NullPointerException
>>      
>>  org.apache.struts2.components.UIBean.evaluateParams(UIBean.java:792)
>>        org.apache.struts2.components.UIBean.end(UIBean.java:510)
>>
>> org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:42)
>>
>> org.apache.jsp.cardSearch_jsp._jspx_meth_s_005ftextfield_005f0(cardSearch_jsp.java:583)
>>
>> org.apache.jsp.cardSearch_jsp._jspx_meth_s_005fform_005f0(cardSearch_jsp.java:530)
>>        org.apache.jsp.cardSearch_jsp._jspService(cardSearch_jsp.java:296)
>>        org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
>>        javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>>
>> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
>>      
>>  org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)
>>        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
>>        javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>>
>> org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:154)
>>
>> org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:186)
>>        etc.....
>>
>> If I remove the portlet plugin (and the portlet.xml file which points to
>> one
>> of the classes from the plugin) all of my original webpages work without
>> any
>> issues so it's definetly the plugin that's causing a conflict.
>>
>> Can I not deploy a struts2 application that includes both normal web
>> pages
>> and portlets? Or is there a way around this problem.
>>
>> Any help would be greatly appreciated.
>>
>> Iain.
>> --
>> View this message in context:
>> http://www.nabble.com/Error-when-deploying-portlets-beside-a-normal-Struts2-web-app--tp23981728p23981728.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Error-when-deploying-portlets-beside-a-normal-Struts2-web-app--tp23981728p23995311.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Error when deploying portlets beside a normal Struts2 web app?

Posted by Nils-Helge Garli Hegvik <ni...@gmail.com>.
If you're using portlets, your package must extend
"struts-portlet-default" instead of "struts-default". It should be
possible to run servlet actions and portlet actions in the same
application.

Nils-H


On Thu, Jun 11, 2009 at 3:52 PM, IainM<ia...@live.co.uk> wrote:
>
> Hi,
>
> I have an existing Struts2 (2.1.6) web app which I would like to add a
> couple of portlets to. I have added the portlet plugin and a portel.xml file
> and developed a couple of plugins which I have successfully run in JBOSS
> Portal. My problem is that the addition of the portlet plugin
> (struts2-portlet-plugin-2.1.6) seems to break my existing web pages. For
> example, when I have an action which forwards onto a very plain jsp file
> that shows a form (using <s:form>) I get a NullPointerException as below:
>
> org.apache.jasper.JasperException: java.lang.NullPointerException
>
> org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:521)
>
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:415)
>        org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)
>        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
>        javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>       etc...
>
> root cause
>
> java.lang.NullPointerException
>        org.apache.struts2.components.UIBean.evaluateParams(UIBean.java:792)
>        org.apache.struts2.components.UIBean.end(UIBean.java:510)
>
> org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:42)
>
> org.apache.jsp.cardSearch_jsp._jspx_meth_s_005ftextfield_005f0(cardSearch_jsp.java:583)
>
> org.apache.jsp.cardSearch_jsp._jspx_meth_s_005fform_005f0(cardSearch_jsp.java:530)
>        org.apache.jsp.cardSearch_jsp._jspService(cardSearch_jsp.java:296)
>        org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
>        javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
>        org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)
>        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
>        javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>
> org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:154)
>
> org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:186)
>        etc.....
>
> If I remove the portlet plugin (and the portlet.xml file which points to one
> of the classes from the plugin) all of my original webpages work without any
> issues so it's definetly the plugin that's causing a conflict.
>
> Can I not deploy a struts2 application that includes both normal web pages
> and portlets? Or is there a way around this problem.
>
> Any help would be greatly appreciated.
>
> Iain.
> --
> View this message in context: http://www.nabble.com/Error-when-deploying-portlets-beside-a-normal-Struts2-web-app--tp23981728p23981728.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org