Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » IAM (Eclipse Integration for Apache Maven) » Maven, Hibernate & Derby
Maven, Hibernate & Derby [message #17457] Tue, 17 March 2009 17:47 Go to next message
Eclipse User
Originally posted by: jon.hanson.geemayl.com

Hi,

I'm attempting to use the IAM plugin to invoke a Maven project which runs
the Mojo Hibernate plugin to create some Derby DB tables from some
annotated Java POM classes.

My pom.xml works if i invoke Maven from the command line, e.g. mvn
package, however from within Eclipse i get the following error:

17/03/09 21:28:26 GMT: [INFO] [hibernate3:hbm2ddl]
17/03/09 21:28:26 GMT: [INFO] Configuration XML file loaded:
file:/G:/dev/workspace/testdb/src/main/resources/hibernate.c fg.xml
17/03/09 21:28:26 GMT: [INFO] Configuration XML file loaded:
file:/G:/dev/workspace/testdb/src/main/resources/hibernate.c fg.xml
17/03/09 21:28:27 GMT: [INFO] No hibernate properties file loaded.
17/03/09 21:28:27 GMT: [WARN] 1 errors occurred while performing <hbm2ddl>.
17/03/09 21:28:27 GMT: [ERROR] Error #1: java.sql.SQLException: No
suitable driver found for jdbc:derby://localhost:1527/testdb;create=true

I'm guessing this is because the derbyclient.jar, which contains the Derby
JDBC driver, isn't being found. However, my pom.xml file has this:

<build>
<extensions>
<extension>
<groupId>org.apache.derby</groupId>
<artifactId>derbyclient</artifactId>
<version>10.4.2.0</version>
</extension>

which I believe is supposed to address this (when running from the command
line at least). Indeed, if i remove it then i get the same error when
building from the command line.

Any idea how i might fix this? I guess adding the derbyclient.jar to the
classpath used by Eclipse might fix this however that seems a bit drastic.

thanks,
Jon
Re: Maven, Hibernate & Derby [message #17461 is a reply to message #17457] Thu, 19 March 2009 19:29 Go to previous messageGo to next message
jon hanson is currently offline jon hanson
Messages: 5
Registered: July 2009
Junior Member
Bueller? Bueller?
Re: Maven, Hibernate & Derby [message #17466 is a reply to message #17457] Fri, 20 March 2009 04:56 Go to previous messageGo to next message
Abel Mui is currently offline Abel Mui
Messages: 247
Registered: July 2009
Senior Member
Hello Jon,

IAM runs maven in the same process as Eclipse, so classloading issues
might show up.

You can try adding derby as a dependency of your hibernate plug-in
(instead of as a build extension), but I'm not sure.

If you can provide a test case in bugzilla, that would be great.

Yours,
Abel Muiño

jon hanson wrote:

> Hi,

> I'm attempting to use the IAM plugin to invoke a Maven project which runs
> the Mojo Hibernate plugin to create some Derby DB tables from some
> annotated Java POM classes.

> My pom.xml works if i invoke Maven from the command line, e.g. mvn
> package, however from within Eclipse i get the following error:

> 17/03/09 21:28:26 GMT: [INFO] [hibernate3:hbm2ddl]
> 17/03/09 21:28:26 GMT: [INFO] Configuration XML file loaded:
> file:/G:/dev/workspace/testdb/src/main/resources/hibernate.c fg.xml
> 17/03/09 21:28:26 GMT: [INFO] Configuration XML file loaded:
> file:/G:/dev/workspace/testdb/src/main/resources/hibernate.c fg.xml
> 17/03/09 21:28:27 GMT: [INFO] No hibernate properties file loaded.
> 17/03/09 21:28:27 GMT: [WARN] 1 errors occurred while performing <hbm2ddl>.
> 17/03/09 21:28:27 GMT: [ERROR] Error #1: java.sql.SQLException: No
> suitable driver found for jdbc:derby://localhost:1527/testdb;create=true

> I'm guessing this is because the derbyclient.jar, which contains the Derby
> JDBC driver, isn't being found. However, my pom.xml file has this:

> <build>
> <extensions>
> <extension>
> <groupId>org.apache.derby</groupId>
> <artifactId>derbyclient</artifactId>
> <version>10.4.2.0</version>
> </extension>

> which I believe is supposed to address this (when running from the command
> line at least). Indeed, if i remove it then i get the same error when
> building from the command line.

> Any idea how i might fix this? I guess adding the derbyclient.jar to the
> classpath used by Eclipse might fix this however that seems a bit drastic.

> thanks,
> Jon
Re: Maven, Hibernate & Derby [message #17471 is a reply to message #17466] Fri, 20 March 2009 19:43 Go to previous messageGo to next message
jon hanson is currently offline jon hanson
Messages: 5
Registered: July 2009
Junior Member
Hi Abel,

Actually, adding Derby as a dependency of the Hibernate plugin appears to
have fixed the problem.

Just in case anyone else hits the same problem, here is the XML:

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>hibernate3-maven-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<id>generate-ddl</id>
<phase>process-classes</phase>
<goals>
<goal>hbm2ddl</goal>
</goals>
</execution>
</executions>
<configuration>
<components>
<component>
<name>hbm2ddl</name>

<implementation>annotationconfiguration</implementation>
</component>
</components>
</configuration>
<dependencies>
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derbyclient</artifactId>
<version>10.4.2.0</version>
</dependency>
</dependencies>
</plugin>

Thanks for your help,

Jon
Re: Maven, Hibernate & Derby [message #17476 is a reply to message #17471] Mon, 23 March 2009 06:09 Go to previous message
Carlos Sanchez is currently offline Carlos Sanchez
Messages: 114
Registered: July 2009
Senior Member
Hi Jon,

IAM uses a preview of the next major Maven release, that is not yet
finished and has bugs, and that explains why you get different results
in the command line.

For more info

http://code.google.com/p/q4e/wiki/ReportingBugs
http://code.google.com/p/q4e/wiki/FAQ

Thanks


On 3/21/09 12:43 AM, jon hanson wrote:
> Hi Abel,
>
> Actually, adding Derby as a dependency of the Hibernate plugin appears
> to have fixed the problem.
>
> Just in case anyone else hits the same problem, here is the XML:
>
> <plugin>
> <groupId>org.codehaus.mojo</groupId>
> <artifactId>hibernate3-maven-plugin</artifactId>
> <version>2.2</version>
> <executions>
> <execution>
> <id>generate-ddl</id>
> <phase>process-classes</phase>
> <goals>
> <goal>hbm2ddl</goal>
> </goals>
> </execution>
> </executions>
> <configuration>
> <components>
> <component>
> <name>hbm2ddl</name>
>
> <implementation>annotationconfiguration</implementation>
> </component>
> </components>
> </configuration>
> <dependencies>
> <dependency>
> <groupId>org.apache.derby</groupId>
> <artifactId>derbyclient</artifactId>
> <version>10.4.2.0</version>
> </dependency>
> </dependencies>
> </plugin>
>
> Thanks for your help,
>
> Jon
>
Re: Maven, Hibernate & Derby [message #568584 is a reply to message #17457] Thu, 19 March 2009 19:29 Go to previous message
jon hanson is currently offline jon hanson
Messages: 5
Registered: July 2009
Junior Member
Bueller? Bueller?
Re: Maven, Hibernate & Derby [message #568601 is a reply to message #17457] Fri, 20 March 2009 04:56 Go to previous message
Abel Mui is currently offline Abel Mui
Messages: 247
Registered: July 2009
Senior Member
Hello Jon,

IAM runs maven in the same process as Eclipse, so classloading issues
might show up.

You can try adding derby as a dependency of your hibernate plug-in
(instead of as a build extension), but I'm not sure.

If you can provide a test case in bugzilla, that would be great.

Yours,
Abel Muiño

jon hanson wrote:

> Hi,

> I'm attempting to use the IAM plugin to invoke a Maven project which runs
> the Mojo Hibernate plugin to create some Derby DB tables from some
> annotated Java POM classes.

> My pom.xml works if i invoke Maven from the command line, e.g. mvn
> package, however from within Eclipse i get the following error:

> 17/03/09 21:28:26 GMT: [INFO] [hibernate3:hbm2ddl]
> 17/03/09 21:28:26 GMT: [INFO] Configuration XML file loaded:
> file:/G:/dev/workspace/testdb/src/main/resources/hibernate.c fg.xml
> 17/03/09 21:28:26 GMT: [INFO] Configuration XML file loaded:
> file:/G:/dev/workspace/testdb/src/main/resources/hibernate.c fg.xml
> 17/03/09 21:28:27 GMT: [INFO] No hibernate properties file loaded.
> 17/03/09 21:28:27 GMT: [WARN] 1 errors occurred while performing <hbm2ddl>.
> 17/03/09 21:28:27 GMT: [ERROR] Error #1: java.sql.SQLException: No
> suitable driver found for jdbc:derby://localhost:1527/testdb;create=true

> I'm guessing this is because the derbyclient.jar, which contains the Derby
> JDBC driver, isn't being found. However, my pom.xml file has this:

> <build>
> <extensions>
> <extension>
> <groupId>org.apache.derby</groupId>
> <artifactId>derbyclient</artifactId>
> <version>10.4.2.0</version>
> </extension>

> which I believe is supposed to address this (when running from the command
> line at least). Indeed, if i remove it then i get the same error when
> building from the command line.

> Any idea how i might fix this? I guess adding the derbyclient.jar to the
> classpath used by Eclipse might fix this however that seems a bit drastic.

> thanks,
> Jon
Re: Maven, Hibernate & Derby [message #568622 is a reply to message #17466] Fri, 20 March 2009 19:43 Go to previous message
jon hanson is currently offline jon hanson
Messages: 5
Registered: July 2009
Junior Member
Hi Abel,

Actually, adding Derby as a dependency of the Hibernate plugin appears to
have fixed the problem.

Just in case anyone else hits the same problem, here is the XML:

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>hibernate3-maven-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<id>generate-ddl</id>
<phase>process-classes</phase>
<goals>
<goal>hbm2ddl</goal>
</goals>
</execution>
</executions>
<configuration>
<components>
<component>
<name>hbm2ddl</name>

<implementation>annotationconfiguration</implementation>
</component>
</components>
</configuration>
<dependencies>
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derbyclient</artifactId>
<version>10.4.2.0</version>
</dependency>
</dependencies>
</plugin>

Thanks for your help,

Jon
Re: Maven, Hibernate & Derby [message #568637 is a reply to message #17471] Mon, 23 March 2009 06:09 Go to previous message
Carlos Sanchez is currently offline Carlos Sanchez
Messages: 114
Registered: July 2009
Senior Member
Hi Jon,

IAM uses a preview of the next major Maven release, that is not yet
finished and has bugs, and that explains why you get different results
in the command line.

For more info

http://code.google.com/p/q4e/wiki/ReportingBugs
http://code.google.com/p/q4e/wiki/FAQ

Thanks


On 3/21/09 12:43 AM, jon hanson wrote:
> Hi Abel,
>
> Actually, adding Derby as a dependency of the Hibernate plugin appears
> to have fixed the problem.
>
> Just in case anyone else hits the same problem, here is the XML:
>
> <plugin>
> <groupId>org.codehaus.mojo</groupId>
> <artifactId>hibernate3-maven-plugin</artifactId>
> <version>2.2</version>
> <executions>
> <execution>
> <id>generate-ddl</id>
> <phase>process-classes</phase>
> <goals>
> <goal>hbm2ddl</goal>
> </goals>
> </execution>
> </executions>
> <configuration>
> <components>
> <component>
> <name>hbm2ddl</name>
>
> <implementation>annotationconfiguration</implementation>
> </component>
> </components>
> </configuration>
> <dependencies>
> <dependency>
> <groupId>org.apache.derby</groupId>
> <artifactId>derbyclient</artifactId>
> <version>10.4.2.0</version>
> </dependency>
> </dependencies>
> </plugin>
>
> Thanks for your help,
>
> Jon
>
Previous Topic:Maven, Hibernate & Derby
Next Topic:IAM Dev Build Published
Goto Forum:
  


Current Time: Thu Aug 28 23:38:17 EDT 2014

Powered by FUDForum. Page generated in 0.02065 seconds