[hibernate-dev] Invoking hbm2java without using Ant

2008-04-21 Thread Lakshmana Pamarthy
As part of the reverse engineering code generation functionality, I am trying
to find a solution on how to invoke hbm2java from a java class without using
ant.

I read the documentation on Ant tasks at 
http://www.hibernate.org/hib_docs/tools/reference/en/html/ant.html

But this doc doesn't tell anything about how to invoke hbm2java from a java
class without using Ant. 

I would like to know if its possible to do. If yes, any pointers are greatly
appreciated.

Appreciate your early response.

Thanks,




  

Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
___
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev


Re: [hibernate-dev] Invoking hbm2java without using Ant

2008-05-13 Thread Lakshmana Pamarthy
Hi,

Wondering if you can help me here.

I have a hibernate.reveng.xml file which contains some tables. I want to
generate mappings and POJOs for those tables that are in the reveng.xml file
without using Ant.

Here is how my code looks like:

String fileName = "hibernate.reveng.xml";
JDBCMetaDataConfiguration cfg = new JDBCMetaDataConfiguration();
cfg.configure();
OverrideRepository or = new OverrideRepository();
or.addResource(fileName);
cfg.setReverseEngineeringStrategy(or.getReverseEngineeringStrategy(new
DefaultReverseEngineeringStrategy()));

But I am getting java.lang.ExceptionInInitializerError at
JDBCMetaDataConfiguration cfg = new JDBCMetaDataConfiguration();

Any idea why I am getting an error there ?

Thanks





  
___
hibernate-dev mailing list
hibernate-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev


Re: [hibernate-dev] Invoking hbm2java without using Ant

2008-05-14 Thread Lakshmana Pamarthy
Here you go:

I have all the required jars added to the project. Those include
commons-logging-1.0.4jar, hibernate2.jar, hibernate-tools.jar,
hibernate-annotations.jar, dom4j-1.6.1.jar etc...

org.apache.commons.logging.LogConfigurationException: Invalid class loader
hierarchy.  You have more than one version of 'org.apache.commons.logging.Log'
visible, which is not allowed.
at
org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:385)
Caused: org.apache.commons.logging.LogConfigurationException:
org.apache.commons.logging.LogConfigurationException: Invalid class loader
hierarchy.  You have more than one version of 'org.apache.commons.logging.Log'
visible, which is not allowed. (Caused by
org.apache.commons.logging.LogConfigurationException: Invalid class loader
hierarchy.  You have more than one version of 'org.apache.commons.logging.Log'
visible, which is not allowed.)
at
org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:397)
at
org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529)
Caused: org.apache.commons.logging.LogConfigurationException:
org.apache.commons.logging.LogConfigurationException:
org.apache.commons.logging.LogConfigurationException: Invalid class loader
hierarchy.  You have more than one version of 'org.apache.commons.logging.Log'
visible, which is not allowed. (Caused by
org.apache.commons.logging.LogConfigurationException: Invalid class loader
hierarchy.  You have more than one version of 'org.apache.commons.logging.Log'
visible, which is not allowed.) (Caused by
org.apache.commons.logging.LogConfigurationException:
org.apache.commons.logging.LogConfigurationException: Invalid class loader
hierarchy.  You have more than one version of 'org.apache.commons.logging.Log'
visible, which is not allowed. (Caused by
org.apache.commons.logging.LogConfigurationException: Invalid class loader
hierarchy.  You have more than one version of 'org.apache.commons.logging.Log'
visible, which is not allowed.))
at
org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:543)
at
org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235)
at
org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:209)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
at org.hibernate.cfg.Configuration.(Configuration.java:120)
Caused: java.lang.ExceptionInInitializerError
at
org.netbeans.modules.hibernate.wizards.HibernateRevengWizard.buildFiles(HibernateRevengWizard.java:250)
at
org.netbeans.modules.hibernate.wizards.HibernateRevengWizard.instantiate(HibernateRevengWizard.java:237)
at
org.openide.loaders.TemplateWizard$InstantiatingIteratorBridge.instantiate(TemplateWizard.java:1025)
at
org.openide.loaders.TemplateWizard.handleInstantiate(TemplateWizard.java:595)
at
org.openide.loaders.TemplateWizard.instantiateNewObjects(TemplateWizard.java:416)
at
org.openide.loaders.TemplateWizardIterImpl.instantiate(TemplateWizardIterImpl.java:248)
at
org.openide.loaders.TemplateWizardIteratorWrapper.instantiate(TemplateWizardIteratorWrapper.java:161)
at
org.openide.WizardDescriptor.callInstantiateOpen(WizardDescriptor.java:1387)
at 
org.openide.WizardDescriptor.callInstantiate(WizardDescriptor.java:1341)
at org.openide.WizardDescriptor.access$1600(WizardDescriptor.java:119)
at 
org.openide.WizardDescriptor$Listener$2$1.run(WizardDescriptor.java:1908)
at 
org.openide.WizardDescriptor$Listener$2.run(WizardDescriptor.java:1957)
at org.openide.WizardDescriptor.lazyValidate(WizardDescriptor.java:1316)
at org.openide.WizardDescriptor.access$1200(WizardDescriptor.java:119)
at
org.openide.WizardDescriptor$Listener.actionPerformed(WizardDescriptor.java:1964)
Caused: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.openide.util.WeakListenerImpl$ProxyListener.invoke(WeakListenerImpl.java:449)
Caused: java.lang.reflect.UndeclaredThrowableException
at $Proxy22.actionPerformed(Unknown Source)
at 
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
at
javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at 
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
at java.awt.Component.pr

Re: [hibernate-dev] Invoking hbm2java without using Ant

2008-05-14 Thread Lakshmana Pamarthy
So is this what causing the java.lang.ExceptionInInitializerError while trying
to instantiate JDBCMetaDataConfiguration ?


--- Max Rydahl Andersen <[EMAIL PROTECTED]> wrote:

> The exception says it all. You seem to have multiple commons-logging classes
> on the class path.
> 
> /max
> 
> > Here you go:
> >
> > I have all the required jars added to the project. Those include
> > commons-logging-1.0.4jar, hibernate2.jar, hibernate-tools.jar,
> > hibernate-annotations.jar, dom4j-1.6.1.jar etc...
> >
> > org.apache.commons.logging.LogConfigurationException: Invalid class loader
> > hierarchy.  You have more than one version of
> 'org.apache.commons.logging.Log'
> > visible, which is not allowed.
> > at
> >
>
org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:385)
> > Caused: org.apache.commons.logging.LogConfigurationException:
> > org.apache.commons.logging.LogConfigurationException: Invalid class loader
> > hierarchy.  You have more than one version of
> 'org.apache.commons.logging.Log'
> > visible, which is not allowed. (Caused by
> > org.apache.commons.logging.LogConfigurationException: Invalid class loader
> > hierarchy.  You have more than one version of
> 'org.apache.commons.logging.Log'
> > visible, which is not allowed.)
> > at
> >
>
org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:397)
> > at
> >
>
org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529)
> > Caused: org.apache.commons.logging.LogConfigurationException:
> > org.apache.commons.logging.LogConfigurationException:
> > org.apache.commons.logging.LogConfigurationException: Invalid class loader
> > hierarchy.  You have more than one version of
> 'org.apache.commons.logging.Log'
> > visible, which is not allowed. (Caused by
> > org.apache.commons.logging.LogConfigurationException: Invalid class loader
> > hierarchy.  You have more than one version of
> 'org.apache.commons.logging.Log'
> > visible, which is not allowed.) (Caused by
> > org.apache.commons.logging.LogConfigurationException:
> > org.apache.commons.logging.LogConfigurationException: Invalid class loader
> > hierarchy.  You have more than one version of
> 'org.apache.commons.logging.Log'
> > visible, which is not allowed. (Caused by
> > org.apache.commons.logging.LogConfigurationException: Invalid class loader
> > hierarchy.  You have more than one version of
> 'org.apache.commons.logging.Log'
> > visible, which is not allowed.))
> > at
> >
>
org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:543)
> > at
> >
>
org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235)
> > at
> >
>
org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:209)
> > at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
> > at org.hibernate.cfg.Configuration.(Configuration.java:120)
> > Caused: java.lang.ExceptionInInitializerError
> > at
> >
>
org.netbeans.modules.hibernate.wizards.HibernateRevengWizard.buildFiles(HibernateRevengWizard.java:250)
> > at
> >
>
org.netbeans.modules.hibernate.wizards.HibernateRevengWizard.instantiate(HibernateRevengWizard.java:237)
> > at
> >
>
org.openide.loaders.TemplateWizard$InstantiatingIteratorBridge.instantiate(TemplateWizard.java:1025)
> > at
> >
> org.openide.loaders.TemplateWizard.handleInstantiate(TemplateWizard.java:595)
> > at
> >
>
org.openide.loaders.TemplateWizard.instantiateNewObjects(TemplateWizard.java:416)
> > at
> >
>
org.openide.loaders.TemplateWizardIterImpl.instantiate(TemplateWizardIterImpl.java:248)
> > at
> >
>
org.openide.loaders.TemplateWizardIteratorWrapper.instantiate(TemplateWizardIteratorWrapper.java:161)
> > at
> >
> org.openide.WizardDescriptor.callInstantiateOpen(WizardDescriptor.java:1387)
> > at
> org.openide.WizardDescriptor.callInstantiate(WizardDescriptor.java:1341)
> > at org.openide.WizardDescriptor.access$1600(WizardDescriptor.java:119)
> > at
> org.openide.WizardDescriptor$Listener$2$1.run(WizardDescriptor.java:1908)
> > at 
> > org.openide.WizardDescriptor$Listener$2.run(WizardDescriptor.java:1957)
> > at org.openide.WizardDescriptor.lazyValidate(WizardDescriptor.java:1316)
> > at org.openide.WizardDescriptor.access$1200(WizardDescriptor.java:119)
> > at
> >
>
org.openide.WizardDescriptor$Listener.actionPerformed(WizardDescriptor.java:1964)
> > Caused: java.lang.reflect.InvocationTargetException
> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > at
> >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> > at
> >
>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> > at java.lang.reflect.Method.invoke(Method.java:585)
> > at
> >
>
org.openide.util.WeakListenerImpl$ProxyListener.invoke(WeakListenerImpl.java:449)
> > Caused: java.lang.reflect.Undecla