[jira] Resolved: (CAMEL-1427) java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext

2009-03-18 Thread Charles Moulliard (JIRA)

 [ 
https://issues.apache.org/activemq/browse/CAMEL-1427?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Charles Moulliard resolved CAMEL-1427.
--

Resolution: Fixed

Hi,

I have been able to deploy successfully camel cxf:endpoint in ServiceMix 
engine. Both configuration (using the cxf:endpoint or uri=cxf:///) works except 
that I have to restart the SMX server in order to launch correctly the Camel 
CXF bundle after an update of the bundle.

To run it correctly, I have imported in my bundle MANIFEST file different 
packages. Here is the list. This could be helpfull for others :

{code}

META-INF.cxf,
META-INF.wsdl,
org.apache.commons.logging,
org.apache.camel,
org.apache.camel.component,

org.apache.camel.component.cxf,

org.apache.camel.component.cxf.converter,

org.apache.camel.component.jms,

org.apache.camel.dataformat.bindy,

org.apache.camel.dataformat.bindy.csv,

org.apache.camel.example.reportincident,

org.apache.camel.example.reportincident.model,

org.apache.camel.processor,

org.apache.activemq.camel.component;${activemq.osgi.version},

org.apache.activemq.camel.converter;${activemq.osgi.version},

org.apache.activemq.pool,
org.apache.cxf,
org.apache.cxf.binding,

org.apache.cxf.binding.corba,

org.apache.cxf.binding.soap,

org.apache.cxf.binding.soap.spring,
org.apache.cxf.bus,

org.apache.cxf.bus.resource,

org.apache.cxf.bus.spring,

org.apache.cxf.buslifecycle,
org.apache.cxf.catalog,

org.apache.cxf.configuration,

org.apache.cxf.configuration.spring,
org.apache.cxf.endpoint,
org.apache.cxf.headers,

org.apache.cxf.management,

org.apache.cxf.management.jmx,
org.apache.cxf.phase,
org.apache.cxf.resource,

org.apache.cxf.transport,

org.apache.cxf.transport.http,

org.apache.cxf.transport.http.policy,

org.apache.cxf.transport.http_jetty,

org.apache.cxf.transport.jms,

org.apache.cxf.transports.http,

org.apache.cxf.workqueue,
org.apache.cxf.wsdl,
org.apache.cxf.wsdl11,

org.springframework.beans.factory.config,
*

{code}

I will discuss this point with G. Nodet.

Here is an example of the config used :

{code}

http://www.springframework.org/schema/beans";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:camel="http://camel.apache.org/schema/spring";
xmlns:osgi="http://www.springframework.org/schema/osgi";
xmlns:cxf="http://camel.apache.org/schema/

Re: Camel 2.0 - About type converter degrade performance issue

2009-03-18 Thread William Tam
+1 on overloading methods.

On Wed, Mar 18, 2009 at 7:22 AM, Claus Ibsen  wrote:
> Hi
>
> Any thoughts on this one?
>
> It all boils down to a suggestion to add 1 methods to the
> org.apache.camel.Message API
>
> new method:
> - tryGetBody(Class type)
>
> or overload existing with a boolean to indicate ignore exception and return 
> null
> - getBody(Class, true)
>
> The same applies for the org.apache.camel.spi.TypeConverter interface
> as we need a method
> on the line as above
>
> new method:
> - tryConvertTo(Class type)
>
> or overload existing with a boolean to indicate ignore exception and return 
> null
> - convertTo(Class, true)
>
> The boolean thing is maybe a nice one as it have the same method name.
>
>
>
>
> On Mon, Mar 16, 2009 at 7:32 AM, Claus Ibsen  wrote:
>> Hi
>>
>> In Camel 1.6.0 and 2.0 we have had a performance issue that could
>> seriously degrade performance by x2-x10 when you did stress test by
>> sending > 1000 msg/sec.
>>
>> The cause of this is the TypeConverter that will throw a
>> NoSuchTypeConverterExists when Camel cannot converter to the desired
>> type.
>> We do this internally in Camel in some areas of the code where we will
>> ignore this exception and eg. continue.
>>
>> We did a fix for this performance issue in the stream cache but this
>> was just a fix in once place. Lately this issue surfaced again in
>> camel-mina when using UDP.
>>
>> So I have been experimenting with doing a fix once for all.
>>
>> I suggest to:
>> - add 2 new methods to TypeConverter that returns *null* instread of
>> throwing the NoSuchTypeConverterExists exception.
>>  I have named them: tryConvertTo. But maybe there is a better name?
>> - add 1 new method on Message to get the body using the try convert to 
>> instead.
>>  I have named the method: tryGetBody(T). But maybe there is a better name?
>> - Use tryGetBody internally in Camel where we today do try ..
>> catch(NoSuchTypeConverterExists)
>> - Then we can expose the regular getBody(T) for the end users, and let
>> it act as it does today by throwing the exception
>> - We can also optimize the DefaultTypeConverter to let it look in the
>> miss cache first if it have tried to convert this before but could not
>>
>> If the tryGetBody, tryConvertTo are you to your liking we can also do:
>> - add a new method to TypeConvert: boolean canConvertTo(T, value)
>> - add a new method to Message: boolean canGetBody(T, value)
>> - then use that method as guard before doing the regular convertTo/getBody
>>  But this requires that you always use this as guard, to be sure that
>> the NoSuchTypeConverterExists is not thrown
>>  And it also requires that we use the miss cache to not do 2x
>> convertions, 1 for the boolean check, and then 1 for the actual
>> convertion
>>  It also requires that the body can be converted multiple times.
>>
>> Whether solution 1 or 2 we also need to check the other components and
>> fix it internally as well, so we dont have a situation like mina with
>> UDP that was affected by the performance drawback.
>>
>> In my experiment I have the first solution up and running.
>>
>> Any thoughts?
>>
>> I will create a JIRA ticket for this one as well so we wont forget it.
>>
>>
>> --
>> Claus Ibsen
>> Apache Camel Committer
>>
>> Open Source Integration: http://fusesource.com
>> Blog: http://davsclaus.blogspot.com/
>>
>
>
>
> --
> Claus Ibsen
> Apache Camel Committer
>
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
>


Re: svn commit: r755502 - /camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSpringEndpoint.java

2009-03-18 Thread William Tam
Hi Willem,

Is it a good idea to import org.springframework packages from this
module?  I thought it could create class not found problem when Spring
isn't in user's classpath (CxfComponent references CxfSpringEndpoint).
  Should we merge fix to 1.x?

Cheers,
William

2009/3/18  :
> Author: ningjiang
> Date: Wed Mar 18 08:04:13 2009
> New Revision: 755502
>
> URL: http://svn.apache.org/viewvc?rev=755502&view=rev
> Log:
> CAMLE-1427 added the state check of the ApplicationContext state
>
> Modified:
>    
> camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSpringEndpoint.java
>
> Modified: 
> camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSpringEndpoint.java
> URL: 
> http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSpringEndpoint.java?rev=755502&r1=755501&r2=755502&view=diff
> ==
> --- 
> camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSpringEndpoint.java
>  (original)
> +++ 
> camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfSpringEndpoint.java
>  Wed Mar 18 08:04:13 2009
> @@ -19,6 +19,9 @@
>  import java.lang.reflect.Proxy;
>  import javax.xml.namespace.QName;
>
> +import org.springframework.context.ApplicationContext;
> +import org.springframework.context.support.AbstractApplicationContext;
> +
>  import org.apache.camel.CamelContext;
>  import org.apache.camel.component.cxf.spring.CxfEndpointBean;
>  import org.apache.camel.component.cxf.util.CxfEndpointUtils;
> @@ -60,8 +63,7 @@
>
>
>     private void init(CxfEndpointBean bean) throws Exception {
> -        this.bean = bean;
> -
> +        this.bean = bean;
>         // create configurer
>         configurer = new 
> ConfigurerImpl(((SpringCamelContext)getCamelContext())
>             .getApplicationContext());
> @@ -178,6 +180,13 @@
>     }
>
>     void configure(Object beanInstance) {
> +        // check the ApplicationContext states first , and call the refresh 
> if necessary
> +        if (((SpringCamelContext)getCamelContext()).getApplicationContext() 
> instanceof AbstractApplicationContext) {
> +            AbstractApplicationContext context = 
> (AbstractApplicationContext)((SpringCamelContext)getCamelContext()).getApplicationContext();
> +            if (!context.isActive()) {
> +                context.refresh();
> +            }
> +        }
>         configurer.configureBean(beanId, beanInstance);
>     }
>
>
>
>


[jira] Commented: (CAMEL-1427) java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext

2009-03-18 Thread Charles Moulliard (JIRA)

[ 
https://issues.apache.org/activemq/browse/CAMEL-1427?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=50636#action_50636
 ] 

Charles Moulliard commented on CAMEL-1427:
--

@Willem

In fact, we cannot use import 

{code}

 
 
{code}

because in this case in a OSGI server, the camel routes defined with the string 
url for the cxf endpoint does not work.

Temporary conclusion :

Top of SMX4, we cannot use import statements and we can't use the cxf:endpoint 
but only declare the uri like this :

{code}
http://localhost:8080/camel-example/incident? .
{code}

Remark : I will create a bundle of the reportincident example and deploy it in 
SMX to see if the error appears in OSGI


> java.lang.IllegalStateException: BeanFactory not initialized or already 
> closed - call 'refresh' before accessing beans via the ApplicationContext
> -
>
> Key: CAMEL-1427
> URL: https://issues.apache.org/activemq/browse/CAMEL-1427
> Project: Apache Camel
>  Issue Type: Bug
>  Components: camel-osgi
>Reporter: Charles Moulliard
>Assignee: Willem Jiang
>
> Hi,
> When I run the following spring DSL in SMX4
> 
> http://www.springframework.org/schema/beans";
>   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>   xmlns:camel="http://camel.apache.org/schema/spring";
>   xmlns:cxf="http://camel.apache.org/schema/cxf";
>   xsi:schemaLocation=" http://www.springframework.org/schema/beans
>   http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
>   http://camel.apache.org/schema/osgi
>   http://camel.apache.org/schema/osgi/camel-osgi.xsd
>   http://camel.apache.org/schema/spring
>   http://camel.apache.org/schema/spring/camel-spring.xsd
>   http://camel.apache.org/schema/cxf
>   http://camel.apache.org/schema/cxf/camel-cxf.xsd";>
>  
>
> class="org.apache.camel.dataformat.bindy.csv.BindyCsvDataFormat">
> value="org.apache.camel.example.reportincident.model" />
>   
>   
>class="org.apache.camel.example.reportincident.csv.CsvBean" />
>class="org.apache.camel.example.reportincident.OutputReportIncident">
>   
>   
>   http://camel.apache.org/schema/osgi";>
>   
> org.apache.camel.example.reportincident.routing
>   
>   
>   
>uri="file://d:/temp/data/?moveExpression=d:/temp/done/${file:name}" />
>   
>   
>   
>   
>   
>   
>uri="cxf://http://localhost:8080/camel-example/incident?serviceClass=org.apache.camel.example.reportincident.service.ReportIncidentEndpoint&wsdlURL=wsdl/report_incident.wsdl";
>  />
>type="org.apache.camel.example.reportincident.InputReportIncident" />
>   
>   
>   
>   
>   
>
>   
> 
> , I receive the following error :
> 15:48:59,209 | ERROR | xtenderThread-15 | OsgiBundleXmlApplicationContext  | 
> gatedExecutionApplicationContext  366 | Post refresh error
> java.lang.IllegalStateException: BeanFactory not initialized or already 
> closed - call 'refresh' before accessing beans via the ApplicationContext
>   at 
> org.springframework.context.support.AbstractRefreshableApplicationContext.getBeanFactory(AbstractRefreshableApplicationContext.java:153)
>   at 
> org.springframework.context.support.AbstractApplicationContext.containsBean(AbstractApplicationContext.java:892)
>   at 
> org.apache.cxf.configuration.spring.ConfigurerImpl.configureBean(ConfigurerImpl.java:141)
>   at 
> org.apache.cxf.configuration.spring.ConfigurerImpl.configureBean(ConfigurerImpl.java:111)
>   at 
> org.apache.cxf.transport.http.AbstractHTTPTransportFactory.configure(AbstractHTTPTransportFactory.java:229)
>   at 
> org.apache.cxf.transport.http.AbstractHTTPTransportFactory.configure(AbstractHTTPTransportFactory.java:224)
>   at 
> org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory.createDestination(JettyHTTPTransportFactory.java:121)
>   at 
> org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory.getDestination(JettyHTTPTransportFactory.java:103)
>   at 
> org.apache.cxf.endpoint.ServerImpl.initDestination(ServerImpl.java:90)
>   at org.apache.cxf.endpoint.ServerImpl.(ServerImpl.java:69)
>   at 
> org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:121)
>   at 
> org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:

[jira] Commented: (CAMEL-1459) TypeConverter - Avoid NoSuchTypeConverterException that can degrade performance

2009-03-18 Thread Claus Ibsen (JIRA)

[ 
https://issues.apache.org/activemq/browse/CAMEL-1459?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=50633#action_50633
 ] 

Claus Ibsen commented on CAMEL-1459:


Game plans is:
- Add getMandatoryBody(Class type) to {{org.apache.camel.Message}} that will 
thrown a NoTypeConvertException if not possible to convert.
- Existing getBody() will *not* throw the exception but return {{null}} if no 
convertions possible

- Add mandatoryConvertTo(Class type, Object value) to 
{{org.apache.camel.spil.TypeConverter}} that will thrown a 
NoTypeConvertException if not possible to convert.
- Existing convertBody() will *not* throw the exception but return {{null}} if 
no convertions possible

> TypeConverter - Avoid NoSuchTypeConverterException that can degrade 
> performance
> ---
>
> Key: CAMEL-1459
> URL: https://issues.apache.org/activemq/browse/CAMEL-1459
> Project: Apache Camel
>  Issue Type: Improvement
>Reporter: Claus Ibsen
>Assignee: Claus Ibsen
>Priority: Critical
> Fix For: 2.0.0
>
>
> See nabble:
> http://www.nabble.com/Camel-2.0---About-type-converter-degrade-performance-issue-td22532536s22882.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



Re: Camel 2.0 - About type converter degrade performance issue

2009-03-18 Thread Claus Ibsen
Hi

Any thoughts on this one?

It all boils down to a suggestion to add 1 methods to the
org.apache.camel.Message API

new method:
- tryGetBody(Class type)

or overload existing with a boolean to indicate ignore exception and return null
- getBody(Class, true)

The same applies for the org.apache.camel.spi.TypeConverter interface
as we need a method
on the line as above

new method:
- tryConvertTo(Class type)

or overload existing with a boolean to indicate ignore exception and return null
- convertTo(Class, true)

The boolean thing is maybe a nice one as it have the same method name.




On Mon, Mar 16, 2009 at 7:32 AM, Claus Ibsen  wrote:
> Hi
>
> In Camel 1.6.0 and 2.0 we have had a performance issue that could
> seriously degrade performance by x2-x10 when you did stress test by
> sending > 1000 msg/sec.
>
> The cause of this is the TypeConverter that will throw a
> NoSuchTypeConverterExists when Camel cannot converter to the desired
> type.
> We do this internally in Camel in some areas of the code where we will
> ignore this exception and eg. continue.
>
> We did a fix for this performance issue in the stream cache but this
> was just a fix in once place. Lately this issue surfaced again in
> camel-mina when using UDP.
>
> So I have been experimenting with doing a fix once for all.
>
> I suggest to:
> - add 2 new methods to TypeConverter that returns *null* instread of
> throwing the NoSuchTypeConverterExists exception.
>  I have named them: tryConvertTo. But maybe there is a better name?
> - add 1 new method on Message to get the body using the try convert to 
> instead.
>  I have named the method: tryGetBody(T). But maybe there is a better name?
> - Use tryGetBody internally in Camel where we today do try ..
> catch(NoSuchTypeConverterExists)
> - Then we can expose the regular getBody(T) for the end users, and let
> it act as it does today by throwing the exception
> - We can also optimize the DefaultTypeConverter to let it look in the
> miss cache first if it have tried to convert this before but could not
>
> If the tryGetBody, tryConvertTo are you to your liking we can also do:
> - add a new method to TypeConvert: boolean canConvertTo(T, value)
> - add a new method to Message: boolean canGetBody(T, value)
> - then use that method as guard before doing the regular convertTo/getBody
>  But this requires that you always use this as guard, to be sure that
> the NoSuchTypeConverterExists is not thrown
>  And it also requires that we use the miss cache to not do 2x
> convertions, 1 for the boolean check, and then 1 for the actual
> convertion
>  It also requires that the body can be converted multiple times.
>
> Whether solution 1 or 2 we also need to check the other components and
> fix it internally as well, so we dont have a situation like mina with
> UDP that was affected by the performance drawback.
>
> In my experiment I have the first solution up and running.
>
> Any thoughts?
>
> I will create a JIRA ticket for this one as well so we wont forget it.
>
>
> --
> Claus Ibsen
> Apache Camel Committer
>
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/


[jira] Commented: (CAMEL-1465) Added a Spring configuration in the camel-example-reportincident

2009-03-18 Thread Charles Moulliard (JIRA)

[ 
https://issues.apache.org/activemq/browse/CAMEL-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=50631#action_50631
 ] 

Charles Moulliard commented on CAMEL-1465:
--

@Willem,

There are two camel-config.xml files in the resources directory. 

This one must be removed : 
C:\Workspace\apache-camel-source\examples\camel-example-reportincident\src\main\resources\camel-config.xml

> Added a Spring configuration in the camel-example-reportincident
> 
>
> Key: CAMEL-1465
> URL: https://issues.apache.org/activemq/browse/CAMEL-1465
> Project: Apache Camel
>  Issue Type: Improvement
>Affects Versions: 2.0.0
>Reporter: Willem Jiang
>Assignee: Willem Jiang
>Priority: Minor
> Fix For: 2.0.0
>
>
> We should provide the Spring configuration which equals to the Java DSL route 
> rule in camel-example-reportincident, as some user prefer to use Spring.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Commented: (CAMEL-1427) java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext

2009-03-18 Thread Charles Moulliard (JIRA)

[ 
https://issues.apache.org/activemq/browse/CAMEL-1427?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=50629#action_50629
 ] 

Charles Moulliard commented on CAMEL-1427:
--

@Willem,

Error still there :

START LEVEL 100
   ID   State Spring Level  Name
[   0] [Active ] [   ] [0] System Bundle (1.5.0.r752991)
[   1] [Active ] [   ] [   10] Apache ServiceMix Specs :: JAXP API 1.4 
(1.3.0.SNAPSHOT)
[   2] [Active ] [   ] [   10] Apache Felix Prefrences Service (1.0.2)
[   3] [Active ] [   ] [   10] geronimo-annotation_1.0_spec (1.1.1)
[   4] [Active ] [   ] [   10] OSGi R4 Compendium Bundle (4.1.0)
[   5] [Active ] [   ] [   10] Apache ServiceMix Bundles: jaxp-ri-1.4.2 
(1.4.2.1)
[   6] [Active ] [   ] [   10] Apache Felix Configuration Admin Service 
(1.0.4)
[   7] [Active ] [   ] [   10] geronimo-servlet_2.5_spec (1.1.2)
[   8] [Active ] [Started] [   40] Apache ServiceMix Kernel :: GShell Core 
(1.1.0.SNAPSHOT)
[   9] [Active ] [   ] [8] OPS4J Pax Logging - API (1.3.0)
[  10] [Active ] [   ] [8] OPS4J Pax Logging - Service (1.3.0)
[  11] [Active ] [   ] [5] OPS4J Pax Url - wrap: (0.3.3)
[  12] [Active ] [   ] [5] OPS4J Pax Url - mvn: (0.3.3)
[  13] [Active ] [   ] [   30] Apache ServiceMix Kernel :: JAAS Modules 
(1.1.0.SNAPSHOT)
[  14] [Active ] [   ] [   30] Apache ServiceMix Kernel :: GShell 
Features (1.1.0.SNAPSHOT)
[  15] [Active ] [   ] [   30] Apache ServiceMix Kernel :: GShell Admin 
(1.1.0.SNAPSHOT)
[  16] [Active ] [   ] [   30] Apache ServiceMix Bundles: mina-1.1.7 
(1.1.7.1)
[  17] [Active ] [   ] [   30] spring-osgi-extender (1.2.0.rc1)
[  18] [Active ] [   ] [   30] Apache ServiceMix Kernel :: GShell 
PackageAdmin Commands (1.1.0.SNAPSHOT)
[  19] [Active ] [   ] [   30] Apache ServiceMix Kernel :: GShell 
ConfigAdmin Commands (1.1.0.SNAPSHOT)
[  20] [Active ] [Started] [   30] Apache ServiceMix Kernel :: GShell OSGi 
Commands (1.1.0.SNAPSHOT)
[  21] [Active ] [   ] [   30] Spring Context (2.5.6)
[  22] [Active ] [   ] [   30] Apache ServiceMix Bundles: 
commons-jexl-1.1 (1.1.0.1)
[  23] [Active ] [Started] [   30] Apache ServiceMix Kernel :: JAAS Config 
(1.1.0.SNAPSHOT)
[  24] [Active ] [   ] [   30] Apache ServiceMix Bundles: 
commons-httpclient-3.1 (3.1.0.1)
[  25] [Active ] [   ] [   30] Spring Core (2.5.6)
[  26] [Active ] [   ] [   30] jmx-impl (1.0.0.r6125-patched)
[  27] [Active ] [   ] [   30] spring-osgi-io (1.2.0.rc1)
[  28] [Active ] [   ] [   30] jmx (1.0.0.r6125-patched)
[  29] [Active ] [Started] [   30] Apache ServiceMix Kernel :: GShell Log 
Commands (1.1.0.SNAPSHOT)
[  30] [Active ] [   ] [   30] spring-osgi-core (1.2.0.rc1)
[  31] [Active ] [   ] [   30] Apache ServiceMix Bundles: 
commons-vfs-1.0 (1.0.0.1)
[  32] [Active ] [   ] [   30] Spring Beans (2.5.6)
[  33] [Active ] [   ] [   30] Unnamed - 
com.google.code.sshd:sshd:bundle:0.1 (0.1)
[  34] [Active ] [Started] [   30] Apache ServiceMix Kernel :: Management 
(1.1.0.SNAPSHOT)
[  35] [Active ] [   ] [   30] Apache ServiceMix Bundles: 
commons-codec-1.2 (1.2.0.1)
[  36] [Active ] [   ] [   30] Apache ServiceMix Bundles: cglib-2.1_3 
(2.1.0.3_1)
[  37] [Active ] [   ] [   30] Apache ServiceMix Bundles: jline-0.9.94 
(0.9.94.1)
[  38] [Active ] [   ] [   30] Apache ServiceMix Bundles: 
aopalliance-1.0 (1.0.0.1)
[  39] [Active ] [   ] [   30] Spring AOP (2.5.6)
[  40] [Active ] [Started] [   30] Apache ServiceMix Kernel :: Spring 
Deployer (1.1.0.SNAPSHOT)
[  41] [Active ] [   ] [   30] Apache ServiceMix Bundles: oro-2.0.8 
(2.0.8.1)
[  42] [Active ] [   ] [   15] Apache ServiceMix Kernel :: File Monitor 
(1.1.0.SNAPSHOT)
[  43] [Active ] [   ] [   60] Apache ServiceMix Bundles: 
jaxb-impl-2.1.6 (2.1.6.1)
[  44] [Active ] [   ] [   60] Apache ServiceMix Specs :: JAXB API 2.1 
(1.2.0)
[  45] [Active ] [   ] [   60] Apache ServiceMix Specs :: ACTIVATION 
API 1.4 (1.2.0)
[  46] [Active ] [   ] [   60] ObjectWeb ASM (2.2.3)
[  47] [Active ] [   ] [   60] Commons Collections (3.2.1)
[  48] [Active ] [   ] [   60] Commons Lang (2.4)
[  49] [Active ] [   ] [   60] Apache Commons Pool Bundle (1.4)
[  50] [Active ] [   ] [   60] geronimo-jta_1.1_spec (1.1.1)
[  51] [Active ] [   ] [   60] geronimo-j2ee-connector_1.5_spec (2.0.0)
[  52] [Active ] [   ] [   60] Apache ServiceMix Bundles: howl-1.0.1-1 
(1.0.1.1_1)
[  53] [Active ] [   ] [   60] Geronimo TxManager :: Transaction 
(2.2.0.r634076)
[  54] [Active ] [   ] [   60] Spring Transaction (2.5.6)
[  55] [Active ] [Started] [   60] Apache ServiceMix Tr

Re: Camel - JMXConnector Thread

2009-03-18 Thread Claus Ibsen
On Tue, Mar 17, 2009 at 10:44 AM, Willem Jiang  wrote:
> +1 for using the Executor to support the managed thread.
Hi

I have fixed this now and will commit a fix in short time on trunk.

>
> Willem
>
> Claus Ibsen wrote:
>> Hi
>>
>> Another minor note.
>> We might wanna make sure the threads we create in Camel is using the
>> same API so end users can be 100% in control of thread creation.
>> Eg in WebSphere to use its WorkManager API to control threads.
>>
>> So maybe some ExectutorService is needed as well? Just wondering /
>> thinking loud.
>>
>>
>> On Tue, Mar 17, 2009 at 10:24 AM, Claus Ibsen  wrote:
>>> Hi
>>>
>>> I was working on CAMEL-1462 and I was wondering why the
>>> JMXConnectorThread created in
>>> DefaultInstrumentationAgent#createJmxConnector is not set as daemon?
>>>
>>> eg in the code below there should be a: connector.setDaemon(true)
>>>
>>>
>>>        // Start the connector server asynchronously (in a separate thread).
>>>        Thread connectorThread = new Thread() {
>>>            public void run() {
>>>                try {
>>>                    cs.start();
>>>                } catch (IOException ioe) {
>>>                    LOG.warn("Could not start JMXConnector thread.", ioe);
>>>                }
>>>            }
>>>        };
>>>        connectorThread.setName("Camel JMX Connector Thread [" + url + "]");
>>>        connectorThread.start();
>>>        LOG.info("JMX Connector thread started and listening at: " + url);
>>>
>>>
>>>
>>> --
>>> Claus Ibsen
>>> Apache Camel Committer
>>>
>>> Open Source Integration: http://fusesource.com
>>> Blog: http://davsclaus.blogspot.com/
>>>
>>
>>
>>
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/


[jira] Commented: (CAMEL-1431) camel-cxf and spring DSL does not work very well

2009-03-18 Thread Charles Moulliard (JIRA)

[ 
https://issues.apache.org/activemq/browse/CAMEL-1431?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=50628#action_50628
 ] 

Charles Moulliard commented on CAMEL-1431:
--

@Willem,

I don't have this error ( java.lang.IllegalStateException: BeanFactory not 
initialized or already closed - call 'refresh' before accessing beans via the 
ApplicationContext) in a non-OSGI environment

> camel-cxf and spring DSL does not work very well
> 
>
> Key: CAMEL-1431
> URL: https://issues.apache.org/activemq/browse/CAMEL-1431
> Project: Apache Camel
>  Issue Type: Sub-task
>  Components: camel-cxf
>Affects Versions: 2.0-M1
>Reporter: Charles Moulliard
>Assignee: Willem Jiang
>
> Hi,
> Camel-cxf and camel works very well when the routing is defined like this :
> {code}
> public class ReportIncidentRoutes extends RouteBuilder {
> public void configure() throws Exception {
> // webservice response for OK
> OutputReportIncident OK = new OutputReportIncident();
> OK.setCode("0");
> // endpoint to our CXF webservice
> String cxfEndpoint = 
> "cxf://http://localhost:8080/camel-example/incident";
> + 
> "?serviceClass=org.apache.camel.example.reportincident.ReportIncidentEndpoint"
> + "&wsdlURL=wsdl/report_incident.wsdl";
> // first part from the webservice -> file backup
> from(cxfEndpoint)
> // we need to convert the CXF payload to InputReportIncident that 
> FilenameGenerator and velocity expects
> .convertBodyTo(InputReportIncident.class)
> // return OK as response
> .transform(constant(OK));
> }
> @ContextConfiguration
> public class ReportIncidentRoutesTest extends 
> AbstractJUnit4SpringContextTests  {
>   
>   private static final transient Log LOG = 
> LogFactory.getLog(ReportIncidentRoutesTest.class);
>   
> @Autowired
> protected CamelContext camelContext;
> // should be the same address as we have in our route
> private final static String ADDRESS = 
> "http://localhost:8080/camel-example/incident";;
> //private final static QName endpointName = new 
> QName("http://reportincident.example.camel.apache.org";, 
> "ReportIncidentEndpoint"); 
> protected static ReportIncidentEndpoint createCXFClient() {
> // we use CXF to create a client for us as its easier than JAXWS and 
> works
> JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
> factory.setServiceClass(ReportIncidentEndpoint.class);
> factory.setAddress(ADDRESS);
> //factory.setEndpointName(endpointName);
> return (ReportIncidentEndpoint) factory.create();
> }
> @Test
> public void testRendportIncident() throws Exception {
>   
>   assertNotNull(camelContext);
> // create input parameter
> InputReportIncident input = new InputReportIncident();
> input.setIncidentId("123");
> input.setIncidentDate("2008-08-18");
> input.setGivenName("Claus");
> input.setFamilyName("Ibsen");
> input.setSummary("Bla");
> input.setDetails("Bla bla");
> input.setEmail("davscl...@apache.org");
> input.setPhone("0045 2962 7576");
> // create the webservice client and send the request
> ReportIncidentEndpoint client = createCXFClient();
> OutputReportIncident out = client.reportIncident(input);
> // assert we got a OK back
> assertEquals("0", out.getCode());
> }
> 
> }
>  {code}
> but not when the routing is defined in spring DSL
>  {code}
> 
> http://www.springframework.org/schema/beans";
>   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>   xmlns:camel="http://camel.apache.org/schema/spring";
>   xmlns:cxf="http://camel.apache.org/schema/cxf";
>   xsi:schemaLocation=" http://www.springframework.org/schema/beans
>   http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
>   http://camel.apache.org/schema/osgi
>   http://camel.apache.org/schema/osgi/camel-osgi.xsd
>   http://camel.apache.org/schema/spring
>   http://camel.apache.org/schema/spring/camel-spring.xsd
>   http://camel.apache.org/schema/cxf
>   http://camel.apache.org/schema/cxf/camel-cxf.xsd";>
>   
>  class="org.apache.camel.example.reportincident.beans.WebService" />
>   
>class="org.apache.camel.example.reportincident.OutputReportIncident">
>   
>   
>   
>   
>   address="http://localhost:8080/camel-example/incident";
>  wsdlURL="wsdl/report_incident.wsdl"
>  
> serviceClass="org.ap

[jira] Commented: (CAMEL-1431) camel-cxf and spring DSL does not work very well

2009-03-18 Thread Willem Jiang (JIRA)

[ 
https://issues.apache.org/activemq/browse/CAMEL-1431?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=50622#action_50622
 ] 

Willem Jiang commented on CAMEL-1431:
-

Hi Charles,
Clause's Java DSL will set the out message's body with the instance of 
OutputReportIncident,
{code}
   // return OK as response
.transform(constant(OK));
{code}

Because  Camel Spring's ,  tag don't support the hold the 
bean's instance, 
so we can use the  to return an instance of  OutputReportIncident for 
 to use.
Basicaly, the  tag is mapped into MethodCallExpression in Java, the 
expression 
value is the method return value. 
You can find the magic from the package of org.apache.camel.model.language  in 
camel-core. 

For the java.lang.IllegalStateException, I wrote a comment in CAMEL-1427, 
please check it out.

BTW, I also write a Spring configuration file which is based on  Clause's 
example in CAMEL-1465, 
You may take it as an example.

Willem


> camel-cxf and spring DSL does not work very well
> 
>
> Key: CAMEL-1431
> URL: https://issues.apache.org/activemq/browse/CAMEL-1431
> Project: Apache Camel
>  Issue Type: Sub-task
>  Components: camel-cxf
>Affects Versions: 2.0-M1
>Reporter: Charles Moulliard
>Assignee: Willem Jiang
>
> Hi,
> Camel-cxf and camel works very well when the routing is defined like this :
> {code}
> public class ReportIncidentRoutes extends RouteBuilder {
> public void configure() throws Exception {
> // webservice response for OK
> OutputReportIncident OK = new OutputReportIncident();
> OK.setCode("0");
> // endpoint to our CXF webservice
> String cxfEndpoint = 
> "cxf://http://localhost:8080/camel-example/incident";
> + 
> "?serviceClass=org.apache.camel.example.reportincident.ReportIncidentEndpoint"
> + "&wsdlURL=wsdl/report_incident.wsdl";
> // first part from the webservice -> file backup
> from(cxfEndpoint)
> // we need to convert the CXF payload to InputReportIncident that 
> FilenameGenerator and velocity expects
> .convertBodyTo(InputReportIncident.class)
> // return OK as response
> .transform(constant(OK));
> }
> @ContextConfiguration
> public class ReportIncidentRoutesTest extends 
> AbstractJUnit4SpringContextTests  {
>   
>   private static final transient Log LOG = 
> LogFactory.getLog(ReportIncidentRoutesTest.class);
>   
> @Autowired
> protected CamelContext camelContext;
> // should be the same address as we have in our route
> private final static String ADDRESS = 
> "http://localhost:8080/camel-example/incident";;
> //private final static QName endpointName = new 
> QName("http://reportincident.example.camel.apache.org";, 
> "ReportIncidentEndpoint"); 
> protected static ReportIncidentEndpoint createCXFClient() {
> // we use CXF to create a client for us as its easier than JAXWS and 
> works
> JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
> factory.setServiceClass(ReportIncidentEndpoint.class);
> factory.setAddress(ADDRESS);
> //factory.setEndpointName(endpointName);
> return (ReportIncidentEndpoint) factory.create();
> }
> @Test
> public void testRendportIncident() throws Exception {
>   
>   assertNotNull(camelContext);
> // create input parameter
> InputReportIncident input = new InputReportIncident();
> input.setIncidentId("123");
> input.setIncidentDate("2008-08-18");
> input.setGivenName("Claus");
> input.setFamilyName("Ibsen");
> input.setSummary("Bla");
> input.setDetails("Bla bla");
> input.setEmail("davscl...@apache.org");
> input.setPhone("0045 2962 7576");
> // create the webservice client and send the request
> ReportIncidentEndpoint client = createCXFClient();
> OutputReportIncident out = client.reportIncident(input);
> // assert we got a OK back
> assertEquals("0", out.getCode());
> }
> 
> }
>  {code}
> but not when the routing is defined in spring DSL
>  {code}
> 
> http://www.springframework.org/schema/beans";
>   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>   xmlns:camel="http://camel.apache.org/schema/spring";
>   xmlns:cxf="http://camel.apache.org/schema/cxf";
>   xsi:schemaLocation=" http://www.springframework.org/schema/beans
>   http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
>   http://camel.apache.org/schema/osgi
>   http://camel.apache.org/schema/osgi/camel-osgi.xsd
>   http://camel.apache.org/schema/spring
>   http://camel.apache.org/schema/spr

[jira] Commented: (CAMEL-1427) java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext

2009-03-18 Thread Willem Jiang (JIRA)

[ 
https://issues.apache.org/activemq/browse/CAMEL-1427?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=50621#action_50621
 ] 

Willem Jiang commented on CAMEL-1427:
-

Hi Charles,

After studied the Spring Osgi relates ApplicationContext code, I found they 
will use the managed thread to refresh the application.
Since your application context didn't import any CXF relates components, CXF 
bus will try to create the application context itself, 
then you may hit that kind of  java.lang.IllegalStateException: BeanFactory not 
initialized or already closed , 
if the CXF bus's application context doesn't finish the initialization before 
camel setup the  cxf endpoint for your.

So please include the below line into your Spring configuration to load the bus 
explicitly.
{code}
 
 
 
{code}

Willem


> java.lang.IllegalStateException: BeanFactory not initialized or already 
> closed - call 'refresh' before accessing beans via the ApplicationContext
> -
>
> Key: CAMEL-1427
> URL: https://issues.apache.org/activemq/browse/CAMEL-1427
> Project: Apache Camel
>  Issue Type: Bug
>  Components: camel-osgi
>Reporter: Charles Moulliard
>Assignee: Willem Jiang
>
> Hi,
> When I run the following spring DSL in SMX4
> 
> http://www.springframework.org/schema/beans";
>   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>   xmlns:camel="http://camel.apache.org/schema/spring";
>   xmlns:cxf="http://camel.apache.org/schema/cxf";
>   xsi:schemaLocation=" http://www.springframework.org/schema/beans
>   http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
>   http://camel.apache.org/schema/osgi
>   http://camel.apache.org/schema/osgi/camel-osgi.xsd
>   http://camel.apache.org/schema/spring
>   http://camel.apache.org/schema/spring/camel-spring.xsd
>   http://camel.apache.org/schema/cxf
>   http://camel.apache.org/schema/cxf/camel-cxf.xsd";>
>  
>
> class="org.apache.camel.dataformat.bindy.csv.BindyCsvDataFormat">
> value="org.apache.camel.example.reportincident.model" />
>   
>   
>class="org.apache.camel.example.reportincident.csv.CsvBean" />
>class="org.apache.camel.example.reportincident.OutputReportIncident">
>   
>   
>   http://camel.apache.org/schema/osgi";>
>   
> org.apache.camel.example.reportincident.routing
>   
>   
>   
>uri="file://d:/temp/data/?moveExpression=d:/temp/done/${file:name}" />
>   
>   
>   
>   
>   
>   
>uri="cxf://http://localhost:8080/camel-example/incident?serviceClass=org.apache.camel.example.reportincident.service.ReportIncidentEndpoint&wsdlURL=wsdl/report_incident.wsdl";
>  />
>type="org.apache.camel.example.reportincident.InputReportIncident" />
>   
>   
>   
>   
>   
>
>   
> 
> , I receive the following error :
> 15:48:59,209 | ERROR | xtenderThread-15 | OsgiBundleXmlApplicationContext  | 
> gatedExecutionApplicationContext  366 | Post refresh error
> java.lang.IllegalStateException: BeanFactory not initialized or already 
> closed - call 'refresh' before accessing beans via the ApplicationContext
>   at 
> org.springframework.context.support.AbstractRefreshableApplicationContext.getBeanFactory(AbstractRefreshableApplicationContext.java:153)
>   at 
> org.springframework.context.support.AbstractApplicationContext.containsBean(AbstractApplicationContext.java:892)
>   at 
> org.apache.cxf.configuration.spring.ConfigurerImpl.configureBean(ConfigurerImpl.java:141)
>   at 
> org.apache.cxf.configuration.spring.ConfigurerImpl.configureBean(ConfigurerImpl.java:111)
>   at 
> org.apache.cxf.transport.http.AbstractHTTPTransportFactory.configure(AbstractHTTPTransportFactory.java:229)
>   at 
> org.apache.cxf.transport.http.AbstractHTTPTransportFactory.configure(AbstractHTTPTransportFactory.java:224)
>   at 
> org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory.createDestination(JettyHTTPTransportFactory.java:121)
>   at 
> org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory.getDestination(JettyHTTPTransportFactory.java:103)
>   at 
> org.apache.cxf.endpoint.ServerImpl.initDestination(ServerImpl.java:90)
>   at org.apache.cxf.endpoint.ServerImpl.(ServerImpl.java:69)
>   at 
> org.apache.cxf.frontend.ServerFactoryBean.create(ServerFa

[jira] Resolved: (CAMEL-1463) JMX instrumentation - will add DeadLetterChannel even if you have defined to use NoErrorHandler

2009-03-18 Thread Claus Ibsen (JIRA)

 [ 
https://issues.apache.org/activemq/browse/CAMEL-1463?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen resolved CAMEL-1463.


Resolution: Fixed

Yes got it now.

Trunk: Committed revision 755487.
1.x: Committed revision 755493.

> JMX instrumentation - will add DeadLetterChannel even if you have defined to 
> use NoErrorHandler
> ---
>
> Key: CAMEL-1463
> URL: https://issues.apache.org/activemq/browse/CAMEL-1463
> Project: Apache Camel
>  Issue Type: Bug
>  Components: camel-core
>Affects Versions: 1.6.0
>Reporter: Claus Ibsen
>Assignee: Claus Ibsen
> Fix For: 2.0.0, 1.6.1
>
>
> See nabble:
> http://www.nabble.com/StreamCaching-in-Camel-1.6-td22305654s22882.html
> I will add an unit test that demonstrates this:
> org.apache.camel.processor.ChoiceNoErrorHandlerTest
> The route should at all time *not* contain any error handler at all, 
> regardless wether JMX is enabled or not.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.