Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

data source not found #1

Open
davecramer opened this issue May 5, 2012 · 24 comments
Open

data source not found #1

davecramer opened this issue May 5, 2012 · 24 comments

Comments

@davecramer
Copy link

Looking for Connection Identifier ConnectionIdentifier(lift) but failed to find either a JNDI data source with the name lift or a lift connection manager with the correct name
net.liftweb.db.DB$$anonfun$newConnection$2.apply(DB.scala:188)
net.liftweb.db.DB$$anonfun$newConnection$2.apply(DB.scala:188)
net.liftweb.common.EmptyBox.openOr(Box.scala:574)
net.liftweb.db.DB$class.newConnection(DB.scala:187)
net.liftweb.db.DB$class.getConnection(DB.scala:293)
net.liftweb.db.DB$class.use(DB.scala:666)
net.liftweb.db.DB$$anon$1.use(DB.scala:38)

@josephks
Copy link
Owner

josephks commented May 6, 2012

If you aren't running pg on the same machine as you are running the monitor you have to configure your database connection.

@davecramer
Copy link
Author

I tried two machines both with pg running on them. Same error

@josephks
Copy link
Owner

josephks commented May 6, 2012

That message means that app can't connect to the database. Make sure you can connect with psql using localhost. If that works ok try explicitly configuring the db connection in the default.props file.

@davecramer
Copy link
Author

I can connect to template1 no problem using psql -h localhost -U postgres template1
This is exactly what is in default.props

@josephks
Copy link
Owner

josephks commented May 6, 2012

And there is no helpful exception on the console? Somehow some way the app can't connect to the database. Could it be your jvm security settings? Do you see anything in the pg logs indicating the connection was refused?

3 similar comments
@josephks
Copy link
Owner

josephks commented May 6, 2012

And there is no helpful exception on the console? Somehow some way the app can't connect to the database. Could it be your jvm security settings? Do you see anything in the pg logs indicating the connection was refused?

@josephks
Copy link
Owner

josephks commented May 6, 2012

And there is no helpful exception on the console? Somehow some way the app can't connect to the database. Could it be your jvm security settings? Do you see anything in the pg logs indicating the connection was refused?

@josephks
Copy link
Owner

josephks commented May 6, 2012

And there is no helpful exception on the console? Somehow some way the app can't connect to the database. Could it be your jvm security settings? Do you see anything in the pg logs indicating the connection was refused?

@davecramer
Copy link
Author

Joseph, where should this properties file be when the system is running ?

FYI I am one of the maintainers of the JDBC driver, my jvm is not the problem

@josephks
Copy link
Owner

josephks commented May 7, 2012

I pushed an example to github. It goes under src/main/resources/props.

@davecramer
Copy link
Author

ok there is a default.props file there. How about when it is running where is it supposed to live ? Where is the pgjdbc jar when it is running ?

@josephks
Copy link
Owner

josephks commented May 7, 2012

Are you running this from sbt? The jdbc driver is a dependency, and should also be included in any war file built. The props file is also included in any war file built.

@davecramer
Copy link
Author

I am running this from the sbt, I guess I could try building a war and running it

@josephks
Copy link
Owner

josephks commented May 7, 2012

It runs fine from sbt for me. Do you think that the jdbc jar isn't being found in the classpath? It could by an ivy issue. Try removing your ~/.ivy and rerunning.

@davecramer
Copy link
Author

I have no idea, wouldn't you get a class not found error instead ?

@josephks
Copy link
Owner

josephks commented May 7, 2012

I forgot about this quirk of Lift, that if you specify a user in the config file but no password the user wouldn't be used. Were you specifying a user in the config w/o a password?

Back to basics: Are you sure there is nothing in the pg log file or in the sbt window that indicates what the problem is? If I try to access the webapp and pg isn't running I get a org.postgresql.util.PSQLException above the NPE.

@josephks
Copy link
Owner

josephks commented May 7, 2012

Just pushed an update that should work around Lift's password problem

@davecramer
Copy link
Author

that worked now I just have

Welcome to the PostgresQL Monitor!

Your database version is: PostgreSQL 9.0.7 on x86_64-apple-darwin11.3.0, compiled by GCC i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.9.00), 64-bit

Your database encoding is: UTF8

on the screen

@josephks
Copy link
Owner

josephks commented May 7, 2012

OK great. I've been using it on 9.1.x dbs so I don't know if there will be any issues with 9.0.x.

@davecramer
Copy link
Author

Is there no menu or anything ?

@josephks
Copy link
Owner

josephks commented May 7, 2012

No, I kind of had the idea that everyone would customize the web pages for their own setups, and this was version 0.1. I just pushed some updated templates, including links on the front page.

I just noticed that the bandwidth charts are having some javascript issues that I thought I fixed already. Don't be surprised if they don't work.

@davecramer
Copy link
Author

OK, I figured it out thanks.

So why scala ? seems like an awful lot of dependancies to do a couple of fairly simple things ?

Dave

@josephks
Copy link
Owner

josephks commented May 7, 2012

The dependency list isn't all that large. Some of that stuff is only there for testing. I have persistence-api as a dependency for the ORM generator, which isn't really done. You can try it by going to /api/schema/jpa

I like programming in Scala because it makes some things just so much easier than Java. Lift in particular makes comet updates easy. Both of them do have learning curves though. Lift makes ajax and comet stuff easy but its basic orm stuff isn't as easy to use as other frameworks like Rails. It's mostly just a lack of documentation.

@josephks
Copy link
Owner

josephks commented May 7, 2012

I pushed a fix for the bandwidth chart problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants