Hi!
i use jboss3.2.3, oracle8.1.7 and castor0.9.5.2 in my current project.
I am trying to lookup the database but i have an exception by instantiate
the db-Object. Where is my error?
Josef
I use the following code:
======== oracle-ds.xml =========
<?xml version="1.0" encoding="UTF-8"?>
<datasources>
<local-tx-datasource>
<jndi-name>myDatabase</jndi-name>
<connection-url>jdbc:oracle:thin:@orion:1521:orion817</connection-url>
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
<user-name>user</user-name>
<password>user</password>
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
<min-pool-size>2</min-pool-size>
<max-pool-size>100</max-pool-size>
<idle-timeout-minutes>0</idle-timeout-minutes>
</local-tx-datasource>
</datasources>
======== database.xml =========
<database name="awl" engine="oracle">
<jndi name="java:comp/env/jdbc/myDatabase" />
<mapping href="mapping.xml" />
</database>
======== Source-Code =========
public class DatabaseManager
{
public void init()
throws Exception
{
mapping = new Mapping(getClass().getClassLoader());
mapping.loadMapping(getClass().getResource("mapping.xml"));
jdo = new JDO();
jdo.setConfiguration(getClass().getResource("database.xml");
jdo.setDatabaseName("myDatabase");
ctx = new InitialContext();
db = (Database) ctx.lookup( "java:comp/env/jdo/myDatabase" );
}
private Mapping mapping;
private JDO jdo;
private UserTransaction ut;
private InitialContext ctx;
}
======== Exception =========
javax.naming.NameNotFoundException: jdo not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:495)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:503)
at org.jnp.server.NamingServer.getObject(NamingServer.java:509)
at org.jnp.server.NamingServer.lookup(NamingServer.java:253)
at org.jnp.server.NamingServer.lookup(NamingServer.java:256)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:528)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:642)
....
______________________________________________________________________________
Erdbeben im Iran: Zehntausende Kinder brauchen Hilfe. UNICEF hilft den
Kindern - helfen Sie mit! https://www.unicef.de/spe/spe_03.php
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev