*
The moose likes Portals and Portlets and the fly likes Portal Deployed;but cant see it. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Portals and Portlets
Bookmark "Portal Deployed;but cant see it." Watch "Portal Deployed;but cant see it." New topic
Author

Portal Deployed;but cant see it.

Shridhar. Blr.
Ranch Hand

Joined: Nov 23, 2000
Posts: 45
Hi All,

I have installed jetspeed and developed a sample portal per studyguides.scja.com site. I could successfully develop and deploy the war file but i am not able to search and add it and see it working.
I didnt see any errors on the console.

can any one point me, what might be the reason?

Thanks in Advance,
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968
    
    1

Okay, let's get this portlet going.

So, you've installed and deployed JetSpeed onto a Windows platform I'm assuming?

You have started the portal, and can log into the main page at: http://localhost:8080/jetspeed/ ?

What tool did you use to develop your portlet? Eclipse? Notepad? IRAD? Lomboz? NetBeans? Just curious.

When you deploy the war file, where do you export it to? When you deploy a JSR-168 portlet to JetSpeed2, you need to drop the portlet war file into the: C:\_jetspeed20\webapps\jetspeed\WEB-INF\deploy directory

Your actual path will depend upon where you installed your portal server.

Now, when I drop the JSR168 Ajax portlet I've been working on, into the deploy directory, I get a whole bunch of output on the DOS prompt/command window that was used to start JetSpeed. When you deploy your own portlet, you should get something similar. Mine says:



Now, I'm not sure when the list of deployable portlets is cached. I sometimes log out of JetSpeed and then log back in again when I'm doing testing to make sure the list of portlets has been regenerated or updated. But give JetSpeed a minute or two to catch up, and you should be able to view your portlet on the list of portlets, and add it to the page.

Oh, by the way, maybe you could show us the portlet.xml file. That's where the name used by the portal to display the name of the portlet to you in the list is configured. If you haven't properly named the portlet in the portlet.xml file, or maybe haven't supported the proper language of your portal server, it might not be displaying the portlet as an option for addition. Make sure the portlet supports your preferred language.

Let me know!

-Cameron McKenzie
[ April 08, 2007: Message edited by: Cameron W. McKenzie ]
Shridhar. Blr.
Ranch Hand

Joined: Nov 23, 2000
Posts: 45
Hello Cameron,

Thanks for your quick reply.
Well i didn't put it in deploy folder

Now i can search for the Portlet, but when i add it i am getting the following message ;

Cannot create Portlet instance com.examscam.portlet.HelloWorldPortlet for Portlet Application HelloWorldPortlet

also, please find the portlet.xml: [HelloWorldPortlet sample example from your site.]

<?xml version="1.0" encoding="UTF-8"?>
<portlet-app
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
id="BasicPortlets.413e4e0df0"><portlet>
<portlet-name>HelloWorld</portlet-name>
<display-name>HelloWorld portlet</display-name>
<display-name xml:lang="en">HelloWorld portlet</display-name>
<portlet-class>
com.examscam.portlet.HelloWorldPortlet
</portlet-class>
<init-param>
<name>wps.markup</name>
<value>html</value>
</init-param>
<expiration-cache>0</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>view</portlet-mode>
</supports>
<supported-locale>en</supported-locale>
<resource-bundle>
com.examscam.portlet.nl.HelloWorldPortletResource
</resource-bundle>
<portlet-info>
<title>HelloWorld portlet</title>
</portlet-info>
</portlet>
</portlet-app>

Waiting for your reply.

Thanks in Advance,
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968
    
    1

Okay, we're getting closer.

Could you download this file and drop it in your deploy folder:

http://www.scja.com/jsr168/war/ImageDisplay.war

This is a simple JSR168 portlet that displays an image. It is uncreatively called ImageDisplayPortlet.

I just want to see if this portlet will deploy and can be added. If it works, then we know the environment works, and things should deploy properly.

One thing I do wonder is if the war file actually contains the compiled portlet class. Open up the war file with WinZip or something, and check to see if the package aware portlet is compiled with the proper name, and is under the classes folder of web-inf. The question is, why can't it create an instance? Maybe the class isn't compiled, maybe the class is incorrectly named, or maybe even, the method signature of the doView method isn't totally 100%.

Maybe you could post the actually Java class you created as well. Lets make sure it extends the GenericPortlet from javax.portlet.

We'll get this working!

-Cameron McKenzie
Shridhar. Blr.
Ranch Hand

Joined: Nov 23, 2000
Posts: 45
Hello Cameron,

Thanks for your quick reply.

Deployed ImageDisplayPortlet.war and it clicked , After searching & adding, i cul see the image.

But the HelloWorld is still not working. javascript: x()
Confused

Message:
----------------
Cannot create Portlet instance com.examscam.portlet.HelloWorldPortlet for Portlet Application HelloWorld
-----------------

I checked for the .class file, package is correct and .class file is also there. This is how it looks;

-------------------------------------------
package com.examscam.portlet;

import java.io.IOException;

import javax.portlet.GenericPortlet;
import javax.portlet.PortletException;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;

public class HelloWorldPortlet extends GenericPortlet {

protected void doView(RenderRequest request, RenderResponse response)
throws PortletException, IOException {
// TODO Auto-generated method stub
response.setContentType("text/html");
response.getWriter().println("Hello World!!");
}
}

-------------------------
portlet.xml
-------------------------


<?xml version="1.0" encoding="UTF-8"?>
<portlet-app
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
id="BasicPortlets.413e4e0df0"><portlet>
<portlet-name>HelloWorld</portlet-name>
<display-name>HelloWorld portlet</display-name>
<display-name xml:lang="en">HelloWorld portlet</display-name>
<portlet-class>
com.examscam.portlet.HelloWorldPortlet
</portlet-class>
<init-param>
<name>wps.markup</name>
<value>html</value>
</init-param>
<expiration-cache>0</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>view</portlet-mode>
</supports>
<supported-locale>en</supported-locale>
<resource-bundle>
com.examscam.portlet.nl.HelloWorldPortletResource
</resource-bundle>
<portlet-info>
<title>HelloWorld portlet</title>
</portlet-info>
</portlet>
</portlet-app>

-------------------------
web.xml
-------------------------

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app id="WebApp_ID">
<display-name>BasicPortlets</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<taglib id="PortletTLD">
<taglib-uri>http://java.sun.com/portlet</taglib-uri> <taglib-location>/WEB-INF/tld/std-portlet.tld</taglib-location>
</taglib>
</web-app>
------------

I dont have std-portlet.tld file.

Waiting for your reply.

Thanks,
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61088
    
  66

"Shridhar N",

You have previously been warned on one or more occasions regarding adjusting your display name to meet JavaRanch standards. This is not optional. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it prior to your next post.

Your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Be aware that accounts with invalid display names are removed.

bear
JavaRanch Sheriff
[ April 09, 2007: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968
    
    1

Well, I guess we're begging the question: what happens when the tld file is placed into the web-inf folder.

Or, for that matter, what if you removed the reference to the tld in the web.xml file. That might actually be the problem.

Let me know.

-Cameron McKenzie
Shridhar. Blr.
Ranch Hand

Joined: Nov 23, 2000
Posts: 45
Hello,

Well, i tried those options, i couldnt find the tld and also w/o that tld, it was throwing some exception on the console, hence i have commented that line.

Thanks,
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968
    
    1

Here's a link to those files just in case you need them.

std-portlet.tld

portal.tld

I'm glad you got it working. I'll dig into that a bit more.

-Cameron McKenzie
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3704
    
    5

"Shridhar. Nagarhalli."

While we at the JavaRanch are pleased you updated your name to better match are naming policy, its still not quite right with the periods in your first and last name. Could you please remove them?

Thanks,
Scott


My Blog: Down Home Country Coding with Scott Selikoff
Sivaram thamatam
Greenhorn

Joined: Nov 11, 2011
Posts: 1
Cameron Wallace McKenzie wrote:Here's a link to those files just in case you need them.

std-portlet.tld

portal.tld

I'm glad you got it working. I'll dig into that a bit more.

-Cameron McKenzie


I could not get the above files(std-portlet.tld,portal.tld) getting no network on click of the mentioned links. Please give me alternative links to get the files.
I am getting following error while launching my portlet.
org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/portlet cannot be resolved in either web.xml or the jar files deployed with this application

I have define the below tag in jsp.
<%@ taglib uri="http://java.sun.com/portlet" prefix="p" %>

Please suggest me to resolve the error.
neha ns
Greenhorn

Joined: Nov 17, 2011
Posts: 1
I am also facing the same issue. I tried deploying the ImageDisplay.war to the JetSpeed portal (2.2). But it is not visible in the portlets list.

Please suggest, what can be missing. There is no error while deploying the war.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Portal Deployed;but cant see it.