Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/342.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 未找到匹配的工厂方法:工厂bean';Freemarker配置工厂';;工厂法';createConfiguration()';_Java_Spring_Spring Mvc - Fatal编程技术网

Java 未找到匹配的工厂方法:工厂bean';Freemarker配置工厂';;工厂法';createConfiguration()';

Java 未找到匹配的工厂方法:工厂bean';Freemarker配置工厂';;工厂法';createConfiguration()';,java,spring,spring-mvc,Java,Spring,Spring Mvc,我试图在我的项目中使用SpringMVC和freemarker。但当我尝试使用ApplicationContext.getBean(String)方法创建配置对象时,出现以下错误: org.springframework.beans.factory.BeanCreationException:创建在类路径资源[META-INF/applicationContext.xml]中定义了名为“freeMarkerConfiguration”的bean时出错:未找到匹配的工厂方法:工厂bean“free

我试图在我的项目中使用SpringMVC和freemarker。但当我尝试使用ApplicationContext.getBean(String)方法创建配置对象时,出现以下错误:

org.springframework.beans.factory.BeanCreationException:创建在类路径资源[META-INF/applicationContext.xml]中定义了名为“freeMarkerConfiguration”的bean时出错:未找到匹配的工厂方法:工厂bean“freeMarkerConfiguration工厂”;工厂方法“createConfiguration()”。检查具有指定名称和参数的方法是否存在,以及该方法是否为非静态方法

My applicationContext.xml定义为:

<bean id="freeMarkerConfigurationFactory"
class="org.springframework.ui.freemarker.FreeMarkerConfigurationFactoryBean">
    <property name="templateLoaderPath" value="classpath:/" />
    <property name="preferFileSystemAccess" value="false" />
</bean>
<bean id="freeMarkerConfiguration" class="freemarker.template.Configuration"
factory-bean="freeMarkerConfigurationFactory" factory-method="createConfiguration"
scope="prototype" />

pom.xml:

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-context-support</artifactId>
    <version>3.2.13.RELEASE</version>
</dependency>
<dependency>
    <groupId>org.freemarker</groupId>
    <artifactId>freemarker</artifactId>
    <version>2.3.25-incubating</version>
</dependency>

org.springframework
spring上下文支持
3.2.13.释放
org.freemarker
自由标记
2.3.25-孵化
我使用JBoss EAP 6.4.x作为应用服务器