4 Replies Latest reply on Nov 17, 2005 5:57 AM by Emmanuel Bernard

    Problems on EJB3 - Application

    Alvaro Martinez Newbie

      Hi,

      As of yet, I am developing an EJB3 Application, and I have EJB3 Trailblazer as a guide, I have created all descriptors, the trail shows, fixing them up to my requirements, and I have also packaged the application such as the blazer illustrates.

      The tools I have been using for it are: JBoss AS 4.0.3. RC2, Jboss IDE 1.5 RC1, EJB 3.0 RC2, An Oracle 10g Database, (I included the hibernate_cfg.xml file as a part of the .ejb3 file), all this over Windows 2000 server.

      Well all the development process is going fine up to the debugging stage where the JBoss issued this log when starting or deploying the application:

      ==>>
      00:10:39,562 INFO [JaccHelper] Initialising JACC Context for deployment: XCellDomainServer.ejb3
      00:10:39,984 INFO [Ejb3AnnotationHandler] found EJB3: ejbName=XCellDomRemote.OApplPropertiesBean,
      class=XCellDomRemote.OApplPropertiesBean, type=STATELESS
      00:10:40,328 INFO [JaccHelper] XCellDomRemote.OApplPropertiesBean has no @SecurityDomain - skipping JACC configuration
      00:10:40,390 INFO [Ejb3AnnotationHandler] found EJB3: ejbName=XCellDomRemote.OCiudadesBean,
      class=XCellDomRemote.OCiudadesBean, type=STATELESS
      00:10:40,453 INFO [JaccHelper] XCellDomRemote.OCiudadesBean has no @SecurityDomain - skipping JACC configuration

      00:10:40,562 INFO [Ejb3Deployment] default entity manager name: XCellDomainServer

      00:10:40,578 INFO [Ejb3Configuration] found EJB3 Entity bean: XCellDomSrvrSeg.OSysPrivs
      00:10:40,578 INFO [Ejb3Configuration] found EJB3 Entity bean: XCellDomSrvrSeg.OSysUsers
      00:10:40,578 INFO [Ejb3Configuration] found EJB3 Entity bean: XCellDomSrvr.OApplProperty
      00:10:40,578 INFO [Ejb3Configuration] found EJB3 Entity bean: XCellDomSrvr.OBodega
      00:10:40,578 INFO [Ejb3Configuration] found EJB3 Entity bean: XCellDomSrvr.OCiudad
      00:10:40,578 INFO [Ejb3Configuration] found EJB3 Entity bean: XCellDomSrvr.OCliente
      00:10:40,593 INFO [Ejb3Configuration] found EJB3 Entity bean: XCellDomSrvr.OClienteEmpresa
      00:10:40,593 INFO [Ejb3Configuration] found EJB3 Entity bean: XCellDomSrvr.OCombo
      00:10:40,593 INFO [Ejb3Configuration] found EJB3 Entity bean: XCellDomSrvr.OElemento
      00:10:40,609 INFO [Ejb3Configuration] found EJB3 Entity bean: XCellDomSrvr.OEmpresa
      00:10:40,609 INFO [Ejb3Configuration] found EJB3 Entity bean: XCellDomSrvr.OEquipo
      00:10:40,609 INFO [Ejb3Configuration] found EJB3 Entity bean: XCellDomSrvr.OEstadisticasVentas
      00:10:40,609 INFO [Ejb3Configuration] found EJB3 Entity bean: XCellDomSrvr.OFactura
      00:10:40,609 INFO [Ejb3Configuration] found EJB3 Entity bean: XCellDomSrvr.OFacturaCompra
      00:10:40,625 INFO [Ejb3Configuration] found EJB3 Entity bean: XCellDomSrvr.OFacturaDetalle
      00:10:40,625 INFO [Ejb3Configuration] found EJB3 Entity bean: XCellDomSrvr.OFacturaVenta
      00:10:40,625 INFO [Ejb3Configuration] found EJB3 Entity bean: XCellDomSrvr.OMarca
      00:10:40,625 INFO [Ejb3Configuration] found EJB3 Entity bean: XCellDomSrvr.OModelo
      00:10:40,625 INFO [Ejb3Configuration] found EJB3 Entity bean: XCellDomSrvr.OOperador
      00:10:40,625 INFO [Ejb3Configuration] found EJB3 Entity bean: XCellDomSrvr.OPersona
      00:10:40,625 INFO [Ejb3Configuration] found EJB3 Entity bean: XCellDomSrvr.OProveedor
      00:10:40,640 INFO [Ejb3Configuration] found EJB3 Entity bean: XCellDomSrvr.ORepresentante
      00:10:40,640 INFO [Ejb3Configuration] found EJB3 Entity bean: XCellDomSrvr.OSimCard

      00:10:41,109 WARN [ServiceController] Problem creating service jboss.j2ee:service=EJB3,module=XCellDomainServer.ejb3

      java.lang.UnsupportedOperationException
      at org.hibernate.util.EmptyIterator.next(EmptyIterator.java:18)
      at org.hibernate.util.JoinedIterator.next(JoinedIterator.java:53)
      at org.hibernate.cfg.AnnotationBinder.bindId(AnnotationBinder.java:1493)
      at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:573)
      at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:256)
      at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:191)
      at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:970)
      at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:607)
      at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:75)
      at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:473)
      at org.hibernate.ejb.Ejb3Configuration.createContainerEntityManagerFactory(Ejb3Configuration.java:202)
      at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:78)
      at org.jboss.ejb3.Ejb3Deployment.initializeManagedEntityManagerFactory(Ejb3Deployment.java:512)
      at org.jboss.ejb3.Ejb3Deployment.create(Ejb3Deployment.java:253)
      at org.jboss.ejb3.Ejb3JmxDeployment.create(Ejb3JmxDeployment.java:230)
      at org.jboss.ejb3.Ejb3Module.createService(Ejb3Module.java:34)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalCreate(ServiceMBeanSupport.java:252)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:234)
      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:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:974)
      at $Proxy0.create(Unknown Source)
      at org.jboss.system.ServiceController.create(ServiceController.java:356)
      at org.jboss.system.ServiceController.create(ServiceController.java:295)
      at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
      at $Proxy10.create(Unknown Source)
      at org.jboss.ejb3.EJB3Deployer.create(EJB3Deployer.java:198)
      at org.jboss.deployment.MainDeployer.create(MainDeployer.java:919)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:773)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:737)
      at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:118)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
      at $Proxy6.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:319)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:507)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:192)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:203)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:182)
      00:10:41,109 INFO [EJB3Deployer] Deployed: file:/D:/Java/jboss-4.0.3RC2/server/all/deploy/XCellDomainServer.ejb3
      00:10:41,281 INFO [TomcatDeployer] deploy, ctxPath=/XCellDomain, warUrl=.../tmp/deploy/tmp13946XCellDomain-exp.war/
      00:10:41,859 ERROR [URLDeploymentScanner] Incomplete Deployment listing:

      --- MBeans waiting for other MBeans ---
      ObjectName: jboss.jms:alias=QueueConnectionFactory
      State: FAILED
      Reason: javax.naming.CommunicationException: error setting options [Root exception is java.net.SocketException: error setting options]

      ObjectName: jboss.jms:alias=TopicConnectionFactory
      State: FAILED
      Reason: javax.naming.CommunicationException: error setting options [Root exception is java.net.SocketException: error setting options]

      ObjectName: jboss.j2ee:service=EJB3,name=trail.injection.RecordManagerBean
      State: FAILED
      Reason: javax.naming.NameNotFoundException: QueueConnectionFactory not bound

      ObjectName: jboss.j2ee:service=EJB3,module=XCellDomainServer.ejb3
      State: FAILED
      Reason: java.lang.UnsupportedOperationException

      --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
      ObjectName: jboss.j2ee:service=EJB3,name=trail.injection.RecordManagerBean
      State: FAILED
      Reason: javax.naming.NameNotFoundException: QueueConnectionFactory not bound

      ObjectName: jboss.jms:alias=TopicConnectionFactory
      State: FAILED
      Reason: javax.naming.CommunicationException: error setting options [Root exception is java.net.SocketException: error setting options]

      ObjectName: jboss.jms:alias=QueueConnectionFactory
      State: FAILED
      Reason: javax.naming.CommunicationException: error setting options [Root exception is java.net.SocketException: error setting options]

      ObjectName: jboss.j2ee:service=EJB3,module=XCellDomainServer.ejb3
      State: FAILED
      Reason: java.lang.UnsupportedOperationException

      <<==

      As a result when the follwing fragment of code executes ...

      public class OCiudadesServlet extends HttpServlet
      {
      private static final long serialVersionUID = 1L;
      //------------------------------------------------------------
      // Local storage
      //------------------------------------------------------------
      private OCiudades CiudadesBean;
      private Collection AllCiudades;
      private int LastBrowsedCity;

      //------------------------------------------------------------
      // Servlet Startup
      //------------------------------------------------------------
      public void init() throws ServletException
      {
      try
      {
      // Gets the reference to de OCiudades bean
      Context cn = new InitialContext();
      CiudadesBean = (OCiudades) cn.lookup(OCiudades.class.getName());

      // Find all the objects
      AllCiudades = CiudadesBean.FindAll();

      }
      catch(Exception e)
      {
      throw new ServletException(e.getMessage());
      }
      }

      .....

      ...the server issues a servlet exception indicating that the OCiudades bean is not bound.

      As a part of the documentation for this issue I include the Hibernate_Cfg.xml file, I'm thinking the problem has something to do with de persisitence container configuration but don´t figure out how exactly is it.

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE hibernate-configuration PUBLIC
      "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
      "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
      <hibernate-configuration>
      <session-factory name="CellDomain">
      oracle.jdbc.driver.OracleDriver
      CellDom
      jdbc:oracle:thin:@localhost:1521:orcl
      CellDom
      CellDom
      org.hibernate.dialect.OracleDialect
      </session-factory>
      </hibernate-configuration>

      Thanks in advance and expecting suggestions,
      Alvaro E Martinez M
      alvaromm@yahoo.com