This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JBoss/WildFly and the fly likes Need Help!!!!: Issues Deploying with Spring in JBoss Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Need Help!!!!: Issues Deploying with Spring in JBoss" Watch "Need Help!!!!: Issues Deploying with Spring in JBoss" New topic
Author

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

Wai Meng Ng
Greenhorn

Joined: Feb 17, 2003
Posts: 22
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.


Cheers,
Wai Meng
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9955
    
163

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

[My Blog] [JavaRanch Journal]
Wai Meng Ng
Greenhorn

Joined: Feb 17, 2003
Posts: 22
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
Marshal

Joined: Jul 20, 2005
Posts: 9955
    
163

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

Joined: Feb 17, 2003
Posts: 22
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.
prashant shelke
Greenhorn

Joined: Mar 10, 2009
Posts: 14
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need Help!!!!: Issues Deploying with Spring in JBoss
 
Similar Threads
deploy spring application in JBoss
Arjuna Transaction with Jboss
[spring] aop config
PropertyAccessException
CustomEditorConfigurer Exception