PDA

View Full Version : Tomcat Pentaho and Stringbeans



dlpatri
05-23-2006, 12:22 PM
I've managed to get Pentaho running correctly on Tomcat 5.5.17. I've also been able to get the Stringbeans Portal running on it pretty well. However, when I try to run a Pentaho Portlet inside of Stringbeans, I get an IncompatibleClassChangeError.

It seemed as though the Portlet-Api jar that JBoss uses was newer than the Portlet-Api jar that Stringbeans uses, so I recompiled Stringbeans with the new Portlet-Api jar and updated all of the jar files. But that didn't really fix anything.

Does anyone else have any idea as to what might be causing this error?

I have been able to get my own, personal, Portlets to work in Stringbeans, so I know that what I've done ought to work for that Container.

dlpatri
05-23-2006, 12:24 PM
1179445 ERROR [http-8443-Processor25] com.nabhinc.portal.core.PortalServlet - Portlet exception in getting portlet content.javax.portlet.PortletException: java.lang.IncompatibleClassChangeError
at com.nabhinc.portal.core.PortletWindow.renderPortlet(PortletWindow.java:392)
at com.nabhinc.portal.core.PortletWindow.getContent(PortletWindow.java:246)
at org.apache.jsp.themes.blue.portal_jsp._jspService(portal_jsp.java:1621)

dlpatri
05-23-2006, 12:28 PM
Caused by: java.lang.IncompatibleClassChangeError
at javax.portlet.GenericPortlet.getTitle(GenericPortlet.java:203)
at javax.portlet.GenericPortlet.render(GenericPortlet.java:177)
at com.nabhinc.portal.core.PortletServlet.doGet(PortletServlet.java:191)

mbatchelor
05-23-2006, 12:58 PM
For anyone to be able to help, I think we need to see the whole server log file. If you can attach it as a .zip file, we'll see what we can do.

Take care,

Marc

dlpatri
05-24-2006, 06:05 AM
I have attached this http://forums.pentaho.org/archived_att/files/stringbeanIntegration.zip to provide more information regarding the IncompatibleClassChangeError that I've been receiving. I hope it's enough to go off of, but if not, let me know of anything else that I could send so that we can find out what's going on.

It almost seems to me like Stringbeans and Pentaho share a common dependancy whose versions differ from one another. Like one product is using a newer jar file than another. I'm not entirely sure though...

Also, I am running Pentaho 1.1.5 and Stringbeans 3.0.1. Any help would be greatly appreciated.

Post edited by: dlpatri, at: 05/24/2006 10:06

mbatchelor
05-24-2006, 08:19 AM
Hi there,

I'm sorry you're having trouble, but perhaps I may be able to provide some troubleshooting pointers on this.

First, are you using the stringbeans that comes bundled with tomcat, or have you deployed stringbeans into your own tomcat container? Second, have you checked your classpath?

Here's what I'm thinking - that there is more than one version of the portlet API jar available. I had a quick looksie at the stringbeans distribution with tomcat, and it has portlet.jar in the shared/lib directory. Is it possible that somewhere on your classpath, it's finding either another version of this .jar file (also called portlet-api.jar)?

That's about all I can think of. The IncompatibleClassChangeException indicates that the same class is coming from two different jar files and are two different versions.

I hope this helps,

Marc

dlpatri
05-24-2006, 09:33 AM
Thank you for the pointer. That was probably the best description I've seen for the IncompatibleClassChangeError so far.

This is what I got from the JavaDocs:


Thrown when an incompatible class change has occurred to some class definition. The definition of some class, on which the currently executing method depends, has since changed.


Anyways, I removed the portlet-api.jar file from pentaho/WEB-INF/lib since I wanted to use the one that was in shared/lib. When you said:


The IncompatibleClassChangeException indicates that the same class is coming from two different jar files and are two different versions.


Thats when I remembered the Stringbean Documentation saying that there shouldn't be other portlet-api.jars inside the Web Applications' directory WEB-INF/lib directory.

So, I've gotten past that error now. Thanks.

Now I'm getting:


java.sql.SQLException: socket creation error
at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
at org.hsqldb.jdbc.jdbcConnection.(Unknown Source)
at org.hsqldb.jdbcDriver.getConnection(Unknown Source)
at org.hsqldb.jdbcDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(DriverManager.java:525)
at java.sql.DriverManager.getConnection(DriverManager.java:140)
at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:110)


I'll play around with it. If anyone already knows that answer to this one, I wouldn't mind having it. But otherwise, I'll try to get things working and provide the answer later.

Thanks again.

dlpatri
05-24-2006, 09:46 AM
lol. It helps to have hsqldb started.

dlpatri
05-24-2006, 10:59 AM
Thanks to Marc's input, I've been able to get several portlets to work now. However there are a few portlets that seem to reference the "pentaho-solutions" folder. For instance, the Widget-Grid-Example1 is looking for "samples/portal/budgetvariance.dial.xml".

Even though Pentaho is able to find the files, Stringbeans can't right now. For fun, I tried putting the context-param: solution-path in the web.xml of Stringbeans, but that didn't seem to do anything.

Does anyone know of a way to make the pentaho-solutions folder available to web-applications in another context?

Right now, I'm thinking about putting the Pentaho-Solutions folder into the Tomcat webapps directory and changing all of the portlet references to look for it there. I'd also change solution-path in pentaho's web.xml so that it would point to the appropriate folder.

I'd prefer it if there were a cleaner solution though. So, if anyone has any ideas let me know.

Post edited by: dlpatri, at: 05/24/2006 15:01

mbatchelor
05-24-2006, 12:05 PM
That exception is almost universally that the hypersonic database isn't running. There's a start_hypersonic.bat (or start_hypersonic.sh) file that needs to be running before running your server.

Glad you got through things,

Marc

mbatchelor
05-24-2006, 12:17 PM
Can you tell us exactly which portlets are working, and which ones aren't? Perhaps we can spot a pattern that isn't immediately obvious.

dlpatri
05-24-2006, 12:32 PM
I've determined now that it actually could find pentaho-solutions and all of the files in it. I was thrown off by the way the error messages were worded.

I'm now thinking that the Portlets aren't working because they expect a few JBoss services that were defined in the Portlet.xml file in pentaho/WEB-INF. I had to remove those definitions because Stringbeans couldn't parse the service elements.

I'm going to start looking at the Portlet's source to see if I'm anywhere near correct in my thinking. If I am then I'll try and change them so that they'll work outside the JBoss Portal.

For the record, the following Portlets are giving me problems:

RegionFilter
Widget-Grid-Example1
PieChart-Example
Action-Portlet
Secure-Action-Portlet


The Widgets mentioned don't appear on the screen (I wonder if they need certain data to be there first... I think that may be the case because Widget-Example1 works). The Portlets where data is submitted error out on submit.

I wish I could be more specific about the errors, but I'm not getting much from either console or log output.

I would also like to mention that the various "examples" Portlets work just fine. For instance Getting-Started-Examples, Reporting-Examples, etc...

Post edited by: dlpatri, at: 05/24/2006 16:36

dlpatri
05-25-2006, 06:25 AM
I figured out 1 of the problems that I've been getting. This one has to deal with Submitting the forms. I've noticed that when I use ActionPortlet and submit the form; I get this URL:


https://localhost:8443/stringbeans/portal/my/normal/0/process_action/1/0/mode/view/window_state/normal&DEPARTMENT=sales&REGION=central&solution=samples&action=custom-parameter-page-example.xaction&path=reporting

The problem with this URL is that the first request parameter has a '&' in front of it as opposed to a '?'. My guess is that JBoss doesn't care as much about whether or not the '?' is there or not, but Stringbeans/Tomcat does. When I replace the first '&' in the URL with a '?' it seems to Submit just fine.

The second problem I'm having is that 'child' portlets like EmbeddedReportPortlet can't seem to get a hold of the information that was submitted by ActionPortlet. After I managed to get ActionPortlet to submit I received this error, presumably from EmbeddedReportPortlet.


10:03:58,737 ERROR [RuntimeContext] 4faf9fbe-ebf7-11da-a8d0-7bb2977cede2:RUNTIME:context-30472005-1148565838721:jfreereport-reports-test-1.xaction RuntimeContext.ERROR_0018 - The requested parameter DEPARTMENT has a NULL value
10:03:58,737 ERROR [RuntimeContext] 4faf9fbe-ebf7-11da-a8d0-7bb2977cede2:RUNTIME:context-30472005-1148565838721:jfreereport-reports-test-1.xaction RuntimeContext.ERROR_0013 - Parameters could not be resolved
10:03:58,737 ERROR [RuntimeContext] 4faf9fbe-ebf7-11da-a8d0-7bb2977cede2:RUNTIME:context-30472005-1148565838721:jfreereport-reports-test-1.xaction RuntimeContext.ERROR_0012 - ActionDefinition for JFreeReportComponent did not execute success
fully

So, once I figure out where the JavaScript for that page is, I should be able to fix the Submission error. Then I have to figure out why it is that EmbeddedReportPortlet can't find the data it's looking for.

I'm beginning to wonder how how hard it would be to make my own portlets that use Pentaho. I don't see any documentation on the subject, but I should just be able to examine what's going on in the source of the pre-existing Portlets.

Is there any documentation out there for invoking Pentaho's libraries directly? (Aside from the Javadoc, of course).

mbatchelor
05-25-2006, 06:39 AM
But of course!

Check out the SDK in the downloads section.

dlpatri
05-26-2006, 08:07 AM
Quick Update.

I thought you guys might be interested to know that I managed to create a form submission Portlet as well as a report displaying portlet. After I made these, I quickly re-tested Widget-Grid-Example1, PieChart-Example, and EmbeddedReportPortlet. They all work now.

It seems like the entire problem has been data submission. Both the ActionPortlet and the SecureActionPortlet put together a URL from JavaScript. First and foremost, the generated URL does not work in Tomcat because the first parameter has a '&' in front of it as opposed to a '?'. Secondly, once you change the URL to fix that problem, the 'child' Portlets can't find the data.

In my Form Submitting Portlet, I made it so that it takes the data from the request, and puts "DEPARTMENT" and "REGION" inside of the Session under APPLICATION_SCOPE. When the attributes are set this way, the 'child' Portlets can find it.

I'm still kind of newb with Portlets, so I haven't figured out how to make the 'child' Portlets automatically refresh themselves after submitting the 'parent' Portlet, but I'm working on it. Right now I refresh the page after submitting the Portlet.

(Thinking about it now though, I wonder if it's because I'm not using processPortletAction at all.... I guess I'm going to have to experiment).

jdixon
05-31-2006, 08:59 PM
RE: URLs missing '?' in them.

This is how we construct the URLs in the Pentaho portlets.

We use a portlet URL factory org.pentaho.ui.portlet.PortletUrlFactory which gets passed a javax.portlet.RenderResponse from the portlet and is provided by the portal.

When we need to create a URL we either create a PortletURL by calling javax.portlet.RenderResponse.createActionURL() (for URLs that need to change state on the page) or RenderResponse.createRenderURL() (for URLs that don't).

We then either:
* Make calls to PortletURL.setParameter() to add parameters to the URL and then call PortletURL.getUrl() to get the final URL
or
* Call PortletURL.getUrl() and manually add parameters (because the PortletURL is not available during final URL construction, e.g. in an XSLT).

I think the problem you are seeing with bad urls is happening in the second case.

In the attached zip file is a new org.pentaho.ui.portlet.PortletUrlFactory class file to try to see if it solves the problem for you.
Unzip the file
Place it into ~/pentaho/WEB-INF/classes/org/pentaho/ui/portlet
Restart Tomcat or touch the web.xml

Let me know if this works for you. Thank you for your persistance.

James http://forums.pentaho.org/archived_att/files/PortletUrl.zip

roberto63
06-01-2006, 07:56 AM
Hello. After some work, I have portal and portlets running ok. I don't know if this is the same problem, but I discovered that by using the filter panel in the url obtained is missing the '?' necessary to have the pages refreshed with parameters of choice.
To solve this, I have inserted a row in the FilterPanelDefault.xsl file in the custom dir of pentaho-solutions containing

submitUrl += '?';

just below the var submitUrl declaration. By this way I have my portlets refreshing as expected without any problem.
I think that someone would try the platform examples in a different context that the demo, should consider this issue.
Regards
Roberto

rutfield
07-27-2006, 01:54 PM
I'm a little confused by this thread.

I am experiencing the same error referenced earlier



10:03:58,737 ERROR [RuntimeContext] 4faf9fbe-ebf7-11da-a8d0-7bb2977cede2:RUNTIME:context-30472005-1148565838721:jfreereport-reports-test -1.xaction RuntimeContext.ERROR_0018 - The requested parameter DEPARTMENT has a NULL value
10:03:58,737 ERROR [RuntimeContext] 4faf9fbe-ebf7-11da-a8d0-7bb2977cede2:RUNTIME:context-30472005-1148565838721:jfreereport-reports-test -1.xaction RuntimeContext.ERROR_0013 - Parameters could not be resolved
10:03:58,737 ERROR [RuntimeContext] 4faf9fbe-ebf7-11da-a8d0-7bb2977cede2:RUNTIME:context-30472005-1148565838721:jfreereport-reports-test -1.xaction RuntimeContext.ERROR_0012 - ActionDefinition for JFreeReportComponent did not execute success
fully

I can not tell if I should try the attached file, PortletUrl.zip (is it supported, or was that a test?) or modifying the FilterPanelDefault.xsl to insert a line submitUrl+= '?';?

Thanks. Just FYI, I am on Windows XP with JBoss 4.04GA and JBP 2.4 CR1.

Please advise.

RKiC
03-27-2007, 10:26 AM
I'm trying to get Pentaho Portals to work with Tomcat as well. I've already installed StringBeans and got the sample portal that came with StringBeans up and running. I've deployed the pentaho war file with the deploy.bat that came with StringBeans, but I'm quite clueless on what to do next. Perhaps someone could tell me what the next steps would be or what the URL would be for the portal if there are no additional steps.
Thanks in advance.

mlowery
03-29-2007, 10:50 AM
The only pieces provided by Pentaho are the actual Pentaho portlet classes and the JSR-168 portlet.xml file describing those portlets. In addition to these files, you might need to edit/create Stringbeans-specific configuration files or use some Stringbeans admin interface to configure the Pentaho portlets.