Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Why is Jasper embedded in CF8

Guest
Nov 30, 2008 Nov 30, 2008
I'm trying to invoke the Jasper Report engine directly from ColdFusion. I've ran into a bit of a snag because CF has compiled Jasper into it's main JAR and so there is no way to override it. The below code can be ran in ColdFusion 8 and you'll see the path and file CFUSION.JAR

<cfobject type="java" class="net.sf.jasperreports.engine.JasperRunManager" action="create" name="jrrm" >
<cfobject type="java" class="net.sf.jasperreports.engine.JasperCompileManager" action="create" name="jrcm" >

<cfoutput>#jrrm.getClass().getProtectionDomain().getCodeSource().getLocation().toString()#</cfoutput>

Since .JAR files are just .ZIP files I extracted it and noticed a NET.SF.JASPERREPORTS path directly in the CFUSION jar. It's all compiled code so I have no idea what version of Jasper it is.

I'm tempted to just plop the new version in the CFUSION jar and rebuilt it. What I can't determine is what within CF is even using Jasper...does anyone on here having any ideas...or an idea on how to find out? And rebuilding this JAR seems like a bit too hacky.
495
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Nov 30, 2008 Nov 30, 2008
To update this posting I've found if I put the Jasper JAR file in the c:\coldFusion8\lib directory it will load over CFUSION, but only if I name it someting like AJasper.jar.... The key is to have it list before Cfusion in alpha order. I'm guessing the JVM loads up JAR files this way...:)
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 30, 2008 Nov 30, 2008
LATEST
twillerror wrote:
> To update this posting I've found if I put the Jasper JAR file in the
> c:\coldFusion8\lib directory it will load over CFUSION, but only if I name it
> someting like AJasper.jar.... The key is to have it list before Cfusion in
> alpha order. I'm guessing the JVM loads up JAR files this way...:)

are you sure you got the right version? usually what's 'native' to cf will get
on the classpath ahead of other stuff & i'm not sure just renaming the jar is
enough. jasper reports are what cf uses for the cfreport bits (along w/iText for
pdf support).

can't you just use the baked in jasper lib (we often use the 'old' iText lib
that comes w/cf)? if not, have a look at mark mandel's javaLoader. it can
arbitrarily load java libs, works a treat (we use it when we need the very
latest iText lib).




Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources