<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=el_schalo" rel="nofollow">Alexander Schäl</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-6480?redirect=false" rel="nofollow">SPR-6480</a></strong> and commented</p>
<p dir="auto">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.</p>
<p dir="auto">So the resource request for "<a href="http://service.ACME.com:42/webstart/ressources.jar" rel="nofollow">http://service.ACME.com:42/webstart/ressources.jar</a>" (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.</p>
<p dir="auto">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:"</p>
<p dir="auto">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.</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 2.5.6</p>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398100187" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/11147" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/11147/hovercard" href="https://github.com/spring-projects/spring-framework/issues/11147">#11147</a> Spring fails to load ressources via Java Network Launching Protocol (WebStart) since Java6 (<em><strong>"is duplicated by"</strong></em>)</li>
</ul>
<p dir="auto">4 votes, 4 watchers</p>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=astefan" rel="nofollow">Andrei Stefan</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-3391?redirect=false" rel="nofollow">SPR-3391</a></strong> and commented</p>
<p dir="auto">Using this configuration:<br>
&lt;bean id="parentMockBean" class="test.objects.ParentMockBean"&gt;<br>
&lt;property name="mockBean.prop4"&gt;<br>
&lt;value&gt;1&lt;/value&gt;<br>
&lt;/property&gt;<br>
&lt;/bean&gt;</p>
<p dir="auto">generates exception using spring.jar 2.0.4. The same error doesn't happen with 2.0.3 spring.jar file.</p>
<p dir="auto">Exception is following:<br>
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:<br>
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<br>
Caused by: org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessException details (1) are:<br>
PropertyAccessException 1:<br>
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<br>
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<br>
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:227)<br>
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:138)<br>
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:815)<br>
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:645)<br>
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:78)<br>
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:59)<br>
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1100)<br>
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:835)<br>
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:423)<br>
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)<br>
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:144)<br>
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)<br>
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)<br>
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:279)<br>
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:360)<br>
at org.springframework.context.support.ClassPathXmlApplicationContext.&lt;init&gt;(ClassPathXmlApplicationContext.java:91)<br>
at org.springframework.context.support.ClassPathXmlApplicationContext.&lt;init&gt;(ClassPathXmlApplicationContext.java:75)<br>
at test.main.SimpleTest.main(SimpleTest.java:15)</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 2.0.4</p>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398077000" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/8043" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/8043/hovercard" href="https://github.com/spring-projects/spring-framework/issues/8043">#8043</a> Error in BeanWrapperImpl.setPropertyValue for nested paths for primitive wrapper types such as integer (<em><strong>"duplicates"</strong></em>)</li>
</ul>