PetStore 2.0 - java.lang.RuntimeException: javax.naming.NamingException: Lookup failed for 'jdbc/Pet

Posted by Harry Pham on Stack Overflow See other posts from Stack Overflow or by Harry Pham
Published on 2010-04-19T21:01:11Z Indexed on 2010/04/19 21:03 UTC
Read the original article Hit count: 1929

Filed under:
|
|

I download PetStore 2.0 from https://blueprints.dev.java.net/servlets/ProjectDocumentList?folderID=5315&expandFolder=5315&folderID=0. I tried to build them in netbean 6.8 and I got this error

SEVERE: Exception while preparing the app
java.lang.RuntimeException: javax.naming.NamingException: Lookup failed for 'jdbc/PetstoreDB' in SerialContext  [Root exception is javax.naming.NameNotFoundException: PetstoreDB not found]

Seems like it cant find 'jdbc/PetStoreDB'. So I went back to the website and it look like I have to build the database via Ant script. So at the PetStore home directory, I run this command

ant setup
ant run

And I got the same error when I try ant run

 [exec] Deprecated syntax, instead use:
 [exec] asadmin --port 4848 --host localhost --passwordfile /Users/KingdomHeart/.asadminpass --user admin deploy [options] ...
 [exec] com.sun.enterprise.admin.cli.CommandException: remote failure: Exception while preparing the app : java.lang.RuntimeException: javax.naming.NamingException: Lookup failed for 'jdbc/PetstoreDB' in SerialContext  [Root exception is javax.naming.NameNotFoundException: PetstoreDB not found]
 [exec] 
 [exec] 
 [exec] Command deploy failed.

Any idea what happen?

© Stack Overflow or respective owner

Related posts about java

Related posts about java-ee