Service is not running when OS is upgraded from Windows 8.1 to Windows 10 - service

We have upgraded windows from 8.1 to 10.
Now in Windows 10 services installed by us are not running.
The same services are running properly if we install these services on Windows 8.1.
ON windows 10, we tried below things which didn't solve the problem.
services-> select service -> properties -> Set [Log on] as LOCAL SERVICE
Set full permission to "perticuler" user or "everyone" user for the folder where service files exist.
Change owner of folder as "everyone", "system" or "perticuler" user where service files exist.
Below is a workaround which works but not feasible for us since it requires password and actually we want to know the actual reason behind this problem.
workaround :
1. services-> select service -> properties -> Set [Log on] as "This account" where user can be selected and it also requires password. Refer attached image.
Please note that the service is a dot net(c#) service and it runs internally a jar file. if it is able to run jar file then only service starts successfully.
Thanks in advance

I have found the cause and solution.
[Cause of problem]
Service unable to understand that, to run JAR file, which program should be run.
[Detail]
I tried to debug the code.
At the location where process is started, popup message like shown in below image is occurred.
location : processSample.Start()
It means that atleast once user need to select the program.
If we select [Java(TM) Platform SE binary] once, then after that the
service always runs successfully.
This behavior is in Windows 10 only.
In addition to program selection, user setting shown in image in question is also required to run the service.
I want to say that, in default program setting already correct program is selected for .jar files as shown in below image, but still windows 10 asks user to select program once.
[Solution]
Run JAR file from windows(c#) service with settings below :
sampleProcess.StartInfo.FileName = "javaw.exe";
sampleProcess.StartInfo.Arguments = "-jar Sample.jar";
sampleProcess.StartInfo.WorkingDirectory = #"C:\SampleFolder";
sampleProcess.StartInfo.UseShellExecute = false;
sampleProcess.EnableRaisingEvents = true;
sampleProcess.StartInfo.CreateNoWindow = false;
Here working directory is the location where the [Sample.jar] does exist.
additinally a Path environment variable must be set in order to execure "javaw.exe".
Before fix I had implementation as below which is not proper for every system environment :
sampleProcess.StartInfo.FileName = "Sample.jar";
sampleProcess.StartInfo.WorkingDirectory = #"C:\SampleFolder";
sampleProcess.EnableRaisingEvents = true;
sampleProcess.StartInfo.CreateNoWindow = false;

Related

i am facing error about apex images loading

There is a problem with your environment because the Application Express files have not been loaded. Please verify that you have copied the images directory to your application server as instructed in the Installation Guide. In addition, please verify that your image prefix path is correct. Your current path is /i/ (it should contain both starting and ending forward slashes, such as the default /i/). Use the SQL script reset_image_prefix.sql if you need to change it.
Starting with Apex 18.1.x.x.x we should be instead putting CDN location as static path for images. Local path will not be supported any further.
Take a look at below announcement :
https://blogs.oracle.com/apex/announcing-oracle-apex-static-resources-on-oracle-content-delivery-network
CDN makes application faster.
Coming to problem you mentioned, can be easily resolved by performing below steps :
Locate reset_image_prefix.sql . It should be under 'apex/utilities'
change directory :
cd apex/utilities
Connect to DB and check what is image prefix
connect to SQL as SYS
SQL> set serveroutput on
SQL> begin
2 dbms_output.put_line(apex_200100.wwv_flow_image_prefix.g_image_prefix);
3
4 end;
5 /
It should list /i/ or any other location you may have configured with
Note: whenever you run the above command change to the correct APEX user (version), so for APEX 19.1 you use apex_190100.
4. Now, check CDN address. For example Apex 20.1.X.X.XX location is - https://static.oracle.com/cdn/apex/20.1.0.00.13/
Same can be checked from https://blogs.oracle.com/apex/announcing-oracle-apex-static-resources-on-oracle-content-delivery-network
5. Now, its time to run SQL (assuming you have APEX 19.2.0.X.XX version)
SQL> #reset_image_prefix.sql
Enter the Application Express image prefix [/i/] https://static.oracle.com/cdn/apex/19.2.0.00.18/
...Changing Application Express image prefix
NEW_IMAGE_PREFIX
------------------------------------------------
https://static.oracle.com/cdn/apex/19.2.0.00.18/
Go to http://your-host:your-port/ords/apex_admin
Problem should be resolved by now!

Node-red in IBM Bluemix crashes while starting after sleeping (lite account)

After sleeping (in lite account type) node-red, created by node-red starter kit, crashes while starting. It is possible to login in editor for a few seconds and then it crashes with error code "an instance of the app crashed: APP/PROC/WEB: Exite with status 1 (out of memory)". Dashboard (node-red-dashboard) was installed before sleeping and worked correctly.
I tried to restart Node-RED, Stop and Start.
I solved this problem. The problem may be due to the memory overflow in the container Garden. Taking into account that the content is stored in the cache, the application cannot start after the restart process, it issues an Exit status 1 (out of memory) error.
The cache is updated only by pushing the application into the cloud.
An option that was checked for application recovery:
View the name of the database for NodeRED (which stores all information about the Node-RED) in Cloudant, for example, "nodered."
Install to PC Cloud Foundry Command Line Interface - CLI https://docs.cloudfoundry.org/cf-cli/install-go-cli.html
Download from github and unarchive the application's code bluemix-starter https://github.com/knolleary/node-red-bluemix-starter (clone or download -> download zip)
In the downloaded folder add a record to a manifest file (manifest.yml) in the env section, in which set the database name (for example, nodered) in Cloudant to environment variable NODE_RED_STORAGE_DB_NAME. Four spaces must be made before NODE_RED_STORAGE_DB_NAME. It is better to make changes using the Notepad ++ editor.
---
applications:
- memory: 256M
env:
OPTIMIZE_MEMORY: true
NODE_RED_STORAGE_DB_NAME: nodered
command: node index.js --settings ./bluemix-settings.js –v
Save the file after changing.
Run the command line (cmd) and then:
a. go to a folder with a downloaded project, such as Windows
cd c:/node-red-bluemix-starter
b. specify the api endpoint where the application is located, in our case:
cf api https://api.eu-gb.bluemix.net
c. send a registration command in the cloud
cf login
d. specify the mail and password (password is entered without explicit character display)
e. pushing the project by specifying the name of your instance Node-RED, for example NameApp
cf push NameApp

Azure batch Application package not getting copied to Working Directory of Task

I have created Azure Batch pool with Linux Machine and specified Application Package for the Pool.
My command line is
command='python $AZ_BATCH_APP_PACKAGE_scriptv1_1/tasks/XXX/get_XXXXX_data.py',
python3: can't open file '$AZ_BATCH_APP_PACKAGE_scriptv1_1/tasks/XXX/get_XXXXX_data.py':
[Errno 2] No such file or directory
when i connect to node and look at working directory non of the Application Package files are present there.
How do i make sure that files from Application Package are available in working directory or I can invoke/execute files under Application Package from command line ?
Make sure that your async operation have proper await in place before you start using the package in your code.
Also please share your design \ pseudo-code scenario and how you are approaching it as a design?
Further to add:
Seems like this one is pool level package.
The error seems like that the application env variable is either incorrectly used or there is some other user level issue. Please checkout linmk below and specially the section where use of env variable is mentioned.
This seems like user level issue because In case of downloading the package resource, if there will be an error it will be visible to you via exception handler or at the tool level is you are using batch explorer \ Batch-labs or code level exception handling.
https://learn.microsoft.com/en-us/azure/batch/batch-application-packages
Reason \ Rationale:
If the pool level or the task application has error, an error-list will come back if there was an error in the application package then it will be returned as the UserError or and AppPackageError which will be visible in the exception handle of the code.
Key you can always RDP into your node and checkout the package availability: information here: https://learn.microsoft.com/en-us/azure/batch/batch-api-basics#connecting-to-compute-nodes
I once created a small sample to help peeps around so this resource might help you to checkeout the use here.
Hope rest helps.
On Linux, the application package with version string is formatted as:
AZ_BATCH_APP_PACKAGE_{0}_{1}
On Windows it is formatted as:
AZ_BATCH_APP_PACKAGE_APPLICATIONID#version
Where 0 is the application name and 1 is the version.
$AZ_BATCH_APP_PACKAGE_scriptv1_1 will take you to the root folder where the application was unzipped.
Does this "exact" path exist in that location?
tasks/XXX/get_XXXXX_data.py
You can see more information here:
https://learn.microsoft.com/en-us/azure/batch/batch-application-packages
Edit: Just saw this question: "or can I invoke/execute files under Application Package from command line"
Yes you can invoke and execute files from the application package directory with the environment variable above.
If you type env on the node you will see the environment variables that have been set.

JBoss EAP 6.x - PolicyContext.getContext remains null

I'm using JBoss EAP 6.4 for my enterprise app and I'm a little stuck when I attempt to retrieve the active subject.
Of course, the user would need to authenticate, which goes through the following code snippet
LoginContext loginContext = new LoginContext("CONTEXTNAME", callbackHandler);
loginContext.login();
return loginContext.getSubject();
That works just fine (and the subject is filled in), however the problem lies when I try to retrieve the subject at a later point in the execution ...
final Subject subject = (Subject)PolicyContext.getContext("javax.security.auth.Subject.container");
... where subject remains null!
What am I missing??
Any help is much appreciated.
SOLVED!
Thanks to the following article on how to introduce the security manager on JBoss EAP 6.4.
The problem was that the security manager had to be configured in JBoss. You need to open the standalone.conf (or standalone.conf.bat), uncomment and add the following:
rem # Uncomment this to run with a security manager enabled
set "SECMGR=true"
rem # Using == when setting -Djava.security.policy specifies that the security manager
rem # will use only the specified policy file. Using = specifies that the security
rem # manager will use the specified policy combined with the policy set in the policy.url
rem # section of JAVA_HOME/lib/security/java.security.
set "JAVA_OPTS=%JAVA_OPTS% -Djava.security.policy==%JBOSS_HOME%\bin\server.policy"
That would enable the security manager and make it point to a custom server.policy, which I have a sample of below:
grant {
permission java.security.AllPermission;
};
That would give all permissions to any modules to operate. Of course, you'll need to edit the policy file if you want to tighten up the security.
Retrieving the Subject is also easy:
Subject.getSubject(AccessController.getContext());
That's it! I hope it'll work for you guys as well.

COM+ application deployment using command-line

I need to deploy my COM dll as a COM+ application. I used to do that from Component Services manager (dcomcnfg.exe). But my requirement is to deploy it from command-line. Is there a command to do that?
Update: And how to uninstall the same?
Thanks.
Here are a couple of scripts that dump a COM+ application's settings to an XML file, as well as installs applications from and XML file. It provided me a good framework for doing something similar a while back. It contains example code of how to create and remove COM+ applications using the COM+ administration API.
This vbscript snippet creates an application and installs a component:
Dim catalog
Dim applications
Dim application
Set catalog = CreateObject("COMAdmin.COMAdminCatalog")
Set applications = catalog.GetCollection("Applications")
Call applications.Populate
Set application = applications.Add()
' ID is an arbitrary GUID, that you can create using uuidgen
application.Value("ID") = "{da2d72e3-f402-4f98-a415-66d21dafc0a9}"
application.Value("Name") = "SampleApp"
application.Value("Activation") = 0' COMAdmin.COMAdminActivationOptions.COMAdminActivationLocal
application.Value("ApplicationAccessChecksEnabled") = 0 'COMAdmin.COMAdminAccessChecksLevelOptions.COMAdminAccessChecksApplicationComponentLevel
application.Value("Description") = "Sample Application"
'application.Value("Identity") = "machine\administrator"
'application.Value("Password") = "YourPassword"
application.Value("RunForever") = True
Call applications.SaveChanges
catalog.InstallComponent "SampleApp", "C:\Documents and Settings\me\My Documents\Test\MyTestProj.dll", "", ""
Set application = Nothing
Set applications = Nothing
Set catalog = Nothing
This is running on Windows XP -- other OS's may have different behavior. And it does seem to be pretty temperamental. If it doesn't work the errors are really vague and unhelpful.
To delete I think you will have to iterate over the the components in the application and remove from the list as per this example. I think a similar approach would be required to remove the entire application.
References
See Configurating COM+ for a good easy to understand article (but is not in script). MSDN has a good reference on Automating COM+ Administration and also the complete COM+ Administration Reference.