Hey all,
I'm running into an issue using guice-persist on the server side of a GWT 
application.
I'm using the following persistence.xml w/ a JPA annotated DurableUser 
class:
<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_2_0.xsd";
             version="2.0">
    <persistence-unit name="db-manager">
        <provider>org.hibernate.ejb.HibernatePersistence</provider>
        <class>com.turms.server.database.DurableUser</class>
        <properties>
            <property name="hibernate.cache.use_second_level_cache" 
value="false"/>

            <property name="hibernate.connection.drive_class" 
value="com.mysql.jdbc.Driver"/>
            <property name="hibernate.connection.url" 
value="jdbc:mysql://localhost:3306/xxxXX"/>
            <property name="hibernate.connection.username" value="xx"/>
            <property name="hibernate.connection.password" value="xx"/>
            <property name="hibernate.connection.pool_size" value="1"/>
            <property name="hibernate.dialect" 
value="org.hibernate.dialect.MySQLDialect"/>
            <property name="hibernate.hbm2ddl.auto" value="create"/>
            <property name="hibernate.id.new_generator_mappings" 
value="true"/>
        </properties>
    </persistence-unit>
</persistence>

in my server's service class, I create an injector w/ my DatabaseModule 
class (provides a UserDao) and a new JpaPersistModule("db-manager")
On initialization of my server's service class, I call:
    PersistService service = injector.getInstance(PersistService.class);
    service.start();

this results in the following exception being thrown:
java.lang.NoClassDefFoundError: com/xxxXX/server/database/DurableUser 
(wrong name: com/xxxxx/server/database/DurableUser)

One thing I noticed is that the first path in the exception 
(com/xxxXX/server/database/DurableUser) is not quite right..that path 
should be com/xxxxx/server/database/DurableUser.
My company name xxxXX, but the last 2 letters should not be capitalized in 
the path. I'm not sure where this change is coming from, I dont see any 
place where xxxXX is in a package name. The bad path name is the only 
problem I can find with my current setup.

My built service (a .war) has the following structure:
XxxXX-1.0
--com.xxxxx.XxxXXWebJUnit
  --junit files
--META-INF (empty folder)
--XxxXXWeb
  --looks like gwt web stuff in this folder
*--WEB-INF*
*  --classes*
*    --com*
*      --compiled classes*
*    --META-INF*
*      --persistence.xml*
*  *--deploy
    --files needed for deployment
  --lib
    --jars for project
  --web.xml

It seems like my persistence.xml is in the right place, so JPA shouldnt 
have any trouble locating DurableUser.class

Any help is greatly appreciated!

-- 
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-guice.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to