You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Mikel Cármenes Cavia <mi...@gmail.com> on 2008/06/13 14:37:31 UTC
CGLIB Enhancement failed.
Hey guys,
Does anybody know what the following error might be caused by?
09:20:16,140 ERROR BasicLazyInitializer:130 - CGLIB Enhancement failed:
org.git.systems.data.PcCalc
java.lang.NoClassDefFoundError: Could not initialize class
net.sf.cglib.proxy.Enhancer
I've made sure that cglib is correctly added, and its .jar is indeed there
when I check. This error has to do with Hibernate not being able to access
this resource, thus it cannot execute sessionFactory =
cfg.buildSessionFactory(); and communicate with the database.
I can't think of anything as far as Maven goes that could be going wrong,
since compiling and packaging works fine, I only get messages after the
login panel of my application (that is, I try to log in and when it connects
to the database to check my info, I get these errors).
All errors whine about the same CGLIB Enhancement failing, so I'm guessing
that every single class that requires Hibernate is throwing these
exceptions.
Any clues as to why this may be happening? Has anyone else ever had any
issues with cglib?
Thanks!
RE: CGLIB Enhancement failed.
Posted by Martin Gainty <mg...@hotmail.com>.
the statement that replace old with new is fairly ambiguous
If we know the session_factory_name specification from hibernate.properties vis a vis
hibernate.session_factory_name=org.hibernate.proxy.pojo.cglib.CGLIBProxyFactory
The cglib version which came with hibernate 3.2 I use for Byte code generation is
cglib-2.1.3.jar
Replace <whatever version of cglib> with cglib-2.1.3.jar and apprise us of any errors..this link should provide the necessary library
https://olex.openlogic.com/packages/cglib
Keep us apprised,
Martin Gainty
______________________________________________
Disclaimer and confidentiality note
Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission.
> Date: Fri, 13 Jun 2008 10:54:28 -0300
> From: fabio@simula.com.br
> To: users@maven.apache.org
> Subject: Re: CGLIB Enhancement failed.
>
> It's very difficult to guess, but I think the tip is:
>
> Caused by: java.lang.ClassNotFoundException:
> net.sf.cglib.transform.impl.InterceptFieldEnabled
>
> Something related yet with Hibernate or cglib or its dependencies... You
> are building a single jar with all dependencies packaged in it, right?
> Maybe some dependencies are overwriting classes. Do a test without
> packaging this way.
>
> I added one dependency some time ago, which had a misbehavior of declare
> a specific version dependency. I needed to add the <exclude></exclude>
> element in the dependency declaration to remove the extra library.
>
> All the best!
>
>
> Mikel Cármenes Cavia escreveu:
> > Here is the complete exception, in case this helps:
> >
> > C:\DEV\Maven\GITSYSTEMS\target>java -jar
> > GITSYSTEMS-1.0-jar-with-dependencies.jar
> > Initial SessionFactory creation failed.java.lang.NoClassDefFoundError
> > Exception occurred during event dispatching:
> > java.lang.ExceptionInInitializerError
> > at
> > org.git.systems.data.HibernateUtil.<clinit>(HibernateUtil.java:71)
> > at org.git.systems.data.dao.UserDAO.validateUser(UserDAO.java:49)
> > at org.git.systems.system.UserManager.loginUser(UserManager.java:57)
> > at
> > org.git.systems.gui.LoginJDialog.actionPerformed(LoginJDialog.java:174)
> > at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
> > at javax.swing.AbstractButton$Handler.actionPerformed(Unknown
> > Source)
> > at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown
> > Source)
> > at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
> > at javax.swing.AbstractButton.doClick(Unknown Source)
> > at
> > javax.swing.plaf.basic.BasicRootPaneUI$Actions.actionPerformed(Unknown
> > Source)
> > at javax.swing.SwingUtilities.notifyAction(Unknown Source)
> > at javax.swing.JComponent.processKeyBinding(Unknown Source)
> > at javax.swing.KeyboardManager.fireBinding(Unknown Source)
> > at javax.swing.KeyboardManager.fireKeyboardAction(Unknown Source)
> > at javax.swing.JComponent.processKeyBindingsForAllComponents(Unknown
> > Source)
> > at javax.swing.JComponent.processKeyBindings(Unknown Source)
> > at javax.swing.JComponent.processKeyEvent(Unknown Source)
> > at java.awt.Component.processEvent(Unknown Source)
> > at java.awt.Container.processEvent(Unknown Source)
> > at java.awt.Component.dispatchEventImpl(Unknown Source)
> > at java.awt.Container.dispatchEventImpl(Unknown Source)
> > at java.awt.Component.dispatchEvent(Unknown Source)
> > at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
> > at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown
> > Source)
> > at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown
> > Source)
> > at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown
> > Source)
> > at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown
> > Source)
> > at java.awt.Component.dispatchEventImpl(Unknown Source)
> > at java.awt.Container.dispatchEventImpl(Unknown Source)
> > at java.awt.Window.dispatchEventImpl(Unknown Source)
> > at java.awt.Component.dispatchEvent(Unknown Source)
> > at java.awt.EventQueue.dispatchEvent(Unknown Source)
> > at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown
> > Source)
> > at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
> > at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
> > at java.awt.Dialog$1.run(Unknown Source)
> > at java.awt.Dialog$3.run(Unknown Source)
> > at java.security.AccessController.doPrivileged(Native Method)
> > at java.awt.Dialog.show(Unknown Source)
> > at java.awt.Component.show(Unknown Source)
> > at java.awt.Component.setVisible(Unknown Source)
> > at java.awt.Window.setVisible(Unknown Source)
> > at java.awt.Dialog.setVisible(Unknown Source)
> > at org.git.systems.gui.LoginJDialog.<init>(LoginJDialog.java:44)
> > at
> > org.git.systems.gui.mainwindow.GITCAPMainJFrame.<init>(GITCAPMainJFrame.java:63)
> > at org.git.systems.GITCap$1.run(GITCap.java:61)
> > at java.awt.event.InvocationEvent.dispatch(Unknown Source)
> > at java.awt.EventQueue.dispatchEvent(Unknown Source)
> > at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown
> > Source)
> > at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
> > at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown
> > Source)
> > at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
> > at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
> > at java.awt.EventDispatchThread.run(Unknown Source)
> > Caused by: java.lang.NoClassDefFoundError
> > at
> > org.hibernate.tuple.EntityMetamodel.class$(EntityMetamodel.java:41)
> > at
> > org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:122)
> > at
> > org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:412)
> > at
> > org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:10
> > 8)
> > at
> > org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
> > at
> > org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:216)
> > at
> > org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1176)
> > at
> > org.git.systems.data.HibernateUtil.<clinit>(HibernateUtil.java:65)
> > ... 53 more
> > Caused by: java.lang.ClassNotFoundException:
> > net.sf.cglib.transform.impl.InterceptFieldEnabled
> > at java.net.URLClassLoader$1.run(Unknown Source)
> > at java.security.AccessController.doPrivileged(Native Method)
> > at java.net.URLClassLoader.findClass(Unknown Source)
> > at java.lang.ClassLoader.loadClass(Unknown Source)
> > at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
> > at java.lang.ClassLoader.loadClass(Unknown Source)
> > at java.lang.ClassLoader.loadClassInternal(Unknown Source)
> > at java.lang.Class.forName0(Native Method)
> > at java.lang.Class.forName(Unknown Source)
> > ... 61 more
> >
> >
> > Thanks!
> >
> > On Fri, Jun 13, 2008 at 10:18, Mikel Cármenes Cavia <mi...@gmail.com>
> > wrote:
> >
> >> Thanks Fabio, I should have realized that I was adding cglib twice, since
> >> Hibernate adds it already as a transitive dependency. So I have removed
> >> cglib from my pom, but now I get an event dispatching error when the session
> >> factory is built.
> >> This is the code where the problem resides:
> >>
> >> ...
> >> .addClass(org.git.systems.data.SampleState.class);
> >> sessionFactory = cfg.buildSessionFactory();
> >> } catch (Throwable ex) {
> >> // Make sure you log the exception, as it might be swallowed
> >> System.err.println("Initial SessionFactory creation failed. " +
> >> ex);
> >> throw new ExceptionInInitializerError(ex);
> >> }
> >>
> >> And this is the exception:
> >>
> >> Initial SessionFactory creation failed. java.lang.NoClassDefFoundError
> >> Exception occurred during event dispatching:
> >> java.lang.ExceptionInInitializerError
> >> at org.git.systems.data.HibernateUtil.<clinit>(HibernateUtil.java:71)
> >>
> >> It seems like Hibernate is looking for something it can't find, and I'm
> >> totally clueless as to what that might be...
> >>
> >> Mikel
> >>
> >> 2008/6/13 Fabio Braga de Oliveira <fa...@simula.com.br>:
> >>
> >> Hi Mikel,
> >>> This happened to me when 2 different cglib versions where added to the
> >>> build. Look for a library adding the cglib as a transitive dependency, and
> >>> exclude the oldest one.
> >>>
> >>> Good luck!
> >>>
> >>>
> >>> Mikel Cármenes Cavia escreveu:
> >>>
> >>> Hey guys,
> >>>> Does anybody know what the following error might be caused by?
> >>>>
> >>>> 09:20:16,140 ERROR BasicLazyInitializer:130 - CGLIB Enhancement failed:
> >>>> org.git.systems.data.PcCalc
> >>>> java.lang.NoClassDefFoundError: Could not initialize class
> >>>> net.sf.cglib.proxy.Enhancer
> >>>>
> >>>> I've made sure that cglib is correctly added, and its .jar is indeed
> >>>> there
> >>>> when I check. This error has to do with Hibernate not being able to
> >>>> access
> >>>> this resource, thus it cannot execute sessionFactory =
> >>>> cfg.buildSessionFactory(); and communicate with the database.
> >>>>
> >>>> I can't think of anything as far as Maven goes that could be going wrong,
> >>>> since compiling and packaging works fine, I only get messages after the
> >>>> login panel of my application (that is, I try to log in and when it
> >>>> connects
> >>>> to the database to check my info, I get these errors).
> >>>>
> >>>> All errors whine about the same CGLIB Enhancement failing, so I'm
> >>>> guessing
> >>>> that every single class that requires Hibernate is throwing these
> >>>> exceptions.
> >>>>
> >>>> Any clues as to why this may be happening? Has anyone else ever had any
> >>>> issues with cglib?
> >>>>
> >>>> Thanks!
> >>>>
> >>>>
> >>> --
> >>> Fabio Braga de Oliveira
> >>> Gerente de Projetos de Software
> >>> Work: +55 19 3295-2111
> >>> Mobile: +55 19 9270-6574
> >>> E-mail: fabio@simula.com.br
> >>>
> >>> Símula Sistemas de Planejamento e Comércio Ltda.
> >>> Url: http://www.simula.com.br
> >>> Address: Av. José Bonifácio, 2510
> >>> Zipcode 13093-240
> >>> Campinas - SP - Brazil
> >>>
> >>>
> >>>
> >
>
>
> --
> Fabio Braga de Oliveira
> Gerente de Projetos de Software
> Work: +55 19 3295-2111
> Mobile: +55 19 9270-6574
> E-mail: fabio@simula.com.br
>
> Símula Sistemas de Planejamento e Comércio Ltda.
> Url: http://www.simula.com.br
> Address: Av. José Bonifácio, 2510
> Zipcode 13093-240
> Campinas - SP - Brazil
>
>
_________________________________________________________________
It’s easy to add contacts from Facebook and other social sites through Windows Live™ Messenger. Learn how.
https://www.invite2messenger.net/im/?source=TXT_EML_WLH_LearnHow
Re: CGLIB Enhancement failed.
Posted by Mikel Cármenes Cavia <mi...@gmail.com>.
On a completely different note, I am looking to build a custom build tool
that takes my application from the file system, or from version control, and
based on Maven and launch4j, builds a Windows executable.
Do any of you guys know of a way that I could query mvnrepository.com from
java to get the right pom declarations for each of the dependencies? This is
the only way I can think of to add some dynamism to the whole custom build
process.
Cheers!
On Fri, Jun 13, 2008 at 11:08, Mikel Cármenes Cavia <mi...@gmail.com>
wrote:
> Thanks so much Simon and Fabio, it's all up and running now!
> Your help is truly appreciated.
>
>
> 2008/6/13 Fabio Braga de Oliveira <fa...@simula.com.br>:
>
>> It's very difficult to guess, but I think the tip is:
>>
>> Caused by: java.lang.ClassNotFoundException:
>> net.sf.cglib.transform.impl.InterceptFieldEnabled
>>
>> Something related yet with Hibernate or cglib or its dependencies... You
>> are building a single jar with all dependencies packaged in it, right? Maybe
>> some dependencies are overwriting classes. Do a test without packaging this
>> way.
>>
>> I added one dependency some time ago, which had a misbehavior of declare a
>> specific version dependency. I needed to add the <exclude></exclude> element
>> in the dependency declaration to remove the extra library.
>>
>> All the best!
>>
>>
>> Mikel Cármenes Cavia escreveu:
>>
>> Here is the complete exception, in case this helps:
>>>
>>> C:\DEV\Maven\GITSYSTEMS\target>java -jar
>>> GITSYSTEMS-1.0-jar-with-dependencies.jar
>>> Initial SessionFactory creation failed.java.lang.NoClassDefFoundError
>>> Exception occurred during event dispatching:
>>> java.lang.ExceptionInInitializerError
>>> at
>>> org.git.systems.data.HibernateUtil.<clinit>(HibernateUtil.java:71)
>>> at org.git.systems.data.dao.UserDAO.validateUser(UserDAO.java:49)
>>> at
>>> org.git.systems.system.UserManager.loginUser(UserManager.java:57)
>>> at
>>> org.git.systems.gui.LoginJDialog.actionPerformed(LoginJDialog.java:174)
>>> at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
>>> at javax.swing.AbstractButton$Handler.actionPerformed(Unknown
>>> Source)
>>> at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown
>>> Source)
>>> at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
>>> at javax.swing.AbstractButton.doClick(Unknown Source)
>>> at
>>> javax.swing.plaf.basic.BasicRootPaneUI$Actions.actionPerformed(Unknown
>>> Source)
>>> at javax.swing.SwingUtilities.notifyAction(Unknown Source)
>>> at javax.swing.JComponent.processKeyBinding(Unknown Source)
>>> at javax.swing.KeyboardManager.fireBinding(Unknown Source)
>>> at javax.swing.KeyboardManager.fireKeyboardAction(Unknown Source)
>>> at
>>> javax.swing.JComponent.processKeyBindingsForAllComponents(Unknown
>>> Source)
>>> at javax.swing.JComponent.processKeyBindings(Unknown Source)
>>> at javax.swing.JComponent.processKeyEvent(Unknown Source)
>>> at java.awt.Component.processEvent(Unknown Source)
>>> at java.awt.Container.processEvent(Unknown Source)
>>> at java.awt.Component.dispatchEventImpl(Unknown Source)
>>> at java.awt.Container.dispatchEventImpl(Unknown Source)
>>> at java.awt.Component.dispatchEvent(Unknown Source)
>>> at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
>>> at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown
>>> Source)
>>> at
>>> java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown
>>> Source)
>>> at
>>> java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown
>>> Source)
>>> at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown
>>> Source)
>>> at java.awt.Component.dispatchEventImpl(Unknown Source)
>>> at java.awt.Container.dispatchEventImpl(Unknown Source)
>>> at java.awt.Window.dispatchEventImpl(Unknown Source)
>>> at java.awt.Component.dispatchEvent(Unknown Source)
>>> at java.awt.EventQueue.dispatchEvent(Unknown Source)
>>> at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown
>>> Source)
>>> at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown
>>> Source)
>>> at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown
>>> Source)
>>> at java.awt.Dialog$1.run(Unknown Source)
>>> at java.awt.Dialog$3.run(Unknown Source)
>>> at java.security.AccessController.doPrivileged(Native Method)
>>> at java.awt.Dialog.show(Unknown Source)
>>> at java.awt.Component.show(Unknown Source)
>>> at java.awt.Component.setVisible(Unknown Source)
>>> at java.awt.Window.setVisible(Unknown Source)
>>> at java.awt.Dialog.setVisible(Unknown Source)
>>> at org.git.systems.gui.LoginJDialog.<init>(LoginJDialog.java:44)
>>> at
>>>
>>> org.git.systems.gui.mainwindow.GITCAPMainJFrame.<init>(GITCAPMainJFrame.java:63)
>>> at org.git.systems.GITCap$1.run(GITCap.java:61)
>>> at java.awt.event.InvocationEvent.dispatch(Unknown Source)
>>> at java.awt.EventQueue.dispatchEvent(Unknown Source)
>>> at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown
>>> Source)
>>> at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown
>>> Source)
>>> at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown
>>> Source)
>>> at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
>>> at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
>>> at java.awt.EventDispatchThread.run(Unknown Source)
>>> Caused by: java.lang.NoClassDefFoundError
>>> at
>>> org.hibernate.tuple.EntityMetamodel.class$(EntityMetamodel.java:41)
>>> at
>>> org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:122)
>>> at
>>>
>>> org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:412)
>>> at
>>>
>>> org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:10
>>> 8)
>>> at
>>>
>>> org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
>>> at
>>> org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:216)
>>> at
>>>
>>> org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1176)
>>> at
>>> org.git.systems.data.HibernateUtil.<clinit>(HibernateUtil.java:65)
>>> ... 53 more
>>> Caused by: java.lang.ClassNotFoundException:
>>> net.sf.cglib.transform.impl.InterceptFieldEnabled
>>> at java.net.URLClassLoader$1.run(Unknown Source)
>>> at java.security.AccessController.doPrivileged(Native Method)
>>> at java.net.URLClassLoader.findClass(Unknown Source)
>>> at java.lang.ClassLoader.loadClass(Unknown Source)
>>> at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
>>> at java.lang.ClassLoader.loadClass(Unknown Source)
>>> at java.lang.ClassLoader.loadClassInternal(Unknown Source)
>>> at java.lang.Class.forName0(Native Method)
>>> at java.lang.Class.forName(Unknown Source)
>>> ... 61 more
>>>
>>>
>>> Thanks!
>>>
>>> On Fri, Jun 13, 2008 at 10:18, Mikel Cármenes Cavia <mi...@gmail.com>
>>> wrote:
>>>
>>> Thanks Fabio, I should have realized that I was adding cglib twice,
>>>> since
>>>> Hibernate adds it already as a transitive dependency. So I have removed
>>>> cglib from my pom, but now I get an event dispatching error when the
>>>> session
>>>> factory is built.
>>>> This is the code where the problem resides:
>>>>
>>>> ...
>>>> .addClass(org.git.systems.data.SampleState.class);
>>>> sessionFactory = cfg.buildSessionFactory();
>>>> } catch (Throwable ex) {
>>>> // Make sure you log the exception, as it might be swallowed
>>>> System.err.println("Initial SessionFactory creation failed. " +
>>>> ex);
>>>> throw new ExceptionInInitializerError(ex);
>>>> }
>>>>
>>>> And this is the exception:
>>>>
>>>> Initial SessionFactory creation failed. java.lang.NoClassDefFoundError
>>>> Exception occurred during event dispatching:
>>>> java.lang.ExceptionInInitializerError
>>>> at org.git.systems.data.HibernateUtil.<clinit>(HibernateUtil.java:71)
>>>>
>>>> It seems like Hibernate is looking for something it can't find, and I'm
>>>> totally clueless as to what that might be...
>>>>
>>>> Mikel
>>>>
>>>> 2008/6/13 Fabio Braga de Oliveira <fa...@simula.com.br>:
>>>>
>>>> Hi Mikel,
>>>>
>>>>> This happened to me when 2 different cglib versions where added to the
>>>>> build. Look for a library adding the cglib as a transitive dependency,
>>>>> and
>>>>> exclude the oldest one.
>>>>>
>>>>> Good luck!
>>>>>
>>>>>
>>>>> Mikel Cármenes Cavia escreveu:
>>>>>
>>>>> Hey guys,
>>>>>
>>>>>> Does anybody know what the following error might be caused by?
>>>>>>
>>>>>> 09:20:16,140 ERROR BasicLazyInitializer:130 - CGLIB Enhancement
>>>>>> failed:
>>>>>> org.git.systems.data.PcCalc
>>>>>> java.lang.NoClassDefFoundError: Could not initialize class
>>>>>> net.sf.cglib.proxy.Enhancer
>>>>>>
>>>>>> I've made sure that cglib is correctly added, and its .jar is indeed
>>>>>> there
>>>>>> when I check. This error has to do with Hibernate not being able to
>>>>>> access
>>>>>> this resource, thus it cannot execute sessionFactory =
>>>>>> cfg.buildSessionFactory(); and communicate with the database.
>>>>>>
>>>>>> I can't think of anything as far as Maven goes that could be going
>>>>>> wrong,
>>>>>> since compiling and packaging works fine, I only get messages after
>>>>>> the
>>>>>> login panel of my application (that is, I try to log in and when it
>>>>>> connects
>>>>>> to the database to check my info, I get these errors).
>>>>>>
>>>>>> All errors whine about the same CGLIB Enhancement failing, so I'm
>>>>>> guessing
>>>>>> that every single class that requires Hibernate is throwing these
>>>>>> exceptions.
>>>>>>
>>>>>> Any clues as to why this may be happening? Has anyone else ever had
>>>>>> any
>>>>>> issues with cglib?
>>>>>>
>>>>>> Thanks!
>>>>>>
>>>>>>
>>>>>> --
>>>>> Fabio Braga de Oliveira
>>>>> Gerente de Projetos de Software
>>>>> Work: +55 19 3295-2111
>>>>> Mobile: +55 19 9270-6574
>>>>> E-mail: fabio@simula.com.br
>>>>>
>>>>> Símula Sistemas de Planejamento e Comércio Ltda.
>>>>> Url: http://www.simula.com.br
>>>>> Address: Av. José Bonifácio, 2510
>>>>> Zipcode 13093-240
>>>>> Campinas - SP - Brazil
>>>>>
>>>>>
>>>>>
>>>>>
>>>
>>
>> --
>> Fabio Braga de Oliveira
>> Gerente de Projetos de Software
>> Work: +55 19 3295-2111
>> Mobile: +55 19 9270-6574
>> E-mail: fabio@simula.com.br
>>
>> Símula Sistemas de Planejamento e Comércio Ltda.
>> Url: http://www.simula.com.br
>> Address: Av. José Bonifácio, 2510
>> Zipcode 13093-240
>> Campinas - SP - Brazil
>>
>>
>>
>
Re: CGLIB Enhancement failed.
Posted by Mikel Cármenes Cavia <mi...@gmail.com>.
Thanks so much Simon and Fabio, it's all up and running now!
Your help is truly appreciated.
2008/6/13 Fabio Braga de Oliveira <fa...@simula.com.br>:
> It's very difficult to guess, but I think the tip is:
>
> Caused by: java.lang.ClassNotFoundException:
> net.sf.cglib.transform.impl.InterceptFieldEnabled
>
> Something related yet with Hibernate or cglib or its dependencies... You
> are building a single jar with all dependencies packaged in it, right? Maybe
> some dependencies are overwriting classes. Do a test without packaging this
> way.
>
> I added one dependency some time ago, which had a misbehavior of declare a
> specific version dependency. I needed to add the <exclude></exclude> element
> in the dependency declaration to remove the extra library.
>
> All the best!
>
>
> Mikel Cármenes Cavia escreveu:
>
> Here is the complete exception, in case this helps:
>>
>> C:\DEV\Maven\GITSYSTEMS\target>java -jar
>> GITSYSTEMS-1.0-jar-with-dependencies.jar
>> Initial SessionFactory creation failed.java.lang.NoClassDefFoundError
>> Exception occurred during event dispatching:
>> java.lang.ExceptionInInitializerError
>> at
>> org.git.systems.data.HibernateUtil.<clinit>(HibernateUtil.java:71)
>> at org.git.systems.data.dao.UserDAO.validateUser(UserDAO.java:49)
>> at
>> org.git.systems.system.UserManager.loginUser(UserManager.java:57)
>> at
>> org.git.systems.gui.LoginJDialog.actionPerformed(LoginJDialog.java:174)
>> at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
>> at javax.swing.AbstractButton$Handler.actionPerformed(Unknown
>> Source)
>> at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown
>> Source)
>> at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
>> at javax.swing.AbstractButton.doClick(Unknown Source)
>> at
>> javax.swing.plaf.basic.BasicRootPaneUI$Actions.actionPerformed(Unknown
>> Source)
>> at javax.swing.SwingUtilities.notifyAction(Unknown Source)
>> at javax.swing.JComponent.processKeyBinding(Unknown Source)
>> at javax.swing.KeyboardManager.fireBinding(Unknown Source)
>> at javax.swing.KeyboardManager.fireKeyboardAction(Unknown Source)
>> at
>> javax.swing.JComponent.processKeyBindingsForAllComponents(Unknown
>> Source)
>> at javax.swing.JComponent.processKeyBindings(Unknown Source)
>> at javax.swing.JComponent.processKeyEvent(Unknown Source)
>> at java.awt.Component.processEvent(Unknown Source)
>> at java.awt.Container.processEvent(Unknown Source)
>> at java.awt.Component.dispatchEventImpl(Unknown Source)
>> at java.awt.Container.dispatchEventImpl(Unknown Source)
>> at java.awt.Component.dispatchEvent(Unknown Source)
>> at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
>> at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown
>> Source)
>> at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown
>> Source)
>> at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown
>> Source)
>> at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown
>> Source)
>> at java.awt.Component.dispatchEventImpl(Unknown Source)
>> at java.awt.Container.dispatchEventImpl(Unknown Source)
>> at java.awt.Window.dispatchEventImpl(Unknown Source)
>> at java.awt.Component.dispatchEvent(Unknown Source)
>> at java.awt.EventQueue.dispatchEvent(Unknown Source)
>> at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown
>> Source)
>> at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
>> at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
>> at java.awt.Dialog$1.run(Unknown Source)
>> at java.awt.Dialog$3.run(Unknown Source)
>> at java.security.AccessController.doPrivileged(Native Method)
>> at java.awt.Dialog.show(Unknown Source)
>> at java.awt.Component.show(Unknown Source)
>> at java.awt.Component.setVisible(Unknown Source)
>> at java.awt.Window.setVisible(Unknown Source)
>> at java.awt.Dialog.setVisible(Unknown Source)
>> at org.git.systems.gui.LoginJDialog.<init>(LoginJDialog.java:44)
>> at
>>
>> org.git.systems.gui.mainwindow.GITCAPMainJFrame.<init>(GITCAPMainJFrame.java:63)
>> at org.git.systems.GITCap$1.run(GITCap.java:61)
>> at java.awt.event.InvocationEvent.dispatch(Unknown Source)
>> at java.awt.EventQueue.dispatchEvent(Unknown Source)
>> at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown
>> Source)
>> at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
>> at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown
>> Source)
>> at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
>> at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
>> at java.awt.EventDispatchThread.run(Unknown Source)
>> Caused by: java.lang.NoClassDefFoundError
>> at
>> org.hibernate.tuple.EntityMetamodel.class$(EntityMetamodel.java:41)
>> at
>> org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:122)
>> at
>>
>> org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:412)
>> at
>>
>> org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:10
>> 8)
>> at
>>
>> org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
>> at
>> org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:216)
>> at
>>
>> org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1176)
>> at
>> org.git.systems.data.HibernateUtil.<clinit>(HibernateUtil.java:65)
>> ... 53 more
>> Caused by: java.lang.ClassNotFoundException:
>> net.sf.cglib.transform.impl.InterceptFieldEnabled
>> at java.net.URLClassLoader$1.run(Unknown Source)
>> at java.security.AccessController.doPrivileged(Native Method)
>> at java.net.URLClassLoader.findClass(Unknown Source)
>> at java.lang.ClassLoader.loadClass(Unknown Source)
>> at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
>> at java.lang.ClassLoader.loadClass(Unknown Source)
>> at java.lang.ClassLoader.loadClassInternal(Unknown Source)
>> at java.lang.Class.forName0(Native Method)
>> at java.lang.Class.forName(Unknown Source)
>> ... 61 more
>>
>>
>> Thanks!
>>
>> On Fri, Jun 13, 2008 at 10:18, Mikel Cármenes Cavia <mi...@gmail.com>
>> wrote:
>>
>> Thanks Fabio, I should have realized that I was adding cglib twice, since
>>> Hibernate adds it already as a transitive dependency. So I have removed
>>> cglib from my pom, but now I get an event dispatching error when the
>>> session
>>> factory is built.
>>> This is the code where the problem resides:
>>>
>>> ...
>>> .addClass(org.git.systems.data.SampleState.class);
>>> sessionFactory = cfg.buildSessionFactory();
>>> } catch (Throwable ex) {
>>> // Make sure you log the exception, as it might be swallowed
>>> System.err.println("Initial SessionFactory creation failed. " +
>>> ex);
>>> throw new ExceptionInInitializerError(ex);
>>> }
>>>
>>> And this is the exception:
>>>
>>> Initial SessionFactory creation failed. java.lang.NoClassDefFoundError
>>> Exception occurred during event dispatching:
>>> java.lang.ExceptionInInitializerError
>>> at org.git.systems.data.HibernateUtil.<clinit>(HibernateUtil.java:71)
>>>
>>> It seems like Hibernate is looking for something it can't find, and I'm
>>> totally clueless as to what that might be...
>>>
>>> Mikel
>>>
>>> 2008/6/13 Fabio Braga de Oliveira <fa...@simula.com.br>:
>>>
>>> Hi Mikel,
>>>
>>>> This happened to me when 2 different cglib versions where added to the
>>>> build. Look for a library adding the cglib as a transitive dependency,
>>>> and
>>>> exclude the oldest one.
>>>>
>>>> Good luck!
>>>>
>>>>
>>>> Mikel Cármenes Cavia escreveu:
>>>>
>>>> Hey guys,
>>>>
>>>>> Does anybody know what the following error might be caused by?
>>>>>
>>>>> 09:20:16,140 ERROR BasicLazyInitializer:130 - CGLIB Enhancement failed:
>>>>> org.git.systems.data.PcCalc
>>>>> java.lang.NoClassDefFoundError: Could not initialize class
>>>>> net.sf.cglib.proxy.Enhancer
>>>>>
>>>>> I've made sure that cglib is correctly added, and its .jar is indeed
>>>>> there
>>>>> when I check. This error has to do with Hibernate not being able to
>>>>> access
>>>>> this resource, thus it cannot execute sessionFactory =
>>>>> cfg.buildSessionFactory(); and communicate with the database.
>>>>>
>>>>> I can't think of anything as far as Maven goes that could be going
>>>>> wrong,
>>>>> since compiling and packaging works fine, I only get messages after the
>>>>> login panel of my application (that is, I try to log in and when it
>>>>> connects
>>>>> to the database to check my info, I get these errors).
>>>>>
>>>>> All errors whine about the same CGLIB Enhancement failing, so I'm
>>>>> guessing
>>>>> that every single class that requires Hibernate is throwing these
>>>>> exceptions.
>>>>>
>>>>> Any clues as to why this may be happening? Has anyone else ever had any
>>>>> issues with cglib?
>>>>>
>>>>> Thanks!
>>>>>
>>>>>
>>>>> --
>>>> Fabio Braga de Oliveira
>>>> Gerente de Projetos de Software
>>>> Work: +55 19 3295-2111
>>>> Mobile: +55 19 9270-6574
>>>> E-mail: fabio@simula.com.br
>>>>
>>>> Símula Sistemas de Planejamento e Comércio Ltda.
>>>> Url: http://www.simula.com.br
>>>> Address: Av. José Bonifácio, 2510
>>>> Zipcode 13093-240
>>>> Campinas - SP - Brazil
>>>>
>>>>
>>>>
>>>>
>>
>
> --
> Fabio Braga de Oliveira
> Gerente de Projetos de Software
> Work: +55 19 3295-2111
> Mobile: +55 19 9270-6574
> E-mail: fabio@simula.com.br
>
> Símula Sistemas de Planejamento e Comércio Ltda.
> Url: http://www.simula.com.br
> Address: Av. José Bonifácio, 2510
> Zipcode 13093-240
> Campinas - SP - Brazil
>
>
>
Re: CGLIB Enhancement failed.
Posted by Fabio Braga de Oliveira <fa...@simula.com.br>.
It's very difficult to guess, but I think the tip is:
Caused by: java.lang.ClassNotFoundException:
net.sf.cglib.transform.impl.InterceptFieldEnabled
Something related yet with Hibernate or cglib or its dependencies... You
are building a single jar with all dependencies packaged in it, right?
Maybe some dependencies are overwriting classes. Do a test without
packaging this way.
I added one dependency some time ago, which had a misbehavior of declare
a specific version dependency. I needed to add the <exclude></exclude>
element in the dependency declaration to remove the extra library.
All the best!
Mikel C�rmenes Cavia escreveu:
> Here is the complete exception, in case this helps:
>
> C:\DEV\Maven\GITSYSTEMS\target>java -jar
> GITSYSTEMS-1.0-jar-with-dependencies.jar
> Initial SessionFactory creation failed.java.lang.NoClassDefFoundError
> Exception occurred during event dispatching:
> java.lang.ExceptionInInitializerError
> at
> org.git.systems.data.HibernateUtil.<clinit>(HibernateUtil.java:71)
> at org.git.systems.data.dao.UserDAO.validateUser(UserDAO.java:49)
> at org.git.systems.system.UserManager.loginUser(UserManager.java:57)
> at
> org.git.systems.gui.LoginJDialog.actionPerformed(LoginJDialog.java:174)
> at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
> at javax.swing.AbstractButton$Handler.actionPerformed(Unknown
> Source)
> at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown
> Source)
> at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
> at javax.swing.AbstractButton.doClick(Unknown Source)
> at
> javax.swing.plaf.basic.BasicRootPaneUI$Actions.actionPerformed(Unknown
> Source)
> at javax.swing.SwingUtilities.notifyAction(Unknown Source)
> at javax.swing.JComponent.processKeyBinding(Unknown Source)
> at javax.swing.KeyboardManager.fireBinding(Unknown Source)
> at javax.swing.KeyboardManager.fireKeyboardAction(Unknown Source)
> at javax.swing.JComponent.processKeyBindingsForAllComponents(Unknown
> Source)
> at javax.swing.JComponent.processKeyBindings(Unknown Source)
> at javax.swing.JComponent.processKeyEvent(Unknown Source)
> at java.awt.Component.processEvent(Unknown Source)
> at java.awt.Container.processEvent(Unknown Source)
> at java.awt.Component.dispatchEventImpl(Unknown Source)
> at java.awt.Container.dispatchEventImpl(Unknown Source)
> at java.awt.Component.dispatchEvent(Unknown Source)
> at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
> at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown
> Source)
> at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown
> Source)
> at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown
> Source)
> at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown
> Source)
> at java.awt.Component.dispatchEventImpl(Unknown Source)
> at java.awt.Container.dispatchEventImpl(Unknown Source)
> at java.awt.Window.dispatchEventImpl(Unknown Source)
> at java.awt.Component.dispatchEvent(Unknown Source)
> at java.awt.EventQueue.dispatchEvent(Unknown Source)
> at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown
> Source)
> at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
> at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
> at java.awt.Dialog$1.run(Unknown Source)
> at java.awt.Dialog$3.run(Unknown Source)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.awt.Dialog.show(Unknown Source)
> at java.awt.Component.show(Unknown Source)
> at java.awt.Component.setVisible(Unknown Source)
> at java.awt.Window.setVisible(Unknown Source)
> at java.awt.Dialog.setVisible(Unknown Source)
> at org.git.systems.gui.LoginJDialog.<init>(LoginJDialog.java:44)
> at
> org.git.systems.gui.mainwindow.GITCAPMainJFrame.<init>(GITCAPMainJFrame.java:63)
> at org.git.systems.GITCap$1.run(GITCap.java:61)
> at java.awt.event.InvocationEvent.dispatch(Unknown Source)
> at java.awt.EventQueue.dispatchEvent(Unknown Source)
> at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown
> Source)
> at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
> at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown
> Source)
> at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
> at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
> at java.awt.EventDispatchThread.run(Unknown Source)
> Caused by: java.lang.NoClassDefFoundError
> at
> org.hibernate.tuple.EntityMetamodel.class$(EntityMetamodel.java:41)
> at
> org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:122)
> at
> org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:412)
> at
> org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:10
> 8)
> at
> org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
> at
> org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:216)
> at
> org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1176)
> at
> org.git.systems.data.HibernateUtil.<clinit>(HibernateUtil.java:65)
> ... 53 more
> Caused by: java.lang.ClassNotFoundException:
> net.sf.cglib.transform.impl.InterceptFieldEnabled
> at java.net.URLClassLoader$1.run(Unknown Source)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(Unknown Source)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at java.lang.ClassLoader.loadClassInternal(Unknown Source)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Unknown Source)
> ... 61 more
>
>
> Thanks!
>
> On Fri, Jun 13, 2008 at 10:18, Mikel C�rmenes Cavia <mi...@gmail.com>
> wrote:
>
>> Thanks Fabio, I should have realized that I was adding cglib twice, since
>> Hibernate adds it already as a transitive dependency. So I have removed
>> cglib from my pom, but now I get an event dispatching error when the session
>> factory is built.
>> This is the code where the problem resides:
>>
>> ...
>> .addClass(org.git.systems.data.SampleState.class);
>> sessionFactory = cfg.buildSessionFactory();
>> } catch (Throwable ex) {
>> // Make sure you log the exception, as it might be swallowed
>> System.err.println("Initial SessionFactory creation failed. " +
>> ex);
>> throw new ExceptionInInitializerError(ex);
>> }
>>
>> And this is the exception:
>>
>> Initial SessionFactory creation failed. java.lang.NoClassDefFoundError
>> Exception occurred during event dispatching:
>> java.lang.ExceptionInInitializerError
>> at org.git.systems.data.HibernateUtil.<clinit>(HibernateUtil.java:71)
>>
>> It seems like Hibernate is looking for something it can't find, and I'm
>> totally clueless as to what that might be...
>>
>> Mikel
>>
>> 2008/6/13 Fabio Braga de Oliveira <fa...@simula.com.br>:
>>
>> Hi Mikel,
>>> This happened to me when 2 different cglib versions where added to the
>>> build. Look for a library adding the cglib as a transitive dependency, and
>>> exclude the oldest one.
>>>
>>> Good luck!
>>>
>>>
>>> Mikel C�rmenes Cavia escreveu:
>>>
>>> Hey guys,
>>>> Does anybody know what the following error might be caused by?
>>>>
>>>> 09:20:16,140 ERROR BasicLazyInitializer:130 - CGLIB Enhancement failed:
>>>> org.git.systems.data.PcCalc
>>>> java.lang.NoClassDefFoundError: Could not initialize class
>>>> net.sf.cglib.proxy.Enhancer
>>>>
>>>> I've made sure that cglib is correctly added, and its .jar is indeed
>>>> there
>>>> when I check. This error has to do with Hibernate not being able to
>>>> access
>>>> this resource, thus it cannot execute sessionFactory =
>>>> cfg.buildSessionFactory(); and communicate with the database.
>>>>
>>>> I can't think of anything as far as Maven goes that could be going wrong,
>>>> since compiling and packaging works fine, I only get messages after the
>>>> login panel of my application (that is, I try to log in and when it
>>>> connects
>>>> to the database to check my info, I get these errors).
>>>>
>>>> All errors whine about the same CGLIB Enhancement failing, so I'm
>>>> guessing
>>>> that every single class that requires Hibernate is throwing these
>>>> exceptions.
>>>>
>>>> Any clues as to why this may be happening? Has anyone else ever had any
>>>> issues with cglib?
>>>>
>>>> Thanks!
>>>>
>>>>
>>> --
>>> Fabio Braga de Oliveira
>>> Gerente de Projetos de Software
>>> Work: +55 19 3295-2111
>>> Mobile: +55 19 9270-6574
>>> E-mail: fabio@simula.com.br
>>>
>>> S�mula Sistemas de Planejamento e Com�rcio Ltda.
>>> Url: http://www.simula.com.br
>>> Address: Av. Jos� Bonif�cio, 2510
>>> Zipcode 13093-240
>>> Campinas - SP - Brazil
>>>
>>>
>>>
>
--
Fabio Braga de Oliveira
Gerente de Projetos de Software
Work: +55 19 3295-2111
Mobile: +55 19 9270-6574
E-mail: fabio@simula.com.br
S�mula Sistemas de Planejamento e Com�rcio Ltda.
Url: http://www.simula.com.br
Address: Av. Jos� Bonif�cio, 2510
Zipcode 13093-240
Campinas - SP - Brazil
Re: CGLIB Enhancement failed.
Posted by Mikel Cármenes Cavia <mi...@gmail.com>.
Here is the complete exception, in case this helps:
C:\DEV\Maven\GITSYSTEMS\target>java -jar
GITSYSTEMS-1.0-jar-with-dependencies.jar
Initial SessionFactory creation failed.java.lang.NoClassDefFoundError
Exception occurred during event dispatching:
java.lang.ExceptionInInitializerError
at
org.git.systems.data.HibernateUtil.<clinit>(HibernateUtil.java:71)
at org.git.systems.data.dao.UserDAO.validateUser(UserDAO.java:49)
at org.git.systems.system.UserManager.loginUser(UserManager.java:57)
at
org.git.systems.gui.LoginJDialog.actionPerformed(LoginJDialog.java:174)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown
Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown
Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.AbstractButton.doClick(Unknown Source)
at
javax.swing.plaf.basic.BasicRootPaneUI$Actions.actionPerformed(Unknown
Source)
at javax.swing.SwingUtilities.notifyAction(Unknown Source)
at javax.swing.JComponent.processKeyBinding(Unknown Source)
at javax.swing.KeyboardManager.fireBinding(Unknown Source)
at javax.swing.KeyboardManager.fireKeyboardAction(Unknown Source)
at javax.swing.JComponent.processKeyBindingsForAllComponents(Unknown
Source)
at javax.swing.JComponent.processKeyBindings(Unknown Source)
at javax.swing.JComponent.processKeyEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown
Source)
at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown
Source)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown
Source)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown
Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown
Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.Dialog$1.run(Unknown Source)
at java.awt.Dialog$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Dialog.show(Unknown Source)
at java.awt.Component.show(Unknown Source)
at java.awt.Component.setVisible(Unknown Source)
at java.awt.Window.setVisible(Unknown Source)
at java.awt.Dialog.setVisible(Unknown Source)
at org.git.systems.gui.LoginJDialog.<init>(LoginJDialog.java:44)
at
org.git.systems.gui.mainwindow.GITCAPMainJFrame.<init>(GITCAPMainJFrame.java:63)
at org.git.systems.GITCap$1.run(GITCap.java:61)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown
Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown
Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError
at
org.hibernate.tuple.EntityMetamodel.class$(EntityMetamodel.java:41)
at
org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:122)
at
org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:412)
at
org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:10
8)
at
org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
at
org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:216)
at
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1176)
at
org.git.systems.data.HibernateUtil.<clinit>(HibernateUtil.java:65)
... 53 more
Caused by: java.lang.ClassNotFoundException:
net.sf.cglib.transform.impl.InterceptFieldEnabled
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
... 61 more
Thanks!
On Fri, Jun 13, 2008 at 10:18, Mikel Cármenes Cavia <mi...@gmail.com>
wrote:
> Thanks Fabio, I should have realized that I was adding cglib twice, since
> Hibernate adds it already as a transitive dependency. So I have removed
> cglib from my pom, but now I get an event dispatching error when the session
> factory is built.
> This is the code where the problem resides:
>
> ...
> .addClass(org.git.systems.data.SampleState.class);
> sessionFactory = cfg.buildSessionFactory();
> } catch (Throwable ex) {
> // Make sure you log the exception, as it might be swallowed
> System.err.println("Initial SessionFactory creation failed. " +
> ex);
> throw new ExceptionInInitializerError(ex);
> }
>
> And this is the exception:
>
> Initial SessionFactory creation failed. java.lang.NoClassDefFoundError
> Exception occurred during event dispatching:
> java.lang.ExceptionInInitializerError
> at org.git.systems.data.HibernateUtil.<clinit>(HibernateUtil.java:71)
>
> It seems like Hibernate is looking for something it can't find, and I'm
> totally clueless as to what that might be...
>
> Mikel
>
> 2008/6/13 Fabio Braga de Oliveira <fa...@simula.com.br>:
>
> Hi Mikel,
>>
>> This happened to me when 2 different cglib versions where added to the
>> build. Look for a library adding the cglib as a transitive dependency, and
>> exclude the oldest one.
>>
>> Good luck!
>>
>>
>> Mikel Cármenes Cavia escreveu:
>>
>> Hey guys,
>>> Does anybody know what the following error might be caused by?
>>>
>>> 09:20:16,140 ERROR BasicLazyInitializer:130 - CGLIB Enhancement failed:
>>> org.git.systems.data.PcCalc
>>> java.lang.NoClassDefFoundError: Could not initialize class
>>> net.sf.cglib.proxy.Enhancer
>>>
>>> I've made sure that cglib is correctly added, and its .jar is indeed
>>> there
>>> when I check. This error has to do with Hibernate not being able to
>>> access
>>> this resource, thus it cannot execute sessionFactory =
>>> cfg.buildSessionFactory(); and communicate with the database.
>>>
>>> I can't think of anything as far as Maven goes that could be going wrong,
>>> since compiling and packaging works fine, I only get messages after the
>>> login panel of my application (that is, I try to log in and when it
>>> connects
>>> to the database to check my info, I get these errors).
>>>
>>> All errors whine about the same CGLIB Enhancement failing, so I'm
>>> guessing
>>> that every single class that requires Hibernate is throwing these
>>> exceptions.
>>>
>>> Any clues as to why this may be happening? Has anyone else ever had any
>>> issues with cglib?
>>>
>>> Thanks!
>>>
>>>
>>
>> --
>> Fabio Braga de Oliveira
>> Gerente de Projetos de Software
>> Work: +55 19 3295-2111
>> Mobile: +55 19 9270-6574
>> E-mail: fabio@simula.com.br
>>
>> Símula Sistemas de Planejamento e Comércio Ltda.
>> Url: http://www.simula.com.br
>> Address: Av. José Bonifácio, 2510
>> Zipcode 13093-240
>> Campinas - SP - Brazil
>>
>>
>>
>
Re: CGLIB Enhancement failed.
Posted by "simon.kitching@chello.at" <si...@chello.at>.
The ASM library has made a number of incompatible releases, which causes
nasty problems. I think this might be what you've struck.
Even the latest version of cglib requires ASM 1.x. If something else
requires ASM 2.x or ASM 3.x then you're in trouble because the ASM
versions are incompatible.
Fortunately, there is a variant of cglib that hides ASM internally. So
first, add this dependency to your pom to pull in cglib 2.1.3 with
internal asm:
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib-nodep</artifactId>
<version>2.1_3</version>
</dependency>
Then use "mvn dependency:tree" to find out which dependency is trying to
use cglib, and add this to it:
<exclusion>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
</exclusion>
Repeat until dependency:tree shows no dependency on the original "cglib"
library.
That worked for me.
BTW: it would be great if maven had a "dependency alias" feature, so
that we could say that "cglib-nodep" replaces "cglib". But there is no
such thing AFAIK.
Regards,
Simon
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: CGLIB Enhancement failed.
Posted by Mikel Cármenes Cavia <mi...@gmail.com>.
Thanks Fabio, I should have realized that I was adding cglib twice, since
Hibernate adds it already as a transitive dependency. So I have removed
cglib from my pom, but now I get an event dispatching error when the session
factory is built.
This is the code where the problem resides:
...
.addClass(org.git.systems.data.SampleState.class);
sessionFactory = cfg.buildSessionFactory();
} catch (Throwable ex) {
// Make sure you log the exception, as it might be swallowed
System.err.println("Initial SessionFactory creation failed. " + ex);
throw new ExceptionInInitializerError(ex);
}
And this is the exception:
Initial SessionFactory creation failed. java.lang.NoClassDefFoundError
Exception occurred during event dispatching:
java.lang.ExceptionInInitializerError
at org.git.systems.data.HibernateUtil.<clinit>(HibernateUtil.java:71)
It seems like Hibernate is looking for something it can't find, and I'm
totally clueless as to what that might be...
Mikel
2008/6/13 Fabio Braga de Oliveira <fa...@simula.com.br>:
> Hi Mikel,
>
> This happened to me when 2 different cglib versions where added to the
> build. Look for a library adding the cglib as a transitive dependency, and
> exclude the oldest one.
>
> Good luck!
>
>
> Mikel Cármenes Cavia escreveu:
>
> Hey guys,
>> Does anybody know what the following error might be caused by?
>>
>> 09:20:16,140 ERROR BasicLazyInitializer:130 - CGLIB Enhancement failed:
>> org.git.systems.data.PcCalc
>> java.lang.NoClassDefFoundError: Could not initialize class
>> net.sf.cglib.proxy.Enhancer
>>
>> I've made sure that cglib is correctly added, and its .jar is indeed there
>> when I check. This error has to do with Hibernate not being able to access
>> this resource, thus it cannot execute sessionFactory =
>> cfg.buildSessionFactory(); and communicate with the database.
>>
>> I can't think of anything as far as Maven goes that could be going wrong,
>> since compiling and packaging works fine, I only get messages after the
>> login panel of my application (that is, I try to log in and when it
>> connects
>> to the database to check my info, I get these errors).
>>
>> All errors whine about the same CGLIB Enhancement failing, so I'm guessing
>> that every single class that requires Hibernate is throwing these
>> exceptions.
>>
>> Any clues as to why this may be happening? Has anyone else ever had any
>> issues with cglib?
>>
>> Thanks!
>>
>>
>
> --
> Fabio Braga de Oliveira
> Gerente de Projetos de Software
> Work: +55 19 3295-2111
> Mobile: +55 19 9270-6574
> E-mail: fabio@simula.com.br
>
> Símula Sistemas de Planejamento e Comércio Ltda.
> Url: http://www.simula.com.br
> Address: Av. José Bonifácio, 2510
> Zipcode 13093-240
> Campinas - SP - Brazil
>
>
>
Re: CGLIB Enhancement failed.
Posted by Fabio Braga de Oliveira <fa...@simula.com.br>.
Hi Mikel,
This happened to me when 2 different cglib versions where added to the
build. Look for a library adding the cglib as a transitive dependency,
and exclude the oldest one.
Good luck!
Mikel C�rmenes Cavia escreveu:
> Hey guys,
> Does anybody know what the following error might be caused by?
>
> 09:20:16,140 ERROR BasicLazyInitializer:130 - CGLIB Enhancement failed:
> org.git.systems.data.PcCalc
> java.lang.NoClassDefFoundError: Could not initialize class
> net.sf.cglib.proxy.Enhancer
>
> I've made sure that cglib is correctly added, and its .jar is indeed there
> when I check. This error has to do with Hibernate not being able to access
> this resource, thus it cannot execute sessionFactory =
> cfg.buildSessionFactory(); and communicate with the database.
>
> I can't think of anything as far as Maven goes that could be going wrong,
> since compiling and packaging works fine, I only get messages after the
> login panel of my application (that is, I try to log in and when it connects
> to the database to check my info, I get these errors).
>
> All errors whine about the same CGLIB Enhancement failing, so I'm guessing
> that every single class that requires Hibernate is throwing these
> exceptions.
>
> Any clues as to why this may be happening? Has anyone else ever had any
> issues with cglib?
>
> Thanks!
>
--
Fabio Braga de Oliveira
Gerente de Projetos de Software
Work: +55 19 3295-2111
Mobile: +55 19 9270-6574
E-mail: fabio@simula.com.br
S�mula Sistemas de Planejamento e Com�rcio Ltda.
Url: http://www.simula.com.br
Address: Av. Jos� Bonif�cio, 2510
Zipcode 13093-240
Campinas - SP - Brazil