These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Newbie question - "Java Persistence with Hibernate"
PostPosted: Sun Jun 28, 2009 12:47 pm 
Newbie

Joined: Sun Jun 28, 2009 12:28 pm
Posts: 1
I'm reading "Java Persistence with Hibernate", Chapter 2.

I'm trying to run the examples in Eclipse development environment(Ganymede), using the JBOSS plug-in server and Hibernate. I'm stuck on the example which runs EJB components with JBOSS (page 115).

I have downloaded the source code from http://www.manning.com/bauer2/. The persistence.xml and helloworld-beans.xml I have put in the META-INF directory of my project. When I start the server, I get the following problem:

Code:
17:25:53,031 ERROR [URLDeploymentScanner] Incomplete Deployment listing:

--- MBeans waiting for other MBeans ---
ObjectName: persistence.units:ear=TestApplication.ear,jar=TestApplicationEJB.jar,unitName=helloworld
  State: NOTYETINSTALLED
  I Depend On:
    jboss.jca:name=HelloWorldDS,service=DataSourceBinding


My persistence.xml looks like this:

Code:
<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="helloworld">

        <!-- A datasource managed by the Java EE runtime environment -->
        <jta-data-source>java:/HelloWorldDS</jta-data-source>

        <properties>
            <property name="hibernate.archive.autodetection" value="class, hbm"/>

            <!-- SQL stdout logging
            <property name="hibernate.show_sql" value="true"/>
            <property name="hibernate.format_sql" value="true"/>
            <property name="use_sql_comments" value="true"/>
            -->

            <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>

            <!-- On deployment of this persistence unit, drop and then re-create all tables -->
            <property name="hibernate.hbm2ddl.auto" value="create"/>

        </properties>
    </persistence-unit>

</persistence>


and my hello-beans.xml

Code:
<?xml version="1.0" encoding="UTF-8"?>

<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="urn:jboss:bean-deployer bean-deployer_1_0.xsd"
    xmlns="urn:jboss:bean-deployer:2.0">

    <!-- Enable a JCA datasource available through JNDI -->
    <bean name="helloWorldDatasourceFactory"
          class="org.jboss.resource.adapter.jdbc.local.LocalTxDataSource">
        <property name="jndiName">java:/HelloWorldDS</property>

        <!-- HSQL DB -->
        <property name="driverClass">com.mysql.jdbc.Driver</property>
        <property name="connectionURL">jdbc:mysql://localhost:3306/jpa_hibernate</property>
        <property name="userName">root</property>
        <property name="password">deborah</property>

        <property name="minSize">0</property>
        <property name="maxSize">10</property>
        <property name="blockingTimeout">1000</property>
        <property name="idleTimeout">100000</property>

        <property name="transactionManager"><inject bean="TransactionManager"/></property>
        <property name="cachedConnectionManager"><inject bean="CachedConnectionManager"/></property>
        <property name="initialContextProperties"><inject bean="InitialContextProperties"/></property>
    </bean>

    <bean name="HelloWorldDS" class="java.lang.Object">
        <constructor factoryMethod="getDatasource">
            <factory bean="helloWorldDatasourceFactory"/>
        </constructor>
    </bean>

</deployment>


As you can see I'm connecting to a MySQL database. Any ideas?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.