0

I am using ant script to deploy adapters and wlapp file over mobileFirstServer. I am using Java 7. Using the code below:

<target name="deploy-wlapp">
<taskdef resource="com/worklight/ant/deployers/antlib.xml">
    <classpath>
        <pathelement location="worklight-ant-deployer.jar"/>
    </classpath>
</taskdef>
  <wladm url="http://localhost:10080/worklightadmin" user="admin"    password="admin" secure="false">
    <deploy-app runtime="myTime"    file="/Users/admin/Documents/workspace/myTime/bin/myTime-iOSnative-    1.0.wlapp"/>
</wladm>
</target>

<target name="deploy-adapter">
  <taskdef resource="com/worklight/ant/deployers/antlib.xml">
   <classpath>
  <pathelement location="worklight-ant-deployer.jar"/>
 </classpath>
</taskdef>
<wladm url="http://localhost:10080/worklightadmin" user="admin"     password="admin" secure="false">
    <deploy-adapter runtime="myTime"       file="//Users/admin/Documents/workspace/myTime/bin/Requests.adapter"/>
</wladm>
</target>

I am getting the following error in terminal:

: com.ibm.worklight.admin.restclient.RESTException: Error accessing http://localhost:10080/worklightadmin/management-apis/1.0/runtimes/myTime/adapters?locale=en_US: HTTP/1.1 404 Not Found FWLSE3002E: The resource is not found. FWLSE3041E: No MBean found for MobileFirst project 'myTime'. Possibly the MobileFirst runtime web application for MobileFirst project 'myTime' is not running. If it is running, use JConsole to inspect the available MBeans. If it is not running, full error details are available in the log files of the server. at com.ibm.worklight.admin.restclient.RESTClient.getResponse(RESTClient.java:1247) at com.ibm.worklight.admin.restclient.RESTClient.getResponseWithTimeout(RESTClient.java:1324) at com.ibm.worklight.admin.restclient.RESTClient.getPOSTResponse(RESTClient.java:1442) at com.ibm.worklight.admin.restclient.RESTClient.getPOSTFileResponse(RESTClient.java:1464) at com.ibm.worklight.admin.commands.DeployAdapter.getResponse(DeployAdapter.java:41) at com.ibm.worklight.admin.restclient.ActionClient.execute(ActionClient.java:84) at com.ibm.worklight.admin.ant.types.AbstractActionElement.executeCommand(AbstractActionElement.java:76) at com.ibm.worklight.admin.ant.types.ActionElement.executeCommands(ActionElement.java:43) at com.ibm.worklight.admin.ant.WladmTask.executeCommands(WladmTask.java:705) at com.ibm.worklight.admin.ant.WladmTask.execute(WladmTask.java:459) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.Target.execute(Target.java:435) at org.apache.tools.ant.Target.performTasks(Target.java:456) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393) at org.apache.tools.ant.Project.executeTarget(Project.java:1364) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) at org.apache.tools.ant.Project.executeTargets(Project.java:1248) at org.apache.tools.ant.Main.runBuild(Main.java:851) at org.apache.tools.ant.Main.startAnt(Main.java:235) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)

In Eclipse the following error is shown:

ERROR ] FWLSE3002E: The resource is not found. FWLSE3041E: No MBean found for MobileFirst project 'myTime'. Possibly the MobileFirst runtime web application for MobileFirst project 'myTime' is not running. If it is running, use JConsole to inspect the available MBeans. If it is not running, full error details are available in the log files of the server.

The same code is running fine for other projects.

Idan Adar
  • 44,156
  • 13
  • 50
  • 89
kiran
  • 49
  • 8
  • are you able to deploy the binaries for myTime project directly through MFP console, without ANT? – Sami Jun 02 '15 at 16:12
  • @Hussain Eddin Yes. I am able to build and deploy project using mfp console. – kiran Jun 03 '15 at 04:49

1 Answers1

1

It's clearly mentioned in the IBM Knowledgecenter you have to mention the <WorklightInstallDir>/WorklightServer/worklight-ant-deployer.jar

So you have to mention the WorklightServer install directory path (absolte path to the worklight-ant-deployer.jar File)

SO your taskdef should look like

<taskdef resource="com/worklight/ant/deployers/antlib.xml">
    <classpath>
        <pathelement location="C:\IBM\MobileFirst_Platform_Server\WorklightServer\worklight-ant-deployer.jar"/>
    </classpath>
</taskdef>

The location is where your mobilefirst server is located. The jar file alone wont do the trick. So try it out by giving the absolute path to the mobilefirst production server

Kawinesh S K
  • 3,148
  • 1
  • 16
  • 29
  • Thanks for replying I gave the absolute path only. Just for uploading purpose I did some editing. Same script is work fine for other project for this I am facing issues. – kiran Jun 03 '15 at 05:42
  • @kiran the error occurs for you while deploying your Adapter right. – Kawinesh S K Jun 03 '15 at 05:52
  • yes. Error is occurring while deployment of app and adapter. – kiran Jun 03 '15 at 06:09
  • @kiran i think some server config is crashed if u can just try to move your project to someother location and try the same in both eclipse and also ant configuration. I mean new workspace import your project or copy paste it – Kawinesh S K Jun 03 '15 at 06:11
  • I am still facing the same error. I tried to deploy other projects with same script they are being deployed but myTime is only facing the problem. – kiran Jun 03 '15 at 07:14