I tried to upgrade POI/POI-OOXML version from 3.12 to 3.15, but even then was not able to get past this.
Also, donĀ“t know if its related to the current issue, but may be a clue.
If I try to run a report using the reportingUI interface, the error details will show the following error instead:
@icrc.thonorio what are the full details of your environment? War version, all modules and versions, java version, operating system?
It looks to me like maybe something in your environment is causing a different XML parser or different set of POI libraries from getting loaded than expected.
The reporting module hasnāt been updated to have any build profiles against the 2.3.x, 2.4.x, or 2.5.x lines of OpenMRS core yet (unfortunately). It would be great if someone had the bandwidth to add these profiles into the reporting module and then corresponding build plans into Bamboo as is done with the 1.9-2.2 version we are currently building and testing against. This would help identify this kind of problem sooner.
The key part here is the Could not initialize class which is different from a plain NoClassDefFoundError. NoClassDefFoundError means that a valid class couldnāt be found and is raised either when the class isnāt present on the classpath or, as in this case, when thereās an exception thrown when trying to initialize the class (in which case the classloader canāt load the class definition).
Unfortunately, without the full log itās hard to tell more than that. Thereās likely to be a āCaused byā entry later in the stack trace you provided a snippet of that might have more detail on what happened.
If I had to make a guess this looks like a commit that mightāve broken things (assuming 1.21.0 works). (The reasoning here is that adding a module to the aware of list makes thatās moduleās classpath part of the existing moduleās classpath, so itās entirely possible that after that change, itās loading some other class from itās changed classpath than it was using before).
I did create 2 new profiles (for 2.3 and 2.4), however the api-test seems to throw a lot of ERRORS.
Because of that, I needed to Update the file TestingApplicationContext (can be seen bellow) and add a new ReportTestDataset-openmrs-āVERSIONā.xml file.
This solved the great majority of the Errors but 7 of them still stand.
All seem to be related with āEvaluationException: Failed to evaluate Error evaluating because: nullā
One of the failing tests:
public void evaluate_shouldReturnAllOrdersForAVisit() throws Exception {
VisitEvaluationContext context = new VisitEvaluationContext();
context.setBaseVisits(new VisitIdSet(1));
OrderForVisitDataDefinition d = new OrderForVisitDataDefinition();
EvaluatedVisitData vd = Context.getService(VisitDataService.class).evaluate(d, context);
Assert.assertEquals(expectedOrders.intValue(), ((List) vd.getData().get(1)).size());
}
@icrc.thonorio - I also get errors while trying to build with your 2.4 profile, but thatās not surprising to me. I do get different errors than you were describing - mine appear to be related to Mockito version changes.
I am trying to implement anti-csrf strategies to make OMRS more secure. Below is a PR of what i have done in core.
My ambition is to create a csrf token from core, which can also be accessed in the referenceapplication-module on the login page, to verify that the request is coming from an authorised source.
I think what i added in core works, but the reference application was using an earlier version on openmrs so i decided to update it to the version having my security configurations, 2.5-SNAPSHOT
This also raised the need to change the version of some modules to the latest release.
@jnsereko - these errors can be annoying to track down. What Iām seeing in your error log is this:
[jar:file:/home/joshua/.m2/repository/org/openmrs/module/appframework-api/2.16.0/appframework-api-2.16.0-tests.jar!/TestingApplicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.MappingException: An association from the table allergy_reaction refers to an unmapped class: org.openmrs.Allergy
Caused by: org.hibernate.MappingException: An association from the table allergy_reaction refers to an unmapped class: org.openmrs.Allergy
This tells me that it isnāt the referenceapplication moduleās TestingApplicationContext.xml file that is at issue still, but rather the one in a dependency - specifically in the appframework module. It is likely that this module has not yet been upgraded to support building against OpenMRS core 2.5. See here:
Hello @mseaton
I have added the packagesToScan property to the appframework and changed its version in the reference-application-module to 2.17.0-SNAPSHOT, so that this change is accessed.
However, i am having an error
Caused by: org.hibernate.cache.CacheException:
net.sf.ehcache.CacheException: Another CacheManager with same name 'hibernateCache' already exists in the same VM. Please provide unique names for each CacheManager in the config or do one of the following:
1. Use one of the CacheManager.create() static factory methods to reuse same CacheManager with same name or create one if necessary
2. Shutdown the earlier cacheManager before creating new one with same name.
The source of the existing CacheManager is: DefaultConfigurationSource [ ehcache.xml or ehcache-failsafe.xml ]
Caused by: net.sf.ehcache.CacheException:
Attempt two; tried adding the ehcache.xml file and the ehcache-api.xml to the TestingApplicationContext.xml like;
.......
<!-- default properties must be set in the hibernate.default.properties -->
</bean>
<bean id="hibernateCache" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean" scope="singleton">
<property name="shared" value="true"/>
<property name="configLocation">
<value>classpath:ehcache.xml</value>
</property>
</bean>
............