Announcement Announcement Module
Collapse
No announcement yet.
Web Start Problem Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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

    Comment


    • #3
      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.

      Comment


      • #4
        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

        Comment


        • #5
          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.

          Comment


          • #6
            Look at my previous post: use ClassPathXmlApplicationContext instead of FileSystemXmlApplicationContext.

            Comment


            • #7
              Customizing spring context using java WebStart

              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.

              Comment

              Working...
              X