Not able to start Websphere application Server 8.0 in Rational application developer 8 - websphere-8

On the console.. I get the following -
Usage: java [-options] class [args...]
(to execute a class)
or java [-jar] [-options] jarfile [args...]
(to execute a jar file)
where options include:
-cp -classpath <directories and zip/jar files separated by ;>
set search path for application classes and resources
-D<name>=<value>
set a system property
-verbose[:class|gc|jni]
enable verbose output
-version print product version
-version:<value>
require the specified version to run
-showversion print product version and continue
-jre-restrict-search | -no-jre-restrict-search
include/exclude user private JREs in the version search
-agentlib:<libname>[=<options>]
load native agent library <libname>, e.g. -agentlib:hprof
see also, -agentlib:jdwp=help and -agentlib:hprof=help
-agentpath:<pathname>[=<options>]
load native agent library by full pathname
-javaagent:<jarpath>[=<options>]
load Java programming language agent, see java.lang.instrument
-? -help print this help message
-X print help on non-standard options
-splash:<imagepath> show splash screen with specified image
-ea[:<packagename>...|:<classname>]
-enableassertions[:<packagename>...|:<classname>]
enable assertions
-da[:<packagename>...|:<classname>]
-disableassertions[:<packagename>...|:<classname>]
disable assertions
-esa | -enablesystemassertions
enable system assertions
-dsa | -disablesystemassertions
disable system assertions
Eventually the server doesn't start and gets stopped after time-out. The Server was working fine. However, I wanted to restart it. I stopped the server completely and tried starting it. Since then I am facing this issue.

You can check the script that is getting executed when you right click and start the server.
Check if there are any unwanted entries in the java options which does not confirm to the java command line.

Related

R beakr script as Rscript Windows 10 service

I'm trying to setup a simple beakr service in Windows that implements the example at https://github.com/MazamaScience/beakr. I'm able to run the script from the command line successfully and I've been able to add the service in Windows using NSSM, but I am unable to start the service.
When I dig into the service error logs I see that Rscript.exe cannot be executed due to a non-specific permissions problem.
My Rscript.exe is running out of C:\Program Files\R<Version>\bin and my beakr.R script is running out of my User home directory.
If anyone has had success implementing a similar service (Web page based REST endpoint) using R in Windows, I would love to know how you did it.
This is what I did to run an R script as Service using latest pre-release version of NSSM on Windows 10:
Create a directory to store the files
In this example : C:\R\ServiceTest
Create in this directory a never ending script : ServiceTest.R
library(beepr)
# Test script : beeps every 10 seconds
while (T) {
beepr::beep(1)
if (interactive()) {
# Shows spin cursor to facilitate test in interactive mode
for (i in 1:10) {
if (i%%4==0) {cursor <- '/'}
if (i%%4==1) {cursor <- '-'}
if (i%%4==2) {cursor <- '\\'}
if (i%%4==3) {cursor <- '|'}
cat('\r',cursor)
flush.console()
Sys.sleep(1)
}
} else {
Sys.sleep(10)
}
}
I used to let this kind of script run in a console open on my desktop to check various alarms regularly.
Create a batch file to run the script : ServiceTest.bat
Rscript ServiceTest.R
Open an Admin console and make sure the batch file runs correctly:
C:\R\ServiceTest>ServiceTest.bat
C:\R\ServiceTest>Rscript ServiceTest.R
|
Cancel the batch (Ctrl+C)
Using the Admin console, install the batch file as service using NSSM :
nssm install
Set Service name : ServiceTest
Set Application path : C:\R\ServiceTest\ServiceTest.bat
Set Working directory : C:\R\ServiceTest\
Set Logon : Windows User + Password
Install Service
Open Windows Services Manager, find ServiceTest and start it : if everything went well, that's it!
If you get an error message, check Windows Event Log / Services : you can find there hints on the cause of the problem. Most common problems I encountered :
error on path
used local user instead of own user account / password to run the service
If you want to remove the service :
nssm remove ServiceTest
This replaced very nicely the many R consoles I left running in the background on my Desktop.
I see no reasons it wouldn't work with a REST endpoint.

Robotframework, AutoIt: Error message "No keyword with name 'Send' found"

I'm trying to get familiar with the robotframework using autoitlibrary to test Windows applications. I found some examples which use the Send command to type text into a notpad window.
That's what I've done so far:
*** Settings ***
Library AutoItLibrary
*** Variables ***
${app} C:/Program Files/Notepad++/notepad++.exe
*** Test Cases ***
Enter text
Run ${app}
Win Wait Active new 1 - Notepad++
Send This is just a test.
So, the Notepad++ window is opened, but then it failed with the No keyword with name 'Send' found. message. I suppose there is no Send command in the AutoItLibrary, but I also cannot find any other command which may do this job.
AutoIt is installed, and so is the wrapper by pip install robotframework-autoitlibrary.
There really exists a Send keyword in AutoIt, but supposedly not in the wrapper for robotframework.
And ideas to fix this?
UPDATE: Windows 10 (64bit in a VirtualBox), Python v3.7.6 (32bit), RF v3.1.2, RF-AutoItLibrary v1.2.4, AutoIt v3.3.14.5
The "Search Keywords" dialog in RIDE provides AutoItLibrary as a Source, but then list only a few commands. So I suppose the library is accessible, but incomplete.
import os, re, subprocess, sys
# Set path to Python directories.
programfiles = os.environ['programfiles']
if not programfiles:
exit('Failed to get programfiles')
python_dirs = [os.path.join(programfiles, 'Python35'),
os.path.join(programfiles, 'Python36'),
os.path.join(programfiles, 'Python37'),
os.path.join(programfiles, 'Python38')]
# Process each python directory.
for python_dir in python_dirs:
print('---')
# Set path to AutoItX3.dll.
autoitx_dll = os.path.join(python_dir, r'Lib\site-packages\AutoItLibrary\lib\AutoItX3.dll')
if not os.path.isfile(autoitx_dll):
print('File not found: "' + autoitx_dll + '"')
continue
# Set path to the makepy module.
makepy = os.path.join(python_dir, r'Lib\site-packages\win32com\client\makepy.py')
if not os.path.isfile(makepy):
print('File not found: "' + makepy + '"')
continue
# Generate cache using make.py.
command = [os.path.join(python_dir, 'python.exe'), makepy, autoitx_dll]
with subprocess.Popen(command, stderr=subprocess.PIPE, cwd=python_dir, universal_newlines=True) as p:
stderr = p.communicate()[1]
print(stderr.rstrip())
parameters = re.findall(r'^Generating to .+\\([A-F0-9\-]+)x(\d+)x(\d+)x(\d+)\.py$', stderr, re.M)
if len(parameters) == 1:
parameters = parameters[0]
print('Insert the next line into AutoItLibrary.__init__.py if not exist.\n'
' win32com.client.gencache.EnsureModule("{{{guid}}}", {major}, {minor}, {lcid})'
.format(guid=parameters[0],
major=parameters[1],
minor=parameters[2],
lcid=parameters[3]))
# Pause so the user can view the subprocess output.
input('Press the return key to continue...')
The generated cache done by win32com\client\makepy.py for AutoItLibrary from the setup.py is saved in the %temp%\gen_py folder. This is done only when setup.py is executed. If the %temp% directory is cleaned later, which removes the cache, then I notice keywords like Send may fail to be recognized by the robotframework.
One solution appears to be regenerating the cache. The code above will generate the cache by use of makepy.py. It may also print a message about inserting win32com.client.gencache.EnsureModule(...) into AutoItLibrary\__init__.py for any of the Python versions as needed. This will ensure the cache is available when AutoItLibrary
is imported.
Change paths in the code to suit your environment.
With further research:
AutoItLibrary currently has AutoItX 3.3.6.1 and latest AutoIt has AutoItX 3.3.14.5. Important to know as one version registered can overwrite the registration of the previous registration.
AutoItLibrary currently registers AutoIt3X.dll without the _x64 suffix on the name on x64 systems. I may reference AutoIt3_x64.dll to define difference between x86 and x64.
Any version of AutoIt3X.dll and AutoIt3_x64.dll uses the same ID codes and the last registered wins (based on bitness as both x86 and x64 registrations can co-exist).
The TypeLib class key registered ID is {F8937E53-D444-4E71-9275-35B64210CC3B} and is where win32com may search.
If AutoIt3X.dll and AutoIt3_x64.dll are registered, unregister any 1 of those 2 will remove the AutoItX3.Control class key. Without this key, AutoIt3X will fail as AutoItLibrary needs this key. To fix, register again e.g. regsvr32.exe AutoIt3X.dll as admin in the working directory of AutoIt3X.dll.
The methods of any same version of AutoItX will match i.e. AutoIt3X.dll and AutoIt3X_x64.dll only changes in bitness, not methods.
Inserting win32com.client.gencache.EnsureModule("{F8937E53-D444-4E71-9275-35B64210CC3B}", 0, 1, 0) into AutoItLibrary\__init__.py should ensure the cache is always available for any AutoItX version. The initial code can be used to generate the cache, though the suggested change in AutoItLibrary\__init__.py makes it obsolete as the cache is generated on import of AutoItLibrary. If the ID was not constant, then the initial code may inform you of the ID to use.
The cache is important as it has generated .py files with methods like e.g.:
def Send(self, strSendText=defaultNamedNotOptArg, nMode=0):
'method Send'
# etc...
which if missing, makes Send and many others, an invalid keyword in AutoItLibrary.
If AutoItX 3.3.14.5 is registered, the - leading methods are removed and the + leading methods are added as compared to AutoItX 3.3.6.1:
-BlockInput
-CDTray
-IniDelete
-IniRead
-IniWrite
-RegDeleteKey
-RegDeleteVal
-RegEnumKey
-RegEnumVal
-RegRead
-RegWrite
-RunAsSet
+RunAs
+RunAsWait
So if any of those methods causes error, then you may want AutoItX 3.3.6.1 registered instead. In the AutoItX history, 3.3.10.0 release is when those method changes happened.
Fix:
Check your python architecture ( is it 32 or 64 bit)
For 32:
Open cmd in "Run as administrator" mode
run the command pip install robotframework-autoitlibrary
Now clone the autoit library source code:
https://github.com/nokia/robotframework-autoitlibrary
in the root directory run the below command: python setup.py install using cmd in admin mode
to navigate to root directory use the command pushd <filepath>' instead ofcd ` if cd doesn't work in cmd opened in admin mode.
For 64:
Open cmd in "Run as administrator" mode
Now clone the autoit library source code:
https://github.com/nokia/robotframework-autoitlibrary
in the root directory run the below command: python setup.py install using cmd in admin mode
to navigate to root directory use the command pushd <filepath>' instead ofcd ` if cd doesn't work in cmd opened in admin mode.

While click run in my project i am getting "Failed to start program. Path or permissions wrong?"

While click run on my project in qt creator
" Failed to start program. Path or permissions wrong?"
11:02:18: Starting C:\V6\Filename2.0\release\Filename.exe...
11:02:18: Failed to start program. Path or permissaions wrong?
11:02:18: C:/V6/Filename2.0/release/Filename.exe exited with code -1
11:02:18: The process failed to start. Either the invoked program "C:/V6/Filename2.0/release/Filename2.exe" is missing, or you may have insufficient permissions to invoke the program.
Without more information (Qt and Qt Creator version, OS version - I assume it's windows) it's difficult to formulate a sensible hypothesis, however, off the top of my head some things you might try:
are you sure there's not another Filename.exe running? if there is QtCreator cannot create a new executable replacing current one that is in use
maybe windows holds some lock on that particular file / folder, it might be worth checking with tools like mst isusedby
try closing QtCreator / rebooting to clean any stale locks on that folder
in the projects section choose another folder for shadow building and see if the executable can be created there.
It could be due to executable file name , as pointed out in this answer : Qt: Cannot execute '': The requested operation requires elevation that shows another error message, this happens if executable file name contains or ends with "install", "update", "setup", "patch".
On the other hand, its possible to explicitly set (access level) manifist in the .pro with Admin privileges required:
QMAKE_LFLAGS += /MANIFESTUAC:\"level=\'requireAdministrator\' uiAccess=\'false\'\"
Or, to set access for current user:
QMAKE_LFLAGS += /MANIFESTUAC:\"level=\'asInvoker\' uiAccess=\'false\'\"
A bit late, but I have had this issue, caused by a target flag set as :
TARGET = runme.exe
in my .pro file.
Removing the extension,and changing it to just :
TARGET = runme
has solved this issue for me.

Installing an MSP using Powershell works on the local machine, fails remotely. Why?

I need some Powershell advice.
I need to install an application's MSP update file on multiple Win08r2 servers. If I run these commands locally, within the target machine's PS window, it does exactly what I want it to:
$command = 'msiexec.exe /p "c:\test\My Application Update 01.msp" REBOOTPROMPT=S /qb!'
invoke-wmimethod -path win32_process -name create -argumentlist $command
The file being executed is located on the target machine
If I remotely connect to the machine, and execute the two commands, it opens two x64 msiexec.exe process, and one msiexec.exe *32 process, and just sits there.
If I restart the server, it doesn't show that the update was installed, so I don't think it's a timing thing.
I've tried creating and remotely executing a PS1 file with the two lines, but that seems to do the same thing.
If anyone has advice on getting my MSP update installed remotely, I'd be all ears.
I think I've included all the information I have, but if something is missing, please ask questions, and I'll fill in any blanks.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
My process for this is:
Read a CSV for server name and Administrator password
Create a credential with the password
Create a new session using the machine name and credential
Create a temporary folder to hold my update MSP file
Call a PS1 file that downloads the update file to the target server
>>> Creates a new System.Net.WebClient object
>>> Uses that web client object to download from the source to the location on the target server
Call another PS1 file that applies the patch that was just downloaded –>> This is where I’m having issues.
>>> Set the variable shown above
>>> Execute the file specified in the variable
Close the session to the target server
Move to the next server in the CSV…
If I open a PS window and manually set the variable, then execute it (as shown above in the two lines of code), it works fine. If I create a PS1 file on the target server, containing the same two lines of code, then right click > ‘Run With PowerShell’ it works as expected / desired. If I remotely execute my code in PowerGUI, it returns a block of text that looks like this, then just sits there. RDP’d into the server, the installer never launches. My understanding of the “Return Value” value is that “0″ means the command was successful.
PSComputerName : xx.xx.xx.xx
RunspaceId : bf6f4a39-2338-4996-b75b-bjf5ef01ecaa
PSShowComputerName : True
__GENUS : 2
__CLASS : __PARAMETERS
__SUPERCLASS :
__DYNASTY : __PARAMETERS
__RELPATH :
__PROPERTY_COUNT : 2
__DERIVATION : {}
__SERVER :
__NAMESPACE :
__PATH :
ProcessId : 4808
ReturnValue : 0
I even added a line of code between the variable and the execution that creates a text file on the desktop, just to verify I was getting into my ‘executeFile’ file, and that text file does get created. It seems that it’s just not remotely executing my MSP.
Thank you in advance for your assistance!
Catt11.
Here's the strategy I used to embed an msp into a powershell script. It works perfectly for me.
$file = "z:\software\AcrobatUpdate.msp"
$silentArgs = "/passive"
$additionalInstallArgs = ""
Write-Debug "Running msiexec.exe /update $file $silentArgs"
$msiArgs = "/update `"$file`""
$msiArgs = "$msiArgs $silentArgs $additionalInstallArgs"
Start-Process -FilePath msiexec -ArgumentList $msiArgs -Wait
You probably don't need to use the variables if you don't want to, you could hardcode the values. I have this set up as a function to which I pass those arguments, but if this is more of a one-shot deal, it might be easier to hard-code the values.
Hope that helps!
using Start-Process for MSP package is not a good practice because some update package lockdown powershell libs and so you must use WMI call

Why are my svn ant tasks failing?

I am trying to run a build script and I keep getting errors during a specific svn task. When I try to build the target from the command line, I get an authentication error. When I run the build from flex builder I get an error saying "please get a newer Subversion client". From what I can tell there is a root issue that can be seen here when doing an ant -verbose:
svn_update:
[echo] Updating the project source...
[svn] Using javahl
[svn] <Update> started ...
[svn] update /Users/dave/Documents/Flex Builder 3/AssetLibrary -r HEAD --force
[svn] At revision 373.
[svn] <Update> finished.
[ant] Exiting /Users/dave/Documents/Flex Builder 3/Simulation/build-template/commonbuild.xml.
[ant] Exiting /Users/dave/Documents/Flex Builder 3/AssetLibrary/build.xml.
[echo] Updating DataService Source
...
svn_update:
[echo] Updating the project source...
[svn] Using command line
[svn] <Update> started ...
[svn] up -r HEAD /Users/dave/Documents/Flex Builder 3/DataService --non-interactive
[svn] svn: OPTIONS of 'https://svn.example.com/{redacted}': authorization failed: Could not authenticate to server: ignored NTLM challenge, rejected Basic challenge (https://svn.example.com)
[svn] <Update> failed !
[ant] Exiting /Users/dave/Documents/Flex Builder 3/Simulation/build-template/commonbuild.xml.
[ant] Exiting /Users/dave/Documents/Flex Builder 3/DataService/build.xml.
[ant] Exiting /Users/dave/Documents/Flex Builder 3/Simulation/build.xml.
As you can see, the second (failing) svn_update target is using command line, and the first (working) update is using javahl. I am using the default attributes for svn, so javahl should default to be used.
I updated my svnant jars to 1.3.0.
Would love some help with this one!
Dave
First thing that's catching my eye is that the javahl one isn't calling the update on the same directory as the last one:
/Users/david.marr/Documents/Flex Builder 3/AssetLibrary
vs.
/Users/david.marr/Documents/Flex Builder 3/DataService
It could be that there is some other SVN problem underlying and you're just getting a misleading error message. Also, are you sure url https://svn.frogdesign.com/{redacted} is being parsed correct whatnot? "{redacted}" doesn't look like ANT syntax to me, and neither a regular url.
Maybe your command line client is too old, and the server has a versioning constraint on clients allowed to connect? What does svn --version say?
I usually get the Could not authenticate to server: ignored NTLM challenge, rejected Basic challenge error I use svn update in non interactive mode (example: svn update --non-interactive > output.txt) and when my NT or Active Directory password has changed. The way to fix this would be to first run svn update > output.txt which will then prompt you for your password. Once provided, you will get the following
Authentication realm: <http://svnserver:80> SVN Server
Password for 'siacca':
-----------------------------------------------------------------------
ATTENTION! Your password for authentication realm:
<http://svnserver:80> SVN Server
can only be stored to disk unencrypted! You are advised to configure
your system so that Subversion can store passwords encrypted, if
possible. See the documentation for details.
You can avoid future appearances of this warning by setting the value
of the 'store-plaintext-passwords' option to either 'yes' or 'no' in
'/cygdrive/u/.subversion/servers'.
-----------------------------------------------------------------------
Store password unencrypted (yes/no)? yes
Once this is done (I'm with you, I don't like storing my password unencrypted either, but this is the only way I can run automated nightly svn updates), you should be able to run svn update in non-interactive mode.

Resources