Balkishore pandey

Greenhorn
+ Follow
since Apr 19, 2012
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Balkishore pandey

Thanks a lot mate. Using "/usr/local/bin/node " solved the issue.
8 years ago
Hi,

Node resides in /usr/local/bin/node, but what will I do with it??

when I type

master1:~ kishore$ node /Users/kishore/Desktop/serialport/listport.js

on my terminal, the script runs.

So I decided to copy this file where my netbeans project folder resides, (i.e) my user directory and did something like:

String directory = System.getProperty("user.dir" + "/listport.js");
System.out.println(directory);

And got the output as null. So my concern is how can I store the path in a string along with the filename?
8 years ago
Hi,

It is a script. A javascript file. Inorder to run it in terminal. I usually goto to the folder where the file exist and type



node is also set as environment variable.

Thanks for the help.
8 years ago
Hi,

Thanks a ton for replying.

The file exists. When I type the same on terminal, the file executes.
8 years ago
Hi,

I am trying to run a node.js script from java. And the following is my source code:



In doing so, i get an error java.io.IOException: error=2, No such file or directory

What am I doing wrong here?

Any help?
8 years ago
Hi John McParland,
When i directly specify the path in java.io.file, the source code works perfectly.
And by the way, it is fine if i have t write a new property file for a new machine.
Any help would be very much appreciated.

Regards.
9 years ago
Hi John McParland,
I tried debugging, i use netbeans by the way, by placing the end point. But still i dont get any thing. And yes it is a web application. I don't use and kind of logging mechanism.
Is it possible to use properties or configuration files? If so how can I use them?
Any help would be very much appreciated.

And Thank a ton for replying.
Regards.
9 years ago
Hi John McParland,

Are you sure i have to use java.io.file in this line



As java.io.File is used to read the path or file name and it is not used to read the value of the string.
Do apologize my stupid-ness if the question was wrong.
9 years ago
Hi John McParland,
I have a small doubt,
How should i print System.getProperty(PYTHON_PATH)?
I used System.out.println(System.getProperty(PYTHON_PATH)); and stopped debugging a line after this.
But not getting any thing.

What i am getting is
9 years ago
Hi John McParland,
I am getting this error when i test my restful wen service in the browser.
It is an request failed error,which means the python file is not read in the program.
But i didn't print the value of System.getProperty(PYTHON_PATH)
I will print it and will inform will let you know.

Thanks you very much.
Regards.
9 years ago
Hi John McParland,
Thank you very much for replying.
But when I run this script, i get an HTTP 500 error.
Edited: I use to get this kinds of error before, when my python file is not read.
Any help would be very much appreciated.

Regards.
Balkishore
9 years ago
Dear JavaRanch memebers,

Here is my sample code:



As it can be seen in the code, this part:



contains the path of the python script that will be executed. But this source code can only be used in my computer and it's more specific.

Is there a way to make it more generic? so that it can be used in other computers as well? I have heard about something called configuration files, but being very new to java, I was not able to understand it.
And i also tried creating a file called path.properties and copying it in the src folder of netbeans project. The content of path.properties is

Path=C:\\Users\\Balkishore\\Documents\\NetBeansProjects\\Testinstrument_Rest\\build\\web

But i don't have any idea how to call this property file in my code, and where to call this all i know is to call it i have to use:


But seriously i have no clue where to add this piece of code in my source code.

Any help would be very much appreciated.

Thanks a ton in advance.
9 years ago
Dear javaranch members,

I have a small problem, in which i am struck for few days now.

Here is my Get Restful code, in this i use Pathparam to pass parameter via the web-browser.


As it can be seen from above code i pass the parameter using PAthParam to the python file Command.py. But when i enter the parameter value (i.e) name1=USB0::0x164E::0x13EC::TW00008555; which is the id of my instrument connected and command=*IDN?, which is SCPI command to get the name of the instrumnet, in the browser window i get an error: Command result NULL, but in reality i should get either 0 or 1.

But am kinda confused if the values i am passing in the browser window is actually passed in or not?

If not what i could do to pass this values? I have attached the image of the error,
Is my code correct? or am i missing something in it?

Any help would be very much appreciated. Thanks a ton in advance.!
9 years ago