Page 1 of 1

custom credit card module was not picked up

Posted: Thu Mar 24, 2011 11:23 pm
by TTLee
I am able to run the demoappwtp based on ... ipse+-+WTP

Then I try to customize the payment workflow by following ... figuration

I created two java class:
my own credit module com.rrhui.payment.service.module.CreditCardModule.
my own payment service com.rrhui.payment.service.PaymentServiceImpl

I also created my own. /WEB-INF/applicationContext-custom-payment.xml,

<bean id="blCreditCardService" class="com.rrhui.payment.service.PaymentServiceImpl">
<property name="paymentModule" ref="myCreditCardModule"/>

<bean id="myCreditCardModule" class="com.rrhui.payment.service.module.CreditCardModule">
<property name="param1" value="value1"/>


and add it to the web.xml as


Then, I restart the eclipse-tomcat server, and I go through the shopping-checkout flow from http://localhost:8081/broadleafdemo.

My runtime parameter is as
-Xmx512m -XX:MaxPermSize=512M
-Dcatalina.base="D:\MyWork\RRuriProject\broadleaf\.metadata\.plugins\org.eclipse.wst.server.core\tmp0" -Dcatalina.home="D:\ProgramFiles\apache-tomcat-6.0.32" -Dwtp.deploy="D:\MyWork\RRuriProject\broadleaf\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps" -Djava.endorsed.dirs="D:\ProgramFiles\apache-tomcat-6.0.32\endorsed"

the java class was compiled under D:\MyWork\RRuriProject\broadleaf\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps.

However, my credit card module was not picked up at all.

I notice the payment workflow was launched by the checkout workflow, but it should still use my new creditcard module, right?

Did I missing any steps.

Re: custom credit card module was not picked up

Posted: Mon Mar 28, 2011 3:34 pm
by jefffischer
Thanks for your question. The first thing to check is the merged application context that Spring is seeing to make sure that your custom bean definitions are actually making it through. There is a file in the WEB-INF directory of the demo. Change the property from WARN to DEBUG. Now, when you start your server, you should see a lot of additional output to the console. Most of this will be the merged application context. Search through this output and make sure your new, custom bean definitions are making it. If not, then confirm that your changed web.xml is actually making it to your target build that Tomcat is running on.

Re: custom credit card module was not picked up

Posted: Mon Mar 28, 2011 6:14 pm
by TTLee
Thank you for the info.

But i can not find the at src\site\BroadleafCommerceDemo.

instead it is at src\core\BroadleafCommerceProfile\src\main\resources\.

or should I create myself ?

Re: custom credit card module was not picked up

Posted: Thu Mar 31, 2011 6:20 am
by jefffischer
Sorry - sometimes I get confused between version 1.5 and 1.1. The best answer is to create the files yourself inside the WEB-INF directory. Then, you'll need to add the following to your web.xml (put this right before your MergeContextLoaderListener declaration):

Code: Select all

<!-- enable configured logging -->


Here's an example of what you could put in that file to achieve this goal:

Code: Select all

log4j.appender.stdout.layout.ConversionPattern=[%5p] %d{HH:mm:ss} %c{1} - %m%n

log4j.rootLogger=WARN, stdout