Results 1 to 5 of 5

Thread: sybase jdbc driver and jasperreports 3.0.0 as osgi bundles?

  1. #1
    Join Date
    Oct 2008
    Posts
    0

    Default sybase jdbc driver and jasperreports 3.0.0 as osgi bundles?

    Dear S2AP team,

    I can't find sybase driver and jasperreports 3 (old jasperreports 2.0.5 is there) in your repository.

    I have tried to create war-lib project which contains all jars I haven't as osgi bundles.
    I added all jars to classpath in these war-lib and exported those packages.
    com.company.infrastructure.sybase bundle imports com.sybase.jdbc3.jdbc package
    but on deploy I get error: com.sybase.jdbc3.jdbc.SybDriver class isn't found

    I tried to change MANIFEST.MF in conn2.jar - sybase driver file to add needed info but unsuccessfully.

    I think there are many jars in the world that wasn't yet converted to osgi bundles and I'm not alone in such situation.

    Can you provide some manual-help for this problem?

    Regards

    Roman

  2. #2
    Join Date
    Oct 2008
    Posts
    0

    Default sybase jdbc driver and jasperreports 3.0.0 as osgi bundles?

    Any advices how to use jdbc drivers not available as osgi bundles?
    And not open source.

    Regards

    Roman

  3. #3
    Join Date
    Oct 2008
    Posts
    493

    Default sybase jdbc driver and jasperreports 3.0.0 as osgi bundles?

    Roman,

    You have a few options:

    1) If your application is a traditional JEE WAR file, you can package the JAR in WEB-INF/lib. There would be no need to import any packages in this case.
    2) If your application is packaged as one or more OSGi bundles, you can package the JAR within a bundle and reference it via the Bundle-ClassPath manifest header. There would also be no need to import any packages in this case.
    3) You can use BND (http://www.aqute.biz/Code/Bnd) to create an OSGi bundle from an existing JAR file as described here: http://blog.springsource.com/main/2008/02/18/creating-osgi-bundles/. You will have to import the packages that are exported from your newly-created bundle.

    When working with JDBC you may also encounter classloading problems with DriverManager -- it doesn't work in an OSGi environment due to its classloading behavior. As an alternative I would recommend using a DataSource implementation that employs OSGi-friendly classloading such as Commons DBCP or Spring's SimpleDriverDataSource (http://static.springframework.org/spring/docs/2.5.x/api/org/springframework/jdbc/datasource/SimpleDriverDataSource.html).

    Regards,
    Andy

  4. #4
    Join Date
    Aug 2004
    Location
    San Mateo, CA
    Posts
    1,265

    Default sybase jdbc driver and jasperreports 3.0.0 as osgi bundles?

    Regarding DriverManager: Using a pooling DataSource is an important best practice anyway.

  5. #5
    Join Date
    Oct 2008
    Posts
    0

    Default sybase jdbc driver and jasperreports 3.0.0 as osgi bundles?

    Many Thanks for help.
    BND tool and reading of OSGI spec docs helped me.
    I done mistake in MANIFEST.MF and it was a reason jdbc driver bundle wasn't found.
    And of course I use DataSource.
    I took Petclinic sample as start template and created my own bundles.

    Regards

    Roman

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •