JavaScript Run jar file with node js on Microsoft Azure file with node,file upload with node js,download file

I make a node js web app for generating report. My idea is to use .jasper file (jasper report) to generate these reports. I've tried a bunch of node js library to do this, but nothing seems to work. And finally I proceed to make a .jar file (java) to solve this. The process is as follows:

  1. Node js get request from user
  2. Node js run .jar file by using child_process. It run something like "java -jar MyApp.jar arg1 arg2 arg3"
  3. .jar file generate a pdf and save it to a folder
  4. .jar file return the path of newly generated pdf file
  5. Node js get the path and return pdf file to user

It run perfectly in my computer. Then I upload it to Microsoft Azure. It seems like the run .jar file step is failed, because no pdf file is created. Can anyone help me or suggest a better way to do this?

Answer:1

If you deployed the NodeJS webapp into MS Azure WebApps, the step 2 of the process could not spawn a child process for running a jar runnable file because the Java runtime environment not included your current Azure WebApp with NodeJS.

There are three suggested way to do this:

  1. Using Azure VM to install NodeJS and Java, and deploy your app on the VM as the same as on the local computer. It's the simple way.

  2. I searched an open source report software called jsreport. It can be install on MS Azure VM or Cloud Service. You can refer to the download page Run jar file with node js on Microsoft Azure to install it. And there is the jsreport sdk for NodeJS http://jsreport.net/learn/nodejs. If you want to use jsreport on Azure Cloud Service, you need to know how to build NodeJS App on Azure Cloud Service https://azure.microsoft.com/en-us/documentation/articles/cloud-services-nodejs-develop-deploy-express-app/.

  3. Changing your process. NodeJS get request from user and send it with the specified file name and path to the ServiceBus; The jar runnable file modified as a Azure WebJob read the request from the ServiceBus and generate a pdf with the given file name and save it to the given file path on the Azure Blob Storage; NodeJS directly return pdf file to user from Blob Storage.

For Azure WebJob & Service Bus, you can refer to https://azure.microsoft.com/en-us/documentation/articles/web-sites-create-web-jobs/ and https://azure.microsoft.com/en-us/documentation/articles/service-bus-nodejs-how-to-use-queues/.

Answer:2

As mentioned in the interface section of 'Programming javascript applications' you can implement interfaces with stampit. When reducing the unnecessary stuff from the example, I end up with something ...

As mentioned in the interface section of 'Programming javascript applications' you can implement interfaces with stampit. When reducing the unnecessary stuff from the example, I end up with something ...

I'm debugging someone's code and wondering what this regex does? Code: <script> var t = document.getElementById("filterVal").value; var s = filterVal.replace(/"([^"]+(?="))"/g, '$1') </...

I'm debugging someone's code and wondering what this regex does? Code: <script> var t = document.getElementById("filterVal").value; var s = filterVal.replace(/"([^"]+(?="))"/g, '$1') </...

  1. what does this emoji mean
  2. what does this mean �� ��
  3. what does this symbol mean
  4. what does this emoji mean ��
  5. what does this sign mean
  6. what does this mean in english
  7. what does this word mean
  8. what does this emoji mean ��
  9. what does this emoji mean ��
  10. what does this emoji mean ��
  11. what does this emoji mean ��
  12. what does this mean in texting
  13. what does this national emergency mean
  14. what does this emoji mean ��
  15. what does this symbol mean in math
  16. what does this quote mean
  17. what does this mean in spanish
  18. what does this mean in math
  19. what does this mean 3
  20. what does this emoji mean ��

How do I use a dependency injected field in another field within the ember controller in 2.x Ember? For instance, I have export default Ember.Controller.extend({ session: Ember.inject.service(...

How do I use a dependency injected field in another field within the ember controller in 2.x Ember? For instance, I have export default Ember.Controller.extend({ session: Ember.inject.service(...

  1. using dependency injection c#
  2. using dependency injection in unit tests c#
  3. using dependency injection in asp.net core
  4. using dependency injection in console application c#
  5. using dependency injection in a class library
  6. using dependency injection in .net core
  7. using dependency injection in a class library c#
  8. using dependency injection in mvc 5
  9. using dependency injection in web api
  10. using dependency injection in unit tests
  11. using dependency injection in java
  12. using dependency injection
  13. using dependency injection with entity framework
  14. using dependency injection with startup.cs in asp.net core
  15. using dependency injection in windows service
  16. using dependency injection with annotations
  17. using dependency injection in asp net webforms
  18. using dependency injection swift
  19. using dependency injection with framework
  20. using dependency injection in laravel

trying to use document.getElementById() in jsreport using the scripts section on the left menu, but it reports back Error occured - Error during rendering report: document is not defined What ...

trying to use document.getElementById() in jsreport using the scripts section on the left menu, but it reports back Error occured - Error during rendering report: document is not defined What ...