AttachCurrentThread fails when several VMs running in different threads

Hi,
I would like to build an application that runs several JVMs in parallel. I'm using Java6 and according to the JNI specs this should be possible as long as each VM instance is running in a separate thread.
In the below mentioned demo application two threads are created. Both instantiate a VM (which works well). But only one thread seems to be able to run AttachCurrentThread. When AttachCurrentThread is called for the second one I get the following error:
# An unexpected error has been detected by Java Runtime Environment:
#  SIGSEGV (0xb) at pc=0x080486ae, pid=1428, tid=3035118512
# Java VM: Java HotSpot(TM) Client VM (1.6.0_03-b05 mixed mode, sharing)
# Problematic frame:
# C  [jvmthreads+0x6ae]But because one thread successfully instantiates a java class I think that the basic code structure is OK. It seems to be a threading issue. My application looks as follows:
#include <stdlib.h>
#include <jni.h>
#include <pthread.h>
#define USER_CLASSPATH "myclasses.jar"
#define CLASS_NAME "com.foobar/DummyRtbosFiller"
JavaVM* JavaThreads_createJVM(){
     JNIEnv *env;
    JavaVM *vm;
    jint res;
    setenv("JAVA_VM_VERSION", "1.5", 1);
//    setenv("JAVA_VM_VERSION", "1.5", 0);
    JavaVMInitArgs vm_args;
    JavaVMOption options[7];
    options[0].optionString = malloc(3000*sizeof(char));
    sprintf(options[0].optionString, "-Djava.class.path="USER_CLASSPATH);
    options[1].optionString = "-Xmx64m";
     int enableRemDebugging = 0;
     if(enableRemDebugging){
         printf("enable remote debugging");
          // intellij remote debugging support
          options[2].optionString = "-Xdebug";
          options[3].optionString = "-Xnoagent";
          options[4].optionString = "-Djava.compiler=NONE";
          options[5].optionString = "-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=34343";
          vm_args.nOptions = 6;
     }else{
          vm_args.nOptions = 2;
     vm_args.options = options;
    vm_args.version = JNI_VERSION_1_4;
    vm_args.ignoreUnrecognized = JNI_TRUE;
    /* Create the Java VM */
    res = JNI_CreateJavaVM(&vm, (void**)&env, &vm_args);
    printf("java started.\n");
     return vm;
* \brief Shuts down an existing java virtual machine.
* \param jvm Pointer to the jvm to be destroyed.
* This method is used to shut down an existing java virtual machine.
int JavaThreads_destroyJVM(JavaVM *jvm){
//     JNIEnv *env = getAttachedEnv(self, jvm);
//     if ((*env)->ExceptionOccurred(env)) {
//        (*env)->ExceptionDescribe(env);
      // detach the current thread from the vm
    (*jvm)->DetachCurrentThread(jvm);
    (*jvm)->DestroyJavaVM(jvm);
     return 0;
* \brief Attaches the current thread to a given vm instance
* \param self Pointer to bbcm-instance
* \param jvm Pointer to the jvm use for attachment
* This method is used to attach the current thread to a given vm instance
JNIEnv* getAttachedEnv(JavaVM *jvm){
     JNIEnv *localEnv = NULL;
     int envErr = 0;
     /* get a local java env */
     envErr = (*jvm)->AttachCurrentThread( jvm, (void**)&localEnv, NULL );
     if ( envErr != 0 ){
          if ( (*localEnv)->ExceptionCheck( localEnv ) == JNI_TRUE ){
            (*localEnv)->ExceptionDescribe( localEnv );
     if((*localEnv)->ExceptionOccurred(localEnv)){
         (*localEnv)->ExceptionDescribe(localEnv);
     if (localEnv == NULL) {
        printf("ERROR: failed to get ENV pointer in pushContext");
          //  JavaThreads_destroyJVM(jvm);
        return (JNIEnv*) NULL;
     return localEnv;
* \brief Create a new instance of the transcriber application
* \return Pointer to the java object
* This method is used to create a new instance transcriber application
jobject startJavaSubSystem(JavaVM *jvm, char* argString){
    printf("attaching env pointer.\n");
     JNIEnv *env = getAttachedEnv(jvm);
    printf("thread attachment done.\n");
     jclass cls;
     jmethodID mid;
     jobject transcriber;
     cls = (*env)->FindClass(env, CLASS_NAME);
    if (cls == NULL) {
        JavaThreads_destroyJVM(jvm);
     jstring jArgumentString = (*env)->NewStringUTF(env, argString);
    mid = (*env)->GetMethodID(env, cls, "<init>", "(ILjava/lang/String;)V");
     if (mid == NULL) {
        JavaThreads_destroyJVM(jvm);
    printf("starting object instantiation\n");
    (*env)->NewObject(env, cls, mid, 1, jArgumentString);
     return transcriber;
void startJavaThread(char* arg){
     JavaVM *jvm;
    printf("create a jvm instance for component '%s'\n", arg);
     jvm = JavaThreads_createJVM();
    printf("attempting to start component '%s'\n", arg);
    startJavaSubSystem(jvm, arg);
    printf("component '%s' started !\n", arg);
    // sleep forever to keep the thread alive
    sleep(10000);
int main(int argc, char **argv) {
      pthread_t thread1, thread2;
      /* Create independent threads each of which will instantiate a java VM. */
     int iret1 = pthread_create( &thread1, NULL, startJavaThread,  (void*) "test47");
     sleep(1);
     int iret2 = pthread_create( &thread2, NULL, startJavaThread, (void*) "test48");
     pthread_join( thread1, NULL);
     pthread_join( thread2, NULL);
     printf("Thread 1 returns: %d\n",iret1);
     printf("Thread 2 returns: %d\n",iret2);
     return 0;
}What could be my mistake?
Any help (links, docs, ideas) is welcome.
Best regards, Holger

You're right. I got confused by the specs of JNI_GetCreatedJVMs:
JNI_GetCreatedJavaVMs function returns all virtual machine instances
that have been created in the current process.But unfortunately you're completely right (cf. http://java.sun.com/javase/6/docs/technotes/guides/jni/spec/invocation.html#wp9502 )
As of JDK/JRE 1.2, creation of multiple VMs in a single process is not supported.Nothing seems to have changed since then. :-(
thanks for the help, bg, holger

Similar Messages

  • DefaultTreeNode exception when being modified from a different thread

    Hi,
    I have two panels, each one displays a separate tree structure, when I attempt to copy from one tree to another in a different thread I get the following exception.
    Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 84 >= 83
         at java.util.Vector.elementAt(Vector.java:427)
         at javax.swing.tree.VariableHeightLayoutCache.getNode(VariableHeightLayoutCache.java:976)
         at javax.swing.tree.VariableHeightLayoutCache.getPreferredHeight(VariableHeightLayoutCache.java:274)
         at javax.swing.plaf.basic.BasicTreeUI.updateCachedPreferredSize(BasicTreeUI.java:1872)
         at javax.swing.plaf.basic.BasicTreeUI.getPreferredSize(BasicTreeUI.java:2015)
         at javax.swing.plaf.basic.BasicTreeUI.getPreferredSize(BasicTreeUI.java:2003)
         at javax.swing.JComponent.getPreferredSize(JComponent.java:1627)
         at javax.swing.ScrollPaneLayout.layoutContainer(ScrollPaneLayout.java:769)
         at java.awt.Container.layout(Container.java:1432)
         at java.awt.Container.doLayout(Container.java:1421)
         at java.awt.Container.validateTree(Container.java:1519)
         at java.awt.Container.validate(Container.java:1491)
         at javax.swing.RepaintManager.validateInvalidComponents(RepaintManager.java:639)
         at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:127)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)Obviously if I revert back the copying to the same thread the problem is avoided, however the program appears to be frozen for the duration of the copying. I also tried changing the way that the information is displayed (ie in a table) and that did not throw exceptions.
    I also found this http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4704869 on the Sun Website, however there was no solution.
    Therefore, how do I construct a tree that can be modified from a separate thread.
    Any assistance greatly appreciated.

    The bug you referred to states that the exception is due to the tree being modified by a thread not being the EDT.
    What kind of thread are you using? The �correct� way of doing this would be by using SwingWorker: http://java.sun.com/javase/6/docs/api/javax/swing/SwingWorker.html
    If you were not, please give SwingWorer a try and tell us if the exception is still thrown!

  • Is there a way to run two different threads indefinitely

    I have two different threads and they both are doing different tasks.... I want them to be running indefinitely....
    i want the threads to run indefinetly passing the control between one another( anyway, passing the control is unpredicatable)
    I dont want the tasks to be run in a infinite loop but the threads itself, which are doing their respective tasks.....

    vinney_143 wrote:
    anyway, with respect to what i understood, this is what i tried.............. i thought of calling the start() methods within a loop but it should be throwing illegalThreadStateException. so, i came to this forum to seek some help on this.
    If i am gonna put the loop inside the threads, i dont think that serves my purposes of calling two threads indefinitely and not doing a task in each thread indefinitely........Threads have states: NEW, RUNNABLE, BLOCKED, WAITING, TERMINATED. When you create a thread (as an instance of thread) it is in NEW state. When you call start() on the thread instance it goes into RUNNABLE state. Process scheduler chooses a thread in runnable pool and runs it on the processor. When a thread goes to RUNNABLE etc states it can not go to NEW state (thats illegal). From a RUNNABLE state thread can only go to BLOCKED, WAITING or TERMINATED states. You can't call start() on the thread more than once. Once a thread is terminated (TERMINATED state) it can't go to NEW state either. Once start() is called the thread is started and you write logic that determines when the thread is terminated. Thats the reason why you got an IllegalThreadStateException.
    while(true) {
        thread.start(); // throws IllegalThreadStateException
    }Heres one way to keep thread running till a certain condition is met.
    class MyThread extends Thread {
        public void run() {
            while(true) {
                boolean condition = //
                if(condition) {
                    return; // terminates thread because run() returns
    }Hope this helps.

  • Migrate Roles failes when migrating VMs with legacy network adapters (2008R2 - 2012)

    I'm working on a upgrade of Hyper-V 2008R2 cluster to Hyper-V 2012 cluster. I am using the "migrate roles" feature of failover clustering to migrate the CSV's and VM's. The wizard ask to which switch the VMs need to be connected on the target cluster.
    All VMs with network adapters can be started in the new cluster without any issues. If you look at the XML file of the migrated VMs with normal network adapters, a new XML has been generated in the proper 2012 format. However, all VM's with a legacy
    network adapter fail to start. Also there is no migrated XML file in the VM directory. It is impossible to check or adjust the settings of the migrated VMs with legacy network adapters using the failover clustering console.
    I have reproduced the issue in my lab several times, and it seems like a bug.
    There are several workarounds, but I am looking for a real solution.

    Hi,
    We recommend that you use the legacy network adapter only to perform a network-based installation or when the guest operating system does not support the network adapter.
    If the virtual machine continues to use the legacy network adapter it will not be able to leverage many of the features available in the Hyper-V virtual switch. You may want
    to replace the legacy network adapter after the operating system is installed.
    The related KB:
    Building Your Cloud Infrastructure: Converged Data Center without Dedicated Storage Nodes
    http://technet.microsoft.com/en-us/library/hh831829.aspx
    Configure Networking
    http://technet.microsoft.com/en-us/library/cc770380.aspx
    Hope this helps.
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • Authentication to agent workstation failed when trying to run a test in Oracle Test Manager

    I have the complete version of OATS installed on my local machine. I have the OracleATSHelper, OracleATSServer and OracleATSAgent services running.
    In OTM when I go to run an openscript test I select the system, type the version number and hit run and get a "Authentication to agent workstation failed" error in the summary field.
    It worked before but I cant figure out why it isnt working anymore.
    Can anyone help?

    ATS Version: 12.3.0.1.0 build 376
    I am getting the same error when trying to execute a script from OTM - "Authentication to agent workstation failed".
    I have the OTM server on a remote (server) machine and the Oracle Agent is running on my laptop / workstation. I've tried all I have seen on this thread, but no progress. The manager is now in manual mode and the console only provides the following output:
    D:\OracleATS\agentmanager\bin>d:\OracleATS\agentmanager\bin\AgentManagerService.exe -c  AgentManagerService.conf
    wrapper  | --> Wrapper Started as Console
    wrapper  | Launching a JVM...
    jvm 1    | Wrapper (Version 3.0.3)
    jvm 1    |
    One different thing, maybe, I see is that the agentmanager_auth.log is empty always.
    Also, on the server, I've added this SYSTEM successfully, i.e.the Testing of the SYSTEM added in OTM always gives the success message "The system specified can be successfully accessed by the Oracle Test Manager server."  . In fact it does this even when I provide an incorrect password!    

  • "Import Failed" when trying to run a import (Integration) script from FDM

    Backgroud about the Issue : My source system for data is Oracle Orion and the Destination is HFM.Trying to import data fom orion to HFM through FDM via ODBC connectivity.
    Modified the "Integration Script Example" in fdm_admin guide and with this i am able to import data from the Orion to the FDM staging table "tDataSegX" however i am not abel to see any data in the FDM (Import Module) and thats when i get this error "Import Failed".
    Posisble casue according to my knowledge : My Import script only includes code to 1.Connect to ODBC data source 2. copies all the values from the Source table to the staging table.
    I am not sure if i am missing some attributes in the script ??!!
    can some one help me in checking if my imoport scritp is correct ??!!!
    Here is my script
    Function Import_int(strLoc, lngCatKey, dblPerKey, strWorkTableName)
    Dim objSS 'ADODB.Connection
    Dim strOra 'Ora string
    Dim rs ' As New ADODB.Recordset
    Dim rsAppend 'tTB table append rs object
    Set cnSS = CreateObject("ADODB.Connection")
    Set rs = CreateObject("ADODB.Recordset")
    Set rsAppend = DW.DataAccess.farsTableAppend("TDATASEG7")
    Dim strconn
    strconn="Provider=msdaora;Data Source=<<Data Source Name>>;User Id=<<Username>>;Password=<<Password>>;"
    cnSS.open strConn
    strOra = "Select * "
    strOra = strOra & "FROM <<Oracle View>>"
    'Get data
    rs.Open strOra, cnSS
    If rs.bof And rs.eof Then
    RES.PlngActionType = 2
    RES.PstrActionValue = "No Records to load!"
    Exit Function
    End If
    'Loop through records and append to tTB table in location's DB
    If Not rs.bof And Not rs.eof Then
    Do While Not rs.eof
    rsAppend.AddNew
    rsAppend.Fields("PartitionKey") = RES.PlngLocKey
    rsAppend.Fields("CatKey") = RES.PlngCatKey
    rsAppend.Fields("PeriodKey") = RES.PdtePerKey
    rsAppend.Fields("DataView") = "YTD"
    rsAppend.Fields("CalcAcctType") = 9
    'write conditions to eliminate null
    rsAppend.Fields("Amount") = rs.fields("YTD").Value
    rsAppend.Fields("Desc1") = test 'rs.fields("txtAcctDes").Value
    rsAppend.Fields("Account") = rs.fields("MAIN_AC_CODE").Value
    rsAppend.Fields("Entity") = rs.fields("COMPANY_CODE").Value
    rs.movenext
    Loop
    End If
    'Records loaded
    RES.PlngActionType = 6
    RES.PstrActionValue = "ODBC Import successful!"
    'Assign Return value
    SQLIntegration = True
    rs.close
    End Function

    HI,
    I first changed the table name to "strWorkTableName" and tried executing only the script from the Workbench client and got error as bellow
    Financial Data Management Workbench
    -2147467259 - Data access error.
    At Line: 20
    OK
    For some reason i am not ok with running the code in the workbench client (even for checking the syntax) because for the reason that i am not sure if all the parameter required by the funciton will be passed by donig just "Run script."So even with this error in the Work bench client i proceded to the Workflow module in the web interface and run the import and here is what i have now.
    Error: An error occurred importing the file.
    Detail: Invalid procedure call or argument
    here is the error message from the "View Erro Log"
    ERROR:
    Code............................................. 5
    Description...................................... Invalid procedure call or argument
    Procedure........................................ clsImpProcessMgr.fExecuteImpScript
    Component........................................ upsWObjectsDM
    Version.......................................... 1112
    Thread........................................... 15676
    IDENTIFICATION:
    User............................................. admin
    Computer Name.................................... <<ComputerName>>
    App Name......................................... <<ApplicationName>>
    Client App....................................... WebClient
    CONNECTION:
    Provider......................................... ORAOLEDB.ORACLE
    Data Server......................................
    Database Name.................................... HYPTDB
    Trusted Connect.................................. False
    Connect Status.. Connection Open
    GLOBALS:
    Location......................................... ORION
    Location ID...................................... 750
    Location Seg..................................... 4
    Category......................................... WLCAT
    Category ID...................................... 12
    Period........................................... Feb - 2011
    Period ID........................................ 2/28/2011
    POV Local........................................ False
    Language......................................... 1033
    User Level....................................... 1
    All Partitions................................... True
    Is Auditor....................................... False
    ** Begin FDM Runtime Error Log Entry [2011-03-21 14:43:42] **
    ERROR:
    Code............................................. 5
    Description...................................... Invalid procedure call or argument
    Procedure........................................ clsImpProcessMgr.fLoadAndProcessFile
    Component........................................ upsWObjectsDM
    Version.......................................... 1112
    Thread........................................... 15676
    IDENTIFICATION:
    User............................................. admin
    Computer Name.................................... <<ComputerName>>
    App Name......................................... <<ApplicationName>>
    Client App....................................... WebClient
    CONNECTION:
    Provider......................................... ORAOLEDB.ORACLE
    Data Server......................................
    Database Name.................................... HYPTDB
    Trusted Connect.................................. False
    Connect Status.. Connection Open
    GLOBALS:
    Location......................................... ORION
    Location ID...................................... 750
    Location Seg..................................... 4
    Category......................................... WLCAT
    Category ID...................................... 12
    Period........................................... Feb - 2011
    Period ID........................................ 2/28/2011
    POV Local........................................ False
    Language......................................... 1033
    User Level....................................... 1
    All Partitions................................... True
    Is Auditor....................................... False
    ** Begin FDM Runtime Error Log Entry [2011-03-21 14:44:05] **
    ERROR:
    Code............................................. 70
    Description...................................... Permission denied
    Procedure........................................ clsArchiveMgr.fArchiveSupercededDelete
    Component........................................ upsWObjectsDM
    Version.......................................... 1112
    Thread........................................... 7180
    IDENTIFICATION:
    User............................................. admin
    Computer Name.................................... <<ComputerName>>
    App Name......................................... <<ApplicationName>>
    Client App....................................... WebClient
    CONNECTION:
    Provider......................................... ORAOLEDB.ORACLE
    Data Server......................................
    Database Name.................................... HYPTDB
    Trusted Connect.................................. False
    Connect Status.. Connection Open
    GLOBALS:
    Location......................................... SAMPLE
    Location ID...................................... 748
    Location Seg..................................... 2
    Category......................................... WLCAT
    Category ID...................................... 12
    Period........................................... Feb - 2011
    Period ID........................................ 2/28/2011
    POV Local........................................ False
    Language......................................... 1033
    User Level....................................... 1
    All Partitions................................... True
    Is Auditor....................................... False
    ** Begin FDM Runtime Error Log Entry [2011-03-21 14:44:05] **
    ERROR:
    Code............................................. 70
    Description...................................... Permission denied
    Procedure........................................ clsArchiveMgr.fArchiveSupercededFlag
    Component........................................ upsWObjectsDM
    Version.......................................... 1112
    Thread........................................... 7180
    IDENTIFICATION:
    User............................................. admin
    Computer Name.................................... <<ComputerName>>
    App Name......................................... <<ApplicationName>>
    Client App....................................... WebClient
    CONNECTION:
    Provider......................................... ORAOLEDB.ORACLE
    Data Server......................................
    Database Name.................................... HYPTDB
    Trusted Connect.................................. False
    Connect Status.. Connection Open
    GLOBALS:
    Location......................................... SAMPLE
    Location ID...................................... 748
    Location Seg..................................... 2
    Category......................................... WLCAT
    Category ID...................................... 12
    Period........................................... Feb - 2011
    Period ID........................................ 2/28/2011
    POV Local........................................ False
    Language......................................... 1033
    User Level....................................... 1
    All Partitions................................... True
    Is Auditor....................................... False
    ** Begin FDM Runtime Error Log Entry [2011-03-21 14:44:05] **
    ERROR:
    Code............................................. 70
    Description...................................... Permission denied
    Procedure........................................ clsImpProcessMgr.fClearData
    Component........................................ upsWObjectsDM
    Version.......................................... 1112
    Thread........................................... 7180
    IDENTIFICATION:
    User............................................. admin
    Computer Name.................................... <<ComputerName>>
    App Name......................................... <<ApplicationName>>
    Client App....................................... WebClient
    CONNECTION:
    Provider......................................... ORAOLEDB.ORACLE
    Data Server......................................
    Database Name.................................... HYPTDB
    Trusted Connect.................................. False
    Connect Status.. Connection Open
    GLOBALS:
    Location......................................... SAMPLE
    Location ID...................................... 748
    Location Seg..................................... 2
    Category......................................... WLCAT
    Category ID...................................... 12
    Period........................................... Feb - 2011
    Period ID........................................ 2/28/2011
    POV Local........................................ False
    Language......................................... 1033
    User Level....................................... 1
    All Partitions................................... True
    Is Auditor....................................... False
    ** Begin FDM Runtime Error Log Entry [2011-03-21 14:44:05] **
    ERROR:
    Code............................................. 70
    Description...................................... Permission denied
    Procedure........................................ clsImpProcessMgr.fLoadAndProcessFile
    Component........................................ upsWObjectsDM
    Version.......................................... 1112
    Thread........................................... 7180
    IDENTIFICATION:
    User............................................. admin
    Computer Name.................................... <<ComputerName>>
    App Name......................................... <<ApplicationName>>
    Client App....................................... WebClient
    CONNECTION:
    Provider......................................... ORAOLEDB.ORACLE
    Data Server......................................
    Database Name.................................... HYPTDB
    Trusted Connect.................................. False
    Connect Status.. Connection Open
    GLOBALS:
    Location......................................... SAMPLE
    Location ID...................................... 748
    Location Seg..................................... 2
    Category......................................... WLCAT
    Category ID...................................... 12
    Period........................................... Feb - 2011
    Period ID........................................ 2/28/2011
    POV Local........................................ False
    Language......................................... 1033
    User Level....................................... 1
    All Partitions................................... True
    Is Auditor....................................... False

  • Msiexec /qn fails when its not run using the built-in local administrator account

    Hello all,
    I am working on a project where I am trying to automate the deployment of VMs through a self-service portal.
    Among other tasks such as clone VM, sysprep it, assign an IP, create AD computer object, join VM to domain and so on..., i need to install a few applications using msiexec, which is driving me crazy...
    For this purpose, I am using a local user account part of the administrators group.
    Please note, UAC is disabled on all the OS.
    Basically, the msi installation works as expected on Windows 7 machines, however on Windows 8/2012, it fails due to lack of permissions. The curious thing is that if I use the built-in\administrator account instead for the deployment on those systems, the
    application is installed correctly.
    I have tested some things such as: DisableMSI (http://msdn.microsoft.com/en-us/library/aa368304%28v=vs.85%29.aspx), but although it progresses a bit further, it keeps failing.
    Does anyone know what I can do to allow an user part of the administrators local group to be able to install using msiexec /qn?
    Thanks in advance.

    Hi,
    Does it work if you use the account in local admin, and run the commands prompt as administrator to install the msi file? Please know that Only the built in administrator account has admin privilege by default. On other admin accounts you need
    to run with elevated privilege (ie runas).
    I would like to know if you use SCCM to perform your deployment with task sequence.
    As I known, even if you disable UAC, the following policy is still enabled to detect application installation.
    Computer configuration\Windows settings\Security Settings\Local
    Policies\Security Options -> User Account Control: Detect application installations and prompt for elevation policy
    Please disable this policy to see if your issue can be fixed. 
    Kate Li
    TechNet Community Support

  • Configuring EM Database Control when database is running on different IP

    OS Solaris
    DB Oracle 10.2.0.2
    The have the following situation:
    We have a veritas active/passive cluster. This is not RAC. Server name is abc. But the database is running on VIP xyz. How do I configure database control to run on vip xyz. whenever I run emca -config dbconsole db, it always sees the server name as abc.
    I also tried emca -config dbconsole db -HOST xyz but finally it always shows the hostname as abc.
    I was able to get EM to see the targets (database, listener) properly on the vip xyz by manually editing the targets.xml file. So now the situation is, on the home page it shows that the datbaase is up and the listener is up, but it complains that it cannot connect to the database.
    I really appreciate any help in this.
    -Nags

    DBConsole installs requiring different hostnames (virtual) than the physical hostname, simply set ORACLE_HOSTNAME variable to the new virtual hostname and run emca.
    in detail please read this note , it might help you
    Configure DB Control 10.2 for use in Active/Passive High Availability Environments
    Overview and Requirements:
    In order for the DB Control to service a database instance after failing over to a different host in the cluster, the following conditions must be met:
    1. Install on a shared disk/volume which holds the binaries, the configuration and the runtime data (including the database). Installations on non-shared devices are not supported.
    2. Configuration data and metadata must also failover to the surviving node
    3. Inventory location must failover to the surviving node
    4. Software owner and timezone parameters must be the same on all cluster member nodes that will host this database
    Installation and Configuration:
    • In order to override the physical hostname of the cluster member with a virtual hostname, you must use the parameter ORACLE_HOSTNAME to configure DBConsole
    • For inventory pointer, software must be installed using the commandline parameter ‘-invPtrLoc’ to point to the shared inventory location file, which includes the path to the shared inventory location.
    • The database software, the configuration of the database and DB Control is done on a shared volume.
    Note: The use of OCFS V1 to install shared Oracle binaries is currently not supported.
    If you are using an NFS mounted volume for the installation, please ensure that you specify rsize and wsize in your mount command to prevent running into I/O issues.
    See Metalink Note <279393.1>
    Example:
    lxdb.acme.com:/u01/app/share1 /u01/app/share1 nfs rw,bg,rsize=32768,wsize=32768,hard,nointr,tcp,noac,vers=3,timeo=600 0 0
    A. Setup the alias for the virtual hostname/virtual IP address
    You can do this by either allowing the clusterware to set it up, or manually before installation and startup of Oracle services. This virtual hostname must be static and resolveable consistently on the network: All nodes participating in the setup must resolve the virtual IP address to the same hostname. Standard TCP tools like nslookup and traceroute can be used to verify.
    B. Setup shared storage
    This can be storage managed by the clusterware that is in use or, you can use any shared file system (FS) volume as long as it is not an unsupported type, such as OCFS V1. The most common shared FS is NFS.
    C. Setup the environment:
    Some OS versions require specific OS patches to be applied prior to installing 10gR2. The user installing and using the 10gR2 software must also have sufficient kernel resources available. Refer to the installation guide for more details.
    Before you launch the installer, certain environment variables need to be verified. Each of these variables must be set identical for the account installing the software on ALL machines participating in the cluster:
    • OS variable TZ
    Timezone setting. Recommended to unset this prior to the installation
    • PERL variables
    Variables like PERL5LIB should be unset to prevent the install (OUI) and DB Control to pick up the wrong set of PERL libraries
    • Paths used for dynamic libraries
    Based on the OS, the variables can be LD_LIBRARY_PATH, LIBPATH, SHLIB_PATH or DYLD_LIBRARY_PATH. These variables should ONLY point to directories, which will be visible and usable on each node of the cluster.
    D. Ensure that oracle user name, ID and group name and ID are in sync on all cluster members
    The user and group of the software owner should be defined identically on all nodes of the cluster. This can be verified using the ‘id’ command:
    $ id -a
    uid=1234(oracle) gid=5678(dba) groups=5678(dba)
    E. Ensure that inventory files are on the shared storage
    1. Create your new ORACLE_HOME directory.
    2. Create the Oracle Inventory directory under the new oracle home
    cd <shared oracle home>
    mkdir oraInventory
    3. Create the oraInst.loc file. This file contains the Inventory directory path information needed by the Universal Installer.
    a. vi oraInst.loc
    b. Enter the path information to the Oracle Inventory directory, and specify the group of the software owner as the dba user:
    Example:
    inventory_loc=/app/oracle/product/10.2/oraInventory
    inst_group=dba
    F. Start the installer:
    You need to point to the inventory location file oraInst.loc (under the ORACLE_BASE in this case), as well as specifying the hostname of the virtual group. Debug parameter is optional.
    runInstaller -invPtrLoc /app/oracle/share1/oraInst.loc ORACLE_HOSTNAME=lxdb.acme.com –debug
    G. Update the SPFILE and tnsnames.ora file
    Add an listener entry to the spfile file that points to an entry in the tnsnames file calling the virtual IP directly. As an example, set a tnsnames.ora entry that points to the virtual host name:
    LISTENER_DBC =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = lxdb.acme.com)(PORT = 1521))
    Then update the spfile parameter local_listener to point to the new tnsnames.ora entry:
    SQL> alter system set local_listener='LISTENER_DBC';
    SQL> show parameter local
    NAME TYPE VALUE
    local_listener string LISTENER_DBC
    H. Startup of services:
    Ensure that you start your services in the proper order:
    - establish IP address on the active node
    - start the TNS listener
    - start the database
    - start dbconsole
    - test functionality
    In case of failure…
    - Establish IP on failover box
    - start TNS listener lsnrctl start
    - start the database dbstart
    - start dbconsole emctl start dbconsole
    - test functionality
    If you want to manually stop or shutdown a service:
    Stop the application
    Stop DB Control emctl stop dbconsole
    Stop TNS listener lsnrctl stop
    Stop DB dbshut
    Stop IP

  • [SOLVED] PKGBUILD for a font - xset fails when X not running

    I am working on my second PKGBUILD -- this time for a simple raster font I use.  The PKGBUILD uses a post_install() which does an "xset -fp rehash" after installing the font files, because it seemed like otherwise the font wouldn't show up in X.  Then in tests I found that the install died with errors when I installed my package without X running.  How is this situation normally handled?
    Last edited by scottfial (2010-07-09 08:04:21)

    xset will fail if X isn't running.  Font packages generally have an install file like this:
    # arg 1: the new package version
    post_install() {
    echo -n "Updating font cache... "
    fc-cache -f > /dev/null
    mkfontscale /usr/share/fonts/local
    mkfontdir /usr/share/fonts/local
    echo "done."
    # # arg 1: the new package version
    # # arg 2: the old package version
    post_upgrade() {
    post_install $1
    # # arg 1: the old package version
    post_remove() {
    post_install $1
    The user can then either run xset manually or logout/login after installation.

  • How do you separate global data running in different threads of TestStand

    I have created a DLL which I want to call from multiple threads of TestStand. I also need to have some global data that is local to each thread. VC++ allows me to use the declaration:
    __declspec(thread) int foo
    to create "Thread Local Storage"
    (ie global data that is local in the each thread -- not shared between threads).
    This works fine from a VC++ application, but when I try to access data declared with this from Test Stand I get the following error.
    Win32error code 998 - Invalid access to memory location
    This occurs when I try to set a variable declared using this convention in my DllMain function.
    I get a -17502; System Level Exception when I access it from a function that I call in the DL
    L.

    Russell -
    I found the following comment in Microsoft's MSDN and I know that TestStand dynamically loads DLLs:
    If a DLL declares any nonlocal data or object as __declspec( thread ), it can cause a protection fault if dynamically loaded. After the DLL is loaded withLoadLibrary, it causes system failure whenever the code references the nonlocal __declspec( thread ) data. Because the global variable space for a thread is allocated at run time, the size of this space is based on a calculation of the requirements of the application plus the requirements of all of the DLLs that are statically linked. When you use LoadLibrary, there is no way to extend this space to allow for the thread local variables declared with __declspec( thread ). Use the TLS APIs, such as
    TlsAlloc, in your DLL to allocate TLS if the DLL might be loaded with LoadLibrary.
    Scott Richardson (NI)
    Scott Richardson
    National Instruments

  • Cloning context file on db tier fails when run non-interactively

    Hi all,
    I have a problem where cloning the DB tier context file using adclonectx.pl non-interactively using a pairsfile and noprompt fails in certain circumstances and continually returns this error
    Target System Port Pool [0-99] : RC-00201: Error: Not a valid port pool number
    If we clone from prod or uat (which are on different nodes) to non-prod it works fine, if we clone from a different non-prod environment (on the same node) it fails.
    We can run adclonectx.pl interactively with the same pairsfile and it works, so I copied all of the variables in the log into the pairsfile and ran it non-interactively and it failed with the same error.
    My understanding is that adclonectx.pl uses the source DB context file and the pairsfile to create the new context file. I've tried cloning the context file non-interactively from several different non-prod envs with the same error, so I don't think it's specific to 1 source env.
    It seems to want to prompt for the portpool when it's on the same node as the source environment.
    EBS 12.1.3, DB 11.2.0.3 RAC 2 node on Oracle Linux 5.
    I've raised 3-9540409031 : adclonectx.pl on db Tier errors with RC-00201 when run non-interactively using pairsfile - but haven't got an answer yet.
    This is the pairsfile with everthing in it - generated from an interactive session that worked.
    s_db_ons_remoteport = 6411
    s_cmanport = 1532
    s_clusterInterConnects = dxd1db01-ib
    s_dbhost = dxd1db01-ib
    s_dbSidLower = ebscnv1
    s_dbhome4 = +DATA_DXD1
    s_dbhome3 = +DATA_DXD1
    s_dbSid = EBSCNV1
    s_dbhome2 = +DATA_DXD1
    s_dbhome1 = +DATA_DXD1
    s_isAdmin = YES
    s_clonestage = /u01/EBSDEV/product/11.2.0/appsutil/clone
    s_jretop = /u01/EBSDEV/product/11.2.0/jdk/jre
    s_db_rollback_segs = NOROLLBACK
    s_db_util_filedir = /u01/EBSCNV/tmp
    s_isForms = YES
    s_undo_tablespace = APPS_UNDOTS1
    s_temp = /u01/EBSDEV/product/11.2.0/appsutil/temp
    s_database_type = RAC
    s_dbuser = orebscnv
    s_instName = EBSCNV1
    s_dbGlnam = EBSCNV
    s_domainname = mgmt.shared.health.nz
    s_dbgroup = oinstall
    s_hostname = dxd1db01-ib
    s_jdktop = /u01/EBSDEV/product/11.2.0/jdk/jre
    s_isConc = YES
    s_instThread = 1
    s_dbport = 1532
    s_isWeb = YES
    s_dbCluster = true
    s_contextname = EBSCNV1_dxd1db01-ib
    s_dbClusterInst = 2
    s_dbdomain = mgmt.shared.health.nz
    s_base = /u01/EBSCNV
    s_db_ons_localport = 6311
    s_contextfile = /u01/EBSCNV/tmp/EBSCNV1_dxd1db01-ib.xml
    s_db_oh = /u01/EBSDEV/product/11.2.0
    s_instNumber = 1
    s_virtual_hostname = dxd1db01-ib
    s_display = y
    this is the adclonectx.pl comand i use - I've checked all the env variables before running and they're all good
    perl ./adclonectx.pl \
    contextfile=$SRCCTX \
    template=$ORACLE_HOME/appsutil/template/adxdbctx.tmp \
    outfile=$NEWCTX \
    pairsfile=$PAIRSFILE \
    initialnode
    when run non-interactively i use this command  - and as mentioned above this works under certain circumstances
    dummypw=dummypw
    echo \$dummypw | perl ./adclonectx.pl \
    contextfile=$SRCCTX \
    template=$ORACLE_HOME/appsutil/template/adxdbctx.tmp \
    outfile=$NEWCTX \
    pairsfile=$PAIRSFILE \
    initialnode noprompt
    Any ideas, it's got 3 DBAs stumped...

    That makes sense to me ... the pool parameter should be in the pairsfile, .. or in the parameters when calling it at command line
    You can force the pool to be changed, even when you're on the same server. Actually, I would use different pools for any environment, different server or not. And, avoid the default pool as well. If you do it this way, one of the advantages is that you spot issues - like the one you have - much much earlier. In that case, you would need that extra parameter on every run.

  • Firefox Flash plugin crashes when FF launched with "Run as different user"

    I often start Firefox in Windows 7 (x64) using the "Run as different user" mechanism. After upgrading my Flash plugin to v11 (11.8.800.94), the browser will hang for several minutes when visiting any page that contains Flash content. When Firefox becomes responsive again, scrolling a page with Flash content will cause the app to hang again. Disabling the Flash plugin eliminates the problem.
    It seems the plugin is silently crashing -- I'm not alerted to a plugin crash in any way (no dialog or yellow "Flash player crashed" notice at the top of the window), but after FF hangs I will see a new crash report entry in the FF about:crashes list. An example crash report is available at https://crash-stats.mozilla.com/report/index/ff452291-b5b2-44e4-a172-416792130818
    The plugin does not crash when Firefox is running under the same account that is logged onto Windows interactively -- only when running FF as a different user. For example, if I log onto Windows with user account Adam and launch FF normally, the problem does not exist. If I close FF and launch it as user Bob (shift+right-click Firefox Shortcut, choose "Run as different user"), the problem will appear. However, if I log into Windows as user Bob and launch FF normally, the problem does not exist.
    I have tried the following as troubleshooting steps, all to no effect:
    Create new Windows user accounts to rule out potential Windows or Firefox profile issues.
    Use another PC (also Windows 7 x64). The same behavior occurs on both PCs
    Disable AVG antivirus.
    Upgrade Firefox to latest version (23.0.1).
    Disable Flash hardware acceleration.
    Give both user accounts full local admin privileges.
    Can anyone suggest something to try next?
    Update: Per the troubleshooting instructions at < http://forums.adobe.com/thread/1018071?tstart=0 >, I was able to eliminate the problem by adding the line
    ProtectedMode=0
    to my C:\Windows\SysWOW64\Macromed\Flash\mms.cfg file to disable Flash Player Protected Mode. There are instructions on that page for submitting a Protected Mode-related bug, and I will follow through with that.

    Maybe you did't understand my previous statement. There are no crashes in FF 3.6, There is no previous evidence FF 14 was ever here, I completely uninstalled all trace of Firefox, no app data, no preferences, no cache. I will upgrade to FF14 so I can send IDs,
    so here ya go.
    Crash ID: bp-fa9da320-92dc-47f7-afff-33e702120718
    AdapterDeviceID: 0x2a02
    AdapterVendorID: 0x8086
    Add-ons: {972ce4c6-7e08-4474-a285-3208198ce6fd}:14.0.1
    BuildID: 20120713134347
    CrashTime: 1342655269
    EMCheckCompatibility: true
    Email: [email protected]
    FramePoisonBase: 7ffffffff0dea000
    FramePoisonSize: 4096
    InstallTime: 1342655256
    Notes: AdapterVendorID: 0x8086, AdapterDeviceID: 0x2a02GL Context? GL Context+ GL Layers? GL Layers+
    ProductID: {ec8030f7-c20a-464f-9b0e-13a3a9e97384}
    ProductName: Firefox
    ReleaseChannel: release
    StartupTime: 1342655256
    Theme: classic/1.0
    Throttleable: 1
    URL: http://www.mozilla.org/en-US/firefox/14.0.1/whatsnew/?oldversion=rv:1.9.2.13
    Vendor: Mozilla
    Version: 14.0.1
    This report also contains technical information about the state of the application when it crashed.

  • I have a production mobile Flex app that uses RemoteObject calls for all data access, and it's working well, except for a new remote call I just added that only fails when running with a release build.  The same call works fine when running on the device

    I have a production mobile Flex app that uses RemoteObject calls for all data access, and it's working well, except for a new remote call I just added that only fails when running with a release build. The same call works fine when running on the device (iPhone) using debug build. When running with a release build, the result handler is never called (nor is the fault handler called). Viewing the BlazeDS logs in debug mode, the call is received and send back with data. I've narrowed it down to what seems to be a data size issue.
    I have targeted one specific data call that returns in the String value a string length of 44kb, which fails in the release build (result or fault handler never called), but the result handler is called as expected in debug build. When I do not populate the String value (in server side Java code) on the object (just set it empty string), the result handler is then called, and the object is returned (release build).
    The custom object being returned in the call is a very a simple object, with getters/setters for simple types boolean, int, String, and one org.23c.dom.Document type. This same object type is used on other other RemoteObject calls (different data) and works fine (release and debug builds). I originally was returning as a Document, but, just to make sure this wasn't the problem, changed the value to be returned to a String, just to rule out XML/Dom issues in serialization.
    I don't understand 1) why the release build vs. debug build behavior is different for a RemoteObject call, 2) why the calls work in debug build when sending over a somewhat large (but, not unreasonable) amount of data in a String object, but not in release build.
    I have't tried to find out exactly where the failure point in size is, but, not sure that's even relevant, since 44kb isn't an unreasonable size to expect.
    By turning on the Debug mode in BlazeDS, I can see the object and it's attributes being serialized and everything looks good there. The calls are received and processed appropriately in BlazeDS for both debug and release build testing.
    Anyone have an idea on other things to try to debug/resolve this?
    Platform testing is BlazeDS 4, Flashbuilder 4.7, Websphere 8 server, iPhone (iOS 7.1.2). Tried using multiple Flex SDK's 4.12 to the latest 4.13, with no change in behavior.
    Thanks!

    After a week's worth of debugging, I found the issue.
    The Java type returned from the call was defined as ArrayList.  Changing it to List resolved the problem.
    I'm not sure why ArrayList isn't a valid return type, I've been looking at the Adobe docs, and still can't see why this isn't valid.  And, why it works in Debug mode and not in Release build is even stranger.  Maybe someone can shed some light on the logic here to me.

  • Error "Conversion failed when converting date and/or time from character string" to execute one query in sql 2008 r2, run ok in 2005.

    I have  a table-valued function that run in sql 2005 and when try to execute in sql 2008 r2, return the next "Conversion failed when converting date and/or time from character string".
    USE [Runtime]
    GO
    /****** Object:  UserDefinedFunction [dbo].[f_Pinto_Graf_P_Opt]    Script Date: 06/11/2013 08:47:47 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE   FUNCTION [dbo].[f_Pinto_Graf_P_Opt] (@fechaInicio datetime, @fechaFin datetime)  
    -- Declaramos la tabla "@Produc_Opt" que será devuelta por la funcion
    RETURNS @Produc_Opt table ( Hora datetime,NSACOS int, NSACOS_opt int)
    AS  
    BEGIN 
    -- Crea el Cursor
    DECLARE cursorHora CURSOR
    READ_ONLY
    FOR SELECT DateTime, Value FROM f_PP_Graficas ('Pinto_CON_SACOS',@fechaInicio, @fechaFin,'Pinto_PRODUCTO')
    -- Declaracion de variables locales
    DECLARE @produc_opt_hora int
    DECLARE @produc_opt_parc int
    DECLARE @nsacos int
    DECLARE @time_parc datetime
    -- Inicializamos VARIABLES
    SET @produc_opt_hora = (SELECT * FROM f_Valor (@fechaFin,'Pinto_PRODUC_OPT'))
    -- Abre y se crea el conjunto del cursor
    OPEN cursorHora
    -- Comenzamos los calculos 
    FETCH NEXT FROM cursorHora INTO @time_parc,@nsacos
    /************  BUCLE WHILE QUE SE VA A MOVER A TRAVES DEL CURSOR  ************/
    WHILE (@@fetch_status <> -1)
    BEGIN
    IF (@@fetch_status = -2)
    BEGIN
    -- Terminamos la ejecucion 
    BREAK
    END
    -- REALIZAMOS CÁLCULOS
    SET @produc_opt_parc = (SELECT dbo.f_P_Opt_Parc (@fechaInicio,@time_parc,@produc_opt_hora))
    -- INSERTAMOS VALORES EN LA TABLA
    INSERT @Produc_Opt VALUES (@time_parc,@nsacos, @produc_opt_parc)
    -- Avanzamos el cursor
    FETCH NEXT FROM cursorHora INTO @time_parc,@nsacos
    END
    /************  FIN DEL BUCLE QUE SE MUEVE A TRAVES DEL CURSOR  ***************/
    -- Cerramos el cursor
    CLOSE cursorHora
    -- Liberamos  los cursores
    DEALLOCATE cursorHora
    RETURN 
    END

    You can search the forums for that error message and find previous discussions - they all boil down to the same problem.  Somewhere in your query that calls this function, the code invoked implicitly converts from string to date/datetime.  In general,
    this works in any version of sql server if the runtime settings are correct for the format of the string data.  The fact that it works in one server and not in another server suggests that the query executes with different settings - and I'll assume for
    the moment that the format of the data involved in this conversion is consistent within the database/resultset and consistent between the 2 servers. 
    I suggest you read Tibor's guide to the datetime datatype (via the link to his site below) first - then go find the actual code that performs this conversion.  It may not be in the function you posted, since that function also executes other functions. 
    You also did not post the query that calls this function, so this function may not, in fact, be the source of the problem at all. 
    Tibor's site

  • Unit test runs perfectly fine with NUnit but fails when run from TestExplorer

    Hello all,
    I have a TestProject, Harmony.Tests. In there, I have a method AddApplicationEvent()
    which calls another method Send(InvokeRequestMessage requestMessage) which calls a webservice (OperationHandlerBrokerWebService). 
    The code snippet looks like this. This is not the complete code but a part where we are calling the web service. It fails on the underlined Italic line of code.
    OperationHandlerBrokerWebService brokerService = new OperationHandlerBrokerWebService();
    brokerService.UseDefaultCredentials = true;
    brokerService.Url = address;
    brokerService.Timeout = timeoutInMilliseconds;
    byte[] serializedResponseMessage = brokerService.InvokeOperationHandler(serializedRequestMessage);
    The same test works and passed fine when I ran it with NUnit, but failed with following exception when I tried to run it from TestExplorer. 
    Test Name: AddApplicationEvent
    Test FullName: N4S.Harmony.Tests.CaseManagement.HarmonyFacadeTests.AddApplicationEvent
    Test Source: d:\TFS\TMW\Dev\TMWOnline\Harmony\N4S.Harmony.Tests\CaseManagement\HarmonyFacadeTests.cs : line 665
    Test Outcome: Failed
    Test Duration: 0:00:00.296
    Result Message:
    SetUp : Message returned System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: Invalid token for impersonation - it cannot be duplicated.
    at System.Security.Principal.WindowsIdentity.CreateFromToken(IntPtr userToken)
    at System.Security.Principal.WindowsIdentity..ctor(SerializationInfo info)
    at System.Security.Principal.WindowsIdentity..ctor(SerializationInfo info, StreamingContext context)
    --- End of inner exception stack trace ---
    at System.RuntimeMethodHandle._SerializationInvoke(Object target, SignatureStruct& declaringTypeSig, SerializationInfo info, StreamingContext context)
    at System.Reflection.RuntimeConstructorInfo.SerializationInvoke(Object target, SerializationInfo info, StreamingContext context)
    at System.Runtime.Serialization.ObjectManager.CompleteISerializableObject(Object obj, SerializationInfo info, StreamingContext context)
    at System.Runtime.Serialization.ObjectManager.FixupSpecialObject(ObjectHolder holder)
    at System.Runtime.Serialization.ObjectManager.DoFixups()
    at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
    at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
    at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream)
    at N4S.Forms.OperationHandlerBroker.AMessage.DeserializeMessage(Byte[] serializedMessage)
    at N4S.Forms.OperationHandlerBroker.WebServiceServer.BrokerService.InvokeOperationHandler(Byte[] serializedInvokeRequestMessage)
    --- End of inner exception stack trace ---
    expected: <0>
    but was: <1>
    Result StackTrace:
    at N4S.Harmony.Tests.TestHelper.InvokeOperation(OperationHandler handler, OperationHandlerInput input, Boolean expectedToWork) in d:\TFS\TMW\Dev\TMWOnline\Harmony\N4S.Harmony.Tests\TestHelper.cs:line 136
    at N4S.Harmony.Tests.TestHelper.LoginAsUser(String username, String password) in d:\TFS\TMW\Dev\TMWOnline\Harmony\N4S.Harmony.Tests\TestHelper.cs:line 394
    at N4S.Harmony.Tests.TestHelper.Login(TestUserName requestedUser) in d:\TFS\TMW\Dev\TMWOnline\Harmony\N4S.Harmony.Tests\TestHelper.cs:line 377
    at N4S.Harmony.Tests.TestHelper.LoginAsAdvisor() in d:\TFS\TMW\Dev\TMWOnline\Harmony\N4S.Harmony.Tests\TestHelper.cs:line 230
    at N4S.Harmony.Tests.CaseManagement.HarmonyFacadeTests.Login() in d:\TFS\TMW\Dev\TMWOnline\Harmony\N4S.Harmony.Tests\CaseManagement\HarmonyFacadeTests.cs:line 76
    at N4S.Harmony.Tests.CaseManagement.HarmonyFacadeTests.SetupTest() in d:\TFS\TMW\Dev\TMWOnline\Harmony\N4S.Harmony.Tests\CaseManagement\HarmonyFacadeTests.cs:line 67
    I am not sure what causing the issue. I checked the Credentials, Windows Identity during both the test run and there is no difference. Please advise !!
    Thanks,
    Deepak

    Hi Tina,
    Thanks for your reply. 
    I do have NUnit adapter installed. I even noticed that the test runs fine with NUnit GUI and also if I run it through Resharper Test Explorer window. 
    As you can see in the image above the same test is passed when I ran it from Resharper Unit Test Explorer window but fails when I ran it from Test Explorer window. I also captured the information on fiddler. 
    There was a significant difference in the Header Content length. Also under the User-Agent property the protocol versions are different. 
    Not sure why VSTest ExecutionEngine is picking a different version.
    The UnitTest in question is calling a webservice method which in turn calls a method from another referenced project. 
    Web Service class
    using System;
    using System.Web.Services;
    using N4S.Forms.OperationHandlerBroker.Server;
    using NLog;
    namespace N4S.Forms.OperationHandlerBroker.WebServiceServer
    /// <summary>
    /// The operaton-handler broker service.
    /// </summary>
    [WebService(Description = "The N4S Forms Operation-Handler Broker Web-Service.", Name = "OperationHandlerBrokerWebService",
    Namespace = "N4S.Forms.OperationHandlerBroker.WebServiceServer")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    public class BrokerService : WebService
    { /// <summary>
    /// Calls <see cref="HandleRequest"/>. Updates performance-counters.
    /// </summary>
    /// <param name="serializedInvokeRequestMessage">the binary-serialized <see cref="InvokeRequestMessage"/></param>
    /// <returns>the binary-serialized response message</returns>
    [WebMethod(BufferResponse = true, CacheDuration = 0, Description = "Invokes the requested operation-handler and returns a binary-serialized response-message.", EnableSession = false)]
    public byte[] InvokeOperationHandler(byte[] serializedInvokeRequestMessage)
    logger.Trace(Strings.TraceMethodEntered);
    PerformanceMonitor.RecordRequestStarted();
    InvokeRequestMessage requestMessage = (InvokeRequestMessage) AMessage.DeserializeMessage(serializedInvokeRequestMessage);
    InvokeResponseMessage responseMessage;
    try
    responseMessage = HandleRequest(requestMessage);
    PerformanceMonitor.RecordSuccessfulRequest();
    catch (Exception)
    PerformanceMonitor.RecordFailedRequest();
    throw;
    finally
    PerformanceMonitor.RecordRequestEnded();
    logger.Trace(Strings.TraceMethodExiting);
    return AMessage.SerializeMessage(responseMessage);
    UnitTest snippet
    OperationHandlerBrokerWebService brokerService = new OperationHandlerBrokerWebService();
    brokerService.UseDefaultCredentials = true;
    byte[] serializedResponseMessage = brokerService.InvokeOperationHandler(serializedRequestMessage);
    Please advise.
    Thanks,
    Deepak

Maybe you are looking for

  • Issue with FI substitution in Miro

    Hi Friends, I have a substitution created in FI. According to substitution, if cost center entered in document is 'xyz', then it will substitute tax code from x1 to x2. It is working fine for any FI document posted in FI (like FB01 and so on) I am ex

  • A reason to keep PSE 3, old filters and plug ins

    One of my absolute favourite filter sets is KPT Collection by Corel. When getting my new Mac, I realized that KPT was no longer supported by Corel, I had to call them when I couldnt install it into PSE.  They said that it was being discontinued. And

  • SQL Server Transparent Data encryption

    I have implemented TDE for the Database and Column Level Encryption for Sensitive data in Tables. But, the Porblem is the data is entered through an front end application how could i encrypt this data when it is inserted from the Front end. And how t

  • Joining three tables through link tables

    I have three separate tables that are related to each other through two link tables. Employees have a many to many relationship with Programs (1 link table) Employee + Programs have a many to many relationship with Attributes (The employee attributes

  • HT201077 my photo stream on windows doesn't recieve my photo album. why?

    My photo stream back up is "on" on my device, however none of the photos is backed up on my PC. It has been like that for a few months. I cleared space on my iCloud storage, i did reset on the iCloud settings page, and still none. I could use some he