MobileFirst client properties does not seems to change - ibm-mobilefirst

In my project even if i change my server host using build settings and deploy target , the client properties does not change in the wlClient.properties file , however the context path changes to new one, the server host url is pointing to my local host now ,also one thing i have noted that wlBuildId this property is missing in the file
My version is :7.1.0.00.20150901-2103
What i have done :
Changed the server url in Right click > Run As > Build setting and Deploy target and rebuild the project even after rebuilding the wlClient.properties file the wlServerHost property doesn't change
Attached the settings screen along with this

I finally tracked down the problem , actually it was a bug in the build i have installed.
I installed the mobile first plugin from eclipse market which was of version 7.1.0.00.2015 which has the bug, then i removed the plugin and downloaded the package from IBM Mobile firsts website which was of build version 7.1.0.00.2016 which has the fix for this bug and it is rectified now.
The point to note is that the package in the eclipse's market has to be changed to the new build in which the issue is fixed.
Thank you

Related

Is there a way to clear IBM MobileFirst Platform server Cache?

I'm working on an IBM MobileFirst Platform 7.1 project where there are many name value pairs in the worklight.properties file.
Say for example,
HOST_NAME = www.google.com
I access these variables form the MobileFirst adapter.
var hostName = WL.Server.configuration["HOST_NAME"]
There will be cases where I'll have to change the HOST_NAME in the worklight.properties to a different value. But sometimes, even after the value is changed in the worklight.properties file, they are not getting updated in the adapter.
Every time when I change the values I do the following,
Clean the project
Restart the server
Deploy the adapter again
Nothing seemed to change the value.
I suspect, the MobileFirst server caches the values and reuses the old values without updating the new ones. I say this because, I tried deleting the values in the worklight.properties file, and even tried deleting the file itself. Still the adapter was using the old value.
I tried deleting the MobileFirstServerConfig Folder in my workspace. Even that didn't work.
It would be great if someone could help me clear the cache or find a work around to this issue. Thanks in advance.
I kind of followed the above method but initially it didn't work.
But later I tried to follow these steps in this exact order and it seemed to work.
Stop Worklight Server.
Remove your project from Mobile First Development Server.
Go to the "bin" directory and remove your project war.
Clean and Build the entire workspace.
Start the server
Deploy the adapters
Run your app.
The worklight.properties file is embedded into the project runtime WAR file. So, if you change anything in worklight.properties, you must rebuild the WAR file and redeploy it. Based on your description, it sounds like you're only building the adapter (and not the app). At minimum, I would suggest to remove the runtime WAR file from the project "bin" directory (just to ensure that it gets rebuilt) and build all app environments. That should build / redeploy the WAR file and restart the server, and then what you're doing should work.
Here are the steps to follow:
1. If worklight server is up and running, stop it or restart your system.
2. Clear bin folder.
3. Do Clean Project and Build for enviournment.
4. Open Mobile first Console(Start server)
5. Deploy All adapters
6. Run your app.
If wlq or wl error is comming we can give an alert message 'test' in our main file where we have all the javascript files.

Worklight Console does not show new changes to project -- seems to use original code

I am running Eclipse Luna 4.4.1 with Worklight Studio 6.2...
I have made changes to my Worklight project. For some reason, I cannot get these changes to be seen/previewed when opening in the Worklight Console...
I have made simple changes such as adding print (console.log) statements to see if these changes are making it out to the console... I have even removed design elements to see if I can get this preview to error out...
Here is what I do:
Highlight the app folder (the folder under the "apps" folder) and right-click
Select Run As > 2 Build All Environments
Once that is complete, I highlight the project folder (the topmost folder in the project) and right-click, selecting Open Worklight Console, which opens the console in Firefox
Click the Preview as Common Resources link in the Console
The "old" code/project runs -- no changes appear
I have tried Cleaning the project, closing and re-opening Eclipse, rebooting my machine, etc. but nothing seems to shake this up. Worklight seems to use the "old" code no matter what I do in Eclipse...
Is there a setting on Worklight I may be missing?
Starting Worklight 6.2 you do not need to either build or deploy your application in order to see changes made to web resources.
The following should suffice:
Create a Project and application
Run As > Run on Worklight Development Environment
Open console, view the application (keep this tab open)
In Eclipse, change some resource (image, CSS, HTML, JavaScript)
Return to the previously opened tab and refresh it
The change should be visible to you.
Something to try:
Close Eclipse
Open your TMPDIR and delete the wlBuildResources folder
Open Eclipse, try again
You can also try adding a mobile environment to your application; there are some reports this some times, show how, helps 'refreshing' the web resources used while previewing applications
You can also make sure you are using the very latest 6.2.0.01 iFix; there were preview-related fixes in the past. You can get it from IBM Fix Central website (assuming you are an IBM customer/business partner; for evaluation purposes you should download the latest available version, from the Eclipse Marketplace - v6.3)
Note that Run As > Build all environment does not actually deploy your modified web resources to the server, it only generates the .wlapp for later consumption elsewhere, so I suggest to follow my steps at the very top of this answer, by using Run As > Run on Worklight Development Server, and later on simply save (ctrl/cmd-s) and then go to the console to verify the changes are there.

How to Fix No MBean found for Worklight project?

I have a problem when deploying my Worklight project on the server . It shows the following Error Message :
FWLSE3041E: No MBean found for Worklight project 'MyProject'. Possibly the Worklight runtime web application for Worklight project 'MyProject' is not running. If it is running, use JConsole to inspect the available MBeans.
and when I tried to preview my application it showed this message :
SRVE0777E: Exception thrown by application class 'com.worklight.core.auth.impl.AuthenticationFilter.verifyServletInitialized:420'
I had the same issue using Worklight 6.2 CLI, but recreating the project did not work.
One issue that I had was that worklight did not build a .war-file properly, so I copied the .war-file from a backup.
Edit: This happens regularly in our project now, and we have no idea why. We fix it by invoking any procedure, which makes it work until you restart the server. Worklight must be building something when invoking a procedure that it does not do when building.
I Solved The problem by creating a new Worklight Project and copied all my files , it works just fine :) I used Worklight 6.1 instead of 6.2
I solved this by fixing a recently created security test in
server/conf/authenticationConfig.xml
The problem was I mispelled the Realm name I previously defined.
I solved this problem by deleting the application from the worklight server and rebuild it.
Delete WorklightServerConfig folder in workspace and rebuild your application.
I was able to fix this in MobileFirst 7.0 (Fka Worklight) by opening the Servers view, Window -> Show View -> Servers. Then expanding the MobileFirst Development Server and right click on the project in question, chose delete.
Once you do that go back to the applications' directory in the "apps" directory and right click -> Run As -> Run On MobileFirst Development Server
This should rebuild and deploy the project on the server.
I solved the problem by using ibm jdk not open jdk. My solution is to make sure the env parameters are correct
export JAVA_HOME = $your_ibm_jdk
export PATH + $your_ibm_jdk/bin:$PATH
run java -version to make sure the setting work

IBM Worklight 6.0 - Dojo library uses localhost after deploy

I have a Worklight 6.0 project that uses the new Dojo 1.9 libs, I created an external dojo project, like the documentation suggested, then, in the main project properties, under "Dojo toolkit", it references this dojo19 project.
The project works on the local server, then I did "Run As" | "Build for Remote Server...", and entered the correct domain:port and context path, clicked Build, the *.wlapp files were updated. (I've also updated the settings for publicWorkLightHostname / publicWorkLightPort / publicWorkLightProtocol in the "Environment Entries for Web Modules" in the installed war to match the remote server names/port/protocol.)
But, after deploying both war and -all.wlapp file, accessing the app I get JS errors when it tries to refer to the dojo19 library:
The page at
https://<myIP>:9443/<myproject>/apps/services/www/ /mobilewebapp/default/IODMobile.html
ran insecure content from http://localhost:64441/dojo19/<myproject>/IODMobile/mobilewebapp/dojo/nls/core-web-layer_en-us.js.
The dojo19 is the project name in my Worklight developer workspace that I referred to above.
Why is it trying localhost? Seems there's a missing step here in deploying the dojo library project into Worklight.
Where are you trying to preview the application when you get the error message?
See the changes in Dojo in Worklight 6.0
If launching the application in emulator/simulator/device, see Billy Rowe's answer in this question
Partial copy/paste:
Step 1: Verify your application works in the Mobile Browser Simulator
with Provide Library Resources checked. If the Console log is showing
resources being served from the server, then these have to be copied
to your application before deploying to AVD or a device
Step 2: After you think you have all Dojo/resources within your
project, uncheck Provide Library Resources and test it again in MBS.
If it fails in MBS, then something is missing in your application that
is in the library/server. You can check Provide Library Resources and
retest to see if it shows you what that is. Not all resources are
shown, e.g. if there's a missing CSS file.
Also I would suggest to do all of this in the Development environment (that is, in Eclipse) before starting to deploy the .war file and .wlapp file etc... (which, BTW, I hope you're doing based on the new instructions for Worklight 6.0)
In the information center, it will show you how to uncheck the Provide Library Resources in the Console Log.
I think what you're running into is:
1) Something is being served from the Dojo Library/Server
2) A bug in 6.0 that used "localhost" instead of the IP of the host (your machine running eclipse). This is fixed in the 6.0 iFix. With this fix, you can run your app external to Studio and still use the Dojo Library/Server. Without this fix, you must have everything you need within your app.
Can you install the iFix and let us know if that fixed the problem?

IBM Worklight 6.0 - SRVE0777E: javax.servlet.ServletException: Worklight Project not initialized

I've just installed Worklight 6.0 on Mac OS X Mountain Lion 10.8.4.
I'm trying to build a very simple HelloWorklight app to test the installed environment and I'm getting errors building and deploying it.
I'm getting these errors in Eclipse console:
[2013-07-13 02:11:21] Starting build process: application
'HelloWorklightApp', all environments
[2013-07-13 02:11:21] Application 'HelloWorklightApp' with
all environments build finished.
[2013-07-13 02:11:21] Deploying application
'HelloWorklightApp' with all environments to Worklight Server...
[2013-07-13 02:11:21] Failed to deploy the application to
Worklight server: Worklight module
HelloWorklightProject was not
successfully started. Full details of the error are available from the
Worklight Development Server console.
The Worklight Development Server console in my browser shows:
Application Error
SRVE0777E: Exception thrown by application class
'com.worklight.core.auth.impl.AuthenticationFilter.doFilter:110'
javax.servlet.ServletException: Worklight Project not initialized
at com.worklight.core.auth.impl.AuthenticationFilter.doFilter(AuthenticationFilter.java:110)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:194)
at [internal classes]
I'm truly stuck. On the other hand I'm sure it must be something simple to fix it.
Has anyone got an idea how?
I had a similar problem (at least WDS console error looks the same).
A little bit history:
My problems started, when I updated Worklight to version 6 (with version 5 I had no problems). Some compilation erros were fixed by adding Websphere Library to a project. But my custom authentication still wasn't working.
How I fixed it:
open new workspace in Eclipse
import Worklight project
clean project
restart Eclipse
downgrade compiler compliance level (in Eclipse: Window > Preferences > Compiler and set "Compiler compliance level" to lower version)
rebuild project and try to run it
At this point it started to work. I've spend lots of time to find out that compiler stuff, but still I'm not sure which part requires that.
So we had this issue with 2 macs and it took us a solid day and a half to figure it all out.
We went through a lot of reconfiguring, re-downloading eclipse and worklight.
Make sure your config files from the update are correct. (worklight.prop and authConfig)
This is the big one. Install JDK 1.7 and reference the new JRE 7. When we
were running on Oracle JRE 6, we had a ton of errors and even a Java
Heap memory issue.
Once you install it, it may to be tricky to find the actually path to the JRE.
First, go to Eclipse > Pref > Installed JRE's > Add
Then, add a new standard vm. Click Directory on the next pane and browse to the install path of JRE.
We found it in [name of your HD] > Library > Java > JavaVirtualMachines > jdk1.7.0_25.jdk > Contents > Home > jre
It should load everything it needs and you can click the check box of the new JRE. For good measure, I changed the compiler to 1.7 as well.
The jdk folder may have a slightly diff name depending on what update you have. Hopefully this helps.
I got the same error after deploy an new app deployment.
What I've done on Server is:
delete all application
delete all extra configuration between new server instance and my current instance. In my case it was: applicationMonitor and shared librairy
clean
restart
After that I managed to deploy my application normally
window -> show view -> servers -> server configuration -> HTTP EndPoint -> host
By default the host will be *. Try to change the host as your local machine ip address. for example host = . After changing the host, close the server.xml and then try to rebuild the project.