Problem extending reports-core for JasperReports - tomcat gets conflicting ConfigStorageMBean

Hi:

I am trying to extend the reports-core for JasperReports. I already have a subscription, so I can click the Reports box and load the modules. The problem is that, in order to get to the internals and add my overrides, I need to include the reports-core as a dependency in addition to clicking the reports box on the project properties. If I don’t click the reports box, then gradle can’t find the reports-core library.

However, if I DO click the reports box and include the reports-core as a dependency, then tomcat can’t start the application. I am adding reports-core to the app-global project as a dependency. Is this the correct place?

I get the following:


10:02:36.365 INFO  c.h.cuba.core.sys.AppComponents - Using app components: [com.haulmont.cuba, com.haulmont.reports]
10:02:36.370 INFO  c.h.cuba.web.sys.WebAppContextLoader - Loading app properties from classpath:cuba-web-app.properties
10:02:36.370 INFO  c.h.cuba.web.sys.WebAppContextLoader - Loading app properties from classpath:com/paslists/rade/web-app.properties
10:02:36.371 INFO  c.h.cuba.web.sys.WebAppContextLoader - Loading app properties from file:/home/eraskin/studio-projects/rade/build/tomcat/conf/app/local.app.properties
10:02:36.377 INFO  c.h.c.c.s.CubaClassPathXmlApplicationContext - Refreshing com.haulmont.cuba.core.sys.CubaClassPathXmlApplicationContext@37259111: startup date [Thu Mar 09 10:02:36 EST 2017]; root of context hierarchy
10:02:36.890 ERROR c.h.cuba.web.sys.WebAppContextLoader - Error initializing application
org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [cuba-web-spring.xml]; nested exception is org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name 'cuba_ConfigStorageMBean' for bean class [com.haulmont.cuba.web.jmx.ConfigStorage] conflicts with existing, non-compatible bean definition of same name and class [com.haulmont.cuba.core.jmx.ConfigStorage]

What am I doing wrong? How can I extend reports-core to add my new features?

Here’s an update for you. I tried moving my reporting code from app-global to app-core. I was able to remove the dependency on reports-core that way, but it did not solve this problem.

So, my problem may not be related to reporting at all…

I did try to convert it to single war format, but I turned that flag back off and have deleted the single-war-web.xml file.

An undeploy followed by a clean seems to have fixed the problem. I guess it was a combination of having tried to switch to single-war and putting my report code in the wrong module.

In any event, I can run the application now. Of course, I have NO idea if anything I wrote works yet! :slight_smile:

Posting all this here in case it helps anyone else…