DataTorrent - Developing Hello World Application - maven

I am totally new to DataTorrent. I am trying to build a sample application using data torrent using this link but information given on this page is not much helpfull. I created a maven project as described on page using below command.
mvn archetype:generate -DarchetypeRepository=https://www.datatorrent.com/maven/content/repositories/releases -DarchetypeGroupId=com.datatorrent -DarchetypeArtifactId=apex-app-archetype -DarchetypeVersion=3.0.0 -DgroupId=com.td.example -Dpackage=com.td.example.shashi -DartifactId=shashi-app -Dversion=1.0-SNAPSHOT
Project was created successfully but after that it says to create a zip file for uploading on application server.
I ran below command to upload it but it is giving problem accessing server.
curl -XPOST -T shashi-app.zip http://hostname:9090/ws/v2/appPackages
Any pointer on above issue?

The application can be submitted via gateway using REST calls.
To do that, the apa file needs to be uploaded into the appPackages - you can do this from DT UI console or by using a REST call to POST the jar.
Please check for your syntax of the job submission. The following link has the documentation on uploading the job and submission using REST calls.
http://docs.datatorrent.com/configuration_packages/#post-wsv2apppackagesuserapp-pkg-nameapp-pkg-versionapplicationsapp-namelaunchconfigpackageuserconfpkgname

Related

"~" symbol created automatically after running project with service worker

My project is a simple login page. I am using asp.net core with MVC.
Everything was working well and I wanted to add service worker to my project. I followed the known steps. Add a manifest.json file in wwwroot, fill it correctly and add this function services.AddProgressiveWebApp(); after services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);.
When others do these steps, service worker works properly. When I run it (IIS Express), service worker produces an error: "Uncaught (in promise) TypeError: Failed to register a ServiceWorker: A bad HTTP response code (404) was received when fetching the script."
Then I realized this thing: https://localhost:44331/~/serviceworker.
The ~ symbol is created automatically and I am not knowing how to remove it.
The following https://localhost:44331/serviceworker works.
Help?
It is solved.
I updated the version from v1.0.42 to v.1.0.33 and it worked.
v1.0.42 has a bug.

Swashbuckle + XmlComments work locally, but fail swagger generation on server

I have a webapi project, and I am utilizing the swashbuckle framework to flush out api documentation.
I have followed the directions to build the documentation xml file with my controller and DTO's, and it all works great locally.
However, when generating the swagger document, a 500 error is thrown. I have confirmed if i remove my xml registration line, the swagger doc is generated and returned successfully.
here is my registration line:
GlobalConfiguration.Configuration.EnableSwagger(c =>
{
...
c.IncludeXmlComments($"{System.AppDomain.CurrentDomain.BaseDirectory}bin\\Company.MyApp.xml");
...
Update: I did some additional logging, and while this lne for IncludeXmlComments runs through successfully on startup, when I request the swagger.json file from the server, I am getting a System.IO.FileNotFoundException: Could not find file 'D:\home\site\wwwroot\bin\Monetary.Scheduling.xml' exception. when I use the Kudu tools to look into this directory, I cannot find this file.
TL;DR: Why is this file showing up fine locally, but when I deploy to Azure using Kudu or a Octopus nugget package, this file is not there?
The problem is that somehow the XML file is not making it to your server...
I had this exact issue with an Azure deployment it worked fine in my local machine but not in azure
...and it was because I was missing the XML doc in the release config

JUnit Scripts Does not run with JMeter

I have the JUNIT code in my eclipse
My workflow is as follows:
Login to an Web Application
Enter the userID and password.
Create some User
Log out
when i try to execute this script using the JMeter it could not succeeded.
MY JMeter does only launch the browser and get into my web application, after that it gets failed.
But my JUnit code works fine when execute using eclipse
Can some one help me in this?
Make sure that the correct Classname/Test Method is selected in the JUnit Request Sampler. Make sure errors are appended by checking the boxes as in the image below.
Use the fail() method to debug. Put it in your catch blocks or wherever needed.
If that seems too tedious to you then write your own mini logger (or use an existing one) and append all errors to a file. (Probably the best option).
Just throwing it out there: it is possible to use JOptionPane.showMessageDialog(null, e.toString()); to debug by adding the rt.jar from your jdk folder. This can get annoying though...
For setup or tutorial please see Jmeter Junit Issue

Is there an issue with Eclipse plug in for Heroku?

I m using Eclipse plugin to deploy new application on Heroku. However recently when I m trying to create a new app I get the following exception from Eclipse at the stage where I select a template app:
An unknown error has occurred. If this error persists, please follow up with Heroku support.
com.heroku.api.exception.RequestFailedException: Unexpected app exist status statuscode:401 responseBody:{"id":"unauthorized","error":"Unauthorized"}
I understand that it has to do with authorization. However I cannot find the way to check my credentials that I have provided to the Eclipse plugin. As far as I remeber the credentials are given during the next step , once you have selected and named your template app.
Anybody knows if there is a problem with eclipse plug in for heroku?
Thank you.

Create an EVENT SOURCE using web setup project

I am developing a website using MVC 3,
I have a web setup project for installing it to my localhost.
Now what I want is to create an EVENT SOURCE ( where I will later on log using my website ) using this very setup.
Is this possible?
I have been following this link:
http://msdn.microsoft.com/en-us/library/ms998320.aspx#paght000015%5Feventlogaccess
I earlier tried creating an EVENT SOURCE programmatically, but my web app threw security exceptions, similar to the error the user in this post was getting: System.Security.SecurityException when writing to Event Log
Thanks in advance
Yasser
After a lot of struggle I myslef managed to answer my question
I first had to create a seperate installer class, which had code to install an event source.
Next in my web setup project, under custom action in INSTALL, I simply added the output of the above project which was a single dll.
and thats it!
Now whenever my web setup runs, the installer dll is also activated and run and my event source gets created.
Now that was not too difficult was it ? ;)

Resources