You are using BMP beans right?  And version 2.0 final?

Cheers

-----Original Message-----
From: Kris Kristensen [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 19, 2000 5:02 PM
To: jBoss
Subject: Sv: [jBoss-User] problems with JNDI/Datasource


Hi Jay

Non taken..

I don't know how to put it but... It still doesn't work. I've done exactly
as you suggested, but it still refuses to bind the 
JNDI-name: jdbc/newsDB to the pool: NewsPool. It just keep on connecting to
the Hypersonic DS instead of the right pool. 

<snippets from jboss.xml>
...
<resource-managers> 
       <resource-manager res-class="org.jboss.ejb.deployment.JDBCResource">
         <res-name>jdbc/newsDB</res-name>
         <res-jndi-name>NewsPool</res-jndi-name>  
       </resource-manager> 
     </resource-managers>
...

<snippets from ejb-jar-xml>
...
<resource-ref>
    <description>A link to newsDB</description>
    <res-ref-name>jdbc/newsDB</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
  </resource-ref>
...

<...and jboss.jcml>
...
<mbean name="DefaultDomain:service=XADataSource,name=NewsPool">
       <attribute name="Properties"></attribute>
       <attribute name="URL">jdbc:odbc:hund</attribute>
       <attribute name="GCMinIdleTime">1200000</attribute>
       <attribute name="JDBCUser">admin</attribute>
       <attribute name="MaxSize">0</attribute>
       <attribute name="Password" />
       <attribute name="GCEnabled">false</attribute>
       <attribute name="InvalidateOnError">false</attribute>
       <attribute name="TimestampUsed">false</attribute>
       <attribute name="Blocking">true</attribute>
       <attribute name="GCInterval">120000</attribute>
       <attribute name="IdleTimeout">1800000</attribute>
       <attribute name="IdleTimeoutEnabled">false</attribute>
       <attribute name="LoggingEnabled">false</attribute>
       <attribute name="MaxIdleTimeoutPercent">1.0</attribute>
       <attribute name="MinSize">0</attribute>
     </mbean>
...

<and finally jbos.conf>
...
<MLET CODE="org.jboss.jdbc.XADataSourceLoader" ARCHIVE="jboss.jar"
CODEBASE="../lib/ext/">
    <ARG TYPE="java.lang.String" VALUE="NewsPool">
    <ARG TYPE="java.lang.String"
VALUE="org.jboss.minerva.xa.XADataSourceImpl">
</MLET>
...

the jboss.properties file does include the jdbc.odbc.JdbcOdbcDriver

<from the startup log>
[NewsPool] XA Connection pool NewsPool bound to java:/NewsPool

Are there any other property/jcml/xml/conf - files that need to be modified
in order to this JNDI-namespace work?

Btw. Just for the fun of it I've tried to use the MSDE-DB with a proper
jdbc-driver, instead of MS Access with jdbc-odbc, but with the same result,
no binding...

It looks to me as if JBoss is ignoring everything from the jboss.xml, except
the part there the bean is bound to the 
JNDI-namespace.
<from the log>
[Container factory] Bound DogNewsBean to DogNews

The log doesn't say anything about the jdbc/newsDB to NewsPool binding...?

Any suggestions...

Cheers

Kris Kristensen

-----Oprindelig meddelelse-----
Fra: Jay Walters <[EMAIL PROTECTED]>
Til: jBoss <[EMAIL PROTECTED]>
Dato: 19. december 2000 19:22
Emne: RE: [jBoss-User] problems with JNDI/Datasource


>Sorry about that, it was probably worse than no help at all.
>
>#1 I don't believe JDBC/ODBC works right, not to mention Access '97 as a
>valid data store for XA, but we'll let somebody who really knows one way or
>the other jump on that one.
>
>Now on to my mistakes!
>
>What is NewsForDogs?  I think you've got something backwards in your .xml
>files.  I've pasted in snips from my code which does work.
>
>I have setup a pool named OraclePool in my jboss.conf/jboss.jcml files.
>
>This is from my log -
>
>[OraclePool] XA Connection pool OraclePool bound to java:/OraclePool
>
>This is from my jboss.xml file -
>
>        <resource-manager
res-class="org.jboss.ejb.deployment.JDBCResource">
>            <res-name>jdbc/timesheetDs</res-name>
>            <res-jndi-name>OraclePool</res-jndi-name>
>        </resource-manager>
> 
>This is from my ejb-jar.xml file -
> 
>        <res-ref-name>jdbc/timesheetDs</res-ref-name>
>        <res-type>javax.sql.DataSource</res-type>
> 
>This is from my code -
>
>     dataSource =
>(DataSource)initialContext.lookup("java:comp/env/jdbc/timesheetDs");
> 
>Hope this helps.  It has to be an improvement over my last answer.
>
>Cheers
>-----Original Message-----
>From: Kris Kristensen [mailto:[EMAIL PROTECTED]]
>Sent: Tuesday, December 19, 2000 11:57 AM
>To: jBoss
>Subject: Sv: [jBoss-User] problems with JNDI/Datasource
>
>
>Hi Jay
>
>Let me explain
>
>first of all, no I don't want to go to Hypersonic. Actually the jdbc/newsDB
>represents a jdbc-odbc connection to 
>MS Access 97, and as you can see from the log JBoss successfully binds a
>pool to it. 
><snippet from log>
>XA Connection pool jdbc/newsDB bound to java:/jdbc/newsDB
>
>You wrote that I have to: "change the setup for the DefaultDS entry in
>jboss.jcml", why ??. If that's the case, therre is no point in telling the
>beans that they should bind to a certain Datasource, because JBoss would
>only connect to the default. That can't be the case, can it ?? As far as
I'm
>concerned, JBoss can connect to whatever DataSource as the default, as long
>as it call's the right DataSource from the beans, and my problem is that it
>don't. I think my problem comes from the jboss.xml. But I can't figure out
>what the problem is. I have followed your examples regarding jboss.xml, set
>up a resource manager, bound it to the 
>JNDI-name: jdbc/newsDB, but somehow it isn't enough (or maybe too much).
>Could you please show me a complete example of the jboss.xml where
>JNDI-lookup is part of it. In my java code I would like to do like this:
>
><snippet from code>
>initial = new InitialContext();
>ds = (DataSource)initial.lookup("java:comp/env/jdbc/newsDB");
>
>... and it would bind to the right DataSource: jdbc/newsDB
>
>Cheers
>
>Kris Kristensen
>
>
>-----Oprindelig meddelelse-----
>Fra: Jay Walters <[EMAIL PROTECTED]>
>Til: 'jBoss' <[EMAIL PROTECTED]>
>Dato: 19. december 2000 03:12
>Emne: RE: [jBoss-User] problems with JNDI/Datasource
>
>
>>Do you want it to go to Hypersonic or not?  You need to change the setup
>for
>>the DefaultDS entry in jboss.jcml JBoss pre-2.1 or jboss.jcml/jboss.conf
if
>>using the JBoss 2.0 Final release.  Most important is updating the JDBC
>URL,
>>username and password.
>>
>>Cheers
>>Jay Walters
>>
>>-----Original Message-----
>>From: Kris Kristensen [mailto:[EMAIL PROTECTED]]
>>Sent: Monday, December 18, 2000 5:52 PM
>>To: jBoss
>>Subject: Sv: [jBoss-User] problems with JNDI/Datasource
>>
>>
>>Hi Edward
>>
>>As far as I can see, I can't find the solution in the "advanced" section.
>>I've scrolled this doc up and down many times now and i haven't been able
>to
>>come up with a solution. Are there any particular places in this doc, you
>>would recommend, or was it just a generel suggestion. In the latter case,
>>I've been there as you can see. 
>>
>>Thank's anyway.
>>
>>Cheers
>>
>>Kris Kristensen
>>
>>-----Oprindelig meddelelse-----
>>Fra: Edward J Becker <[EMAIL PROTECTED]>
>>Til: jBoss <[EMAIL PROTECTED]>
>>Dato: 18. december 2000 23:27
>>Emne: RE: [jBoss-User] problems with JNDI/Datasource
>>
>>
>>>Not sure if this well help, but you might want to check (if you havent
>>>already):
>>>
>>>http://www.ejboss.org/manual/adv_config.html
>>>
>>>-----Original Message-----
>>>From: [EMAIL PROTECTED]
>>>[mailto:[EMAIL PROTECTED]]On Behalf Of Kris Kristensen
>>>Sent: Monday, December 18, 2000 5:06 PM
>>>To: [EMAIL PROTECTED]
>>>Subject: [jBoss-User] problems with JNDI/Datasource
>>>
>>>
>>>hi there
>>>
>>>I have hazzled through all your examples, both in the manual, and in the
>>>mailing list, but somehow it refuses to work. I have one stateless
session
>>>bean that is going to handle all communikation to and from various
>>>databases. Just as a test I've setup one DataSource in the jboss.conf and
>>>jboss.jcml files. during startup JBoss logs the following:
>>>XA Connection pool jdbc/newsDB bound to java:/jdbc/newsDB
>>>
>>>In my ejb-jar.xml:
>>>
>>><?xml version="1.0" encoding="Cp1252"?>
>>><ejb-jar>
>>>     <enterprise-beans>
>>>       <session>
>>>  <ejb-name>DogNewsBean</ejb-name>
>>>  <home>dk.redballtech.dogs.beans.ejb.sessionbeans.DogNewsHome</home>
>>>  <remote>dk.redballtech.dogs.beans.ejb.sessionbeans.DogNews</remote>
>>>
>>><ejb-class>dk.redballtech.dogs.beans.ejb.sessionbeans.DogNewsBean</ejb-cl
a
>s
>>s
>>>>
>>>  <session-type>Stateless</session-type>
>>>  <transaction-type>Container</transaction-type>
>>>  <resource-ref>
>>>         <description>A link to newsDB</description>
>>>    <res-ref-name>jdbc/newsDB</res-ref-name>
>>>    <res-type>javax.sql.DataSource</res-type>
>>>    <res-auth>Container</res-auth>
>>>  </resource-ref>
>>>       </session>
>>>     </enterprise-beans>
>>>     <assembly-descriptor>
>>>       <container-transaction>
>>>  <method>
>>>    <ejb-name>DogNewsBean</ejb-name>
>>>    <method-name>*</method-name>
>>>  </method>
>>>  <trans-attribute>Required</trans-attribute>
>>>       </container-transaction>
>>>     </assembly-descriptor>
>>>   </ejb-jar>
>>>
>>>In my jboss.xml:
>>><?xml version="1.0" encoding="Cp1252"?>
>>><jboss>
>>>     <secure>false</secure>
>>>     <container-configurations>
>>>     <resource-managers>
>>>       <resource-manager>
>>>         <res-name>NewsForDogs</res-name>
>>>         <res-jndi-name>jdbc/newsDB</res-jndi-name>
>>>       </resource-manager>
>>>     </resource-managers>
>>>     </container-configurations>
>>>     <enterprise-beans>
>>>       <session>
>>>  <ejb-name>DogNewsBean</ejb-name>
>>>  <jndi-name>DogNews</jndi-name>
>>>  <configuration-name></configuration-name>
>>>  <resource-ref>
>>>    <res-ref-name>jdbc/newsDB</res-ref-name>
>>>    <resource-name>NewsForDogs</resource-name>
>>>  </resource-ref>
>>>       </session>
>>>     </enterprise-beans>
>>></jboss>
>>>
>>>In my java code I would call this by the JNDI:
>>>java:comp/env/jdbc/newsDB
>>>
>>>But jboss doesn't resolve the right JNDI name. Result from JBoss log:
>>>
>>>[Hypersonic] 0:SELECT * FROM newsTB ORDER BY newsID DESC
>>>[Hypersonic] java.sql.SQLException: Table not found: NEWSTB
>>>[Hypersonic]  at org.hsql.Trace.getError(Trace.java:124)
>>>[Hypersonic]  at org.hsql.Trace.getError(Trace.java:115)
>>>[Hypersonic]  at org.hsql.Trace.error(Trace.java:130)
>>>[Hypersonic]  at org.hsql.Database.getTable(Database.java:216)
>>>[Hypersonic]  at org.hsql.Parser.parseTableFilter(Parser.java:456)
>>>[Hypersonic]  at org.hsql.Parser.parseSelect(Parser.java:305)
>>>[Hypersonic]  at org.hsql.Parser.processSelect(Parser.java:25)
>>>[Hypersonic]  at org.hsql.Database.execute(Database.java:120)
>>>[Hypersonic]  at org.hsql.ServerConnection.run(ServerConnection.java:58)
>>>...
>>>
>>>what is missing (or incorrect) since JBoss "think's" it's a Hypersonic DS
>?
>>>
>>>-thanks is advance
>>>Kris Kristensen
>>>
>>>Btw: I'm using JBoss-final-2.0 edition
>>>
>>>
>>>
>>>--
>>>--------------------------------------------------------------
>>>To subscribe:        [EMAIL PROTECTED]
>>>To unsubscribe:      [EMAIL PROTECTED]
>>>Problems?:           [EMAIL PROTECTED]
>>>
>>>
>>>
>>>--
>>>--------------------------------------------------------------
>>>To subscribe:        [EMAIL PROTECTED]
>>>To unsubscribe:      [EMAIL PROTECTED]
>>>Problems?:           [EMAIL PROTECTED]
>>>
>>
>>
>>
>>--
>>--------------------------------------------------------------
>>To subscribe:        [EMAIL PROTECTED]
>>To unsubscribe:      [EMAIL PROTECTED]
>>List Help?:          [EMAIL PROTECTED]
>>
>>
>>--
>>--------------------------------------------------------------
>>To subscribe:        [EMAIL PROTECTED]
>>To unsubscribe:      [EMAIL PROTECTED]
>>List Help?:          [EMAIL PROTECTED]
>>
>
>
>
>--
>--------------------------------------------------------------
>To subscribe:        [EMAIL PROTECTED]
>To unsubscribe:      [EMAIL PROTECTED]
>List Help?:          [EMAIL PROTECTED]
>
>
>--
>--------------------------------------------------------------
>To subscribe:        [EMAIL PROTECTED]
>To unsubscribe:      [EMAIL PROTECTED]
>List Help?:          [EMAIL PROTECTED]
>



--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
List Help?:          [EMAIL PROTECTED]


--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
List Help?:          [EMAIL PROTECTED]

Reply via email to