Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6326445
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T17:05:37+00:00 2026-05-24T17:05:37+00:00

I am calling a method called getBanks() (located inside BankService) from inside my Flex

  • 0

I am calling a method called getBanks() (located inside BankService) from inside my Flex app. Here is the BankService class:

@org.springframework.stereotype.Service("com.apollo.counterpartcontacts.service.BankService")
@org.springframework.flex.remoting.RemotingDestination("com.apollo.counterpartcontacts.service.IBankService")
public class BankService extends _BankService {

    private Logger logger = LoggerFactory.getLogger(getClass());
    private ApplicationContext  applicationContext;
    private List<String> configHostResources = new ArrayList<String>();
    private List<String> configResources = new ArrayList<String>();

    private PersistenceManager persistenceManager;

    @BeforeClass
    public void beforeClass() {
        try {
            addConfigResource("application.xml");
            addConfigHostResource("application.xml");
        }
        catch (UnknownHostException e) {
            logger.error("Error loading host specific resource", e);
        }
        List<String> aList = new ArrayList<String>();
        aList.addAll(configHostResources);
        aList.addAll(configResources);
        String[] aConfigArray = new String[aList.size()];
        aConfigArray = aList.toArray(aConfigArray);
        applicationContext = new ClassPathXmlApplicationContext(aConfigArray);

        persistenceManager = (PersistenceManager) applicationContext.getBean("persistenceManager");
    }
        void addConfigResource(String aConfigName) {
            logger.info("Adding a config: " + aConfigName);
            configResources.add(aConfigName);
        }

        public void addConfigHostResource(final String theSuffix) throws UnknownHostException {
            String aHostName = InetAddress.getLocalHost().getHostName();
            String aConfigName = aHostName.toLowerCase() + "." + theSuffix;
            logger.info("Adding a host config: " + aConfigName);
            configHostResources.add(aConfigName);
        }

    private org.springframework.orm.hibernate3.HibernateTemplate hibernateTemplate;

    @org.springframework.beans.factory.annotation.Autowired
    public void setHibernateTemplate(org.springframework.orm.hibernate3.HibernateTemplate hibernateTemplateValue) {
        hibernateTemplate = hibernateTemplateValue;
    }

    public org.springframework.orm.hibernate3.HibernateTemplate getHibernateTemplate() {
        return hibernateTemplate;
    }

    public List getBanks(){
        beforeClass();
        List allBanks = persistenceManager.getBanks();
        return allBanks;
    }

}

The problem is that the call to beforeClass() produces the following error:

flex.messaging.MessageException: org.springframework.beans.factory.BeanDefinitionStoreException : IOException parsing XML document from class path resource [apnycdtg7qgcq1.application.xml]; nested exception is java.io.FileNotFoundException: class path resource [apnycdtg7qgcq1.application.xml] cannot be opened because it does not exist

The curious thing about this is that apnycdtg7qgcq1.application.xml is located in my src folder, the same place that the error claims it is looking in. Anyone see the problem here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T17:05:38+00:00Added an answer on May 24, 2026 at 5:05 pm

    The word “resource” as in addConfigResource and addConfigHostResource typically means a classpath resource. Likewise, ClassPathXmlApplicationContext is expecting Spring context files on the classpath. Try moving your file onto the classpath and it should work.

    If you are a Maven user, this mean moving it to src/main/resources. If you are building with something else, move the file into wherever that tool expects resources to reside, or make sure that when it compiles, it copies XML files onto the classpath (typically where your .class files get generated to).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a method called Rotate and I am calling it from another method
Calling the ajax called URL works well without ajax eg. http://localhost/ci/controller/method/param_value . But using
I am calling a method from another method and keep getting a warning: firstViewController
I'm having an issue calling a method from a separate project within the same
How could I go about calling a method on a static class given the
I have a class where inside this class is one private method and many
In my jsf page I am calling a method called saveinsert and in my
I have a View Controller calling a method in its own view called closeMenu.
How do I find the method name of the calling method from a method
here is the code of the calling method - NameValuePair[] data = { new

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.