Why do I get the error "Server Creation Failed: "Class not Registered"? - matlab

I am creating a COM server (using actxserver) for CSTStudio using MATLAB, but I'm getting the error
Class not regiestred in feval
which is working inside actxserver. Also when I tried to create COM server for other applications such as Word and PowerPoint it is working fine but showing an error for the invoke function.
Here is the MATLAB Code:
addpath(genpath('G:\MATLAB\CST-MATLAB-API-master'));
cst = actxserver('CSTStudio.application');
mws = cst.invoke('NewMWS');
This is the error:
MicrostripAntenna
Error using feval
Server Creation Failed: Class not registered
Error in actxserver (line 89)
h=feval(['COM.' convertedProgID], 'server', machinename, interface);
Error in MicrostripAntenna (line 32)
cst = actxserver('CSTStudio.application');

Not clear what you mean by saying it is "working for other applications." Do you mean you can create those objects or that from within those programs you can create CSTStudio.application? #1 is CSTStudio installed on that computer? Is there a registry entry for the ProgId on the computer? Is it an in-process (.dll) or local server (.exe)?
My first suggestion is that you use VB Script to try and diagnose whether it is a 32/64-bit mismatch and whether the server is even on the machine.
Take this VB Script and save it to a file called CSTStudioTest.vbs
dim app
set app = CreateObject("CSTStudio.application")
MsgBox TypeName(app)
Change directory to where the newly created file exists.
Then, execute the script in two different ways:
c:\windows\system32\wscript.exe CSTStudioTest.vbs
and also as
c:\windows\syswow64\wscript.exe CSTStudioTest.vbs
If both succeed, then that means CSTStudio is a local server (.exe)
If one succeeds, then that means CSTStudio is an in-process server (.dll) and that it means it will only work with programs of the same bitness. If only the first script succeeded, it means CSTStudio server is a 64-bit in process server. If only the second script succeeds, it means it is a 32-bit in process server. If it is an in process server, then you can only directly call it from a process that has the same bitness (64 bit from 64 bit, or 32 bit from 32 bit).
If both of those scripts fail, that means CSTStudio is not installed correctly on your computer (if at all).
If the bitness between MATLAB and CSTStudio is different, the easiest remedy is to get a version of MATLAB or CSTStudio that matches the bitness of the other.

Related

Selenium throwing 'no display specified' error when one exists

I have a script that starts a Selenium server (if one is not already running) and then runs some acceptance tests in Codeception (with Firefox version 27, which is compatible with our Selenium 2.42.2). If I go onto the server (using VNC), the script runs and executes properly, however I'm using eclipse with RTC plugin, and it's set up so that you can make a build request, which will run that script on the server.
For some reason it always fails with this error (or some variant of it):
15:42:26.125 WARN - Exception: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
Error: no display specified
Error: no display specified
On the server, even if I manually do export DISPLAY, it still fails from RTC. As far as I can tell, there's nothing special in the build rules that would cause this. It it just because VNC happens to be a GUI, and it can't find a display from just a terminal?
This means that there is not graphical interface available for user(as it probably use ssh to connect), I would suggest you to use Xvfb

Enter-PSSession causes a stack overflow exception

I have a batch file that contains a few commands to connect with Team Foundation Server 2012 through the command line utility TF.exe.
This batch file exists on our development server, and is designed to essentially "deploy" our website by getting latest from source control
The batch file works fine on the server, but calling the batch file remotely via PSSession causes some strange issues.
I frequently receive the error:
Process is terminated due to StackOverFlowException
Or
Not enough storage available to complete this command...
There is plenty of resources available on the server in terms of available resources. I'm pretty new at powershell...what is it that I'm missing?
EDIT: Here's the command that worked for me:
set-item wsman:localhost\Shell\MaxMemoryPerShellMB 2048
Powershell remote sessions have a default memory limit of 150MB. The limits are configured in WinRM.
http://msdn.microsoft.com/en-us/library/aa384372(VS.85).aspx

how to connect to Socket from vbscript

I want to connect to a java server socket threw ASP Classic. For this when I google then found winsock.dll but it does not work. I try below code to create object
Dim x
Set x = CreateObject("MSWINSOCK.Winsock.1")
but error comes cant create object . So can any body tell me how can I connect to a socket at a specific port threw vbscript. Is there any other com object provided by microsoft so that we can trust on that and use that.
The MSWINSOCK component is not provided by winsock.dll, it is provided by MSWinsck.ocx.
You can check it is registered by looking in RegEdit.exe under HKEY_CLASSES_ROOT\MSWinsock.Winsock.
This control is 32-bit only, so it will only work when running scripts with the 32-bit hosts.
I suspect you either don't have it installed, or are running your script under 64 bit operating system.
If the latter, you should launch your scripts from the 32bit hosts like so:
c:\windows\syswow64\cscript.exe //nologo c:\path\to\script.wsf /argument:value
or:
c:\windows\syswow64\wscript.exe //nologo c:\path\to\script.wsf /argument:value
But really I would suggest you should not be attempting general network communications application from VBScript. Try VB.Net instead.

ADO.net SQL Server commands failing on x86 Windows Server 2008

I am deploying project with developer-targeted setup using Inno Setup. I've wrote some code to make some actions that are a bit too custom for the original Inno Setup.
One of such actions was connecting to and running SQL files, thanks to StackOverflow users I've found some code for doing so. The problem is that whenever I try deploying the project on a new Windows Server 2008 machine (x86), I'm getting such cryptic error on every sql command apart from the first one:
"Not enough storage space is available to complete this operation ProgID: ADODB.Connection"
So. The first command fires and works, next stop with error. If I'd run the code again, some of the commands might work, but at some point, the installer would hung. The problem does not exists on windows XP I am writing it on.
I use the code linked above for every SQL command I run (new ole object ADODB.Connection, new command, execute... end) - I don't make the second query for results of insert (as it's there just for showing purpose).
Any thoughts what can be happening here or how can I make a workaround?

Scheduled execution of Testcomplete fails

With TestComplete 8 we have a script that is scheduled to start 06:00 every morning by this line:
"C:\Program Files\Automated QA\TestComplete 8\Bin\TestComplete.exe" "C:\Attracs\TestComplete\Attracs\AttracsTEST\AttracsTESTProject.mds" /r /e /SilentMode
The problem is that this often fails. The log remark says:
An error occurred while calling the "Keys" method or property of the "TcxCustomInnerTextEdit" object.
The object or one of its parent objects does not exist.
If I connect to the computer with Remote Desktop and manually run the script it works fine.
There is no screensaver active and the power scheme is set to never sleep.
I have noticed that Testcomplete needs a handle to GUI (the screen is visible) or the script got this kind of errors. Could it be that when it starts it have no handle to the GUI components because they aren't visible ?
From the helps Running Tests via Remote desktop:
However, if you minimize the Remote Desktop window (the window that display the remote computer’s desktop), the operating system switches the remote session to the GUI-less mode and does not display windows and controls. As a result, TestComplete (or TestExecute) is unable to interact with the tested application’s GUI, as the GUI does not actually exist in this case and your automated GUI test fails.
To avoid this issue, you can keep the Remote Desktop window visible during the test run, but this may be inconvenient as it occupies some part or even your entire screen and leaves less space for you to run your local applications.
Any solution for this?
There is a way to enable the console connection in Windows to be active at all times, which allows TestComplete to work without actually connecting with RDP.
From: Running Tests in Minimized Remote Desktop Windows
Log in to the computer from which you
connect to remote computers.
Close all open Remote Desktop
sessions.
Launch the Registry editor
(Regedit.exe).
If you have a 32-bit operating system:
Locate the
HKEY_CURRENT_USER\Software\Microsoft\Terminal
Server Client\ Registry key if you
want to change the connection settings
for the current user only.
-- or --
Locate the
HKEY_LOCAL_MACHINE\Software\Microsoft\Terminal
Server Client\ Registry key if you
want to change the connection settings
for all the users.
Create a new DWORD value in this key
and name it
RemoteDesktop_SuppressWhenMinimized.
Specify 2 as the value data.
If you have a 64-bit operating system:
Locate the
HKEY_CURRENT_USER\Software\Wow6432Node\Microsoft\Terminal
Server Client\ Registry key if you
want to change the connection settings
for the current user only.
-- or --
Locate the
HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Terminal
Server Client\ Registry key if you
want to change the connection settings
for all the users.
Add the
RemoteDesktop_SuppressWhenMinimized
value to the key.
I found this page
http://www.automatedqa.com/support/viewarticle/12567/viewarticle.aspx?aid=12567
It seems that a solution could be that running TestComplete in a Virtual machine.
/Roland
To run any UI test, the UI needs to be available. Hence, the machine should be unlocked so that TestComplete can perform user actions like mouse click, keys, etc to work.
However, if you have non UI test like running Web Services then it will work.