Hi, this sounds a little bit OT but you can try this:
app = new Application(); String[] paths = {"*classpath:*applicationContext.xml"}; appContext = new ClassPathXmlApplicationContext(paths); however, this is a webapp I assume...you don't have to go through this code with Spring in a webapp... ...then, as said by Jorg, go back to J2EE 101 :)) On Thu, Sep 8, 2011 at 10:31 AM, Jörg Schaible <joerg.schai...@scalaris.com>wrote: > Hi Anamika, > > anamika gupta wrote: > > > Hi, > > > > I am building my applications using maven, but a strange thing > happens. > > In one of my java class , i have the code > > > > app = new Application(); > > String[] paths = {"applicationContext.xml"}; > > appContext = new ClassPathXmlApplicationContext(paths); > > > > So, as per my knowledge, it should search for "applicationContext.xml" in > > the classes folder. but when i am building it with maven and deploy it on > > the server, it starts looking for the "applicationContext.xml" in > /WEB-INF > > folder. > > Can you please tell me why it happens. > > > > As if i build it using the eclipse and deploy it on the server, it looks > > for the same file in classes folder. > > > > Can you please tell me what is the reaon for such discrepancy in the > > behaviuor > > > > Any help will be greatly appreciated > > Basically this has nothing to do with Maven and does not belong to this > list. As a hint you should make yourself familiar with the JavaEE > specification for web containers especially looking for the documented > classloader behavior. > > Cheers, > Jörg > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > >