使用阔叶树商业版本5.2.2-GA。我已经使用spring实现了自定义搜索功能。
看到这个问题:
[org.broadleafcommerce.cms.url.domain.URLHandlerImpl]
are managed classes within the MergePersistenceUnitManager
but were not detected as being transformed by the EntityMarkerClassTransformer. There can be multiple causes for this:
1. Session persistence is enabled in your servlet container (like Tomcat) and an entity object has been loaded by the container before being loaded by the application's classloader. Ensure that session persistence is disabled; in Tomcat ensure that a <Manager pathname="" /> element exists in your context.xml.
2. You are inadvertently using class scanning to find a ServletContainerInitializer class, and your servlet container is loading all classes before transformers have been registered. If you are using a web.xml, ensure that there is an <absolute-ordering /> element somewhere in that file. If you are not using a web.xml and are using Spring Boot, then you likely need to add one. See https://www.broadleafcommerce.com/docs/core/5.2/broadleaf-concepts/key-aspects-and-configuration/app-server-configuration/tomcat for the example web.xml
3. The classes are being used as apart of an @Bean method or in some other runtime capacity that is initialized prior to persistence manager startup我可以通过以下两种方法来避免这一错误:
<pluginManagement>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration combine.self="override">
</configuration>
</plugin>
</plugins>
</pluginManagement> <dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-solr</artifactId>
</dependency>我很高兴暂时删除工具,尽管这会导致审计功能出现问题。例如,当试图保存BLC有机实体(如StaticAssetImpl)时,由于没有spring工具,我看到如下情况:
java.lang.NullPointerException: null
at org.broadleafcommerce.common.audit.AbstractAuditableListener.setAuditData(AbstractAuditableListener.java:88)理想情况下,从长期来看,我希望能够安全地包含spring依赖项。注意:我可以安全地使用spring causing和spring jpa,看起来spring solr完全是造成问题的原因。我尝试了spring solr 3.0.5,3.0.8(最新)和2.0.9。
同时,一直在寻找禁用审核的方法,似乎找不到任何文档。我已经尝试过覆盖实体来删除@EntityListener,试图重写AdminAuditableListener,尝试寻找一个会禁用它的属性,但到目前为止还没有成功。
感谢任何短期解决办法来禁用审计、仅禁用特定实体的审核,或者可能是一些我没有尝试过使spring solr兼容的工具。
谢谢
发布于 2018-07-28 23:44:31
您所遇到的关于UrlHandlerImpl的错误在Broadleve5.2.3-GA中得到了解决,参见https://github.com/broadleafcommerce/issues/issues/5。最新的阔叶树版本实际上是5.2.6-GA。
Spring可能不小心(扫描或其他什么)添加了一些内容,但通常这部分不应该是一个问题。
https://stackoverflow.com/questions/50905992
复制相似问题