0 Replies Latest reply on May 7, 2008 5:11 AM by dilipreddy

    Not getting JBoss portal datasource

    dilipreddy

      Hi
      This is Dileep,
      plz give me solution....

      I am working Jboss portal, to get the connection i am using JNDI
      name, but it is not identyfying it,

      and it is giving the org.hibernate.jdbc.GenericJDBCException and
      sometimes connetion cant open

      This is mysql-ds.xml

      datasources>
      <local-tx-datasource>
      <jndi-name>MySqlDS</jndi-name>
      <connection-url>jdbc:mysql://localhost:3306/jbossportal</connection-url>
      <driver-class>com.mysql.jdbc.Driver</driver-class>
      <user-name>root</user-name>
      password
      <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>


      This is Portal-mysql5-ds.xml


      <local-tx-datasource>
      <jndi-name>PortalDS</jndi-name>
      <connection-url>jdbc:mysql://localhost:3306/jbossportal?useServerPrepStmts=false&jdbcCompliantTruncation=false</connection-url>
      <driver-class>com.mysql.jdbc.Driver</driver-class>
      <user-name>root</user-name>
      password
      </local-tx-datasource>
      </datasources


      javax.naming.InitialContext newInitialContext= new
      javax.naming.InitialContext();
      javax.naming.Context
      ctx=(Context)newInitialContext.lookup("java:comp/env");
      javax.sql.DataSource ds=(javax.sql.DataSource)ctx.lookup("PortalDS");
      java.sql.Connection conn=ds.getConnection();

      System.out.println("con..."+conn.getClass());


      Error msg is :javax.naming.NameNotFoundException PortalDS not bound

      if u know the configuration then plz inform me, waiting for reply...

      Thank and Regards,
      Dilip