On Jan 15, 2008 2:06 PM, Gladwell, Ricado <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> For some reason, I get a DeploymentException when attempting to load
> classpath resources in my Spring application context XML.
>
<snip>
> Caused by: org.apache.axis2.AxisFault: Error creating bean with name
> 'aolProxyRegistrationService' defined in class path resource
> [applicationContext.xml]: Initialization of bean failed; nested
> exception is org.springframework.beans.TypeMismatchException: Failed to
> convert property value of type [java.lang.String] to required type
> [java.io.File] for property 'welcomeEmailVelocityTemplate'; nested
> exception is java.lang.IllegalArgumentException: Could not retrieve File
> for class path resource [welcomeEmail.vm]: class path resource
> [welcomeEmail.vm] cannot be resolved to absolute file path because it
> does not reside in the file system: jar:file:/D:/Program Files/Apache
> Software Foundation/Tomcat
> 5.5/work/Catalina/localhost/axis2/axis25019RSPProxyServer-0.1-SNAPSHOT.a
> ar!/welcomeEmail.vm

The error "Failed to convert property value of type [java.lang.String]
to required type
 [java.io.File] for property 'welcomeEmailVelocityTemplate';" looks
like a spring error and not an axis2 error.

Its often the case that some type of stream or url is preferred for
files in a servlet container, and perhaps even more so for reading
files inside a aar. I'd take a look at this interface and and choose
an implementing class that gets some type of stream going ala
getResourceAsStream() :

http://static.springframework.org/spring/docs/2.0.x/api/org/springframework/core/io/Resource.html

The same type of problem is common for hibernate file mappings and
some type of resource handling is a known solution.

HTH,
Robert

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to