Tibco error on Parasoft soa test tool - unit-testing

Im using Parasoft SOA test tool and I get the error : Failed to open Tibrv in native implementation while running my tests using TIBCO. I have added the jar file in the soa classpath and also in the environment variables. can some one please help

This error says that the RV client can't link the native Rendezvous libraries.
So adding the jar file is only half of the job. It might help to know more what you like to do and in what way you start "TIBCO" (there are many TIBCO products) to help on this issue.
Generally on windows platforms the RV dll's should be in your Path Variable.

Related

Unit testing net5.0 ASP.Net projects with the NUnit console?

I've recently been trying to implement automated unit test within my Jenkins pipeline using the nunit3-console.exe, for multiple Test projects that implement Microsoft and Asp.Net related functionnalities within their set-up methods.
The test projects are in Net 5.0 and trying to run them will give me this error:
1) SetUp Error : MyProjectPath
System.IO.FileNotFoundException : Could not load file or assembly 'Microsoft.Extensions.DependencyInjection.Abstractions, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The specified file could not be found.
at MyProjectTest.StartTest()
This is obviously not the only missing assembly, as it requires many of the Microsoft.Extensions and Asp.Net related dll to functions. Manually supplying said DLLs to the Test folder directory does allow the command to properly run, but this is obviously not a great solution in the long run. Supplying the missing assemblies to the GAC would also fix the problem, but only as long as we don't update any of our packages.
What would be the intended workflow when a Test requires such DLLs? Where should they be placed so that they can easily be maintained and/or replaced after updates? I've tried using the .Net Core console runner hoping it might include these DLLs as well.
Thanks a lot for your help!
https://github.com/nunit/nunit-console/releases
Use the NUnit.ConsoleRunner.NetCore.

Registering a CPP dll into COM after installation using Wix Msi installer

I am trying to register a CPP library into COM during the Msi installation.
I have searched a lot and found many solutions in here, but nothing is working in my code. I don't know is there any direct method for this. I have tried using Custom Action with direct ExeCommand and with a batch script.
Here is the code with batch script.
<SetProperty Id="Register" Value=""[INSTALLDIR]Scripts\Register.bat"" After="CostFinalize"/>
<CustomAction Id="Register" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="deferred" Return="check" Impersonate="no"/>
<SetProperty Id="Unregister" Value=""[INSTALLDIR]Scripts\UnRegister.bat"" After="CostFinalize"/>
<CustomAction Id="Unregister" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="deferred" Return="check" Impersonate="no"/>
Using this code, installation does not show any error, but dll is not getting registered. After installation if I ran the batch script separately then it gets registered.
Register.bat
cd "C:\Windows\System32"
regsvr32 "C:\Program Files (x86)\ABC\Abc.dll"
ping -n 15 127.0.0.1 >nul:
Unregister.bat
cd "C:\Windows\System32"
regsvr32 /u "C:\Program Files (x86)\ABC\Abc.dll"
ping -n 15 127.0.0.1 >nul:
With Custom Action with ExeCommand it shows error like some dll dependency missing.
ExeCommand code is given below.
<CustomAction Id="Register" Directory="INSTALLDIR" Execute="deferred" Impersonate="no"
ExeCommand="[WindowsFolder]System32\regsvr32 "[INSTALLDIR]Abc.dll"" Return="check" />
<CustomAction Id="Unregister" Directory="INSTALLDIR" Execute="deferred" Impersonate="no"
ExeCommand="[WindowsFolder]System32\regsvr32 /u "[INSTALLDIR]Abc.dll"" Return="check" />
And InstallSequencefor both the cases is given below.
<InstallExecuteSequence>
<Custom Action="Register" Before="InstallFinalize" >NOT Installed</Custom>
<Custom Action="Unregister" Before="RemoveFiles">Installed AND NOT UPGRADINGPRODUCTCODE</Custom>
</InstallExecuteSequence>
In both the case I think it is running with elevated privileges.
This is the error I get most of the time.
Edit
Dependency walker view of the dll is shown below.
Also I am adding the heat command I used. I have added this to prebuild event to generate the component. After that added this component in product file.
call "$(WIX)bin\heat.exe" file "dllPath\Abc.dll" -dr "INSTALLDIR" -srd -gg -sfrag -suid -out "$(SolutionDir)Installer\ComRegisterComponent.wxs"
And the generated file is look like this.
<Fragment>
<DirectoryRef Id="INSTALLDIR">
<Component Id="Abc.dll" Guid="*">
<File Id="Abc.dll" KeyPath="yes" Source="SourceDir\Abc.dll" />
</Component>
</DirectoryRef>
</Fragment>
Here this SourceDir path is confusing me.I have added the exact path in heat command even then it generates this SourceDir.
Short, Summary Answer
You need to stop using batch files and custom actions for COM registration (unreliable) and rather extract the COM registration information using the heat.exe tool from the WiX toolkit to add the COM registration to your MSI database at compile time.
There are some complications for 64-bit binaries, see details below. Fortunately it looks like you are dealing with a 32-bit component based on your installation directory shown above.
In this particular case it helped to run heat.exe on the COM file after deployment when all dependencies were "in place" for the COM file to load properly. There is a lot of "debugging communication" in these answers - I'll leave it all in place for the future, but try this simple solution first. And perhaps try the new dependency tool "Dependencies.exe" described below.
Long, Detailed Answer
Before I try to answer the question (which seems to revolve around missing dependencies or something weird being done in your batch file), I want to clear up a few things for you with regards to best practice for COM registration.
Note: the screenshot seems to indicate something weird going on in your batch file, but missing dependencies could still be an issue.
Self-registration Considered Harmful
Self-registration should not be used to register COM files. Here is a description of why this is the case: MSI register dll - Self-Registration considered harmful. There is good news, however, doing things as intended via built-in MSI mechanisms will be both easier and more reliable once you set it up properly.
There is a way to self-register files during installation without using custom actions like you are trying to do (the SelfReg table). Custom actions are very hard to get working correctly, but you should not use the built-in mechanism to run self-registration either (as explained in detail in the linked answer above)
Rather than using custom actions or the SelfReg table, COM registration information should be extracted from your COM files at compilation time - in other words when you compile your MSI file from your WiX source files. The extracted registry data should be used to populate the family of MSI data tables designed to reliably register and unregister the COM file during installation and uninstallation respectively.
WiX: The "heat.exe" Command Line Tool
Understanding the intricate details of this process is not necessary - all you need to know is what tools to use. WiX provides the "heat.exe" tool for this purpose. It is essentially a "harvester" tool capable of generating valid WiX XML source files for several purposes - one of which is COM extraction. It also supports traversing directories in general - generating WiX source files which can install the files encountered during traversal. It is essentially a very quick way to make an MSI package once you know how to use it.
Dependency Walker
So we have established that you should take the time to learn how to use heat.exe to generate the WiX source necessary to register the COM file properly. however, there is one more problem: the missing dependencies.
For a COM file to be able to self-register - or for you to be able to successfully extract the COM registry data using heat.exe - the COM file must be able to load correctly. For this to be possible all dll dependencies must be available on the system in question in an accessible location.
Get yourself a copy of Dependency Walker and use it to scan your COM file for what files it depends on. Here is an example of a COM file which fails to load because it cannot find MMUtilities.dll:
You will most likely find something similar wrong with your dll (or whatever file type it is, for example OCX) when it is run from your setup's installation location. The required dependency files can not be found by regsvr32.exe and the registration process fails.
There are some reported missing dependencies that are not important - I guess this has to do with the age of the Dependency Walker tool - it hasn't been updated recently as far as I know. Look for a file you recognize as either your own dependency file or a core system file as opposed to very long dll names of files you have never heard of. Keep in mind that some dlls have dependency language dlls that are required for loading. For example MMUtilities.dll needs MmUtilitiesEnglish.dll or another language dll present in the same folder to be able to load correctly.
Some sample false positive dependencies for the above file: API-MS-WIN-CORE-RTLSUPPORT-L1-1-0.DLL, API-MS-WIN-CORE-PROCESSTHREADS-L1-1-0.DLL, API-MS-WIN-CORE-REGISTRY-L1-1-0.DLL, etc... There were many. I believe, but I am not sure, that the root cause of these false positives centers around problems with side-by-side components installed to the WinSxS folder, but that is a whole other discussion - just mentioning it.
UPDATE: I just checked this again and most of the false positive dependencies seen above are apparently API-sets - a Windows feature introduced long after Dependency Walker was created, and hence not handled correctly by the tool.
As the linked answer indicates (do read it, link above), there is now also a rewrite of Dependency Walker in C# called "Dependencies", available here: https://github.com/lucasg/Dependencies (untested by me at time of writing, will test shortly).
Also quick mention: if you have an executable to check (as opposed to a dll, ocx, etc...), you can launch it via the Profile => Start Profiling... menu entry and you will then also see "hidden run-time dependencies" not specified in the binary import table (where dependencies / imports are specified). You need to really exercise the application using all features in all dialogs to be sure to get all such dependencies.
The dependency walker web page calls these hidden dependencies explicit dependencies (a dynamic or run-time dependency) and system hook dependencies (injected dependencies). See the link just above for more details.
Heat.exe Extraction
Once you have determined what files are missing for making your WiX heat.exe extraction work, you can put the files in question "next to" your COM dll so they are found during its loading. You can test run using regsvr32.exe to see if registration completes correctly. There should be no error messages when you run registration manually like this. Remember to run registration from an elevated command prompt.
Several other stackoverflow answers explain how to use heat.exe - I haven't used it in a long time: How to run heat.exe and register a dll in wix. Here is the official documentation for heat.exe from the WiX guys themselves. It can be a somewhat intimidating tool - it has a lot of features.
In its simplest form (for normal 32-bit COM files with all dependencies available in the path or local folder), you can run this heat.exe command line to generate an output WiX source file called YourFileName.wxs with all the required COM registry data.
heat.exe file YourFileName.ocx -o YourFileName.wxs
I wrote an answer several years ago showing how to incorporate the exported WiX registry data into your main WiX source: How to Reference a Heat Output(wxs) in Wix (Command Line). I believe this is an accurate description of the procedure, but for some reason someone down-voted the answer. Please give it a go and see if it works for you.
Important!: heat.exe does not yet correctly process 64-bit COM binaries (December, 2017).
I have been informed that the WiX Expansion Pack (not free) handles 64-bit binaries and provides several other features.
I suppose I can link to it (I am not affiliated with FireGiant): https://www.firegiant.com/wix/wep-documentation/harvesting/. Somehow people need to know about these things, but I am not sure about the the stackoverflow etiquette of linking.
Are your binaries 64-bit? (it doesn't look that way from your installation folder, but I add this for others who might find it). For a 64-bit component I guess we have come full circle and have to advise you to either use the above expansion pack feature or just try to set the file to self-register as described here. I hate this self-register "solution", but I can't think of any other quick fixes at the moment (none that I would recommend anyway). I will check again. Make sure to check the latest WiX release to see if the 64-bit problem has been fixed before going for this "self-registration fix". It is at least better than trying to register using custom actions and batch files (which should never be attempted - there are so many potential problems relating to MSI's complex custom action sequencing, impersonation / elevation, conditioning,installation modes with silent and interactive, not to mention the potential interference from security software, and the list goes on).
Some links:
How do you register a Win32 COM DLL file in WiX 3?
Cannot register DLL using WiX
Use wix to perform function of REGSVR32
Heat.exe Cannot Harvest TypeLib Info from a 64-bit COM DLL
Heat.exe: 64-bit .dll fails to be converted to a 64-bit .msi
Just adding another answer with information on how to use procmon.exe in an efficient manner to debug missing dependencies during self-registration using regsvr32.exe.
Essentially you should set an include filter for what events you want to monitor and record, otherwise you get an almighty list of irrellevant events listed and it is hard to find what you need in the sea of useless information:
To limited the captured process information to what you need, just go to Filter => Filter...
Set the left drop down to Process Name and then the second column to is and finally type in regsvr32.exe in the right box as illustrated above in the picture.
Crucially set the rightmost box to Include. Then press OK.
All unnecessary events should now be suppressed and only regsvr32.exe events are displayed (when you get to running it).
Run regsvr32.exe the normal way and look for "NAME NOT FOUND" entries (or similar) in the list.
In the illustration below MMUtilities.dll can not be found. In other words it is a missing dependency.
And please note that you can include / exclude events of a certain type by clicking the buttons illustrated below on and off. Registry events, file system events, network activity, process and tread activity, profiling events. This can greatly reduce the "noise" you have to deal with in the list.
The other way to debug missing dependencies during self-registration is to use Dependency Walker as illustrated in my other answer in this "thread" or question or whatever to call it. Generally I find Dependency Walker to be the quicker option, but ProcMon is perhaps better overall - unless you are debugging an EXE file, then Dependency Walker has the superior Profile feature (Profile => Start Profiling...).
The idea is not to use a bat file for registering the dll. Let Windows installer/WiX do it for you. This has been answered in the past also here.

Can't generate java code from WSDL

I want to generate java code from wsdl for my jbossws client. I am using Intelij Idea 12
Here is the procedure I followed.
Right click on the package > webservices > generate java code from wsdl
but it only creates a file same as wsdl not java code classes.
What is the wrong thing I did?
Did you define Axis runtime environment in your IDE. In Axis package, there is file called (wsdl2java.bat) for window or (wsdl2java.sh) for linux environment which could help to generate java source from wsdl, Check out those file exists or not. Please refer below site.
http://www.gerd-riesselmann.net/scala/creating-java-classes-wsdl-file-using-apache-axis-2
Good luck!

Do Policy Intersection in WSO2ESB Class Mediator

I've created a Class Mediator in which I want to intersect two policies. I've created the Class Mediator with Carbon Studio for Eclipse, which automatically adds some predefined libs to the build path of my project.
One of the libs is neethi-2.0.4.wso2v1.jar.
If I want to use the intersect-method I get an exception. If I have a look at the source I see that the intersect-method just throws an "UnsupportedOperationException".
So the given neethi lib is useless for intersection, therefore I want to use the newest Neethi lib (aka neethi-3.0.2.lib) for intersection inside my class mediator.
Could you tell me how I can include third party libs, especially in my use case these ones, that should override the once used inside the esb( neethi-2.0.4.wso2v1.jar).
Thanks
Developer Studio adds these libs to your project classpath, so that developers do not get build errors in the source code.
Therefore those libraries are only for the development time and available only with Dev Studio. They are not the libraries used in the runtime of the server.
Runtime libraries are provided by the WSO2 Carbon Server runtime. So this UnsupportedOperationException is thrown by the server is occurred due to the version of the neethi in the server does not support it. So you need to upgrade the library in the server runtime.
But as you can see, WSO2 have forked the neethi codebase and have some custom implementations on the forked source. So IMO, simply upgrading the version would not help.
Anyway you need to actually upgrade the library and see whether you face any issues with it.
To upgrade the versions, you can either create a Java Library artifact for newer Neethi library and include it in the CAR file and deploy the CAR file or copy the new Neethi library to <CARBON_HOME>/repository/components/lib location while the server is running.
You can find the current Neethi library in the <CARBON_HOME>/repository/components/plugins location. If you find some error or exception similar to "Linkage Error", then try to remove the older version of the library. But it would cause some other exceptions.
So IMO the bottom line is, you will face some issues with the version upgrade. But yes of course you can give a try and see, whether we can overcome them. Give it a try and post your observations here. We will try our best to assist you.

How to build using ant in IBM RAD

All,
we have multiple applications that we develop in IBM RAD 7.5.
Since, RAD does build all the applications that are required, I was wondering how can I achieve the same using ant files.
What I wanted to know is apart from my application specific libraries (that I will know where they are etc), which other jar files should my application point to?
I am talking about IBM WAS runtime libraries etc, so that my application builds successfully.
Is there a standard guideline by IBM on this?
Thanks.
The JARs provided in WAS_HOME/dev/ in WebSphere Application Server 7.0 and later, such as was_public.jar or j2ee.jar, are intended specifically for this purpose.
#bkail's answer is probably what you want if you're on one of those more recent versions of WAS (I don't have v7 or v8 installation to verify).
Another option is to expand the Server Runtime library that you have added to your RAD Java Build Path, you'll see the jars you want to include for your Ant build.
However, if you're actually running within RAD, you'll be pointing to a full server runtime which contains more than you need to simply compile. In that case, you can add one of the "WebSphere Application Server vX stub" runtimes just to see which jars those include; they are the minimum for compiling.
Which specific jars are in that environment will depend on your version of WAS, any installed Feature Packs, and probably even Fixpack levels. In many cases - depending on which APIs you're using - all that's needed to compile is j2ee.jar.
(You probably already realize this, but remember that you only need those jars in your classpath to compile, you don't want to deploy them in your WAR since they're already part of WAS.)