首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用spring-data-solr与阔叶树商业有关的麻烦

使用spring-data-solr与阔叶树商业有关的麻烦
EN

Stack Overflow用户
提问于 2018-06-18 09:05:25
回答 1查看 197关注 0票数 0

使用阔叶树商业版本5.2.2-GA。我已经使用spring实现了自定义搜索功能。

看到这个问题:

代码语言:javascript
复制
[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

我可以通过以下两种方法来避免这一错误:

  1. 通过site/pu.xml重写spring maven-plugin配置删除Spring-toolent.jar:
代码语言:javascript
复制
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-maven-plugin</artifactId>
                    <configuration combine.self="override">
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
  1. 移除spring-data-solr依赖项(只是为了证明它会导致错误),即从core/头.xml中移除以下内容:
代码语言:javascript
复制
        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-solr</artifactId>
        </dependency>

我很高兴暂时删除工具,尽管这会导致审计功能出现问题。例如,当试图保存BLC有机实体(如StaticAssetImpl)时,由于没有spring工具,我看到如下情况:

代码语言:javascript
复制
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兼容的工具。

谢谢

EN

回答 1

Stack Overflow用户

发布于 2018-07-28 23:44:31

您所遇到的关于UrlHandlerImpl的错误在Broadleve5.2.3-GA中得到了解决,参见https://github.com/broadleafcommerce/issues/issues/5。最新的阔叶树版本实际上是5.2.6-GA。

Spring可能不小心(扫描或其他什么)添加了一些内容,但通常这部分不应该是一个问题。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50905992

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档