I am using RocketMQ in service Fabric Application.
But it is throwing exception when i am tring to create instance of ONSFactoryProperty; ONSFactoryProperty factoryInfo = new ONSFactoryProperty()
External component has thrown an exception.
at ons.UnmanagedONSFactoryProperty.{ctor}(UnmanagedONSFactoryProperty* )
at ons.ONSFactoryProperty..ctor() in d:\bug\rocketmq-
client4cpp\managedons\managedonsfactory.cpp:line 8
Also at the time of create instance of ONSFactory ;
ONSFactory onsfactory = new ONSFactory();
at ons.UnmanagedONSFactory.getInstance()
at ons.ONSFactory..ctor() in d:\bug\rocketmq-
client4cpp\managedons\managedonsfactory.cpp:line 271
But same code i have tried in console application.There it is working fine.Is there any solution for the issue?
Related
MinIO is returning a general exception when calling the API from a .net client. In the library parsing the xml fails telling me that "Client calls PutObjectAsync General Exception 'doctype' is an unexpected token. The expected token is 'DOCTYPE'" which is no help at all.
MinIO Version
2021-09-09T21:37:07Z
Uploading objects using the webconsole works as expected.
Can you share an example of the code you are using? Please make sure you are using the S3 endpoint (running on port 9000 by default) and not the console-ui endpoint (9090 by default).
Here is a simple example of how to use the .net library to connect to the MinIO running on https://play.min.io:9000.
using Minio;
// Initialize the client with access credentials.
private static MinioClient minio = new MinioClient("play.min.io",
"Q3AM3UQ867SPQQA43P2F",
"zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG"
).WithSSL();
// Create an async task for listing buckets.
var getListBucketsTask = minio.ListBucketsAsync();
// Iterate over the list of buckets.
foreach (Bucket bucket in getListBucketsTask.Result.Buckets)
{
Console.WriteLine(bucket.Name + " " + bucket.CreationDateDateTime);
}
Please read more at https://docs.min.io/docs/dotnet-client-quickstart-guide.html
In my current project we are using aws-lambda to make a rest call to external service and consume the response. Happy path works fine but when it comes to connection-timeout or socket-timeout it is not working as expected. Little more details below
When making a call to external system and if the read-timeout scenario happens (external system connection got established but did not receive any response from the system within 15 sec) the aws lambda keeps waiting for the response till lambda-timeout (25 sec) and returns error.
But I expect the rest-call code invoked within lamda to throw the SocketTimeOutException or related one which is not happening.
Same thing, when I tried using a sample java code (using apache's http-client implementation which is what I have used in lambda) it works perfectly fine and I am getting proper exception thrown.
Initially we tried with jersey implementation for making rest-call and thought this is having issue and changed to http-client implementation, but none of them thrown the exception as it does in sample java code.
Please let me know your suggestions or solutions if faced already.
Below is the code snippet that I use in both lambda as well as sample program for making the rest call. (this whole block is wrapped under try-catch)
HttpPost post = new HttpPost(URL);
RequestJSONObject request = new RequestJSONObject();
//setting required request payload
ObjectMapper mapper = new ObjectMapper();
String jsonStr = mapper.writeValueAsString(request);
post.setEntity(new StringEntity(jsonStr));
post.addHeader("content-type", "application/json");
RequestConfig config = RequestConfig.custom()
.setConnectTimeout(1000)
.setSocketTimeout(3000).build();
CloseableHttpClient httpClient =
HttpClientBuilder.create().setDefaultRequestConfig(config).build();
CloseableHttpResponse response = httpClient.execute(post);
Thanks,
Ganesh Karthik C.
I've developed a Console Application that connects to RabbitMQ then process some messages. I'm using Topshelf to allow the execution as a service without (on the paper) issues, but when I run it as a service I got the following exception
Application: XXX.exe Framework
Version: v4.0.30319 Description: The process was terminated due to an
unhandled exception. Exception Info: System.IO.FileNotFoundException
at
Microsoft.Extensions.Configuration.FileConfigurationProvider.Load(Boolean)
at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load()
at
Microsoft.Extensions.Configuration.ConfigurationRoot..ctor(System.Collections.Generic.IList`1)
at Microsoft.Extensions.Configuration.ConfigurationBuilder.Build() at
XXX.Program.Main(System.String[])
Now I think it's somehow missing the configuration file or some dll but I've all the files a folder on c:\services\myservice. If I run the exe from command prompt it works flawlessly.
I've also tried to set the identity to network service / admin user and similar... with no luck. I'm using TopShelf 4.0.4
Any suggestion?
Thanks
SOLUTION
It was a fault of mine...
I had to use
var builder = new ConfigurationBuilder()
.SetBasePath(Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location))
.AddJsonFile("appsettings.json")
.AddJsonFile("appsettings.{environmentName}.json",true,true);
instead of
var builder = new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory()) //(which is the default code present on MS site)
.AddJsonFile("appsettings.json")
.AddJsonFile("appsettings.{environmentName}.json",true,true);
As suggested by #bozoJoe here's the answer to my question, for upvote
SOLUTION
It was a fault of mine...
I had to use
var builder = new ConfigurationBuilder()
.SetBasePath(Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location))
.AddJsonFile("appsettings.json")
.AddJsonFile("appsettings.{environmentName}.json",true,true);
instead of
var builder = new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory()) //(which is the default code present on MS site)
.AddJsonFile("appsettings.json")
.AddJsonFile("appsettings.{environmentName}.json",true,true);
I am using IBM websphere application server, I am trying to access the default file repository from my application using the virtual member manager, below is the code I use, it works well but I got an empty result, I checked the fileRegistry.xml file and it contains users, can anyone tell my where is my problem?
DataObject root = SDOHelper.createRootDataObject();
DataObject searchCtrl = SDOHelper.createControlDataObject(root,null,SchemaConstants.DO_SEARCH_CONTROL);
searchCtrl.getList(SchemaConstants.PROP_PROPERTIES).add("uid");
searchCtrl.getList(SchemaConstants.PROP_SEARCH_BASES).add("o=defaultWIMFileBasedRealm");
searchCtrl.setString(SchemaConstants.PROP_SEARCH_EXPRESSION,"#xsi:type='PersonAccount' and uid='*'");
root = getVMMService().search(root);
System.out.println("Output data graph"+ printDO(root));
Does the getVMMService() method get an instance of LocalServiceProvider ? I run the example in an standAlone app, in the example http://www.ibm.com/developerworks/websphere/zones/portal/proddoc/dw-w-userrepository/ is call it via corba protocol, when I try with Servlets for testing, I comment those lines
I am running tests that needs to open a new instance of IE everytime for new test.
My first test passes and closes the IE at the end and then my next test has to open a new IE but It failing at that point and giving me following error
SetUp method failed. System.Runtime.InteropServices.COMException : Creating an instance of the COM component with CLSID {0002DF01-0000-0000-C000-000000000046} from the IClassFactory failed due to the following error: 800704a6.
at WatiN.Core.IE.CreateNewIEAndGoToUri(Uri uri, LogonDialogHandler logonDialogHandler, Boolean createInNewProcess)
at WatiN.Core.IE..ctor()
I am currently running them using teamcity v5.1.4, nunit 2.5.5, watin 2.0 on a windows 7 machine with .net framework 3.5
Following is the code where its failing.
<TestFixtureSetUp()> _
Public Sub Setup()
System.Threading.Thread.Sleep(100)
_internetExplorer = New IE()
LoginUser()
CheckForDataBase()
End Sub
<TestFixtureTearDown()> _
Public Sub TearDown()
Logout()
_internetExplorer.Close()
End Sub
Any idea what could be reason for this
800704a6= error ERROR_SHUTDOWN_IS_SCHEDULED from win32. Is a reboot pending?
I suggest you have a look at this Q&A session. There are lots of informations concerning your problem. It can be related to the fact that updates are scheduled on your server.