我刚刚完成配置hybris并尝试设置eclipse项目。根据wiki.hybris中的指南,我将所有扩展都导入到eclipse项目中。当我尝试构建和清理时,我得到超过3000个编译器错误。其中一个错误是AbstractTrackingEvent类无法解析为某个类型。我在项目文件夹中查找了特定的类。我找不到 de.hybris.eventtracking.model 下的事件文件夹,这就是问题的原因。
我在导入项目时遗漏了什么?我的eclipse项目中有很多这样的问题。请让我知道如何解决它。我附上了截图供参考。
注意:我使用的是hybris-commerce-suite 5.7.0.8
根据要求,我正在添加源代码。
package de.hybris.eventtracking.services.populators;
import de.hybris.eventtracking.model.events.AbstractTrackingEvent;
import de.hybris.eventtracking.services.constants.TrackingEventJsonFields;
import de.hybris.platform.servicelayer.dto.converter.ConversionException;
import java.io.IOException;
import java.util.Map;
import org.apache.commons.lang.StringUtils;
import com.fasterxml.jackson.databind.ObjectMapper;
/**
* @author stevo.slavic
*
*/
public abstract class AbstractTrackingEventGenericPopulator implements
GenericPopulator<Map<String, Object>, AbstractTrackingEvent>
{
private final ObjectMapper mapper;
public AbstractTrackingEventGenericPopulator(final ObjectMapper mapper)
{
this.mapper = mapper;
}
public ObjectMapper getMapper()
{
return mapper;
}
protected Map<String, Object> getPageScopedCvar(final Map<String, Object> trackingEventData)
{
final String cvar = (String) trackingEventData.get(TrackingEventJsonFields.COMMON_CVAR_PAGE.getKey());
Map<String, Object> customVariablesPageScoped = null;
if (StringUtils.isNotBlank(cvar))
{
try
{
customVariablesPageScoped = getMapper().readValue(cvar, Map.class);
}
catch (final IOException e)
{
throw new ConversionException("Error extracting custom page scoped variables from: " + cvar, e);
}
}
return customVariablesPageScoped;
}
}