This content has been marked as final.
Show 9 replies
-
1. Re: MicroContainer with external dependencies
alesj Oct 17, 2007 6:07 AM (in response to ataylor)"ataylor" wrote:
If i was running as a service i would add the following to my bean definition<depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
You mean mbean?
As MC being full state machine, this is of course there:<bean name="PojoInjectee" class="org.jboss.example.microcontainer.mbeans.PojoInjectee"> <depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends> </bean> <bean name="demander" class="org.jboss.example.microcontainer.demand.Demander"> <demand state="Create">jboss.jca:service=DataSourceBinding,name=DefaultDS</demand> </bean>
Even with additional 'demand' dependency. ;-)
But then your datasource should also be registered through MC.
Or see Carlo's JNDI problem: http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4079099#4079099 -
2. Re: MicroContainer with external dependencies
ataylor Oct 17, 2007 7:07 AM (in response to ataylor)ok, that worked cheers.
If i register my datasource within the MC something like<bean name="DataSource" class="org.jboss.resource.adapter.jdbc.local.LocalTxDataSource"> <property name="driverClass">com.mysql.jdbc.Driver</property> <property name="connectionURL">jdbc:mysql://localhost:3306/messaging</property> <property name="userName">sa</property> </bean>
And another app within the JBoss AS also connects to this database, via the DefaultDS, wont I be using a different connection pool? -
3. Re: MicroContainer with external dependencies
alesj Oct 17, 2007 8:36 AM (in response to ataylor)"ataylor" wrote:
And another app within the JBoss AS also connects to this database, via the DefaultDS, wont I be using a different connection pool?
This is out-of-the-scope of MC. ;-)
All MC will do is instantiate new LTDS bean, fill it in with provided propertys, call create/start methods and finally install the bean into registry.
Check the code for how LTDS works, or how can it be tuned to use existing cpool. -
4. Re: MicroContainer with external dependencies
ataylor Oct 29, 2007 5:28 AM (in response to ataylor)If have the following definition
<bean name="ServiceLocator" class="org.jboss.jms.server.microcontainer.ServiceLocator"> <depends>jboss:service=TransactionManager</depends> <depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends> </bean>
i get the errorjboss.jca:service=DataSourceBinding,name=DefaultDS -> ** NOT FOUND **
The dependency on the Transaction Manager is enforced correctly, however it cant seem to find the datasource binding. Is this to do with the fact that these are deployed slightly differently in the App Server. i.e. the datasource mbean is dynamically created from the *-ds.xml file at startup time?
Is the MC not able to enforce this? -
5. Re: MicroContainer with external dependencies
alesj Oct 29, 2007 6:11 AM (in response to ataylor)Can you check the JMX console for datasource mbean?
What about if you change order of props --> jboss.jca:name=DefaultDS,service=DataSourceBinding?
This should not matter - we fixed it - but just to see where the problem might be.
MC definitely knows how to enforce this kind of dependices. ;-) -
6. Re: MicroContainer with external dependencies
ataylor Oct 29, 2007 6:57 AM (in response to ataylor)cheers Ales, that did the trick.
many thanks. -
7. Re: MicroContainer with external dependencies
alesj Oct 29, 2007 7:05 AM (in response to ataylor)"ataylor" wrote:
cheers Ales, that did the trick.
many thanks.
Great that it worked.
But it shouldn't depend on the ObjectName props order.
Either you have some old version that doesn't have the fixes that we did for this, or we missed some case. :-)
What's your version again?
Or the whole env? -
8. Re: MicroContainer with external dependencies
ataylor Oct 29, 2007 7:43 AM (in response to ataylor)i'm running in JBoss 5.0.0.Beta2
-
9. Re: MicroContainer with external dependencies
alesj Oct 29, 2007 7:55 AM (in response to ataylor)Can you try the latest JBoss AS5 trunk?