Announcement Announcement Module
Collapse
No announcement yet.
Websphere 4.0.7 deployment TypeMismatchException Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Websphere 4.0.7 deployment TypeMismatchException

    Hi,

    I'm currently facing a TypeMismatchException while deploying an ear under Websphere 4.0.7.

    I'm using Spring 1.1 RC1 and Hibernate2.

    My application context is the following :


    Code:
    <bean id="grecoDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
    	<property name="driverClassName">
    		<value>blabla</value>
    	</property>
    	<property name="url">
    		<value>blabla</value>
    	</property>
    	<property name="username">
    		<value>blabla</value>
    	</property>
    	<property name="password">
    		<value>blabla</value>
    	</property>
    </bean>
    
    <bean id="grecoSessionFactory" class="org.springframework.orm.hibernate.LocalSessionFactoryBean">
    	<property name="mappingResources">
    	<list>
    	
    	<value>/TypeFichierTO.hbm.xml</value> 
    		
    	</list>
    	</property>
    	<property name="hibernateProperties">
    		<props>
    			<prop key="hibernate.dialect">net.sf.hibernate.dialect.OracleDialect</prop>
    			<prop key="hibernate.query.substitutions">true=1 false=0</prop>
    		    <prop key="hibernate.show_sql">true</prop>
    		</props>
    	</property>
    	<property name="dataSource">
    		<ref bean="grecoDataSource"/>
    	</property>
    </bean>
    
    <bean id="transactionManager" class="org.springframework.orm.hibernate.HibernateTransactionManager">
    		<property name="sessionFactory"><ref local="grecoSessionFactory"/></property>	
    </bean>
    I get a TypeMismatchException saying the following :

    Code:
    org.springframework.beans.TypeMismatchException&#58; Failed to convert property value of type &#91;org.springframework.orm.hibernate.LocalSessionFactoryBean&#93; to required type &#91;net.sf.hibernate.SessionFactory&#93; for property 'sessionFactory'
    	at org.springframework.beans.BeanWrapperImpl.doTypeConversionIfNecessary&#40;BeanWrapperImpl.java&#40;Compiled Code&#41;&#41;
    	at org.springframework.beans.BeanWrapperImpl.setPropertyValue&#40;BeanWrapperImpl.java&#40;Compiled Code&#41;&#41;
    	at org.springframework.beans.BeanWrapperImpl.setPropertyValue&#40;BeanWrapperImpl.java&#40;Compiled Code&#41;&#41;
    	at org.springframework.beans.BeanWrapperImpl.setPropertyValue&#40;BeanWrapperImpl.java&#40;Inlined Compiled Code&#41;&#41;
    	at org.springframework.beans.BeanWrapperImpl.setPropertyValues&#40;BeanWrapperImpl.java&#40;Compiled Code&#41;&#41;
    	at org.springframework.beans.BeanWrapperImpl.setPropertyValues&#40;BeanWrapperImpl.java&#58;773&#41;
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues&#40;AbstractAutowireCapableBeanFactory.java&#40;Compiled Code&#41;&#41;
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean&#40;AbstractAutowireCapableBeanFactory.java&#58;604&#41;
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean&#40;AbstractAutowireCapableBeanFactory.java&#58;267&#41;
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean&#40;AbstractAutowireCapableBeanFactory.java&#58;204&#41;
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean&#40;AbstractBeanFactory.java&#58;199&#41;
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean&#40;AbstractBeanFactory.java&#40;Inlined Compiled Code&#41;&#41;
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons&#40;DefaultListableBeanFactory.java&#40;Compiled Code&#41;&#41;
    	at org.springframework.context.support.AbstractApplicationContext.refresh&#40;AbstractApplicationContext.java&#58;279&#41;
    	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>&#40;ClassPathXmlApplicationContext.java&#58;81&#41;
    	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>&#40;ClassPathXmlApplicationContext.java&#58;66&#41;
    	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>&#40;ClassPathXmlApplicationContext.java&#58;57&#41;
    	at Tester.doTest&#40;Tester.java&#58;70&#41;
    	at InitServlet.init&#40;InitServlet.java&#58;14&#41;
    	at com.ibm.servlet.engine.webapp.StrictServletInstance.doInit&#40;ServletManager.java&#58;802&#41;
    	at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._init&#40;StrictLifecycleServlet.java&#58;141&#41;
    	at com.ibm.servlet.engine.webapp.PreInitializedServletState.init&#40;StrictLifecycleServlet.java&#58;254&#41;
    	at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.init&#40;StrictLifecycleServlet.java&#40;Inlined Compiled Code&#41;&#41;
    	at com.ibm.servlet.engine.webapp.ServletInstance.init&#40;ServletManager.java&#40;Compiled Code&#41;&#41;
    	at javax.servlet.GenericServlet.init&#40;GenericServlet.java&#40;Inlined Compiled Code&#41;&#41;
    	at com.ibm.servlet.engine.webapp.ServletManager.addServlet&#40;ServletManager.java&#40;Compiled Code&#41;&#41;
    	at com.ibm.servlet.engine.webapp.WebAppServletManager.loadServlet&#40;WebAppServletManager.java&#40;Compiled Code&#41;&#41;
    	at com.ibm.servlet.engine.webapp.WebAppServletManager.loadAutoLoadServlets&#40;WebAppServletManager.java&#40;Compiled Code&#41;&#41;
    	at com.ibm.servlet.engine.webapp.WebApp.loadServletManager&#40;WebApp.java&#58;1217&#41;
    	at com.ibm.servlet.engine.webapp.WebApp.init&#40;WebApp.java&#58;145&#41;
    	at com.ibm.servlet.engine.srt.WebGroup.loadWebApp&#40;WebGroup.java&#58;259&#41;
    	at com.ibm.servlet.engine.srt.WebGroup.init&#40;WebGroup.java&#58;168&#41;
    	at com.ibm.servlet.engine.ServletEngine.addWebApplication&#40;ServletEngine.java&#58;857&#41;
    	at com.ibm.ws.runtime.WebContainer.install&#40;WebContainer.java&#58;43&#41;
    	at com.ibm.ws.runtime.Server.startModule&#40;Server.java&#58;618&#41;
    	at com.ibm.ejs.sm.active.ActiveModule.startModule&#40;ActiveModule.java&#58;511&#41;
    	at com.ibm.ejs.sm.active.ActiveModule.startAction&#40;ActiveModule.java&#58;355&#41;
    	at com.ibm.ejs.sm.active.ActiveObject.startObject&#40;ActiveObject.java&#58;948&#41;
    	at com.ibm.ejs.sm.active.ActiveObject.start&#40;ActiveObject.java&#58;137&#41;
    	at java.lang.reflect.Method.invoke&#40;Native Method&#41;
    	at com.ibm.ejs.sm.agent.AdminAgentImpl.activeObjectInvocation&#40;AdminAgentImpl.java&#40;Compiled Code&#41;&#41;
    	at com.ibm.ejs.sm.active.ActiveObject.invokeContainedObject&#40;ActiveObject.java&#40;Compiled Code&#41;&#41;
    	at com.ibm.ejs.sm.agent.AdminAgentImpl.activeObjectInvocation&#40;AdminAgentImpl.java&#40;Compiled Code&#41;&#41;
    	at com.ibm.ejs.sm.agent.AdminAgentImpl.invokeActiveObject&#40;AdminAgentImpl.java&#58;62&#41;
    	at com.ibm.ejs.sm.agent._AdminAgentImpl_Tie._invoke&#40;_AdminAgentImpl_Tie.java&#58;73&#41;
    	at com.ibm.CORBA.iiop.ExtendedServerDelegate.dispatch&#40;ExtendedServerDelegate.java&#58;532&#41;
    	at com.ibm.CORBA.iiop.ORB.process&#40;ORB.java&#58;2450&#41;
    	at com.ibm.CORBA.iiop.OrbWorker.run&#40;OrbWorker.java&#58;186&#41;
    	at com.ibm.ejs.oa.pool.ThreadPool$PooledWorker.run&#40;ThreadPool.java&#58;104&#41;
    	at com.ibm.ws.util.CachedThread.run&#40;ThreadPool.java&#58;144&#41;
    This problems occurs only under websphere 4.0.7 and work perfectly under my dev environment.


    Does anybody has a solution for this ?

  • #2
    This is incredibly weird. It's as if the LocalSessionFactory bean is not bean used as a FactoryBean, but rather the factorybean itself (and not its output) is being fed as the target propertly.

    Are you sure you're using the same config in both environments? The only way I could ever see this happening is if you prefixed the FactoryBean name itself with &, which tells Spring to return the factory bean, and not its output...

    Comment


    • #3
      Colin,
      thanks for your reply

      Exactly the same configuration file is included in my post is used in both environment.

      The deployment target is AIX.
      Our dev is WXP.

      Could this problem be related to xml parser version ?

      Comment


      • #4
        I'm sort of stumped, based on available info, but one thing I would strongly suggest is trying this with Spring 1.1 final (or you can use the current CVS version, which is being released tonight as 1.1.1). While the 1.1RC1 you mention was used by a number of people even in production, there were a number of fixes among the way, and I'd like to ensure that this is still an issue in the released version before trying to spend more time on it...

        Comment


        • #5
          The 1.1 final release (as well as 1.02 ) has already been tried and produce the same error.
          We decided to get back to 1.1 RC1 as this is the version we qualified for our development environment, but I will integrate 1.1 final once this problem is resolved.

          Comment


          • #6
            If everything is working fine in your dev environment, then this can only be an environmental difference or a config difference.

            If you have made doubly sure that you have no other Spring version on the aix system, and the config is exactly the same, then about the only thing I can actually suggest is attaching to the aix system with a debugger and tracing into Spring to see what is going on. This is essentially very core functionality used by almost any Spring user, so I doubt it is any sort of Spring bug (although you never know) and it should be fairly obvious as to what is going on. The XML parser should not really affect things in this fashion; again the only time I could see this happening is if you manually inserted & in front of the LocalSessionFactoryBean reference, and even then, in the xml file it would actually have to be escaped as &amp;. This is obviously not the case so something else is going on...

            Comment


            • #7
              in the first instance, it may be easier to turn your logging output up to DEBUG for the org.springframework.beans.factory.support package and see what turns up in the logs. Please post it if you can do this (I'm intrigued as well!)

              Regards,

              Comment

              Working...
              X