I'm currently running a (free) Google App Engine instance which I need to restart manually.
However, in the 'instances' tab in my project it just gives me the options to 'view logs' or 'shutdown'.
Shutting down the instance is not an option because I do not want to manually re-deploy the application to google appspot. This is not an option because I need to do this from multiple locations (even on the road), and my project is located on a single desktop computer.
The reason I want to be able to restart the instance is because of the caching within my Java application. I cache certain users and data so that I only rarely have to call the datastore.
However, when I want to delete certain records from the datastore they still exist in the cache of my application. This means that the users can access data which was already deleted by hand.
I know it's possible to write a single-use admin application just to clear the cache, but that's not the way I wish to solve this problem. It should be easier than that.
Is there any way to restart a running instance, effectively rebooting my Java application, without re-deploying the entire application to google appspot?
Go to the Datastore viewer tab in your App Engine console. Click on "Flush memcache" button. Or, go to the Memcache viewer tab and click on "Flush cache" button.
If you want to restart your instance manually - shut it down. Then hit your website, and a new instance will be created automatically. There is no need to redeploy your app again.
The "Flush memcache" approach didn't work for me. I couldn't find where to shutdown a service either.
Instead, I found a way to delete the instance being served then hit the application's url. App engine would automatically create a new instance, which essentially would be a restart.
To delete an instance, do this:
From App engine dashboard, click "Instances" on the side menu. On the Instances page—below the graph—you would see a list of active instances, delete them, then hit your app's url.
Related
I have a question regarding updating a application on websphere application server. The application is already up and running and I just want to update the code which is packaged in a .ear file. Here is what I thought I should do:
stop the application server.
go to my enterprise application, select the one I am updating, and click update.
point to my .ear file in replace the entire application radio button option.
restart my application server.
After doing this and trying out my application, it is still running the old code, which makes me really confused. The only way I managed to get it to work is to use WinSCP, manually go to the cell directly/installedapps and replace the whole .ear folder. I dont think this a viable solution moving forward.
I solved it. After some intense digging it seems the binary files were expanded into dmgr profile but not my correct node. After finishing the update instead of clicking save I click review and there is a checkbox to synchronize the nodes, which then did the trick.
To update existing enterprise application we do not have to stop the application since WAS stops the application before updating the code .
Based on the update you gave i am assuming this is a network deployment manager setup , so possibly problem is with sync is not taking place after updating the app and save .
Are you explicitly invoking sync operation after application update ? If not , i would recommend that.
Still problem persists then most likely for what ever reason nodeagent process is not invoking app expansion into installedApps folder but you can take a quick look at nodeagent systemout.log file or ffdc files to see if there is any clue about expansion process.
As a work-around you can also use EARExapnder.sh/bat tool available /profile_home/bin directory to expand the application into installedApps when the app is really updated in config/cells/cell_name/applications but not under installedApps folder.
I hope this helps.
Thanks
VT
These opinions are my own.
I have a signed applet which I'm loading on my web page. When Java7u45 was released, this security dialog started to pop up:
I read that I need to add certain attributes (Application-Name and Built-By) in the Manifest file of my JAR, but no matter what I add, the Application and Publisher fields are always UNKNOWN. Is there any way to get these values populated?
ANSWER: I accidentally found the reason why these fields were not populated. It seems that you have to have the Java Cache enabled in the Java preferences, in order for the Java to cache the applet information and display it to you the next time you try to load the applet. In my case, I've disabled the Java cache, but when I re-enabled it, the Application, and Publisher fields started to populate properly.
App details:
I am writing an app that requires the user to have a device password set. The company distributes blackberry devices to its associates who will then use them to report on sales etc. The company wants to make sure that the device password is set so that the confidential information can not be easily accessed by anyone if they steal the phone. The app must not work if the password is not set, which is easy enough.
The problem:
The company wants the a message to come up saying "Please set a device password" and then direct the user to the device to the options menu to show them where to set their device password. Doing this seems troublesome
What I have tried so far:
I have looked into the ApplicationManager object, which allows you to bring an application to the foreground. However when I use the following code to see what applications are available:
ApplicationManager manager = ApplicationManager.getApplicationManager();
ApplicationDescriptor descriptors[] = manager.getVisibleApplications();
for(int i=0;i<descriptors.length;i++)
{
String applicationName= descriptors[i].getName();
System.out.println("applicationName");
}
The only visible applications are stuff like Phone, Messages, Blackberry Messages, Home Screen etc, but the options application is not present, which leads me to believe its not accessable from here. (If I'm wrong please let me know)
I have also taken a look at the Invoke.invokeApplication(appType, args) method, however the API does not have an appType constant for the options, or settings etc. The API specifies only the following types and I cannot find the one I need:
APP_TYPE_ADDRESSBOOK
APP_TYPE_BLUETOOTH_CONFIG
APP_TYPE_CALCULATOR
APP_TYPE_CALENDAR
APP_TYPE_CAMERA
APP_TYPE_MAPS
APP_TYPE_MEMOPAD
APP_TYPE_MESSAGES
APP_TYPE_PHONE
APP_TYPE_SEARCH
APP_TYPE_TASKS
I have scanned the API docs and I cannot find anything that looks right. Ive searched for Device and Options and Settings but none of the hits are relevant.
If anyone knows what to do then let me know.
Unfortunately there's no standard API to invoke this screen programmatically. But there's a workaround. Use EventInjector to inject a sequence of keyboard events to open Options screen.
This way is not an elegant one, but I think it is the only workaround in this case.
UPDATE:
I would implement the following approach. Upon application startup I would check, whether device is password protected via DeviceInfo.isPasswordEnabled().
If device is not password protected I would display message: Device is not password protected. Please set password for your device in the device Options. And launch the application again.
I understand, this way is not elegant, but it is reliable and provides full information to the customers, how to use this application properly.
Ok so as it turns out you can run internal apps using the ApplicationManager, so I launched the Options app using the following code:
ApplicationManager.getApplicationManager().launch("net_rim_bb_options_app");
However this only launches the Options app, and does not navigate the user to the Security section.
The following blurb from this page helped me understand what this method really does:
Starting
A BlackBerry application can be started in a number of ways:
by the system automatically on device startup
by another application
by the system at a scheduled time
Regardless of how an application is started, the Application Manager is responsible for starting the process the application will run within.
The ApplicationManager class enables applications to interact with the Application Manager to perform tasks, including:
run an application immediately or at a scheduled time
interact with processes, including retrieving the IDs for foreground applications
post global events to the system
Entry points
The Application Manager starts an application by getting a new process and spawning a thread within that process to call one of the entry points of the application. For many applications, the main() method of its application class is the single entry point that is called. But you can configure more than one entry point for an application.
Using more than one entry point lets you create different ways for a user to start an application. For example, if your application allows users to create a new document, you might like to provide users with two icons that they can click to start the application. Users could click one icon to open the application to its home screen and the other icon to open the application to the screen required to create a new document.
Summary
So basically this method just runs the main method of the app, and supplies the arguments in the main method. It is my suspicion that the main method of the Options app does not allow for you to supply the page you want to open up on as an argument in the main method.
There is no documentation (as far as I can tell) on what arguments the options app takes, so short of guessing how it can be used, it seems that directing the user here and giving them some instructions on how to navigate further is my only option
u_u
I have a web page where sometimes I need to communicate with a device.
This device is accessed with sockets, so I have a jar file with the support libraries.
When you want to get data from the device, you press a button, and a javascript method fetches the data using the library (no java code here)
The presence of the jar makes the java machine to start as soon as you load the page.
Since there is a lot of users that don't use this option (usually they don't even have the device, to begin with), they see that as a nuisance.
Is there a posibility to delay the java loading until the button is pressed ?
I don't want to redirect them to another page, that should be done in the same page.
You can load the jar file into a seperate div created dynamically via javascript, at the time you need it.
If you want to consider loading your application with java-webstart-technology, you can implement a button similiar to what oracle has on their page here
Basically what the button does is download the required jars specified in a jnlp-file and launch it.
I have blackberry app (java). My app stores some informations in files (file:///store/home/user/app_name/). When user removes app, these files don't delete.
I want to delete files when app is removed by user.
What is solution?
Don't store files this way - use Persistable for your app data instead: http://docs.blackberry.com/en/developers/deliverables/17952/Storing_objects_persistently_1219782_11.jsp
There are two "standard" ways to uninstall an application. The first, via Options - Applications menu. And the second, via javaloader -erase -f command.
Theoretically you can intercept the uninstall event for the first way (when you use "Options - Applications" menu), but you need additional application that receives this event and does the cleanup action.
To intercept and recognize an unknown event I do the following.
I write a simple BlackBerry app, that implements and uses GlobalEventListener and runs in background, and prints every intercepted global event guid to the system output and/or log with timestamps.
Now, uninstall your app from Options menu and inspect logged global event guids. After that install/uninstall another applications. And then inspect log/system output window to find out which events are related to uninstall action.
It does not guarantee 100% result, but at least you will get fun with coding, logging and exploring.