-
Jul 25th, 2008, 06:57 AM
#1
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
-
Jul 28th, 2008, 05:21 AM
#2
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
-
Jul 28th, 2008, 05:40 AM
#3
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
-
Jul 28th, 2008, 11:13 AM
#4
sybase jdbc driver and jasperreports 3.0.0 as osgi bundles?
Regarding DriverManager: Using a pooling DataSource is an important best practice anyway.
-
Jul 29th, 2008, 04:57 AM
#5
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
-
Forum Rules