Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Need Help!!!!: Issues Deploying with Spring in JBoss

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

I am porting an Application Running in Weblogic to JBoss developed with SpringFramework.

I have created a JNDI in JBoss (using oracle-ds.xml) and when I tried to deploy my application, the following error shows up:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are: PropertyAccessException 1: org.springframework.beans.TypeMismatchException: Failed to convert property value of type [org.jboss.resource.adapter.jdbc.WrapperDataSource] to required type [javax.sql.DataSource] for property 'dataSource' nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [org.jboss.resource.adapter.jdbc.WrapperDataSource] to required type [javax.sql.DataSource] for property 'dataSource': no matching editors or conversion strategy found
Caused by: org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessException details (1) are: PropertyAccessException 1: org.springframework.beans.TypeMismatchException: Failed to convert property value of type [org.jboss.resource.adapter.jdbc.WrapperDataSource] to required type [javax.sql.DataSource] for property 'dataSource'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [org.jboss.resource.adapter.jdbc.WrapperDataSource] to required type [javax.sql.DataSource] for property 'dataSource': no matching editors or conversion strategy found Caused by: java.lang.IllegalArgumentException: Cannot convert value of type org.jboss.resource.adapter.jdbc.WrapperDataSource] to required type [javax.sql.DataSource] for property 'dataSource': no matching editors or conversion strategy found



Sorry for the lengthy excerpt from my logs, but I have highlighed what i think is the main error message.

Below is an excerpt from the applicationContext.xml:



I followed the JBoss guide and created a oracle-ds.xml and with a simple jsp successfully tested the connection to the Oracle Database. There were no errors when running this simple test page in the console and the above-mentioned errors only started showing up when i deployed the war file I am attempting to port to JBoss.

I was wondering if someone could give me some hints as to what i should do? I have searched the web but could not find any inkling on how to resolve this. Many thanks in advance.

 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you packaging any jar files containing javax.sql.* in your application? If yes, then remove them from your application packaging.
 
Wai Meng Ng
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Jaikiran Pai wrote:Are you packaging any jar files containing javax.sql.* in your application? If yes, then remove them from your application packaging.



Thank you for your reply, I found the j2ee.jar containing these files and removed this from the war file; however the error still persists. I have lots of jar files in the lib folder of my war so I am checking them one by one. Just curious, how would have jar files containing javax.sql cause the error?
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Wai Meng Ng wrote:

Just curious, how would have jar files containing javax.sql cause the error?



Because of classloading issues. The same class/interface might be loaded by two different classloaders Classloader A and Classloader B. Then when your app which uses Classloader B tries to use the class loaded by Classloader A, it will not be recognized as the correct type. More details here
 
Wai Meng Ng
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Jaikiran Pai wrote:

Wai Meng Ng wrote:

Just curious, how would have jar files containing javax.sql cause the error?



Because of classloading issues. The same class/interface might be loaded by two different classloaders Classloader A and Classloader B. Then when your app which uses Classloader B tries to use the class loaded by Classloader A, it will not be recognized as the correct type. More details here



Thanks for the heads up.
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have got same issue when
1. I changed bean mapping in applicationContext.xml.

ERROR org.springframework.web.servlet.DispatcherServlet - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'testController' defined in ServletContext resource [/WEB-INF/FileUploaderServlet-servlet.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.TypeMismatchException: Failed to convert property value of type [$Proxy52] to required type [com.server.util.services.UtilService] for property 'utilService'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [$Proxy52] to required type [com.server.util.services.UtilService] for property 'utilService': no matching editors or conversion strategy found
Caused by:
org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessException details (1) are:
PropertyAccessException 1:
org.springframework.beans.TypeMismatchException: Failed to convert property value of type [$Proxy52] to required type [com.server.util.services.UtilService] for property 'utilService'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [$Proxy52] to required type [com.server.util.services.UtilService] for property 'utilService': no matching editors or conversion strategy found
Caused by:
java.lang.IllegalArgumentException: Cannot convert value of type [$Proxy52] to required type [com.server.util.services.UtilService] for property 'utilService': no matching editors or conversion strategy found
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:224)
at org.springframework.beans.TypeConverterDelegate.
 
    Bookmark Topic Watch Topic
  • New Topic