You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Roye, Suhneel BGI SF" <Su...@barclaysglobal.com> on 2006/04/17 21:33:46 UTC

hibernate3-maven-plugin:hbm2java - Setup Problems

I am trying to set up the Hibernate3 plugin for Maven2. Specifically, I
would like to have the plugin generate POJO's from *.hbm.xml mapping
files.

Relevant portions of my project directory structure:
Hibernate Configuration: <project>/src/main/resources/hibernate.cfg.xml
Hibernate Mappings:
<project>/src/main/resources/com/mycompany/app/*.hbm.xml
Target directory for generated POJO's:
<project>/src/main/java/com/mycompany/app/*.java

POM snippet:
.
.
.
    <pluginRepositories>
        <pluginRepository>
            <id>snapshots</id>
            <url>http://snapshots.maven.codehaus.org/maven2</url>
        </pluginRepository>
    </pluginRepositories>

.
.
.
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>hibernate3-maven-plugin</artifactId>
                <configuration>
                    <hibernate>
 
<configurationFile>/src/main/resources/hibernate.cfg.xml</configurationF
ile>
                    </hibernate>
                    <outputDirectory>
                        <hbm2java>/src/main/java</hbm2java>
                    </outputDirectory>
                </configuration>
            </plugin>
.
.
.

Hibernate configuration snippet:
.
.
.
		<mapping resource="com/mycompany/app/TableOne.hbm.xml"/>
		<mapping resource="com/mycompany/app/TableTwo.hbm.xml"/>
		<mapping
resource="com/mycompany/app/TableThree.hbm.xml"/>
.
.

When I run "mvn hibernate3:hbm2java", I get an error and no POJO's are
generated. The top of my stack trace is:
java.lang.ExceptionInInitializerError
        at
org.codehaus.mojo.hibernate3.exporter.Hbm2JavaGeneratorMojo.createExport
er(Hbm2JavaGeneratorMojo.java:52)

Can someone please point out what I'm missing or doing wrong?

Thanks. 
 
This message and any attachments are confidential, proprietary, and may be privileged.  If this message was misdirected, Barclays Global Investors (BGI) does not waive any confidentiality or privilege.  If you are not the intended recipient, please notify us immediately and destroy the message without disclosing its contents to anyone.  Any distribution, use or copying of this e-mail or the information it contains by other than an intended recipient is unauthorized.  The views and opinions expressed in this e-mail message are the author's own and may not reflect the views and opinions of BGI, unless the author is authorized by BGI to express such views or opinions on its behalf.  All email sent to or from this address is subject to electronic storage and review by BGI.  Although BGI operates anti-virus programs, it does not accept responsibility for any damage whatsoever caused by viruses being passed.

RE: hibernate3-maven-plugin:hbm2java - Setup Problems

Posted by Gwyn <gw...@gmail.com>.
Hi,
  I'm no expert, but it looks to me as if the log4j connection is as a
result of clogging.  Whether it's as a result of implicit or explict config,
I've no idea...
/Gwyn
--
View this message in context: http://www.nabble.com/hibernate3-maven-plugin%3Ahbm2java---Setup-Problems-t1463811.html#a3974445
Sent from the Maven - Users forum at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: hibernate3-maven-plugin:hbm2java - Setup Problems

Posted by Johann Reyes <jr...@hiberforum.org>.
Hello Suhneel;

Could you please run "mvn -X hibernate3:hbm2java" and send me the output?

Also what jdk you are running?

Regards

Johann Reyes

-----Original Message-----
From: Roye, Suhneel BGI SF [mailto:Suhneel.Roye@barclaysglobal.com] 
Sent: Monday, April 17, 2006 3:34 PM
To: Maven Users List
Subject: hibernate3-maven-plugin:hbm2java - Setup Problems

I am trying to set up the Hibernate3 plugin for Maven2. Specifically, I
would like to have the plugin generate POJO's from *.hbm.xml mapping
files.

Relevant portions of my project directory structure:
Hibernate Configuration: <project>/src/main/resources/hibernate.cfg.xml
Hibernate Mappings:
<project>/src/main/resources/com/mycompany/app/*.hbm.xml
Target directory for generated POJO's:
<project>/src/main/java/com/mycompany/app/*.java

POM snippet:
.
.
.
    <pluginRepositories>
        <pluginRepository>
            <id>snapshots</id>
            <url>http://snapshots.maven.codehaus.org/maven2</url>
        </pluginRepository>
    </pluginRepositories>

.
.
.
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>hibernate3-maven-plugin</artifactId>
                <configuration>
                    <hibernate>
 
<configurationFile>/src/main/resources/hibernate.cfg.xml</configurationF
ile>
                    </hibernate>
                    <outputDirectory>
                        <hbm2java>/src/main/java</hbm2java>
                    </outputDirectory>
                </configuration>
            </plugin>
.
.
.

Hibernate configuration snippet:
.
.
.
		<mapping resource="com/mycompany/app/TableOne.hbm.xml"/>
		<mapping resource="com/mycompany/app/TableTwo.hbm.xml"/>
		<mapping
resource="com/mycompany/app/TableThree.hbm.xml"/>
.
.

When I run "mvn hibernate3:hbm2java", I get an error and no POJO's are
generated. The top of my stack trace is:
java.lang.ExceptionInInitializerError
        at
org.codehaus.mojo.hibernate3.exporter.Hbm2JavaGeneratorMojo.createExport
er(Hbm2JavaGeneratorMojo.java:52)

Can someone please point out what I'm missing or doing wrong?

Thanks. 
 
This message and any attachments are confidential, proprietary, and may be
privileged.  If this message was misdirected, Barclays Global Investors
(BGI) does not waive any confidentiality or privilege.  If you are not the
intended recipient, please notify us immediately and destroy the message
without disclosing its contents to anyone.  Any distribution, use or copying
of this e-mail or the information it contains by other than an intended
recipient is unauthorized.  The views and opinions expressed in this e-mail
message are the author's own and may not reflect the views and opinions of
BGI, unless the author is authorized by BGI to express such views or
opinions on its behalf.  All email sent to or from this address is subject
to electronic storage and review by BGI.  Although BGI operates anti-virus
programs, it does not accept responsibility for any damage whatsoever caused
by viruses being passed.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org