0
votes

Afternoon All,

Here is my context:

I am setting up an existing worklight project with App Envs for IPhone, Android, and Mobile Web.

When using the Worklight Console to preview the apps, I get context root errors from the iPhone app only. (I get the Error: The Server was unable to process the request from the appl...)

When I open the browsers JS console, I see the problem is that the app is requesting the wrong context root. It is accessing the /worklight/ context, which is not there.

The contextroot that does work is the following: http://localhost:8080/apps/services/api/[APPNAME]/iphone/init

The Context root that the iphone is trying to hit: http://localhost:8080/worklight/apps/services/api/[APPNAME]/iphone/init

Here is the weird part. The context root is fine for the Android, and Mobile Web environments. Only the iPhone environment is having context root issues.

All three environments are sharing the same application-descriptor.xml file and same server.

Below are some file outputs.

Files below:

/server/conf/worklight.properties

publicWorkLightHostname=localhost
publicWorkLightProtocol=http
publicWorkLightPort=8080
publicWorkLightContext=/worklight/

/apps/[APPNAME]/application-descriptor.xml

<worklightServerRootURL>http://localhost:8080</worklightServerRootURL>

So a couple of questions.

1) When setting the context roots, what is the relationship between the client and server. Do the context roots have to match between the two? Is one a master and the other simply slaves from that and does not need settings?

2) (Somewhat unrelated) While debugging this issue I have come across zero documentation about how to go about "un-deploying" the server in the Eclipse dev ide. (un-deploy the server is right from IBM's documentation) I need to know how to redeploy the server when I make changes to the server settings (worklight.properties). I have seen references to cracking open the war manually, to just stopping and starting the server in the IDE.

Any help is greatly appreciated.

1

1 Answers

1
votes

If you are using a context root, it must exist in both worklight.properties and application-descriptor.xml. make sure both match, then re-build and deploy and see if the problem persists.

When using the development edition of Worklight, your server is based on Jetty which is run within Eclipse (it is bundled with the Worklight Studio plug-in you have installed in Eclipse). You do not need to "undeploy" anything. Simply make the changes to worklight.properties and application-descriptor.xml and re-build your application. The changes will make their way to both the server and client.

Do note, though, that using a context root is mainly for when using application servers such as Tomcat, Liberty or WAS.