我正在更新 hybris/SAP-Commerce (2005) 的旧公司实习生扩展。它是使用 API 的扩展。
我不知道这个扩展有多少年了。
但是,在将其应用于 java 11 时,我发现了这样的问题(Java 11: import javax.xml.ws.WebFault: "Cannot resolve symbol ws")。
重新运行命令 ./hybrisserver.sh 后,给定的(只读)“.jar”文件会引发以下异常:
Failed to instantiate [<class from given .jar>]:
Constructor threw exception;
nested exception is java.lang.IllegalAccessError:
class com.sun.org.apache.xml.internal.resolver.Catalog (in unnamed module @0x9a92113) cannot access class jdk.xml.internal.JdkXmlUtils (in module java.xml) because module java.xml does not export jdk.xml.internal to unnamed module @0x9a92113
Run Code Online (Sandbox Code Playgroud)
我认为可能是jdk的问题,所以尝试了不同的发行版。(我正在使用 sdkman 开发 Manjaro Linux KDE 20.1)遵循我测试过的发行版:
Vendor | Version | Dist | Identifier
--------------------------------------------------------
AdoptOpenJDK | 11.0.8.j9 | …Run Code Online (Sandbox Code Playgroud) 我们正在使用 Hybris v5.7,我已经向项目添加了一个插件。我想渲染一些 CMS 组件,我发现有两种方法可以填充渲染组件的模型对象:创建 DefaultAddOnCMSComponentRenderer 或 AbstractCMSAddOnComponentController 的子类并将其注册为 bean。哪种方法更好?也许这些方法之一已经过时了?
@Controller
@RequestMapping("/view/MarketingNotificationFormComponentController")
public class MarketingNotificationFormComponentController extends AbstractCMSAddOnComponentController<MarketingNotificationFormComponentModel> {
@Override
protected void fillModel(HttpServletRequest request, Model model, MarketingNotificationFormComponentModel component) {
//populate model here
}
}
Run Code Online (Sandbox Code Playgroud)
或者
public class MarketingNotificationFormComponentRenderer extends DefaultAddOnCMSComponentRenderer<MarketingNotificationFormComponentModel> {
@Override
protected Map<String, Object> getVariablesToExpose(PageContext pageContext, MarketingNotificationFormComponentModel component) {
Map<String, Object> variables = new HashMap<String, Object>();
// populate model here
return variables;
}
}
Run Code Online (Sandbox Code Playgroud) 试图覆盖spring bean使用覆盖Alias。
我想超越骑行roundCurrency的方法commonI18NService
开箱即用定义
<alias alias="commonI18NService" name="defaultCommonI18NService"/>
<bean id="defaultCommonI18NService" class="de.hybris.platform.servicelayer.i18n.impl.DefaultCommonI18NService" parent="abstractBusinessService">
<property name="languageDao" ref="languageDao"/>
<property name="currencyDao" ref="currencyDao"/>
<property name="countryDao" ref="countryDao"/>
<property name="regionDao" ref="regionDao"/>
<property name="conversionStrategy" ref="conversionStrategy"/>
</bean>
Run Code Online (Sandbox Code Playgroud)
我们的自定义代码:-
public class DefaultCustomCommonI18NService extends DefaultCommonI18NService
{
@Override
public double roundCurrency(double value, int digits)
{
// custom logic
return value;
}
}
Run Code Online (Sandbox Code Playgroud)
注入自定义 bean :-
<alias alias="commonI18NService" name="defaultCustomCommonI18NService"/>
<bean id="defaultCustomCommonI18NService" class="com.extended.service.impl.DefaultCustomCommonI18NService" parent="defaultCommonI18NService"/>
Run Code Online (Sandbox Code Playgroud)
但它在服务器启动时抛出异常
INFO [localhost-startStop-1] [HybrisContextFactory] Loading <<application>> spring config <master> from extension (saporderexchangeb2b) located in …Run Code Online (Sandbox Code Playgroud) 最近,我们已将 Hybris 5.4 迁移到 Hybris 6.5,但从那时起它就生成了现有的 PK(我们正在使用具有一些记录的同一数据库)。
在开发环境中,我们有:
但现在我们担心在生产中也会遇到同样的问题,我们无法采取这种解决方法。
我们怎样做才能让 Hybris 考虑到旧的 PK?
我有一个 Hybris 项目,我们通过 swagger + swagger-ui 提供一个宁静的 API。我们遇到日期时间属性和参数的格式问题。显示格式如下:“2018-06-22T08:00:19.130Z”。
但是,我们使用并需要在 swagger-ui 提供的示例中显示的格式是“2018-06-22T08:00:19Z”。
参数是 DTO 由 spring 自动生成的。
关于如何更改示例的日期时间格式有什么想法吗?
谢谢,克里斯
我正在尝试在 Hybris 1811 上进行平台更新。在中间,由于以下错误,它被终止。我尝试再次构建并重新启动服务器,但我不断收到相同的错误。有人遇到过这样的问题吗?
INFO: Illegal access: this web application instance has been stopped already. Could not load [java.util.concurrent.locks.Lock]. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.
java.lang.IllegalStateException: Illegal access: this web application instance has been stopped already. Could not load [java.util.concurrent.locks.Lock]. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access. …Run Code Online (Sandbox Code Playgroud) 我正在尝试从 DAO 层触发灵活搜索查询。我的查询是这样的:
SELECT {loyaltypoints},{redeemedloyaltypoints}
FROM {LoyaltyUser}
WHERE {uid} =?uid
Run Code Online (Sandbox Code Playgroud)
向我抛出未知的类型代码,但我的类型代码是正确的。我看到堆栈跟踪消息就像
SEVERE: Servlet.service() for servlet [DispatcherServlet] in context with path [/store]
threw exception [Request processing failed; nested exception is java.lang.IllegalArgumentException:
invalid pks [10] - unknown typecode 0] with root cause
java.lang.IllegalArgumentException: invalid pks [10] - unknown typecode 0
at de.hybris.platform.core.WrapperFactory.getCachedItems(WrapperFactory.java:304)
at de.hybris.platform.core.LazyLoadItemList.loadPage(LazyLoadItemList.java:230)
at de.hybris.platform.servicelayer.search.impl.LazyLoadModelList.loadPage(LazyLoadModelList.java)"
Run Code Online (Sandbox Code Playgroud)
我的items.xml样子:
<itemtype code="LoyaltyUser" extends="Customer" autocreate="true" generate="true"
jaloclass="de.hybris.merchandise.core.jalo.LoyaltyUser">
<deployment table="LoyaltyUsers" typecode="10010"/>
<attributes>
<attribute generate="true" autocreate="true" qualifier="loyaltypoints" type="java.lang.Integer" >
<description>Loyalty points given for each purchase</description>
<modifiers …Run Code Online (Sandbox Code Playgroud) 每次我们向 items.xml 添加新属性时,我们都必须执行 hybris 更新,否则我们会收到一些错误,例如:JaloItemNotFoundException: no attribute Cart.newAttribute
但是,有时执行更新后,我们不会得到 JaloItemNotFoundException,而是得到类似以下内容的信息:
de.hybris.platform.servicelayer.exceptions.AttributeNotSupportedException: cannot find attribute newAttribute
Run Code Online (Sandbox Code Playgroud)
对于第二种情况,如果我们在更新后重新启动服务器,它总是有效的。更新后除了重启服务器还有其他办法解决吗?
几年前,我在一家公司工作,该公司在更新后添加了重新启动作为“部署步骤”。我在这里试图避免这种情况。
我尝试执行几次更新并清理类型缓存。但没有运气。
有谁知道如何在产品列表页面上显示的 Facet 导航中添加其他属性?到目前为止我只能选择价格范围,但我想添加品牌和其他过滤器,你知道如何通过 hMC 维护它吗?我认为这与 solr 配置有关,但我对 hybris 相当陌生......
完成ant all. ./hybrisserver.sh后我所做的那一刻(在平台文件夹中)
或者我做. ./hybrisserver.sh debug
我收到以下错误,我应该如何解决这个问题。该设置早些时候就可以工作,我用一个配方对其进行了初始化。如果我在安装程序文件夹中给出./install.sh -r b2c_acc_plus start ,效果很好
. ./hybrisserver.sh
dirname: illegal option -- b
usage: dirname path
-bash: cd: /tomcat/bin: No such file or directory
Run Code Online (Sandbox Code Playgroud) java ×5
spring ×2
tomcat ×2
backoffice ×1
catalina ×1
java-11 ×1
server ×1
springfox ×1
swagger ×1
swagger-ui ×1