开发者

ApplicationContext ctx = new FileSystemXmlApplicationContext error

开发者 https://www.devze.com 2022-12-27 14:41 出处:网络
Hi I am completely new to Java, so sorry if my question may sound a bit stupid. I am following a tutorial on hibernate and i am trying to get the context definition files from the file system.

Hi I am completely new to Java, so sorry if my question may sound a bit stupid.

I am following a tutorial on hibernate and i am trying to get the context definition files from the file system.

ApplicationContext ctx  = new FileSystemXmlApplicationContext(
        new String[] { "conf/rssWebApplication-services.xml",
        "conf/rssWebApplication-data-hibernate.xml" });

But i get the following e开发者_运维问答rror:

found   : org.springframework.context.support.FileSystemXmlApplicationContext
required: org.jboss.weld.context.ApplicationContext
        ApplicationContext ctx  = new FileSystemXmlApplicationContext(
                new String[] { "conf/rssWebApplication-services.xml",

Any idea what is the problem?

Thanks


Your import of ApplicationContext is wrong - fix it, to point to spring's ApplicationContext. (Currently, it is from the Weld framework). So:

org.springframework.context.ApplicationContext

instead of

org.jboss.weld.context.ApplicationContext 
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号