You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Brent Verner <db...@netavail.com> on 2009/10/20 15:46:54 UTC
Re: Configuring the Jetty Runtime - specifying port via Spring
property placeholders
Hi,
If you're loading the configuration yourself, you can subclass the
appropriate ApplicationContext to disable validation...
public class NonValidatingClassPathXmlApplicationContext
extends ClassPathXmlApplicationContext {
public NonValidatingClassPathXmlApplicationContext(String conf) {
super(conf);
}
protected void initBeanDefinitionReader( XmlBeanDefinitionReader
beanDefinitionReader) {
super.initBeanDefinitionReader(beanDefinitionReader);
beanDefinitionReader.setValidationMode(XmlBeanDefinitionReader.VALIDATION_NONE);
beanDefinitionReader.setNamespaceAware(true);
}
}
hth.
Brent
On Tue, Oct 20, 2009 at 8:41 AM, szczepiq <sz...@gmail.com> wrote:
> Hi,
>
> Following the wiki entry:
> http://cwiki.apache.org/CXF20DOC/jetty-configuration.html
>
> There is any example:
>
> <httpj:engine-factory bus="cxf">
> ...
> <httpj:engine port="9001">
> ...
>
> How can I make the engine *port* configurable via Spring property placeholders?
>
> I tried following:
>
> <httpj:engine port="${service.port}">
>
> However, it doesn't work. I can understand why it doesn't work:
> httpj:engine is a schema extension, not a typical bean wiring stuff
> where property placeholders work out of the box.
>
> The question is how can I make it working so that I can configure the
> port via a property?
>
> Thanks!
> Szczepan
>
Re: Configuring the Jetty Runtime - specifying port via Spring
property placeholders
Posted by Brent Verner <db...@netavail.com>.
Oh, sorry about that... Here's what I have in my spring configuration.
AFAIK, the resolution of placeholders all happens within Spring and
cxf just uses the configured beans.
spring config snippet:
...
<bean id="agent-placeholderConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="ignoreResourceNotFound" value="true"/>
<property name="localOverride" value="true" />
<property name="locations">
<list>
<value>classpath:META-INF/serviceManagerAgent.properties</value>
<value>classpath:serviceManagerAgent-local.properties</value>
</list>
</property>
</bean>
...
<httpj:engine port="${sma.servicePort}">
<httpj:tlsServerParametersRef id="secure" />
<httpj:threadingParameters
minThreads="${sma.minThreads}"
maxThreads="${sma.maxThreads}"
/>
<httpj:sessionSupport>true</httpj:sessionSupport>
</httpj:engine>
properties file:
...
sma.servicePort: 19001
sma.minThreads: 5
sma.maxThreads: 25
cheers!
b
On Tue, Oct 20, 2009 at 10:01 AM, szczepiq <sz...@gmail.com> wrote:
> Thanks for the hint.
>
> Although I'm not sure how this problem is related to validation. In my
> case ${service.port} is simply not resolved - there are no XML/bean
> validation errors.
>
> Cheers,
> Szczepan
>
> On Tue, Oct 20, 2009 at 3:46 PM, Brent Verner <db...@netavail.com> wrote:
>> Hi,
>>
>> If you're loading the configuration yourself, you can subclass the
>> appropriate ApplicationContext to disable validation...
>>
>> public class NonValidatingClassPathXmlApplicationContext
>> extends ClassPathXmlApplicationContext {
>> public NonValidatingClassPathXmlApplicationContext(String conf) {
>> super(conf);
>> }
>> protected void initBeanDefinitionReader( XmlBeanDefinitionReader
>> beanDefinitionReader) {
>> super.initBeanDefinitionReader(beanDefinitionReader);
>> beanDefinitionReader.setValidationMode(XmlBeanDefinitionReader.VALIDATION_NONE);
>> beanDefinitionReader.setNamespaceAware(true);
>> }
>> }
>>
>>
>> hth.
>> Brent
>>
>> On Tue, Oct 20, 2009 at 8:41 AM, szczepiq <sz...@gmail.com> wrote:
>>> Hi,
>>>
>>> Following the wiki entry:
>>> http://cwiki.apache.org/CXF20DOC/jetty-configuration.html
>>>
>>> There is any example:
>>>
>>> <httpj:engine-factory bus="cxf">
>>> ...
>>> <httpj:engine port="9001">
>>> ...
>>>
>>> How can I make the engine *port* configurable via Spring property placeholders?
>>>
>>> I tried following:
>>>
>>> <httpj:engine port="${service.port}">
>>>
>>> However, it doesn't work. I can understand why it doesn't work:
>>> httpj:engine is a schema extension, not a typical bean wiring stuff
>>> where property placeholders work out of the box.
>>>
>>> The question is how can I make it working so that I can configure the
>>> port via a property?
>>>
>>> Thanks!
>>> Szczepan
>>>
>>
>
Re: Configuring the Jetty Runtime - specifying port via Spring
property placeholders
Posted by szczepiq <sz...@gmail.com>.
Thanks for the hint.
Although I'm not sure how this problem is related to validation. In my
case ${service.port} is simply not resolved - there are no XML/bean
validation errors.
Cheers,
Szczepan
On Tue, Oct 20, 2009 at 3:46 PM, Brent Verner <db...@netavail.com> wrote:
> Hi,
>
> If you're loading the configuration yourself, you can subclass the
> appropriate ApplicationContext to disable validation...
>
> public class NonValidatingClassPathXmlApplicationContext
> extends ClassPathXmlApplicationContext {
> public NonValidatingClassPathXmlApplicationContext(String conf) {
> super(conf);
> }
> protected void initBeanDefinitionReader( XmlBeanDefinitionReader
> beanDefinitionReader) {
> super.initBeanDefinitionReader(beanDefinitionReader);
> beanDefinitionReader.setValidationMode(XmlBeanDefinitionReader.VALIDATION_NONE);
> beanDefinitionReader.setNamespaceAware(true);
> }
> }
>
>
> hth.
> Brent
>
> On Tue, Oct 20, 2009 at 8:41 AM, szczepiq <sz...@gmail.com> wrote:
>> Hi,
>>
>> Following the wiki entry:
>> http://cwiki.apache.org/CXF20DOC/jetty-configuration.html
>>
>> There is any example:
>>
>> <httpj:engine-factory bus="cxf">
>> ...
>> <httpj:engine port="9001">
>> ...
>>
>> How can I make the engine *port* configurable via Spring property placeholders?
>>
>> I tried following:
>>
>> <httpj:engine port="${service.port}">
>>
>> However, it doesn't work. I can understand why it doesn't work:
>> httpj:engine is a schema extension, not a typical bean wiring stuff
>> where property placeholders work out of the box.
>>
>> The question is how can I make it working so that I can configure the
>> port via a property?
>>
>> Thanks!
>> Szczepan
>>
>