-
1. Re: I dont want DefaultDS as my datasource :(
gt Sep 4, 2001 4:36 AM (in response to osw)I have the same problem using Entity Managed Bean.
My ressource reference is always linked to java:/DefaultDS
extract of JNDIView
java:comp namespace of the Fdbtab bean:
+ env (class: org.jnp.interfaces.NamingContext)
| + as400[link -> java:/DefaultDS] (class: javax.naming.LinkRef)
Documentation not very clear on this point.
Thank for help -
2. Re: I dont want DefaultDS as my datasource :(
delattrj Sep 4, 2001 5:00 AM (in response to osw)I think you can change default datasource in jaws.xml
jerome. -
4. Re: I dont want DefaultDS as my datasource :(
osw Sep 4, 2001 6:20 AM (in response to osw)Thakns for info, but I'm using Bean persistance and therefore dont need any type mappings jaws is supposed to deal with.
Interesting thing I found in JBoss source (God save opensource):
file org.jboss.ejb.Container.java:
====================================================
if (ref.getType().equals("javax.sql.DataSource"))
{
// Go through JNDI and look for DataSource - use the first one
Context dsCtx = new InitialContext();
try
{
// Check if it is available in JNDI
dsCtx.lookup("java:/DefaultDS");
finalName = "java:/DefaultDS";
} catch (Exception e)
{
Logger.debug(e);
}
}====================================================
and no references to ref.getResourceName() or ref.getJndiName() -
5. Re: I dont want DefaultDS as my datasource :(
tbfmicke Sep 4, 2001 6:54 AM (in response to osw)
If you look a few lines earlier in the same file you will find both getResourceName() and getJndiName() (with getJndiName() only in 2.4, not in 2.5, no idea why) and that the code snippet is in an if, and is only executed if the resource the code is really looking for is not found. (At least as far as I understand the code, I might be missing something)
>
> Interesting thing I found in JBoss source (God save
> opensource):
>
>
> and no references to ref.getResourceName() or
> ref.getJndiName() -
6. Re: I dont want DefaultDS as my datasource :(
delattrj Sep 4, 2001 8:02 AM (in response to osw)did you try it ?
I've changed the default datasource in jaws for CMP first.
and I did not had your problem when testing BMP few days later ... -
7. Re: I dont want DefaultDS as my datasource :(
osw Sep 4, 2001 8:44 AM (in response to osw)Hi again.
editing jaws didn't help me.
But I got my beans working after editing Container.java and placing class back to jboss.jar
=======
//dsCtx.lookup("java:/DataSource");
//finalName = "java:/DataSource";
dsCtx.lookup(finalName = "java:/" + resourceName);
=======
Sure it might be wrong in general (I'm not an jndi expert) but works fine for my case. -
8. Re: I dont want DefaultDS as my datasource :(
cnsxxx09 Jan 7, 2002 5:33 AM (in response to osw)Hi,
I have the same problem...(JBoss 3 Alpha)
I created the oracleds-service.xml (from the on-line manual...which I can see is created ok) and put the following in jaws.xml
OracleDS <type-mapping>Oracle8</type-mapping>
but when I try to use my beans I get the Deployment Exception:
Error: can't find data source: java:/DefaultDS
....and yet there is no reference to DefaultDS anywhere in my jar file
If I had a TYPO somewhere maybe in my OracleDS or oracleds-service.xml then I could understand if that was the error message...but I'm baffled as to why DefaultDS is looked for...
Any ideas?
TIA
Chris
-=-= -
9. Re: I dont want DefaultDS as my datasource :(
adrian.brock Jan 7, 2002 5:56 AM (in response to osw)From the 3.0 testsuite
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jboss/jbosstest/src/resources/xa/META-INF/ejb-jar.xml?rev=1.1&content-type=text/vnd.viewcvs-markup
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jboss/jbosstest/src/resources/xa/META-INF/jboss.xml?rev=1.2&content-type=text/vnd.viewcvs-markup
Follow the pattern for java:/InstantDB, DB2, ejb/DBConnection2
Regards,
Adrian -
10. Re: I dont want DefaultDS as my datasource :(
cnsxxx09 Jan 7, 2002 8:59 AM (in response to osw)Thanks for the reply and the pointer...
I now have my oracleds-service.xml as follows...
OracleDS
which deploys as a JBOSS System Service:
service=ConnectionFactoryLoader,name=OracleDS
My ejb-jar.xml contains (per bean):
<resource-ref>
<res-ref-name>jdbc/Oracle</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
and my jboss.xml file (per bean):
<resource-ref>
<res-ref-name>jdbc/Oracle</res-ref-name>
<resource-name>OracleDS</resource-name>
</resource-ref>
and (general):
<resource-manager res-class="org.jboss.ejb.deployment.JDBCResource">
<res-name>OracleDS</res-name>
<res-jndi-name>java:/OracleDS</res-jndi-name>
</resource-manager
and my jaws.xml file:
OracleDS <type-mapping>Oracle8</type-mapping>
....but still no joy. I've been staring and staring at this for some time now that my eyes have gone square!
Is there something obvious I'm missing?
Thanks
Chris
-=-=- -
11. Re: I dont want DefaultDS as my datasource :(
garymarsh Jan 7, 2002 1:01 PM (in response to osw)Hi,
I am using MS SQLSERVER as my datasource and I made the following changes to my standardjaws.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<!--
java:/DefaultDS
<type-mapping>Hypersonic SQL</type-mapping>
false
-->
java:/SQLServerPool
<type-mapping>MS SQLSERVER2000</type-mapping>
false
===========
I also made the following changes in the jboss.jcml,
<!-- ==================================================================== -->
<!-- JDBC -->
<!-- ==================================================================== -->
<!-- Add your JDBC Driver i.e. Microsoft JDBC for SQLServer here -->
org.hsqldb.jdbcDriver,
com.microsoft.jdbc.sqlserver.SQLServerDriver
<!-- This is the setup for MSSQLServer Connection Pool -->
org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl
SQLServerPool
DatabaseName=PayeArchitecture;SelectMethod=cursor
jdbc:microsoft:sqlserver://localhost:1433
1200000
paye
richrules
10
false
false
false
true
120000
1800000
false
false
1.0
0
see if this might help.
Gary -
12. Re: I dont want DefaultDS as my datasource :(
adrian.brock Jan 7, 2002 6:03 PM (in response to osw)I assume </resource-manager is a mis-type and the >
is really there.
Also is your <resource-manager> a child of a
<resource-managers>?
I did find that if the resource-manager is not
present, the DefaultDS is only a debug message.
It will use whatever is in standardjaws.xml
DefaultDS is also mentioned in standardjbosscmp-jdbc.xml
I've just done what you did except with hsqldb,
changing DefaultDS to MyDS and it all worked fine,
not even the warning :-)
This is all 3.0 latest CVS by the way.
Regards,
Adrian -
13. Re: I dont want DefaultDS as my datasource :(
cnsxxx09 Jan 8, 2002 2:49 AM (in response to osw)Hi,
Thanks again for the reply...
I am using v3 alpha...CVS is blocked at work so I can't get the latest changes.
I had to change some lines in my oracle service xml file because:
<depends optional-attribute-name="
didn't work but
<mbean-ref name="
did work.
Anyway, the answer is yes to both your first and 2nd questions......
Also I have now changed DefaultDS in the 2 files you mention to OracleDS and it now works (well, I no longer get the DefaultDS error message)....
but I guess this is not the way it should be done...
Onto the next problem......
Chris
-=-=-= -
14. Re: I dont want DefaultDS as my datasource :(
giorgio42 Jan 8, 2002 3:33 AM (in response to osw)
I have been fighting with the same problem the past days, but finally I have been able to solve this problem.
Two hints from my experience:
- If you switch from EJB1.1 to EJB2.0 you have to use jbosscmp-jdbc.xml instead of jaws.xml, else your jaws.xml will silently be ignored and the settings will be taken from standardjbosscmp-jdbc.xml.
- In jaws.xml setting the datasource directly below the top-level element works fine. In jbosscmp-jdbc.xml I have to put it inside a tag.
HTH.
Georg