tliron / prudence

An opinionated lightweight web framework built for scale
https://prudence.threecrickets.com
Apache License 2.0
13 stars 5 forks source link

MongoVision Error: importClass must be called with a class; had "[JavaPackage com.mongodb.rhino.BSON]" instead #3

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
1) What's the problem?

MongoVision is returning error 500 on this request: 
http://localhost:8080/mongovision/data/databases/?_dc=1304458203784&node=root

This error is in the log:
MongoVision error:
com.threecrickets.scripturian.exception.ExecutionException: Function 
importClass must be called with a class; had "[JavaPackage 
com.mongodb.rhino.BSON]" instead. (mongo-db.js#14)

This is line 14 in mongo-db.js: 
importClass(com.mongodb.rhino.BSON, com.mongodb.rhino.JSON)

2) How can someone else reproduce it?
Try the most recent (alpha) mongo vision

3) What operating system and JVM version are you using?
Windows XP
Java(TM) SE Runtime Environment (build 1.6.0_21-b07)
Java HotSpot(TM) Client VM (build 17.0-b17, mixed mode, sharing)

[Don't forget to set the release version and flavor below]
v11rev_984

Original issue reported on code.google.com by tgloc...@gmail.com on 3 May 2011 at 9:48

GoogleCodeExporter commented 9 years ago
Ah, our installation instructions need to be updated for Windows: you need to 
edit your Prudence's \bin\run.bat file and add the two JAR files from 
MongoVision.

Can you confirm that this solved the problem for you?

Original comment by tal.liron on 6 May 2011 at 2:16

GoogleCodeExporter commented 9 years ago
Also: the next release of Prudence will feature an improved run.bat that will 
make this unnecessary.

If you want to try it now, you can paste this in your run.bat instead of the 
explicit listing of *.jar files:

SETLOCAL ENABLEDELAYEDEXPANSION
SET JARS=
FOR /F %%J IN ('DIR /B libraries\*.jar') DO SET JARS=!JARS!;%CD%\libraries\%%~J
SET JARS=%JARS:~1%

Original comment by tal.liron on 6 May 2011 at 3:20

GoogleCodeExporter commented 9 years ago
Yes that worked!  

I have altered the run.bat as shown above.  

I have the two mongo jars in both the applications\mongovision\libraries folder 
AND my prudence\v11rev_984\libraries folder.  

I suspect they need only be in one place... (and will continue reading the docs 
on this.)

It also helps to have mongo running. ;)  

Thanks again.

Original comment by tgloc...@gmail.com on 6 May 2011 at 7:00

GoogleCodeExporter commented 9 years ago
Great! I will close this issue.

The upcoming release of MongoVision will let you connect to any DB host. It's, 
of course, ridiculous to require that MongoVision be installed on the same 
machine as MongoDB.

(BTW, new release of Prudence just came out that includes this batch file fix)

Original comment by tal.liron on 6 May 2011 at 9:42