-
1. Re: Runtime tab - not showing datasource
narayanab16 Jul 18, 2012 4:01 AM (in response to 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??
{
newInitialContext ic =
InitialContext();
"datasources/OracleDS"DataSource ds0 = (DataSource) ic.lookup(
);
"helloooo.."Connection con = ds0.getConnection();
out.println(
+ 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 Jul 18, 2012 4:56 AM (in response to narayanab16)Thanks for watching and i have resolved the issue.
-
3. Re: Runtime tab - not showing datasource
sramanand Oct 16, 2012 7:44 PM (in response to narayanab16)how did you resolve it?
-
4. Re: Runtime tab - not showing datasource
narayanab16 Oct 20, 2012 2:33 AM (in response to sramanand)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