You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by RomualdoGobbo <Ro...@newlog.it> on 2010/08/11 12:52:42 UTC

troubles camel-example-spring-xquery modified including camel-mina

Hi all,
I've modified a little bit the camel-example-spring-xquery adding the
camel-mina tcp changing the original behavior via file:// messages capture,
but as you can see in the following mvn script execution I've received a
build error, and for me is very difficult to understand the why; please see
on the uploaded .rar fiel including
http://camel.465427.n5.nabble.com/file/n2471729/camel-example-spring-xquery.rar
camel-example-spring-xquery.rar  all the sources.

Regards,
Romualdo

C:\Documents and
Settings\Administrator\workspace\camel-example-spring-xquery>
n camel:run
[INFO] Scanning for projects...
[INFO]
-----------------------------------------------------------------------
[INFO] Building Camel :: Example :: Spring :: XQuery
[INFO]    task-segment: [camel:run]
[INFO]
-----------------------------------------------------------------------
[INFO] Preparing camel:run
[INFO] [antrun:run {execution: create-prop}]
[INFO] Executing tasks
     [echo] Maven version: 2.4.0
     [echo] OSGi version: 2.4.0
[INFO] Executed tasks
[INFO] [properties:read-project-properties {execution: default}]
[INFO] Setting property: classpath.resource.loader.class =>
'org.codehaus.plex
.velocity.ContextClassLoaderResourceLoader'.
[INFO] Setting property: velocimacro.messages.on => 'false'.
[INFO] Setting property: resource.loader => 'classpath'.
[INFO] Setting property: resource.manager.logwhenfound => 'false'.
[INFO] [remote-resources:process {execution: default}]
[INFO] [resources:resources {execution: default-resources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 6 resources
[INFO] Copying 3 resources
[INFO] [resources:resources {execution: default}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 6 resources
[INFO] Copying 3 resources
[INFO] [compiler:compile {execution: default-compile}]
[INFO] No sources to compile
[INFO] [resources:testResources {execution: default-testResources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Documents and
Settings\Administr
or\workspace\camel-example-spring-xquery\src\test\resources
[INFO] Copying 3 resources
[INFO] [compiler:testCompile {execution: default-testCompile}]
[INFO] No sources to compile
[INFO] [camel:run {execution: default-cli}]
[INFO] Classpath = [file:/C:/Documents and
Settings/Administrator/workspace/ca
l-example-spring-xquery/target/classes/, file:/C:/Documents and
Settings/Admin
trator/.m2/repository/org/apache/camel/camel-spring/2.4.0/camel-spring-2.4.0.j
, file:/C:/Documents and
Settings/Administrator/.m2/repository/org/apache/came
camel-core/2.4.0/camel-core-2.4.0.jar, file:/C:/Documents and
Settings/Adminis
ator/.m2/repository/commons-logging/commons-logging-api/1.1/commons-logging-ap
1.1.jar, file:/C:/Documents and
Settings/Administrator/.m2/repository/org/fuse
urce/commonman/commons-management/1.0/commons-management-1.0.jar,
file:/C:/Doc
ents and
Settings/Administrator/.m2/repository/org/springframework/spring-cont
t/3.0.3.RELEASE/spring-context-3.0.3.RELEASE.jar, file:/C:/Documents and
Setti
s/Administrator/.m2/repository/org/springframework/spring-aop/3.0.3.RELEASE/sp
ng-aop-3.0.3.RELEASE.jar, file:/C:/Documents and
Settings/Administrator/.m2/re
sitory/aopalliance/aopalliance/1.0/aopalliance-1.0.jar, file:/C:/Documents
and
ettings/Administrator/.m2/repository/org/springframework/spring-asm/3.0.3.RELE
E/spring-asm-3.0.3.RELEASE.jar, file:/C:/Documents and
Settings/Administrator/
2/repository/org/springframework/spring-beans/3.0.3.RELEASE/spring-beans-3.0.3
ELEASE.jar, file:/C:/Documents and
Settings/Administrator/.m2/repository/org/s
ingframework/spring-core/3.0.3.RELEASE/spring-core-3.0.3.RELEASE.jar,
file:/C:
ocuments and
Settings/Administrator/.m2/repository/commons-logging/commons-log
ng/1.1.1/commons-logging-1.1.1.jar, file:/C:/Documents and
Settings/Administra
r/.m2/repository/org/springframework/spring-expression/3.0.3.RELEASE/spring-ex
ession-3.0.3.RELEASE.jar, file:/C:/Documents and
Settings/Administrator/.m2/re
sitory/org/springframework/spring-tx/3.0.3.RELEASE/spring-tx-3.0.3.RELEASE.jar
file:/C:/Documents and
Settings/Administrator/.m2/repository/org/apache/mina/m
a-core/1.1.7/mina-core-1.1.7.jar, file:/C:/Documents and
Settings/Administrato
.m2/repository/org/slf4j/slf4j-api/1.6.0/slf4j-api-1.6.0.jar,
file:/C:/Documen
 and
Settings/Administrator/.m2/repository/org/apache/camel/camel-saxon/2.4.0/
mel-saxon-2.4.0.jar, file:/C:/Documents and
Settings/Administrator/.m2/reposit
y/net/sf/saxon/saxon/9.1.0.8/saxon-9.1.0.8.jar, file:/C:/Documents and
Setting
Administrator/.m2/repository/net/sf/saxon/saxon-dom/9.1.0.8/saxon-dom-9.1.0.8.
r, file:/C:/Documents and
Settings/Administrator/.m2/repository/net/sf/saxon/s
on-sql/9.1.0.8/saxon-sql-9.1.0.8.jar, file:/C:/Documents and
Settings/Administ
tor/.m2/repository/net/sf/saxon/saxon-xpath/9.1.0.8/saxon-xpath-9.1.0.8.jar,
f
e:/C:/Documents and
Settings/Administrator/.m2/repository/org/apache/camel/cam
-mina/2.4.0/camel-mina-2.4.0.jar, file:/C:/Documents and
Settings/Administrato
.m2/repository/org/apache/camel/camel-jms/2.4.0/camel-jms-2.4.0.jar,
file:/C:/
cuments and
Settings/Administrator/.m2/repository/org/springframework/spring-j
/3.0.3.RELEASE/spring-jms-3.0.3.RELEASE.jar, file:/C:/Documents and
Settings/A
inistrator/.m2/repository/org/apache/geronimo/specs/geronimo-jms_1.1_spec/1.1.
geronimo-jms_1.1_spec-1.1.1.jar, file:/C:/Documents and
Settings/Administrator
m2/repository/org/apache/activemq/activemq-core/5.3.2/activemq-core-5.3.2.jar,
ile:/C:/Documents and
Settings/Administrator/.m2/repository/org/apache/activem
activeio-core/3.1.2/activeio-core-3.1.2.jar, file:/C:/Documents and
Settings/A
inistrator/.m2/repository/org/apache/geronimo/specs/geronimo-j2ee-management_1
_spec/1.0.1/geronimo-j2ee-management_1.1_spec-1.0.1.jar, file:/C:/Documents
an
Settings/Administrator/.m2/repository/org/apache/activemq/kahadb/5.3.2/kahadb-
3.2.jar, file:/C:/Documents and
Settings/Administrator/.m2/repository/org/apac
/activemq/protobuf/activemq-protobuf/1.0/activemq-protobuf-1.0.jar,
file:/C:/D
uments and
Settings/Administrator/.m2/repository/org/osgi/org.osgi.core/4.1.0/
g.osgi.core-4.1.0.jar, file:/C:/Documents and
Settings/Administrator/.m2/repos
ory/org/springframework/osgi/spring-osgi-core/1.2.0/spring-osgi-core-1.2.0.jar
file:/C:/Documents and
Settings/Administrator/.m2/repository/org/springframewo
/osgi/spring-osgi-io/1.2.0/spring-osgi-io-1.2.0.jar, file:/C:/Documents and
Se
ings/Administrator/.m2/repository/org/apache/geronimo/specs/geronimo-j2ee-mana
ment_1.0_spec/1.1/geronimo-j2ee-management_1.0_spec-1.1.jar,
file:/C:/Document
and
Settings/Administrator/.m2/repository/commons-net/commons-net/2.0/commons-
t-2.0.jar, file:/C:/Programmi/Java/jdk1.6.0_20/jre/../lib/tools.jar]
11-ago-2010 12.31.10 org.apache.camel.impl.MainSupport doStart
INFO: Apache Camel 2.4.0 starting
11-ago-2010 12.31.10
org.springframework.context.support.AbstractApplicationCo
ext prepareRefresh
INFO: Refreshing
org.springframework.context.support.ClassPathXmlApplicationCo
ext@b1cb25: startup date [Wed Aug 11 12:31:10 CEST 2010]; root of context
hier
chy
11-ago-2010 12.31.10
org.springframework.beans.factory.xml.XmlBeanDefinitionRe
er loadBeanDefinitions
INFO: Loading XML bean definitions from file [C:\Documents and
Settings\Admini
rator\workspace\camel-example-spring-xquery\target\classes\META-INF\spring\cam
Context.xml]
11-ago-2010 12.31.10 org.apache.camel.spring.handler.CamelNamespaceHandler
ini
INFO: camel-osgi.jar/camel-spring-osgi.jar not detected in classpath
11-ago-2010 12.31.11
org.springframework.beans.factory.support.DefaultListable
anFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in
org.springframework.beans.factory.suppor
DefaultListableBeanFactory@f4e6d: defining beans
[template,consumerTemplate,ca
lContext:beanPostProcessor,camelContext,jms]; root of factory hierarchy
11-ago-2010 12.31.11 org.apache.camel.impl.DefaultCamelContext doStart
INFO: Apache Camel 2.4.0 (CamelContext: camelContext) is starting
11-ago-2010 12.31.11 org.apache.camel.impl.DefaultCamelContext
createManagemen
trategy
INFO: JMX enabled. Using ManagedManagementStrategy.
11-ago-2010 12.31.11
org.apache.camel.impl.converter.AnnotationTypeConverterLo
er load
INFO: Found 4 packages with 14 @Converter classes to load
11-ago-2010 12.31.11 org.apache.camel.impl.converter.DefaultTypeConverter
load
peConverters
INFO: Loaded 148 type converters in 0.301 seconds
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further
deta
s.
11-ago-2010 12.31.12 org.apache.camel.component.mina.MinaConsumer doStart
INFO: Binding to server address: /192.168.1.223:3000 using acceptor:
org.apach
mina.transport.socket.nio.SocketAcceptor@ebbf5c
11-ago-2010 12.31.12 org.apache.camel.component.mina.MinaConsumer doStop
INFO: Unbinding from server address: /192.168.1.223:3000 using acceptor:
org.a
che.mina.transport.socket.nio.SocketAcceptor@ebbf5c
11-ago-2010 12.31.12 org.apache.camel.impl.MainSupport doStop
INFO: Apache Camel 2.4.0 stopping
*************************************
Error occurred while running main from: org.apache.camel.spring.Main
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImp
java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcc
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.camel.maven.RunMojo$1.run(RunMojo.java:415)
        at java.lang.Thread.run(Thread.java:619)
Caused by: org.apache.camel.RuntimeCamelException: java.net.BindException:
Can
t assign requested address: bind
        at
org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(Object
lper.java:1126)
        at
org.apache.camel.spring.SpringCamelContext.onApplicationEvent(Sprin
amelContext.java:103)
        at
org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(
melContextFactoryBean.java:231)
        at
org.springframework.context.event.SimpleApplicationEventMulticaster
ulticastEvent(SimpleApplicationEventMulticaster.java:97)
        at
org.springframework.context.support.AbstractApplicationContext.publ
hEvent(AbstractApplicationContext.java:303)
        at
org.springframework.context.support.AbstractApplicationContext.fini
Refresh(AbstractApplicationContext.java:911)
        at
org.springframework.context.support.AbstractApplicationContext.refr
h(AbstractApplicationContext.java:428)
        at
org.springframework.context.support.ClassPathXmlApplicationContext.
nit>(ClassPathXmlApplicationContext.java:139)
        at
org.springframework.context.support.ClassPathXmlApplicationContext.
nit>(ClassPathXmlApplicationContext.java:93)
        at
org.apache.camel.spring.Main.createDefaultApplicationContext(Main.j
a:219)
        at org.apache.camel.spring.Main.doStart(Main.java:173)
        at
org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:56)
        at org.apache.camel.impl.MainSupport.run(MainSupport.java:114)
        at org.apache.camel.impl.MainSupport.run(MainSupport.java:291)
        at org.apache.camel.spring.Main.main(Main.java:97)
        ... 6 more
Caused by: java.net.BindException: Cannot assign requested address: bind
        at sun.nio.ch.Net.bind(Native Method)
        at
sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.jav
119)
        at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59)
        at
org.apache.mina.transport.socket.nio.SocketAcceptor.registerNew(Soc
tAcceptor.java:363)
        at
org.apache.mina.transport.socket.nio.SocketAcceptor.access$800(Sock
Acceptor.java:55)
        at
org.apache.mina.transport.socket.nio.SocketAcceptor$Worker.run(Sock
Acceptor.java:222)
        at
org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunna
e.java:51)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolEx
utor.java:886)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecut
.java:908)
        ... 1 more
*************************************
[INFO]
-----------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
-----------------------------------------------------------------------
[INFO]

Cannot assign requested address: bind
[INFO]
-----------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO]
-----------------------------------------------------------------------
[INFO] Total time: 5 seconds
[INFO] Finished at: Wed Aug 11 12:31:12 CEST 2010
[INFO] Final Memory: 30M/72M
[INFO]
-----------------------------------------------------------------------
11-ago-2010 12.31.12 org.apache.camel.spring.Main$HangupInterceptor run
INFO: Received hang up - stopping the main instance.
C:\Documents and
Settings\Administrator\workspace\camel-example-spring-xquery>
-- 
View this message in context: http://camel.465427.n5.nabble.com/troubles-camel-example-spring-xquery-modified-including-camel-mina-tp2471729p2471729.html
Sent from the Camel Development mailing list archive at Nabble.com.

Re: troubles camel-example-spring-xquery modified including camel-mina

Posted by RomualdoGobbo <Ro...@newlog.it>.
Hi,
I've find some info in an old post JIRA where you suggested the changing 
/mina:tcp/ flow to solve the problem

from:/*
*/

    /*consumer *(<from
    uri="mina:tcp://192.168.1.223:3000?textline=true&amp;sync=false"/>)/

to/*
*/

    /*producer */(/<to
    uri="mina:tcp://192.168.1.223:3000?textline=true&amp;sync=true"/>/)
    adding a timer before (/<from uri="timer://foo?period=2000"/>/) and
    the loop seems to be OK.

  Unfortunately I've received the following message:

    /[                           foo] MinaProducer                  
    WARN  No payload to send for exchange: Exchange[Message: [Body is
    null]]/

to bear in mind that the tcp flow is at socket level sending in 
continuous mode only text message incoming from TCP/IP distributed 
sensors (quite similar a Serial Port transmission!) without any other 
attributes as Header or Body ... than the raw text.

The final /camelContext.xm/l <route> section is the following:

    /<route>
    <from uri="timer://foo?period=2000"/>
    <to uri="mina:tcp://192.168.1.223:3000?textline=true&amp;sync=true"/>
    <to uri="xquery:myTransform.xquery"/>
    <to uri="jms:MyQueue"/>
    //</route>/

Have you some suggestions?

Best Regards,
Romualdo



Claus Ibsen-2 [via Camel] wrote:
> Hi
>
> Ah the mina component doesn't support consuming from a remote IP address.
> when you do from it's supposed to be the localhost (eg act as a server).
>
> There is a ticket in JIRA to add a new feature to Camel mina to allow
> for what you want.
> Most likely it will be implemented in the camel-netty component.
> Apache Mina seems to be progressing very slow.
> They haven't released Mina 2.0 yet despite working with it for 2+ years.
>
> On Wed, Aug 11, 2010 at 5:37 PM, RomualdoGobbo <[hidden email] 
> </user/SendEmail.jtp?type=node&node=2472558&i=0>> wrote:
>
> >
> > Claus,
> > I don't know why the IP Address is logged in this fashion!
> > In the following <route> portion of camelContext.xml below
> >
> > <route>
> > <from
> > uri="mina:tcp://192.168.1.223:3000?textline=true&sync=false"/>
> > <to uri="xquery:myTransform.xquery"/>
> > <to uri="jms:MyQueue"/>
> > </route>
> >
> >
> > the uri is compliant to the notation (maybe have you to add another 
> "/"?).
> >
> > The IP is UP and running in our private LAN and is monitored via
> > HyperTerminal WinSocket since the last day. The aim is to capture the
> > incoming flow from the above IP address and insert It in the queue.
> >
> > Many thank for your help.
> >
> > Romualdo.
> > P.S. for your convenience the previous attached .rar file contains the
> > complete project.
> > --
> > View this message in context: 
> http://camel.465427.n5.nabble.com/troubles-camel-example-spring-xquery-modified-including-camel-mina-tp2471729p2472079.html 
> <http://camel.465427.n5.nabble.com/troubles-camel-example-spring-xquery-modified-including-camel-mina-tp2471729p2472079.html?by-user=t>
> > Sent from the Camel Development mailing list archive at Nabble.com.
> >
>
>
>
> -- 
> Claus Ibsen
> Apache Camel Committer
>
> Author of Camel in Action: http://www.manning.com/ibsen/
> Open Source Integration: http://fusesource.com 
> <http://fusesource.com?by-user=t>
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
>
>
> ------------------------------------------------------------------------
> View message @ 
> http://camel.465427.n5.nabble.com/troubles-camel-example-spring-xquery-modified-including-camel-mina-tp2471729p2472558.html 
>
> To unsubscribe from Re: troubles camel-example-spring-xquery modified 
> including camel-mina, click here 
> <http://camel.465427.n5.nabble.com/template/NodeServlet.jtp?tpl=unsubscribe_by_code&node=2472079&code=Um9tdWFsZG8uR29iYm9AbmV3bG9nLml0fDI0NzIwNzl8LTEyMjI2NjQ0NQ==>. 
>
>


-- 
+-----------------------------------------------------------------------+
Company: NEWLOG Consulting Srl
Message from: Romualdo Gobbo - CEO
Pza Carrobiolo 5 - 20052 MONZA (MB) - ITALY
Tel +39 039 2302833
Fax +39 039 2302832
Mobile +39 335 213886
Geo 45°35'13.8"N/09°16'36.2"E
E-mail: Romualdo.Gobbo@newlog.it
http://www.newlog.it
WAP: wap.newlog.it
+-----------------------------------------------------------------------+

- Disclaimer -
This email and any attachments thereto may contain information which is confidential and/or protected by intellectual property rights and are intended for the sole use of the recipient(s) named above. Any use of the information contained herein (including, but not limited to, total or partial reproduction, communication or distribution in any form) or the taking of any action in reliance on the contents, by persons other than the designated recipient(s) is strictly prohibited.

If you have received this email in error, please notify the sender either by telephone or by email and delete the material from any computer.

Thank you for your cooperation.


-- 
View this message in context: http://camel.465427.n5.nabble.com/troubles-camel-example-spring-xquery-modified-including-camel-mina-tp2471729p2473292.html
Sent from the Camel Development mailing list archive at Nabble.com.

Re: troubles camel-example-spring-xquery modified including camel-mina

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Aug 12, 2010 at 12:01 PM, RomualdoGobbo
<Ro...@newlog.it> wrote:
>
> Hi,
> could you help me to find the JIRA ticket regarding the new feature?
https://issues.apache.org/activemq/browse/CAMEL-1077



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: troubles camel-example-spring-xquery modified including camel-mina

Posted by RomualdoGobbo <Ro...@newlog.it>.
Hi,
could you help me to find the JIRA ticket regarding the new feature?
Regards,
Romualdo

Claus Ibsen-2 [via Camel] wrote:
> Hi
>
> Ah the mina component doesn't support consuming from a remote IP address.
> when you do from it's supposed to be the localhost (eg act as a server).
>
> There is a ticket in JIRA to add a new feature to Camel mina to allow
> for what you want.
> Most likely it will be implemented in the camel-netty component.
> Apache Mina seems to be progressing very slow.
> They haven't released Mina 2.0 yet despite working with it for 2+ years.
>
> On Wed, Aug 11, 2010 at 5:37 PM, RomualdoGobbo <[hidden email] 
> </user/SendEmail.jtp?type=node&node=2472558&i=0>> wrote:
>
> >
> > Claus,
> > I don't know why the IP Address is logged in this fashion!
> > In the following <route> portion of camelContext.xml below
> >
> > <route>
> > <from
> > uri="mina:tcp://192.168.1.223:3000?textline=true&sync=false"/>
> > <to uri="xquery:myTransform.xquery"/>
> > <to uri="jms:MyQueue"/>
> > </route>
> >
> >
> > the uri is compliant to the notation (maybe have you to add another 
> "/"?).
> >
> > The IP is UP and running in our private LAN and is monitored via
> > HyperTerminal WinSocket since the last day. The aim is to capture the
> > incoming flow from the above IP address and insert It in the queue.
> >
> > Many thank for your help.
> >
> > Romualdo.
> > P.S. for your convenience the previous attached .rar file contains the
> > complete project.
> > --
> > View this message in context: 
> http://camel.465427.n5.nabble.com/troubles-camel-example-spring-xquery-modified-including-camel-mina-tp2471729p2472079.html 
> <http://camel.465427.n5.nabble.com/troubles-camel-example-spring-xquery-modified-including-camel-mina-tp2471729p2472079.html?by-user=t>
> > Sent from the Camel Development mailing list archive at Nabble.com.
> >
>
>
>
> -- 
> Claus Ibsen
> Apache Camel Committer
>
> Author of Camel in Action: http://www.manning.com/ibsen/
> Open Source Integration: http://fusesource.com 
> <http://fusesource.com?by-user=t>
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
>
>
> ------------------------------------------------------------------------
> View message @ 
> http://camel.465427.n5.nabble.com/troubles-camel-example-spring-xquery-modified-including-camel-mina-tp2471729p2472558.html 
>
> To unsubscribe from Re: troubles camel-example-spring-xquery modified 
> including camel-mina, click here 
> <http://camel.465427.n5.nabble.com/template/NodeServlet.jtp?tpl=unsubscribe_by_code&node=2472079&code=Um9tdWFsZG8uR29iYm9AbmV3bG9nLml0fDI0NzIwNzl8LTEyMjI2NjQ0NQ==>. 
>
>


-- 
+-----------------------------------------------------------------------+
Company: NEWLOG Consulting Srl
Message from: Romualdo Gobbo - CEO
Pza Carrobiolo 5 - 20052 MONZA (MB) - ITALY
Tel +39 039 2302833
Fax +39 039 2302832
Mobile +39 335 213886
Geo 45°35'13.8"N/09°16'36.2"E
E-mail: Romualdo.Gobbo@newlog.it
http://www.newlog.it
WAP: wap.newlog.it
+-----------------------------------------------------------------------+

- Disclaimer -
This email and any attachments thereto may contain information which is confidential and/or protected by intellectual property rights and are intended for the sole use of the recipient(s) named above. Any use of the information contained herein (including, but not limited to, total or partial reproduction, communication or distribution in any form) or the taking of any action in reliance on the contents, by persons other than the designated recipient(s) is strictly prohibited.

If you have received this email in error, please notify the sender either by telephone or by email and delete the material from any computer.

Thank you for your cooperation.


-- 
View this message in context: http://camel.465427.n5.nabble.com/troubles-camel-example-spring-xquery-modified-including-camel-mina-tp2471729p2473061.html
Sent from the Camel Development mailing list archive at Nabble.com.

Re: troubles camel-example-spring-xquery modified including camel-mina

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Ah the mina component doesn't support consuming from a remote IP address.
when you do from it's supposed to be the localhost (eg act as a server).

There is a ticket in JIRA to add a new feature to Camel mina to allow
for what you want.
Most likely it will be implemented in the camel-netty component.
Apache Mina seems to be progressing very slow.
They haven't released Mina 2.0 yet despite working with it for 2+ years.

On Wed, Aug 11, 2010 at 5:37 PM, RomualdoGobbo <Ro...@newlog.it> wrote:
>
> Claus,
> I don't know why the IP Address is logged in this fashion!
> In the following <route> portion of camelContext.xml below
>
>    <route>
>      <from
> uri="mina:tcp://192.168.1.223:3000?textline=true&amp;sync=false"/>
>      <to uri="xquery:myTransform.xquery"/>
>      <to uri="jms:MyQueue"/>
>    </route>
>
>
> the uri is compliant to the notation (maybe have you to add another "/"?).
>
> The IP is UP and running in our private LAN and is monitored via
> HyperTerminal WinSocket since the last day. The aim is to capture the
> incoming flow from the above IP address and insert It in the queue.
>
> Many thank for your help.
>
> Romualdo.
> P.S. for your convenience the previous attached .rar file contains the
> complete project.
> --
> View this message in context: http://camel.465427.n5.nabble.com/troubles-camel-example-spring-xquery-modified-including-camel-mina-tp2471729p2472079.html
> Sent from the Camel Development mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: troubles camel-example-spring-xquery modified including camel-mina

Posted by RomualdoGobbo <Ro...@newlog.it>.
Claus,
I don't know why the IP Address is logged in this fashion!
In the following <route> portion of camelContext.xml below

    <route>
      <from
uri="mina:tcp://192.168.1.223:3000?textline=true&amp;sync=false"/>
      <to uri="xquery:myTransform.xquery"/>
      <to uri="jms:MyQueue"/>
    </route>


the uri is compliant to the notation (maybe have you to add another "/"?).

The IP is UP and running in our private LAN and is monitored via
HyperTerminal WinSocket since the last day. The aim is to capture the
incoming flow from the above IP address and insert It in the queue.

Many thank for your help.

Romualdo.
P.S. for your convenience the previous attached .rar file contains the
complete project.
-- 
View this message in context: http://camel.465427.n5.nabble.com/troubles-camel-example-spring-xquery-modified-including-camel-mina-tp2471729p2472079.html
Sent from the Camel Development mailing list archive at Nabble.com.

Re: troubles camel-example-spring-xquery modified including camel-mina

Posted by Claus Ibsen <cl...@gmail.com>.
Looks like the IP address is a bit wrong

 /192.168.1.223:3000

There appears to be a leading / char.
And are you sure the IP address is up and running on the port.


On Wed, Aug 11, 2010 at 12:52 PM, RomualdoGobbo
<Ro...@newlog.it> wrote:
>
> Hi all,
> I've modified a little bit the camel-example-spring-xquery adding the
> camel-mina tcp changing the original behavior via file:// messages capture,
> but as you can see in the following mvn script execution I've received a
> build error, and for me is very difficult to understand the why; please see
> on the uploaded .rar fiel including
> http://camel.465427.n5.nabble.com/file/n2471729/camel-example-spring-xquery.rar
> camel-example-spring-xquery.rar  all the sources.
>
> Regards,
> Romualdo
>
> C:\Documents and
> Settings\Administrator\workspace\camel-example-spring-xquery>
> n camel:run
> [INFO] Scanning for projects...
> [INFO]
> -----------------------------------------------------------------------
> [INFO] Building Camel :: Example :: Spring :: XQuery
> [INFO]    task-segment: [camel:run]
> [INFO]
> -----------------------------------------------------------------------
> [INFO] Preparing camel:run
> [INFO] [antrun:run {execution: create-prop}]
> [INFO] Executing tasks
>     [echo] Maven version: 2.4.0
>     [echo] OSGi version: 2.4.0
> [INFO] Executed tasks
> [INFO] [properties:read-project-properties {execution: default}]
> [INFO] Setting property: classpath.resource.loader.class =>
> 'org.codehaus.plex
> .velocity.ContextClassLoaderResourceLoader'.
> [INFO] Setting property: velocimacro.messages.on => 'false'.
> [INFO] Setting property: resource.loader => 'classpath'.
> [INFO] Setting property: resource.manager.logwhenfound => 'false'.
> [INFO] [remote-resources:process {execution: default}]
> [INFO] [resources:resources {execution: default-resources}]
> [INFO] Using 'UTF-8' encoding to copy filtered resources.
> [INFO] Copying 6 resources
> [INFO] Copying 3 resources
> [INFO] [resources:resources {execution: default}]
> [INFO] Using 'UTF-8' encoding to copy filtered resources.
> [INFO] Copying 6 resources
> [INFO] Copying 3 resources
> [INFO] [compiler:compile {execution: default-compile}]
> [INFO] No sources to compile
> [INFO] [resources:testResources {execution: default-testResources}]
> [INFO] Using 'UTF-8' encoding to copy filtered resources.
> [INFO] skip non existing resourceDirectory C:\Documents and
> Settings\Administr
> or\workspace\camel-example-spring-xquery\src\test\resources
> [INFO] Copying 3 resources
> [INFO] [compiler:testCompile {execution: default-testCompile}]
> [INFO] No sources to compile
> [INFO] [camel:run {execution: default-cli}]
> [INFO] Classpath = [file:/C:/Documents and
> Settings/Administrator/workspace/ca
> l-example-spring-xquery/target/classes/, file:/C:/Documents and
> Settings/Admin
> trator/.m2/repository/org/apache/camel/camel-spring/2.4.0/camel-spring-2.4.0.j
> , file:/C:/Documents and
> Settings/Administrator/.m2/repository/org/apache/came
> camel-core/2.4.0/camel-core-2.4.0.jar, file:/C:/Documents and
> Settings/Adminis
> ator/.m2/repository/commons-logging/commons-logging-api/1.1/commons-logging-ap
> 1.1.jar, file:/C:/Documents and
> Settings/Administrator/.m2/repository/org/fuse
> urce/commonman/commons-management/1.0/commons-management-1.0.jar,
> file:/C:/Doc
> ents and
> Settings/Administrator/.m2/repository/org/springframework/spring-cont
> t/3.0.3.RELEASE/spring-context-3.0.3.RELEASE.jar, file:/C:/Documents and
> Setti
> s/Administrator/.m2/repository/org/springframework/spring-aop/3.0.3.RELEASE/sp
> ng-aop-3.0.3.RELEASE.jar, file:/C:/Documents and
> Settings/Administrator/.m2/re
> sitory/aopalliance/aopalliance/1.0/aopalliance-1.0.jar, file:/C:/Documents
> and
> ettings/Administrator/.m2/repository/org/springframework/spring-asm/3.0.3.RELE
> E/spring-asm-3.0.3.RELEASE.jar, file:/C:/Documents and
> Settings/Administrator/
> 2/repository/org/springframework/spring-beans/3.0.3.RELEASE/spring-beans-3.0.3
> ELEASE.jar, file:/C:/Documents and
> Settings/Administrator/.m2/repository/org/s
> ingframework/spring-core/3.0.3.RELEASE/spring-core-3.0.3.RELEASE.jar,
> file:/C:
> ocuments and
> Settings/Administrator/.m2/repository/commons-logging/commons-log
> ng/1.1.1/commons-logging-1.1.1.jar, file:/C:/Documents and
> Settings/Administra
> r/.m2/repository/org/springframework/spring-expression/3.0.3.RELEASE/spring-ex
> ession-3.0.3.RELEASE.jar, file:/C:/Documents and
> Settings/Administrator/.m2/re
> sitory/org/springframework/spring-tx/3.0.3.RELEASE/spring-tx-3.0.3.RELEASE.jar
> file:/C:/Documents and
> Settings/Administrator/.m2/repository/org/apache/mina/m
> a-core/1.1.7/mina-core-1.1.7.jar, file:/C:/Documents and
> Settings/Administrato
> .m2/repository/org/slf4j/slf4j-api/1.6.0/slf4j-api-1.6.0.jar,
> file:/C:/Documen
>  and
> Settings/Administrator/.m2/repository/org/apache/camel/camel-saxon/2.4.0/
> mel-saxon-2.4.0.jar, file:/C:/Documents and
> Settings/Administrator/.m2/reposit
> y/net/sf/saxon/saxon/9.1.0.8/saxon-9.1.0.8.jar, file:/C:/Documents and
> Setting
> Administrator/.m2/repository/net/sf/saxon/saxon-dom/9.1.0.8/saxon-dom-9.1.0.8.
> r, file:/C:/Documents and
> Settings/Administrator/.m2/repository/net/sf/saxon/s
> on-sql/9.1.0.8/saxon-sql-9.1.0.8.jar, file:/C:/Documents and
> Settings/Administ
> tor/.m2/repository/net/sf/saxon/saxon-xpath/9.1.0.8/saxon-xpath-9.1.0.8.jar,
> f
> e:/C:/Documents and
> Settings/Administrator/.m2/repository/org/apache/camel/cam
> -mina/2.4.0/camel-mina-2.4.0.jar, file:/C:/Documents and
> Settings/Administrato
> .m2/repository/org/apache/camel/camel-jms/2.4.0/camel-jms-2.4.0.jar,
> file:/C:/
> cuments and
> Settings/Administrator/.m2/repository/org/springframework/spring-j
> /3.0.3.RELEASE/spring-jms-3.0.3.RELEASE.jar, file:/C:/Documents and
> Settings/A
> inistrator/.m2/repository/org/apache/geronimo/specs/geronimo-jms_1.1_spec/1.1.
> geronimo-jms_1.1_spec-1.1.1.jar, file:/C:/Documents and
> Settings/Administrator
> m2/repository/org/apache/activemq/activemq-core/5.3.2/activemq-core-5.3.2.jar,
> ile:/C:/Documents and
> Settings/Administrator/.m2/repository/org/apache/activem
> activeio-core/3.1.2/activeio-core-3.1.2.jar, file:/C:/Documents and
> Settings/A
> inistrator/.m2/repository/org/apache/geronimo/specs/geronimo-j2ee-management_1
> _spec/1.0.1/geronimo-j2ee-management_1.1_spec-1.0.1.jar, file:/C:/Documents
> an
> Settings/Administrator/.m2/repository/org/apache/activemq/kahadb/5.3.2/kahadb-
> 3.2.jar, file:/C:/Documents and
> Settings/Administrator/.m2/repository/org/apac
> /activemq/protobuf/activemq-protobuf/1.0/activemq-protobuf-1.0.jar,
> file:/C:/D
> uments and
> Settings/Administrator/.m2/repository/org/osgi/org.osgi.core/4.1.0/
> g.osgi.core-4.1.0.jar, file:/C:/Documents and
> Settings/Administrator/.m2/repos
> ory/org/springframework/osgi/spring-osgi-core/1.2.0/spring-osgi-core-1.2.0.jar
> file:/C:/Documents and
> Settings/Administrator/.m2/repository/org/springframewo
> /osgi/spring-osgi-io/1.2.0/spring-osgi-io-1.2.0.jar, file:/C:/Documents and
> Se
> ings/Administrator/.m2/repository/org/apache/geronimo/specs/geronimo-j2ee-mana
> ment_1.0_spec/1.1/geronimo-j2ee-management_1.0_spec-1.1.jar,
> file:/C:/Document
> and
> Settings/Administrator/.m2/repository/commons-net/commons-net/2.0/commons-
> t-2.0.jar, file:/C:/Programmi/Java/jdk1.6.0_20/jre/../lib/tools.jar]
> 11-ago-2010 12.31.10 org.apache.camel.impl.MainSupport doStart
> INFO: Apache Camel 2.4.0 starting
> 11-ago-2010 12.31.10
> org.springframework.context.support.AbstractApplicationCo
> ext prepareRefresh
> INFO: Refreshing
> org.springframework.context.support.ClassPathXmlApplicationCo
> ext@b1cb25: startup date [Wed Aug 11 12:31:10 CEST 2010]; root of context
> hier
> chy
> 11-ago-2010 12.31.10
> org.springframework.beans.factory.xml.XmlBeanDefinitionRe
> er loadBeanDefinitions
> INFO: Loading XML bean definitions from file [C:\Documents and
> Settings\Admini
> rator\workspace\camel-example-spring-xquery\target\classes\META-INF\spring\cam
> Context.xml]
> 11-ago-2010 12.31.10 org.apache.camel.spring.handler.CamelNamespaceHandler
> ini
> INFO: camel-osgi.jar/camel-spring-osgi.jar not detected in classpath
> 11-ago-2010 12.31.11
> org.springframework.beans.factory.support.DefaultListable
> anFactory preInstantiateSingletons
> INFO: Pre-instantiating singletons in
> org.springframework.beans.factory.suppor
> DefaultListableBeanFactory@f4e6d: defining beans
> [template,consumerTemplate,ca
> lContext:beanPostProcessor,camelContext,jms]; root of factory hierarchy
> 11-ago-2010 12.31.11 org.apache.camel.impl.DefaultCamelContext doStart
> INFO: Apache Camel 2.4.0 (CamelContext: camelContext) is starting
> 11-ago-2010 12.31.11 org.apache.camel.impl.DefaultCamelContext
> createManagemen
> trategy
> INFO: JMX enabled. Using ManagedManagementStrategy.
> 11-ago-2010 12.31.11
> org.apache.camel.impl.converter.AnnotationTypeConverterLo
> er load
> INFO: Found 4 packages with 14 @Converter classes to load
> 11-ago-2010 12.31.11 org.apache.camel.impl.converter.DefaultTypeConverter
> load
> peConverters
> INFO: Loaded 148 type converters in 0.301 seconds
> SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
> SLF4J: Defaulting to no-operation (NOP) logger implementation
> SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further
> deta
> s.
> 11-ago-2010 12.31.12 org.apache.camel.component.mina.MinaConsumer doStart
> INFO: Binding to server address: /192.168.1.223:3000 using acceptor:
> org.apach
> mina.transport.socket.nio.SocketAcceptor@ebbf5c
> 11-ago-2010 12.31.12 org.apache.camel.component.mina.MinaConsumer doStop
> INFO: Unbinding from server address: /192.168.1.223:3000 using acceptor:
> org.a
> che.mina.transport.socket.nio.SocketAcceptor@ebbf5c
> 11-ago-2010 12.31.12 org.apache.camel.impl.MainSupport doStop
> INFO: Apache Camel 2.4.0 stopping
> *************************************
> Error occurred while running main from: org.apache.camel.spring.Main
> java.lang.reflect.InvocationTargetException
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImp
> java:39)
>        at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcc
> sorImpl.java:25)
>        at java.lang.reflect.Method.invoke(Method.java:597)
>        at org.apache.camel.maven.RunMojo$1.run(RunMojo.java:415)
>        at java.lang.Thread.run(Thread.java:619)
> Caused by: org.apache.camel.RuntimeCamelException: java.net.BindException:
> Can
> t assign requested address: bind
>        at
> org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(Object
> lper.java:1126)
>        at
> org.apache.camel.spring.SpringCamelContext.onApplicationEvent(Sprin
> amelContext.java:103)
>        at
> org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(
> melContextFactoryBean.java:231)
>        at
> org.springframework.context.event.SimpleApplicationEventMulticaster
> ulticastEvent(SimpleApplicationEventMulticaster.java:97)
>        at
> org.springframework.context.support.AbstractApplicationContext.publ
> hEvent(AbstractApplicationContext.java:303)
>        at
> org.springframework.context.support.AbstractApplicationContext.fini
> Refresh(AbstractApplicationContext.java:911)
>        at
> org.springframework.context.support.AbstractApplicationContext.refr
> h(AbstractApplicationContext.java:428)
>        at
> org.springframework.context.support.ClassPathXmlApplicationContext.
> nit>(ClassPathXmlApplicationContext.java:139)
>        at
> org.springframework.context.support.ClassPathXmlApplicationContext.
> nit>(ClassPathXmlApplicationContext.java:93)
>        at
> org.apache.camel.spring.Main.createDefaultApplicationContext(Main.j
> a:219)
>        at org.apache.camel.spring.Main.doStart(Main.java:173)
>        at
> org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:56)
>        at org.apache.camel.impl.MainSupport.run(MainSupport.java:114)
>        at org.apache.camel.impl.MainSupport.run(MainSupport.java:291)
>        at org.apache.camel.spring.Main.main(Main.java:97)
>        ... 6 more
> Caused by: java.net.BindException: Cannot assign requested address: bind
>        at sun.nio.ch.Net.bind(Native Method)
>        at
> sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.jav
> 119)
>        at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59)
>        at
> org.apache.mina.transport.socket.nio.SocketAcceptor.registerNew(Soc
> tAcceptor.java:363)
>        at
> org.apache.mina.transport.socket.nio.SocketAcceptor.access$800(Sock
> Acceptor.java:55)
>        at
> org.apache.mina.transport.socket.nio.SocketAcceptor$Worker.run(Sock
> Acceptor.java:222)
>        at
> org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunna
> e.java:51)
>        at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolEx
> utor.java:886)
>        at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecut
> .java:908)
>        ... 1 more
> *************************************
> [INFO]
> -----------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO]
> -----------------------------------------------------------------------
> [INFO]
>
> Cannot assign requested address: bind
> [INFO]
> -----------------------------------------------------------------------
> [INFO] For more information, run Maven with the -e switch
> [INFO]
> -----------------------------------------------------------------------
> [INFO] Total time: 5 seconds
> [INFO] Finished at: Wed Aug 11 12:31:12 CEST 2010
> [INFO] Final Memory: 30M/72M
> [INFO]
> -----------------------------------------------------------------------
> 11-ago-2010 12.31.12 org.apache.camel.spring.Main$HangupInterceptor run
> INFO: Received hang up - stopping the main instance.
> C:\Documents and
> Settings\Administrator\workspace\camel-example-spring-xquery>
> --
> View this message in context: http://camel.465427.n5.nabble.com/troubles-camel-example-spring-xquery-modified-including-camel-mina-tp2471729p2471729.html
> Sent from the Camel Development mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus