Return-Path: Delivered-To: apmail-cxf-users-archive@www.apache.org Received: (qmail 33375 invoked from network); 3 Feb 2010 09:39:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 3 Feb 2010 09:39:16 -0000 Received: (qmail 86870 invoked by uid 500); 3 Feb 2010 09:39:15 -0000 Delivered-To: apmail-cxf-users-archive@cxf.apache.org Received: (qmail 86778 invoked by uid 500); 3 Feb 2010 09:39:15 -0000 Mailing-List: contact users-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@cxf.apache.org Delivered-To: mailing list users@cxf.apache.org Received: (qmail 86768 invoked by uid 99); 3 Feb 2010 09:39:15 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Feb 2010 09:39:15 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of devnsl01@gmail.com designates 209.85.220.222 as permitted sender) Received: from [209.85.220.222] (HELO mail-fx0-f222.google.com) (209.85.220.222) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Feb 2010 09:39:05 +0000 Received: by fxm22 with SMTP id 22so2731248fxm.2 for ; Wed, 03 Feb 2010 01:38:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:reply-to :user-agent:mime-version:to:subject:content-type; bh=iRdjhoQjsJ0H7muPQPTpyDGVn6MqZGC9Qi/uTLSV8rg=; b=xuuzwVVVRBZ9Fmh+ViOuRMRM3W/OmnPUrZenUFKh4zSf9qVYgppqpExI9kYnGUBbAL xdm+6LDaV/o6koKuTfoRfxzF5UcKVuRd9Uww+9nFN6MwcDIL5zkjJTKeHnidKqOHzmz5 MemQzgSf2p0DndP1v6C4ZzHbQ9O9dvPZsfEIY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:reply-to:user-agent:mime-version:to:subject :content-type; b=GFhAQ31LzNYDo4B+wZ3afAC8h6ZitDOy3dbUjgCpkcxzwHxYhcoR7gWg9BsiKADBMZ qP2P/QWFyYHZRJ02oR7i4cs+/IHcX4pjnPyAubAR8qlW6HB/iSAQENUpfqnutp3gzD4f k1Qs2OK7qzCZZfVMKgxNoXDmWyukrgHjz/s+4= Received: by 10.103.85.4 with SMTP id n4mr4553427mul.128.1265189924168; Wed, 03 Feb 2010 01:38:44 -0800 (PST) Received: from ?192.168.7.111? ([85.236.238.214]) by mx.google.com with ESMTPS id g1sm7737523muf.7.2010.02.03.01.38.43 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 03 Feb 2010 01:38:43 -0800 (PST) Message-ID: <4B6943B1.1090407@gmail.com> Date: Wed, 03 Feb 2010 10:36:49 +0100 From: Alex Reply-To: devnsl01@gmail.com User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Mailing Liste Apache CXF Subject: Tomcat, CXF and Hibernate Content-Type: multipart/mixed; boundary="------------090308060907020909060103" --------------090308060907020909060103 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: quoted-printable Hi out there, I'm want to set up a CXF 2.2.6 webservice with persistence using=20 hibernate on a tomcat 6.0.24. my setup, please take a look at the attached files. The same configuration work fine without CXF, I dont' know how to set up = this with CXF context, and wehre the problem is. =2E. INFO ;2010-02-03=20 10:30:46,578;org.hibernate.impl.SessionFactoryObjectFactory;;Factory=20 name: MyHibernateSession INFO ;2010-02-03 10:30:46,578;org.hibernate.util.NamingHelper;;JNDI=20 InitialContext properties:{} INFO ;2010-02-03=20 10:30:46,578;org.hibernate.impl.SessionFactoryObjectFactory;;Bound=20 factory to JNDI name: MyHibernateSession WARN ;2010-02-03=20 10:30:46,578;org.hibernate.impl.SessionFactoryObjectFactory;;InitialConte= xt=20 did not implement EventContext INFO ;2010-02-03=20 10:30:46,610;org.springframework.web.context.ContextLoader;;Root=20 WebApplicationContext: initialization started INFO ;2010-02-03=20 10:30:46,633;org.springframework.web.context.support.XmlWebApplicationCon= text;;Refreshing=20 org.springframework.web.context.support.XmlWebApplicationContext@3f56e5ed= :=20 display name [Root WebApplicationContext]; startup date [Wed Feb 03=20 10:30:46 CET 2010]; root of context hierarchy INFO ;2010-02-03=20 10:30:46,668;org.springframework.beans.factory.xml.XmlBeanDefinitionReade= r;;Loading=20 XML bean definitions from ServletContext resource=20 [/WEB-INF/applicationContext.xml] INFO ;2010-02-03=20 10:30:46,737;org.springframework.beans.factory.xml.XmlBeanDefinitionReade= r;;Loading=20 XML bean definitions from class path resource [META-INF/cxf/cxf.xml] INFO ;2010-02-03=20 10:30:46,800;org.springframework.beans.factory.xml.XmlBeanDefinitionReade= r;;Loading=20 XML bean definitions from class path resource=20 [META-INF/cxf/cxf-extension-soap.xml] INFO ;2010-02-03=20 10:30:46,820;org.springframework.beans.factory.xml.XmlBeanDefinitionReade= r;;Loading=20 XML bean definitions from class path resource [META-INF/cxf/cxf-servlet.x= ml] INFO ;2010-02-03=20 10:30:46,868;org.springframework.web.context.support.XmlWebApplicationCon= text;;Bean=20 factory for application context=20 [org.springframework.web.context.support.XmlWebApplicationContext@3f56e5e= d]:=20 org.springframework.beans.factory.support.DefaultListableBeanFactory@7d59= ea8e INFO ;2010-02-03=20 10:30:46,966;org.springframework.beans.factory.support.DefaultListableBea= nFactory;;Pre-instantiating=20 singletons in=20 org.springframework.beans.factory.support.DefaultListableBeanFactory@7d59= ea8e:=20 defining beans=20 [cxf,org.apache.cxf.bus.spring.BusApplicationListener,org.apache.cxf.bus.= spring.BusWiringBeanFactoryPostProcessor,org.apache.cxf.bus.spring.Jsr250= BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,org= =2Eapache.cxf.resource.ResourceManager,org.apache.cxf.configuration.Confi= gurer,org.apache.cxf.binding.BindingFactoryManager,org.apache.cxf.transpo= rt.DestinationFactoryManager,org.apache.cxf.transport.ConduitInitiatorMan= ager,org.apache.cxf.wsdl.WSDLManager,org.apache.cxf.phase.PhaseManager,or= g.apache.cxf.workqueue.WorkQueueManager,org.apache.cxf.buslifecycle.BusLi= feCycleManager,org.apache.cxf.endpoint.ServerRegistry,org.apache.cxf.endp= oint.ServerLifeCycleManager,org.apache.cxf.endpoint.ClientLifeCycleManage= r,org.apache.cxf.transports.http.QueryHandlerRegistry,org.apache.cxf.endp= oint.EndpointResolverRegistry,org.apache.cxf.headers.HeaderManager,org.ap= ache.cxf.catalog.OASISCatalogManager,org.apache.cxf.endpoint.ServiceContr= actResolverRegistry,org.apache.cxf.binding.soap.SoapBindingFactory,org.ap= ache.cxf.binding.soap.SoapTransportFactory,org.apache.cxf.binding.soap.cu= stomEditorConfigurer,org.apache.cxf.transport.servlet.ServletTransportFac= tory,MyService];=20 root of factory hierarchy INFO ;2010-02-03=20 10:30:48,367;org.springframework.web.context.ContextLoader;;Root=20 WebApplicationContext: initialization completed in 1757 ms INFO ;2010-02-03=20 10:30:48,381;org.apache.cxf.bus.spring.BusApplicationContext;;Refreshing = org.apache.cxf.bus.spring.BusApplicationContext@1259b924: display name=20 [org.apache.cxf.bus.spring.BusApplicationContext@1259b924]; startup date = [Wed Feb 03 10:30:48 CET 2010]; parent:=20 org.springframework.web.context.support.XmlWebApplicationContext@3f56e5ed= INFO ;2010-02-03=20 10:30:48,390;org.apache.cxf.bus.spring.BusApplicationContext;;Bean=20 factory for application context=20 [org.apache.cxf.bus.spring.BusApplicationContext@1259b924]:=20 org.springframework.beans.factory.support.DefaultListableBeanFactory@1535= 7784 INFO ;2010-02-03=20 10:30:48,390;org.springframework.beans.factory.support.DefaultListableBea= nFactory;;Pre-instantiating=20 singletons in=20 org.springframework.beans.factory.support.DefaultListableBeanFactory@1535= 7784:=20 defining beans []; parent:=20 org.springframework.beans.factory.support.DefaultListableBeanFactory@7d59= ea8e ERROR;2010-02-03 10:30:50,847;myservice.db.dao.CostumerHome;;Could not=20 locate SessionFactory in JNDI javax.naming.NameNotFoundException: Name MyHibernateSession is not bound = in this Context =2E.. I searched the net but I didn't found any related, so I hope you can=20 help me. Best regards Alex. --------------090308060907020909060103 Content-Type: text/xml; name="applicationContext.xml" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="applicationContext.xml" --------------090308060907020909060103 Content-Type: text/xml; name="context.xml" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="context.xml" --------------090308060907020909060103 Content-Type: text/xml; name="hibernate.cfg.xml" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="hibernate.cfg.xml" java:comp/env/jdbc/mydb org.hibernate.dialect.Sybase11Dialect thread false org.hibernate.transaction.JDBCTransactionFactory org.hibernate.cache.EhCacheProvider --------------090308060907020909060103 Content-Type: text/x-java; name="InitSessionFactory.java" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="InitSessionFactory.java" package myservice.db.hibernate; import javax.naming.InitialContext; import javax.naming.NamingException; import org.apache.log4j.Logger; import org.hibernate.HibernateException; import org.hibernate.SessionFactory; import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Environment; public class InitSessionFactory { private static Logger log = Logger.getLogger(InitSessionFactory.class); /** The single instance of hibernate SessionFactory */ private static org.hibernate.SessionFactory sessionFactory; /** * Default constructor. It is private to guaranty singleton */ private InitSessionFactory() { } static { final Configuration cfg = new Configuration(); cfg.configure("/hibernate.cfg.xml"); String sessionFactoryJndiName = cfg.getProperty(Environment.SESSION_FACTORY_NAME); try { if (sessionFactoryJndiName != null) { cfg.buildSessionFactory(); log.debug("get a jndi session factory"); sessionFactory = (SessionFactory) (new InitialContext()).lookup(sessionFactoryJndiName); } else { log.debug("classic factory"); sessionFactory = cfg.buildSessionFactory(); } } catch (NamingException e) { throw new HibernateException("Could not configure Hibernate configuration", e); } } /** * Returns the single instance of the session factory * * @return */ public static SessionFactory getInstance() { return sessionFactory; } } --------------090308060907020909060103 Content-Type: text/x-java; name="ServletListener.java" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ServletListener.java" package myservice.db.hibernate; import javax.servlet.ServletContextEvent; import javax.servlet.ServletContextListener; public class ServletListener implements ServletContextListener { /** * initialize the factory */ public void contextInitialized(ServletContextEvent arg0) { InitSessionFactory.getInstance(); } /** * close down sessionFactory and free ressources */ public void contextDestroyed(ServletContextEvent arg0) { InitSessionFactory.getInstance().close(); } } --------------090308060907020909060103 Content-Type: text/xml; name="web.xml" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="web.xml" PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iSVNPLTg4NTktMSI/Pgo8d2ViLWFwcCB4 bWxucz0iaHR0cDovL2phdmEuc3VuLmNvbS94bWwvbnMvamF2YWVlIiB4bWxuczp4c2k9Imh0 dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2NoZW1hLWluc3RhbmNlIgoJeHNpOnNjaGVtYUxv Y2F0aW9uPSJodHRwOi8vamF2YS5zdW4uY29tL3htbC9ucy9qYXZhZWUgaHR0cDovL2phdmEu c3VuLmNvbS94bWwvbnMvamF2YWVlL3dlYi1hcHBfMl81LnhzZCIKCXZlcnNpb249IjIuNSI+ Cgk8ZGlzcGxheS1uYW1lPm15U2VydmljZTwvZGlzcGxheS1uYW1lPgoJPGNvbnRleHQtcGFy YW0+CgkJPHBhcmFtLW5hbWU+Y29udGV4dENvbmZpZ0xvY2F0aW9uPC9wYXJhbS1uYW1lPgoJ CTxwYXJhbS12YWx1ZT5XRUItSU5GL2FwcGxpY2F0aW9uQ29udGV4dC54bWw8L3BhcmFtLXZh bHVlPgoJPC9jb250ZXh0LXBhcmFtPgogICAgCiAgICA8bGlzdGVuZXI+CiAgICAgICAgPGxp c3RlbmVyLWNsYXNzPm15c2VydmljZS5kYi5oaWJlcm5hdGUuU2VydmxldExpc3RlbmVyPC9s aXN0ZW5lci1jbGFzcz4KICAgIDwvbGlzdGVuZXI+Cgk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