BTW,

I tried to use the spring extension that serviceMix provides..
I tried the Spring 1.2-dev-2 provided with SM, as well as the latest 1.2.4
spring release, and both of them give me :

org.springframework.beans.factory.BeanDefinitionStoreException: Line 2 in XML do
cument from class path resource [spring/servicemix.xml] is invalid; nested excep
tion is org.xml.sax.SAXParseException: Document root element "beans", must match
 DOCTYPE root "null".
org.xml.sax.SAXParseException: Document root element "beans", must match DOCTYPE
 root "null".

where my file is :
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:my="http://servicemix.org/demo/";>

  <!-- the JBI container -->
  <container id="jbi">
  <property name="rootDir" value="./META-INF/servicemix/wdir"/>
   <property name="useMBeanServer" value="true"/>
   <property name="createMBeanServer" value="true"/>
   <property name="installationDirPath" value="./META-INF/servicemix/install"/>
   <property name="deploymentDirPath" value="./META-INF/servicemix/deploy"/>

   <property name="monitorInstallationDirectory" value="false"/>
   <property name="dumpStats" value="true"/>
   <property name="statsInterval" value="10"/>
   <property name="transactionManager" ref="transactionManager"/>

    <components>

      <!-- lets kick off a timer to send messages on an input destination topic
-->
      <component id="timer" service="my:timer"
class="org.servicemix.components.quartz.QuartzComponent"
destinationService="my:inputSender">
        <property name="triggers">
          <map>
            <entry>
              <key>
                <bean class="org.quartz.SimpleTrigger">
                  <property name="repeatInterval" value="5000"/>
                  <property name="repeatCount" value="-1"/>
                </bean>
              </key>
                <bean class="org.quartz.JobDetail">
                  <property name="name" value="My Example Job"/>
                  <property name="group" value="ServiceMix"/>
                </bean>
            </entry>
          </map>
        </property>
      </component>

      <component id="inputSender" service="my:inputSender"
class="org.servicemix.components.jms.JmsSenderComponent">
        <property name="template">
          <bean class="org.springframework.jms.core.JmsTemplate">
            <property name="connectionFactory">
              <ref local="jmsConnectionFactory"/>
            </property>
            <property name="defaultDestinationName" value="WeatherTopic"/>
            <property name="pubSubDomain" value="true"/>
          </bean>
        </property>
      </component>


      <!-- lets subscribe and republish on a different JMS destination - i.e.
make a JMS bridge -->
      <component id="inputReceiver" service="my:inputReceiver"
class="org.servicemix.components.jms.JmsInUsingJCABinding"
destinationService="my:outputSender">
        <property name="jcaContainer" ref="jencks"/>
        <property name="activationSpec">
          <bean class="org.activemq.ra.ActiveMQActivationSpec">
            <property name="destination" value="WeatherTopic"/>
            <property name="destinationType" value="javax.jms.Topic"/>
          </bean>
        </property>
      </component>


      <component id="outputSender" service="my:outputSender"
class="org.servicemix.components.jms.JmsSenderComponent">
        <property name="template">
          <bean class="org.springframework.jms.core.JmsTemplate">
            <property name="connectionFactory">
              <ref local="jmsConnectionFactory"/>
            </property>
            <property name="defaultDestinationName" value="TestTopic"/>
            <property name="pubSubDomain" value="true"/>
          </bean>
        </property>
      </component>


      <!-- just to demonstrate that we are sending messages, lets trace the
messages we receive -->
      <component id="jmsTrace" service="my:jmsTrace"
class="org.servicemix.components.jms.JmsInUsingJCABinding"
destinationService="my:trace">
        <property name="jcaContainer" ref="jencks"/>
        <property name="activationSpec">
          <bean class="org.activemq.ra.ActiveMQActivationSpec">
            <property name="destination" value="TestTopic"/>
            <property name="destinationType" value="javax.jms.Topic"/>
          </bean>
        </property>
      </component>

      <component id="trace" service="my:trace"
class="org.servicemix.components.util.TraceComponent"/>
    </components>
  </container>


  <!-- the JCA container -->
  <bean id="jencks" class="org.jencks.JCAContainer" singleton="true">

    <!-- lets use the default configuration of work manager and transaction
manager-->
    <property name="bootstrapContext">
      <bean class="org.jencks.factory.BootstrapContextFactoryBean">
        <property name="threadPoolSize" value="25"/>
      </bean>
    </property>

    <!-- the JCA Resource Adapter -->
    <property name="resourceAdapter">
      <bean id="activeMQResourceAdapter"
class="org.activemq.ra.ActiveMQResourceAdapter" singleton="true">
        <property name="serverUrl" value="${jms.jndiProviderUrl}"/>
      </bean>
    </property>
  </bean>

<!--
  <!-- message broker -->
  <bean id="broker" class="org.activemq.spring.BrokerFactoryBean">
     <property name="config" value="classpath:activemq.xml"/>
   </bean>

-->

  <bean id="transactionManager"
class="org.jencks.factory.TransactionManagerFactoryBean"/>

<!--
  <bean id="jmsFactory" class="org.activemq.pool.PooledConnectionFactory">
    <property name="connectionFactory">
      <bean class="org.activemq.ActiveMQConnectionFactory">
        <property name="brokerURL">
          <value>tcp://localhost:61616</value>
        </property>
      </bean>
    </property>
  </bean>
-->
</beans>

Thanks,
Sami Dalouche

Selon Sami Dalouche <[EMAIL PROTECTED]>:

> Hi,
>
> I'm trying to embed ServiceMix using plain spring (not the
> container/component
> tags, that I have no idea how to use using an unmodified spring)
>
> So, for the moment, I'm just trying to deploy as few stuff as possible :
>
>
>   <bean id="jbi" class="org.servicemix.jbi.container.SpringJBIContainer">
>
>     <property name="componentNames">
>       <list>
>         <value>sender</value>
>       </list>
>     </property>
>   </bean>
>
>
>  <bean id="sender" class="org.servicemix.components.jms.JmsSenderComponent">
>       <property name="template">
>               <ref bean="jmsTemplate"/>
>       </property>
>     <property name="service" ref="receiverServiceName"/>
>
>   </bean>
>
>   <bean id="receiverServiceName" class="javax.xml.namespace.QName">
>     <constructor-arg value="http://servicemix.org/example/"/>
>     <constructor-arg value="receiver"/>
>   </bean>
>
> and I get the following Exception :
>
> org.springframework.beans.factory.BeanCreationException: Error creating bean
> wit
> h name 'jbi' defined in class path resource [spring/servicemix.xml]:
> Initializat
> ion of bean failed; nested exception is java.lang.IllegalArgumentException:
> null
>  source
> java.lang.IllegalArgumentException: null source
>         at java.util.EventObject.<init>(Unknown Source)
>         at javax.management.Notification.<init>(Unknown Source)
>         at javax.management.AttributeChangeNotification.<init>(Unknown
> Source)
>         at
> org.servicemix.jbi.management.BaseStandardMBean.sendAttributeChangeNo
> tification(BaseStandardMBean.java:438)
>         at
> org.servicemix.jbi.management.BaseStandardMBean.updateAttribute(BaseS
> tandardMBean.java:221)
>
> Does anyone have some advice to give me ?
>
> Thanks a lot
> Sami Dalouche
>
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
>
>




----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

Reply via email to