Jump to content
We've recently updated our Privacy Statement, available here ×

Java version giving incompatibility


marcosmarciel50

Recommended Posts

Hello friends, I'm new with the jasper tool, and I'm having some problems, I have several reports here, which are working, but I have one here, which uses a sub-report, but when I ask to generate it, it returns this error:

Exception on "main" thread net.sf.jasperreports.engine.JRRuntimeException: net.sf.jasperreports.engine.JRException: Class not found when loading object from InputStream.

compiling with jasperstudio works, but when I compile with phpjasper it gives an error.

 

I believe it's a problem with incompatibility with java, but I'm already using the newest version of jdk

Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

Thank you for posting to the Jaspersoft Community. Our team of experts has read your question and we are working to get you an answer as quickly as we can. If you have a Jaspersoft Professional Subscription plan, please visit https://support.tibco.com/s/ for direct access to our technical support teams offering guaranteed response times.
 

Link to comment
Share on other sites

Hello,
I assume you are using the latest version of JasperReports library which does indeed support any JRE versions from v. 6.
If your PHP app is able to run jasper reports nicely and it only fails for reports embedding sub-reports then I would check that the master report points to the right location to find the sub-report .jasper or .jrxml file once deployed in your app.

I hope this helps

Link to comment
Share on other sites

Yes, I'm at version 6.20.5, and my jdk version is this:

java version "1.8.0_371"
Java SE Runtime Environment (build 1.8.0_371-b11)
Java HotSpot 64-Bit Server VM (build 25.371-b11, mixed mode)

and my subreport's call is this:

<band height="306" splitType="Stretch">

<subreport>

<reportElement x="0" y="0" width="509" height="70" uuid="e54ebdae-686d-4023-91f2-e0ca8e043b4e"/>

<subreportParameter name="REPORT_CONNECTION">

<subreportParameterExpression><![CDATA[]]></subreportParameterExpression>

</subreportParameter>

<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>

<subreportExpression><![CDATA["C://xampp//htdocs//gerador_relatorio//gerenciamentoCargas//relatorio_sub.jrxml"]]></subreportExpression>

</subreport>

</band>

And yes, my subreport directory is correct, I already confirmed it.

 

I added an image in attachment, in classpath do I need to add the jdk path of my machine?

 

Link to comment
Share on other sites

  • 3 weeks later...

I would try to remove the jasper file of the subreport and recompile it with the same compiler you used to compile the master report.
Be aware that Jaspersoft Studio may not always compile the subreports for you, or simply it does not do it if it is not necessary (i.e. the jasper is up-to-date respect to the jrxml).

Since phpjasper will be your running environment, I would use it also to (re)compile all your jrxml files.

Giulio

Link to comment
Share on other sites

Another possible error could be the way you are referencing the subreport:
C://xampp//htdocs//gerador_relatorio//gerenciamentoCargas//relatorio_sub.jrxml
You should point to the jasper file, not to the jrxml file (which is the source that needs to be compiled into a jasper file).

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...