Caucho Forums  

This forum is permanently closed because of spam. For free community support, please visit Google Groups:


Go Back   Caucho Forums > Resin

Reply
 
Thread Tools Display Modes
  #1  
Old 11-15-2010, 09:21 AM
igor igor is offline
Junior Member
 
Join Date: Nov 2010
Posts: 15
Default Resin 4 and Liferay portal integration problem

I have some integration problem with Liferay portal 6.x and Resin 4.0.12. Portal is deployed as ROOT application. There is a simple resin-web.xml that contains only authenticator tag. Portal works.

When someone wants to deploy a portlet, there is a problem. Portlet is deployed as a war and is a web application. Lets say that I have deployed portlet called 'ip-geocoder-portlet' (or whatever). On the filesystem, folder 'webapps\ip-geocoder-portlet ' exist. Once again, it is just a common web app, with jsps, WEB-INF classes, libs and so on. Portlet doesn't have any resin-web.xml.

Now, I want to invoke jsp page from the portlet (not through the portal, just for the purpose of this demonstration):

http://localhost:8080/ip-geocoder-portlet/view.jsp

What I got as result is the following server error:
-------------------------------------------------------------
C:\liferay\bundles\resin-4.0.12\webapps\ROOT\WEB-INF\work\_jsp\_view__jsp.java:9:
package com.liferay.ipgeocoder.model does not exist
import com.liferay.ipgeocoder.model.IPInfo;
^
C:\liferay\bundles\resin-4.0.12\webapps\ROOT\WEB-INF\work\_jsp\_view__jsp.java:10:
package com.liferay.ipgeocoder.util does not exist
import com.liferay.ipgeocoder.util.IPGeocoderUtil;
...
-------------------------------------------------------------

It says that package doesn't exist - but it is there; in WEB-INF/classes of the portlet.

The same thing applies for the libs - portlet application (i.e. web application deployed in different context then ROOT) does not see any libs.


My guess is that Resin continues to operates inside the ROOTs context, and not the ip-geocoder-portlet, because of the following error line:
-----------------------------------------------------
...webapps\ROOT\WEB-INF\work\_jsp\...
-----------------------------------------------------

I would expected that resin compiler compiles jsps to
'...webapps\ip-geocoder-portlet\WEB-IN\work\_jsp\...'


The question is: how to make portlet (or any other web app deployed in different context) independent from the ROOT application? Or: how to make my JSP files be aware of my classes and libs (when deployed as web app in different context then ROOT)? Do I miss some configuration?


Would you be so kind to help me with this issue?
Reply With Quote
  #2  
Old 11-23-2010, 04:35 PM
reza reza is offline
Super Moderator
 
Join Date: Nov 2009
Location: Philadelphia, PA
Posts: 101
Send a message via Skype™ to reza
Default Where are the dependecies located?

Igor,

Just to be sure, where do your classes and libraries reside? Are they in the ROOT web application? If so, you cannot expect them to be accessible in the class-path of another web application unless you explicitly place the classes and libraries into that web application as well. Alternatively, you can place the shared libraries in $Resin/lib so that they are accessible to all web applications.

Hope it helps,
Reza
Reply With Quote
  #3  
Old 11-29-2010, 12:10 PM
igor igor is offline
Junior Member
 
Join Date: Nov 2010
Posts: 15
Default

Let me give some more hints on my problem I have the following web apps:

/ROOT - the liferay portal itself
/ip-geocoder-portlet - some simple portlet, used for testing purposes

when I go to the existing jsp: http://localhost:8080/ip-geocoder-portlet/view.jsp I've got some similar errors, where the first one is:
-----------------------------------------------------------------
C:\liferay\bundles\resin-4.0.13\webapps\ROOT\WEB-INF\work\_jsp\_view__jsp.java:9:
package com.liferay.ipgeocoder.model does not exist
import com.liferay.ipgeocoder.model.IPInfo;
-----------------------------------------------------------------

The package "com.liferay.ipgeocoder.model" and the class "com.liferay.ipgeocoder.model.IPInfo" do exist in the /ip-geocoder-portlet/WEB-INF/classes/

In the view.jsp page, this class is imported with the:

<%@ page import="com.liferay.ipgeocoder.model.IPInfo" %>

So, everything what is going on above is inside /ip-geocoder-portlet web application. Still, WEB-INF/classes seems invisible to the web application. From the first line of above error report, I see that /ip-geocoder-portlet/view.jsp is compiled in the ROOTs work folder, which seems invalid. In Tomcat, for example, it works as expected: view.jsp is compiled correctly.

So to put it simple, i have 2 web applications, where one is the ROOT. JSP imports in second web applications are not recognized, although they are there in the second WEB-INF/classes.

Last edited by igor; 11-29-2010 at 12:13 PM.
Reply With Quote
  #4  
Old 11-30-2010, 09:56 PM
reza reza is offline
Super Moderator
 
Join Date: Nov 2009
Location: Philadelphia, PA
Posts: 101
Send a message via Skype™ to reza
Default What Version of Resin is it?

Igor,

If this is what we suspect it is, it is a very serious class-loading issue. What version of Resin are you using? I'll try to replicate the issue on my end and enter a bug report.

If you can, please set the log levels to finer or finest, post the log entries and Resin configuration.

Thanks,
Reza
Reply With Quote
  #5  
Old 12-01-2010, 10:33 AM
igor igor is offline
Junior Member
 
Join Date: Nov 2010
Posts: 15
Default

Of course. Attached is the resin 4.0.13 config and the finest log. As you can see from the access.log, all what i did is:
  1. start the portal
  2. go to the http://localhost:8080/ip-geocoder-portlet/view.jsp in web browser.
Attached Files
File Type: zip log.zip (15.3 KB, 2 views)
File Type: zip resin.zip (2.1 KB, 2 views)
Reply With Quote
  #6  
Old 12-01-2010, 09:10 PM
reza reza is offline
Super Moderator
 
Join Date: Nov 2009
Location: Philadelphia, PA
Posts: 101
Send a message via Skype™ to reza
Default Can't replicate it...

Igor,

In a very simple web application, I am able to access WEB-INF/classes deployed classes into a simple test JSP. I am thinking there is something a bit more involved going on in your case, probably due to the differences in Tomcat and Resin class-loaders.

Does this happen when you type in the portlet URL directly or only when you try to access it from the portal? It makes a difference since this might be related to this bug: http://bugs.caucho.com/view.php?id=4284.

I'll continue trying to replicate this.

Thanks for your patience,
Reza

Last edited by reza; 12-01-2010 at 09:50 PM.
Reply With Quote
  #7  
Old 12-07-2010, 06:27 PM
igor igor is offline
Junior Member
 
Join Date: Nov 2010
Posts: 15
Default

It happens when I type that manually, but also when portlet (deployed as a web app) is accessed by portal (deployed as ROOT).

The related issue seems like what I am experiencing, but it says its fixed in 4.0.14, which is not released yet

btw, if you want to investigate the issue more, i can give you some steps how to reproduce it on liferay - it would not be time consuming since a lot of steps are automatized with ant.
Reply With Quote
  #8  
Old 01-06-2011, 02:28 AM
reza reza is offline
Super Moderator
 
Join Date: Nov 2009
Location: Philadelphia, PA
Posts: 101
Send a message via Skype™ to reza
Default

Igor,

I am still having a hard-time reproducing this bug. Is there any way you could pare it down to a simple application that would demostrate the problem?

Thanks,
Reza
Reply With Quote
  #9  
Old 01-21-2011, 10:22 AM
igor igor is offline
Junior Member
 
Join Date: Nov 2010
Posts: 15
Default

Huh, Ill try. If you have time, you can try it on liferay portal as well - the process of deploying to resin is automated, it just takes time to download all the source.
Reply With Quote
  #10  
Old 01-23-2011, 10:46 PM
igor igor is offline
Junior Member
 
Join Date: Nov 2010
Posts: 15
Default

Here is a little help:

Checkout latest Liferay portal sources from SVN trunk (e.g. using SmartSVN). For public access, you can use: svn://svn.lilferay.com/repos/public/portal/trunk

Invoke 'ant' to compile everything.

Add file in portal folder named 'app.server.<username>.properties', where username is your OS username. Enable resin:

app.server.type=resin

Invoke following to download Resin and configure it: ant -buildfile build-dist.xml unzip-resin

Deploy portal with 'ant deploy'

Every time you can invoke 'ant all' to clean everything and redeploy it again.

This should be enough to start portal on resin (start it with resin/bin/run.bat)

after that it is about to deploy portlet war, let me know if you need some.

thank you!
Reply With Quote
Reply

Tags
integration, liferay

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:44 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.