Pluto on JBoss on Windows
Installing Pluto on JBoss 3.2.3 on Windows 2000
0. Basic instructions are here, others recommend this.
1. Download Maven - fortunately, this is quite easy and the nicest installer I have yet seen in the open source J2EE world. I accepted all the defaults. One gotcha - the install did not add the MAVEN_HOME\bin directory to my path, so I had to do that manually.
2. Get the Pluto source. This was a bit more challenging for me as I didn't have cvs installed on my system (which led to installing winCVS, which led to installing Python). But eventually I installed it at c:\jakarta-pluto.
3. Modify build.properties settings
Starting with the c:\jakarta-pluto\build.properties.sample file, I set
maven.tomcat.home=C:/jboss-3.2.3/server/default
and saved this as build.properties.
4. After adding MAVEN_HOME\bin to my path, I changed directory to the root of the Pluto project (c:\jakarta-pluto) and ran:
maven fullDeployment
Everything seemed to complete correctly - and it was actually quite impressive as maven seemed to go to all the right places and get the information it needed.
5. Then I started JBoss - and noticed many error messages - and of course the URL http://localhost:8080/pluto/portal failed with an internal 500 error (context not found I believe).
6. Turns out there were two main problems:
a. Maven deployed pluto.war and testsuite.war as "exploded war files", but it put them in jboss's default\webapps directory, not in default/deploy. However, when I simply copied everything under default\webapps to default\deploy, things were still failing. So, I went with the .war approach instead, and simplied copied pluto.war from c:\jakarta-pluto\portal\target to default\deploy and I copied c:\jakarta-pluto\testsuite\target\testsuite.war to default\deploy. But then I ran into:
java.lang.NoClassDefFoundError: org/apache/pluto/PortletContainerException
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:1590)
at java.lang.Class.getConstructor0(Class.java:1762)
b. The problem was that Maven deployed pluto-1.0.jar and portlet-api-1.0.jar to C:\jboss-3.2.3\server\default\shared\lib, rather than C:\jboss-3.2.3\server\default\lib. I moved these jar files to C:\jboss-3.2.3\server\default\lib.
7. I then tried http://localhost:8080/pluto/portal/test - and initially, I thought everything was fine. But that was only because I didn't know what to expect. As it turns out, there was more work ahead.
8. At this point I ran into a NPE:
java.lang.NullPointerException
at org.apache.pluto.portalImpl.om.entity.impl.PortletEntityImpl.getPortletDefinition(PortletEnt
at org.apache.pluto.portalImpl.aggregation.PortletFragment.service(PortletFragment.java:147)
As Russell Heywood pointed out, Tomcat deploys testsuite.war into an exploded directory named "testsuite". However, in jboss the directory name is something like tmp12345testsuite.war. Thus, Pluto was not able to match these two differing names. So I added the following slight modification to Russell's code as follows at line 184 of PortletDefinitionRegistryFileImpl.java: (Note: I think Russell's works if you use an exploded directory deployment instead of a .war deployment - but that is just a guess.)
//RB hack - change webModule from the form of tmp12345foo.war to foo
if (webModule.endsWith(".war") && webModule.startsWith("tmp")) {
webModule = webModule.substring(8,webModule.length()-4);
}
9. I run "maven fullDeployment" to recreate the pluto.war file (and then put it in the deploy directory)
10. At this point, I ran into the next NPE
java.lang.NullPointerException
at org.apache.pluto.portalImpl.aggregation.PortletFragment.service (PortletFragment.java:156)
...
This was due to my portletDefinition having a null servletDefinition. Turned out that the reason this was occurring was that my testsuite.war (created by maven) was lacking a web.xml. Interestingly, the exploded directory deployment that maven created had the web.xml. So I just created a version of testsuite.war by zipping up the exploded testsuite directory structure and put the resulting testsuite.war into jboss's deploy directory. And then it worked. For real. :)
Comments
Richard,
Can pluto be used with JBoss? I am running into a number of very strange errors, that seem to come from caching, and some random unknown errors.
Posted by: Chris Buckley | May 14, 2004 05:31 PM