4 Replies Latest reply on Oct 20, 2012 2:33 AM by narayanab16

    Runtime tab - not showing datasource

    narayanab16

      Hi,

       

       

      JBoss AS 7.1.1  Final release

       

      I have added a datasource in the 'default' profile.

       

      http://localhost:9990/console & provided username, password.

      The runtime tab did not show the datasource which i added.

       

      How to bring to datasouce to the runtime tab.

       

      Really required jboss experts to solve the case.

        • 1. Re: Runtime tab - not showing datasource
          narayanab16

          Hi,

           

          Can someone try to provide solution.

           

          If i try to get db connection i get below error

           

          The data source exists in the default profile but not available to the runtime.

           

          How to bring to the jboss runtime tab??

           

           

           

           

           

           

          try

          {

          InitialContext ic =

          new

          InitialContext();

          DataSource ds0 = (DataSource) ic.lookup(

          "datasources/OracleDS"

          );

          Connection con = ds0.getConnection();

          out.println(

          "helloooo.."

          + con);

          }

          catch

          (Exception e) {

          e.printStackTrace();

          }

           

           

           

          Error

          ------

           

          javax.naming.NameNotFoundException: datasources/OracleDS -- service jboss.naming.context.java.datasources.OracleDS

          13:24:47,595 ERROR [stderr] (http--127.0.0.1-8090-1)  at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:97)

          13:24:47,595 ERROR [stderr] (http--127.0.0.1-8090-1)  at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:178)

          13:24:47,595 ERROR [stderr] (http--127.0.0.1-8090-1)  at org.jboss.as.naming.InitialContext.lookup(InitialContext.java:113)

          13:24:47,595 ERROR [stderr] (http--127.0.0.1-8090-1)  at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:214)

          13:24:47,595 ERROR [stderr] (http--127.0.0.1-8090-1)  at javax.naming.InitialContext.lookup(InitialContext.java:392)

          • 2. Re: Runtime tab - not showing datasource
            narayanab16

            Thanks for watching and i have resolved the issue.

            • 3. Re: Runtime tab - not showing datasource

              how did you resolve it?

              • 4. Re: Runtime tab - not showing datasource
                narayanab16

                hi,

                here 2 profile full, full-sockets

                domain.xml

                 

                <server-group name="main-server-group" profile="full">

                <jvm name="default"><heap size="64m" max-size="512m"/></jvm><socket-binding-group ref="full-sockets"/>

                </server-group><server-group name="other-server-group" profile="full-ha"><jvm name="default">

                <heap size="64m" max-size="512m"/></jvm><socket-binding-group ref="full-ha-sockets"/>

                </server-group></server-groups>

                 

                <profile name="full">

                <datasource jndi-name="java:jboss/datasources/OracleDS" pool-name="OracleDS" enabled="true" use-java-context="true"><connection-url>jdbc:oracle:thin:@xx.xx.xx:61900:rfeop</connection-url><driver>oracle</driver><transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation><pool><prefill>true</prefill><use-strict-min>false</use-strict-min><flush-strategy>FailingConnectionOnly</flush-strategy></pool><security><user-name>eop</user-name><password>eop</password></security></datasource>

                 

                <drivers><driver name="oracle" module="com.oracle.ojdbc6"><driver-class>oracle.jdbc.OracleDriver</driver-class><datasource-class>oracle.jdbc.pool.OracleDataSource</datasource-class><xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class></driver></drivers>

                .....

                </profile>

                 

                According to my context

                ------------------------------------

                Goto  jbosss location ==> in my m/c  ==> /opt/jboss712/jboss-as-7.1.2.Final/modules/com

                            inside com create oracle, inside this ojdbc6 folders then main folder

                   where u keep ojdbc6 jar & module.xml

                 

                dependencies can be placed if ur java api uses import javax.sql.DataSource in the .java code as i stated.in conversation

                <module xmlns="urn:jboss:module:1.1" name="com.oracle.ojdbc6">

                 

                    <resources>

                        <resource-root path="ojdbc6.jar"/>

                        <!-- Insert resources here -->

                    </resources>

                    <dependencies>

                        <module name="javax.api"/>

                        <module name="javax.transaction.api"/>

                        <module name="javax.servlet.api" optional="true"/>

                    </dependencies>

                </module>

                 

                pls revert if u need any help

                 

                happy

                 

                Message was edited by: narayanab16