Datasource installs, but isn't present in context (oracle8,
nimdok Dec 16, 2002 6:04 PMI think I finally managed to get my Oracle 8 data source installed by modifying the oracle-ds.xml file and dropping it into the deploy directory. Here it is:
<local-tx-datasource>
<jndi-name>CCTADS</jndi-name>
<connection-url>jdbc:oracle:thin:@servername:1521:ccta_test</connection-url>
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
<user-name>ccta</user-name>
ccta
</local-tx-datasource>
I have added classes12.zip to server/default/lib, and modified standardjaws.xml and standardjbosscmp-jdbc.xml to have the following:
java:CCTADS
<datasource-mapping>Oracle8</datasource-mapping>
where CCTADS is the name I chose instead of OracleDS. In my web.xml file I reference the resource like this:
<resource-ref>
Database reference for CCTA application
<res-ref-name>jdbc/CCTADS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<env-entry>
Name of resource reference for database
<env-entry-name>jndi-datasource-name</env-entry-name>
<env-entry-value>jdbc/CCTADS</env-entry-value>
<env-entry-type>java.lang.String</env-entry-type>
</env-entry>
I run JBoss, and lines such as the following lead me to believe things are going OK:
17:07:45,516 INFO [CCTADS] Bound connection factory for resource adapter for ConnectionManager 'jboss.jca:service=LocalTxCM,name=CCTADS to JNDI name 'java:/CCTADS'
Then in my action servlet class (for struts), I try and grab the data source, but I'm getting nothing. It throws the following:
17:07:48,875 INFO [STDOUT] explanation: Could not dereference object
17:07:48,891 ERROR [MainDeployer] could not start deployment: file:/D:/jboss-3.2.0beta/server/default/deploy/ccta.war
org.jboss.deployment.DeploymentException: Could not dereference object; - nested throwable: (javax.servlet.ServletException: Could not dereference object)
at org.jboss.jetty.Jetty.deploy(Jetty.java:427)
at org.jboss.jetty.JettyService.performDeploy(JettyService.java:243)
at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:302)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:812)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:624)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:588)
at sun.reflect.GeneratedMethodAccessor25.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
at $Proxy7.deploy(Unknown Source)
Can anyone tell me what I should type from this point on to obtain my DataSource correctly:
Context ic = new InitialContext();
.....
DataSource ds = .....