2 Replies Latest reply on Feb 12, 2014 7:40 AM by Andy Gowdy

    Problems migrating to AS 6

    Andy Gowdy Newbie

      Hi

      I am having problems migrating to AS 6 from AS 3.  I have managed to deploy my ears but when I run the application I get problems converting one to another.

       

      2014-01-31 13:10:46,861 DEBUG [com.comino.cxm.RequestLog.Result] (http-127.0.0.1-8080-1) <ERROR> <DATE>31/01/2014 01:10:46</DATE><MESSAGE>Comino Xml Messaging Error: chkUser</MESSAGE><MESS1>Error creating bean with name 'chkuser' defined in class path resource [HibernateUH.har/com/comino/cxm/hibernateuh/RequestHandlers.xml]: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'org.jboss.resource.adapter.jdbc.WrapperDataSource' to required type 'org.hibernate.SessionFactory' for property 'sessionFactory'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [org.jboss.resource.adapter.jdbc.WrapperDataSource] to required type [org.hibernate.SessionFactory] for property 'sessionFactory': no matching editors or conversion strategy found</MESS1><STACK><![CDATA[org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'chkuser' defined in class path resource [HibernateUH.har/com/comino/cxm/hibernateuh/RequestHandlers.xml]: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'org.jboss.resource.adapter.jdbc.WrapperDataSource' to required type 'org.hibernate.SessionFactory' for property 'sessionFactory'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [org.jboss.resource.adapter.jdbc.WrapperDataSource] to required type [org.hibernate.SessionFactory] for property 'sessionFactory': no matching editors or conversion strategy found

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:529)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)

        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)

        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)

        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)

        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198)

        at com.comino.cxm.housingfacade.objects.business.BeanFactoryBOMap.getBOFRequestHandler(BeanFactoryBOMap.java:56)

        at com.comino.cxm.housingfacade.HousingFacadeBean.setMessage(HousingFacadeBean.java:214)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:606)

        at org.jboss.invocation.Invocation.performCall(Invocation.java:386)

        at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:233)

        at org.jboss.webservices.integration.invocation.ServiceEndpointInterceptorEJB21.invoke(ServiceEndpointInterceptorEJB21.java:93)

        at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:156)

        at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:173)

        at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)

        at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)

        at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)

        at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)

        at org.jboss.ejb.plugins.SecurityInterceptor.process(SecurityInterceptor.java:228)

        at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:211)

        at org.jboss.ejb.plugins.security.PreSecurityInterceptor.process(PreSecurityInterceptor.java:100)

        at org.jboss.ejb.plugins.security.PreSecurityInterceptor.invoke(PreSecurityInterceptor.java:84)

        at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)

        at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:138)

        at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:650)

        at org.jboss.ejb.Container.invoke(Container.java:1072)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:606)

        at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)

        at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)

        at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)

        at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:271)

        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:670)

        at org.jboss.webservices.integration.invocation.InvocationHandlerEJB21.invoke(InvocationHandlerEJB21.java:152)

        at org.jboss.ws.core.server.ServiceEndpointInvoker.invoke(ServiceEndpointInvoker.java:241)

        at org.jboss.wsf.stack.jbws.RequestHandlerImpl.processRequest(RequestHandlerImpl.java:527)

        at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:316)

        at org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl.java:222)

        at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:147)

        at org.jboss.wsf.common.servlet.AbstractEndpointServlet.service(AbstractEndpointServlet.java:87)

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)

        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324)

        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242)

        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)

        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)

        at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181)

        at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.event(CatalinaContext.java:285)

        at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.invoke(CatalinaContext.java:261)

        at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88)

        at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100)

        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:159)

        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

        at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)

        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

        at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53)

        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362)

        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)

        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:654)

        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951)

        at java.lang.Thread.run(Thread.java:744)

      Caused by: org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'org.jboss.resource.adapter.jdbc.WrapperDataSource' to required type 'org.hibernate.SessionFactory' for property 'sessionFactory'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [org.jboss.resource.adapter.jdbc.WrapperDataSource] to required type [org.hibernate.SessionFactory] for property 'sessionFactory': no matching editors or conversion strategy found

        at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:463)

        at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:494)

        at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:488)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1433)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1392)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1128)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)

        ... 64 more

      Caused by: java.lang.IllegalStateException: Cannot convert value of type [org.jboss.resource.adapter.jdbc.WrapperDataSource] to required type [org.hibernate.SessionFactory] for property 'sessionFactory': no matching editors or conversion strategy found

        at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:264)

        at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:448)

        ... 70 more

       

      Here is my bean xml

       

       

       

         <bean id="sessionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">

           <property name="jndiName">

              <ref bean="sessionFactoryName"/>

            </property>

         </bean>

       

       

         <bean id="requestHandler" abstract="true">

           <property name="sessionFactory">

              <ref bean="sessionFactory"/>

            </property>

         </bean>

       

      here is the arguments.

       

        <bean id="BOMap" class="com.comino.cxm.housingfacade.objects.business.BeanFactoryBOMap">

         <property name="boMap">

             <map>

        <entry key="UHLIVE">

        <bean class="com.comino.cxm.housingfacade.RequestHandlerBeanFactory">

        <constructor-arg value="java:UHLIVE" index="0"/>

                      <!--constructor-arg value="java:/hibernate/sessionfactoryuhlive" index="0"/-->

        <constructor-arg value="/HibernateUH.har/com/comino/cxm/hibernateuh/RequestHandlers.xml" index="1"/>

        </bean>

        </entry>

       

      I have spent a few days trying to find this and wondered if there is any help out there who know what this problem is.

       

      Thanks Andy

        • 1. Re: Problems migrating to AS 6
          Andy Gowdy Newbie

          HI Everyone

           

          I could do with some help on this its causing a major headache. 

           

          Thanks Andy

          • 2. Re: Problems migrating to AS 6
            Andy Gowdy Newbie

            Hi Folks

             

            Found the problem with my deployment. 

             

            I am using EJB2 (no persistence.xml)  The old version of JBOSS uses JBOSS-service.xml  you need to REPLACE this with service-hibernate.xml (all lowercase)  inside this XML

             

            I placed this code.   The example was from a book by Francesco Marchioni  one thing ...Using the example I got errors relating to the classpath not found for the dialect.   I replaced the dialect with Dialect (notice the capital D) 

             

            <?xml version="1.0" encoding="UTF-8"?>

             

             

            <hibernate-configuration xmlns="urn:jboss:hibernate-deployer:1.0">

             

             

              <session-factory name="java:/hibernate/sessionfactoryuhlive"

              bean="jboss.har:service=Hibernate,HibernateUH2_Live">

             

             

              <property name="datasourceName">java:/UHLIVE</property>

             

             

              <property name="Dialect">

              com.comino.cxm.hibernateuh.SQLServerDialect

              </property>

             

             

              <depends>jboss:service=Naming</depends>

              <depends>jboss:service=TransactionManager</depends>

              </session-factory>

             

            </hibernate-configuration>