[jboss-user] [EJB 3.0] - Re: MBean start ordering in 5.0CR2
Just a note that I've duplicated the issue and am working on a fix for the next release. Thanks huberth for your detailed explanations. S, ALR View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4200028#4200028 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4200028 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: MBean start ordering in 5.0CR2
Raised https://jira.jboss.org/jira/browse/EJBTHREE-1530 View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4182922#4182922 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4182922 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: MBean start ordering in 5.0CR2
"huberth" wrote : On the other hand, come to think of it, the requirement to call the life cycle methods at the right time is strictly EJB3. I guess you are right. I think you could file a JIRA under EJBTHREE project and point to this thread. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4182915#4182915 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4182915 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: MBean start ordering in 5.0CR2
On the other hand, come to think of it, the requirement to call the life cycle methods at the right time is strictly EJB3. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4182911#4182911 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4182911 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: MBean start ordering in 5.0CR2
Agreed. What do we do with it now? Should I raise a JIRA? Or do you? View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4182907#4182907 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4182907 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: MBean start ordering in 5.0CR2
Going by what you have shown here, this looks like a bug to me. I think its more a Microcontainer bug (as far as i know, that's what resolves the dependencies) than a EJB3 bug. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4182904#4182904 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4182904 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: MBean start ordering in 5.0CR2
I've got it. Try this: public interface LifeCycle | { | public void create() throws Exception; | public void start() throws Exception; | | public void destroy(); | public void stop(); | } @Management(LifeCycle.class) | @Service(objectName = "myorg:service=MBeanB") | public class MBeanB implements LifeCycle | { | private static final Logger logger = Logger.getLogger(MBeanB.class); | | public void create() throws Exception | { | logger.log(Level.INFO, "Creating"); | } | | public void start() throws Exception | { | logger.log(Level.INFO, "Starting"); | } | | public void destroy() | { | logger.log(Level.INFO, "Destroying"); | } | | public void stop() | { | logger.log(Level.INFO, "Stopping"); | } | } @Management(LifeCycle.class) | @Depends("myorg:service=MBeanB") | @Service(objectName = "myorg:service=MBeanA") | public class MBeanA implements LifeCycle | { | private static final Logger logger = Logger.getLogger(MBeanA.class); | | public void create() throws Exception | { | logger.log(Level.INFO, "Creating"); | } | | public void start() throws Exception | { | logger.log(Level.INFO, "Starting"); | } | | public void destroy() | { | logger.log(Level.INFO, "Destroying"); | } | | public void stop() | { | logger.log(Level.INFO, "Stopping"); | } | } Then put MBeanA into a.jar and MBeanB into b.jar (the jar names matter - the relative alphabetical sort order to be precise). Create an exploded ear in the deploy directory with no application.xml (not sure if this part matters, but it's what I've been doing) and place the two jars in it. I get the following logs, indicating they started out of order: 2008/10/17 08:54:18.813 INFO (main) [com.myorg.common.server.MBeanA.create:36] Creating | 2008/10/17 08:54:18.835 INFO (main) [com.myorg.common.server.MBeanA.start:41] Starting | 2008/10/17 08:54:18.842 INFO (main) [com.myorg.common.server.MBeanB.create:35] Creating | 2008/10/17 08:54:18.896 INFO (main) [com.myorg.common.server.MBeanB.start:40] Starting The ear's contents are sorted first by suffix, then by name to come up with the attempted installation order. Since MBeanA comes first, but can't be installed yet due to an unresolved dependency, it is skipped. When MBeanB is installed, we recurse looking for newly resolved dependencies, at which time we find MBeanB and attempt to install it. Unfortunately, as I mentioned previously, the create/start methods get invoked only after this recursion. So the recursion is probably correct, but the great distance (code-wise) between the state transitions and the invocation of the corresponding life cycle methods is probably the real problem. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4182902#4182902 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4182902 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: MBean start ordering in 5.0CR2
Look closely at the chain of calls between the lower installMBean and the resolveContexts calls. Further down inside the install call from installMBean the code eventually transitions the state of StatisticsMBean to created, then started, then installed, constantly calling resolveContexts(boolean) along the way. That call to resolveContexts eventually figures out that StatisticsMBean is installed, which BWAllocatorAdminMBean requires, so it installs that MBean as well (although, stepping through I didn't quite figure out exactly how that happened, to be honest). The problem is that the actual create/start methods get invoked on StatisticsMBean only after the install call returns, much later. I would have thought those calls would have been more closely tied to the actual state transitions that they represent... say, as part of StartStopLifecycleAction.installAction() for example. There seems to be an odd inconsistency in the approach to handling dependencies here, too. We have both the recursion thing going on, as well as the iteration going on in resolveContexts. That is, of course, from a fairly superficial understanding of the code and the problem space, so maybe there's nothing to that. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4182766#4182766 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4182766 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: MBean start ordering in 5.0CR2
The thirdparty directory seems to cover a lot of (only?) non-jboss stuff. For example, AbstractController.java is not under the 5.0 source directory anywhere, and it seems to be an important player here. I found a copy of it under viewvc, but it's obviously a different version as the line numbers don't line up. But I am at least able to look at variable values for that class in the debugger. And, yes, EJB3-1430 is the reason I downloaded beta4. I'm not sure how anyone's getting anywhere with CR2 as it stands. But, agreed, it's hard to tell if it's specific to the Beta4 load, as my current issue would have been preempted by the other one. Uploading the application might be a bit difficult as I don't think it'd be simply a matter of giving you the ear. I figured out the log4j thing - we had altered the default one so those lines weren't coming out. I just had to set the logger 'org.jboss.ejb3.deployers.JBossASKernel' to 'INFO' level. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4182731#4182731 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4182731 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: MBean start ordering in 5.0CR2
"huberth" wrote : | | I've got the source for AS 5.0CR2, and EJB3 1.0.0-Beta4. If you have 5.0CR2 source then you will find most of the required java files in there. The source for the other projects can be found under 5.0CR2 source/thirdparty/jboss/xxx folder. "huberth" wrote : | I should probably add that to get this far, I had to download, build and apply the 1.0.0-Beta4 release of the EJB3 module. | I should admit that, i am not on 1.0.0-Beta4 of EJB3. I know there's a bug in JBoss-5 CR2 https://jira.jboss.org/jira/browse/EJBTHREE-1430, because of which you probably moved to this version of EJB3. The fix for that was a single line change in one of the EJB3 files (ServiceContainer.java). So i just patched in this single file instead of moving to 1.0.0-Beta4. I am not sure if the issue that you are seeing is specific to 1.0.0-Beta4. "huberth" wrote : | Can you try separating them into separate jars, play with the names of the jars, putting a sleep(60) in the create method of AnotherServiceImpl (although, they're all started from thread 'main' so I guess it's unlikely that will show anything)? | I can give it a try during some free time tomorrow. But if possible, upload your application to some place where i could access it. "huberth" wrote : | Also, what log4j tweak do I need to do to get the 'installing bean:' logs? | Nothing. The log4j settings are the default that come with JBoss. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4182723#4182723 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4182723 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: MBean start ordering in 5.0CR2
I've attached a debugger to the server and placed a break-point in BWAllocatorAdminMBean.start. Here's the stack trace in the main thread: [EMAIL PROTECTED], priority=5, in group 'jboss', status: 'RUNNING' | at com.alcatel.tpapps.rac.server.bwallocator.BWAllocatorAdminMBean.start(BWAllocatorAdminMBean.java:50) | at sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java:-1) | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) | at java.lang.reflect.Method.invoke(Method.java:597) | at org.jboss.aop.joinpoint.MethodInvocation.invokeTarget(MethodInvocation.java:122) | at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111) | at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:56) | at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) | at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47) | at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) | at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42) | at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) | at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79) | at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:190) | at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) | at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76) | at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) | at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42) | at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) | at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41) | at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) | at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106) | at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) | at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:65) | at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) | at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67) | at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) | at org.jboss.ejb3.service.ServiceContainer.localInvoke(ServiceContainer.java:409) | at org.jboss.ejb3.service.ServiceContainer.localInvoke(ServiceContainer.java:374) | at org.jboss.ejb3.service.ServiceMBeanDelegate.invoke(ServiceMBeanDelegate.java:215) | at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164) | at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668) | at org.jboss.ejb3.deployers.JBossASKernel.invokeOptionalMethod(JBossASKernel.java:287) | at org.jboss.ejb3.deployers.JBossASKernel.installMBean(JBossASKernel.java:177) | at org.jboss.ejb3.service.ServiceContainer.registerManagementInterface(ServiceContainer.java:615) | at org.jboss.ejb3.service.ServiceContainer.lockedStart(ServiceContainer.java:241) | at org.jboss.ejb3.EJBContainer.start(EJBContainer.java:866) | at sun.reflect.GeneratedMethodAccessor190.invoke(Unknown Source:-1) | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) | at java.lang.reflect.Method.invoke(Method.java:597) | at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:59) | at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:150) | at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66) | at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:241) | at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47) | at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:109) | at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:70) | at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleActi
[jboss-user] [EJB 3.0] - Re: MBean start ordering in 5.0CR2
I added 'Starting' logs to my MBeans and got: 2008/10/16 09:35:43.366 INFO (main) [com.myorg.rac.server.bwallocator.BWAllocatorAdminMBean.start:50] Starting BWAllocatorAdminMBean | | 2008/10/16 09:35:45.661 ERROR (main) [org.jboss.logging.util.LoggerStream.write:156] java.lang.RuntimeException: Problem registering @Management interface for @Service class com.myorg.rac.server.bwallocator.BWAllocatorAdminMBean | | 2008/10/16 09:35:46.132 INFO (main) [com.myorg.common.server.statistics.StatisticsMBean.start:54] Starting StatisticsMBean Another thing to note here is that these MBeans are in two different jars in an exploded ear, which has no application.xml. I should probably also mention that I'm getting lots of warnings like: 2008/10/16 09:35:44.659 WARN (main) [org.jboss.ejb3.interceptors.registry.InterceptorRegistry.getApplicableInterceptorClasses:82] applicable interceptors is non-existent for public void com.myorg.common.server.statistics.StatisticsMBean.registerCounter(java.lang.String,java.lang.String) throws com.myorg.common.exception.OperationFailedException Curiously, I seem to be getting one of those for all mgmt interface methods except 'start'. Things seem to be functioning well enough that I had been assuming those were benign. I have other MBeans that do end up starting in the right order. In fact, most of them do. That doesn't necessarily mean that such timing is enforced, of course. If it's left to a race, there will be winners and losers. Can you try separating them into separate jars, play with the names of the jars, putting a sleep(60) in the create method of AnotherServiceImpl (although, they're all started from thread 'main' so I guess it's unlikely that will show anything)? Also, what log4j tweak do I need to do to get the 'installing bean:' logs? View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4182673#4182673 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4182673 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: MBean start ordering in 5.0CR2
anonymous wrote : When MBeanA's start method is called, it calls a method on MBeanB via its injected reference, which delegates to the singleton. The problem is that at this point, a field in the singleton has not been initialized, as MBeanB's start method hasn't yet been called. | As per the documentation http://docs.jboss.org/ejb3/app-server/reference/build/reference/en/html/jboss_extensions.html: anonymous wrote : start() - called by the server when the service is started and all the services it depends upon have been started too. At this point the service (and all the services it depends on) is fully functional. So what you are observing should not have happened. So i decided to give it a try with a simple application with 2 dependent services (MyService depends on AnotherService): @Service (objectName = "org.myapp:name=MyService") | @Management(MyService.class) | @Depends({"org.myapp:name=AnotherService"}) | public class MyServiceImpl implements MyService { | | | public void create() throws Exception { | System.out.println("Created " + this.getClass().getName() + " at " + new Timestamp(System.currentTimeMillis())); | | } | | public void start() throws Exception { | System.out.println("Started " + this.getClass().getName() + " at " + new Timestamp(System.currentTimeMillis())); | | | } | | } | | @Service (objectName = "org.myapp:name=AnotherService") | @Management(AnotherService.class) | public class AnotherServiceImpl implements AnotherService { | | public void create() throws Exception { | System.out.println("Created " + this.getClass().getName() + " at " + new Timestamp(System.currentTimeMillis())); | | } | | public void start() throws Exception { | System.out.println("Started " + this.getClass().getName() + " at " + new Timestamp(System.currentTimeMillis())); | | } | | } | | | Since MyService depends on AnotherService, the start() of AnotherService will be called first and then the start() of the MyService. And that's exactly how it behaves as can be seen in the logs: 13:42:24,590 INFO [JBossASKernel] Created KernelDeployment for: myapp_ejb3.jar | 13:42:24,605 INFO [JBossASKernel] installing bean: jboss.j2ee:ear=ServiceTest.ear,jar=myapp_ejb3.jar,name=AnotherServiceImpl,service=EJB3 | 13:42:24,605 INFO [JBossASKernel] with dependencies: | 13:42:24,605 INFO [JBossASKernel] and demands: | 13:42:24,605 INFO [JBossASKernel] jboss.ejb:service=EJBTimerService | 13:42:24,605 INFO [JBossASKernel] and supplies: | 13:42:24,605 INFO [JBossASKernel] Class:org.myapp.service.AnotherService | 13:42:24,605 INFO [JBossASKernel] jndi:ServiceTest/AnotherServiceImpl/remote | 13:42:24,605 INFO [JBossASKernel] jndi:ServiceTest/AnotherServiceImpl/local | 13:42:24,605 INFO [JBossASKernel] jndi:ServiceTest/AnotherServiceImpl/local-org.myapp.service.AnotherService | 13:42:24,605 INFO [JBossASKernel] Added bean(jboss.j2ee:ear=ServiceTest.ear,jar=myapp_ejb3.jar,name=AnotherServiceImpl,service=EJB3) to KernelDeployment of: myapp_ejb3.jar | 13:42:24,605 INFO [JBossASKernel] installing bean: jboss.j2ee:ear=ServiceTest.ear,jar=myapp_ejb3.jar,name=MyServiceImpl,service=EJB3 | 13:42:24,605 INFO [JBossASKernel] with dependencies: | 13:42:24,605 INFO [JBossASKernel] and demands: | 13:42:24,605 INFO [JBossASKernel] jboss.ejb:service=EJBTimerService | 13:42:24,605 INFO [JBossASKernel] org.myapp:name=AnotherService | 13:42:24,605 INFO [JBossASKernel] and supplies: | 13:42:24,605 INFO [JBossASKernel] jndi:ServiceTest/MyServiceImpl/local | 13:42:24,605 INFO [JBossASKernel] jndi:ServiceTest/MyServiceImpl/local-org.myapp.service.MyService | 13:42:24,605 INFO [JBossASKernel] Class:org.myapp.service.MyService | 13:42:24,605 INFO [JBossASKernel] jndi:ServiceTest/MyServiceImpl/remote | 13:42:24,605 INFO [JBossASKernel] Added bean(jboss.j2ee:ear=ServiceTest.ear,jar=myapp_ejb3.jar,name=MyServiceImpl,service=EJB3) to KernelDeployment of: myapp_ejb3.jar | 13:42:25,027 INFO [EJBContainer] STARTED EJB: org.myapp.service.AnotherServiceImpl ejbName: AnotherServiceImpl | 13:42:25,136 INFO [JBossASKernel] installing bean: org.myapp:name=AnotherService | 13:42:25,136 INFO [JBossASKernel] with dependencies: | 13:42:25,136 INFO [JBossASKernel] and demands: | 13:42:25,136 INFO [JBossASKernel] jboss.ejb:service=EJBTimerService | 13:42:25,136 INFO [JBossASKernel] and supplies: | 13:42:25,136 INFO [JBossASKernel] Class:org.myapp.service.AnotherService | 13:42:25,136 INFO [JBossASKernel] jndi:ServiceTest/AnotherServiceImpl/remote | 13:42:25,136 INFO [JBossASKernel] jndi:ServiceTest/AnotherServiceImpl/local
[jboss-user] [EJB 3.0] - Re: MBean start ordering in 5.0CR2
Here are the various classes involved, pruned down to the relevant bits. Let me know if I've done too much pruning. // MBeanB in the initial post | @Management(StatisticsAdmin.class) | @Service(objectName = "com.alcatel.tpapps.common:service=StatisticsAdmin") | @RemoteBinding(jndiBinding = StatisticsAdmin.JNDI_NAME) | public class StatisticsMBean | implements StatisticsAdmin | { | public void start() throws OperationFailedException | { | StatisticsManager.getInstance().init(getDBStatisticsSamplingInterval(), | getDBRateCalculationEnabled()); | } | | public void registerCounter(String aInCounterName, | String aInDesc) | throws OperationFailedException | { | StatisticsManager.getInstance(). | registerCounter(aInCounterName, aInDesc); | } | ... | } // MBeanA in the initial post | @Management(BasicMBeanInterface.class) | @Service(objectName = "com.alcatel.tpapps.rac:service=BWAllocatorAdmin") | @Depends({"com.alcatel.tpapps.common:service=StatisticsAdmin"}) | public class BWAllocatorAdminMBean implements BasicMBeanInterface | { | @Resource(mappedName = StatisticsAdmin.JNDI_NAME) | StatisticsAdmin statsAdmin; | | | public void start() throws OperationFailedException | { | // Counter Registration | registerCounters(); | } | | private void registerCounters() throws OperationFailedException | { | Enumeration lCounterList = | BWAllocatorCounters.getInstance().getKeys(); | while (lCounterList.hasMoreElements()) | { | String lCounterName = lCounterList.nextElement(); | | statsAdmin.registerCounter(lCounterName, | BWAllocatorCounters.getInstance().getCounterDescription( | lCounterName)); |} | } | } // The Singleton class | public class StatisticsManager | { | private static StatisticsManager instance = new StatisticsManager(); | | private String localHost = null; | private long statisticsSamplingInterval = 0L; | private boolean rateCalculationEnabled = false; | | public static StatisticsManager getInstance() | { | return instance; | } | public void init(long aInSamplingInterval, | boolean aInRateCalculationEnabled) throws OperationFailedException | { | try | { | localHost = InetAddress.getLocalHost().getHostAddress(); | } | catch (UnknownHostException e) | { | //noinspection ThrowInsideCatchBlockWhichIgnoresCaughtException | throw new OperationFailedException(Level.ERROR, | "IP address of localhost could not be determined. (" | + e.getMessage() + ')'); | } | | rateCalculationEnabled = aInRateCalculationEnabled; | statisticsSamplingInterval = aInSamplingInterval; | } | | public synchronized Counter registerCounter(String aInCounterName, | String aInDesc) | throws OperationFailedException | { | ... | // When this is called, localHost is null. There's more code here, which | // ultimately ends up assigning the null localHost to a not-null constrained | // field of an entity and persists that entity | } | } And here's the exception: javax.ejb.EJBTransactionRolledbackException: org.hibernate.PropertyValueException: not-null property references a null or transient value: com.myorg.common.par.Statistic.hostIpAddress | java.lang.RuntimeException: Problem registering @Management interface for @Service class com.myorg.rac.server.bwallocator.BWAllocatorAdminMBean | at org.jboss.ejb3.service.ServiceContainer.registerManagementInterface(ServiceContainer.java:641) | at org.jboss.ejb3.service.ServiceContainer.lockedStart(ServiceContainer.java:241) | at org.jboss.ejb3.EJBContainer.start(EJBContainer.java:866) | at sun.reflect.GeneratedMethodAccessor190.invoke(Unknown Source) | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) | at java.lang.reflect.Method.invoke(Method.java:597) | at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:59) | at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:150) | at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66) | at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:241) | at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(Execu
[jboss-user] [EJB 3.0] - Re: MBean start ordering in 5.0CR2
Can you please post the code of those MBeans and the exception stacktrace? That will help in understanding the problem better. While posting the logs or xml content or code, remember to wrap it in a code block using the Code button in the message editor window and please hit the Preview button to make sure your post is correctly formatted View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4182363#4182363 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4182363 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: MBean start ordering in 5.0CR2
I should probably add that to get this far, I had to download, build and apply the 1.0.0-Beta4 release of the EJB3 module. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4182236#4182236 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4182236 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user