shopizer-ecommerce / shopizer

Shopizer java e-commerce software
http://www.shopizer.com
Apache License 2.0
3.57k stars 3k forks source link

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'shippingPriceRule': Cannot resolve reference to bean 'shippingPriceDecisionBase' #158

Open paulParis opened 7 years ago

paulParis commented 7 years ago

I try to run shopizer on tomcat but I got these erros: The error seems problem with drools rules :

1-Jun-2017 15:07:32.947 SEVERE [localhost-startStop-1] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start:

org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/sm-shop-2.0.5-SNAPSHOT]] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:153) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:940) at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1816) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'orderActionsControler': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.salesmanager.core.business.services.order.OrderService com.salesmanager.shop.admin.controller.orders.OrderActionsControler.orderService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'orderService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.salesmanager.core.business.services.shipping.ShippingService com.salesmanager.core.business.services.order.OrderServiceImpl.shippingService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'shippingService': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'shippingModules': Cannot resolve reference to bean 'customShippingPriceModule' while setting bean property 'sourceMap' with key [TypedStringValue: value [customQuotesRules], target type [class java.lang.String]]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'customShippingPriceModule' defined in class path resource [spring/shopizer-core-rules.xml]: Cannot resolve reference to bean 'shippingPriceRule' while setting bean property 'shippingPriceRule'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'shippingPriceRule': Cannot resolve reference to bean 'shippingPriceDecisionBase' while setting bean property 'kbase'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'shippingPriceDecisionBase': Invocation of init method failed; nested exception is java.lang.RuntimeException: [43,55]: [ERR 101] Line 43:55 no viable alternative at input '' > [52,55]: [ERR 101] Line 52:55 no viable alternative at input '' [61,55]: [ERR 101] Line 61:55 no viable alternative at input '' [43,56]: [ERR 101] Line 43:56 no viable alternative at input '100' in rule "Shipping quote_15" [52,56]: [ERR 101] Line 52:56 no viable alternative at input '100' in rule "Shipping quote_16" [61,56]: [ERR 101] Line 61:56 no viable alternative at input '100' in rule "Shipping quote_17" [0,0]: Parser returned a null Package

paulParis commented 7 years ago

No body to help or gives idea about this issue please?

ghost commented 7 years ago

Are you deploying it on Tomcat or running it on Embedded Tomcat?

paulParis commented 7 years ago

Yes I am deploying it on Tomcat not in Embbed one

paulParis commented 7 years ago

Some conflits with tomcat Jars? It seems drools rules problems.. Cannot load or read stuff from excel files?

ghost commented 7 years ago

Are you able to run it with embedded tomcat?

On Mon, Jun 26, 2017 at 1:01 AM, paulParis notifications@github.com wrote:

Some conflits with tomcat Jars?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/shopizer-ecommerce/shopizer/issues/158#issuecomment-310989992, or mute the thread https://github.com/notifications/unsubscribe-auth/ABfekNwoOiktOgXXKt2fP-d4OmKSQ27_ks5sH2VqgaJpZM4OA9JX .

-- With Regards Umesh Awasthi http://www.travellingrants.com/

paulParis commented 7 years ago

No it doesnt run

league55 commented 7 years ago

same for me

ghost commented 7 years ago

@league55 @paulParis Can you upgrade JRE and provide your feedback? I tested it on 8.0_131 and it seems to be working for me. Will try to look in to it based on your feedback

league55 commented 7 years ago

Apache Maven 3.3.9 Maven home: /usr/share/maven Java version: 1.8.0_131, vendor: Oracle Corporation Java home: /usr/lib/jvm/java-8-oracle/jre Default locale: ru_UA, platform encoding: UTF-8 OS name: "linux", version: "4.10.0-28-generic", arch: "amd64", family: "unix"

I have pretty clean ubuntu 17 system, only elasticsearch engin is runnung

ghost commented 7 years ago

@league55 even with 1.8.0_131, you are facing same issue?

league55 commented 7 years ago

yes Now trying to build older version, 2.0.4

ghost commented 7 years ago

@league55 Couple of other question

  1. are you trying to deploy it on standalone tomcat?
  2. Did you tried to use embedded tomcat provided with 2.0.5?
league55 commented 7 years ago

starting via ShopApplication.class, mvn spring-boot:run gives the same

league55 commented 7 years ago

I see the code, you did greate work, and app is pretty big now, didn't you think about dockerizing app? It's very handy during development and for newbies like me to set up env...

ghost commented 7 years ago

@league55 This is in plan and help is always welcome :), it seems to be issue with the shipping API but it's working for me. Let me to check it in more details

denesskoumal commented 7 years ago

Hi Guys, I face the exact same issue as league55. Do you have any update on the resolution? @umeshawasthi maybe?

loamDeLest commented 7 years ago

Same issue here (Win 7 / JDK1.8 / Maven 3.5)... I also tried on a VM (Running Redhat 7.3 / OpenJDK1.8 / Maven 3.5) same issue. BUT on another machine (Win 10 / JDK1.8 / Maven 3.5) I ran the project (mvn spring-boot:run in /sm-shop) without any problem... So ???

paulParis commented 7 years ago

Any solution for this problem ? I use JRE 1.8.074, tomcat 8.0.33

@umeshawasthi what is your conf?

paulParis commented 7 years ago

I will use an other solution for my e-commerce. The techno of this project are up a date, but it doesnt work so ...

paulParis commented 7 years ago

spring-boot run shows the same errors, drools files are wrong or what else?

loamDeLest commented 7 years ago

Dear all I found a solution posted here after: https://groups.google.com/forum/#!topic/shopizer/xs8M3KrZLVw

So it says: Open the files:

  1. sm-core/src/main/resources/rules/shipping-custom-rules.xls
  2. sm-core/src/main/resources/rules/shipping-decision-rules.xls

In the file 1 (shipping-custom-rules.xls) delete the symbol "$" in the cell C9, D9, E9,F9, G9.

In the file 2 (shipping-decision-rules.xls) delete the symbol "$" in the cell C9, D9, E9,F9.

then on the main project /shopizer do a mvn clean install and in /shopizer/sm-shop do a mvn spring-boot:run

It worked for me

Best Mohamed

paulParis commented 7 years ago

Big shoooookrane Mohamed, I am going to try this solution it works.

loamDeLest commented 7 years ago

You're welcome PaulParis.

@umeshawasthi : I noticed several other problems in the 2.0.5. Can I send you the points I noticed (to be fixed...) ?

Best Mohamed

paulParis commented 7 years ago

@umeshawasthi Hello, Do you have any idea why it doesnt work? I just deleted $ from xls files as mentionned by Mohamed. Now, it works...

shopizer-ecommerce commented 7 years ago

This as i see seems to have to do with JBOSS drools decision tables implemented as XLS files. Looks like for some reason it has difficulty parsing xls files that are located in sm-core\src\main\resources\rules

@loamDeLest proposed a solution that removes $ in front of input parameter which prevent the error but will break the decision tables if you decide to use them since the dynamic parameters will be replaced with static value, see if that is of interest JBOSS drools page on xls decision table input parameters https://docs.jboss.org/drools/release/5.2.0.Final/drools-expert-docs/html/ch06.html

1) If you just don't want to use them, remove spring includes in xml

Open sm-core\src\main\resources\spring\shopizer-core-modules.xml

Comment customQuotesRules

    <util:map id="shippingModules" map-class="java.util.HashMap" key-type="java.lang.String" value-type="com.salesmanager.core.business.modules.integration.shipping.model.ShippingQuoteModule">
                <beans:entry key="canadapost" value-ref="canadapost"/>
                <beans:entry key="usps" value-ref="usps"/>
                <beans:entry key="ups" value-ref="ups"/>
                <beans:entry key="weightBased" value-ref="weightBased"/>
                <beans:entry key="priceByDistance" value-ref="priceByDistance"/>
                <beans:entry key="storePickUp" value-ref="storePickUp"/>
                <!--<beans:entry key="customQuotesRules" value-ref="customShippingPriceModule"/>-->
                       <!--as defined in shopizer-core-rules-->
    </util:map>

and sm-core\src\main\resources\spring\processors\shopizer-core-shipping-processors.xml

Comment

<ref bean="shippingMethodDecisionProcess"/>

2) Can someone who has those failures can replace those <= or >= statements with > <

For instance weight >= $1, weight <= $2 becomes weight > $1, weight < $2

in both xls files ?

paulParis commented 7 years ago

Hello, thank you. I will read the doc to fix this error.

loamDeLest commented 7 years ago

Hi I did the test for the second proposal ("2. Can someone who has those failures can replace those <= or >= statements with > <")

==> Errors are the same

Best regards Mohamed

shopizer-ecommerce commented 7 years ago

@loamDeLest Thanks for your time on that

I will try to figure out another way of doing it. It's strange that it works for most of the users except for a few ones. In the meantime the options are your's or to comment out rules declaration from spring files as all suggested in this thread

paulParis commented 7 years ago

It depends on plateforme? I doent think. It works for you? Why $1 in xsl file generates exception? Very strange..

paulParis commented 7 years ago

@shopizer-ecommerce what is your conf? JVM, OS and tomcat Server? Maybe conflit with native jars?

forestyura commented 6 years ago

@shopizer-ecommerce I have the same problem. How to fix this error?

paulParis commented 6 years ago

I switched to prestashop, I cannot do business with sophizer with lot of bugs ...

jazzyjay79 commented 6 years ago

Has anyone sorted this issue out yet?

shopizer-ecommerce commented 6 years ago

Open shipping-custom-rules.xls in xls

Remove lines 15, 15, 17 & 18 from csv file

save

rebuild

run