This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Portals and Portlets and the fly likes RAD and Portal Test Envoirmnemnt -Unable to Run a simple Portlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Portals and Portlets
Bookmark "RAD and Portal Test Envoirmnemnt -Unable to Run a simple Portlet" Watch "RAD and Portal Test Envoirmnemnt -Unable to Run a simple Portlet" New topic
Author

RAD and Portal Test Envoirmnemnt -Unable to Run a simple Portlet

Sushma Bhat
Greenhorn

Joined: Jun 12, 2006
Posts: 7
Hello I am trying my hand at writing Portlets using the RAD and Portal Test Envoirnment.I am following the instructions given on the RedBook.But Unfortunately I am unable to run a very simple portlet on the Portal Test envoirnment.I am encountering a error when I am trying to run it ...This is the message(on the portal screen) I get when I click on the Portlet

"This portlet is unavailable. If the problem persists, please contact the portal administrator"

Is there something which I should do to get the portlet working
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968
    
    1

Hey dude. Welcome to the world of Portal and IRAD.

Sometimes if you dont' set the response header, you're in for a world of hurt:

response.setContentType(request.getResponseContentType());

I'd say there was something wrong with your portlet. If the environment says it can't find anything to deploy, it usually means the environment is good, but going from IRAD to the environment is the problem.

Take a look at my tutorial on creating JSR-168 Portlets with IRAD. It might give you an idea.

http://www.technicalfacilitation.com/examscam/get.php?link=../portal/tutorials

Regardless, I'd keep the first portlet real simple. Just code the doView method and printout HelloWorld.

Oh, one other thing. Sometimes the portal test environment coughs up a lung when Hot Method Replace is enabled. As a last ditch effort, I'd disable that, but that's a real low probability idea.

Here's a simple Portlet that should run. Copy and paste my doView:

package com.examscam.portlets;

import java.io.*;

import javax.portlet.*;

public class HelloWorldPortlet extends GenericPortlet {

protected void doView(RenderRequest request, RenderResponse response)
throws PortletException, IOException {

response.setContentType(request.getResponseContentType());

PrintWriter out = response.getWriter();
out.print("Hello Cruel World!!!");

out.print("<BR/><BR/>");

out.println("We love people who speak: ");
out.println(request.getLocale().getDisplayLanguage());

out.print("<BR/><BR/>");

out.print("<BR/><BR/>");

out.println("<B>These headers were sent to the server:</B><BR/><BR/> ");

java.util.Enumeration enum = request.getPropertyNames();
while (enum.hasMoreElements()) {

String name = enum.nextElement().toString();
String value = request.getProperty(name);
out.print("<BR/>");
out.print(name + ": " + value);
}
}
}
 
Consider Paul's rocket mass heater.
 
subject: RAD and Portal Test Envoirmnemnt -Unable to Run a simple Portlet
 
Similar Threads
IBM portal test environment
Unable to setup WebSphere Portal 6.1 & RAD 7 in Windows Vista
run portal app in WPTE..
Portal 6.0 test environment
problem with Websphere Portal 5.1 Server