A couple of observations
1. assuming you are running from the svn trunk (not the 2.0 release)
2. Ive recently stopped using the ConnectionRepositoryEntry, so it is
not initialized
3. Not sure how you expect to find it the CRE from your portlet class,
as the class lives in the Jetspeed webapp. (Perhaps some classloader
tricks come into play here). Or are you packaging our rdbms jar in your
portlet app?
Anthony Perritano wrote:
Hi,
I have a portlet that i want to access a mysql database. i keep running
into this:
Error on SQL: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot
create JDBC driver of class '' for connect URL 'null'
looks like jetspeed.xml
<Context path="/jetspeed" docBase="jetspeed" crossContext="true">
<Realm className="org.apache.catalina.realm.JAASRealm"
appName="Jetspeed"
userClassNames="org.apache.jetspeed.security.impl.UserPrincipalImpl"
roleClassNames="org.apache.jetspeed.security.impl.RolePrincipalImpl"
useContextClassLoader="false"
debug="0"/>
<Resource name="jdbc/jetspeed" auth="Container"
factory="org.apache.commons.dbcp.BasicDataSourceFactory"
type="javax.sql.DataSource" username="jetspeed2"
password="jetspeed2"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://blah:3306/j2"
maxActive="100" maxIdle="30" maxWait="10000"/>
<Resource name="jdbc/sailDB" auth="Container"
factory="org.apache.commons.dbcp.BasicDataSourceFactory"
type="javax.sql.DataSource" username="jetspeed2" password="j2"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://blah:3306/sail"
maxActive="100" maxIdle="30" maxWait="10000"/>
</Context>
the jdbc/jetspeed works great, its the jdbc/sailDB that i am trying to
connect to from my portlet.
my datasource.xml has this:
<bean id="sailDB"
class="org.apache.jetspeed.components.rdbms.ojb.ConnectionRepositoryEntr
y">
<property name="driverClassName">
<value>com.mysql.jdbc.Driver</value>
</property>
<property name="url">
<value>jdbc:mysql://blah:3306/sail</value>
</property>
<property name="username">
<value>jetspeed2</value>
</property>
<property name="password">
<value>j2</value>
</property>
<property name="jndiName">
<value>java:comp/env/jdbc/sailDB</value>
</property>
</bean>
my web.xml in my portlet is:
<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/sailDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
and the code i use to get the datasource in my portlet is:
DataSource ds = null;
Context context = new InitialContext();
ds = (DataSource) context.lookup("java:comp/env/jdbc/sailDB");
am missing something some where???
thanks
Anthony
--
David Sean Taylor
Bluesunrise Software
[EMAIL PROTECTED]
[office] +01 707 773-4646
[mobile] +01 707 529 9194
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]