Move to a Hibernate version compatible with Jahira. When running with
Java 8 an exception was caused when initializing the session factory.
java.lang.NoSuchMethodError: org.hibernate.engine.jdbc.spi.JdbcServices.getConnectionProvider()Lorg/hibernate/engine/jdbc/connections/spi/ConnectionProvider;
at org.jadira.usertype.spi.shared.AbstractUserTypeHibernateIntegrator.use42Api(AbstractUserTypeHibernateIntegrator.java:80)
Now Libreplan can be run on Java8.
This implied some changes:
* Latest versions of hibernate use the Bean Validation API. This
implied renaming the imports and use ConstraintViolationException
instead of InvalidValue. Besides some constraints had to be renamed,
otherwise they wouldn't be recognized by Hibernate validation. In
the new version of Hibernate validator @AssertTrue can only be
applied to properties. So all methods it was applied to must follow
the is.* format.
Automatic execution of Bean Validation API is disabled, otherwise an
infinite loop would happen. This is because there are some
validation constraints that do launch queries to the database. This
causes a flush of the objects in the session and automatic
validation is called again.
* A new library for persisting JodaTime is necessary since
joda-time-hibernate is incompatible with hibernate 4. This library
can automatically register its types for Date conversion so they're
removed from configuration.
* Now, in some places, an InvalidDataAccessApiUsageException is thrown
instead of a DataIntegrityViolationException.
This is because no constraint is violated, the API is being used
incorrectly because a transient instance is being provided where a
persisted one was expected.
* In hibernate 4 listeners cannot be configured via properties.
HibernateDatabaseModificationsListener registers itself in its @PostConstruct method.
* ehcache classes used are now different.
The manually introduced budget cell will be representing the total
amount for the budget on that item, and the expenses cell will
show the difference between that total and the resources costs
for the task hours and required criteria.
FEA: ItEr77S17AutomaticBudgeting
The budget cell will represent the total available budget, and the calculated
read-only total, will be the result of substracting the consumed budget due
to the hours and cost categories of the assinged task criteria.
FEA: ItEr77S17AutomaticBudgeting
FEA: ItEr77S17AutomaticBudgeting
Several components were using Criteria collections not initialized on the
planning state, so when adding dinamically new CriterionRequirements
or HourGroups the group hours were not attached.
Some test cases in DerivedAllocationGeneratorTest were failing during
a mvn install. It might not happen in all systems since it depends
on the order the tests are executed. It's also failing if run
individually.
The problem is that ScenarioBootstrap must be executed before
executing these tests. When distributing the resources, the
DayAssignments of the resource for the current scenario are queried.
An IScenarioManager must have been registered in Registry plus the
main scenario initialized.
The stack trace is:
java.lang.IllegalStateException: loadRequiredData should have been called on org.libreplan.business.scenar
ios.bootstrap.ScenariosBootstrap
at org.libreplan.business.scenarios.bootstrap.ScenariosBootstrap.getMain(ScenariosBootstrap.java:81)
...
at com.sun.proxy.$Proxy42.getMain(Unknown Source)
at org.libreplan.business.scenarios.OnlyMainScenarioAwareManager.getCurrent(OnlyMainScenarioAwareManager.java:38)
at org.libreplan.business.resources.entities.Resource$UsingScenarioManager.calculateAssignments(Resource.java:185)
at org.libreplan.business.resources.entities.Resource$DayAssignmentsState.getAssignments(Resource.java:172)
at org.libreplan.business.resources.entities.Resource.getAssignments(Resource.java:886)
at org.libreplan.business.resources.entities.Resource.getAssignmentsForDay(Resource.java:153)
at org.libreplan.business.resources.entities.Resource.getAssignedDurationDiscounting(Resource.java:861)
at org.libreplan.business.planner.entities.AssignedEffortForResource$AssignedEffortDiscounting.getAssignedDurationAt(AssignedEff
ortForResource.java:169)
at org.libreplan.business.planner.entities.EffortDistributor$ResourceWithDerivedData.withAvailableCapacityOn(EffortDistributor.j
ava:232)
at org.libreplan.business.planner.entities.EffortDistributor.resourcesFromMoreDesirableToLess(EffortDistributor.java:408)
at org.libreplan.business.planner.entities.EffortDistributor.assignAllPossibleWithoutOvertime(EffortDistributor.java:387)
at org.libreplan.business.planner.entities.EffortDistributor.distributeForDay_(EffortDistributor.java:356)
at org.libreplan.business.planner.entities.EffortDistributor.distributeForDay(EffortDistributor.java:341)
at org.libreplan.business.planner.entities.DerivedAllocationGenerator.createAssignments(DerivedAllocationGenerator.java:114)
at org.libreplan.business.planner.entities.DerivedAllocationGenerator.generate(DerivedAllocationGenerator.java:68)
at org.libreplan.business.test.planner.entities.DerivedAllocationGeneratorTest.forOneResourceTheHoursGeneratedAreGotFromAlpha(De
rivedAllocationGeneratorTest.java:205)
There was some issue regarding connector_properties columns
names that was causing that the bootstraps launched an SQL
exception when deploying over MySQL.
FEA: ItEr77S04BugFixing
When the user had restricted access to the company view, and the list
of specific projects that he could read is empty, an HibernateQueryException
was being raised.
FEA: ItEr77S04BugFixing
When deploying again after having imported projects, the calendar bootstrap was wrongly trying to save
a repeated calendar exception day.
FEA: ItEr77S05BasicProjectImport