Error instantiating extensions registry for chart.theme - java

I'm trying to generate a PDF with JasperReports.
At the first time I try, I get this error:
ERROR [net.sf.jasperreports.extensions.DefaultExtensionsRegistry] Error instantiating extensions registry for chart.theme
from vfszip:My-App.ear/lib/jasperreports-chart-themes-4.7.0.jar/jasperreports_extension.properties
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem:
Failed to import bean definitions from relative location [defaultChartPropertiesBean.xml]
Offending resource: URL
[My-App.ear/lib/jasperreports-chart-themes-4.7.0.jar/net/sf/jasperreports/chartthemes/spring/beans/chartThemesBeans.xml];
nested exception is org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem:
Failed to import bean definitions from relative location [chartConstantsBean.xml]
Offending resource: URL
[My-App.ear/lib/jasperreports-chart-themes-4.7.0.jar/net/sf/jasperreports/chartthemes/spring/beans/defaultChartPropertiesBean.xml];
nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from URL
[My-App.ear/lib/jasperreports-chart-themes-4.7.0.jar/net/sf/jasperreports/chartthemes/spring/beans/chartConstantsBean.xml];
nested exception is org.springframework.beans.FatalBeanException:
Class [org.springframework.beans.factory.xml.UtilNamespaceHandler] for namespace
[http://www.springframework.org/schema/util] does not implement the [org.springframework.beans.factory.xml.NamespaceHandler] interface
at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)
at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)
at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:76)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:219)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseDefaultElement(DefaultBeanDefinitionDocumentReader.java:148)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:133)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:93)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
at org.springframework.beans.factory.xml.XmlBeanFactory.<init>(XmlBeanFactory.java:73)
at org.springframework.beans.factory.xml.XmlBeanFactory.<init>(XmlBeanFactory.java:61)
at net.sf.jasperreports.extensions.SpringExtensionsRegistryFactory.getBeanFactory(SpringExtensionsRegistryFactory.java:101)
However, the PDF is generated without any problem.
Plus, the next time I try to generate one PDF, no more errors. This only occurs on the first generation.
What is a reason? And how I can avoid this error?

OK Problem Solved.
I included jasperreports-chart-themes-4.7.0.jar in my classpath. However, this jar wasn't used anymore. I only used the default themes from jasper.
Deleting this jar from .ear and everything works fine.
Thanks anyway

Related

ClassPathXmlApplicationContext return FileNotFoundException exception when try to open beans xml file

i'v got an error exception :
INFOS: Loading XML bean definitions from class path resource [ma/openbook/www/beans/perons.xml]
Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [ma/openbook/www/beans/perons.xml]; nested exception is java.io.FileNotFoundException: class path resource [ma/openbook/www/beans/perons.xml] cannot be opened because it does not exist
i did not understand wath should i do to resolve this issue, i though that's the code is correct
could someone help me please. i will be thankful
http://i.stack.imgur.com/d78ZK.jpg
Maven, by default, does not move non-.java files from /src/main/java into the target build. Instead move your persons.xml resource to /src/main/resource, in the appropriate package.
Also, you seem to have a typo: perons.xml vs persons.xml.

Why do I get this `TypeMismatchException` with Spring

I'm trying to use Hibernate with Spring in Eclipse. I get the following error when I try to run the welcome file on the server:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mySessionFactory' defined in ServletContext resource [/WEB-INF/dispatcher-servlet.xml]:
Initialization of bean failed; nested exception is
org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.util.ArrayList' to required type 'java.lang.Class[]' for property 'annotatedClasses';
nested exception is java.lang.IllegalArgumentException: Cannot find class [com.vaannila.domain.User]
The class com.vaannila.domain.User is in the Java Resources:src folder of the project in eclipse. Why isn't it being located?
From time to time Eclipse is a bit picky about deploying a project correctly. It seems that it has to do with the installed plugins. When this happens to me in the 'Servers'-view of the 'Debug'-Perspective i click the 'add and remove' menu and remove my project from deployment - save it - add it again and redeploy. Usually this does the trick.
Another try is to start Eclipse with the -clean option.

Why isn't eclipse compiling my web app?

When I start my Tomcat server, linked to my Java EE project, I get the error listed below. Two other people are using the same repository with Eclipse/Tomcat/Java and are not having any problems. It creates my package hierarchy, but the classes are missing. Tomcat develops my WEB-INF/classes/com folders, but the contents are all empty. Can anyone help me with this? Thank you.
SEVERE: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping#0' defined in ServletContext resource [/WEB-INF/LightStanza-servlet.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.lightfoundryllc.lightstanza.login.LoginValidator] for bean with name 'loginValidator' defined in ServletContext resource [/WEB-INF/LightStanza-servlet.xml]; nested exception is java.lang.ClassNotFoundException: com.lightfoundryllc.lightstanza.login.LoginValidator
thanks for your help. I set my environment variables for TOMCAT_HOME and PATH and things seem to be working now :).

iReport, error during spring loaded hibernate connection in netbeans plugin

i try to use iReport with an hibernate connection loaded using spring xml config file.
So, in netbeans wizard, i choose new datasource and i select "spring loaded Hibernate collection".
I set my xml spring file, but when i click test i have this exception:
org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [META-INF/spring.cfg.xml]; nested exception is org.springframework.beans.FatalBeanException: NamespaceHandler class [org.springframework.context.config.ContextNamespaceHandler] for namespace [http://www.springframework.org/schema/context] not found; nested exception is java.lang.ClassNotFoundException: org.springframework.context.config.ContextNamespaceHandler
The spring xml is ok beacouse al works great in application, the problem is when i try to use it for iRepor in netbeans plugin.
Documentation about jasper report using hibernate and spring are very very slightly.
EDIT
I added all spring-dependance jar in Tools->Options->iReport->classpath (i'm refering to netbeans, this is totaly undocumented...) and finally seem to load context, but now i have this excpetions:
WARNING [org.netbeans.ProxyClassLoader]: Will not load class org.springframework.beans.factory.xml.NamespaceHandlerSupport arbitrarily from one of ModuleCL#10eaeda[com.jaspersoft.ireport] and ModuleCL#19e3bdd[org.netbeans.libs.springframework] starting from SystemClassLoader[569 modules]; see http://wiki.netbeans.org/DevFaqModuleCCE
WARNING [org.netbeans.ProxyClassLoader]: Will not load class org.springframework.beans.factory.xml.NamespaceHandler arbitrarily from one of ModuleCL#10eaeda[com.jaspersoft.ireport] and ModuleCL#19e3bdd[org.netbeans.libs.springframework] starting from SystemClassLoader[569 modules]; see http://wiki.netbeans.org/DevFaqModuleCCE
org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [META-INF/spring.cfg.xml]; nested exception is org.springframework.beans.FatalBeanException: Class [org.springframework.context.config.ContextNamespaceHandler] for namespace [http://www.springframework.org/schema/context] does not implement the [org.springframework.beans.factory.xml.NamespaceHandler] interface
I think this is a problem of the netbeans plugin only and i can do anything :(
Thanks.
Installing iReport standalone app all work good, so is a problem of iReport plugin in netbeans.

FileNotFoundException, although the XML file should be deployed

I've got problems starting my WAR application on a local JBoss. After two other EARs are deployed and the TomcatDeployer begins deploying the WAR, I'm getting the following error message:
2010-04-28 10:01:56,605 ERROR [org.jboss.ejb.plugins.LogInterceptor] [] [main] EJBException in method: public abstract [return type] methode throws javax.ejb.CreateException,java.rmi.RemoteException, causedBy:
javax.ejb.EJBException: org.springframework.beans.factory.access.BootstrapException: Unable to initialize group definition. Group resource name [classpath*:context.xml], factory key [contextService]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'service' defined in URL [jar:file:/C:/jboss-4.2.3.GA/server/default/deploy/frontend.war/WEB-INF/lib/modules.jar!/aontext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.context.support.ClassPathXmlApplicationContext]: Constructor threw exception; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [package/context.xml]; nested exception is java.io.FileNotFoundException: class path resource [package/context.xml] cannot be opened because it does not exist
But package/context.xml actually is placed inside a JAR in one of my EAR files which should be deployed before the WAR. And at least I get a message that the deployment of the EAR has been successful. I also looked into the JAR with my file archiver and the context.xml is indeed there at the right place.
Is there a way for me to get sure that the JAR, not the EAR as a whole, is really deployed to the JBoss? I'm already starting to lose my head about this issue.
Thank you.
Bernhard
Could be a classloader issue. You can check whether your JAR and its contents are loaded properly by configuring a logger for classloading events, as described here (example 3.8).
The log also gives you information about which classloader loaded what - this might explain why your web app (loaded by its own loader) does not see stuff within the EAR.
Another thing: is the JAR containing the XML file included in the classpath of the WAR?
I have deployed my war in another deploy directory called "deploy.last" in the JBoss directory, since it has to be -- as the name suggests -- deployed at last.
Now I've changed my JBoss configuration and put the war in the higher-ranking deploy directory (where the two EARs are too) and everything is working fine now. The war is still deployed at last.
I don't have an idea why this worked, but it worked. :D

Categories