axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Barry Hathaway <bhath...@nycap.rr.com>
Subject Re: Spring property injection failing in Tomcat
Date Sat, 10 Sep 2011 19:27:35 GMT
After taking Robert's suggesting of RTFM rather than just following the 
examples,
I realized the my ServiceObjectSupplier in services.xml might be 
incorrect. I changed it
and nothing changed. I am still not able to have Spring grab my 
sadlServer.kbaseRoot
parameter out of Tomcat's context.xml and inject it into my bean.

My services.xml is:

<serviceGroup>
<service name="SadlServiceSpringInit" 
class="com.ge.research.sadl.sadlserver.axis.provider.SpringInit">
<description>
       This web service initializes Spring.
</description>
<parameter name="ServiceClass" 
 >com.ge.research.sadl.sadlserver.axis.provider.SpringInit</parameter>
<parameter name="ServiceTCCL" >composite</parameter>
<parameter name="load-on-startup" >true</parameter>
<operation name="springInit">
<messageReceiver 
class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
</operation>
</service>
<service name="SadlService" scope="soapsession">
<description>
       SadlService Spring POJO Axis2 AAR deployment
</description>
<parameter name="ServiceObjectSupplier" 
 >org.apache.axis2.extensions.spring.receivers.SpringServletContextObjectSupplier</parameter>
<parameter name="SpringBeanName" >sadlServiceProvider</parameter>
<messageReceivers>
<messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only"
                        
class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"/>
<messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out"
                        
class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
</messageReceivers>
</service>
</serviceGroup>

On 9/10/2011 7:11 AM, robert lazarski wrote:
> On Fri, Sep 9, 2011 at 6:36 PM, Barry Hathaway<bhathaw1@nycap.rr.com>  wrote:
>> I'm running Axis2 in a Tomcat container and would like to have Spring inject
>> some
>> properties specified in Tomcat's context.xml file into one of my Spring
>> beans.
>> As such, I have:
>>
>> <beans>
>> <bean id="applicationContext"
>>
>>   class="org.apache.axis2.extensions.spring.receivers.ApplicationContextHolder"
>> />
>>
>> <bean id="servletPropertyPlaceHolder"
>> class="org.springframework.web.context.support.ServletContextPropertyPlaceholderConfigurer">
>> <description>
>>             Resolves placeholders via Tomcat's context file for web app
>> </description>
>> <property name="searchContextAttributes" value="true"/>
>> </bean>
>>
>> <bean id="sadlServiceProvider"
>> class="com.ge.research.sadl.sadlserver.axis.provider.SadlServiceProvider">
>> <property name="kbaseRoot" value="${sadlServer.kbaseRoot}" />
>> </bean>
>> </beans>
>>
>> This is failing. It is as if the ServletContextPropertyPlaceholderConfigurer
>> bean is never getting called
>> and is falling back to the standard PropertyPlaceholderConfigurer bean. (By
>> the way, if I add the variable
>> to the Tomcat JVM options via -DsadlServer.kbaseRoot=xxx then it does work).
>>
>> Any ideas?
>> Thanks.
>>
>> Barry Hathaway
> I'm not sure what sadlServer.kbaseRoot is, must be a typo. But if that
> works for you, what's the problem? Are you using the axis2 spring
> guide?
>
> - R
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Mime
View raw message