1 Reply Latest reply on Nov 5, 2005 8:53 AM by alvarommz

    EJB 3.0 Help!!!

    alvarommz

      Hi,

      Concerning my last post "Problems on EJB3 - Application", last night I installed the Jboss AS 4.0.3. sp1 (Production) and I did it with the .jar installer.

      As I read in one of the posts in the forum, I just installed de AS and nothing else.
      Then I packaged the application and deployed it but the problem persists.

      The result at the debugging stage was the following


      type Exception report
      message
      description The server encountered an internal error () that prevented it from
      fulfilling this request.
      exception
      javax.servlet.ServletException: XCellDomRemote.OCiudades not bound
      XCellDomSrvrServlet.OCiudadesServlet.init(OCiudadesServlet.java:62)
      javax.servlet.GenericServlet.init(GenericServlet.java:211)
      org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
      org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
      org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
      org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
      org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
      org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
      org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
      java.lang.Thread.run(Thread.java:595)

      note The full stack trace of the root cause is available in the Apache
      Tomcat/5.5 logs.

      Apache Tomcat/5.5


      I want to note that when the new AS installation started, it presented the following messages:


      01:04:18,562 INFO [DefaultPartition] Number of cluster members: 1
      01:04:18,562 INFO [DefaultPartition] Other members: 0
      01:04:18,562 INFO [DefaultPartition] Fetching state (will wait for 30000 milliseconds):
      01:04:18,562 INFO [DefaultPartition] New cluster view for partition DefaultPartition (id: 0, delta: 0) : [127.0.0.1:1099]
      01:04:18,578 INFO [DefaultPartition] I am (null) received membershipChanged event:
      01:04:18,578 INFO [DefaultPartition] Dead members: 0 ([])
      01:04:18,578 INFO [DefaultPartition] New Members : 0 ([])
      01:04:18,578 INFO [DefaultPartition] All Members : 1 ([127.0.0.1:1099])
      01:04:18,703 INFO [HANamingService] Started ha-jndi bootstrap jnpPort=1100, backlog=50, bindAddress=/0.0.0.0
      01:04:18,718 WARN [HANamingService] Failed to start AutomaticDiscovery
      java.net.SocketException: error setting options
      at java.net.PlainDatagramSocketImpl.join(Native Method)
      at java.net.PlainDatagramSocketImpl.join(PlainDatagramSocketImpl.java:172)
      at java.net.MulticastSocket.joinGroup(MulticastSocket.java:276)
      at org.jboss.ha.jndi.DetachedHANamingService$AutomaticDiscovery.start(DetachedHANamingService.java:495)
      at org.jboss.ha.jndi.DetachedHANamingService.startService(DetachedHANamingService.java:332)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:274)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:230)
      at sun.reflect.GeneratedMethodAccessor23.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.system.ServiceController$ServiceProxy.invoke(ServiceController.java:943)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:428)
      at org.jboss.system.ServiceController.start(ServiceController.java:446)
      at org.jboss.system.ServiceController.start(ServiceController.java:446)
      at sun.reflect.GeneratedMethodAccessor5.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 $Proxy4.start(Unknown Source)
      at org.jboss.deployment.SARDeployer.start(SARDeployer.java:285)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:989)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:790)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:753)
      at sun.reflect.GeneratedMethodAccessor7.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.startService(AbstractDeploymentScanner.java:265)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:274)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:230)
      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)
      .....


      and later...



      01:04:40,906 INFO [TreeCache] viewAccepted(): new members: [aajmartinez:2335]
      01:04:40,906 INFO [TreeCache] new cache is null (maybe first member in cluster)
      01:04:40,906 INFO [TreeCache] state could not be retrieved (must be first member in group)
      01:04:41,640 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jboss-ha-local-jdbc.rar
      01:04:41,906 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jboss-ha-xa-jdbc.rar
      01:04:42,187 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jboss-local-jdbc.rar
      01:04:42,453 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jboss-xa-jdbc.rar
      01:04:42,734 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jms/jms-ra.rar
      01:04:42,921 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/mail-ra.rar
      01:04:47,109 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=DefaultDS' to JNDI name 'java:DefaultDS'
      01:04:47,906 INFO [A] Bound to JNDI name: queue/A
      01:04:47,906 INFO [B] Bound to JNDI name: queue/B
      01:04:47,906 INFO [C] Bound to JNDI name: queue/C
      01:04:47,921 INFO [D] Bound to JNDI name: queue/D
      01:04:47,921 INFO [ex] Bound to JNDI name: queue/ex
      01:04:47,953 INFO [testTopic] Bound to JNDI name: topic/testTopic
      01:04:47,968 INFO [securedTopic] Bound to JNDI name: topic/securedTopic
      01:04:47,968 INFO [testDurableTopic] Bound to JNDI name: topic/testDurableTopic
      01:04:47,968 INFO [testQueue] Bound to JNDI name: queue/testQueue
      01:04:48,078 INFO [UILServerILService] JBossMQ UIL service available at : /0.0.0.0:8093
      01:04:48,187 INFO [DLQ] Bound to JNDI name: queue/DLQ
      01:04:48,562 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=JmsXA' to JNDI name 'java:JmsXA'
      01:04:48,703 INFO [JaccHelper] Initialising JACC Context for deployment: XCellDomainServer.ejb3
      01:04:49,046 INFO [Ejb3AnnotationHandler] found EJB3: ejbName=XCellDomRemote.OApplPropertiesBean, class=XCellDomRemote.OApplPropertiesBean, type=STATELESS
      01:04:49,687 INFO [JaccHelper] XCellDomRemote.OApplPropertiesBean has no @SecurityDomain - skipping JACC configuration
      01:04:49,703 INFO [Ejb3AnnotationHandler] found EJB3: ejbName=XCellDomRemote.OCiudadesBean, class=XCellDomRemote.OCiudadesBean, type=STATELESS
      01:04:49,796 INFO [JaccHelper] XCellDomRemote.OCiudadesBean has no @SecurityDomain - skipping JACC configuration
      01:04:49,921 INFO [Ejb3Deployment] default entity manager name: XCellDomainServer
      01:04:50,453 INFO [Environment] Hibernate 3.1
      01:04:50,468 INFO [Environment] hibernate.properties not found
      01:04:50,468 INFO [Environment] using CGLIB reflection optimizer
      01:04:50,468 INFO [Environment] using JDK 1.4 java.sql.Timestamp handling
      01:04:50,906 INFO [Ejb3Configuration] found EJB3 Entity bean: XCellDomSrvrSeg.OSysPrivs
      01:04:50,906 INFO [Ejb3Configuration] found EJB3 Entity bean: XCellDomSrvrSeg.OSysUsers
      01:04:50,921 INFO [Ejb3Configuration] found EJB3 Entity bean: XCellDomSrvr.OApplProperty
      01:04:50,921 INFO [Ejb3Configuration] found EJB3 Entity bean: XCellDomSrvr.OBodega
      01:04:50,921 INFO [Ejb3Configuration] found EJB3 Entity bean: XCellDomSrvr.OCiudad
      01:04:50,921 INFO [Ejb3Configuration] found EJB3 Entity bean: XCellDomSrvr.OCliente
      01:04:50,921 INFO [Ejb3Configuration] found EJB3 Entity bean: XCellDomSrvr.OClienteEmpresa
      01:04:50,937 INFO [Ejb3Configuration] found EJB3 Entity bean: XCellDomSrvr.OCombo
      01:04:50,937 INFO [Ejb3Configuration] found EJB3 Entity bean: XCellDomSrvr.OElemento
      01:04:50,953 INFO [Ejb3Configuration] found EJB3 Entity bean: XCellDomSrvr.OEmpresa
      01:04:50,953 INFO [Ejb3Configuration] found EJB3 Entity bean: XCellDomSrvr.OEquipo
      01:04:50,953 INFO [Ejb3Configuration] found EJB3 Entity bean: XCellDomSrvr.OEstadisticasVentas
      01:04:50,953 INFO [Ejb3Configuration] found EJB3 Entity bean: XCellDomSrvr.OFactura
      01:04:50,953 INFO [Ejb3Configuration] found EJB3 Entity bean: XCellDomSrvr.OFacturaCompra
      01:04:50,968 INFO [Ejb3Configuration] found EJB3 Entity bean: XCellDomSrvr.OFacturaDetalle
      01:04:50,968 INFO [Ejb3Configuration] found EJB3 Entity bean: XCellDomSrvr.OFacturaVenta
      01:04:50,968 INFO [Ejb3Configuration] found EJB3 Entity bean: XCellDomSrvr.OMarca
      01:04:50,984 INFO [Ejb3Configuration] found EJB3 Entity bean: XCellDomSrvr.OModelo
      01:04:50,984 INFO [Ejb3Configuration] found EJB3 Entity bean: XCellDomSrvr.OOperador
      01:04:50,984 INFO [Ejb3Configuration] found EJB3 Entity bean: XCellDomSrvr.OPersona
      01:04:50,984 INFO [Ejb3Configuration] found EJB3 Entity bean: XCellDomSrvr.OProveedor
      01:04:50,984 INFO [Ejb3Configuration] found EJB3 Entity bean: XCellDomSrvr.ORepresentante
      01:04:50,984 INFO [Ejb3Configuration] found EJB3 Entity bean: XCellDomSrvr.OSimCard
      01:04:52,859 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:988)
      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:245)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:228)
      at sun.reflect.GeneratedMethodAccessor51.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.system.ServiceController$ServiceProxy.invoke(ServiceController.java:943)
      at $Proxy0.create(Unknown Source)
      at org.jboss.system.ServiceController.create(ServiceController.java:341)
      at org.jboss.system.ServiceController.create(ServiceController.java:284)
      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:208)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      ......


      I visited the JMX Console and found the following:



      JBoss JMX Management ConsoleJMX Agent View aajmartinez
      ObjectName Filter (e.g. "jboss:*", "*:service=invoker,*") :
      Catalina
      type=Server
      type=StringCache
      JMImplementation
      name=Default,service=LoaderRepository
      type=MBeanRegistry
      type=MBeanServerDelegate
      jboss
      database=localDB,service=Hypersonic
      name=PropertyEditorManager,type=Service
      name=SystemProperties,type=Service
      partitionName=DefaultPartition,service=DistributedReplicantManager
      partitionName=DefaultPartition,service=DistributedState
      readonly=true,service=invoker,target=Naming,type=http
      service=AttributePersistenceService
      service=ClientUserTransaction
      service=DefaultPartition
      service=HAJNDI
      service=HASessionState
      service=JNDIView
      service=KeyGeneratorFactory,type=HiLo
      service=KeyGeneratorFactory,type=UUID
      service=Mail
      service=Naming
      service=TransactionManager
      service=WebService
      service=XidFactory
      service=invoker,target=Naming,type=http
      service=invoker,type=http
      service=invoker,type=jrmp
      service=invoker,type=jrmpha
      service=invoker,type=local
      service=invoker,type=pooled
      service=invoker,type=pooledha
      service=proxyFactory,target=ClientUserTransaction
      service=proxyFactory,target=ClientUserTransactionFactory
      jboss.admin
      service=DeploymentFileRepository
      service=PluginManager
      jboss.alerts
      service=ConsoleAlertListener
      jboss.aop
      service=AspectDeployer
      service=AspectManager
      jboss.bean
      service=JBossBeanDeployer
      jboss.cache
      service=EJB3EntityTreeCache
      service=EJB3SFSBClusteredCache
      service=InvalidationBridge,type=JavaGroups
      service=InvalidationManager
      service=TomcatClusteringCache
      jboss.console
      sar=console-mgr.sar
      jboss.deployer
      service=BSHDeployer
      jboss.deployment
      flavor=URL,type=DeploymentScanner
      jboss.ejb
      persistencePolicy=database,service=EJBTimerService
      retryPolicy=fixedDelay,service=EJBTimerService
      service=EJBDeployer
      service=EJBTimerService
      jboss.ejb3
      service=EJB3Deployer
      jboss.j2ee
      module=XCellDomainServer.ejb3,service=EJB3
      name=XCellDomRemote.OApplPropertiesBean,service=EJB3
      name=XCellDomRemote.OCiudadesBean,service=EJB3
      service=ClientDeployer
      service=EARDeployer


      and


      MBean InspectorJMX MBean View


      MBean Name:Domain Name:jboss.j2ee
      service: EJB3
      name: XCellDomRemote.OCiudadesBean
      MBean Java Class:org.jboss.ejb3.stateless.StatelessManager

      Back to Agent ViewRefresh MBean View

      MBean description:
      Management Bean.

      List of MBean attributes:
      NameTypeAccessValueDescription
      Instanceorg.jboss.ejb3.ContainerRorg.jboss.ejb3.stateless.StatelessContainer@15b0bc6
      MBean Attribute.
      StateStringjava.lang.StringRCreated MBean Attribute.
      StateintR6 MBean Attribute.
      Namejava.lang.StringRStatelessManager MBean Attribute.

      List of MBean operations:

      void start()
      MBean Operation.

      void create()
      MBean Operation.

      void jbossInternalLifecycle()
      MBean Operation.
      ParamParamTypeParamValueParamDescription
      p1java.lang.String (no description)

      void stop()
      MBean Operation.

      void destroy()
      MBean Operation.



      what tells me that the OCiudades bean is registered and created.

      Here are fragments of the beans where I find the problem:

      package XCellDomRemote;
      
      import java.rmi.RemoteException;
      import java.util.Collection;
      
      import javax.ejb.Remote;
      
      import XCellDomSrvr.OCiudad; // Entioty Bean
      
      /**===============================================
       * @author alvaromm
       * Remote interface for ciudades
       *===============================================*/
      @Remote
      public interface OCiudades
      {
       //---------------------------------------------------
       // Basic processes on OCiudades
       //---------------------------------------------------
       public OCiudad Create( long nCodCiud, String xNomCiud, String xDptoProv, String xPais ) throws RemoteException;
       public OCiudad Find( long nCodCiud ) throws RemoteException;
       public Collection FindAll();
       public String Display(long nCodCiud);
       public String DisplayDpto(long nCodCiud) throws RemoteException;
       public String DisplayPais(long nCodCiud) throws RemoteException;
       public void Remove(long nCodCiud) throws RemoteException;
       public void Edit( long nCodCiud, String xNomCiud, String xDptoProv, String xPais ) throws RemoteException;
       public void Merge(OCiudad Obj);
      
      }
      
      ===============================================================================================
      package XCellDomRemote;
      
      import java.rmi.RemoteException;
      import java.util.Collection;
      
      import javax.ejb.Stateless;
      import javax.persistence.EntityManager;
      import javax.persistence.PersistenceContext;
      
      import XCellDomRemote.OCiudades;
      import XCellDomUtils.EJBMessages;
      import XCellDomUtils.ISQLDriver;
      
      /**===============================================
       * @author alvaromm
       * EJB OCiudad Manager
       *===============================================*/
      public @Stateless class OCiudadesBean implements OCiudades
      {
       //---------------------------------------------------
       // Local storage
       //---------------------------------------------------
       @PersistenceContext
       private EntityManager em;
      
       //---------------------------------------------------
       // Create the object
       //---------------------------------------------------
       public OCiudad Create(long nCodCiud, String xNomCiud, String xDptoProv, String xPais) throws RemoteException
       {
       OCiudad Ciudad = new OCiudad();
       Ciudad.setCodCiud(nCodCiud);
       Ciudad.setNomCiud(xNomCiud);
       Ciudad.setDptoProv(xDptoProv);
       Ciudad.setPais(xPais);
       em.persist(Ciudad);
       return Ciudad;
       }
      
       ....
      }
      
      ====================================================================================
      package XCellDomSrvr;
      
      import java.io.Serializable;
      import java.util.Collection;
      import javax.persistence.CascadeType;
      import javax.persistence.Column;
      import javax.persistence.Entity;
      import static javax.persistence.FetchType.EAGER;
      import static javax.persistence.FetchType.LAZY;
      import javax.persistence.GeneratorType;
      import javax.persistence.Id;
      import javax.persistence.JoinColumn;
      import javax.persistence.OneToMany;
      import javax.persistence.Table;
      import javax.persistence.Version;
      
      /**
       * @author alvaromm
       *
       */
      @Entity
      @Table(name="cdmn_Ciudades", schema= "CellDom")
      public class OCiudad implements Serializable
      {
       //------------------------------------------------------------------
       // Private attributes
       //------------------------------------------------------------------
       private long CodCiud;
       private String NomCiud;
       private String DptoProv;
       private String Pais;
       private int Version;
      
       private static final long serialVersionUID = 1L;
       .....
       //------------------------------------------------------------------
       // Constructors
       //------------------------------------------------------------------
       public OCiudad() {}
       public OCiudad(Long codciud) { this.CodCiud = codciud;}
      
       //------------------------------------------------------------------
       // Accessors to simple fields & objects
       //------------------------------------------------------------------
       @Id(generate=GeneratorType.IDENTITY)
       @Column(name="CodCiud", nullable = false )
       public long getCodCiud() {return this.CodCiud; }
       public void setCodCiud(long codCiud) {this.CodCiud = codCiud;}
      
       @Column(name="DEPTOPROV")
       public String getDptoProv() {return this.DptoProv;}
       public void setDptoProv(String dptoProv) {this.DptoProv = dptoProv;}
      
       @Column(name="NOMCIUD")
       public String getNomCiud() {return this.NomCiud;}
       public void setNomCiud(String nomCiud) {this.NomCiud = nomCiud;}
      
       @Column(name="PAIS")
       public String getPais() {return this.Pais;}
       public void setPais(String pais) {this.Pais = pais;}
      
       @Version
       @Column(name="Version")
       public int getVersion() {return this.Version;}
       public void setVersion(int version) { this.Version = version;}
      ....
      }
      
      


      these are the different .xml descriptors that I use in the application for packaging and deployment:

      Hibernate_cfg.xml

      <?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">
       <property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
       <property name="hibernate.connection.password">CellDom</property>
       <property name="hibernate.connection.url">jdbc:oracle:thin:@localhost:1521:orcl</property>
       <property name="hibernate.connection.username">CellDom</property>
       <property name="hibernate.default_schema">CellDom</property>
       <property name="hibernate.dialect">org.hibernate.dialect.OracleDialect</property>
       </session-factory>
      </hibernate-configuration>
      



      web.xml
      
      <?xml version="1.0" encoding="UTF-8"?>
      <web-app version="2.4"
       xmlns="http://java.sun.com/xml/ns/j2ee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
       <servlet>
       <servlet-name>OCiudadesServlet</servlet-name>
       <servlet-class>XCellDomSrvrServlet.OCiudadesServlet</servlet-class>
       </servlet>
       <servlet-mapping>
       <servlet-name>OCiudadesServlet</servlet-name>
       <url-pattern>/SCiudades</url-pattern>
       </servlet-mapping>
      </web-app>
      


      Packaging-build
      <?xml version="1.0" encoding="UTF-8"?>
      <project default="_packaging_generation_" name="Packaging Generator">
      <target name="_packaging_generation_" depends="N10004,N1001D"/>
      <target name="N10004" description="XCellDomainServer.ejb3">
      <jar destfile="XCellDomainServer.ejb3">
      <zipfileset dir="src">
      <include name="hibernate.cfg.xml"/>
      </zipfileset>
      <zipfileset dir="bin" excludes="**/*Servlet.*"/>
      </jar>
      </target>
      <target name="N1001D" description="XCellDomain.war">
      <jar destfile="XCellDomain.war">
      <zipfileset dir="src" prefix="WEB-INF">
      <include name="web.xml"/>
      </zipfileset>
      <zipfileset dir="bin" prefix="WEB-INF/classes" includes="**/*Servlet.*"/>
      </jar>
      </target>
      </project>
      


      OCiudadesServlet.java (Fragment where the exception triggers)
      import XCellDomRemote.OCiudades;
      import XCellDomSrvr.OCiudad;
      
      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());
       }
      
      ....
      }
      
      
      


      as you might see the OCiudades not bound exception persists and I don´t figure out how to solve it. I´m open to suggestions.

      Thanks in advance for your help.
      Alvaro E Martinez M
      alvaromm@yahoo.com

        • 1. Re: EJB 3.0 Help!!!
          alvarommz

          Hi,

          Yesterday I included in my appl the persistence.xml file:

          <?xml version="1.0" encoding="UTF-8"?>
          <entity-manager>
           <name>OEMManager</name>
           <jta-data-source>java:/CellDomDS</jta-data-source>
           <properties>
           <property name="hibernate.dialect" value = "org.hibernate.dialect.OracleDialect"/>
           <property name="hibernate.hbm2ddl.auto" value = "none"/>
           <property name="hibernate.connection.release_mode" value="auto"/>
           <property name="hibernate.show_sql" value="true"/>
           <property name="hibernate.default_schema" value="CellDom"/>
           <property name="hibernate.generate_statistics" value="true"/>
           <property name="hibernate.use_sql_comments" value="true"/>
           <property name="hibernate.cache.provider_class" value="org.jboss.ejb3.entity.TreeCacheProviderHook"/>
           <property name="hibernate.treecache.mbean.object_name" value="jboss.cache:service=EJB3EntityTreeCache"/>
           </properties>
          </entity-manager>


          and packaged it in a .par file together with the entity beans OCuidad and OApplProperty which a I show a fragment in the previous post.

          I also created the file CellDom-ds.xml and put it at the {jboos-home}/server/all/deploy. The contents of this file are:

          <?xml version="1.0" encoding="UTF-8"?>
          
          <!-- ===================================================================== -->
          <!-- -->
          <!-- JBoss Server Configuration -->
          <!-- -->
          <!-- ===================================================================== -->
          
          <!-- $Id: oracle-xa-ds.xml,v 1.13 2004/09/15 14:37:40 loubyansky Exp $ -->
          
          <!-- ===================================================================== -->
          <!-- ATTENTION: DO NOT FORGET TO SET Pad=true IN transaction-service.xml -->
          <!-- ===================================================================== -->
          
          <datasources>
           <xa-datasource>
           <jndi-name>CellDomDS</jndi-name>
           <track-connection-by-tx>true<track-connection-by-tx/>
           <isSameRM-override-value>false</isSameRM-override-value>
           <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
           <xa-datasource-property name="URL">jdbc:oracle:thin:@128.1.1.1:1521:orcl</xa-datasource-property>
           <xa-datasource-property name="User">CellDom</xa-datasource-property>
           <xa-datasource-property name="Password">SecretPwd</xa-datasource-property>
           <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
          
           <!-- Oracles XA datasource cannot reuse a connection outside a transaction once enlisted in a global transaction and vice-versa -->
           <no-tx-separate-pools/>
           </xa-datasource>
          
           <mbean code="org.jboss.resource.adapter.jdbc.xa.oracle.OracleXAExceptionFormatter"
           name="jboss.jca:service=OracleXAExceptionFormatter">
           <depends optional-attribute-name="TransactionManagerService">jboss:service=TransactionManager</depends>
           </mbean>
          
          </datasources>


          and I also included the oracle 10g jdbc library "ojdbc14.jar" at the {jboos-home}/server/all/lib directory.

          finally I packaged the app in a .ear, .par, .ejb3 (with the corresponding Interfaces and session beans) and .war (with the servlet) files
          When I deployed them these are the results:

          01:32:24,781 INFO [JaccHelper] Initialising JACC Context for deployment: XCellDomain.ejb3
          01:32:24,953 WARN [ServiceController] Problem creating service jboss.j2ee:service=EJB3,module=XCellDomain.ejb3
          java.lang.ClassNotFoundException: No ClassLoaders found for: com.aemm.celldomn.EJB.OApplPropertiesBean
           at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:198)
           at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:475)
           at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:377)
           at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
           at org.jboss.ejb3.Ejb3AnnotationHandler.populateBaseInfo(Ejb3AnnotationHandler.java:168)
           ....
           at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread
          .run(AbstractDeploymentScanner.java:182)
          
          01:32:24,968 INFO [EJB3Deployer] Deployed: file:/D:/Java/jboss-4.0.3/server/all/deploy/XCellDomain.ejb3
          01:32:25,015 INFO [JaccHelper] Initialising JACC Context for deployment: XCellDomain.par
          01:32:25,156 INFO [Ejb3Deployment] Found persistence.xml file in EJB3 jar
          01:32:25,203 WARN [ServiceController] Problem creating service jboss.j2ee:service=EJB3,module=XCellDomain.par
          
          javax.naming.NameNotFoundException: CellDomDS not bound
           at org.jnp.server.NamingServer.getBinding(NamingServer.java:514)
           at org.jnp.server.NamingServer.getBinding(NamingServer.java:522)
           at org.jnp.server.NamingServer.getObject(NamingServer.java:528)
           at org.jnp.server.NamingServer.lookup(NamingServer.java:281)
           ....
           at org.jboss.ejb3.Ejb3Deployment.initializeManagedEntityManagerFactory(Ejb3Deployment.java:494)
           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:245)
           at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:228)
           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.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:182)
          
          01:32:25,203 INFO [EJB3Deployer] Deployed: file:/D:/Java/jboss-4.0.3/server/all/deploy/XCellDomain.par
          01:32:25,281 INFO [TomcatDeployer] deploy, ctxPath=/XCellDomain, warUrl=.../tmp/deploy/tmp28250XCellDomain-exp.war/
          01:32:25,593 INFO [EARDeployer] Init J2EE application: file:/D:/Java/jboss-4.0.3/server/all/deploy/XCellDomain.ear
          01:32:25,609 ERROR [MainDeployer] Could not initialise deployment: file:/D:/Java/jboss-4.0.3/server/all/deploy/XCellDomain.ear
          org.jboss.deployment.DeploymentException: Failed to find module file: XCellDomain.ejb3
           at org.jboss.deployment.EARDeployer.init(EARDeployer.java:242)
           at org.jboss.deployment.MainDeployer.init(MainDeployer.java:843)
           at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:780)
           at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:753)
           at sun.reflect.GeneratedMethodAccessor7.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)
           ....
          01:32:26,109 ERROR [URLDeploymentScanner] Incomplete Deployment listing:
          
          --- Incompletely deployed packages ---
          org.jboss.deployment.DeploymentInfo@8c5af43b { url=file:/D:/Java/jboss-4.0.3/server/all/deploy/CellDom-ds.xml }
           deployer: org.jboss.deployment.XSLSubDeployer@dc9515
           status: Deployment FAILED reason: No ClassLoaders found for: org.jboss.resource.adapter.jdbc.xa.oracle.OracleXAExceptionFormatter; - nested throwable: (java.lang.ClassNotFoundException: No ClassLoaders found for: org.jboss.resource.adapter.jdbc.xa.oracle.OracleXAExceptionFormatter)
           state: FAILED
           watch: file:/D:/Java/jboss-4.0.3/server/all/deploy/CellDom-ds.xml
           altDD: null
           lastDeployed: 1131171673343
           lastModified: 1131171672609
           mbeans:
          
          org.jboss.deployment.DeploymentInfo@83358b06 { url=file:/D:/Java/jboss-4.0.3/server/all/deploy/XCellDomain.ear }
           deployer: org.jboss.deployment.EARDeployer@9d5793
           status: null
           state: FAILED
           watch: file:/D:/Java/jboss-4.0.3/server/all/deploy/XCellDomain.ear
           altDD: null
           lastDeployed: 1131172345609
           lastModified: 1131172345593
           mbeans:
          
          --- MBeans waiting for other MBeans ---
          ObjectName: jboss.j2ee:service=EJB3,module=XCellDomain.ejb3
           State: FAILED
           Reason: java.lang.ClassNotFoundException: No ClassLoaders found for: com.aemm.celldomn.EJB.OApplPropertiesBean
          
          ObjectName: jboss.j2ee:service=EJB3,module=XCellDomain.par
           State: FAILED
           Reason: javax.naming.NameNotFoundException: CellDomDS not bound
          
          --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
          ObjectName: jboss.j2ee:service=EJB3,module=XCellDomain.par
           State: FAILED
           Reason: javax.naming.NameNotFoundException: CellDomDS not bound
          
          ObjectName: jboss.j2ee:service=EJB3,module=XCellDomain.ejb3
           State: FAILED
           Reason: java.lang.ClassNotFoundException: No ClassLoaders found for: com.aemm.celldomn.EJB.OApplPropertiesBean


          I have looked up in the Jboss & Hibernate tutorials and guides, for an error messages guide where errors and possible solutions, are explained, (Just as in Oracle documentation), but I have found nothing about. I wish you to help me please to solve these problems or direct me to a guide where I can find possible solutions.

          Thanks in advance for your help.
          Alvaro E Martinez M
          alvaromm@yahoo.com