Jump to content
Changes to the Jaspersoft community edition download ×

type java.lang.Object cannot be resolved


graderzhy

Recommended Posts

I am using jasper report engin, my program works fine as the appplication, but if I put it as an applet then it throw out this exception. by the way, I am using Tomcat5.5.17

 

net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file:

The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files

/*

^

1 errors

 

I added rt.jar in the archive list of applet, it does not work.

 

Any other suggestion?

 

Thanks

Link to comment
Share on other sites

  • Replies 24
  • Created
  • Last Reply

Top Posters In This Topic

More detailed error information:

 

network: Connecting socket://192.168.101.45:1496 with proxy=DIRECT

network: Connecting http://localhost:8180/myApp/java.class with proxy=DIRECT

net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file:

1. The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files

/*

^

1 errors

 

at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:193)

at net.sf.jasperreports.engine.design.JRDefaultCompiler.compileReport(JRDefaultCompiler.java:131)

at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:211)

at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:197)

Link to comment
Share on other sites

  • 3 weeks later...

Thanks for reply.

 

I do have jdt-compiler-3.1.1.jar under class path.

 

The problem is that if my application run as stand application , it is working fine.

 

If run as applet, all other part is working fine, only this issue.

 

I already put all my jar files in archive list.

 

Also If I add this line in my code:

 

JRProperties.setProperty(JRProperties.COMPILER_CLASS,"net.sf.jasperreports.engine.design.JRJavacCompiler");

 

It will complain "net.sf.jasperreports.engine.*" can not find.

 

Again, if unintall my jvm1.5, and use jvm1.4, it is working fine.

 

Any other suggestion?

 

Thanks

Link to comment
Share on other sites

:P

 

Post edited by: graderzhy, at: 2006/09/05 15:57

 

By the way, I am using jasper 1.2.5 or 1.2.6, I am assuming it will be OK since 1.2.4 already fixed that issue.

 

But the problem is still there.

 

net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file:

1. The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files

/*

^

1 errors

 

at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:193)

at net.sf.jasperreports.engine.design.JRDefaultCompiler.compileReport(JRDefaultCompiler.java:105)

at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:211)

at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:197)

 

 

:( :(

Post edited by: graderzhy, at: 2006/09/05 16:12

Link to comment
Share on other sites

If I add following code :

 

 

Code:
JRProperties.setProperty(JRProperties.COMPILER_CLASS,"net.sf.jasperreports.engine.design.JRJavacCompiler"«»);

 

The java.lang.Object issue is gone, but it will throw out following error:

 

net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file:

C:Program FilesMozilla FirefoxAccRollupReportTemplateV1_1157473502610_148891.java:4: package net.sf.jasperreports.engine does not exist

import net.sf.jasperreports.engine.*;

^

C:Program FilesMozilla FirefoxAccRollupReportTemplateV1_1157473502610_148891.java:5: package net.sf.jasperreports.engine.fill does not exist

import net.sf.jasperreports.engine.fill.*;

^

C:Program FilesMozilla FirefoxAccRollupReportTemplateV1_1157473502610_148891.java:14: package net.sf.jasperreports.engine does not exist

import net.sf.jasperreports.engine.*;

^

C:Program FilesMozilla FirefoxAccRollupReportTemplateV1_1157473502610_148891.java:15: package net.sf.jasperreports.engine.data does not exist

import net.sf.jasperreports.engine.data.*;

^

C:Program FilesMozilla FirefoxAccRollupReportTemplateV1_1157473502610_148891.java:21: cannot find symbol

symbol: class JREvaluator

public class AccRollupReportTemplateV1_1157473502610_148891 extends JREvaluator

^

...... ^

C:Program FilesMozilla FirefoxAccRollupReportTemplateV1_1157473502610_148891.java:160: cannot find symbol

symbol : class JRFillVariable

location: class AccRollupReportTemplateV1_1157473502610_148891

variable_positionPRTTotal = (JRFillVariable)vm.get("positionPRTTotal");

^

100 errors

 

at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:193)

at net.sf.jasperreports.engine.design.JRDefaultCompiler.compileReport(JRDefaultCompiler.java:105)

at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:211)

at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:197)

a

Post edited by: graderzhy, at: 2006/09/05 17:04

Link to comment
Share on other sites

Then I have to put jasperreport.jar file in the ext subdirectory of java_home/jre/lib/

 

But doing this is is not a solution for applet. Since the only way to put jar files for applet is by ac=rhive list.

 

 

 

what confuse me here is that I have jasper1.2.6 jar in the archive list and I can see it downloaded to the local. But for some reason it can not be found by the jasper enginee.

 

I know we can supply a class path to jaser by :

 

System.setProperty("jasper.reports.compile.class.path",compile_path);

 

But if it is applet, then how it works?

 

Any help or suggestion will be apprecaited.

 

Thanks:( :(

 

Post edited by: graderzhy, at: 2006/09/05 22:43

Post edited by: graderzhy, at: 2006/09/05 22:49

Link to comment
Share on other sites

By the way this is my archive jar list of my applet which is related to report

 

<applet archive="./jar/report/jasperreports-1.2.6.jar,./jar/report/commons-javaflow-20060411.jar,./jar/report/groovy-all-1.0-beta-10.jar,./jar/report/jakarta-bcel-20050813.jar,./jar/report/jrpl.jar,./jar/report/xml-apis.jar,./jar/report/commons-beanutils-1.5.jar,./jar/report/commons-collections-2.1.jar,./jar/report/commons-digester-1.7.jar,./jar/report/hsqldb-1.7.1.jar,./jar/report/itext-1.3.1.jar,./jar/report/jcommon-1.0.0.jar,./jar/report/jdt-compiler-3.1.1.jar,./jar/report/jfreechart-1.0.0.jar,./jar/report/poi-2.0-final-20040126.jar,./jar/report/servlet.jar,./jar/report/xalan.jar,./jar/report/xercesImpl.jar,./jar/report/ant-1.5.1.jar,./jar/report/jasperreports-1.2.6-applet.jar,

......

Link to comment
Share on other sites

The fix you mentioned was for the JDT report compiler, you shouldn't use the javac compiler as it requires a classpath, while the JDT compiler uses the context class loader.

 

This seems to be caused by something else. Don't actually know what. Check your applet for older JR jars. Also delete the applet cache.

 

Regards,

Lucian

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 months later...

I also Have this problem, in my jsp/html, I include the jdtcompiler-3.1.1 and Im Using Java 5 and When I try to run the applet directly from a HTML (by double click) it works just fine, when I put the location in the browser and it goes trought the apache tomcat 5.5 server I the the error:

JRException. Errors were encountered when compiling report expressions class file:

 

I would really apreciate some help, Im geting desperate.

 

thanks

Link to comment
Share on other sites

  • 5 months later...
  • 3 months later...
  • 2 months later...

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...