[jboss-user] [Persistence] - Urgent: Problem of set the jboss datasource with name

SARA1232007 do-not-reply at jboss.com
Wed Dec 9 21:25:49 EST 2009


Hi,

I tried to deploy juddi onto jboss-4.0.5.GA. I have modified and declared datasource with name "comp/env/jdbc/juddiDB" on jboss. And I get the information as following when the jboss server starting:


  | 17:11:25,150 INFO  [ConnectionFactoryBindingService] Bound ConnectionManager 'jb
  | oss.jca:service=ConnectionFactoryBinding,name=JmsXA' to JNDI name 'java:JmsXA'
  | 17:11:25,415 INFO  [WrapperDataSourceService] Bound ConnectionManager 'jboss.jca
  | :service=DataSourceBinding,name=comp/env/jdbc/juddiDB' to JNDI name 'java:comp/e
  | nv/jdbc/juddiDB'.

But I fail to access the juddiDB datasource by a test.jsp as following:

  | <%
  | out.print("Test JBoss/MySQL Connection pool"+"<br>");
  | try{
  | 	
  | InitialContext initCtx = new InitialContext();
  | DataSource ds = (DataSource)initCtx.lookup("java:comp/env/jdbc/juddiDB");
  | 
  | 
  | Connection conn = ds.getConnection();
  | out.print("MySQL connection pool runs perfectly");
  | conn.close();
  | }
  | catch(Exception ex){
  | out.println("Connect error : ");
  | out.print(ex.getMessage());
  | }
  | %>

The information I get from the jsp page is following:

  | Test JBoss/MySQL Connection pool
  | Connect error : jdbc not bound 

Could anyone tell me what's wrong? As "java:comp/env/jdbc/juddiDB" is the required name of juddi datasource, what should I do to realize this?

Urgently need help!

Thanks.

Sara

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4269905#4269905

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4269905




More information about the jboss-user mailing list