Issue 1:
Alexander Schäl opened SPR-6480 and commented

When started via Java6 WebStart, the Spring PathMatchingResourcePatternResolver tries to handle the URLConnection (wich is in a WebStart context actually an JNLPCachedJarURLConnection) just like a normal file URL. The PathMatchingResourcePatternResolver checks the resources only for a JarURLConnection, any other is handled as a path on the local file system.

So the resource request for "http://service.ACME.com:42/webstart/ressources.jar" (which would be propperly handled by the com.sun.jnlp.JNLPClassLoader) is crippled to "http:\service.ACME.com:42\webstart\ressources.jar", which of course can't be handled by any class loader and logically ends up in an FileNotFoundException due to the destroyed URL syntax.

A solution COULD be to extend the URLConnection type checking at the method doFindPathMatchingJarResources of org.springframework.core.io.support.PathMatchingResourcePatternResolver from JarURLConnection to an JNLPCachedJarURLConnection in order to treat this connection not as a "file:"

Java WebStart 5 used to cache all resources (especially the JAR files listed as resources in the JNLP file) on the local file system and the PathMatchingResourcePatternResolver could access these JAR files using a local path like "file://path/on/local/system". Java WebStart 6 has got another (obfuscated) cache structure - there are no longer any plain JAR files. That's why the JNLPClassLoader returns JNLPCachedJarURLConnection for any JAR resource instead of JarURLConnection like WebStart 5 did.

Affects: 2.5.6

Issue Links:

#11147 Spring fails to load ressources via Java Network Launching Protocol (WebStart) since Java6 ("is duplicated by")

4 votes, 4 watchers

Issue 2:
Andrei Stefan opened SPR-3391 and commented

Using this configuration:

<bean id="parentMockBean" class="test.objects.ParentMockBean">

<property name="mockBean.prop4">

<value>1</value>

</property>

</bean>

generates exception using spring.jar 2.0.4. The same error doesn't happen with 2.0.3 spring.jar file.

Exception is following:

Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'parentMockBean' defined in class path resource [conf/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 [java.lang.String] to required type [java.lang.Integer] for property 'mockBean.prop4'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [java.lang.String] to required type [java.lang.Integer] for property 'prop4': 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 [java.lang.String] to required type [java.lang.Integer] for property 'mockBean.prop4'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [java.lang.String] to required type [java.lang.Integer] for property 'prop4': no matching editors or conversion strategy found

Caused by: java.lang.IllegalArgumentException: Cannot convert value of type [java.lang.String] to required type [java.lang.Integer] for property 'prop4': no matching editors or conversion strategy found

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

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

at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:815)

at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:645)

at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:78)

at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:59)

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

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

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

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

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

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

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

at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:279)

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:360)

at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:91)

at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:75)

at test.main.SimpleTest.main(SimpleTest.java:15)

Affects: 2.0.4

Issue Links:

#8043 Error in BeanWrapperImpl.setPropertyValue for nested paths for primitive wrapper types such as integer ("duplicates")