简体   繁体   中英

JBOSS | Jasper report error

My application generates some reports to it's clients. But there's an error when generating the reports here's the exception:-

java.lang.NoSuchMethodError: org.eclipse.jdt.internal.compiler.env.NameEnvironmentAnswer.<init>(Lorg/eclipse/jdt/internal/compiler/env/IBinaryType;)V
    net.sf.jasperreports.engine.design.JRJdtCompiler$1.findType(JRJdtCompiler.java:235)
    net.sf.jasperreports.engine.design.JRJdtCompiler$1.findType(JRJdtCompiler.java:204)
    org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.askForType(LookupEnvironment.java:119)
    org.eclipse.jdt.internal.compiler.lookup.PackageBinding.getType(PackageBinding.java:126)
    org.eclipse.jdt.internal.compiler.lookup.Scope.findType(Scope.java:1355)
    org.eclipse.jdt.internal.compiler.lookup.Scope.getTypeOrPackage(Scope.java:2472)
    org.eclipse.jdt.internal.compiler.lookup.Scope.getType(Scope.java:2194)
    org.eclipse.jdt.internal.compiler.ast.SingleTypeReference.getTypeBinding(SingleTypeReference.java:39)
    org.eclipse.jdt.internal.compiler.ast.TypeReference.resolveType(TypeReference.java:141)
    org.eclipse.jdt.internal.compiler.ast.TypeReference.resolveSuperType(TypeReference.java:104)
    org.eclipse.jdt.internal.compiler.lookup.ClassScope.findSupertype(ClassScope.java:1107)
    org.eclipse.jdt.internal.compiler.lookup.ClassScope.connectSuperclass(ClassScope.java:767)
    org.eclipse.jdt.internal.compiler.lookup.ClassScope.connectTypeHierarchy(ClassScope.java:947)
    org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.connectTypeHierarchy(CompilationUnitScope.java:266)
    org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.completeTypeBindings(LookupEnvironment.java:195)
    org.eclipse.jdt.internal.compiler.Compiler.beginToCompile(Compiler.java:301)
    org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:315)
    net.sf.jasperreports.engine.design.JRJdtCompiler.compileClass(JRJdtCompiler.java:392)
    net.sf.jasperreports.engine.design.JRJdtCompiler.compileReport(JRJdtCompiler.java:109)
    net.sf.jasperreports.engine.design.JRDefaultCompiler.compileReport(JRDefaultCompiler.java:106)
    net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:128)
    net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:110)

Recently I moved this application to JBOSS 4.0.5.GA . This application was running fine and there's no errors in generating reports in Tomcat 5

Thanks.

I believe there is a conflicting JAR file:

jdt-compiler-3.1.1.jar

I created a script to set the CLASSPATH before Tomcat runs:

#!/bin/bash

IREPORT_HOME=$HOME/bin/ireport
CLASSPATH=$IREPORT_HOME/platform9/modules/org-netbeans-core.jar:

for j in \
  $IREPORT_HOME/ireport/modules/ext/*.jar \
  $IREPORT_HOME/ide10/modules/ext/*.jar; do
  BASENAME=$(basename $j)

  # Append file names to the CLASSPATH, except those with Tomcat conflicts.
  if [ "$BASENAME" != "jdt-compiler-3.1.1.jar" ]; then
    CLASSPATH=$j:$CLASSPATH
  fi
done

export CLASSPATH=$CLASSPATH.

Save it as setenv.sh and place it in $CATALINA_HOME/bin . You will have to change the IREPORT_HOME variable accordingly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM