[jboss-user] [Installation, Configuration & Deployment] - Re: Error installing to Start: name=persistence.unit:unitNa
amira88
do-not-reply at jboss.com
Sat Dec 5 05:12:12 EST 2009
"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
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4269123#4269123
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4269123
More information about the jboss-user
mailing list