do you know how to get of this distribution list!??

-----Original Message-----
From: "Josef K�nig" [mailto:[EMAIL PROTECTED]
Sent: 08 January 2004 14:35
To: [EMAIL PROTECTED]
Subject: [castor-dev] help: Database lookup in JBoss3.2.2


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.OracleEx
ceptionSorter</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


This e-mail (and any attachments) may contain privileged and/or confidential 
information. If you are not the intended recipient please do not disclose, copy, 
distribute, disseminate or take any action in reliance on it. If you have received 
this message in error please reply and tell us and then delete it. Should you wish to 
communicate with us by e-mail we cannot guarantee the security of any data outside our 
own computer systems. For the protection of Legal & General's systems and staff, 
incoming emails will be automatically scanned.
 
Any information contained in this message may be subject to applicable terms and 
conditions and must not be construed as giving investment advice within or outside the 
United Kingdom.
 
Representative only of the Legal & General marketing group, members of which are 
regulated by the Financial Services Authority for the purposes of advising on life 
assurance and investment products bearing Legal & General's name. 
Legal & General Group PLC, Temple Court, 11 Queen Victoria Street, London, EC4N 4TP. 
Registered in England no: 166055.

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to