Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » RAP app will not run from WAR file(I tried everything from wiki article #Exported_WAR_file_does_not_work)
RAP app will not run from WAR file [message #1042612] Tue, 16 April 2013 12:52 Go to next message
Mark Leone is currently offline Mark Leone
Messages: 67
Registered: April 2012
Member
I have a RAP app that works in the IDE but will not launch as a war file in tomcat. I've done everything suggested on the RAP wiki but it still doesn't work.

I telnet to the osgi console and show short status. My entrypoint and all dependent plugins are ACTIVE. org.eclipse.equinox.servletbridge.extensionbundle is RESOLVED. The plugin.xml and bundle.properties files have been exported in the entrypoint bundle, along with all the class files. And there are no library dependencies, just the bundles specified in MANIFEST.MF.

When I browse to http://host:port/myServlet/path I get a 404 error with the usual message I see when RAP is not able to run the entrypoint: "ProxyServlet: /myServlet/path is not available" The value of "myServlet" is what I entered for the servletName property in the branding extension contribution, and the value of "path" is what I entered for the path property in the entrypoint extension contribution.

The tomcat log shows no errors, and I see the context being deployed. The eclipse workspace log in the tomcat work directory shows no errors except a runtime exception thrown by org.eclipse.rap.ui.workbench, NoClassDefFound error on org.mozilla.javascript.ErrorReporter. I don't know how to resolve that (it doesn't happen when I launch with jetty in the IDE), but I assume it's not causing my problem because the entrypoint and other bundles have been resolved and started.

Permissions of the webapps directory are correct and it's owned by the proper user for tomcat. I tried opening up the permissions to 777 as well. I'm using RAP 1.5 and tomcat 6 on RHEL 5.8

What else can I try to make the app work in tomcat?
Re: RAP app will not run from WAR file [message #1042699 is a reply to message #1042612] Tue, 16 April 2013 15:23 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf Sternberg
Messages: 1290
Registered: July 2009
Senior Member

Which RAP version are you using? There is a known problem with the WAR
product export together with the most recent milestone [1], that is
going to be fixed in the Kepler M7.

Regards, Ralf

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=398780

--
Ralf Sternberg

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: RAP app will not run from WAR file [message #1043730 is a reply to message #1042699] Thu, 18 April 2013 00:00 Go to previous messageGo to next message
Mark Leone is currently offline Mark Leone
Messages: 67
Registered: April 2012
Member
Thanks for that, Ralf. But I don't think I'm running into that bug. I'm using WarProducts 0.2.2 from the Juno update site, and RAP 1.5. I believe the problem you referred to was introduced in Kepler M6.

I'm using the RAP demo as my reference implementation. I can run it as a WAR file on two home systems (OSX, CentOS), using tomcat 6 and tomcat 7. But on my development system (RHEL) at work, which is on a closed network using mirrors of the necessary eclipse sites, I cannot get the RAP demo to run as a WAR file in Tomcat. It does run in the IDE with Jetty.

I tried numerous Tomcat instances (including a fresh installation) on numerous systems, and none of them can run the RAP demo WAR file created on my development system. I compared everything in the OSGI console between a working and non-working instance. All plugins have the precise same version and qualifier, and they each show the same OSGI state. The servletBridge jar file is also the same version. And the WarProducts tool used to create the WAR file is also the same (0.2.2.201212132117). I get the same failing result when I copy the WAR file to other systems, so I don't think it's an OS problem. Also other web apps run fine in Tomcat while the RAP demo does not.

When I run the WAR file created on my development system, the Tomcat and eclipse logs show no problems, and the OSGI state of each plugin is exactly as expected. But the ServletBridge is unable to locate the entrypoint, as evidenced by the Proxy Servlet 404 response. I've verified permissions, and I can't see any reason why the web app is unreachable.

I saw a cryptic entry in a forum post saying that some people have had problems running RAP on some versions of Tomcat, but I couldn't find any specific info along these lines. Does anyone know of such problems? What else can I look at to see why this one particular WAR file of the RAP demo will not run properly on any system?
Re: RAP app will not run from WAR file [message #1044526 is a reply to message #1043730] Thu, 18 April 2013 22:42 Go to previous messageGo to next message
Mark Leone is currently offline Mark Leone
Messages: 67
Registered: April 2012
Member
This was not a RAP problem per se, but an eclipse build problem. I had patched org.eclipse.rwt and org.eclipse.jface to enable the Nebula widget XViewer to run in RAP with read-only StyledText widgets and CellLabelProviders replacing the StyledCellLabelProviders. The patched plugins, placed in my workspace with a later qualifier than the target version, were selected in lieu of the corresponding target plugins. They were properly deployed in the WAR file and shown in the OSGI console as ACTIVE. But for some reason, in the WAR file created on my work computer only, org.eclipse.rwt was failing to resolve gov.mozilla.javascript.ErrorReporter, although it was present in the "rhino" folder which was specified as a class library location. I don't know why the class could not be resolved, but some colleagues had similar build problems trying to patch SWT in an RCP app some time ago.

I resolved the problem by abandoning the rwt and jface patches, and patching XViewer instead. The WAR file ran properly after that. When I removed the patched plugins and selected the original plugins, the workspace launcher started blowing up because of a failure to resolve AbstractUIPlugin. It took (no exaggeration) over three hours and more than a dozen times re-setting the target, re-launching the IDE with -clean, cleaning the workspace, and invoking specialized language that I use when software tools become part of the problem and children are not present, but I finally got the workspace launcher to work properly again. If I ever voice plans to patch rwt or swt again, my colleagues have instructions to slap me on the back of the head.

[Updated on: Thu, 18 April 2013 22:44]

Report message to a moderator

Re: RAP app will not run from WAR file [message #1047428 is a reply to message #1044526] Tue, 23 April 2013 03:34 Go to previous message
Ralf Sternberg is currently offline Ralf Sternberg
Messages: 1290
Registered: July 2009
Senior Member

> If I ever voice plans to patch rwt or swt again, my colleagues
> have instructions to slap me on the back of the head.

Good to hear that the problem is solved and the guilty will be punished ;-)

Thanks for the update!

Ralf

--
Ralf Sternberg

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Previous Topic:UI not blocked during a long event.
Next Topic:computeSize returns different values after some point of time
Goto Forum:
  


Current Time: Sat Aug 23 03:35:49 EDT 2014

Powered by FUDForum. Page generated in 0.16239 seconds