0

I have karaf 4.1.1 and birt runtime 4.5.0 on my server. I have problems deploying birt.war in karaf. My purpose is using birt report engine api in karaf to generete reports based on birt project files.

I instaled karaf war feature. But I'm unable to install birt. I tried to type in karaf shell:

bundle:install -s "C:\birt-runtime-4_5_0\birt.war?Bundle-SymbolicName=birt&Web-ContextPath=/sample"

I got: org.osgi.framework.BundleException: Unable to cache bundle

Any suggestions?

user229044
  • 232,980
  • 40
  • 330
  • 338
ggx2
  • 17
  • 1
  • 7

1 Answers1

1

Try to install your component using webbundle prefix.

Simply, tap the following command in your running Karaf instance:

bundle:install webbundle:file:///C:/birt-runtime-4_5_0/birt.war?Bundle-SymbolicName=birt&Web-ContextPath=/sample
Karim G
  • 448
  • 3
  • 9
  • I have `118 | Active | 80 | 0.0.0 | C__karaf_deploy_ReportEngine` fater I type bundle:bundlelist. But it doesn't show up on HTTP Context. – ggx2 Jul 05 '17 at 12:20
  • try **headers 118** to show some bundle's information and share the output so I can debug with you :) – Karim G Jul 05 '17 at 12:58
  • thanks! `C__karaf_deploy_ReportEngine (118) ---------------------------------- Bnd-LastModified = 1499249649862 Created-By = 1.8.0_131 (Oracle Corporation) Generated-By-Ops4j-Pax-From = wrap:jardir:C:\karaf\deploy\ReportEngine$Bundle-SymbolicName=C:\karaf\deploy\ReportEngine&Bundle-Version=0.0.0 Manifest-Version = 1.0 Tool = Bnd-2.3.0.201405100607 Bundle-ManifestVersion = 2 Bundle-Name = C__karaf_deploy_ReportEngine Bundle-SymbolicName = C__karaf_deploy_ReportEngine Bundle-Version = 0.0.0 Export-Package = genReport.bat, genReport.sh, lib, samples` – ggx2 Jul 05 '17 at 13:12
  • It seems that the war was not wrapped correctly by Karaf. Did you install it using webbundle prefix as I mentioned in my answer ? – Karim G Jul 05 '17 at 13:37
  • yes I used webbundle prefix. I will reinstall it tommorow and post here state of problem. the server is accessible only through work network. – ggx2 Jul 05 '17 at 16:14
  • do I need put the .war file and other birt runtime folders in deploy folder? – ggx2 Jul 06 '17 at 06:53
  • I think that installing the .war into Karaf is equivalent to put it under deploy folder. If you have other dependencies you can try it :) – Karim G Jul 06 '17 at 08:31
  • I've done some more research and found that regular birt runtime doesn't go well with osgi. I've installed birt runtime for osgi. I simply put birt.war file in karaf's deploy folder. I have it installed as birt on bundle list. But on startup on karaf i have following exeptions: java.lang.ArrayIndexOutOfBoundsException with a lot of lines. – ggx2 Jul 06 '17 at 09:10
  • And when I use headers command you've showed me on birt bundle I get: Import-Package = javax.jms;resolution:=optional, org.eclipse.birt.report.servlet;resolution:=optional, org.eclipse.birt.report.filter;resolution:=optional, org.eclipse.birt.report.listener;resolution:=optional, and they're red so I guess karaf couldn't import those. – ggx2 Jul 06 '17 at 09:11
  • We have to change our approach of resolving your problem.Why not to transform the war to an OSGI ready bundle. This is simple just follow this: http://cq-ops.tumblr.com/post/21893960212/how-to-turn-a-jdbc-driver-jar-into-an-osgi-bundle. good luck :) – Karim G Jul 06 '17 at 09:23
  • I will try anything :D You mean transforming birt.war into osgi ready bundle right? – ggx2 Jul 07 '17 at 06:21
  • Yes try it and re test you solution – Karim G Jul 07 '17 at 13:38
  • I made bundle. It's installed on _bundle:list_ in karaf. I have also webcontext. But I quess I must now write some kind of code to use it. I'm also not sure if bundle is done correctly. My boss suggested to me, that plug-in in Eclipse (the link you gave me) is not the same as a osgi bundle. I started gathering data on java bundle, plugin, jsp, servlet etc to get a hang of idea of what I'm doing. I don't have much experience in java. I feel lost. I'll aprove your answer after I gain enough rep. Thanks for help :) – ggx2 Jul 17 '17 at 06:33