I want to execute a java code in MobileFirst Client App Desktop Environment.
In this link I can invoke Java classes from the adapter but I don't want that method since I need to update the war file in our server if I do this.
https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/7.0/server-side-development/using-java-adapters/
I want a way without updating the war file in the server.
I also tried using WLResourceRequest to invoke a Java Adapter but its not applicable in desktop environment.
Is there a way to execute a java code aside from the ones I mentioned above?
In v7.x, the only way to execute Java code is when the class resides in the .war file that gets deployed to the server.
The Desktop environment in v7.1 does not support Java adapters. The only way is to use Java in JavaScript adapters (See: https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/7.1/server-side-development/javascript-adapters/using-java-adapters/) but this, too, requires the Java code to reside in the war file.
In v8.0, however, there is no more war file deployment and Java adapters support the web platform (which means both mobile web and desktop browser). Consider upgrading.
Related
I am working on MobileFirst platform for hybrid app development. I am following this tutorial as I want to use my existing java classes for web service call. And It is working fine on Android.
https://developer.ibm.com/mobilefirstplatform/documentation/getting-started-7-0/server-side-development/using-java-adapters/
Does this works across all platforms. I want to run the same in Windows Phone also.Will this adapter be called on Windows Phone. What is the scope of using Java in JavaScript adapters.
Adapters are sever-side entities. The Java code is executed on the Server and so it does not matter from which client-side application you are calling the adapter from, be it Android or Windows Phone or anything else.
My team is working on the migration of a hybrid app from Tibco Silver Mobile(TSM) platform to IBM MobileFirst Platform.
I have a JAX-RS webservice developed using Weblogic IDE which is currently hosted on TSM server. This webservice does a security check for all the incoming back-end requests and pass the request to the back-end if it is from a valid source.
When the app will be migrated from TSM to MobileFirst platform the TSM server will be moved out of the scene. I am looking for some alternate options for hosting this JAX-RS webservice. I don't want to make any changes to the webservice since it is a tested and proven code used in the TSM based solution.
I understand from the IBM MobileFirst Platform 7.0 documentation that JAX-RS support is now available on the MobileFirst Server and JAX-RS specification based Java adapters can be developed and deployed to the server.
Can I deploy the above mentioned webservice .WAR file as such to MobileFirst Server, without making any customizations?
If yes, what is the procedure for deploying the webservice (.WAR) to MobileFirst Server?
If no, what are the alternate options that can be considered?
As indicated in the comments above:
MFP Server is actually a Java EE application deployed to a supported Java EE application server, WebSphere Liberty or full WebSphere ND being the normal options, though TomCat is also supported.
In principle your own JAX/RS WAR file can be deployed to these same servers, the details will depend upon exactly what Java EE features you exploit and you will need to understand those Java EE servers' administration model. MFP itself is not affected by this, and you need no MFP knowledge to do it. You just need to understand the chosen Java EE server. Personally I would start with WebSphere Liberty.
A further question would be whether it is better to isolate your JAX/RS and Mobile First servers into their own Java EE server instances. It can be easier to manage and scale if you keep things separate, but technically there should be no interference if you do co-locate them. It is pretty trivial to spin up a dedicated Liberty server.
A more interesting question is whether there is value in actually exploiting the MFP Adapter capability to create JAX/RS services. In effect it's your familiar JAX/RS programming model but packaged slightly differently, deployed as a MFP adapter, and with the option explicitly to exploit the MFP security model and easily call other MFP adapters.
Personally, if I were coming to a project with no existing JAX/RS services and have commited to MFP and its security model then I would do my JAX/RS in the MFP Adapters.
I'm running MobileFirst 7.0 on a Liberty installation.
Having successfully deployed my application and adapter into the runtime, the preview, when run from the servers operations console, is apparently trying to communicate with the adapter from the development server rather than the one running on Liberty.
[/MaximoMobile/apps/services/api/PhyCount/common/query] failure. state: 404, response: undefined
The runtime on the server is not called MaximoMobile, that is just the name of the project within Eclipse. It shouldn't be being referenced at all outside of the local copy of Mobilefirst.
I've looked up documentation in instructing the application to use the deployment server rather than the development server using JNDI entries in the server.xml file (http://www-01.ibm.com/support/knowledgecenter/SSHSCD_6.3.0/com.ibm.worklight.deploy.doc/admin/t_using_JNDI_lookup_to_override_WL_properties.html), but I can't see anything incorrectly set, or anything even relating to the adapter.
I have managed to set the endpoint to /worklight as required using Eclipse, but it's still returning 404 and attempting to access a non-existent file.
Answering my own question for people who may later stumble upon this looking for an answer:
The preview on the server doesn't work in the same way as the local preview does, and any part of the interface that requires an adapter won't function.
If you need to test the connection to the server, deploying to a device will allow you to do so!
Using NetBeans, I made a very simple EJB application client (and a EJB server, of course) which runs on Glassfish and uses a jar with the EJB remote interface. The application works without problems.
But I decided to run the ".jar" (which is the application client itself) on a remote machine, with Java SE, Java EE, and Glassfish installed. I searched for a while and it seems to be very simple (using Glassfish command line). Can someone help me please?
Thanks.
I am trying to move a web application that currently runs on WebSphere 6.1 application server over Glassfish 3.X. I currently have a set of WebSphere jacl files that configure an instance of a WAS for my web application (data sources, queues, etc.) and a .bat and a .sh file that execute the jacl files (I think via wsadmin). I develop on a WAS instance on my Windows PC and the software is tested on a WAS instance installed on a Solaris test machine.
Is there the equivalent concept for Glassfish?
That is, does Glassfish have a concept of a platform independent administration scripting language like WebSphere jacl/jython that can be executed from a call from a Windows .bat file or a Unix .sh file?
I'm relatively new to web development and so I may have made some conceptual mistakes and you may also have to fill in some gaps in my question.
Thanks
You can feed a configuration script to asadmin, that contains asadmin subcommands like deploy and create-jdbc-resource, etc...
The 'language' does not have any real flow-of-control or looping constructs, so you would need to flatten those types of things out of the script that would get called by your dot-bat or dot-sh.
If you are really leveraging jacl/jython this might not be possible... but if you aren't putting these interpreters through their paces, the asadmin 'language' may be rich enough for you.
Yes, take at a look at the "asadmin" command. It should be able to configure most anything you need from a script.