[jboss-user] [EJB3] - Re: Using ejb-jar.xml for @Singleton bean

Benoit Heinrich do-not-reply at jboss.com
Mon Feb 14 04:23:13 EST 2011


Benoit Heinrich [http://community.jboss.org/people/benoit.heinrich] created the discussion

"Re: Using ejb-jar.xml for @Singleton bean"

To view the discussion, visit: http://community.jboss.org/message/587183#587183

--------------------------------------------------------------
Hi Jaikiran,

I've tried the suggested approach but unfortunately it doesn't work.
There is no error in the logs, but the startup postcontruct method isn't fired.

Here is the new class I've used:
package com.example.services.startup;

import com.example.services.version.VersionManager;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import javax.annotation.PostConstruct;
import javax.ejb.Singleton;
import javax.ejb.Startup;

@Singleton
@Startup
public class StartupBean {
          private static final Log log = LogFactory.getLog(StartupBean.class);

          private VersionManager versionManager;

          @PostConstruct
          public void startup() {
                    log.info("System started (version " + versionManager.getVersion() + ")");
          }
}


And here is the output from jboss:
10:15:19,793 INFO   org.jboss.deployment.dependency.ContainerDependencyMetaData org.jboss.deployment.dependency.ContainerDependencyMetaData addJndiDependency, JndiDependencyMetaData at e32434{01-services/VersionManagerBean/local}
10:15:19,795 INFO   org.jboss.ejb3.deployers.Ejb3DependenciesDeployer org.jboss.ejb3.deployers.Ejb3DependenciesDeployer Encountered deployment AbstractVFSDeploymentContext at 22312589
10:15:19,795 INFO   org.jboss.ejb3.deployers.Ejb3DependenciesDeployer org.jboss.ejb3.deployers.Ejb3DependenciesDeployer Encountered deployment AbstractVFSDeploymentContext at 22312589
10:15:19,811 INFO   org.jboss.ejb3.instantiator.deployer.BeanInstantiatorDeployerBase org.jboss.ejb3.instantiator.deployer.BeanInstantiatorDeployerBase Installed org.jboss.ejb3.instantiator.impl.Ejb31SpecBeanInstantiator at 42791a into MC at org.jboss.ejb.bean.instantiator/99-startup/startup-1.19.0-SNAPSHOT/StartupBean
10:15:19,811 WARN   org.jboss.ejb3.interceptor.InterceptorInfoRepository org.jboss.ejb3.interceptor.InterceptorInfoRepository EJBTHREE-1852: InterceptorInfoRepository is deprecated
10:15:19,841 INFO   org.jboss.ejb3.singleton.deployer.SingletonContainerDeployer org.jboss.ejb3.singleton.deployer.SingletonContainerDeployer Installing container for EJB StartupBean
10:15:19,841 INFO   org.jboss.ejb3.singleton.deployer.SingletonContainerDeployer org.jboss.ejb3.singleton.deployer.SingletonContainerDeployer with dependencies: 
10:15:19,841 INFO   org.jboss.ejb3.singleton.deployer.SingletonContainerDeployer org.jboss.ejb3.singleton.deployer.SingletonContainerDeployer with demands: 
10:15:19,841 INFO   org.jboss.ejb3.singleton.deployer.SingletonContainerDeployer org.jboss.ejb3.singleton.deployer.SingletonContainerDeployer jboss-injector:topLevelUnit=99-startup.ear,unit=startup-1.19.0-SNAPSHOT.jar,bean=StartupBean
10:15:19,841 INFO   org.jboss.ejb3.singleton.deployer.SingletonContainerDeployer org.jboss.ejb3.singleton.deployer.SingletonContainerDeployer with supplies: 
10:15:19,843 INFO   org.jboss.ejb3.singleton.deployer.SingletonBeanJNDIBinderDeployer org.jboss.ejb3.singleton.deployer.SingletonBeanJNDIBinderDeployer Binding the following entries in JNDI for singleton bean: StartupBean
10:15:19,875 INFO   org.jboss.ejb3.session.SessionSpecContainer org.jboss.ejb3.session.SessionSpecContainer Starting jboss.j2ee:ear=99-startup.ear,jar=startup-1.19.0-SNAPSHOT.jar,name=StartupBean,service=EJB3
10:15:19,875 WARN   org.jboss.ejb3.session.SessionSpecContainer org.jboss.ejb3.session.SessionSpecContainer EJBTHREE-2126: container jboss.j2ee:ear=99-startup.ear,jar=startup-1.19.0-SNAPSHOT.jar,name=StartupBean,service=EJB3 does not verify the businessObjectFactory
10:15:19,876 INFO   http://community.jboss.org/message/587183#587183 Re: Using ejb-jar.xml for @Singleton bean STARTED EJB: com.example.services.startup.StartupBean ejbName: StartupBean
10:15:19,876 WARN   http://community.jboss.org/message/587183#587183 Re: Using ejb-jar.xml for @Singleton bean EJBTHREE-2193: using deprecated TimerServiceFactory for restoring timers
10:15:19,898 INFO   org.jboss.ejb3.nointerface.impl.jndi.AbstractNoInterfaceViewBinder org.jboss.ejb3.nointerface.impl.jndi.AbstractNoInterfaceViewBinder Binding the following entry in Global JNDI for bean:StartupBean


          99-startup/StartupBean/no-interface -> EJB3.1 no-interface view


Do you see anything wrong I'am doing here?
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/587183#587183]

Start a new discussion in EJB3 at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2029]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110214/3e7b6c6c/attachment.html 


More information about the jboss-user mailing list