You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by Hari Krishna Korrapati <ha...@gmail.com> on 2007/12/05 12:18:23 UTC

Problem with cglib jar

Hi,

I am facing a problem with cglib jar.
When i am trying to deploy my ear, i am getting an exception saying

16:44:28,862 ERROR [[/sample]] StandardWrapper.Throwable
java.lang.NoClassDefFoundError: net/sf/cglib/KeyFactory
    at net.sf.hibernate.impl.SessionFactoryImpl.<clinit>(
SessionFactoryImpl.java:297)
    at net.sf.hibernate.cfg.Configuration.buildSessionFactory(
Configuration.java:627)
    at com.xyz.sample.util.ServiceLocator.getDataSource(ServiceLocator.java
:190)
    at com.xyz.sample.web.servlet.ReportServlet.initializeResourceLookups(
ReportServlet.java:912)
    at com.xyz.sample.web.servlet.ReportServlet.init(ReportServlet.java:668)
    at org.apache.catalina.core.StandardWrapper.loadServlet(
StandardWrapper.java:1105)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java
:932)
    at org.apache.catalina.core.StandardContext.loadOnStartup(
StandardContext.java:3915)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java
:4176)
    at org.apache.geronimo.tomcat.GeronimoStandardContext.access$201(
GeronimoStandardContext.java:67)
    at
org.apache.geronimo.tomcat.GeronimoStandardContext$SystemMethodValve.invoke(
GeronimoStandardContext.java:337)
    at org.apache.geronimo.tomcat.valve.GeronimoBeforeAfterValve.invoke(
GeronimoBeforeAfterValve.java:31)
    at org.apache.geronimo.tomcat.GeronimoStandardContext.start(
GeronimoStandardContext.java:192)
    at org.apache.catalina.core.ContainerBase.addChildInternal(
ContainerBase.java:759)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java
:739)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
    at org.apache.geronimo.tomcat.TomcatContainer.addContext(
TomcatContainer.java:313)
    at
org.apache.geronimo.tomcat.TomcatContainer$$FastClassByCGLIB$$9370b073.invoke
(<generated>)
    at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
    at org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke(
FastMethodInvoker.java:38)
    at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(
GBeanOperation.java:122)
    at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(
GBeanInstance.java:817)
    at org.apache.geronimo.gbean.runtime.RawInvoker.invoke(RawInvoker.java
:57)
    at org.apache.geronimo.kernel.basic.RawOperationInvoker.invoke(
RawOperationInvoker.java:35)
    at org.apache.geronimo.kernel.basic.ProxyMethodInterceptor.intercept(
ProxyMethodInterceptor.java:96)
    at
org.apache.geronimo.tomcat.TomcatContainer$$EnhancerByCGLIB$$647beb0c.addContext
(<generated>)
    at org.apache.geronimo.tomcat.TomcatWebAppContext.doStart(
TomcatWebAppContext.java:438)
    at org.apache.geronimo.gbean.runtime.GBeanInstance.createInstance(
GBeanInstance.java:981)
    at org.apache.geronimo.gbean.runtime.GBeanInstanceState.attemptFullStart
(GBeanInstanceState.java:267)
    at org.apache.geronimo.gbean.runtime.GBeanInstanceState.start(
GBeanInstanceState.java:102)
    at org.apache.geronimo.gbean.runtime.GBeanInstanceState.startRecursive(
GBeanInstanceState.java:124)
    at org.apache.geronimo.gbean.runtime.GBeanInstance.startRecursive(
GBeanInstance.java:540)
    at org.apache.geronimo.kernel.basic.BasicKernel.startRecursiveGBean(
BasicKernel.java:379)
    at
org.apache.geronimo.kernel.config.ConfigurationUtil.startConfigurationGBeans
(ConfigurationUtil.java:374)
    at
org.apache.geronimo.kernel.config.ConfigurationUtil.startConfigurationGBeans
(ConfigurationUtil.java:411)
    at org.apache.geronimo.kernel.config.KernelConfigurationManager.start(
KernelConfigurationManager.java:187)
    at
org.apache.geronimo.kernel.config.SimpleConfigurationManager.startConfiguration
(SimpleConfigurationManager.java:527)
    at
org.apache.geronimo.kernel.config.SimpleConfigurationManager.startConfiguration
(SimpleConfigurationManager.java:508)
    at
org.apache.geronimo.kernel.config.SimpleConfigurationManager$$FastClassByCGLIB$$ce77a924.invoke
(<generated>)
    at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
    at org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke(
FastMethodInvoker.java:38)
    at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(
GBeanOperation.java:122)
    at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(
GBeanInstance.java:817)
    at org.apache.geronimo.gbean.runtime.RawInvoker.invoke(RawInvoker.java
:57)
    at org.apache.geronimo.kernel.basic.RawOperationInvoker.invoke(
RawOperationInvoker.java:35)
    at org.apache.geronimo.kernel.basic.ProxyMethodInterceptor.intercept(
ProxyMethodInterceptor.java:96)
    at
org.apache.geronimo.kernel.config.EditableConfigurationManager$$EnhancerByCGLIB$$4ac69885.startConfiguration
(<generated>)
    at org.apache.geronimo.deployment.plugin.local.StartCommand.run(
StartCommand.java:67)
    at java.lang.Thread.run(Thread.java:595)


when i googled it i didnt get exact solution but came to know there is some
problem with hibernate and cglib jars.
My ear has hibernate-2.0.3.jar and cglib-asm-1.0.jar.


*System environment is:*
Application Server: Geronimo 1.1.1, JDK 1.5
Build using Maven 2.0.4
Eclipse 3.2.1


Please advice me how to proceed.


Thanks and Regards,
Hari

Re: Problem with cglib jar

Posted by Jacek Laskowski <ja...@laskowski.net.pl>.
On Dec 14, 2007 7:09 AM, Hari Krishna Korrapati
<ha...@gmail.com> wrote:
> The problem got resolved once i replaced hibernate jar of version 2.0.3 with
> 2.1.4.

Huurayy. Thanks for reporting. I'm sure it'd have been much easier if
you'd used Geronimo 2, but it doesn't really matter actually as you
worked it out with Geronimo 1 too. Think how much easier your life
could be with Geronimo 2 ;-)

Jacek

-- 
Jacek Laskowski
http://www.JacekLaskowski.pl

Re: Problem with cglib jar

Posted by Hari Krishna Korrapati <ha...@gmail.com>.
The problem got resolved once i replaced hibernate jar of version 2.0.3 with
2.1.4.


On Dec 6, 2007 6:34 PM, Jacek Laskowski <ja...@laskowski.net.pl> wrote:

>
> Is it possible that you use the latest (and gratest) Geronimo version?
> I'm pretty sure it'd much easier for you than struggling with the
> previous releases. I doubt *I* give it a shot with G 1.1.1.
>
> Jacek
>
> --
> Jacek Laskowski
> http://www.JacekLaskowski.pl
>

Regards,
Hari

Re: Problem with cglib jar

Posted by Hari Krishna Korrapati <ha...@gmail.com>.
I need to make it out on G1.1.1 only, as i have to implement similar kind of
thing for a client who uses G1.1.1.

On Dec 6, 2007 6:34 PM, Jacek Laskowski <ja...@laskowski.net.pl> wrote:

> On Dec 6, 2007 1:56 PM, Hari Krishna Korrapati
> <ha...@gmail.com> wrote:
>
> > I have removed the hidden classes tag in the above plan, as it was not
> > working.
>
> Is it possible that you use the latest (and gratest) Geronimo version?
> I'm pretty sure it'd much easier for you than struggling with the
> previous releases. I doubt *I* give it a shot with G 1.1.1.
>
> Jacek
>
> --
> Jacek Laskowski
> http://www.JacekLaskowski.pl
>



-- 
Regards,
Hari

Re: Problem with cglib jar

Posted by Jacek Laskowski <ja...@laskowski.net.pl>.
On Dec 6, 2007 1:56 PM, Hari Krishna Korrapati
<ha...@gmail.com> wrote:

> I have removed the hidden classes tag in the above plan, as it was not
> working.

Is it possible that you use the latest (and gratest) Geronimo version?
I'm pretty sure it'd much easier for you than struggling with the
previous releases. I doubt *I* give it a shot with G 1.1.1.

Jacek

-- 
Jacek Laskowski
http://www.JacekLaskowski.pl

Re: Problem with cglib jar

Posted by Hari Krishna Korrapati <ha...@gmail.com>.
Below is the plan (geronimo-application.xml) which i am using

<?xml version="1.0" encoding="UTF-8"?>
<application
    xmlns="http://geronimo.apache.org/xml/ns/j2ee/application-1.1"
    xmlns:log="http://geronimo.apache.org/xml/ns/loginconfig-1.1"
    xmlns:sec="http://geronimo.apache.org/xml/ns/security-1.1"
    xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.1"
    application-name="sampleear">

    <sys:environment>
        <sys:moduleId>
            <sys:groupId>sample-rc</sys:groupId>
            <sys:artifactId>sampleapp</sys:artifactId>
            <sys:version>rc</sys:version>
            <sys:type>car</sys:type>
        </sys:moduleId>
        <sys:dependencies>
            <sys:dependency>
                <sys:groupId>geronimo</sys:groupId>
                <sys:artifactId>geronimo-mail</sys:artifactId>
                <sys:version>1.1.1</sys:version>
                <sys:type>jar</sys:type>
            </sys:dependency>
            <sys:dependency>
                <sys:groupId>geronimo</sys:groupId>
                <sys:artifactId>geronimo-javamail-transport</sys:artifactId>
                <sys:version>1.1.1</sys:version>
                <sys:type>jar</sys:type>
            </sys:dependency>
            <sys:dependency>
                <sys:groupId>console.dbpool</sys:groupId>
                <sys:artifactId>SampleDataSource</sys:artifactId>
            </sys:dependency>
        </sys:dependencies>
    </sys:environment>

    <gbean name="mail/MailSession"
        class="org.apache.geronimo.mail.MailGBean">
        <attribute name="transportProtocol">smtp</attribute>
        <attribute name="useDefault">false</attribute>
        <attribute name="host">localhost</attribute>
        <attribute name="properties">
            mail.debug=true mail.smtp.port=25
            mail.from=xyza@asbcas.com
        </attribute>
    </gbean>
</application>

I am giving a try by upgrading/degrading the version of jars, Need to check
whether any combination works out.
I have removed the hidden classes tag in the above plan, as it was not
working.

On Dec 6, 2007 5:04 PM, Jacek Laskowski <ja...@laskowski.net.pl> wrote:

> On Dec 6, 2007 12:30 PM, Hari Krishna Korrapati
> <ha...@gmail.com> wrote:
> > Hi,
> > Geronimo 1.1.1 has the feature of hidding classes.
> > I tried the option given in the link provided by you, but no luck.
>
> Could you show us the plan you use? You may try to upgrade/downgrade
> the jars in question in Geronimo or your ear.
>
> Jacek
>
> --
> Jacek Laskowski
> http://www.JacekLaskowski.pl
>



-- 
Regards,
Hari

Re: Problem with cglib jar

Posted by Jacek Laskowski <ja...@laskowski.net.pl>.
On Dec 6, 2007 12:30 PM, Hari Krishna Korrapati
<ha...@gmail.com> wrote:
> Hi,
> Geronimo 1.1.1 has the feature of hidding classes.
> I tried the option given in the link provided by you, but no luck.

Could you show us the plan you use? You may try to upgrade/downgrade
the jars in question in Geronimo or your ear.

Jacek

-- 
Jacek Laskowski
http://www.JacekLaskowski.pl

Re: Problem with cglib jar

Posted by Hari Krishna Korrapati <ha...@gmail.com>.
Hi,
Geronimo 1.1.1 has the feature of hidding classes.
I tried the option given in the link provided by you, but no luck.


On Dec 5, 2007 5:02 PM, Jacek Laskowski <ja...@laskowski.net.pl> wrote:

> On Dec 5, 2007 12:18 PM, Hari Krishna Korrapati
> <ha...@gmail.com> wrote:
> > Hi,
> >
> > I am facing a problem with cglib jar.
> > When i am trying to deploy my ear, i am getting an exception saying
> >
> > 16:44:28,862 ERROR [[/sample]] StandardWrapper.Throwable
> > java.lang.NoClassDefFoundError: net/sf/cglib/KeyFactory
> ...
> > when i googled it i didnt get exact solution but came to know there is
> some
> > problem with hibernate and cglib jars.
> > My ear has hibernate-2.0.3.jar and cglib-asm-1.0.jar.
> >
> >
> > System environment is:
> > Application Server: Geronimo 1.1.1, JDK 1.5
>
> I think you need some sort of jar filtering so Geronimo jars don't
> clash with your application's jars. I didn't use G 1.1.1 for a long
> time and don't know whether the feature of hidding classes was
> available at all or not. Google'd it and came across this - Running
> Spring And Hibernate On Geronimo 1.0 (http://www.virtuas.com/node/83).
> See if it works for you and report back.
>
> Jacek
>
> --
> Jacek Laskowski
> http://www.JacekLaskowski.pl
>



-- 
Regards,
Hari

Re: Problem with cglib jar

Posted by Jacek Laskowski <ja...@laskowski.net.pl>.
On Dec 5, 2007 12:18 PM, Hari Krishna Korrapati
<ha...@gmail.com> wrote:
> Hi,
>
> I am facing a problem with cglib jar.
> When i am trying to deploy my ear, i am getting an exception saying
>
> 16:44:28,862 ERROR [[/sample]] StandardWrapper.Throwable
> java.lang.NoClassDefFoundError: net/sf/cglib/KeyFactory
...
> when i googled it i didnt get exact solution but came to know there is some
> problem with hibernate and cglib jars.
> My ear has hibernate-2.0.3.jar and cglib-asm-1.0.jar.
>
>
> System environment is:
> Application Server: Geronimo 1.1.1, JDK 1.5

I think you need some sort of jar filtering so Geronimo jars don't
clash with your application's jars. I didn't use G 1.1.1 for a long
time and don't know whether the feature of hidding classes was
available at all or not. Google'd it and came across this - Running
Spring And Hibernate On Geronimo 1.0 (http://www.virtuas.com/node/83).
See if it works for you and report back.

Jacek

-- 
Jacek Laskowski
http://www.JacekLaskowski.pl