Hi. I'm beginner in JBoss. And I've have a trouble with set up of datasource.
That is what I do:
1. Copy my oracle driver classes12.jar to default/lib
2. Create my own -ds.xml file in default/deploy
2.1. My -ds.xml file name is oracle-ds.xml and its content is next
local-tx-datasource
jndi-nameOracleDS/jndi-name
connection-url
jdbc:oracle:thin:@backup:1521:orabet
/connection-url
driver-classoracle.jdbc.driver.OracleDriver/driver-class
user-namedimo/user-name
deineaugen
exception-sorter-class-name
org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter
/exception-sorter-class-name
new-connection-sqlselect * from item/new-connection-sql
check-valid-connection-sql
select * from dual
/check-valid-connection-sql
type-mappingOracle9i/type-mapping
/local-tx-datasource
2.2 I've started my JBossAS 4.0.0
... ... ...
... ... ...
15:19:13,156 INFO [WrapperDataSourceService] Bound connection factory for
resource adapter for ConnectionManager
'jboss.jca:service=DataSourceBinding,name=OracleDS to JNDI name 'java:OracleDS'
15:19:13,281 INFO [WrapperDataSourceService] Bound connection factory for
resource adapter for ConnectionManager
'jboss.jca:service=DataSourceBinding,name=MyOracleDS to JNDI name
'java:MyOracleDS'
15:19:14,187 INFO [MailService] Mail Service bound to java:/Mail
15:19:14,890 INFO [EjbModule] Deploying Converter
15:19:15,296 INFO [EJBDeployer] Deployed:
file:/C:/JAVA/jboss-4.0.0/server/default/deploy/converter.jar/
15:19:15,921 INFO [EjbModule] Deploying Account
15:19:16,125 INFO [EjbModule] Deploying Interest
15:19:16,140 INFO [EjbModule] Deploying Hello
15:19:16,171 INFO [EjbModule] Deploying Count
15:19:16,796 INFO [EJBDeployer] Deployed:
file:/C:/JAVA/jboss-4.0.0/server/default/deploy/ejbTest.jar/
...
...
15:19:19,843 INFO [Server] JBoss (MX MicroKernel) [4.0.0 (build:
CVSTag=JBoss_4_0_0 date=200409200418)] Started in 37s:766ms
3. I've try to lookup my dataSource in standalone client
import javax.naming.*;
public class Test1{
public static void main(String[] args ){
try {
System.setProperty(java.naming.factory.initial,
org.jnp.interfaces.NamingContextFactory);
System.setProperty(java.naming.provider.url,localhost);
Context ctx = new InitialContext();
ctx.lookup(MyOracleDS);
}
catch(Exception e) {e.printStackTrace();};
}
}
but... I've a fuckup when I try to run this code
javax.naming.NameNotFoundException: MyOracleDS not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:495)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:503)
...
Help me, pls!
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=3932660#3932660
Reply to the post :
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3932660
---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user