Hello Andreas,

I finally get an idea from where could comes the problem because I
reproduced it through Eclipse with my JUnit tests on my embedded activemq
project which is directly linked on my activemq-core Eclipse project (note
that when I link my embedded activemq project with the activemq-core jar
file there is no problem). 

To avoid this exception I must past the src/main/resources/* of activemq
core project to my own embedded activemq project... It seems that eclipse
doesn't add these activemq core project resources files and directory to the
classpath (I can't explain why)...

++


Andreas Gies-3 wrote:
> 
> hmmm....
> 
> 
> maybe its the stupid question of the day, but why don't yo use the  
> servicemix 4 kernel and load the active mq feature into it ?
> 
> Best regards
> Andreas
> 
> On Apr 8, 2009, at 2:53 PM, ffrenchm wrote:
> 
>>
>> Hello,
>>
>> first of all I must say that the bellow test has been realized  
>> successfully
>> without Felix. Bellow some log to show you the minimalist  
>> configuration of
>> my embedded ActiveMQ.
>>
>> INFO  Broker                    - Starting Broker
>> INFO  BrokerService                  - Using Persistence Adapter:
>> AMQPersistenceAdapter(null)
>> INFO  AMQPersistenceAdapter          - AMQStore starting using  
>> directory:
>> /home/mffrench/work/SVN/sandbox/broker/src/tests/resources/com/ 
>> broker/activemq/data/TEST
>> INFO  KahaStore                      - Kaha Store using data directory
>> /home/mffrench/work/SVN/sandbox/broker/src/tests/resources/com/ 
>> broker/activemq/data/TEST/kr-store/state
>> INFO  AMQPersistenceAdapter          - Active data files: []
>> INFO  BrokerService                  - ActiveMQ 5.2.0 JMS Message  
>> Broker
>> (TEST) is starting
>> INFO  BrokerService                  - For help or more information  
>> please
>> see: http://activemq.apache.org/
>> INFO  ManagementContext              - JMX consoles can connect to
>> service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi
>> INFO  KahaStore                      - Kaha Store using data directory
>> /home/mffrench/work/SVN/sandbox/broker/src/tests/resources/com/ 
>> broker/activemq/data/TEST/kr-store/data
>> INFO  TransportServerThreadSupport   - Listening for connections at:
>> tcp://dekatonshir:61616
>> INFO  TransportConnector             - Connector tcp://dekatonshir: 
>> 61616
>> Started
>> INFO  BrokerService                  - ActiveMQ JMS Message Broker  
>> (TEST,
>> ID:dekatonshir-59477-1239193687912-0:0) started
>> Broker started.
>> Stopping broker.
>> INFO  Broker                    - Stopping Broker
>> INFO  BrokerService                  - ActiveMQ Message Broker (TEST,
>> ID:dekatonshir-59477-1239193687912-0:0) is shutting down
>> INFO  TransportConnector             - Connector tcp://dekatonshir: 
>> 61616
>> Stopped
>> INFO  BrokerService                  - ActiveMQ JMS Message Broker  
>> (TEST,
>> ID:dekatonshir-59477-1239193687912-0:0) stopped
>>
>> When I try to run my embedded ActiveMQ with the same configuration  
>> through a
>> Felix OSGI Service I get this exception :
>>
>> java.lang.ClassCastException:
>> org.apache.activemq.transport.tcp.TcpTransportFactory cannot be cast  
>> to
>> org.apache.activemq.transport.TransportFactory
>>      at
>> org 
>> .apache 
>> .activemq 
>> .transport 
>> .TransportFactory.findTransportFactory(TransportFactory.java:201)
>>      at
>> org 
>> .apache 
>> .activemq.transport.TransportFactory.bind(TransportFactory.java:123)
>>      at
>> org 
>> .apache 
>> .activemq 
>> .broker.BrokerService.createTransportConnector(BrokerService.java: 
>> 1712)
>>      at
>> org 
>> .apache 
>> .activemq.broker.BrokerService.addConnector(BrokerService.java:217)
>>      at
>> com 
>> .broker 
>> .activemq 
>> .ActiveMQBrokerConfiguration 
>> .setBrokerOptionalConfiguration(ActiveMQBrokerConfiguration.java:272)
>>      at
>> com 
>> .broker 
>> .activemq 
>> .ActiveMQBrokerConfiguration 
>> .setBrokerConfiguration(ActiveMQBrokerConfiguration.java:369)
>>      at
>> com 
>> .broker 
>> .activemq 
>> .ActiveMQBrokerConfiguration.<init>(ActiveMQBrokerConfiguration.java: 
>> 349)
>>      at com.broker.activemq.ActiveMQBroker.<init>(ActiveMQBroker.java:22)
>>      at com.osgi.services.broker.BrokerService.init(BrokerService.java:38)
>>      at com.osgi.services.broker.BrokerService.start(BrokerService.java: 
>> 42)
>>      at
>> org 
>> .apache 
>> .felix.framework.util.SecureAction.startActivator(SecureAction.java: 
>> 589)
>>      at org.apache.felix.framework.Felix._startBundle(Felix.java:1421)
>>      at org.apache.felix.framework.Felix.startBundle(Felix.java:1341)
>>      at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java: 
>> 942)
>>      at  
>> org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:262)
>>      at java.lang.Thread.run(Thread.java:619)
>> ERROR: Error starting file:bnd/broker-service.jar
>> (org.osgi.framework.BundleException: Activator start error in bundle
>> broker-service [39].)
>> java.io.IOException: Transport scheme NOT recognized: [tcp]
>>      at
>> org 
>> .apache 
>> .activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:27)
>>      at
>> org 
>> .apache 
>> .activemq 
>> .transport 
>> .TransportFactory.findTransportFactory(TransportFactory.java:205)
>>      at
>> org 
>> .apache 
>> .activemq.transport.TransportFactory.bind(TransportFactory.java:123)
>>      at
>> org 
>> .apache 
>> .activemq 
>> .broker.BrokerService.createTransportConnector(BrokerService.java: 
>> 1712)
>>      at
>> org 
>> .apache 
>> .activemq.broker.BrokerService.addConnector(BrokerService.java:217)
>>      at
>> com 
>> .broker 
>> .activemq 
>> .ActiveMQBrokerConfiguration 
>> .setBrokerOptionalConfiguration(ActiveMQBrokerConfiguration.java:272)
>>      at
>> com 
>> .broker 
>> .activemq 
>> .ActiveMQBrokerConfiguration 
>> .setBrokerConfiguration(ActiveMQBrokerConfiguration.java:369)
>>      at
>> com 
>> .broker 
>> .activemq 
>> .ActiveMQBrokerConfiguration.<init>(ActiveMQBrokerConfiguration.java: 
>> 349)
>>      at com.broker.activemq.ActiveMQBroker.<init>(ActiveMQBroker.java:22)
>>      at com.osgi.services.broker.BrokerService.init(BrokerService.java:38)
>>      at com.osgi.services.broker.BrokerService.start(BrokerService.java: 
>> 42)
>>      at
>> org 
>> .apache 
>> .felix.framework.util.SecureAction.startActivator(SecureAction.java: 
>> 589)
>>      at org.apache.felix.framework.Felix._startBundle(Felix.java:1421)
>>      at org.apache.felix.framework.Felix.startBundle(Felix.java:1341)
>>      at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java: 
>> 942)
>>      at  
>> org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:262)
>>      at java.lang.Thread.run(Thread.java:619)
>> Caused by: java.lang.ClassCastException:
>> org.apache.activemq.transport.tcp.TcpTransportFactory cannot be cast  
>> to
>> org.apache.activemq.transport.TransportFactory
>>      at
>> org 
>> .apache 
>> .activemq 
>> .transport 
>> .TransportFactory.findTransportFactory(TransportFactory.java:201)
>>      ... 15 more
>>
>> For me it's very strange because after checking some time on the  
>> eclipse
>> debugger in the two cases I do not see any behavior difference in the
>> org.apache.activemq.transport.TransportFactory.findTransportFactory  
>> and
>> above...
>>
>> It maybe coming from my Felix environment ? I try to be the most  
>> rigorous as
>> possible about activemq-core dependency and I installed all the
>> activemq-core dependencies bundles listed in META-INF/DEPENDENCIES  
>> file in
>> the jar but without any results...
>>
>> Bellow my Felix ps :
>>
>>   ID   State         Level  Name
>> [   0] [Active     ] [    0] System Bundle (1.5.0.SNAPSHOT)
>> [   1] [Active     ] [    1] Apache Felix Shell Service  
>> (1.1.0.SNAPSHOT)
>> [   2] [Active     ] [    1] Apache Felix Shell TUI (1.1.0.SNAPSHOT)
>> [   3] [Active     ] [    1] Apache Felix Bundle Repository  
>> (1.3.0.SNAPSHOT)
>> [   4] [Active     ] [    1] Apache Felix EventAdmin (1.0.0)
>> [   5] [Active     ] [    1] Apache Felix Log Service (0.9.0.SNAPSHOT)
>> [   6] [Active     ] [    1]
>> file:/home/mffrench/work/SVN/sandbox/broker/lib/annogen-0.1.0.jar
>> [   7] [Active     ] [    1]
>> file:/home/mffrench/work/SVN/sandbox/broker/lib/ant-1.6.2.jar
>> [   8] [Active     ] [    1]
>> file:/home/mffrench/work/SVN/sandbox/broker/lib/aopalliance-1.0.jar
>> [   9] [Active     ] [    1] Apache Commons Logging (1.1.1)
>> [  10] [Active     ] [    1] Apache Log4J (1.2.15)
>> [  11] [Active     ] [    1]
>> file:/home/mffrench/work/SVN/sandbox/broker/lib/backport-util- 
>> concurrent-2.1.jar
>> [  12] [Active     ] [    1]
>> file:/home/mffrench/work/SVN/sandbox/broker/lib/commons- 
>> logging-1.1.jar
>> [  13] [Active     ] [    1] Apache Commons Pool Bundle (1.4)
>> [  14] [Active     ] [    1] Apache Derby 10.1 (10.1.3000001.417277)
>> [  15] [Active     ] [    1] geronimo-jacc_1.1_spec (1.0.1)
>> [  16] [Active     ] [    1]
>> file:/home/mffrench/work/SVN/sandbox/broker/lib/geronimo- 
>> jta_1.0.1B_spec-1.1.jar
>> [  17] [Active     ] [    1] geronimo-jta_1.1_spec (1.1.1)
>> [  18] [Active     ] [    1] geronimo-j2ee-management_1.1_spec (1.0.1)
>> [  19] [Active     ] [    1] geronimo-jms_1.1_spec (1.1.1)
>> [  20] [Active     ] [    1]
>> file:/home/mffrench/work/SVN/sandbox/broker/lib/gram-1.1.jar
>> [  21] [Active     ] [    1] Servlet 2.1 API (1.0.1.SNAPSHOT)
>> [  22] [Active     ] [    1] spring-aop (2.5.5)
>> [  23] [Active     ] [    1] spring-beans (2.5.5)
>> [  24] [Active     ] [    1] spring-core (2.5.5)
>> [  25] [Active     ] [    1] spring-context (2.5.5)
>> [  26] [Active     ] [    1] spring-context-support (2.5.5)
>> [  27] [Active     ] [    1] spring-jms (2.5.5)
>> [  28] [Active     ] [    1] spring-tx (2.5.5)
>> [  29] [Active     ] [    1]
>> file:/home/mffrench/work/SVN/sandbox/broker/lib/xalan-2.6.0.jar
>> [  30] [Active     ] [    1] xbean-spring (3.5)
>> [  31] [Active     ] [    1]
>> file:/home/mffrench/work/SVN/sandbox/broker/lib/xpp3-1.1.3.3.jar
>> [  32] [Active     ] [    1]
>> file:/home/mffrench/work/SVN/sandbox/broker/lib/xstream-1.2.2.jar
>> [  33] [Active     ] [    1]
>> file:/home/mffrench/work/SVN/sandbox/broker/lib/activeio- 
>> core-3.1.0.jar
>> [  34] [Active     ] [    1] activemq-jaas (5.2.0)
>> [  35] [Active     ] [    1]
>> file:/home/mffrench/work/SVN/sandbox/broker/lib/activemq- 
>> jmdns_1.0-5.2.0.jar
>> [  36] [Active     ] [    1]
>> file:/home/mffrench/work/SVN/sandbox/broker/lib/activemq-openwire- 
>> generator-5.2.0.jar
>> [  37] [Active     ] [    1] activemq-core (5.2.0)
>> [  38] [Active     ] [    1] broker (0.0.1)
>> [  39] [Resolved   ] [    1] broker-service (0.0.1)
>>
>> Did anybody already get this error ? Do anybody have an idea from  
>> where this
>> error might come and how to solve it ???
>>
>> Thanks for all
>> -- 
>> View this message in context:
>> http://www.nabble.com/Get-an-exception-when-running-embedded-ActiveMQ-with-TransportConnector-activation-on-Felix-tp22949763p22949763.html
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
> 
> ---
> Mit freundlichen Grüssen - Kind Regards
> Andreas Gies
> Principal Consultant
> Open Source Center of Competence
> 
> Progress Software GmbH
> Agrippinawerft 26
> 50678 Köln
> 
> E-Mail        ag...@progress.com
> Direct Line   +49 (0)9953 980349
> Mobile        +49 (0)170 5759611
> Skype         +44 (0)20 3239 2922
> Skype         +353 (0)1 443 4971
> Skype         +1 (0)781 262 0168
> 
> http://www.progress.com
> http://fusesource.com
> http://open-source-adventures.blogspot.com
> 
> 
> 
> -------------------------------------------------------
> Progress Software GmbH
> Sitz der Gesellschaft: Agrippinawerft 26, 50678 Koeln;
> Niederlassung: Fuerstenrieder Str. 279, 81377 Muenchen
> Amtsgericht Koeln, HRB 15620;
> Geschaeftsfuehrung: David Ireland
> -------------------------------------------------------
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Get-an-exception-when-running-embedded-ActiveMQ-with-TransportConnector-activation-on-Felix-tp22949763p23761710.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to