activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ChipSchoch <csch...@elynx.com>
Subject Re: JBoss Integration Question from newb
Date Thu, 03 Sep 2009 14:27:06 GMT

When I use this one I get a naming exception because DefaultDS is not yet
bound:

<beans >

	<bean xmlns=""
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
    
  <broker useJmx="true" brokerName="chip.broker1">

		<managementContext><!-- we'll use an existing one (JBoss) instead of
creating one -->
		  <managementContext createConnector="false"/>
		</managementContext>
	
		<!-- In ActiveMQ 4, you can setup destination policies. note: this xml
format may still change a bit -->
    <destinationPolicy>
      <policyMap><policyEntries>

          <policyEntry topic="FOO.>">
            <dispatchPolicy>
              <strictOrderDispatchPolicy />
            </dispatchPolicy>
            <subscriptionRecoveryPolicy>
              <lastImageSubscriptionRecoveryPolicy />
            </subscriptionRecoveryPolicy>
          </policyEntry>

      </policyEntries></policyMap>
    </destinationPolicy>


    <persistenceAdapter><!-- 
      <journaledJDBC journalLogFiles="5"
dataDirectory="{jboss.server.data.dir}/activemq"/>
      To use a different datasource, use th following syntax : -->
      <!--
      <journaledJDBC journalLogFiles="5" dataDirectory="../data"
dataSource="#postgres-ds"/>
       -->
        <jdbcPersistenceAdapter dataSource="#sybase-ds"/>

    </persistenceAdapter>

    <transportConnectors >
      <!-- prefixing a connector with discovery: causes the connector to be
advertiesed over rendezvous -->
      <transportConnector name="chip.broker1" uri="tcp://localhost:61616"
discoveryUri="multicast://default"/>
    </transportConnectors>

    <networkConnectors>
      <!-- by default just auto discover the other brokers -->
      <networkConnector uri="multicast://default"/>
      <!--
      <networkConnector
uri="static://(tcp://host1:61616,tcp://host2:61616)"/>
      -->
    </networkConnectors>

  </broker>

    <!-- Sybase DataSource Setup -->
    
    <bean name="sybase-ds"
class="org.springframework.jndi.JndiObjectFactoryBean">
        <property name="jndiName" value="java:/DefaultDS"/>
    </bean>    
</beans>

When I use this one I get BrokerService not started:

<beans xmlns="http://activemq.apache.org/schema/core">

	<bean xmlns=""
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>

  <broker useJmx="true" brokerName="chip.broker1">

		<managementContext><!-- we'll use an existing one (JBoss) instead of
creating one -->
		  <managementContext createConnector="false"/>
		</managementContext>
	
		<!-- In ActiveMQ 4, you can setup destination policies. note: this xml
format may still change a bit -->
    <destinationPolicy>
      <policyMap><policyEntries>

          <policyEntry topic="FOO.>">
            <dispatchPolicy>
              <strictOrderDispatchPolicy />
            </dispatchPolicy>
            <subscriptionRecoveryPolicy>
              <lastImageSubscriptionRecoveryPolicy />
            </subscriptionRecoveryPolicy>
          </policyEntry>

      </policyEntries></policyMap>
    </destinationPolicy>


    <persistenceAdapter>
      <journaledJDBC journalLogFiles="5"
dataDirectory="{jboss.server.data.dir}/activemq" datasource="#sybase-ds/>
      <!-- To use a different datasource, use th following syntax : -->
      <!--
      <journaledJDBC journalLogFiles="5" dataDirectory="../data"
dataSource="#postgres-ds"/>
       -->
    </persistenceAdapter>

    <transportConnectors >
      <!-- prefixing a connector with discovery: causes the connector to be
advertiesed over rendezvous -->
      <transportConnector name="chip.broker1" uri="tcp://localhost:61616"
discoveryUri="multicast://default"/>
    </transportConnectors>

    <networkConnectors>
      <!-- by default just auto discover the other brokers -->
      <networkConnector uri="multicast://default"/>
      <!--
      <networkConnector
uri="static://(tcp://host1:61616,tcp://host2:61616)"/>
      -->
    </networkConnectors>

  </broker>

    <!-- Sybase DataSource Setup -->
    
    <!--class="org.springframework.jndi.JndiObjectFactoryBean">
        <property name="jndiName" value="java:/DefaultDS"/>
    </bean>    --> 
    
    <bean id="sybase-ds"  class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
      <property name="driverClassName"
value="net.sourceforge.jtds.jdbc.Driver"/>
      <property name="url"
value="jdbc:jtds:sybase://172.17.20.50:4800;DatabaseName=DEV_JBM_144B"/>
      <property name="username" value="sa"/>
      <property name="password" value="prodsa"/>
      <property name="maxActive" value="200"/>
      <property name="poolPreparedStatements" value="true"/>
    </bean>
</beans>







Gary Tully wrote:
> 
> can you post your broker-config.xml?
> 
> 2009/9/3 ChipSchoch <cschoch@elynx.com>
> 
>>
>> I am trying to integrate JBossAs 4.2.2 and ActiveMQ 5.2.0.  Following the
>> instructions works fine, but I am trying to configure it to use jdbc
>> persistence (sybase db).  I was attempting to specify a JBoss datasource
>> in
>> my broker-config.xml but the .rar deploys before the sybase-ds.xml so the
>> datasource is not bound in JNDI.  I cannot seem to find any example of
>> this
>> integration.
>>
>> Has anyone integrated JBoss with ActiveMQ and used jdbc persistence
>> employing the JBoss datasource?  If so, could you post the configuration?
>>
>> I went through the exercise where I defined the datasource in the config
>> using xbean and was able to reconcile all the class not found and schema
>> violations etc; but then the JBoss log gives:
>>
>> 31 WARN    | Starting ActiveMQ Broker |
>> org.apache.activemq.ra.ActiveMQResourceAdapter     | Could not start up
>> embeded ActiveMQ Broker 'xbean:broker-config.xml': The configuration has
>> no
>> BrokerService instance for resource: xbean:broker-config.xml
>> 2009-09-03 08:25:29,9
>>
>> I am basically clueless on this.  It should not be this difficult.  Any
>> help
>> would really be appreciated.
>> --
>> View this message in context:
>> http://www.nabble.com/JBoss-Integration-Question-from-newb-tp25275700p25275700.html
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
>>
> 
> 
> -- 
> http://blog.garytully.com
> 
> Open Source Integration
> http://fusesource.com
> 
> 

-- 
View this message in context: http://www.nabble.com/JBoss-Integration-Question-from-newb-tp25275700p25277273.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message