The following comment has been added to this issue:

     Author: Scott T Weaver
    Created: Fri, 28 May 2004 2:44 PM
       Body:
> Furthermore, hearing people "talk" about how easy it might be doesn't 
> convince me, no offence. 

Well, they are people I work with that are very compotent developers, so I generally 
trust their opinions.  I will, however, research this for myslef.

> The first three I don't really worry about, but the others?
> I know J2 currently can't (easily) be deployed on those right now but 
> if it would block this in the future I certainly will vote -1 on this.

On the contrary, I think it would make deploying to ANY container much easier than 
now.  

1.  We no longer have to put anything in shared/lib because we control the servlet 
container (Jetty)

2.  Another benefit is that J2 no longer needs to be x-context because, as stated 
above, we are control the servlet container.

Just some food for thought.  I feel this would make our life easier in the long run as 
we would only have to worry about dealing with app server's idiosyncraies relative to 
a portlet application's web app. 
---------------------------------------------------------------------
View this comment:
  http://issues.apache.org/jira/browse/JS2-56?page=comments#action_35790

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/JS2-56

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: JS2-56
    Summary: Objects Fail to Create with Tomcat Classloaders and cross context
       Type: Task

     Status: Open
   Priority: Major

    Project: Jetspeed 2
 Components: 
             Components Core
   Fix Fors:
             2.0-dev/cvs
   Versions:
             2.0-a1

   Assignee: David Sean Taylor
   Reporter: David Sean Taylor

    Created: Tue, 25 May 2004 9:35 PM
    Updated: Fri, 28 May 2004 2:44 PM
Environment: Tomcat 4 and 5

Description:
J2 uses a cross-context class loader to share objects created in the jetspeed context 
with other portlet application contexts. This works fine when objects have already 
been instantiated in the jetspeed context. 

J2 infuses a common servlet into every portlet application that is deployed into a 
Tomcat application server via the J2 portal's PAM (Portlet Application Manager). The 
code that runs in this servlet is placed in Tomcat's shared/lib directory so that both 
Jetspeed common servlet and the Jetspeed portal can share objects. 

The problems I am seeing with this approach are rooting in the creation of new 
objects. For example, if a portlet application, such as the HW_App, has a portlet 
UserInfo, that requires creation of preference objects. Preference objects by OJB. 
Looking at the code used by the ojb object broker

http://cvs.apache.org/viewcvs.cgi/db-ojb/src/java/org/apache/ojb/broker/util/ConstructorHelper.java

you see object creation taking place as:

  result = constructor.newInstance(NO_ARGS);

And this code fails, class not found exception. It fails to find the object to be 
created, such as a NodeImpl, which is deployed in the Prefs jar, normally stored under 
jetspeed's WEB-INF/lib directory. This tells me that the classloader being used by the 
code above is not the same as the cross-context classloader in Tomcat...or...the 
Tomcat cross-context class loader is not designed to handle this kind of object 
construction.

I think we have several directions we can take for a solution
One experiment I tried with Tomcat 4.1.30, was:

1. move every jar out of WEB-INF/lib into shared/lib
2. delete all classes under WEB-INF/classes
3. copy jetspeed-2.0-a1.jar into shared/lib
4. move the JDBC driver into Tomcat's system directory or into the classpath

This seemed to work, although for some reason I could not login to the LoginPortlet 
tonight. Not sure if its related. The solution is simple here: move everything down 
into shared/lib. 

A second solution would be to replace Tomcat's cross-context class loader with our own.
Although I have not found a 'pluggable' way to do this.

A third solution would be to modify the classloader in the Jetspeed common servlet.
I have started some testing in this area without any success (yet):

http://cvs.apache.org/viewcvs.cgi/jakarta-jetspeed-2/commons/src/java/org/apache/jetspeed/container/JetspeedContainerServlet.java

see the infuseClasspath method







---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to