Worklight 5.0.5 project migration to Worklight 6 errors

I had a Worklight 5.0.5 project.

I wanted to try out the latest Worklight – version 6 from : http://www.ibm.com/developerworks/mobile/worklight/index.html

I downloaded it – and imported my exported 5.0.5 project into the new Eclipse with Worklight 6.0 in it. The migration process seemed to pass successfully. However I had compilation errors for the server/java folder where I had some custom java authentication code. The errors were:

The type MyCustomAuthenticator must implement the inherited abstract method WorkLightAuthenticator.processRequest(HttpServletRequest, HttpServletResponse, boolean)

Image

It turns out the HttpServletRequest and associated javax.servlet objects could not be resolved. This is because Worklight 6 uses Websphere Liberty as the internal server and not Jetty – which was used in previous verions as the web container.

To fix the problem follow these steps :

1. Right click project -> properties
2. On properties dialog choose “Java Build Path”
3. Choose the “Libraries” tab
4. Press on “Add Library…” button
5. Select “Server Runtime” and hit “Next”
6. Select “Worklight Development Server” and hit “Finish”

Then do a project clean / restart eclipse and make sure all the imports are then resolved.

The Worklight 5.0.5 project will now build successfully using Worklight 6!

Leave a comment