> This could be because the default destination for the xdoclet:hibernate
> goal is ${maven.build.dir}/xdoclet/hibernatedoclet, but the default
> input directory for the hibernate:schema-export goal is
> ${maven.build.dest}.

That seems to suggest that the hbm.xml files be in the resulting JAR, is
this useful for run-time generation or execution under hibernate?
I've seen examples on the hibernate site where the user is creating a
Service ARchive, I also see that the hibernate installation provides a RAR.
and there doesn't seem to be a maven-sar-plugin ...

The maven-war-plugin which uses

    <ant:property name="maven.war.final.name"
      value="${pom.artifactId}.war"/>

and then
    <ant:jar
         destfile="${maven.war.build.dir}/${maven.war.final.name}"
...

Since it's ant it's first-set, so you can force the maven.war.final.name to
have whatever extension you like -- though why you'd change it from WAR in a
JBoss environment isn't the point I'm getting at here.

The JAR plugin forces you to
    <ant:jar
      jarfile="${maven.build.dir}/${maven.final.name}.jar"

so if you want to make it SAR or RAR (whatever), you have to go through some
kludgery after the jar:jar to change the extension, even worse you have to
override the jar:install to have it put out the SAR in the repository:

    <ant:property name="jardir__"
value="${maven.repo.local}/${pom.artifactDirectory}/jars"/>
    <ant:mkdir dir="${jardir__}"/>
    <ant:copy
      file="${maven.build.dir}/${maven.final.name}.jar"

Is this just a legacy thing from maven early days, I mean the JAR plugin was
written long before the WAR plugin, nobody ever got around to sar-plugin?

----- Original Message ----- 
From: "Richard Burgess" <[EMAIL PROTECTED]>
To: "Maven Users List" <[EMAIL PROTECTED]>
Sent: Wednesday, October 01, 2003 5:25 AM
Subject: Re: maven, xdoclet, hibernate


> On Wed, 2003-10-01 at 10:52, khote wrote:
> > Now all I need to do is find out why my   -schema.sql comes out empty.
>
> This could be because the default destination for the xdoclet:hibernate
> goal is ${maven.build.dir}/xdoclet/hibernatedoclet, but the default
> input directory for the hibernate:schema-export goal is
> ${maven.build.dest}.
>
> The hibernate:schema-export goal can't find any hbm.xml files to use so
> generates an empty sql file.
>
> > Is this JBoss DataSource problem part of all that classloader magic one
has
> > to master to use JBoss?
>
> No.  This is a JNDI issue.  Inside the JBoss container, the Datasource
> can be looked up and used by hibernate.  Outside the container, even if
> the JBoss JNDI server is running and can be connected to, it is
> extremely unlikely that the Datasource object returned will be able to
> function correctly.
>
> The exception message suggests that the InitialContext can't even
> correctly load the JBoss specific NamingContextFactory, so the hibernate
> plugin doesn't even get as far as looking up the Datasource.
>
> Since maven is running in its own VM and not inside JBoss, you should
> not rely on the hibernate plugin being able to look up and use the
> Datasource.
>
> Basically, you need two configurations for hibernate:  one for use by
> the maven build, and possibly unit tests, which connects directly to the
> db.  The second for use when the code is deployed to JBoss which uses
> the datasource.
>
> I haven't been using maven for long, but it sounds as though the former
> can be satisfied by using project.properties and the second by using the
> build/resources element in the project.xml.
>
> Richard
>
> > Is there anything that can be done in maven properties or goals, anybody
> > have any experience with that?
> >
> > ----- Original Message ----- 
> > From: "Richard Burgess" <[EMAIL PROTECTED]>
> > To: "Maven Users List" <[EMAIL PROTECTED]>
> > Sent: Wednesday, October 01, 2003 2:34 AM
> > Subject: Re: maven, xdoclet, hibernate
> >
> >
> > > I've seen this error appear when trying to use hibernate configured to
> > > use a JBoss Datasource in a stand alone JVM.
> > >
> > > Try telling the hibernate plugin to use a direct connection to the
> > > database by specifying the hibernate driver class, url, username and
> > > password properties.  Put the following in your project.properties (or
> > > build.properties, or wherever):
> > >
> > >
> > > # hibernate properties
> > > hibernate.dialect=net.sf.hibernate.dialect.MySQLDialect
> > > hibernate.connection.driver_class=com.mysql.jdbc.Driver
> > > hibernate.connection.url=jdbc:mysql://localhost/test
> > > hibernate.connection.username=tester
> > > hibernate.connection.password=
> > >
> > > # use the hibernate props specified in here for maven hibernate goals
> > > maven.hibernate.properties=project.properties
> > >
> > > Richard
> > >
> > > On Wed, 2003-10-01 at 10:21, khote wrote:
> > > > I have all the basic stuff working with maven, xdoclet, and
hibernate.
> > > > I'm using a mysql database, JBoss 3.2.1, and I have installed the
latest
> > > > hibernate just in case.
> > > >
> > > > However when I try to run the hibernate:schema-export goal I get
> > > >
> > > > Could not obtain initial context
> > > > javax.naming.NoInitialContextException: Cannot instantiate class:
> > > > org.jnp.interfaces.NamingContextFactory [Root exception is
> > > > java.lang.ClassNotFoundException:
> > org.jnp.interfaces.NamingContextFactory]
> > > >
> > > >
> > > > so where is org.jnp.interfaces?  it's in jnp-client.jar.  I see that
> > file in
> > > > ibiblio in the jboss directory
> > > > so I set jnp-client.3.2.1 as a dependency in my project.xml
> > > > I see it's in JBoss/client.  I copy that into
JBoss/server/default/lib,
> > just
> > > > in case.
> > > >
> > > > I still get that error.
> > > > Is there some other place that jnp-client needs to be to make this
> > plugin
> > > > work?
> > > >
> > > >
> > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > >
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to