Results 1 to 7 of 7

Thread: Web Start Problem

  1. #1
    Join Date
    Sep 2004
    Location
    Sydney
    Posts
    27

    Default Web Start Problem

    I'm hoping someone can help me here.
    I have my application running (swing client) using Spring. When I run it from my ant task, it works fine, log4j loads OK and my spring context loads ok.

    However, when I try to run it via webstart, I get errors!
    Code:
    IOException parsing XML document from file [C:\tools\firefox\ctx\clientContext.xml]; nested exception is java.io.FileNotFoundException: ctx\clientContext.xml (The system cannot find the path specified)
    Log4J also isn't found.
    Is someone able to explain?

    This is in my jar file:
    ctx/
    ctx/client.properties
    ctx/clientContext.xml
    log4j.properties

    au/com/todds/client/Client.class

    In Client.java
    public static final String CLIENT_CONTEXT_CONFIG_LOCATION = "/ctx/clientContext.xml";
    ListableBeanFactory beanFactory = new FileSystemXmlApplicationContext(CLIENT_CONTEXT_CON FIG_LOCATION);

    Thanks.

  2. #2
    Join Date
    Aug 2004
    Location
    Montréal, Canada
    Posts
    845

    Default

    You should be looking for the context file in the classpath:
    Code:
    public static final String CLIENT_CONTEXT_CONFIG_LOCATION = "/ctx/clientContext.xml"; 
    ListableBeanFactory beanFactory = new ClassPathXmlApplicationContext(CLIENT_CONTEXT_CONFIG_LOCATION);
    HTH
    Omar Irbouh

    Spring Modules Team
    http://irbouh.blogspot.com/

  3. #3
    Join Date
    Sep 2004
    Location
    Sydney
    Posts
    27

    Default

    Sorry,
    I'm confused by what you mean. I am looking for the context file, that is my file. Also, how would this relate to log4j.properties not being found?

    thanks.

  4. #4
    Join Date
    Aug 2004
    Location
    Montréal, Canada
    Posts
    845

    Default

    I was trying to respond to this problem:
    However, when I try to run it via webstart, I get errors!
    Code:
    IOException parsing XML document from file [C:\tools\firefox\ctx\clientContext.xml]; nested exception is java.io.FileNotFoundException: ctx\clientContext.xml (The system cannot find the path specified)
    The file is not found because your application is looking for it in the FileSystem rather than in the classpath where it is located:
    This is in my jar file:
    ctx/
    ctx/client.properties
    ctx/clientContext.xml
    log4j.properties
    Omar Irbouh

    Spring Modules Team
    http://irbouh.blogspot.com/

  5. #5
    Join Date
    Sep 2004
    Location
    Sydney
    Posts
    27

    Default

    OK, I Understand what you are saying now. But, how do I tell the application to look at the classpath and not at the filesystem, when it is packed up in a jar file, I would have thought the program would find it.

  6. #6
    Join Date
    Aug 2004
    Location
    Montréal, Canada
    Posts
    845

    Default

    Look at my previous post: use ClassPathXmlApplicationContext instead of FileSystemXmlApplicationContext.
    Omar Irbouh

    Spring Modules Team
    http://irbouh.blogspot.com/

  7. #7

    Default Customizing spring context using java WebStart

    Quote Originally Posted by irbouho View Post
    Look at my previous post: use ClassPathXmlApplicationContext instead of FileSystemXmlApplicationContext.
    I am having the same problem as this thread. Conceptually I understand that
    ClassPathXmlApplicationContext should be used. What I am not clear on is how to make this work with Java WebStart.

    I have a Java WebStart accessible Swing application that uses spring XML configuration files. I need some way for the user to customize a few of the spring configured beans. These are defined in
    files inside jars that are signed. Changing the files in jars is messy and breaks the signature on the signed jar. Extracting a copy of the spring context config file out of the signed jar and placing it in same directory as rest of jars for webstart app may work but again seems messy.

    Has any one got any advice on best practice for customizing spring XML
    config files when using Java WebStart?

    TIA for your help.

Similar Threads

  1. Replies: 1
    Last Post: Jul 5th, 2005, 03:48 AM
  2. pagination and continuation problem in SWF
    By yfmoan in forum Web Flow
    Replies: 6
    Last Post: Jun 29th, 2005, 03:42 AM
  3. Replies: 0
    Last Post: Feb 16th, 2005, 01:45 PM
  4. Lazy Load Problem when Doing UnitTest
    By yoshi in forum Data
    Replies: 7
    Last Post: Sep 29th, 2004, 10:00 AM
  5. Replies: 5
    Last Post: Aug 27th, 2004, 07:13 PM

Posting Permissions

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