• Post Reply Bookmark Topic Watch Topic
  • New Topic

connection to database not bound

 
Shirley Ming
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i create a standalone application to connect to the ejb. The database i'm using is MySQL. Application server using jboss4.0.3.

When i run my customerTest.class(a standalone application), it cant connect to the database. Heres the error

Error creating object.
ejbCreate: CustomerDAOFactory.getDAO: NamingException for <asg.domain.CustomerDA
OCloudscape> DAO class :
Cannot connect to database: java:CustomerDB:
CustomerDB not bound


Heres the codes for my java file contain the reference to the MYsql database



This is part my DEPLOYMENT DESCRIPTOR:
<env-entry>
<env-entry-name>CustomerDAOClass</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>asg.domain.CustomerDAOCloudscape</env-entry-value>
</env-entry>
<security-identity>
<description></description>

My codes cn be download from http://intellij.net/forums/thread.jspa?threadID=246613&tstart=0
Download the ejb-jar-customer.jar.

Thanks..
[ August 23, 2006: Message edited by: Shirley Ming ]
 
Jaikiran Pai
Sheriff
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since you are looking up the datasource from a standalone application, it wont be able to access the java: namespace. Have a look at:

Section Configuring a DataSource for remote usage at:ConfigDataSources in JBoss

and Remotely accessing a datasource in JBoss
 
Shirley Ming
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your help.

rEGARDS SHIRLEY
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!