You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-user@portals.apache.org by Murthy Gandikota <mg...@membersedgellc.com> on 2007/10/17 21:28:02 UTC

RE: Pluto 1.1.4 - java.lang.InstantiationException while deploying

I have learnt my lesson with HTML frames. They are only support by IE. Frames suck!

So this got me to thinking, how can I click on some link in Portal#1 and change the appearance of Portal#2? So far I have no answers. Can someone show me a hello world example, where clicking a helloworld link on Portal#1 displays the text hello world in Portal#2?

Thanks for your help
Murthy

-----Original Message-----
From: Murthy Gandikota
Sent: Thursday, September 06, 2007 9:26 AM
To: pluto-user@portals.apache.org
Subject: RE: Pluto 1.1.4 - java.lang.InstantiationException while deploying

I could make my helloworld work after adding the page in the admin screen.
Wonder why no one mentioned that :-)

What is the difference between frames and containers? It seems whatever
is displayed on the Pluto portal can be done with frames. Am I missing
something? Can we layer containers one top of another?

Coming from a Tomcat 5.5.3 and JSP/Servlet background, Pluto 1.1.4 is
much better. So please don't get me wrong.

I'd appreciate if someone could answer my questions.

Thanks
Murthy

-----Original Message-----
From: Murthy Gandikota [mailto:mgandikota@membersedgellc.com]
Sent: Tuesday, September 04, 2007 8:05 PM
To: pluto-user@portals.apache.org
Subject: RE: Pluto 1.1.4 - java.lang.InstantiationException while deploying

I followed the steps indicated by
a) http://www.ociweb.com/jnb/jnbAug2006.html
b) http://portals.apache.org/pluto/v11/deploying.html

Successfully created the war file with maven and deployed without errors

I still see the exception given below.

The URL given in (a) uses JetSpeed2. Do I need that too?

Thanks
Murthy
-----Original Message-----
From: Murthy Gandikota [mailto:mgandikota@membersedgellc.com]
Sent: Tuesday, September 04, 2007 6:22 PM
To: pluto-user@portals.apache.org
Subject: RE: Pluto 1.1.4 - java.lang.InstantiationException while deploying

Ben Wrote:
>Probably the problem that you are having is related to:

>>       <servlet-class>javax.portlet.GenericPortlet
>>       </servlet-class>

>This is in an incorrect way to map the servlet.  This class should be
>org.apache.pluto.core.PortletServlet.

With the change done as suggested above the error now is:

SEVERE: Servlet.service() for servlet HelloWorld threw exception
java.lang.NullPointerException
        at org.apache.pluto.core.PortletServlet.dispatch(PortletServlet.java:196)
        at org.apache.pluto.core.PortletServlet.doGet(PortletServlet.java:145)

I think the exception in the dispatch is because the following session variables are not set:

javax.portlet.response
javax.portlet.request
org.apache.pluto.core.method

The relevant code from PortletServlet.java

// Retrieve attributes from the servlet request.
        Integer methodId = (Integer) request.getAttribute(
            Constants.METHOD_ID);

        portletRequest = (InternalPortletRequest) request.getAttribute(
            Constants.PORTLET_REQUEST);

        portletResponse = (InternalPortletResponse) request.getAttribute(
            Constants.PORTLET_RESPONSE);


I'd appreciate some more help. May be someone can post the web.xml that works!

Thanks
Murthy

RE: Pluto 1.1.4 - java.lang.InstantiationException while deploying

Posted by Murthy Gandikota <mg...@membersedgellc.com>.
Hi Ben
Many thanks for your kind clarification.
In the link I posted, the author used the term "application". I took it in the same sense as Tomcat application scope.

Meanwhile, I am trying to compile Jetspeed2 I got two error message so far:
a) The container name Jetspeed is not unique
I handled this by modifying the code as follows:
components/portal/src/java/org/apache/jetspeed/container/JetspeedPortletContainerWrapper.java:        this(pluto, containerId+Math.round(Math.random()*100000000), servletConfig, env, new Properties());

b) When everything is started up properly with apache tomcat 5.5.23 when I do http://localhost/jetspeed I get

javax.servlet.ServletException: Fatal error encountered while processing portal request: org.apache.jetspeed.pipeline.PipelineException: org.apache.jetspeed.pipeline.PipelineException: org.apache.jetspeed.pipeline.PipelineException: java.lang.IllegalStateException: Cannot call getRequestContext() before it has been created and set for this thread.
        org.apache.jetspeed.engine.JetspeedServlet.doGet(JetspeedServlet.java:280)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        org.apache.jetspeed.engine.servlet.XXSUrlAttackFilter.doFilter(XXSUrlAttackFilter.java:52)



I don't know how to fix this.

I'd appreciate some help. Sorry for posting this Q here as I don't know where else.

Thanks
Murthy

-----Original Message-----
From: ben@netsos.com [mailto:ben@netsos.com]
Sent: Sunday, October 21, 2007 3:33 PM
To: pluto-user@portals.apache.org
Subject: RE: Pluto 1.1.4 - java.lang.InstantiationException while deploying

Murthy,

Make sure:

1) Portlet#B and Portlet#A are part of the same WAR file.  You can only
share attributes within the same portlet application.

2) The render method is called before the processAction method.  Usually,
the roles of the portlets would be reversed; you set session attributes in
the action and display them in the render phase.  The render phase should
be idempotent remember; it should not be changing application state.

Also, it is a really BAD thing when you start passing request objects to
other threads (i.e., don't put the request's PrintWriter into the session,
thereby making it accessible to other threads).  I know this was just an
example, but it could possibly lead to unexpected problems.

Thanks,

Ben

> In my attempt to push content into portlet#B from portlet#A I have tried
> to use the session by following the suggestions given at
> http://allu.wordpress.com/category/portlets/
>
>
> Here is my code in the render method of HelloWorld portlet
>
> public void render(javax.portlet.RenderRequest request,
> javax.portlet.RenderResponse response) {
>         response.setContentType("text/html");
>         PrintWriter writer=null;
> try{
>         writer=response.getWriter();
>         response.getWriter().println("Helloy2z Portlet" + writer);
> } catch (Exception e) {};
>         request.getPortletSession().setAttribute("writer", writer,
> PortletSession.APPLICATION_SCOPE);
>         request.getPortletSession().setAttribute("hello", "there234",
> PortletSession.APPLICATION_SCOPE);
>         PortletContext context = getPortletConfig().getPortletContext();
>        context.setAttribute("hello2", "amen");
> }
>
> Here is the code in the processAction method of Portlet#B
>
> PortletContext context = getPortletConfig().getPortletContext();
>       String a=(String) context.getAttribute("hello2");
>
> PrintWriter
> pw=(PrintWriter)request.getPortletSession().getAttribute("writer",
> PortletSession.APPLICATION_SCOPE);
>
> String h = (String) request.getPortletSession().getAttribute("hello",
> PortletSession.APPLICATION_SCOPE);
>
>
> All a, h and pw are coming out as null.
>
> What am I doing wrong here?
>
> Thanks
> Murthy
> -----Original Message-----
> From: Murthy Gandikota
> Sent: Wednesday, October 17, 2007 2:28 PM
> To: Murthy Gandikota; 'pluto-user@portals.apache.org'
> Subject: RE: Pluto 1.1.4 - java.lang.InstantiationException while
> deploying
>
> I have learnt my lesson with HTML frames. They are only support by IE.
> Frames suck!
>
> So this got me to thinking, how can I click on some link in Portal#1 and
> change the appearance of Portal#2? So far I have no answers. Can someone
> show me a hello world example, where clicking a helloworld link on
> Portal#1 displays the text hello world in Portal#2?
>
> Thanks for your help
> Murthy
>
> -----Original Message-----
> From: Murthy Gandikota
> Sent: Thursday, September 06, 2007 9:26 AM
> To: pluto-user@portals.apache.org
> Subject: RE: Pluto 1.1.4 - java.lang.InstantiationException while
> deploying
>
> I could make my helloworld work after adding the page in the admin screen.
> Wonder why no one mentioned that :-)
>
> What is the difference between frames and containers? It seems whatever
> is displayed on the Pluto portal can be done with frames. Am I missing
> something? Can we layer containers one top of another?
>
> Coming from a Tomcat 5.5.3 and JSP/Servlet background, Pluto 1.1.4 is
> much better. So please don't get me wrong.
>
> I'd appreciate if someone could answer my questions.
>
> Thanks
> Murthy
>
> -----Original Message-----
> From: Murthy Gandikota [mailto:mgandikota@membersedgellc.com]
> Sent: Tuesday, September 04, 2007 8:05 PM
> To: pluto-user@portals.apache.org
> Subject: RE: Pluto 1.1.4 - java.lang.InstantiationException while
> deploying
>
> I followed the steps indicated by
> a) http://www.ociweb.com/jnb/jnbAug2006.html
> b) http://portals.apache.org/pluto/v11/deploying.html
>
> Successfully created the war file with maven and deployed without errors
>
> I still see the exception given below.
>
> The URL given in (a) uses JetSpeed2. Do I need that too?
>
> Thanks
> Murthy
> -----Original Message-----
> From: Murthy Gandikota [mailto:mgandikota@membersedgellc.com]
> Sent: Tuesday, September 04, 2007 6:22 PM
> To: pluto-user@portals.apache.org
> Subject: RE: Pluto 1.1.4 - java.lang.InstantiationException while
> deploying
>
> Ben Wrote:
>>Probably the problem that you are having is related to:
>
>>>       <servlet-class>javax.portlet.GenericPortlet
>>>       </servlet-class>
>
>>This is in an incorrect way to map the servlet.  This class should be
>>org.apache.pluto.core.PortletServlet.
>
> With the change done as suggested above the error now is:
>
> SEVERE: Servlet.service() for servlet HelloWorld threw exception
> java.lang.NullPointerException
>         at
> org.apache.pluto.core.PortletServlet.dispatch(PortletServlet.java:196)
>         at
> org.apache.pluto.core.PortletServlet.doGet(PortletServlet.java:145)
>
> I think the exception in the dispatch is because the following session
> variables are not set:
>
> javax.portlet.response
> javax.portlet.request
> org.apache.pluto.core.method
>
> The relevant code from PortletServlet.java
>
> // Retrieve attributes from the servlet request.
>         Integer methodId = (Integer) request.getAttribute(
>             Constants.METHOD_ID);
>
>         portletRequest = (InternalPortletRequest) request.getAttribute(
>             Constants.PORTLET_REQUEST);
>
>         portletResponse = (InternalPortletResponse) request.getAttribute(
>             Constants.PORTLET_RESPONSE);
>
>
> I'd appreciate some more help. May be someone can post the web.xml that
> works!
>
> Thanks
> Murthy
>



RE: Pluto 1.1.4 - java.lang.InstantiationException while deploying

Posted by be...@netsos.com.
Murthy,

Make sure:

1) Portlet#B and Portlet#A are part of the same WAR file.  You can only
share attributes within the same portlet application.

2) The render method is called before the processAction method.  Usually,
the roles of the portlets would be reversed; you set session attributes in
the action and display them in the render phase.  The render phase should
be idempotent remember; it should not be changing application state.

Also, it is a really BAD thing when you start passing request objects to
other threads (i.e., don't put the request's PrintWriter into the session,
thereby making it accessible to other threads).  I know this was just an
example, but it could possibly lead to unexpected problems.

Thanks,

Ben

> In my attempt to push content into portlet#B from portlet#A I have tried
> to use the session by following the suggestions given at
> http://allu.wordpress.com/category/portlets/
>
>
> Here is my code in the render method of HelloWorld portlet
>
> public void render(javax.portlet.RenderRequest request,
> javax.portlet.RenderResponse response) {
>         response.setContentType("text/html");
>         PrintWriter writer=null;
> try{
>         writer=response.getWriter();
>         response.getWriter().println("Helloy2z Portlet" + writer);
> } catch (Exception e) {};
>         request.getPortletSession().setAttribute("writer", writer,
> PortletSession.APPLICATION_SCOPE);
>         request.getPortletSession().setAttribute("hello", "there234",
> PortletSession.APPLICATION_SCOPE);
>         PortletContext context = getPortletConfig().getPortletContext();
>        context.setAttribute("hello2", "amen");
> }
>
> Here is the code in the processAction method of Portlet#B
>
> PortletContext context = getPortletConfig().getPortletContext();
>       String a=(String) context.getAttribute("hello2");
>
> PrintWriter
> pw=(PrintWriter)request.getPortletSession().getAttribute("writer",
> PortletSession.APPLICATION_SCOPE);
>
> String h = (String) request.getPortletSession().getAttribute("hello",
> PortletSession.APPLICATION_SCOPE);
>
>
> All a, h and pw are coming out as null.
>
> What am I doing wrong here?
>
> Thanks
> Murthy
> -----Original Message-----
> From: Murthy Gandikota
> Sent: Wednesday, October 17, 2007 2:28 PM
> To: Murthy Gandikota; 'pluto-user@portals.apache.org'
> Subject: RE: Pluto 1.1.4 - java.lang.InstantiationException while
> deploying
>
> I have learnt my lesson with HTML frames. They are only support by IE.
> Frames suck!
>
> So this got me to thinking, how can I click on some link in Portal#1 and
> change the appearance of Portal#2? So far I have no answers. Can someone
> show me a hello world example, where clicking a helloworld link on
> Portal#1 displays the text hello world in Portal#2?
>
> Thanks for your help
> Murthy
>
> -----Original Message-----
> From: Murthy Gandikota
> Sent: Thursday, September 06, 2007 9:26 AM
> To: pluto-user@portals.apache.org
> Subject: RE: Pluto 1.1.4 - java.lang.InstantiationException while
> deploying
>
> I could make my helloworld work after adding the page in the admin screen.
> Wonder why no one mentioned that :-)
>
> What is the difference between frames and containers? It seems whatever
> is displayed on the Pluto portal can be done with frames. Am I missing
> something? Can we layer containers one top of another?
>
> Coming from a Tomcat 5.5.3 and JSP/Servlet background, Pluto 1.1.4 is
> much better. So please don't get me wrong.
>
> I'd appreciate if someone could answer my questions.
>
> Thanks
> Murthy
>
> -----Original Message-----
> From: Murthy Gandikota [mailto:mgandikota@membersedgellc.com]
> Sent: Tuesday, September 04, 2007 8:05 PM
> To: pluto-user@portals.apache.org
> Subject: RE: Pluto 1.1.4 - java.lang.InstantiationException while
> deploying
>
> I followed the steps indicated by
> a) http://www.ociweb.com/jnb/jnbAug2006.html
> b) http://portals.apache.org/pluto/v11/deploying.html
>
> Successfully created the war file with maven and deployed without errors
>
> I still see the exception given below.
>
> The URL given in (a) uses JetSpeed2. Do I need that too?
>
> Thanks
> Murthy
> -----Original Message-----
> From: Murthy Gandikota [mailto:mgandikota@membersedgellc.com]
> Sent: Tuesday, September 04, 2007 6:22 PM
> To: pluto-user@portals.apache.org
> Subject: RE: Pluto 1.1.4 - java.lang.InstantiationException while
> deploying
>
> Ben Wrote:
>>Probably the problem that you are having is related to:
>
>>>       <servlet-class>javax.portlet.GenericPortlet
>>>       </servlet-class>
>
>>This is in an incorrect way to map the servlet.  This class should be
>>org.apache.pluto.core.PortletServlet.
>
> With the change done as suggested above the error now is:
>
> SEVERE: Servlet.service() for servlet HelloWorld threw exception
> java.lang.NullPointerException
>         at
> org.apache.pluto.core.PortletServlet.dispatch(PortletServlet.java:196)
>         at
> org.apache.pluto.core.PortletServlet.doGet(PortletServlet.java:145)
>
> I think the exception in the dispatch is because the following session
> variables are not set:
>
> javax.portlet.response
> javax.portlet.request
> org.apache.pluto.core.method
>
> The relevant code from PortletServlet.java
>
> // Retrieve attributes from the servlet request.
>         Integer methodId = (Integer) request.getAttribute(
>             Constants.METHOD_ID);
>
>         portletRequest = (InternalPortletRequest) request.getAttribute(
>             Constants.PORTLET_REQUEST);
>
>         portletResponse = (InternalPortletResponse) request.getAttribute(
>             Constants.PORTLET_RESPONSE);
>
>
> I'd appreciate some more help. May be someone can post the web.xml that
> works!
>
> Thanks
> Murthy
>



RE: Pluto 1.1.4 - java.lang.InstantiationException while deploying

Posted by Murthy Gandikota <mg...@membersedgellc.com>.
In my attempt to push content into portlet#B from portlet#A I have tried to use the session by following the suggestions given at http://allu.wordpress.com/category/portlets/


Here is my code in the render method of HelloWorld portlet

public void render(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response) {
        response.setContentType("text/html");
        PrintWriter writer=null;
try{
        writer=response.getWriter();
        response.getWriter().println("Helloy2z Portlet" + writer);
} catch (Exception e) {};
        request.getPortletSession().setAttribute("writer", writer, PortletSession.APPLICATION_SCOPE);
        request.getPortletSession().setAttribute("hello", "there234", PortletSession.APPLICATION_SCOPE);
        PortletContext context = getPortletConfig().getPortletContext();
       context.setAttribute("hello2", "amen");
}

Here is the code in the processAction method of Portlet#B

PortletContext context = getPortletConfig().getPortletContext();
      String a=(String) context.getAttribute("hello2");

PrintWriter pw=(PrintWriter)request.getPortletSession().getAttribute("writer", PortletSession.APPLICATION_SCOPE);

String h = (String) request.getPortletSession().getAttribute("hello", PortletSession.APPLICATION_SCOPE);


All a, h and pw are coming out as null.

What am I doing wrong here?

Thanks
Murthy
-----Original Message-----
From: Murthy Gandikota
Sent: Wednesday, October 17, 2007 2:28 PM
To: Murthy Gandikota; 'pluto-user@portals.apache.org'
Subject: RE: Pluto 1.1.4 - java.lang.InstantiationException while deploying

I have learnt my lesson with HTML frames. They are only support by IE. Frames suck!

So this got me to thinking, how can I click on some link in Portal#1 and change the appearance of Portal#2? So far I have no answers. Can someone show me a hello world example, where clicking a helloworld link on Portal#1 displays the text hello world in Portal#2?

Thanks for your help
Murthy

-----Original Message-----
From: Murthy Gandikota
Sent: Thursday, September 06, 2007 9:26 AM
To: pluto-user@portals.apache.org
Subject: RE: Pluto 1.1.4 - java.lang.InstantiationException while deploying

I could make my helloworld work after adding the page in the admin screen.
Wonder why no one mentioned that :-)

What is the difference between frames and containers? It seems whatever
is displayed on the Pluto portal can be done with frames. Am I missing
something? Can we layer containers one top of another?

Coming from a Tomcat 5.5.3 and JSP/Servlet background, Pluto 1.1.4 is
much better. So please don't get me wrong.

I'd appreciate if someone could answer my questions.

Thanks
Murthy

-----Original Message-----
From: Murthy Gandikota [mailto:mgandikota@membersedgellc.com]
Sent: Tuesday, September 04, 2007 8:05 PM
To: pluto-user@portals.apache.org
Subject: RE: Pluto 1.1.4 - java.lang.InstantiationException while deploying

I followed the steps indicated by
a) http://www.ociweb.com/jnb/jnbAug2006.html
b) http://portals.apache.org/pluto/v11/deploying.html

Successfully created the war file with maven and deployed without errors

I still see the exception given below.

The URL given in (a) uses JetSpeed2. Do I need that too?

Thanks
Murthy
-----Original Message-----
From: Murthy Gandikota [mailto:mgandikota@membersedgellc.com]
Sent: Tuesday, September 04, 2007 6:22 PM
To: pluto-user@portals.apache.org
Subject: RE: Pluto 1.1.4 - java.lang.InstantiationException while deploying

Ben Wrote:
>Probably the problem that you are having is related to:

>>       <servlet-class>javax.portlet.GenericPortlet
>>       </servlet-class>

>This is in an incorrect way to map the servlet.  This class should be
>org.apache.pluto.core.PortletServlet.

With the change done as suggested above the error now is:

SEVERE: Servlet.service() for servlet HelloWorld threw exception
java.lang.NullPointerException
        at org.apache.pluto.core.PortletServlet.dispatch(PortletServlet.java:196)
        at org.apache.pluto.core.PortletServlet.doGet(PortletServlet.java:145)

I think the exception in the dispatch is because the following session variables are not set:

javax.portlet.response
javax.portlet.request
org.apache.pluto.core.method

The relevant code from PortletServlet.java

// Retrieve attributes from the servlet request.
        Integer methodId = (Integer) request.getAttribute(
            Constants.METHOD_ID);

        portletRequest = (InternalPortletRequest) request.getAttribute(
            Constants.PORTLET_REQUEST);

        portletResponse = (InternalPortletResponse) request.getAttribute(
            Constants.PORTLET_RESPONSE);


I'd appreciate some more help. May be someone can post the web.xml that works!

Thanks
Murthy