Results 1 to 4 of 4

Thread: How to package and access my classes from spring

  1. #1
    Join Date
    May 2006
    Posts
    10

    Question How to package and access my classes from spring

    Hi Spring enthusiasts,

    i hope someone can help me with a question that might be easy. I 'm new to spring and read nearly whole spring doc but couldn't find an answer.

    I use spring in a standalone non-web application and want to load my classes from jar files.
    All my modules are in a modules folder zipped as jar.
    Furthermore I have a second folder with several context files in which my jars are wired together in different ways.

    What is the best way to make spring find the classes in my jars that represent my plugin modules? Is there a template for packaging spring beans?

    I want to be able to put different jars i my modules dir and wire them up by my context so i can access these jars later via rmi. Do I need a special resource loader or do i have to unpack these jars first?

    I would be very glad if someone can help me,
    Prato

  2. #2
    Join Date
    Aug 2004
    Location
    u.s.a
    Posts
    399

    Default

    As long as the jar and application context definitions are on the classpath, there should be no problems. You can also use several forms of resource loaders if you don't want to use the classpath. But, using the classpath is easier in my view. Of course, one place in your program must load the Spring context in the main app loader.

    I have done a few stand alone non-web Spring based apps this way.

  3. #3
    Join Date
    May 2006
    Posts
    10

    Default

    Hi jbetancourt,
    i use a File context to load the jars from an external directory and will try out if it works for my plugins.

    Tnx, prato

  4. #4
    Join Date
    Dec 2005
    Posts
    269

    Default

    another tactics to simplify the operation would be to set up an env. variable, poiniting to the context files' location, and then use it along with popertyplaceholderconfigurer.
    Thus, you abstract the path details from the spring ctx.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •