[jboss-jira] [JBoss JIRA] (JBFORUMS-308) spring bean setter is not working in jboss. Injected bean is getting null while invoking
Pavan Sharma (JIRA)
issues at jboss.org
Tue Sep 15 08:03:00 EDT 2015
[ https://issues.jboss.org/browse/JBFORUMS-308?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13108639#comment-13108639 ]
Pavan Sharma commented on JBFORUMS-308:
---------------------------------------
Does any one has any clue?
> spring bean setter is not working in jboss. Injected bean is getting null while invoking
> ----------------------------------------------------------------------------------------
>
> Key: JBFORUMS-308
> URL: https://issues.jboss.org/browse/JBFORUMS-308
> Project: JBoss Forums
> Issue Type: Bug
> Components: Integration
> Reporter: Pavan Sharma
> Assignee: Luca Stancapiano
>
> I am getting one class instance while not for other in same class and defined in same config.xml file. This is working fine when deployed on webSphere & Tomcat but creating issue on Jboss EAP 6.3.
> 1. I have one auth.xml config file that contains below
> <bean id="loginController" class="com.abc.mvc.controller.auth.LoginController"
> parent="abcAbstractCommandController">
> <property name="spAuthOperation" ref="spAuthOperation" />
> <property name="commandName" value="loginCommand" />
> <property name="commandClass"
> value="com.abc.mvc.command.auth.LoginCommand" />
> <property name="validator" ref="loginValidator" />
> <property name="otpAuthJSONBldr" ref="otpAuthJSONBldr" />
> </bean>
> <bean id="otpAuthJSONBldr"
> class="com.abc.json.builder.auth.OTPAuthJSONBldr"
> parent="comJSONBuilder" />
> 2. LoginController.java; In this class i have injected one operation and one jsonBldr that is defined in auth.xml config file.
> public class LoginController extends AbstractCommandController {
> SPAuthOperation spAuthOperation;
>
> private ABCJSONBuilder otpAuthJSONBldr;
>
> public SPAuthOperation getspAuthOperation() {
> return spAuthOperation;
> }
> public void setspAuthOperation(SPAuthOperation spAuthOperation) {
> this.spAuthOperation = spAuthOperation
> }
> public ABCJSONBuilder getOtpAuthJSONBldr() {
> return otpAuthJSONBldr;
> }
> public void setOtpAuthJSONBldr(ABCJSONBuilder otpAuthJSONBldr1) {
> this.otpAuthJSONBldr = otpAuthJSONBldr1;
> }
> }
> now when i am trying to invoke logincontroller thru my application then getting spAuthOperation class instance but not otpAuthJSONBldr. this is strange thing.
> Below is the Jboss trace log where also getting 'otpJsonBldr' instance created on server startup but then not getting at runtime and application invocation..
> 2015-09-14 12:38:17,656 [ServerService Thread Pool -- 59] TRACE - Found bean property 'otpAuthJSONBldr' of type [com.abc.json.builder.auth.ABCJSONBuilder]
> {color:red}Creating shared instance of singleton bean 'otpAuthJSONBldr'{color}
> 2015-09-14 12:38:21,833 [ServerService Thread Pool -- 59] DEBUG - Creating instance of bean 'otpAuthJSONBldr'
> 2015-09-14 12:38:21,834 [ServerService Thread Pool -- 59] DEBUG - Eagerly caching bean 'otpAuthJSONBldr' to allow for resolving potential circular references
> 2015-09-14 12:38:21,835 [ServerService Thread Pool -- 59] TRACE - Getting BeanInfo for class [com.abc.json.builder.auth.otpAuthJSONBldr]
> 2015-09-14 12:38:21,837 [ServerService Thread Pool -- 59] TRACE - Caching PropertyDescriptors for class [com.abc.json.builder.authotpAuthJSONBldr]
> -----
> Creating implicit proxy for bean 'otpAuthJSONBldr' with 1 common interceptors and 0 specific interceptors
> 2015-09-14 12:38:21,863 [ServerService Thread Pool -- 59] DEBUG - Creating CGLIB2 proxy:{color:red} target source is SingletonTargetSource for target object [com.abc.json.builder.auth.otpAuthJSONBldr at 10b53e6]{color}
> 2015-09-14 12:38:21,863 [ServerService Thread Pool -- 59] DEBUG - Unable to apply any optimisations to advised method: protected com.abc.json.builder.auth.ABCPayloadHeader com.abc.json.builder.authotpAuthJSONBldr.createHeader(com.abc.json.builder.auth.context.ResponseContext)
> 2015-09-14 12:38:21,864 [ServerService Thread Pool -- 59] DEBUG - Unable to apply any optimisations to advised method: public java.lang.Object com.abc.json.builder.auth.otpAuthJSONBldr.createJSONResponse(com.abc.json.builder.auth.context.ResponseContext)
> 2015-09-14 12:38:21,864 [ServerService Thread Pool -- 59] DEBUG - Unable to apply any optimisations to advised method: protected void com.abc.json.builder.auth.otpAuthJSONBldr.populatePayLoad
> 2015-09-14 12:38:21,882 [ServerService Thread Pool -- 59] DEBUG -{color:red} Finished creating instance of bean 'otpAuthJSONBldr'{color}
> Need input on urgent basis.....
> Thanks In advance
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
More information about the jboss-jira
mailing list