Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
BIRT, Oracle, JNDI and Glassfish
leehu
Hi all, I'm trying to use JNDI to connect to an Oracle database. The app is deployed under Glassfish 2.1.1 and I have setup a connection pool referenced by 'jdbc/BirtConnection'.
I'm not sure what I should fill is as the URL when defining the datasource. I've tried accessing through java:comp/env but this does not work.
Anyone with any suggestions? Cheers L
Find more posts tagged with
Comments
DavidB
<blockquote class='ipsBlockquote' data-author="'leehu'" data-cid="80638" data-time="1311761321" data-date="27 July 2011 - 03:08 AM"><p>
Hi all, I'm trying to use JNDI to connect to an Oracle database. The app is deployed under Glassfish 2.1.1 and I have setup a connection pool referenced by 'jdbc/BirtConnection'. <br />
<br />
I'm not sure what I should fill is as the URL when defining the datasource. I've tried accessing through java:comp/env but this does not work.<br />
<br />
Anyone with any suggestions? Cheers L<br /></p></blockquote>
<br />
Hi Leehu, we also use JNDI as our datasource using Postgres, BIRT and Glassfish(v1 & v3) the url in your case should just be 'jdbc/BirtConnection'. If this isn't working you may want to browse your JNDI tree to make sure the entry exists.<br />
<br />
Regards<br />
David
leehu
<blockquote class='ipsBlockquote' data-author="'DavidB'" data-cid="80642" data-time="1311765418" data-date="27 July 2011 - 04:16 AM"><p>
Hi Leehu, we also use JNDI as our datasource using Postgres, BIRT and Glassfish(v1 & v3) the url in your case should just be 'jdbc/BirtConnection'. If this isn't working you may want to browse your JNDI tree to make sure the entry exists.<br />
<br />
Regards<br />
David<br /></p></blockquote>
<br />
Hi David, thanks for the reply.<br />
<br />
Yes, I thought that was it - in the BIRT log it says that it cannot locate the resource though.<br />
<br />
FINER: Calling getJndiDSConnection: JNDI name url=jdbc/BirtConnect<br />
27-Jul-2011 12:24:14 JndiDataSource getConnection<br />
FINER: ENTRY jdbc/BirtConnect<br />
27-Jul-2011 12:24:14 org.eclipse.birt.report.data.oda.jdbc.JndiDataSource getConnection<br />
INFO: javax.naming.NameNotFoundException: BirtConnect not found<br />
27-Jul-2011 12:24:14 JndiDataSource getConnection<br />
FINER: RETURN null<br />
<br />
If I try programatically to get the pool in Java then it returns it ok using jdbc/BirtConnect.<br />
<br />
Have you seen anything like this? Thanks, Lee
DavidB
<blockquote class='ipsBlockquote' data-author="'leehu'" data-cid="80643" data-time="1311765982" data-date="27 July 2011 - 04:26 AM"><p>
Hi David, thanks for the reply.<br />
<br />
Yes, I thought that was it - in the BIRT log it says that it cannot locate the resource though.<br />
<br />
FINER: Calling getJndiDSConnection: JNDI name url=jdbc/BirtConnect<br />
27-Jul-2011 12:24:14 JndiDataSource getConnection<br />
FINER: ENTRY jdbc/BirtConnect<br />
27-Jul-2011 12:24:14 org.eclipse.birt.report.data.oda.jdbc.JndiDataSource getConnection<br />
INFO: javax.naming.NameNotFoundException: BirtConnect not found<br />
27-Jul-2011 12:24:14 JndiDataSource getConnection<br />
FINER: RETURN null<br />
<br />
If I try programatically to get the pool in Java then it returns it ok using jdbc/BirtConnect.<br />
<br />
Have you seen anything like this? Thanks, Lee<br /></p></blockquote>
<br />
In your first post you state the url as 'jdbc/BirtConnection' not 'jdbc/BirtConnect' typo ?<br />
<br />
<br />
Now this is a wild stab in the dark, I once had a problem connecting to a JNDI datasource in BIRT which was due to me manually/partially configuring the glassfish connection pool in the domain.xml file. This resulted in the EJB's accessing the database but not BIRT. The fix was to ensure you have a resource reference entry <resource-ref ref="jdbc/BirtConnect"></resource-ref> within the <server> node of your domain.xml.<br />
<br />
Regards<br />
David
leehu
Hi David. Yes, a typo
I decided to clean everything down and start again from scratch and this time all fine so I must have messed something up with my fiddling the first time round. Thanks for the help.
Cheers L