Error while running node server using Oracle Driver #154

Open
OussamaAouni opened this Issue Mar 10, 2014 · 13 comments

Comments

Projects
None yet
5 participants
@OussamaAouni

Please I hope that I didn't bother you by this issue

I succeed to install oracle module with npm !

But I can't run my server and I got this error

C:\Users\Oussama\Desktop\SPI-master>node server.js

module.js:356
Module._extensions[extension](this, filename);
^
Error: no errorC:\Users\Oussama\Desktop\SPI-master\node_modules\oracle\build\Rel
ease\oracle_bindings.node
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (C:\Users\Oussama\Desktop\SPI-master\node_modules\orac
le\lib\oracle.js:2:16)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)

@kontrafiktion

This comment has been minimized.

Show comment
Hide comment
@kontrafiktion

kontrafiktion Mar 10, 2014

Contributor

Please try:

node -e "console.log(process.arch, require('os').arch())"

to verify 32Bit/64Bit

Please verify instantclient 32/64 Bit

Please verify node-oracle 32/64 Bit

Contributor

kontrafiktion commented Mar 10, 2014

Please try:

node -e "console.log(process.arch, require('os').arch())"

to verify 32Bit/64Bit

Please verify instantclient 32/64 Bit

Please verify node-oracle 32/64 Bit

@OussamaAouni

This comment has been minimized.

Show comment
Hide comment
@OussamaAouni

OussamaAouni Mar 10, 2014

this is the result of the excution of the command :

C:\Users\Oussama\Desktop\SPI-master>node -e "console.log(process.arch, require('os').arch())"
ia32 ia32

and I'm sure that instantclient is 32 Bits and also node and oracle

this is the result of the excution of the command :

C:\Users\Oussama\Desktop\SPI-master>node -e "console.log(process.arch, require('os').arch())"
ia32 ia32

and I'm sure that instantclient is 32 Bits and also node and oracle

@OussamaAouni

This comment has been minimized.

Show comment
Hide comment
@OussamaAouni

OussamaAouni Mar 10, 2014

I have seen this issue #78
and I think i should do the same thing !
What should I do on Windows ti fix the "symlinks" ? thanx a lot

I have seen this issue #78
and I think i should do the same thing !
What should I do on Windows ti fix the "symlinks" ? thanx a lot

@raztus

This comment has been minimized.

Show comment
Hide comment
@raztus

raztus Mar 10, 2014

Collaborator

The symlinks are not required on Windows. However, if you are not using version 11.x of the Oracle Instantclient, you will need to set OCI_VERSION=12 in your environment variables.

Collaborator

raztus commented Mar 10, 2014

The symlinks are not required on Windows. However, if you are not using version 11.x of the Oracle Instantclient, you will need to set OCI_VERSION=12 in your environment variables.

@OussamaAouni

This comment has been minimized.

Show comment
Hide comment
@OussamaAouni

OussamaAouni Mar 10, 2014

thank you @raztus but this is what I've done :/
Really I don't know what's the real problem !
All the installed programs are in 32 bits, I followed the read me and the installation guide !!!

thank you @raztus but this is what I've done :/
Really I don't know what's the real problem !
All the installed programs are in 32 bits, I followed the read me and the installation guide !!!

@raztus

This comment has been minimized.

Show comment
Hide comment
@raztus

raztus Mar 10, 2014

Collaborator

I believe your issue is the same as #90

Collaborator

raztus commented Mar 10, 2014

I believe your issue is the same as #90

@fastpoint

This comment has been minimized.

Show comment
Hide comment
@fastpoint

fastpoint Mar 11, 2014

I get this error too:

module.js:356
Module._extensions[extension](this, filename);
^
Error: The specified procedure could not be found.
E:\blog\node_modules\oracle\build\Release\oracle_bindings.node
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (E:\blog\node_modules\oracle\lib\oracle.js:2:16)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)

I'm no idel,my environment is Win7 32,and oracle client is setup.who help me?

I get this error too:

module.js:356
Module._extensions[extension](this, filename);
^
Error: The specified procedure could not be found.
E:\blog\node_modules\oracle\build\Release\oracle_bindings.node
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (E:\blog\node_modules\oracle\lib\oracle.js:2:16)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)

I'm no idel,my environment is Win7 32,and oracle client is setup.who help me?

@kontrafiktion

This comment has been minimized.

Show comment
Hide comment
@kontrafiktion

kontrafiktion Mar 11, 2014

Contributor

@fastpoint I do not believe that yours is the same error.
This issue is about "Error: no error".
You've got:

Error: The specified procedure could not be found.

In which directory did you invoke

 npm install oracle

It should be same directory where you start node.
And please check #72

If that does not help:
Please create a new issue

Contributor

kontrafiktion commented Mar 11, 2014

@fastpoint I do not believe that yours is the same error.
This issue is about "Error: no error".
You've got:

Error: The specified procedure could not be found.

In which directory did you invoke

 npm install oracle

It should be same directory where you start node.
And please check #72

If that does not help:
Please create a new issue

@OussamaAouni

This comment has been minimized.

Show comment
Hide comment
@OussamaAouni

OussamaAouni Mar 11, 2014

I resolved my problem,
In fact it's caused by the oracle instant client basic driver :
It's A problem of loading oracle modules
I used the dependecy Walker to look for the error :
The OCI.DLL file wasn't visible for the ORAICCI12D.DLL
So it ccan't load succefully oracle from node_modules !!!
So what I did is to execute the command :
Set PATH=C:\OracleInstantClient\instant client-basic-nt-12.1.0.1.0\instantclient_12_1;%PATH%
It works and I haven't the error mentionned before until I don't close the cmd...
But if I restart I got the same error !!!
So I have to do that each time.

Now I have another error is that the server stops when I excute and SQL query to get results from my database !!!
I tried to make a cconsolr.log before and after the SQL bloc. Result: I got the two messages ...
The problem comes from connection.execute(the sql query) !!!

I resolved my problem,
In fact it's caused by the oracle instant client basic driver :
It's A problem of loading oracle modules
I used the dependecy Walker to look for the error :
The OCI.DLL file wasn't visible for the ORAICCI12D.DLL
So it ccan't load succefully oracle from node_modules !!!
So what I did is to execute the command :
Set PATH=C:\OracleInstantClient\instant client-basic-nt-12.1.0.1.0\instantclient_12_1;%PATH%
It works and I haven't the error mentionned before until I don't close the cmd...
But if I restart I got the same error !!!
So I have to do that each time.

Now I have another error is that the server stops when I excute and SQL query to get results from my database !!!
I tried to make a cconsolr.log before and after the SQL bloc. Result: I got the two messages ...
The problem comes from connection.execute(the sql query) !!!

@bjouhier

This comment has been minimized.

Show comment
Hide comment
@bjouhier

bjouhier Mar 13, 2014

Contributor

connection.execute is an async function. You have to pass a callback:

connection.execute(sql, function(err, results) {
  if (err) throw err;
  // do something with results
});
// code here will be executed immediately, while execute is still running
Contributor

bjouhier commented Mar 13, 2014

connection.execute is an async function. You have to pass a callback:

connection.execute(sql, function(err, results) {
  if (err) throw err;
  // do something with results
});
// code here will be executed immediately, while execute is still running
@OussamaAouni

This comment has been minimized.

Show comment
Hide comment
@OussamaAouni

OussamaAouni Mar 13, 2014

that's what I did

oracle.connect(connectData, function(err, connection) {
if (err) { console.log("Error connecting to db:", err); return; }
// Execution d'une requete et affichage du résultat dans les logs
connection.execute("SELECT * FROM ENSEIGNANT", [], function(err, results) {
if (err) { console.log("Error executing query:", err); return; }
//accueil.afficher(results);
console.log(results);
connection.close(); // call only when query is finished executing
});
});

that's what I did

oracle.connect(connectData, function(err, connection) {
if (err) { console.log("Error connecting to db:", err); return; }
// Execution d'une requete et affichage du résultat dans les logs
connection.execute("SELECT * FROM ENSEIGNANT", [], function(err, results) {
if (err) { console.log("Error executing query:", err); return; }
//accueil.afficher(results);
console.log(results);
connection.close(); // call only when query is finished executing
});
});

@raztus

This comment has been minimized.

Show comment
Hide comment
@raztus

raztus Mar 13, 2014

Collaborator

@OussamaAouni could you please paste your new error in? It's not entirely clear what issue you're seeing now.

Collaborator

raztus commented Mar 13, 2014

@OussamaAouni could you please paste your new error in? It's not entirely clear what issue you're seeing now.

@OussamaAouni

This comment has been minimized.

Show comment
Hide comment
@OussamaAouni

OussamaAouni Mar 13, 2014

there's no error ! the server stops running on localhost:9090 without showing any data from the database

there's no error ! the server stops running on localhost:9090 without showing any data from the database

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment