troubleshooting Question

Error on add Jasper Report

Avatar of Rafael_Moreira
Rafael_Moreira asked on
Web Languages and StandardsWeb Development SoftwareWeb Components
2 Comments1 Solution704 ViewsLast Modified:
When i add jasperreport dependency in my pom i get the following error::

Informações: Starting Servlet Engine: Apache Tomcat/7.0.12
java.lang.IllegalAccessError: class org.xml.sax.helpers.SecuritySupport12 cannot access its superclass org.xml.sax.helpers.SecuritySupport
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:792)
      at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
      at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2818)
      at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1148)
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1643)
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
      at org.apache.catalina.startup.ContextConfig.checkHandlesTypes(ContextConfig.java:1956)
      at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:1919)
      at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1806)
      at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1765)
      at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1751)
      at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1255)
      at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:882)
      at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:317)
      at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
      at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89)
      at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5081)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
      at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1033)
      at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:774)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
      at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1033)
      at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:291)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
      at org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
      at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:727)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
      at org.apache.catalina.startup.Catalina.start(Catalina.java:620)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:303)
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:431)

Searching on internet i find:


The servlet 2.3 spec says (9.6.2 Web Application Classloader):
"The classloader that a container uses to load a servlet in a WAR must not
allow the WAR to override JDK or Java Servlet API classes, and is recommended not to allow Servlets in the WAR visibility of the web containers implementation classes. If a web container has a mechanism for exposing container-wide library JARs to application classloaders, it is recommended that the application classloader be implemented in such a
way that classes packaged within the WAR are able to override classes
residing in containerwide
library JARs."





I've tryed :

http://stackoverflow.com/questions/8470450/why-does-java-to-throw-illegalaccesserror-when-invoking-mxmlc
http://atoksyahcodezz.blogspot.com.br/2013/07/error-java.html 
neste site diz para fazer o que está abaixo:
Tomact 7 Errors
If you receive blow error if you try to deploy your application under Tomcat 7.

java.lang.IllegalAccessError: class javax.activation.SecuritySupport12 cannot access its superclass javax.activation.SecuritySupport

please add metadata-complete="true" in your web.xml to override default properties of 3.0 for annotations.




The metadata-complete attribute of the web-app element in a Web application's deployment descriptor specifies whether the Web descriptor and other related deployment descriptors for this module (such as Web service descriptors) are complete
If servlet version is set to 2.4 or an earlier version, the servlet container does not process any annotations.

If the metadata-complete attribute is missing or is set to false, the default value for Servlet 2.5/3.0, and version is set to 2.5/3.0, the servlet container examines the class files of the application for servlet annotations and supports the annotations


After to put metadata=true i1ve got the error:


Jan 04, 2014 8:59:32 PM org.apache.catalina.core.StandardContext listenerStart
Grave: Exception sending context initialized event to listener instance of class org.jboss.weld.environment.servlet.Listener
org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [FacesContext] with qualifiers [@Default] at injection point [[field] @Inject private br.com.confiabilidade.controller.RelatorioItemsDosTecnicosBean.facesContext]
      at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:311)
      at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:280)
      at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:143)
      at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:163)
      at org.jboss.weld.bootstrap.Validator.validateBeans(Validator.java:382)
      at org.jboss.weld.bootstrap.Validator.validateDeployment(Validator.java:367)
      at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:379)
      at org.jboss.weld.environment.servlet.Listener.contextInitialized(Listener.java:182)
      at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4701)
      at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5204)
      at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5199)
      at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:724)

t ve tryed too::

http://osdir.com/ml/JavaServerFaces/2013-07/msg00207.html
Bom... essa parte de dependências de parser XML depende de outras coisas além do jasper. Teste com

            <dependency>
                <groupId>xml-apis</groupId>
                <artifactId>xml-apis</artifactId>
                <version>1.4.01</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>xerces</groupId>
                <artifactId>xercesImpl</artifactId>
                <version>2.10.0</version>
                <scope>test</scope>
            </dependency>

dependendo das fontes vc pode precisar tbm:

            <dependency>
                <groupId>net.sf.jasperreports</groupId>
                <artifactId>jasperreports-fonts</artifactId>
                <version>4.0.0</version>
            </dependency>
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros