on 07-02-2015 12:02 PM
Dear hybris experts,
in “Trail ~ Testing the DAO” from “hybris 5 Devloper Training Trails – Part I –Core” I get the below error, if I try to perform the steps in segment “Run the test – Attempt 3” :
ERROR [main] (junit) [LogRunListener] Test method stadiumDAOTest(de.hybris.platform.cuppytrail.daos.impl.DefaultStadiumDAOIntegrationTest) failed!!
java.lang.NoSuchFieldError: TRACE
at org.jboss.logging.Log4jLogger.translate(Log4jLogger.java:60)
at org.jboss.logging.Log4jLogger.isEnabled(Log4jLogger.java:35)
at org.jboss.logging.Logger.isTraceEnabled(Logger.java:98)
at org.hibernate.validator.internal.util.logging.Log_$logger.isTraceEnabled(Log_$logger.java:156)
at org.hibernate.validator.internal.metadata.aggregated.BeanMetaDataImpl.getValidDefaultGroupSequence(BeanMetaDataImpl.java:387)
at org.hibernate.validator.internal.metadata.aggregated.BeanMetaDataImpl.setDefaultGroupSequence(BeanMetaDataImpl.java:363)
at org.hibernate.validator.internal.metadata.aggregated.BeanMetaDataImpl.setDefaultGroupSequenceOrProvider(BeanMetaDataImpl.java:313)
The error occurred if modelService object try to save the stadiumModel object in stadiumDAOtest() methode.
How can I fix it?
Regards
Tools in use:
JDK 1.8.0_45-b15
hybris-commerce-suite-5.5.1.1
Spring Tool Suite 3.6.4
log4j-1.2.17 in build path
Shal I wait for an answer?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
1 package de.hybris.platform.cuppytrail.daos.impl;
2
3 import static org.junit.Assert.assertEquals;
4 import static org.junit.Assert.assertTrue;
5 import de.hybris.platform.cuppytrail.daos.StadiumDAO;
6 import de.hybris.platform.cuppytrail.model.StadiumModel;
7 import de.hybris.platform.servicelayer.ServicelayerTransactionalTest;
8 import de.hybris.platform.servicelayer.model.ModelService;
9 import java.util.List;
10 import javax.annotation.Resource;
11 import org.junit.Test;
12
13 public class DefaultStadiumDAOIntegrationTest extends ServicelayerTransactionalTest
14 {
15 @Resource
16 private StadiumDAO stadiumDAO;
17
18 @Resource
19 private ModelService modelService;
20
21 private static final String STADIUM_NAME = "wembley";
22
23 private static final Integer STADIUM_CAPACITY = Integer.valueOf(12345);
24
25 @Test
26 public void stadiumDAOTest()
27 {
28 List<StadiumModel> stadiumsByCode = stadiumDAO.findStadiumsByCode(STADIUM_NAME);
29 assertTrue("No Stadium should be returned", stadiumsByCode.isEmpty());
30
31 List<StadiumModel> allStadiums = stadiumDAO.findStadiums();
32 final int size = allStadiums.size();
33
34 final StadiumModel stadiumModel = new StadiumModel();
35 stadiumModel.setCode(STADIUM_NAME);
36 stadiumModel.setCapacity(STADIUM_CAPACITY);
37 modelService.save(stadiumModel);
38
39 allStadiums = stadiumDAO.findStadiums();
40 assertEquals(size + 1, allStadiums.size());
41 assertEquals("Unexpected stadium found", stadiumModel, allStadiums.get(allStadiums.size() - 1));
42
43 stadiumsByCode = stadiumDAO.findStadiumsByCode(STADIUM_NAME);
44 assertEquals("Did not find the Stadium we just saved", 1, stadiumsByCode.size());
45 assertEquals("Retrieved Stadium's name attribute incorrect", STADIUM_NAME, stadiumsByCode.get(0).getCode());
46 assertEquals("Retrieved Stadium's capacity attribute incorrect", STADIUM_CAPACITY, stadiumsByCode.get(0).getCapacity());
47 }
48
49 }
The error occurred on line 37
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Could you share your code? so we can help more.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My code is the exact same code like “Trail ~ Testing the DAO”
User | Count |
---|---|
7 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.