Fórumok

GWT RPC- Portlets

Ana Silva, módosítva 13 év-val korábban

GWT RPC- Portlets

New Member Bejegyzések: 12 Csatlakozás dátuma: 2010.12.01. Legújabb bejegyzések
Hello,

I'm new on portlets and LifeRay world. I have a GWT-RPC ap and i'd like to use it in a portlet, and see it in LifeRay, but when i try to add the portlet, i get the following error:

Error:
The call failed on the server; see server log for details

In localhost."date".log i see:
org.apache.catalina.core.StandardHostValve custom
FINA: Processing ErrorPage[errorCode=404, location=/errors/404.jsp]

Could you help me with this issue?

Than you very much in advance por any kind of information you can give me about this, because i was not able to find much, and the one i've found, didn't help me, as i continue getting the same error.


Regards,
Ana
thumbnail
Massimiliano Assante, módosítva 13 év-val korábban

RE: GWT RPC- Portlets

Junior Member Bejegyzések: 53 Csatlakozás dátuma: 2010.03.04. Legújabb bejegyzések
seems like it can't find portlet jsp. check this thread here about gwt and portlets

it should help you out
Ana Silva, módosítva 13 év-val korábban

RE: GWT RPC- Portlets

New Member Bejegyzések: 12 Csatlakozás dátuma: 2010.12.01. Legújabb bejegyzések
Hi Massimiliano,

I've checked it and made the changes on view.jsp and and now i get the error:

Estado HTTP 404 - /GWTPortlet/

What Am I doingo wrong?? emoticon

Thank you very much for you help!!
Srikanth Reddy, módosítva 13 év-val korábban

RE: GWT RPC- Portlets

Junior Member Bejegyzések: 53 Csatlakozás dátuma: 2010.06.18. Legújabb bejegyzések
Can you please paste your code snippnet.
as the information you provided is not clear??
Ana Silva, módosítva 13 év-val korábban

RE: GWT RPC- Portlets (Válasz)

New Member Bejegyzések: 12 Csatlakozás dátuma: 2010.12.01. Legújabb bejegyzések
Hello Srikanth,

Yes, of course...Sorry if my problem is not clear...

.gwt.xml:


<!--?xml version="1.0" encoding="UTF-8"?-->
<module rename-to="arbol2">
  <!-- Inherit the core Web Toolkit stuff.                        -->
  <inherits name="com.google.gwt.user.User" />  
  <inherits name="com.google.gwt.http.HTTP" />

  <!-- Other module inherits                                      -->  
  <inherits name="com.extjs.gxt.ui.GXT" />
 
  <entry-point class="com.example.arbol.client.Arbol2" />
  <servlet path="/ontol" class="com.example.arbol.server.OntologyServiceImpl" />

 
  <!-- Specify the paths for translatable code                    -->
  <source path="client">
  <source path="shared">

</module>


.java:

RootPanel.get("uid").add(receiver);

web.xml:


<!--?xml version="1.0" encoding="UTF-8"?-->
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
  <display-name>GWTPortlet</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>

  <jsp-config> 
   <taglib>
     <taglib-uri>http://java.sun.com/portlet_2_0</taglib-uri>
     <taglib-location>/WEB-INF/tld/liferay-portlet.tld</taglib-location>
   </taglib>
  </jsp-config>

  <!-- Servlets -->
  <servlet>
    <servlet-name>ontologyServiceImpl</servlet-name>
    <servlet-class>com.example.arbol.server.OntologyServiceImpl</servlet-class>
  </servlet>
    
  <servlet-mapping>
    <servlet-name>ontologyServiceImpl</servlet-name>
    <url-pattern>/arbol2/ontol</url-pattern>
  </servlet-mapping>

</web-app>


_view.jsp:


&lt;%@page contentType="text/html"%&gt;
&lt;%@page pageEncoding="UTF-8"%&gt;
 
   <link type="text/css" rel="stylesheet" href="Arbol2.css">
   <link rel="stylesheet" type="text/css" href="css/ext-all.css"> 
 
&lt;%-- Uncomment below lines to add portlet taglibs to jsp --%&gt;
&lt;%@ page import="javax.portlet.*"%&gt;
&lt;%-- &lt;%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet"%&gt; --%&gt;
&lt;%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%&gt;


<script src="<%=request.getContextPath()%>/arbol2/arbol2.nocache.js"></script>
6<div id="uid"></div>

<b>
    VIEW MODE
</b>


I don´t know if you need to see anything more. Please, let me know if you do... I hope that now it's more clear.

THANK YOU very much for your response!!!

Regards,
Ana
Ana Silva, módosítva 13 év-val korábban

RE: GWT RPC- Portlets (Válasz)

New Member Bejegyzések: 12 Csatlakozás dátuma: 2010.12.01. Legújabb bejegyzések
Please, any help????
Thank you very much!!!
thumbnail
Massimiliano Assante, módosítva 13 év-val korábban

RE: GWT RPC- Portlets

Junior Member Bejegyzések: 53 Csatlakozás dátuma: 2010.03.04. Legújabb bejegyzések
what you pasted seems correct, to me, i may be wrong though, it seems there are missing pieces, like you don't have the portlet code which redirects to the jsp page. What about portlet.xml file?
Specifically in your server code part you should have a class which extends javax.portlet.GenericPortlet overriding the doView method, say org.acme.whatever.MyPortlet (see below)

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

PortletRequestDispatcher dispatcher = getPortletContext().getRequestDispatcher("/WEB-INF/jsp/MYVIEW.jsp");
dispatcher.include(request, response);

}

in the portlet descriptor (portlet.xml) you would have something like

...
<portlet-class>org.acme.whatever.MyPortlet</portlet-class>
...

check this article to have a clear view of the project structure.

hope it helps
M
Ana Silva, módosítva 13 év-val korábban

RE: GWT RPC- Portlets

New Member Bejegyzések: 12 Csatlakozás dátuma: 2010.12.01. Legújabb bejegyzések
Hello Massimiliano,

THANK YOU very much for your help!! It DOES helped me very much, and now it is working!!!! But I still have one problem emoticon
The point is that when I add my portlet in Liferay(Add -> More -> Search my portlet -> Add) I get a white page and it's like if it's trying to load something...And i have to close the window and open it again, and then I can see my portlet added and working right. I have no idea why it's doing that, and what can i do to fix it...
¿Could you help me also with this?¿Do you have any idea of what am I doing wrong?

THAN YOU very much again for your help!!!
thumbnail
Henrique Simoes de Andrade, módosítva 13 év-val korábban

RE: GWT RPC- Portlets

Regular Member Bejegyzések: 165 Csatlakozás dátuma: 2010.04.30. Legújabb bejegyzések
Ana,

Take a look in server.log after you add your portlet, may be have some error that you can paste here.

sorry my English...
Ana Silva, módosítva 13 év-val korábban

RE: GWT RPC- Portlets

New Member Bejegyzések: 12 Csatlakozás dátuma: 2010.12.01. Legújabb bejegyzések
Hi Henrique,

The only "strange" log message that i can see is this:

09-dic-2010 13:10:19 org.apache.catalina.core.StandardHostValve custom
FINA: Processing ErrorPage[errorCode=404, location=/errors/404.jsp]

in "localhost.2010-12-09.log"

Seems like it doesn´t find the page to show...But when I open the window again, everything is OK... I don´t understand emoticon
¿Any idea?

Thank you in advance...
thumbnail
Henrique Simoes de Andrade, módosítva 13 év-val korábban

RE: GWT RPC- Portlets

Regular Member Bejegyzések: 165 Csatlakozás dátuma: 2010.04.30. Legújabb bejegyzések
Your application tries to redirect to this error page in any moment?

If yes, you need to check if the page exists and if this path is correct.

If no, something that your application need to run at the first time is not loaded after you add the portlet.

I have a similar problem when I add a portlet that use jQuery and after add this application the content is not loaded correctly because some scripts were not loaded until I reload the page.

So, I think that you need to check the main resources (javascript, page, etc) that your application needs at startup and try to see if something is missing.

One thing that can help you is debugging Liferay during the deploy using an IDE like Eclipse, if you're in a development environment.

Sorry if I can't help more... emoticon
Ana Silva, módosítva 13 év-val korábban

RE: GWT RPC- Portlets

New Member Bejegyzések: 12 Csatlakozás dátuma: 2010.12.01. Legújabb bejegyzések
Hi Henrique,

Thank you for answering!!Seems like the white page was not related to the error message:

Processing ErrorPage[errorCode=404, location=/errors/404.jsp]

because adding the tag <ajaxable> and putting it to FALSE made that i don´t get the white page anymore...However, i'm still getting this error message... I still can see it in my log file. emoticon

Regards!
thumbnail
Matus Ferko, módosítva 13 év-val korábban

RE: GWT RPC- Portlets

Junior Member Bejegyzések: 26 Csatlakozás dátuma: 2009.06.05. Legújabb bejegyzések
Hi guys,
how do you call RPC calls from gwt? It seems I can't create servlet mapping inside portlet, and I think the best way could be calling action url of the portlet.

Is it how you do it? Or what's your approach?

Thanks
thumbnail
Milen Dyankov, módosítva 13 év-val korábban

RE: GWT RPC- Portlets

Regular Member Bejegyzések: 171 Csatlakozás dátuma: 2009.09.23. Legújabb bejegyzések
Francesco Ped, módosítva 10 év-val korábban

RE: GWT RPC- Portlets

New Member Bejegyzés: 1 Csatlakozás dátuma: 2013.12.04. Legújabb bejegyzések
Hallo, I am new in portlet development. I am trying to create a GWT project to integrate it as a liferay portlet.
I am using:
Liferay Portal 6.2
Community Edition GA1
6.2 CE GA1;
Eclipse Ide;
GWT;
RPC.

I have created in ecllipse a "new liferay project"/portlet with liferay MVC.
I have created in eclipse a standard GWT/RPC project. I have compiled it and copied the "war" folder (via ecplipse) in the "docroot" directory in the liferay project.

Following some hints present in (http://milen.commsen.com/2011/01/liferay-gwt-portlet-how-to-make-it-instanceable-and-use-gwt-rpc.html) I ' am able to see in the published portlet in liferay my GWT page. To obtain it I added "<footer-portlet-javascript>/war/com.paolope.project.Ciao/com.paolope.project.Ciao.nocache.js</footer-portlet-javascript>" to the file liferay_potlet.xml file.

Then I tryed to make running the RPC service via "portal delegate servlet". I have added the following rows in the /docroot/WEB-INF/web.xml file:
"
<!-- Configurazione per far funzionare RCP di GW -->
<servlet>
<servlet-name>remoteServices</servlet-name>
<servlet-class>com.liferay.portal.kernel.servlet.PortalDelegateServlet</servlet-class>
<init-param>
<param-name>servlet-class</param-name>
<param-value>com.paolope.project.server.RemoteServicesImpl</param-value>
</init-param>
<init-param>
<param-name>sub-context</param-name>
<param-value>remoteServices</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>

<servlet>
<servlet-name>RemoteServices</servlet-name>
<servlet-class>com.paolope.project.server.RemoteServicesImpl</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>RemoteServices</servlet-name>
<url-pattern>/com.paolope.project.Ciao/RemoteServices</url-pattern>
<!-- <url-pattern>/war/WEB-INF/classes/com/paolope/project/server/RemoteServicesImpl.class</url-pattern>
-->
</servlet-mapping>


<!-- Fine Configurazione per far funzionare RCP di GWT

"
But the Liferay V6.1 CE server.. gives this error: "
19:10:42,768 ERROR [localhost-startStop-1][BasePortalLifecycle:47] java.lang.ClassNotFoundException: com.paolope.project.server.RemoteServicesImpl
java.lang.ClassNotFoundException: com.paolope.project.server.RemoteServicesImpl
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
at com.liferay.portal.kernel.util.InstanceFactory.newInstance(InstanceFactory.java:52)
at com.liferay.portal.kernel.util.InstanceFactory.newInstance(InstanceFactory.java:27)
at com.liferay.portal.kernel.servlet.PortalDelegateServlet.doPortalInit(PortalDelegateServlet.java:55)
at com.liferay.portal.kernel.util.BasePortalLifecycle.portalInit(BasePortalLifecycle.java:44)
at com.liferay.portal.kernel.util.PortalLifecycleUtil.flushInits(PortalLifecycleUtil.java:48)
at com.liferay.portal.servlet.MainServlet.initPlugins(MainServlet.java:826)
at com.liferay.portal.servlet.MainServlet.init(MainServlet.java:347)
at javax.servlet.GenericServlet.init(GenericServlet.java:160)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1280)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1193)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1088)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5176)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5460)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:656)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1635)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
" and many others.

The portal RPC reports the 404 error.
Is anybody can help me ?
thumbnail
Massimiliano Assante, módosítva 13 év-val korábban

RE: GWT RPC- Portlets

Junior Member Bejegyzések: 53 Csatlakozás dátuma: 2010.03.04. Legújabb bejegyzések
I also experienced that problem, and found the way to solve it

you have to set ajaxable to false in liferay-portlet.xml in order not to make the GWT Portlet gets a blank page when you first add it to the layout. clearly redeploy your portlet.
e.g.

...
<portlet>
...
<ajaxable>false</ajaxable>
...
</portlet>
...


enjoy!
Ana Silva, módosítva 13 év-val korábban

RE: GWT RPC- Portlets

New Member Bejegyzések: 12 Csatlakozás dátuma: 2010.12.01. Legújabb bejegyzések
Hi Massimiliano!!!

THANK YOU VERY, VERY MUCH!!!!Adding the tag <ajaxable> and putting it to FALSE solved my problem!!!I don´t get the blank window anymore!!
Thank you very much for your help!!

Regards!