On 12:11 Fri 25 Jun     , Eric Pugh wrote:
> Konstantin,
> 
> Did your use of the Ant task include using a hibernate.cfg.xml file instead
> of .properties?  I have spent some more time struggling with this, and I
> think I need to go back to learning about ClassLoaders...  I thought it
> would be simple, but, apparently not!

No, I use this task only with .properties file. 

BTW, I have just checked Hibernate sources from HEAD 
(thats why I realy like opensource :) and found that 
SchemaExportTask supports configuration via cfg.xml file
you need to set value of 'config' property.


So I have tried to use it, and have no success, all I 
get is strange NPE. I dig into Hibernate source more deeply
and found line with NPE:
 InputStream rsrc = 
Thread.currentThread().getContextClassLoader().getResourceAsStream(path);

So I think you are right: the problem in classloaders, but I must to
say that I am not very familiar with classloaders.

Konstatin.


> 
> ERic
> 
> > -----Original Message-----
> > From: Konstantin Shaposhnikov [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, June 24, 2004 12:23 AM
> > To: Maven Developers List
> > Subject: Re: Hibernate plugin use Ant task instead of custom integration
> >
> >
> > On 18:15 Wed 23 Jun     , Eric Pugh wrote:
> > > Argh...   You were right about classloader hell..   I was able
> > quite quickly
> > > to swap it to use the Hibernate SchemaExportTask with a
> > .properties file.
> > > However, attempting to get the right mix of classpath's etc to get
> > > SchemaExportTask to work with .cfg.xml configuration file has
> > been a very
> > > frustrating day!  I was able to create a build.xml that worked with a
> > > .cfg.xml and .properties file, but converting that into the plugin.jelly
> > > just never worked.
> >
> > To say the trueth I get classloader errors when using original
> > maven-hibernate-plugin and start to use ant task to avoid them.
> >
> > >
> > > I have been able to add a src/plugin-test project that validates things
> > > work, which pretty much means only with a .properties file.  I
> > tried writing
> > > a unit test to load up the SchemaExportBean and use it via a
> > .properties or
> > > .cfg.xml but no joy.
> > >
> > > So, at this point, I do have my nice little /src/plugin-test to
> > contribute.
> > > However, is there any feeling on committing the Ant task instead of the
> > > custom integration or not?  Right now the Ant task version does
> > the same as
> > > the custom integration, and neither seems to deal with a .cfg.xml
> > > configuration file.
> >
> > I think that using ant task is much more simpler solution.
> >
> > To support schema-export task we need to create bean that simply
> > duplicates all properties of ScemaExportTask. If for example
> > Hibernate team add new option to this Task, with custom integration
> > we need to add this property to bean that used from jelly and to
> > plugin.jelly file. If we will use ant task, than much more less changes
> > will be required.
> >
> > >
> > > Opinions?
> >
> > About m2. I don't now much about it, but I think that it will
> > definitly needs some plugin that works as wrapper for ant task,
> > because a lot of ant tasks already exists, and it would be nice
> > if they will be supported without significant efforts.
> >
> > >
> > > Eric
> > >
> >
> > Best regards,
> > Konstantin.
> >
> >
> > ---------------------------------------------------------------------
> > 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