-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 10 posts ] 
Author Message
 Post subject: Session problem : Hibernate with Struts2
PostPosted: Wed Feb 01, 2012 6:27 pm 
Newbie

Joined: Wed Feb 01, 2012 6:24 pm
Posts: 5
Hello,
I am developing an application with Struts2 & Hibernate (using netbeans 7.0.1), and i am trying to execute this code in the action class
Code:
try {
        Session session = NewHibernateUtil.getSessionFactory().openSession();
        session.beginTransaction(); //Démarrer la transaction
        Query q = session.createQuery(hql);
        System.out.println(q);
        List resultList = q.list(); // Exécuter la requête et récupérer le résultat sous forme de List
      //  displayResult(resultList);
        session.getTransaction().commit(); //Récupérer la transaction et la valider
        } catch (HibernateException he) {
        he.printStackTrace();
       
    }



I have this error while running my app :
Code:
GRAVE: Initial SessionFactory creation failed.java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(Z)V



Any help will be much appreciated??


Top
 Profile  
 
 Post subject: Re: Session problem : Hibernate with Struts2
PostPosted: Thu Feb 02, 2012 4:15 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
In your classpath you use jars which are not compatible to each other.
One jar was compiled with a version of org.objectweb.asm.ClassWriter which had a particular constructor with certain parameters (signature),
but now in your classpath the jar which contains the class org.objectweb.asm.ClassWriter this particular constructor does not exist anymore.


Top
 Profile  
 
 Post subject: Re: Session problem : Hibernate with Struts2
PostPosted: Thu Feb 02, 2012 10:46 am 
Newbie

Joined: Wed Feb 01, 2012 6:24 pm
Posts: 5
pb00067 wrote:
In your classpath you use jars which are not compatible to each other.
One jar was compiled with a version of org.objectweb.asm.ClassWriter which had a particular constructor with certain parameters (signature),
but now in your classpath the jar which contains the class org.objectweb.asm.ClassWriter this particular constructor does not exist anymore.


tanks for replying..
From what i understand so far, i tried to add asm-4.0.jar(last version) in the classpath, but still same old problem :(.
How can i skip this error please??


Top
 Profile  
 
 Post subject: Re: Session problem : Hibernate with Struts2
PostPosted: Thu Feb 02, 2012 11:23 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
Hi,

you cannot simply skip this problem, you must first correct the jar dependencies.

Can you please post the whole stacktrace of the exception.
We have to look from which jar the constructor of org.objectweb.asm.ClassWriter is called,
then we must see which version of asm it requires.


Top
 Profile  
 
 Post subject: Re: Session problem : Hibernate with Struts2
PostPosted: Thu Feb 02, 2012 4:18 pm 
Newbie

Joined: Wed Feb 01, 2012 6:24 pm
Posts: 5
In the browser, i have this error
Code:
HTTP Status 500 -

type Exception report

message

descriptionThe server encountered an internal error () that prevented it from fulfilling this request.

exception

java.lang.reflect.InvocationTargetException

note The full stack traces of the exception and its root causes are available in the GlassFish Server Open Source Edition 3.1.1 logs.
GlassFish Server Open Source Edition 3.1.1


I tried to replace the asm.jar in Struts2&hibernate libraries to the same version (asm_4.jar), but still the same problem!
[img]
http://img11.hostingpics.net/pics/439247Sanstitre.gif
[/img]


Top
 Profile  
 
 Post subject: Re: Session problem : Hibernate with Struts2
PostPosted: Fri Feb 03, 2012 3:02 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
The full stack traces of the exception and its root causes are available in the GlassFish Server Open Source Edition 3.1.1 logs.
Please look into this log-file and report the full stacktrace here.


Top
 Profile  
 
 Post subject: Re: Session problem : Hibernate with Struts2
PostPosted: Fri Feb 03, 2012 12:50 pm 
Newbie

Joined: Wed Feb 01, 2012 6:24 pm
Posts: 5
Hi,
Code:
[list]
ATTENTION: Unable to load config class com.googlecode.s2hibernate.struts2.plugin.interceptors.SessionTransactionInjectorInterceptor at interceptor - jar:file:/C:/Users/z@ki/Documents/NetBeansProjects/S2Hi/build/web/WEB-INF/lib/struts2-fullhibernatecore-plugin-2.2.2-GA.jar!/struts-plugin.xml:15:161 probably due to a missing jar, which might be fine if you never plan to use the hibernateSessionInterceptor interceptor
GRAVE: Actual exception
Could not load class com.googlecode.s2hibernate.struts2.plugin.interceptors.SessionTransactionInjectorInterceptor. Perhaps it exists but certain dependencies are not available? - interceptor - jar:file:/C:/Users/z@ki/Documents/NetBeansProjects/S2Hi/build/web/WEB-INF/lib/struts2-fullhibernatecore-plugin-2.2.2-GA.jar!/struts-plugin.xml:15:161
   at org.apache.struts2.impl.StrutsObjectFactory.buildInterceptor(StrutsObjectFactory.java:81)
   at com.opensymphony.xwork2.config.providers.InterceptorBuilder.constructInterceptorReference(InterceptorBuilder.java:70)
   at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.lookupInterceptorReference(XmlConfigurationProvider.java:998)
   at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadInterceptorStack(XmlConfigurationProvider.java:817)
   at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadInterceptorStacks(XmlConfigurationProvider.java:830)
   at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadInterceptors(XmlConfigurationProvider.java:853)
   at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:460)
   at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:275)
   at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:111)
   at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:204)
   at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66)
   at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:380)
   at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:424)
   at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:195)
   at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:264)
   at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:120)
   at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4685)
   at org.apache.catalina.core.StandardContext.start(StandardContext.java:5377)
   at com.sun.enterprise.web.WebModule.start(WebModule.java:498)
   at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:917)
   at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:901)
   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:733)
   at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2000)
   at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1651)
   at com.sun.enterprise.web.WebApplication.start(WebApplication.java:109)
   at org.glassfish.internal.data.EngineRef.start(EngineRef.java:130)
   at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:269)
   at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:294)
   at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:462)
   at com.sun.enterprise.v3.server.ApplicationLoaderService.processApplication(ApplicationLoaderService.java:375)
   at com.sun.enterprise.v3.server.ApplicationLoaderService.postConstruct(ApplicationLoaderService.java:219)
   at com.sun.hk2.component.AbstractCreatorImpl.inject(AbstractCreatorImpl.java:131)
   at com.sun.hk2.component.ConstructorCreator.initialize(ConstructorCreator.java:91)
   at com.sun.hk2.component.AbstractCreatorImpl.get(AbstractCreatorImpl.java:82)
   at com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:67)
   at com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:139)
   at com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:76)
   at com.sun.enterprise.v3.server.AppServerStartup.run(AppServerStartup.java:253)
   at com.sun.enterprise.v3.server.AppServerStartup.doStart(AppServerStartup.java:145)
   at com.sun.enterprise.v3.server.AppServerStartup.start(AppServerStartup.java:136)
   at com.sun.enterprise.glassfish.bootstrap.GlassFishImpl.start(GlassFishImpl.java:79)
   at com.sun.enterprise.glassfish.bootstrap.GlassFishDecorator.start(GlassFishDecorator.java:63)
   at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishImpl.start(OSGiGlassFishImpl.java:69)
   at com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher.launch(GlassFishMain.java:117)
   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:597)
   at com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMain.java:97)
   at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:55)
Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Layout
   at java.lang.Class.getDeclaredConstructors0(Native Method)
   at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
   at java.lang.Class.getConstructor0(Class.java:2699)
   at java.lang.Class.newInstance0(Class.java:326)
   at java.lang.Class.newInstance(Class.java:308)
   at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:130)
   at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:161)
   at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:150)
   at org.apache.struts2.impl.StrutsObjectFactory.buildInterceptor(StrutsObjectFactory.java:52)
   ... 49 more
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Layout
   at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1519)
   at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1369)
   at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
   ... 58 more

ATTENTION: Unable to load config class com.googlecode.s2hibernate.struts2.plugin.interceptors.SessionTransactionInjectorInterceptor at interceptor - jar:file:/C:/Users/z@ki/Documents/NetBeansProjects/S2Hi/build/web/WEB-INF/lib/struts2-fullhibernatecore-plugin-2.2.2-GA.jar!/struts-plugin.xml:15:161 probably due to a missing jar, which might be fine if you never plan to use the hibernateSessionInterceptor interceptor
GRAVE: Actual exception
Could not load class com.googlecode.s2hibernate.struts2.plugin.interceptors.SessionTransactionInjectorInterceptor. Perhaps it exists but certain dependencies are not available? - interceptor - jar:file:/C:/Users/z@ki/Documents/NetBeansProjects/S2Hi/build/web/WEB-INF/lib/struts2-fullhibernatecore-plugin-2.2.2-GA.jar!/struts-plugin.xml:15:161
   at org.apache.struts2.impl.StrutsObjectFactory.buildInterceptor(StrutsObjectFactory.java:81)
   at com.opensymphony.xwork2.config.providers.InterceptorBuilder.constructInterceptorReference(InterceptorBuilder.java:70)
   at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.lookupInterceptorReference(XmlConfigurationProvider.java:998)
   at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadInterceptorStack(XmlConfigurationProvider.java:817)
   at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadInterceptorStacks(XmlConfigurationProvider.java:830)
   at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadInterceptors(XmlConfigurationProvider.java:853)
   at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:460)
   at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:275)
   at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:111)
   at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:204)
   at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66)
   at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:380)
   at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:424)
   at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:195)
   at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:264)
   at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:120)
   at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4685)
   at org.apache.catalina.core.StandardContext.start(StandardContext.java:5377)
   at com.sun.enterprise.web.WebModule.start(WebModule.java:498)
   at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:917)
   at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:901)
   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:733)
   at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2000)
   at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1651)
   at com.sun.enterprise.web.WebApplication.start(WebApplication.java:109)
   at org.glassfish.internal.data.EngineRef.start(EngineRef.java:130)
   at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:269)
   at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:294)
   at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:462)
   at com.sun.enterprise.v3.server.ApplicationLoaderService.processApplication(ApplicationLoaderService.java:375)
   at com.sun.enterprise.v3.server.ApplicationLoaderService.postConstruct(ApplicationLoaderService.java:219)
   at com.sun.hk2.component.AbstractCreatorImpl.inject(AbstractCreatorImpl.java:131)
   at com.sun.hk2.component.ConstructorCreator.initialize(ConstructorCreator.java:91)
   at com.sun.hk2.component.AbstractCreatorImpl.get(AbstractCreatorImpl.java:82)
   at com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:67)
   at com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:139)
   at com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:76)
   at com.sun.enterprise.v3.server.AppServerStartup.run(AppServerStartup.java:253)
   at com.sun.enterprise.v3.server.AppServerStartup.doStart(AppServerStartup.java:145)
   at com.sun.enterprise.v3.server.AppServerStartup.start(AppServerStartup.java:136)
   at com.sun.enterprise.glassfish.bootstrap.GlassFishImpl.start(GlassFishImpl.java:79)
   at com.sun.enterprise.glassfish.bootstrap.GlassFishDecorator.start(GlassFishDecorator.java:63)
   at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishImpl.start(OSGiGlassFishImpl.java:69)
   at com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher.launch(GlassFishMain.java:117)
   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:597)
   at com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMain.java:97)
   at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:55)
Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Layout
   at java.lang.Class.getDeclaredConstructors0(Native Method)
   at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
   at java.lang.Class.getConstructor0(Class.java:2699)
   at java.lang.Class.newInstance0(Class.java:326)
   at java.lang.Class.newInstance(Class.java:308)
   at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:130)
   at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:161)
   at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:150)
   at org.apache.struts2.impl.StrutsObjectFactory.buildInterceptor(StrutsObjectFactory.java:52)
   ... 49 more
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Layout
   at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1519)
   at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1369)
   at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
   ... 58 more

ATTENTION: Unable to load config class com.googlecode.s2hibernate.struts2.plugin.s2hibernatevalidator.interceptor.HibernateValidatorInterceptor at interceptor - jar:file:/C:/Users/z@ki/Documents/NetBeansProjects/S2Hi/build/web/WEB-INF/lib/struts2-fullhibernatecore-plugin-2.2.2-GA.jar!/struts-plugin.xml:16:173 probably due to a missing jar, which might be fine if you never plan to use the hibernateValidatorInterceptor interceptor
GRAVE: Actual exception
Could not load class com.googlecode.s2hibernate.struts2.plugin.s2hibernatevalidator.interceptor.HibernateValidatorInterceptor. Perhaps it exists but certain dependencies are not available? - interceptor - jar:file:/C:/Users/z@ki/Documents/NetBeansProjects/S2Hi/build/web/WEB-INF/lib/struts2-fullhibernatecore-plugin-2.2.2-GA.jar!/struts-plugin.xml:16:173
   at org.apache.struts2.impl.StrutsObjectFactory.buildInterceptor(StrutsObjectFactory.java:81)
   at com.opensymphony.xwork2.config.providers.InterceptorBuilder.constructInterceptorReference(InterceptorBuilder.java:70)
   at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.lookupInterceptorReference(XmlConfigurationProvider.java:998)
   at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadInterceptorStack(XmlConfigurationProvider.java:817)
   at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadInterceptorStacks(XmlConfigurationProvider.java:830)
   at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadInterceptors(XmlConfigurationProvider.java:853)
   at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:460)
   at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:275)
   at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:111)
   at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:204)
   at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66)
   at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:380)
   at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:424)
   at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:195)
   at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:264)
   at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:120)
   at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4685)
   at org.apache.catalina.core.StandardContext.start(StandardContext.java:5377)
   at com.sun.enterprise.web.WebModule.start(WebModule.java:498)
   at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:917)
   at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:901)
   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:733)
   at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2000)
   at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1651)
   at com.sun.enterprise.web.WebApplication.start(WebApplication.java:109)
   at org.glassfish.internal.data.EngineRef.start(EngineRef.java:130)
   at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:269)
   at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:294)
   at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:462)
   at com.sun.enterprise.v3.server.ApplicationLoaderService.processApplication(ApplicationLoaderService.java:375)
   at com.sun.enterprise.v3.server.ApplicationLoaderService.postConstruct(ApplicationLoaderService.java:219)
   at com.sun.hk2.component.AbstractCreatorImpl.inject(AbstractCreatorImpl.java:131)
   at com.sun.hk2.component.ConstructorCreator.initialize(ConstructorCreator.java:91)
   at com.sun.hk2.component.AbstractCreatorImpl.get(AbstractCreatorImpl.java:82)
   at com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:67)
   at com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:139)
   at com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:76)
   at com.sun.enterprise.v3.server.AppServerStartup.run(AppServerStartup.java:253)
   at com.sun.enterprise.v3.server.AppServerStartup.doStart(AppServerStartup.java:145)
   at com.sun.enterprise.v3.server.AppServerStartup.start(AppServerStartup.java:136)
   at com.sun.enterprise.glassfish.bootstrap.GlassFishImpl.start(GlassFishImpl.java:79)
   at com.sun.enterprise.glassfish.bootstrap.GlassFishDecorator.start(GlassFishDecorator.java:63)
   at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishImpl.start(OSGiGlassFishImpl.java:69)
   at com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher.launch(GlassFishMain.java:117)
   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:597)
   at com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMain.java:97)
   at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:55)
Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Layout
   at java.lang.Class.getDeclaredConstructors0(Native Method)
   at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
   at java.lang.Class.getConstructor0(Class.java:2699)
   at java.lang.Class.newInstance0(Class.java:326)
   at java.lang.Class.newInstance(Class.java:308)
   at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:130)
   at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:161)
   at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:150)
   at org.apache.struts2.impl.StrutsObjectFactory.buildInterceptor(StrutsObjectFactory.java:52)
   ... 49 more
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Layout
   at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1519)
   at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1369)
   at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
   ... 58 more

ATTENTION: Unable to load config class com.googlecode.s2hibernate.struts2.plugin.interceptors.SessionTransactionInjectorInterceptor at interceptor - jar:file:/C:/Users/z@ki/Documents/NetBeansProjects/S2Hi/build/web/WEB-INF/lib/struts2-fullhibernatecore-plugin-2.2.2-GA.jar!/struts-plugin.xml:15:161 probably due to a missing jar, which might be fine if you never plan to use the hibernateSessionInterceptor interceptor
GRAVE: Actual exception
Could not load class com.googlecode.s2hibernate.struts2.plugin.interceptors.SessionTransactionInjectorInterceptor. Perhaps it exists but certain dependencies are not available? - interceptor - jar:file:/C:/Users/z@ki/Documents/NetBeansProjects/S2Hi/build/web/WEB-INF/lib/struts2-fullhibernatecore-plugin-2.2.2-GA.jar!/struts-plugin.xml:15:161
   at org.apache.struts2.impl.StrutsObjectFactory.buildInterceptor(StrutsObjectFactory.java:81)
   at com.opensymphony.xwork2.config.providers.InterceptorBuilder.constructInterceptorReference(InterceptorBuilder.java:70)
   at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.lookupInterceptorReference(XmlConfigurationProvider.java:998)
   at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadInterceptorStack(XmlConfigurationProvider.java:817)
   at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadInterceptorStacks(XmlConfigurationProvider.java:830)
   at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadInterceptors(XmlConfigurationProvider.java:853)
   at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:460)
   at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:275)
   at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:111)
   at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:204)
   at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66)
   at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:380)
   at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:424)
   at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:195)
   at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:264)
   at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:120)
   at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4685)
   at org.apache.catalina.core.StandardContext.start(StandardContext.java:5377)
   at com.sun.enterprise.web.WebModule.start(WebModule.java:498)
   at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:917)
   at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:901)
   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:733)
   at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2000)
   at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1651)
   at com.sun.enterprise.web.WebApplication.start(WebApplication.java:109)
   at org.glassfish.internal.data.EngineRef.start(EngineRef.java:130)
   at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:269)
   at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:294)
   at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:462)
   at com.sun.enterprise.v3.server.ApplicationLoaderService.processApplication(ApplicationLoaderService.java:375)
   at com.sun.enterprise.v3.server.ApplicationLoaderService.postConstruct(ApplicationLoaderService.java:219)
   at com.sun.hk2.component.AbstractCreatorImpl.inject(AbstractCreatorImpl.java:131)
   at com.sun.hk2.component.ConstructorCreator.initialize(ConstructorCreator.java:91)
   at com.sun.hk2.component.AbstractCreatorImpl.get(AbstractCreatorImpl.java:82)
   at com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:67)
   at com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:139)
   at com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:76)
   at com.sun.enterprise.v3.server.AppServerStartup.run(AppServerStartup.java:253)
   at com.sun.enterprise.v3.server.AppServerStartup.doStart(AppServerStartup.java:145)
   at com.sun.enterprise.v3.server.AppServerStartup.start(AppServerStartup.java:136)
   at com.sun.enterprise.glassfish.bootstrap.GlassFishImpl.start(GlassFishImpl.java:79)
   at com.sun.enterprise.glassfish.bootstrap.GlassFishDecorator.start(GlassFishDecorator.java:63)
   at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishImpl.start(OSGiGlassFishImpl.java:69)
   at com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher.launch(GlassFishMain.java:117)
   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:597)
   at com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMain.java:97)
   at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:55)
Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Layout
   at java.lang.Class.getDeclaredConstructors0(Native Method)
   at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
   at java.lang.Class.getConstructor0(Class.java:2699)
   at java.lang.Class.newInstance0(Class.java:326)
   at java.lang.Class.newInstance(Class.java:308)
   at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:130)
   at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:161)
   at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:150)
   at org.apache.struts2.impl.StrutsObjectFactory.buildInterceptor(StrutsObjectFactory.java:52)
   ... 49 more
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Layout
   at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1519)
   at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1369)
   at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
   ... 58 more

INFO: WEB0671: Loading application [S2Hi] at [/S2Hi]
INFO: CORE10010: Loading application S2Hi done in 12 689 ms
INFO: GlassFish Server Open Source Edition 3.1.1 (12) heure de démarrage : Felix (1 177ms), services de démarrage(18 852ms), total(20 029ms)
INFO: JMXStartupService: Started JMXConnector, JMXService URL = service:jmx:rmi://zaki-pc:8686/jndi/rmi://zaki-pc:8686/jmxrmi
INFO: Hibernate Validator 4.1.0.Final
INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
INFO: WEB0169: Created HTTP listener [http-listener-1] on host/port [0.0.0.0:8080]
INFO: Grizzly Framework 1.9.36 started in: 23ms - bound to [0.0.0.0:8080]
INFO: WEB0169: Created HTTP listener [http-listener-2] on host/port [0.0.0.0:8181]
INFO: Grizzly Framework 1.9.36 started in: 6ms - bound to [0.0.0.0:8181]
INFO: Parsing configuration file [struts-default.xml]
INFO: Unable to locate configuration files of the name struts-plugin.xml, skipping
INFO: Parsing configuration file [struts-plugin.xml]
INFO: Parsing configuration file [struts.xml]
INFO: WEB0671: Loading application [S2Hibernate] at [/S2Hibernate]
INFO: S2Hibernate a été déployé en 8 618 ms.
INFO: Hibernate Annotations 3.3.1.GA
INFO: Hibernate 3.2.5
INFO: hibernate.properties not found
INFO: Bytecode provider name : cglib
INFO: using JDK 1.4 java.sql.Timestamp handling
INFO: configuring from resource: /hibernate.cfg.xml
INFO: Configuration resource: /hibernate.cfg.xml
INFO: Reading mappings from resource : test/Entreprises.hbm.xml
INFO: Configured SessionFactory: null
INFO: Mapping class: test.Entreprises -> entreprises
INFO: Hibernate Validator not found: ignoring
INFO: Using Hibernate built-in connection pool (not for production use!)
INFO: Hibernate connection pool size: 20
INFO: autocommit mode: false
INFO: using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost/tp5
INFO: connection properties: {user=root}
INFO: RDBMS: MySQL, version: 5.5.13-log
INFO: JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.1.13 ( Revision: ${bzr.revision-id} )
INFO: Using dialect: org.hibernate.dialect.MySQLDialect
INFO: Using default transaction strategy (direct JDBC transactions)
INFO: No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
INFO: Automatic flush during beforeCompletion(): disabled
INFO: Automatic session close at end of transaction: disabled
INFO: JDBC batch size: 15
INFO: JDBC batch updates for versioned data: disabled
INFO: Scrollable result sets: enabled
INFO: JDBC3 getGeneratedKeys(): enabled
INFO: Connection release mode: auto
INFO: Maximum outer join fetch depth: 2
INFO: Default batch fetch size: 1
INFO: Generate SQL with comments: disabled
INFO: Order SQL updates by primary key: disabled
INFO: Order SQL inserts for batching: disabled
INFO: Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
INFO: Using ASTQueryTranslatorFactory
INFO: Query language substitutions: {}
INFO: JPA-QL strict compliance: disabled
INFO: Second-level cache: enabled
INFO: Query cache: disabled
INFO: Cache provider: org.hibernate.cache.NoCacheProvider
INFO: Optimize cache for minimal puts: disabled
INFO: Structured second-level cache entries: disabled
INFO: Statistics: disabled
INFO: Deleted entity synthetic identifier rollback: disabled
INFO: Default entity-mode: pojo
INFO: Named query checking : enabled
INFO: building session factory
GRAVE: Initial SessionFactory creation failed.java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(Z)V

[/list]



Any suggestion please ??


Top
 Profile  
 
 Post subject: Re: Session problem : Hibernate with Struts2
PostPosted: Fri Feb 03, 2012 10:47 pm 
Newbie

Joined: Fri Feb 03, 2012 10:42 pm
Posts: 1
So much the content, looking for problems, is not an easy thing

_________________
[url=http://breitingreplica.com/replica-cartier-ballon-bleu-de-diamond-mens-watch-we900951-p-902.html]Replica Cartier Ballon Bleu[/url]


Top
 Profile  
 
 Post subject: Re: Session problem : Hibernate with Struts2
PostPosted: Thu Feb 09, 2012 5:45 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
Hi,

the logging clearly says that class org/apache/log4j/Layout cannot be found,
thus log4j jar is missing in your classpath.
You can download log4j from
http://logging.apache.org/log4j/1.2/download.html


Last edited by pb00067 on Thu Feb 09, 2012 11:20 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Session problem : Hibernate with Struts2
PostPosted: Thu Feb 09, 2012 11:17 am 
Newbie

Joined: Wed Feb 01, 2012 6:24 pm
Posts: 5
Hello,
Tanks mr "pb00067" for your help!
I tried to replace Hibernet&Struts2 packages with this JARs and it works !
Code:
01.antlr-2.7.6.jar
02.commons-collections-3.1.jar
03.commons-fileupload-1.2.1.jar
04.commons-io-1.3.2.jar
05.commons-lang-2.3.jar
06.commons-logging-1.1.jar
07.dom4j-1.6.1.jar
08.ejb3-persistence.jar
09.freemarker-2.3.13.jar
10.hibernate3.jar
11.hibernate-annotations.jar
12.hibernate-commons-annotations.jar
13.hibernate-validator.jar
14.hsqldb.jar
15.javassist-3.9.0.GA.jar
16.jta-1.1.jar
17.junit-3.8.1.jar
18.log4j-1.2.15.jar
19.ognl-2.6.11.jar
20.slf4j-api-1.5.8.jar
21.slf4j-log4j12-1.5.8.jar
22.struts2-convention-plugin-2.1.6.jar
23.struts2-core-2.1.6.jar
24.struts2-fullhibernatecore-plugin-1.4-GA.jar
25.xwork-2.1.2.jar

http://www.vaannila.com/struts-2/struts ... ion-1.html

So anyone who have the same problem can try one of this 2solutions
Tanks again.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 10 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.