ibm-mobilefirstmobilefirst-studiomobilefirst-cli

MFP CLI v7.0 cannot build-deploy project initially created with MFP Studio v7.0


Problem Context: We initially created a MFP project (native API for iOS) using MFP Studio plugin v7.0 for Eclipse. We have this project under source control (Git on DevOps).

Problem: After pulling down the MFP project code from Git (fresh pull), if Studio is first used to “Deploy Native API” and to “Deploy Mobile First Adapters”, everything is compiled, built, and deployed just fine. We can then invoke the adapters from Studio just fine, without any problems. After doing so, we can then also switch to the MFP CLI for building and deploying artifacts and the CLI commands work just fine.

Now, if after pulling down the code from Git (fresh pull), instead of using Studio, we start using right away the MFP CLI for building and deploying artifacts, errors occur. It seems that the MFP CLI is missing steps that Studio knows how to do. The errors we get when using the CLI right away for building and deploying (mfp bd) after a fresh pull from Git are the following:

$ mfp info OS: darwin x64 Release: 14.3.0 System Memory: 2845 MB free out of 16384 MB Node: v0.10.30 MobileFirst CLI: 7.0.0.00.20150430-1604 Current directory: /Users/olivieri/git/Ready.App.5.Loyalty/LoyaltyReadyApp

Current project: /Users/olivieri/git/Ready.App.5.Loyalty/LoyaltyReadyApp

Adapter: LoyaltyPushAdapter (/Users/olivieri/git/Ready.App.5.Loyalty/LoyaltyReadyApp/adapters/LoyaltyPushAdapter/LoyaltyPushAdapter.xml) Description: LoyaltyPushAdapter Type: http Procedures: submitNotification

Adapter: LoyaltyUserAdapter (/Users/olivieri/git/Ready.App.5.Loyalty/LoyaltyReadyApp/adapters/LoyaltyUserAdapter/LoyaltyUserAdapter.xml) Description: LoyaltyUserAdapter Type: java Procedures: [Unavailable for Java adapters]

Application: Loyalty (/Users/olivieri/git/Ready.App.5.Loyalty/LoyaltyReadyApp/apps/Loyalty/application-descriptor.xml) Description: Loyalty Type: native ios

Server location: /Users/olivieri/.ibm/mobilefirst/7.0.0.00.20150430-1556/server Server binary: /Users/olivieri/.ibm/mobilefirst/7.0.0.00.20150430-1556/server/wlp/bin/server MobileFirst instance: /Users/olivieri/.ibm/mobilefirst/7.0.0.00.20150430-1556/server/wlp/usr/servers/worklight objc[4021]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.7.0_75.jdk/Contents/Home/jre/bin/java and /Library/Java/JavaVirtualMachines/jdk1.7.0_75.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined. WebSphere Application Server 8.5.5.4 (1.0.7.cl50420141121-1414) on Java HotSpot(TM) 64-Bit Server VM, version 1.7.0_75-b13 (en_US)

Environment variables: TERM_PROGRAM: Apple_Terminal ANDROID_HOME: /Users/olivieri/android-sdks TERM: xterm-256color SHELL: /bin/bash TMPDIR: /var/folders/c9/gf_f0_sd60q1mm9kxwgvlxsr0000gn/T/ Apple_PubSub_Socket_Render: /private/tmp/com.apple.launchd.QL5sT9RU2F/Render TERM_PROGRAM_VERSION: 343.7 TERM_SESSION_ID: 6798439A-3592-4D5C-ABFE-7A2E2D5D80BA ANT_HOME: /Users/olivieri/Development/apache-ant-1.9.4 USER: olivieri SSH_AUTH_SOCK: /private/tmp/com.apple.launchd.E1N6IPACu1/Listeners __CF_USER_TEXT_ENCODING: 0x1F5:0x0:0x0 PATH: /Users/olivieri/Development/apache-ant-1.9.4/bin:/Users/olivieri/Development/checker-276:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Applications/IBM/MobileFirst-CLI:/Applications/IBM/MobileFirst-CLI:/Users/olivieri/Development/gradle-2.3/bin:/Users/olivieri/android-sdks/tools:/Users/olivieri/android-sdks/platform-tools PWD: /Users/olivieri/git/Ready.App.5.Loyalty/LoyaltyReadyApp JAVA_HOME: /Library/Java/JavaVirtualMachines/jdk1.7.0_75.jdk/Contents/Home LANG: en_US.UTF-8 XPC_FLAGS: 0x0 XPC_SERVICE_NAME: 0 HOME: /Users/olivieri SHLVL: 2 LOGNAME: olivieri DISPLAY: /private/tmp/com.apple.launchd.qHj5hi31Kp/org.macosforge.xquartz:0 _: /Applications/IBM/MobileFirst-CLI/IBMnode/bin/node WLP_USER_DIR: /Users/olivieri/.ibm/mobilefirst/7.0.0.00.20150430-1556/server/wlp/usr

$ mfp restart objc[4345]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.7.0_75.jdk/Contents/Home/jre/bin/java and /Library/Java/JavaVirtualMachines/jdk1.7.0_75.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined. Stopping server worklight. Server worklight stopped. Initializing MobileFirst Console. objc[4386]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.7.0_75.jdk/Contents/Home/jre/bin/java and /Library/Java/JavaVirtualMachines/jdk1.7.0_75.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined. Starting server worklight. Server worklight started with process ID 4385. Ricardos-MBP:LoyaltyReadyApp olivieri$

$ mfp bd [Error: BUILD FAILED /Applications/IBM/MobileFirst-CLI/mobilefirst-cli/node_modules/generator-worklight-server/lib/build.xml:135: The following error occurred while executing this line: /Applications/IBM/MobileFirst-CLI/mobilefirst-cli/node_modules/generator-worklight-server/lib/build.xml:167: The following error occurred while executing this line: /Applications/IBM/MobileFirst-CLI/mobilefirst-cli/node_modules/generator-worklight-server/lib/build.xml:185: Build of the adapter 'LoyaltyUserAdapter' failed. The failure message is: '/Users/olivieri/git/Ready.App.5.Loyalty/LoyaltyReadyApp/adapters/LoyaltyUserAdapter/lib does not exist.'. The failure may have been caused due to incorrect Java code, incompatible JDK level, JAVA_HOME not pointing to the location of a valid JDK or missing dependencies. Note that the worklight-jee-library.jar must be in the classpath when building Java adapters.

Total time: 2 seconds ] Error: Sorry an error has occurred. Please check the stack above for details.

Our JAVA_HOME is set correctly and we are using a compatible JDK level.

Any ideas on what could be the possible cause for this error?


Solution

  • Did you make sure to place a .gitkeep file in the java-adapter-folder\lib folder? The folder by default is empty and GIT does not preserve empty folders, and so when downloading this project from GIT the folder will be missing, but it may be required for the build process.

    Try adding the missing folder and see if this helps. Based on the results we'll have an action item out of it.