How to tackle files other then jars inorder to run Client applications?

Hi,
I am moving my client application to run through JWS. In order to run client application, i need to download files other then jars like xml, some bin files etc. My JNLP file is something like following.
<security>
<all-permissions/>
</security>
<resources>
<j2se version="1.6"/>
<jar href="client.jar" download="eager"/>
<jar href="log4j.xml" download="eager"/>
</resources>
During downloading of XML, JWS raises exception for XML file "#### Could not verify signing in resource: tttp://testmachine:8080/classes/log4j.xml"..
#1 How can i avoid these Exception ?
#2. Can only Jar files be downloaded by JWS or i need to package files other jar into jar file format ?
Appreciate if someone can help me on that matter?

The jnlp specification only allows jar files as resources . Downloading anything else would not help anyway as there would be no way to access it. Only the classloader has access to the downloaded resources, so it is required to bundle all other resources in jar files and access them with Thread.currentThread().getResourceAsStream("myfile.xml");
/Andy

Similar Messages

  • For the AD FS Wizard how do I configure a certificate so I can run WCF applications on my server

    For the AD FS Wizard how do I configure a certificate so I can run WCF applications on my server.
    Certificate Status: This CA Root certificate is not trusted because it is not in the Trusted Root Certification Authorities store.
    In IIS under Server Certificates:
    IIS Express Development Certificate
    It will not let me "Complete Certificate Request" because I do not have a ".cer" certificate file.
    How do I get ".cer" file for this Certificate or maybe make one in IIS 8.0 not Express? 

    You need to make the certificate trusted by adding it in the Trusted Root Certification Authorities
    store using Certificates snap-in. You can use Certificates
    snap-in in MMC to export the certificate in a .cer file.
    This posting is provided AS IS with no warranties or guarantees , and confers no rights.
    Ahmed MALEK
    My Website Link
    My Linkedin Profile
    My MVP Profile

  • How to change file content in JAR

    I'm deploying a Java application using Webstart based on different jars.
    One of the jars contains a 'config' file. The config file contains paths to databases.
    The idea is that the user can change these paths (or other settings) using the application.
    This would mean that the content of Config file in the jar file should be updated once the user
    changed 'the settings'..
    Is this possible ? If so, thanks to explain in detail.
    Greetz,

    depends.
    If a user makes a change, you can record that change, possibly using the persistance service.
    Then when he starts again, you read in the default config, then read from the persistance store to override those defaults.
    You can not change the initial jar, that is really on the server, or cached on various users machines.
    /Andy

  • How to read files outside the jar ?

    Hi all,
    One of my classes inside jar needs to read XML file that resides in the same location where the jar sits. I use MyClass.getClass().getResource("MyXMLFile.xml") but it keeps returning null.
    If I place the XML file inside the JAR, I can find it using above methods, but since I want the user to easily edit the XML file without opening the jar file and detach the XML file, I choose not to include the XML file inside the jar.
    Any help would be greatly appreciated.
    Setya

    Thanks for the dukes.
    My JDBC post on this forum discusses the issues of
    using Class-Path in your jar file. It works, but it
    may vary from system to system.
    Thanks also from my side: I have read recently your discussion about reading files in the jar's directory, since I had the same problem. So I was really glad to see your solution. However, I had one more problem, namely that I'm running my application sometimes from the jar, sometimes from the classes directly (debugging). In order to have always the correct path (although a different one) I have added some more lines to deal with that case. I hope that will be useful for you as well!
    Dieter Profos
    import java.awt.*;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import java.awt.event.WindowListener;
    import java.net.URL;
    * @author pkwooster
    * @author Dieter Profos
    * @version 1.01 04/03/26
    public class ReadOutside extends Frame {
    private TextArea textArea;
    public static void main(String[] args) {
    // Create application frame.
    ReadOutside tc = new ReadOutside();
    tc.addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent we) {
    System.exit(0);
    // Show frame
    tc.setSize(600,250);
    tc.setVisible(true);
    public ReadOutside() {
    textArea = new TextArea(20,80);
    add(textArea);
    readOutside(this);
    public void readOutside(Object o) {
    System.out.println(getCodeBasePath(o));
    /** Gets the absolute path of the directory where the JAR or CLASS file is
    * located. If the application is run from a jar file, the directory of the
    * jar file is returned; if it is run from a class file, the method will
    * return the directory path of the class file.
    * @param o The main class of the application.
    * @return The absolute directory path, or null if neither the class nor a
    * jar file could be found.
    public String getCodeBasePath(Object o) {
    Class c = o.getClass();
    URL url;
    // get the class name
    String className = c.getName();
    textArea.append("class name = " + className + "\n");
    // replace package periods by file separators
    className = className.replace('.','/');
    ClassLoader cl = c.getClassLoader();
    if (cl == null)
    cl = ClassLoader.getSystemClassLoader();
    url = cl.getResource(className + ".class");
    String xPath = url.toExternalForm();
    textArea.append("url = " + url + "\n");
    textArea.append("extPath = " + xPath + "\n");
    // make sure that the path starts with jar:file:
    if (xPath.startsWith("jar:file:")) {
    // remove jar:file: + the subsequent file separator
    xPath = xPath.substring("jar:file:".length()+1);
    int n = xPath.indexOf("!");
    if (n < 0)
    n = xPath.length();
    String jarPath = xPath.substring(0, n);
    textArea.append("jar file path = " + jarPath + "\n");
    n = jarPath.lastIndexOf("/");
    String jarDir = jarPath.substring(0, n+1);
    textArea.append("jar dir = " + jarDir + "\n");
    return jarDir;
    else { // if program is run from its class file (development phase!)
    if (xPath.startsWith("file:")) {
    // remove file: + the subsequent file separator
    xPath = xPath.substring("file:".length()+1);
    textArea.append("class file path = " + xPath + "\n");
    int n = xPath.lastIndexOf("/");
    String classDir = xPath.substring(0, n+1);
    textArea.append("class dir = " + classDir + "\n");
    return classDir;
    return null;

  • How to pass XML file as a input to DataService from client application

    Hi,
    I have a function in DataService which will take a complex parameter as input. So from client application how can I pass the Complex parameter?
    If anyone knows please help me.
    thanks,
    Suresh varma

    Something like this. The types will be generated when you Generate SDO Mediator client.
    somenamespace.MyComplexParamDocument myComplexParamDoc=
    MyComplexParamDocument.factory().newInstance();
    MyComplexParam myComplexParam=myComplexParamDoc.addNewMyComplexParam();
    myComplexParam.setFirstName("John");
    CUSTOMERPROFILEDocument[] myCust =
    customerDS.getCustomerByComplexParam(myComplexParamDoc);

  • How to lookup EJBs deployed in OC4J from a standalone client application

    Hello all,
    I am trying to lookup an EJB deployed in OC4J 10.1.3 from a standalone client application using the following code:
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
    env.put(Context.PROVIDER_URL, "ormi://localhost:23791");
    env.put(Context.SECURITY_PRINCIPAL, "jazn.com/test");
    env.put(Context.SECURITY_CREDENTIALS, "test");
    Context context = new InitialContext(env);
    Object ref = context.lookup("ejb/Dispatch");
    I get the following error:
    javax.naming.NameNotFoundException: ejb/Dispatch not found
         at com.evermind.server.rmi.RMIClientContext.lookup(RMIClientContext.java:51)
         at javax.naming.InitialContext.lookup(InitialContext.java:347)
    For the lookup string I've also tried:
    "java:comp/env/ejb/Dispatch" and "Dispatch"
    For the Context.PROVIDER_URL property I've also tried:
    opmn:ormi://localhost:6003:instance
    The result is always the same.
    I appreciate if someone could help me with this?
    Thanks,
    Georgi

    Georgi,
    Your question has been discussed many times on this forum. Search the forum archives for "RMIInitialContextFactory".
    The PROVIDER_URL needs to include the name of the deployed application that your EJB is part of, for example:
    env.put(Context.PROVIDER_URL, "ormi://localhost:23791/MyApp");The lookup name has to be the value of the "ejb-name" element in your "ejb-jar.xml" descriptor file.
    Your SECURITY_PRINCIPAL value looks strange to me. Personally, I use "principals" (and not JAZN), so I modified the "application.xml" file (in the "j2ee/home/config" subdirectory) to use "principals". Look for the following comment in that file:
    &lt;!-- Comment out the jazn element to use principals.
          When both jazn and principals are present jazn is used  --&gt;Good Luck,
    Avi.
    Message was edited by:
    Avi Abrami

  • How to access files in a jar file?

    Can anyone tell me how to access a file contained in my jar file?
    I have about 15 classes jarred and deployed as an applet. I want to include in the jar file some .gif files to be used as icons in a tree view. Rather than trying to access them locally with all the security headaches this brings, can I not simply jar them as resources and point to them in my code?
    Any help much appreciated,
    Thanks in advance,
    Chris

    Hello Chris,
    Please read this note taken directly from Sun, from their Java Tutorial/Creating a GUI with Swing/Using Other Swing Features/How to use Icons/Specifying the Image Source (whew!)
    Note:  Applets are supposed to be able to load images from JAR files.
    Currently, however, some browsers can't read images from a JAR file,
    although they do successfully get classes from a JAR file.
    With our applets, we currently hedge our bets by both putting
    the image files in the applet's archive file (the JAR file containing
    the applet's class files) and by putting the image files in the file
    system on the server.
    */So......Do you want to take a chance?
    -Ron

  • How a zip file changed to jar file

    Hi,
    implfactory.properties in <WASstudioHome>\runtimes\base_v51\properties has to be zipped and changed to type of jar and has to be added to the classpath of my application.Can any one help me how to make it?
    thank u
    Dharani

    First save it outside mail, e.g. on desktop; simply drag it there or use save function of attached files in Mail.app
    If you double click on it and does not open, the file is corrupt or incomplete.
    If you did that while in Mail.app, I assume the download had not yet been completed at the time you clicked on it.

  • How to access files outside a .jar file netbeans project

    Hi, i need to access a file outside a built project inside netbeans. Ideally i would like this file next to the .jar file as myapp.properties. If possible i would like it so that when i am compiling and running the project in netbeans the file can be with the class files or something along those likes. Either way it would be nice to have different code for built projects and just running them outside a jar.
    Heres what i got so far
    properties = new Properties();
                InputStream in = this.getClass().getResourceAsStream("applications.properties");
                properties.load(in);
                in.close();this only works if the file is next to the classes. (think thats called the classpath ? )
    Thanks for any replies!!

    Your wrong code:
    properties = new Properties();
    InputStream in
    = this.getClass().getResourceAsStream("applications.properties");
    properties.load(in);
    in.close();A right code:
    // basic assumption 1: applications.properties
    //  is a pure ISO 8859-1 text file
    // basic assumption 2: the file applications.properties
    //  is stored in the same directory where your
    //  jar file is stored
    properties = new Properties();
    try{
      FileInputStream in      // assume current dir
       = new FileInputStream("applications.properties");
      properties.load(in);
      in.close();
    catch (Exception e){
      e.printStackTrace();
    }

  • How to modify files in the jar pack

    Is there any way to allow the classes to read and write the files or directories which are inside the same jar file?
    Thanks

    I think you can consider the jar file as a zip file and modify the content of it using
    java.util.zip package:
    http://www.java-tips.org/java-se-tips/java.util.zip/

  • How to restore bookmarks other then "restore" option in library?

    i know how to restore bookmark file in mozilla firefox using restore option, but i want to know is there any other way to restore the bookmarks where i have to just put name of the bookmark and it automatically restore if it found that file. please reply if anyone know the answer.

    Duplicated topic, continue here:
    *[https://support.mozilla.org/en-US/questions/987851 /questions/987851]

  • How to get files saved on nokia lumia 900 ADOBE reader application to pc or cloud?

    Hi  i am using adobe  reader X VERSION 10.1.2 BUILD 20121119 ON MY MOKIA LUMIA.  i have downloaded some files and they are only appearing in adobe reader application. how can i email them out or share to any cloud serviece. my concern is that there is no option to get those files to pc with phones sync software ZUNE. Please help

    Thank you for this fast answer; meanwhile I found further possibilities to solve my problem within the community, but each requires access to internet. Under these circumstances your suggestion seems to be the simplest.
    With best regards
    Von: sflynn121 [email protected]
    Gesendet: Mittwoch, 28. August 2013 14:04
    An: adobefan2013
    Betreff: Workspaces.Acrobat.com How to get access to PDF files on iPAD by "Adobe Reader for iPAD?"
    Re: How to get access to PDF files on iPAD by "Adobe Reader for iPAD?"
    created by sflynn121 <http://forums.adobe.com/people/sflynn121>  in Workspaces.Acrobat.com - View the full discussion <http://forums.adobe.com/message/5633375#5633375

  • How to access files from 2nd hard drive while running Mountain Lion

    Not sure the best way to word this and if there is a forum with and answer already I apologize. I recently Upgraded to an SSD split in 2 partitions one with Windows 8 the other half running mountain lion. I replaced the superdrive with the old hard drive that has Snow Leopard and all my documents. The old SATA HD appears and the file structure is visible but I cannot access any files. I recieve an access denied message. ANy help would be appreciate it. Also secondary issue and less important is due to limited space on the SSD I would like to move the user data to the old HD so it would boot ML from SSD but pull and save all downloads, documents, music etc onto the old SATA HD.

    When you get the drive permissions worked out, and the home directory duped from the SSD to the other HDD, there is a way to tell the OS where the new home directory resides.
    System Preferences > Users & Groups
    Unlock the preference pane. Now right click on your User name ( Admin). The pop-up will say Advanced Options ...
    Home Directory: Choose...  and pick the new HDD home directory location.
    Lock the panel down again.
    Done.

  • How to set DISPLAY for tomcat service inorder to run reports using rwrun.sh

    Here is my problem..
    I came to know that its not possible to invoke rwrun.sh without setting the DISPLAY environment variable from the servlet or any java program. But some one proposed me a solution that to set the DISPLAY variable for TOMCAT service from where my servlet invokes the shell script written for report generation using rwrun.sh. The user for tomcat service is wwwrun ..
    Do i need to set this variable in the logon script for this user ..but I couldn't find the .profile file for that.
    Is there any way to set this variable for tomcat service and get the report successfully.

    i gave export DISPLAY=aatsv001.local:0.0 in $ORACLE_HOME/bin/reports.sh
    but it gives me the following error when i invoke the report
    Xlib: connection to "aatsv001.local:0.0" refused by server
    Xlib: No protocol specified
    REP-0069: Internal error
    REP-3000: Internal error starting Oracle Toolkit.
    I also tried giving localhost and also aatsv001 (without .local)
    some one help me..

  • What and How do I need to set up inorder to run JSP on Win NT4 server

    I'm a newer on JSP. I need to get JSP run on win NT 4. That is the only server available for me. I'm wondering that the tomcat could work with IIS. If not, what do I need? Anybody, please help me.
    chayawee

    Tomcat can be configured to work with IIS or it can run standalone.
    For Tomcat IIS Configuration see:
    http://jakarta.apache.org/tomcat/tomcat-3.2-doc/tomcat-iis-howto.html
    You may want to look at Resin (http://www.caucho.com/products/resin/) as an alternative to Tomcat.

Maybe you are looking for