BIRT Exchange Forum: jndi in jboss not working for me - BIRT Exchange Forum

Jump to content


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

jndi in jboss not working for me Rate Topic: -----

#1 User is offline   kimyx 

  • Junior Member
  • PipPip
  • Group: Members
  • Posts: 12
  • Joined: 29-September 09

Posted 13 October 2009 - 09:07 AM

I'm using Actuate 11 M9 beta, deploying its war file into a jboss 4.2.3 server. It's working well except when I try to switch from a direct jdbc connection to a pooled jndi data source.

I've read lots of other threads and the new document by vdodson: Using the BIRT Viewer with JBoss - Articles - BIRT Exchange. My situation differs from the latter document in that I'm using different birt and jboss versions, of course.

When I follow all the advice I've seen there is no indication in the reporting log file or the jmx console that a jndi connection is being tried. I have logging set to FINE (also tried FINER and FINEST) and the only entries have to do with direct jdbc.

Here's the data source from my test report:


    

        

            com.mysql.jdbc.Driver

            jdbc:mysql://localhost:3306/mydb

            dev

            ZGV2

            java:/MyDB

        

    




The jndi data source is definitely functional since it is in use by other parts of the web app. I see its entry in the jndi tree.

I've tried many variations on the data source definition above, including changing the odaURL property to be incorrect. In that case the connection fails with a jdbc error. The user and password are valid for both the jdbc connection and the jndi connection.

Any additional advice on getting this to work in my situation? Why would I see no indication that jndi is being attempted?

Thanks,
Kim
0

#2 User is offline   kimyx 

  • Junior Member
  • PipPip
  • Group: Members
  • Posts: 12
  • Joined: 29-September 09

Posted 13 October 2009 - 12:06 PM

I am not seeing a lot of log entries that I would expect to see after looking at the source code. I've set the JUL_LOG_FILE_LEVEL param in the actuate war web.xml to FINER and I see a lot of log entries from the com.actuate package but none from the org.eclipse.birt package. Is there another place to set logging properties for actuate/birt/eclipse?

I tried changing some settings in the logging.properties file in my jre/lib folder, but that didn't seem to matter.
0

#3 User is offline   kimyx 

  • Junior Member
  • PipPip
  • Group: Members
  • Posts: 12
  • Joined: 29-September 09

Posted 14 October 2009 - 11:35 AM

OK, I finally got my logging configured to show the necessary details.

The following code in JDBCDriverManager.java prevents the jndi connection from being tried if there is a connectionFactory defined for the driver type (mysql in my case).

    private synchronized Connection doConnect( String driverClass, String url, 
            String jndiNameUrl,
            Properties connectionProperties, Collection driverClassPath ) throws SQLException, OdaException
    {
		assert ( url != null );
		IConnectionFactory factory = getDriverConnectionFactory (driverClass);
		if ( factory != null )
		{
			// Use connection factory for connection
			if ( logger.isLoggable( Level.FINER ))
				logger.finer( "Calling IConnectionFactory.getConnection. driverClass=" + driverClass + //$NON-NLS-1$
						", url=" + LogUtil.encryptURL( url ) ); //$NON-NLS-1$
			return factory.getConnection( driverClass, url, connectionProperties );
		}
        
        // no driverinfo extension for driverClass connectionFactory
        
        // if JNDI Data Source URL is defined, try use name service to get connection
        Connection jndiDSConnection = 
            getJndiDSConnection( driverClass, jndiNameUrl, connectionProperties );



I removed the connectionFactory attribute for the mysql jdbcDriver in

$JBOSS_HOME/server/default/deploy/actuate.war/WEB-INF/platform/plugins/com.actuate.data.oda.jdbc.drivers_11.0.0/plugin.xml

and now all is well.

Maybe something changed in either the code or configuration for the Actuate 11 WAR that makes this a new issue. Maybe the jndi connection attempt should occur before the connection factory attempt?
0

#4 User is offline   rmurphy 

  • Senior Member
  • Group: Members
  • Posts: 307
  • Joined: 09-August 07

Posted 14 October 2009 - 07:19 PM

Kim,
I believe the Actuate extensions force connections to go through the Actuate packages. One of the things the Actuate Viewer does is automatically pool database connections for you. For your information, you can read more about the built in connection pooling here: Configuration - BIRT Wiki - BIRT Exchange (I know this isn't the type of pooling you are wanting, but wanted you to be aware of it).

What happens if you modify your design to remove the JDBC connection info? I'm wondering if there is the viewer is not checking the JNDI connection info first and is automatically using the JDBC.

Rob
0

#5 User is offline   kimyx 

  • Junior Member
  • PipPip
  • Group: Members
  • Posts: 12
  • Joined: 29-September 09

Posted 15 October 2009 - 05:14 AM

Rob - thanks for the link on the Actuate pooling. I saw those configuration entries in web.xml but didn't realize they would prevent the jndi-based pooling. In the app I'm working on, the jndi database connection is configured at install time, and this avoids having to configure every report's database at install or run time.

The code forces you to enter all of the jdbc connection info. It punts early if any one of the driver class, jdbc url, user, or password is omitted.

-Kim
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users