In head you could depend on the DeploymentInfo of the package that
contained the ejbs.
I think in 3.0 there is an EJBModule mbean representing the set of ejbs in
the ejb-jar.xml file. Try depending on it too.
I'm not sure but I think that with cmp2 and cmr the ejbs may not be fully
usable until all the ejbs are deployed and all relationships fully
evaluated.
david jencks
On 2003.02.18 06:39 Jonathan.O'[EMAIL PROTECTED] wrote:
> Hi,
> Here's a strange bug. I have some MBean code that does our system
> initialisation for us. On startup of JBoss (Version 3.0.5), it gets a
> TransactionRolledBackLocalException.
> However, if I redeploy our EAR, then it runs with no problems. I guess
> that I need to add another dependency. But what should I add?
>
> Here's the JBoss-service.xml
> <?xml version="1.0" encoding="UTF-8"?>
> <server>
> <mbean code="xcom.traxbahn.system.TraxbahnManagement"
> name="TIPS:service=TraxbahnManager">
> <depends>jboss.jca:service=LocalTxDS,name=OracleDS</depends>
> <depends>jboss.j2ee:service=EJB,jndiName=ejb/CurrencyBc</depends>
> <depends>jboss.j2ee:service=EJB,jndiName=ejb/LoginBc</depends>
> <depends>jboss.j2ee:service=EJB,jndiName=ejb/local/User</depends>
>
><depends>jboss.j2ee:service=EJB,jndiName=ejb/local/UserGroup</depends>
> <depends>jboss.j2ee:service=EJB,jndiName=ejb/local/Command</depends>
>
><depends>jboss.j2ee:service=EJB,jndiName=ejb/local/SubCommand</depends>
> </mbean>
> </server>
>
> Here's the bit of code I call in the MBean:
>
> public void startService() {
> log.info( "Starting Service" );
> refreshSysConfig(); // Uses direct JDBC calls. Connection
> looked up in JNDI.
> refreshCurrencyManager(); // Uses direct JDBC calls.
> Connection looked up in JNDI.
> refreshIssuers(); // Uses direct JDBC calls. Connection
> looked up in JNDI.
> ensureTwoAdmins(); // The offending problem - uses Entity beans
> }
>
> public String ensureTwoAdmins() {
> try {
> log.info("Attempting to ensure two admins");
> LoginBcHome home =
> (LoginBcHome)RemoteHomeFactory.getFactory().lookUpHome(
> LoginBcHome.class, JndiNames.JNDI_NAMES_LOGIN_BC_REMOTE );
> LoginBcRemote loginBean = home.create();
> Collection admins =
> loginBean.findUsersInGroup("admin"); // Marked as txn required
> if ( admins.size() < 2 ) {
> loginBean.removeAllUsers();
> createUser( "admin", "admin", "admin" );
> createUser( "system", "system", "admin"
> );
> return "Created admin/admin,
> system/system and god";
> }
> } catch (CreateException e) {
> } catch (RemoteException e) {
> } catch (TBException e) {
> }
> return "No new users created";
> }
>
> Finally, here's the exception stack trace.
> 11:12:11,525 ERROR [LogInterceptor] TransactionRolledbackLocalException,
> causedBy:
> java.lang.NullPointerException
> at
>
>org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.createBeanClassInstance(JDBCStoreManager.java:513)
> at
>
>org.jboss.ejb.plugins.CMPPersistenceManager.createBeanClassInstance(CMPPersistenceManager.java:165)
> at
>
>org.jboss.resource.connectionmanager.CachedConnectionInterceptor.createBeanClassInstance(CachedConnectionInterceptor.java:251)
> at
> org.jboss.ejb.EntityContainer.createBeanClassInstance(EntityContainer.java:294)
> at
> org.jboss.ejb.plugins.AbstractInstancePool.get(AbstractInstancePool.java:184)
> at
>
>org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:78)
> at
> org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:79)
> at
>
>org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:44)
> at
>
>org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:111)
> at
> org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:228)
> at
> org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:62)
> at
> org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:105)
> at
> org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:129)
> at
> org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:487)
> at
>
>org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.invokeHome(BaseLocalContainerInvoker.java:230)
> at
> org.jboss.ejb.plugins.local.LocalHomeProxy.invoke(LocalHomeProxy.java:110)
> at $Proxy234.findByPrimaryKey(Unknown Source)
> at
>
>xcom.traxbahn.bproc.bcomponents.ejb.LoginBcBean.findUsersInGroup(LoginBcBean.java:453)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:324)
> at
>
>org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:660)
> at
>
>org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
>
> at
>
>org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:77)
>
> at
>
>org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:107)
> at
> org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:228)
> at
> org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:92)
> at
> org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:130)
> at
> org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:204)
> at
> org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.java:313)
> at org.jboss.ejb.Container.invoke(Container.java:712)
> at
> org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
> at
> org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:98)
> at
> org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:102)
> at
> org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:77)
> at
> org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:80)
> at
>
>org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:111)
> at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:76)
> at $Proxy242.findUsersInGroup(Unknown Source)
> at
> xcom.traxbahn.system.TraxbahnManagement.ensureTwoAdmins(TraxbahnManagement.java:91)
> at
> xcom.traxbahn.system.TraxbahnManagement.startService(TraxbahnManagement.java:79)
> at
> org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:165)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:324)
> at
>
>org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
> at
> org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
> at
> org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:1003)
> at $Proxy4.start(Unknown Source)
> at
> org.jboss.system.ServiceController.start(ServiceController.java:413)
> at
> org.jboss.system.ServiceController.start(ServiceController.java:433)
> at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:324)
> at
>
>org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
> at
> org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
> at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
> at $Proxy188.start(Unknown Source)
> at org.jboss.ejb.EjbModule.startService(EjbModule.java:430)
> at
> org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:165)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:324)
> at
>
>org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
> at
> org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
> at
> org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:1003)
> at $Proxy4.start(Unknown Source)
> at
> org.jboss.system.ServiceController.start(ServiceController.java:413)
> at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:324)
> at
>
>org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
> at
> org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
> at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
> at $Proxy10.start(Unknown Source)
> at org.jboss.ejb.EJBDeployer.start(EJBDeployer.java:395)
> at org.jboss.deployment.MainDeployer.start(MainDeployer.java:814)
> at org.jboss.deployment.MainDeployer.start(MainDeployer.java:806)
> at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:627)
> at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:591)
> at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:324)
> at
>
>org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
> at
> org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
> at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
> at $Proxy3.deploy(Unknown Source)
> at
>
>org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:435)
> at
> org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:561)
> at
>
>org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:21
> 2)
> at
>
>org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:225)
>
> at
>
>org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:202)
>
> Ciao,
> Jonathan O'Connor
> Development Manager
> XCOM Dublin
> Phone: +353 1 872 3305
> Mobile: +353 86 824 0736
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user
>
>
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user