8 Replies Latest reply on Dec 8, 2009 1:52 PM by amira manai

    Error installing to Start: name=persistence.unit:unitName=#

    amira manai Newbie

      Hi,
      I am trying to deploy an EJB3 on jBoss 5.0.0.GA and I am receiving this message error:

      02:59:52,044 ERROR [AbstractKernelController] Error installing to Start: name=persistence.unit:unitName=#sample state=Create
      javax.persistence.PersistenceException: [PersistenceUnit: sample] Unable to build EntityManagerFactory
       at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:677)
       at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:132)
       at org.jboss.jpa.deployment.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:301)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
       at java.lang.reflect.Method.invoke(Unknown Source)
       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(LifecycleAction.java:221)
       at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54)
       at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42)
       at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
       at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
       at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
       at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
       at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:774)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:540)
       at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:121)
       at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:51)
       at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
       at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
       at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1178)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
       at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
       at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
       at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:698)
       at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:304)
       at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:205)
       at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:405)
       at org.jboss.Main.boot(Main.java:209)
       at org.jboss.Main$1.run(Main.java:547)
       at java.lang.Thread.run(Unknown Source)
      Caused by: org.hibernate.HibernateException: cannot simultaneously fetch multiple bags
       at org.hibernate.loader.BasicLoader.postInstantiate(BasicLoader.java:89)
       at org.hibernate.loader.entity.EntityLoader.<init>(EntityLoader.java:98)
       at org.hibernate.loader.entity.EntityLoader.<init>(EntityLoader.java:66)
       at org.hibernate.loader.entity.EntityLoader.<init>(EntityLoader.java:56)
       at org.hibernate.loader.entity.BatchingEntityLoader.createBatchingEntityLoader(BatchingEntityLoader.java:126)
       at org.hibernate.persister.entity.AbstractEntityPersister.createEntityLoader(AbstractEntityPersister.java:1775)
       at org.hibernate.persister.entity.AbstractEntityPersister.createEntityLoader(AbstractEntityPersister.java:1779)
       at org.hibernate.persister.entity.AbstractEntityPersister.createLoaders(AbstractEntityPersister.java:3012)
       at org.hibernate.persister.entity.AbstractEntityPersister.postInstantiate(AbstractEntityPersister.java:3005)
       at org.hibernate.persister.entity.SingleTableEntityPersister.postInstantiate(SingleTableEntityPersister.java:712)
       at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:322)
       at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1327)
       at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
       at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669)
       ... 50 more
      02:59:52,085 WARN [WebServiceDeployerEJB] Ingore ejb deployment with null classname: org.jboss.metadata.ejb.jboss.JBossSessionBeanMetaData@8fd19516{HotelTestBean}
      02:59:52,136 ERROR [ProfileServiceBootstrap] Failed to load profile: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
      
      DEPLOYMENTS MISSING DEPENDENCIES:
       Deployment "jboss.j2ee:jar=BaseHotele.jar,name=HotelTestBean,service=EJB3" is missing the following dependencies:
       Dependency "<UNKNOWN jboss.j2ee:jar=BaseHotele.jar,name=HotelTestBean,service=EJB3>" (should be in state "Described", but is actually in state "** UNRESOLVED Demands 'persistence.unit:unitName=#sample' **")
      
      DEPLOYMENTS IN ERROR:
       Deployment "<UNKNOWN jboss.j2ee:jar=BaseHotele.jar,name=HotelTestBean,service=EJB3>" is in error due to the following reason(s): ** UNRESOLVED Demands 'persistence.unit:unitName=#sample' **
       Deployment "persistence.unit:unitName=#sample" is in error due to the following reason(s): org.hibernate.HibernateException: cannot simultaneously fetch multiple bags
      
      02:59:52,152 INFO [Http11Protocol] D�marrage de Coyote HTTP/1.1 sur http-127.0.0.1-8080
      02:59:52,187 INFO [AjpProtocol] Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009
      02:59:52,195 INFO [ServerImpl] JBoss (Microcontainer) [5.0.1.GA (build: SVNTag=JBoss_5_0_1_GA date=200902231221)] Started in 46s:970ms
      



      and this is the persistence.properties:
      <persistence xmlns="http://java.sun.com/xml/ns/persistence"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
       version="1.0">
       <persistence-unit name="sample">
       <jta-data-source>java:/DefaultDS</jta-data-source>
       <properties>
      
       <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
       </properties>
       </persistence-unit>
      </persistence>
      
      
      
      



      I'm using the same persistence.properties in another ejb project and it work correctly!!
      I don't know what's the problem with this project.

      HELP PLEASE.
      I HAVE 4 DAYS RESOLVING THIS PROBLEM!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

      Thank u all !!!!!!!!!!!!!!1

        • 1. Re:  Error installing to Start: name=persistence.unit:unitNa
          amira manai Newbie

          Sorry i meant persistence.xml and not persistence.properties
          Stress effect !!
          i still have the problem HEEEELLLLLLLLLLLPPPP

          • 2. Re:  Error installing to Start: name=persistence.unit:unitNa
            Wolfgang Knauf Master

            Hi,

            see http://www.jboss.org/community/wiki/EJB3relationships and search for your error message "cannot simultaneously fetch multiple bags".

            Hope this helps

            Wolfgang

            • 3. Re:  Error installing to Start: name=persistence.unit:unitNa
              amira manai Newbie

               

              "Wolfgang Knauf" wrote:
              Hi,

              see http://www.jboss.org/community/wiki/EJB3relationships and search for your error message "cannot simultaneously fetch multiple bags".

              Hope this helps

              Wolfgang
              tHANK U MR KNAUF:
              all this error disappeared but when i run the client class i have this errors:
              18:21:20,877 DEBUG TimedSocketFactory:87 - createSocket, hostAddr: localhost/127.0.0.1, port: 1099, localAddr: null, localPort: 0, timeout: 0
              javax.naming.NameNotFoundException: HotelTestBean not bound
               at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
               at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
               at org.jnp.server.NamingServer.getObject(NamingServer.java:785)
               at org.jnp.server.NamingServer.lookup(NamingServer.java:396)
               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
               at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
               at java.lang.reflect.Method.invoke(Unknown Source)
               at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
               at sun.rmi.transport.Transport$1.run(Unknown Source)
               at java.security.AccessController.doPrivileged(Native Method)
               at sun.rmi.transport.Transport.serviceCall(Unknown Source)
               at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
               at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Source)
               at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
               at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
               at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
               at java.lang.Thread.run(Unknown Source)
               at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
               at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
               at sun.rmi.server.UnicastRef.invoke(Unknown Source)
               at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
               at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:722)
               at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:682)
               at javax.naming.InitialContext.lookup(Unknown Source)
               at ClientBeans.ClientA.main(ClientA.java:54)
              Exception in thread "main" java.lang.RuntimeException: javax.naming.NameNotFoundException: HotelTestBean not bound
               at ClientBeans.ClientA.main(ClientA.java:64)
              Caused by: javax.naming.NameNotFoundException: HotelTestBean not bound
               at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
               at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
               at org.jnp.server.NamingServer.getObject(NamingServer.java:785)
               at org.jnp.server.NamingServer.lookup(NamingServer.java:396)
               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
               at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
               at java.lang.reflect.Method.invoke(Unknown Source)
               at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
               at sun.rmi.transport.Transport$1.run(Unknown Source)
               at java.security.AccessController.doPrivileged(Native Method)
               at sun.rmi.transport.Transport.serviceCall(Unknown Source)
               at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
               at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Source)
               at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
               at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
               at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
               at java.lang.Thread.run(Unknown Source)
               at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
               at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
               at sun.rmi.server.UnicastRef.invoke(Unknown Source)
               at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
               at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:722)
               at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:682)
               at javax.naming.InitialContext.lookup(Unknown Source)
               at ClientBeans.ClientA.main(ClientA.java:54)
              

              Help PLEASE!!!
              THANK YOU SOOOOO MUCH!!

              • 4. Re:  Error installing to Start: name=persistence.unit:unitNa
                amira manai Newbie

                 

                "Wolfgang Knauf" wrote:
                hi,

                see http://www.jboss.org/community/wiki/EJB3relationships and search for your error message "cannot simultaneously fetch multiple bags".

                Hope this helps

                wolflfgang

                Hi Mr Knauf,
                I still have this error when i start the server:
                04:26:00,264 ERROR [ProfileServiceBootstrap] Failed to load profile: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
                
                DEPLOYMENTS MISSING DEPENDENCIES:
                 Deployment "jboss.j2ee:jar=BaseHotele.jar,name=HotelTestBean,service=EJB3" is missing the following dependencies:
                 Dependency "<UNKNOWN jboss.j2ee:jar=BaseHotele.jar,name=HotelTestBean,service=EJB3>" (should be in state "Described", but is actually in state "** UNRESOLVED Demands 'persistence.unit:unitName=#BaseHotele' **")
                 Deployment "persistence.unit:unitName=#BaseHotele" is missing the following dependencies:
                 Dependency "jboss.jca:name=ejb3ProjectDS,service=DataSourceBinding" (should be in state "Create", but is actually in state "** NOT FOUND Depends on 'jboss.jca:name=ejb3ProjectDS,service=DataSourceBinding' **")
                
                DEPLOYMENTS IN ERROR:
                 Deployment "<UNKNOWN jboss.j2ee:jar=BaseHotele.jar,name=HotelTestBean,service=EJB3>" is in error due to the following reason(s): ** UNRESOLVED Demands 'persistence.unit:unitName=#BaseHotele' **
                 Deployment "jboss.jca:name=ejb3ProjectDS,service=DataSourceBinding" is in error due to the following reason(s): ** NOT FOUND Depends on 'jboss.jca:name=ejb3ProjectDS,service=DataSourceBinding' **
                
                04:26:00,280 INFO [Http11Protocol] D�marrage de Coyote HTTP/1.1 sur http-127.0.0.1-8080
                04:26:00,410 INFO [AjpProtocol] Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009
                04:26:00,418 INFO [ServerImpl] JBoss (Microcontainer) [5.0.1.GA (build: SVNTag=JBoss_5_0_1_GA date=200902231221)] Started in 43s:888ms
                



                i have only this error only this error .


                My project name=BaseHotele
                My persistence.xml i put it in the META-INF folder and it is:

                <persistence xmlns="http://java.sun.com/xml/ns/persistence"
                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                 xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
                 version="1.0">
                 <persistence-unit name="BaseHotele">
                 <jta-data-source>java:ejb3ProjectDS</jta-data-source>
                 <properties>
                 <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
                
                 <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
                 </properties>
                 </persistence-unit>
                </persistence>
                
                


                My hsqlbd-ds.xml ,i put it in my ejb project "BaseHotele"and i Copy it to the jboss/server/default folder

                and it contain this :
                <datasources>
                 <local-tx-datasource>
                
                 <!-- The jndi name of the DataSource, it is prefixed with java:/ -->
                 <!-- Datasources are not available outside the virtual machine -->
                 <jndi-name>ejb3ProjectDS</jndi-name>
                
                 <!-- For server mode db, allowing other processes to use hsqldb over tcp.
                 This requires the org.jboss.jdbc.HypersonicDatabase mbean.
                 <connection-url>jdbc:hsqldb:hsql://${jboss.bind.address}:1701</connection-url>
                 -->
                 <!-- For totally in-memory db, not saved when jboss stops.
                 The org.jboss.jdbc.HypersonicDatabase mbean is required for proper db shutdown
                 <connection-url>jdbc:hsqldb:.</connection-url>
                 -->
                 <!-- For in-process persistent db, saved when jboss stops.
                 The org.jboss.jdbc.HypersonicDatabase mbean is required for proper db shutdown
                 -->
                 <!-- <connection-url>jdbc:hsqldb:${jboss.server.data.dir}${/}hypersonic${/}localDB</connection-url-->
                
                 <connection-url>jdbc:hsqldb:data/tutorial</connection-url>
                
                
                 <!-- The driver class -->
                 <driver-class>org.hsqldb.jdbcDriver</driver-class>
                
                 <!-- The login and password -->
                 <user-name>sa</user-name>
                 <password></password>
                
                 <!--example of how to specify class that determines if exception means connection should be destroyed-->
                 <!--exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.DummyExceptionSorter</exception-sorter-class-name-->
                
                 <!-- this will be run before a managed connection is removed from the pool for use by a client-->
                 <!--<check-valid-connection-sql>select * from something</check-valid-connection-sql> -->
                
                 <!-- The minimum connections in a pool/sub-pool. Pools are lazily constructed on first use -->
                 <min-pool-size>5</min-pool-size>
                
                 <!-- The maximum connections in a pool/sub-pool -->
                 <max-pool-size>20</max-pool-size>
                
                 <!-- The time before an unused connection is destroyed -->
                 <!-- NOTE: This is the check period. It will be destroyed somewhere between 1x and 2x this timeout after last use -->
                 <!-- TEMPORARY FIX! - Disable idle connection removal, HSQLDB has a problem with not reaping threads on closed connections -->
                 <idle-timeout-minutes>0</idle-timeout-minutes>
                
                 <!-- sql to call when connection is created
                 <new-connection-sql>some arbitrary sql</new-connection-sql>
                 -->
                
                 <!-- sql to call on an existing pooled connection when it is obtained from pool
                 <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
                 -->
                
                 <!-- example of how to specify a class that determines a connection is valid before it is handed out from the pool
                 <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.DummyValidConnectionChecker</valid-connection-checker-class-name>
                 -->
                
                 <!-- Whether to check all statements are closed when the connection is returned to the pool,
                 this is a debugging feature that should be turned off in production -->
                 <track-statements/>
                
                 <!-- Use the getConnection(user, pw) for logins
                 <application-managed-security/>
                 -->
                
                 <!-- Use the security domain defined in conf/login-config.xml -->
                 <security-domain>HsqlDbRealm</security-domain>
                
                 <!-- Use the security domain defined in conf/login-config.xml or the
                 getConnection(user, pw) for logins. The security domain takes precedence.
                 <security-domain-and-application>HsqlDbRealm</security-domain-and-application>
                 -->
                
                 <!-- HSQL DB benefits from prepared statement caching -->
                 <prepared-statement-cache-size>32</prepared-statement-cache-size>
                
                 <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
                 <metadata>
                 <type-mapping>Hypersonic SQL</type-mapping>
                 </metadata>
                
                 <!-- When using in-process (standalone) mode -->
                 <depends>jboss:service=Hypersonic,database=localDB</depends>
                 <!-- Uncomment when using hsqldb in server mode
                 <depends>jboss:service=Hypersonic</depends>
                 -->
                 </local-tx-datasource>
                
                 <!-- Uncomment if you want hsqldb accessed over tcp (server mode)
                 <mbean code="org.jboss.jdbc.HypersonicDatabase"
                 name="jboss:service=Hypersonic">
                 <attribute name="Port">1701</attribute>
                 <attribute name="BindAddress">${jboss.bind.address}</attribute>
                 <attribute name="Silent">true</attribute>
                 <attribute name="Database">default</attribute>
                 <attribute name="Trace">false</attribute>
                 <attribute name="No_system_exit">true</attribute>
                 </mbean>
                 -->
                
                 <!-- For hsqldb accessed from jboss only, in-process (standalone) mode -->
                 <mbean code="org.jboss.jdbc.HypersonicDatabase"
                 name="jboss:service=Hypersonic,database=localDB">
                 <attribute name="Database">localDB</attribute>
                 <attribute name="InProcessMode">true</attribute>
                 </mbean>
                
                </datasources>
                
                
                
                




                This My HotelTestBean:

                
                package de.laliluna.library;
                
                import javax.ejb.Stateless;
                import java.util.Iterator;
                import java.util.List;
                import javax.persistence.EntityManager;
                import javax.persistence.PersistenceContext;
                @Stateless
                public class HotelTestBean implements HotelTestBeanRemote ,HotelTestBeanLocal
                { @PersistenceContext
                 EntityManager em;
                public static final String RemoteJNDIName = HotelTestBean.class.getSimpleName() + "/remote";
                public static final String LocalJNDIName = HotelTestBean.class.getSimpleName() + "/local";
                
                public void test() {
                
                
                Hotel hotel1 = new Hotel("pyramide",25,30);
                em.persist(hotel1);
                Hotel hotel2 = new Hotel("paradis",50,23);
                em.persist(hotel2);
                Hotel hotel3 = new Hotel("intercontinentale",78,19 );
                em.persist(hotel3);
                System.out.println("list some Hotels");
                List someHotels = em.createQuery("from Hotel b where b.nomHotel=:name").setParameter("name", "paradis").getResultList();
                for (Iterator iter = someHotels.iterator(); iter.hasNext();)
                {Hotel element = (Hotel) iter.next();
                System.out.println(element);}
                System.out.println("List all Hotels");
                List allHotels = em.createQuery("from Hotel").getResultList();
                for (Iterator iter = allHotels.iterator(); iter.hasNext();)
                {Hotel element = (Hotel) iter.next();
                System.out.println(element);}
                System.out.println("delete a Hotel");
                em.remove(hotel2);
                System.out.println("List all Hotels");
                allHotels = em.createQuery("from Hotel").getResultList();
                for (Iterator iter = allHotels.iterator(); iter.hasNext();)
                {Hotel element = (Hotel) iter.next();
                System.out.println(element); } }}
                

                Ihis my HotelTestBeanLocal:
                package de.laliluna.library;
                import javax.ejb.Local;
                @Local
                public interface HotelTestBeanLocal { public void test();}
                


                This is my HotelTestBeanRemote:
                package de.laliluna.library;
                
                import javax.ejb.Remote;
                @Remote
                public interface HotelTestBeanRemote {
                 public void test();
                }
                
                



                and this is my ClientA:
                package ClientBeans;
                import java.util.Iterator;
                import java.util.List;
                import java.util.Properties;
                import javax.naming.Context;
                import javax.naming.InitialContext;
                import javax.naming.NamingException;
                import javax.persistence.EntityManager;
                import javax.persistence.PersistenceContext;
                import de.laliluna.library.Hotel;
                import de.laliluna.library.HotelTestBean;
                import de.laliluna.library.HotelTestBeanRemote;
                
                
                public class ClientA {
                
                 /**
                 * @param args
                 */
                
                public static void main(String[] args) {
                
                try
                 {
                
                 Properties props = new Properties();
                 props.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
                 props.setProperty(Context.URL_PKG_PREFIXES, "org.jboss.naming.client");
                 props.setProperty(Context.PROVIDER_URL, "jnp://localhost:1099");
                 // props.setProperty("j2ee.clientName", "ClientNameFromJBossClientXML");
                
                 InitialContext initialContext = new InitialContext(props);
                
                 HotelTestBeanRemote beanRemote = (HotelTestBeanRemote) initialContext.lookup("HotelTestBean.RemoteJNDIName");
                
                 beanRemote.test();
                
                
                
                 } catch (NamingException e)
                 {
                 e.printStackTrace();
                
                 throw new RuntimeException(e);
                 }
                
                 }
                
                

                This is jindi.xml
                java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
                java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
                java.naming.provider.url=localhost:1099
                


                Is this enough or i have something wrong, or i must add another xml files !!!!
                Thank you a lot you gone save my life

                • 5. Re:  Error installing to Start: name=persistence.unit:unitNa
                  amira manai Newbie

                  I have this warn too:
                  1)
                  06:09:25,956 WARN [Ejb3AnnotationHandler] JBMETA-4: did not find any bean meta data for annotation bean HotelTestBean, will create some

                  2)
                  06:09:27,485 WARN [WebServiceDeployerEJB] Ingore ejb deployment with null classname: org.jboss.metadata.ejb.jboss.JBossSessionBeanMetaData@8fd19516{HotelTestBean}

                  3)
                  06:09:25,518 WARN [ConnectionFactoryJNDIMapper] supportsFailover attribute is true on connection factory: jboss.messaging.connectionfactory:service=ClusteredConnectionFactory but post office is non clustered. So connection factory will *not* support failover
                  06:09:25,518 WARN [ConnectionFactoryJNDIMapper] supportsLoadBalancing attribute is true on connection factory: jboss.messaging.connectionfactory:service=ClusteredConnectionFactory but post office is non clustered. So connection factory will *not* support load balancing

                  4)
                  06:09:17,104 WARN [JBossASSecurityMetadataStore] WARNING! POTENTIAL SECURITY RISK. It has been detected that the MessageSucker component which sucks messages from one node to another has not had its password changed from the installation default. Please see the JBoss Messaging user guide for instructions on how to do this.
                  5)
                  06:09:17,131 WARN [AnnotationCreator] No ClassLoader provided, using TCCL: org.jboss.managed.api.annotation.ManagementComponent
                  Helllllp pleaaaaaessssssssseeeeee!!!!!!!!!!!!

                  • 6. Re:  Error installing to Start: name=persistence.unit:unitNa
                    amira manai Newbie

                    Hi Mr knauf:
                    I fixed all the server starting problem but when i run the ClientA i get this error and i can't understand it:
                    [CODE]
                    08:08:44,525 DEBUG TimedSocketFactory:87 - createSocket, hostAddr: localhost/127.0.0.1, port: 1099, localAddr: null, localPort: 0, timeout: 0
                    javax.naming.NameNotFoundException: HotelTestBean not bound
                    at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
                    at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
                    at org.jnp.server.NamingServer.getObject(NamingServer.java:785)
                    at org.jnp.server.NamingServer.lookup(NamingServer.java:396)
                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                    at java.lang.reflect.Method.invoke(Unknown Source)
                    at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
                    at sun.rmi.transport.Transport$1.run(Unknown Source)
                    at java.security.AccessController.doPrivileged(Native Method)
                    at sun.rmi.transport.Transport.serviceCall(Unknown Source)
                    at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
                    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Source)
                    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
                    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
                    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
                    at java.lang.Thread.run(Unknown Source)
                    at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
                    at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
                    at sun.rmi.server.UnicastRef.invoke(Unknown Source)
                    at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
                    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:722)
                    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:682)
                    at javax.naming.InitialContext.lookup(Unknown Source)
                    at de.laliluna.library.ClientA.main(ClientA.java:32)
                    Exception in thread "main" java.lang.RuntimeException: javax.naming.NameNotFoundException: HotelTestBean not bound
                    at de.laliluna.library.ClientA.main(ClientA.java:38)
                    Caused by: javax.naming.NameNotFoundException: HotelTestBean not bound
                    at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
                    at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
                    at org.jnp.server.NamingServer.getObject(NamingServer.java:785)
                    at org.jnp.server.NamingServer.lookup(NamingServer.java:396)
                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                    at java.lang.reflect.Method.invoke(Unknown Source)
                    at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
                    at sun.rmi.transport.Transport$1.run(Unknown Source)
                    at java.security.AccessController.doPrivileged(Native Method)
                    at sun.rmi.transport.Transport.serviceCall(Unknown Source)
                    at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
                    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Source)
                    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
                    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
                    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
                    at java.lang.Thread.run(Unknown Source)
                    at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
                    at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
                    at sun.rmi.server.UnicastRef.invoke(Unknown Source)
                    at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
                    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:722)
                    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:682)
                    at javax.naming.InitialContext.lookup(Unknown Source)
                    at de.laliluna.library.ClientA.main(ClientA.java:32)

                    [/CODE]

                    What i have to do!!

                    • 7. Re:  Error installing to Start: name=persistence.unit:unitNa
                      Wolfgang Knauf Master

                      Hi,

                      you should take a look at the warnings which appear on deploy:

                      1)
                      06:09:25,956 WARN [Ejb3AnnotationHandler] JBMETA-4: did not find any bean meta data for annotation bean HotelTestBean, will create some

                      2)
                      06:09:27,485 WARN [WebServiceDeployerEJB] Ingore ejb deployment with null classname: org.jboss.metadata.ejb.jboss.JBossSessionBeanMetaData@8fd19516{HotelTestBean}

                      It seems something is wrong with your deployment, but I don't see what.

                      Please describe the structure of your ejb JAR file (which files are in which path). You might post the output of "jar tvf insertJarNameHere.jar".

                      Do you find your beans in JNDIView (see: http://www.jboss.org/community/wiki/DisplayTheJDNITreeWithTheJMXConsole ).

                      Best regards

                      Wolfgang

                      • 8. Re:  Error installing to Start: name=persistence.unit:unitNa
                        amira manai Newbie

                         

                        "Wolfgang Knauf" wrote:
                        Hi,

                        you should take a look at the warnings which appear on deploy:
                        1)
                        06:09:25,956 WARN [Ejb3AnnotationHandler] JBMETA-4: did not find any bean meta data for annotation bean HotelTestBean, will create some

                        2)
                        06:09:27,485 WARN [WebServiceDeployerEJB] Ingore ejb deployment with null classname: org.jboss.metadata.ejb.jboss.JBossSessionBeanMetaData@8fd19516{HotelTestBean}

                        It seems something is wrong with your deployment, but I don't see what.

                        Please describe the structure of your ejb JAR file (which files are in which path). You might post the output of "jar tvf insertJarNameHere.jar".

                        Do you find your beans in JNDIView (see: http://www.jboss.org/community/wiki/DisplayTheJDNITreeWithTheJMXConsole ).

                        Best regards

                        Wolfgang

                        Hi Mr Wolfgang,
                        i fixed the problem ,Thank you so much!!