Must Resource files be located in jar package?

I use ResourceBoundle.getBoundle() method to get resource. I found that the resource files must be packaged into the application jar file. Can the resources be isolated from jar file?

From the link you have provided:
●        Do not load a JDBC driver to use them directly. Instead, use the mapping lookup API (see: Mapping Lookups), or the JDBC Connector Service in the SAP J2EE Engine.
●        Do not use the package java.io to write directly to files, or use it to read directly from files.
<b>&#9679;        Do not use a class loader in your classes.</b>
&#9679;        Within a Java mapping program, do not call java.lang.System.exit() or java.lang.System.setProperties().
&#9679;        Do not create or use any threads.
&#9679;        Do not use any network sockets.
I guess it won't be able to do this.
Probably you could deploy a application and consume its service.
Regards,
Henrique.

Similar Messages

  • Modifying JAR file using java.util.jar package  over the network

    Hello,
    I am modifying a JAR file programmatically using java.util.jar package. The time taken to save the contents to a local disk is very less (around 1 sec) . When I tried modifying the JAR from a remote machine over the network (from mapped drive or shared folder of WIN NT), the time taken to save is 15-20 times more.
    I am recreating the whole JAR while modifying. Is there any way to improve the performance. Or is it possible to write only the changed files?
    Thanks,
    Prasad Y S.

    When you "update" a jar file, you must always recreate it from scratch.

  • SSIS - Change Config File Path LOCATION in SQL Agent Job Step (NOT USING DTEXEC)

    SSISers;
    I am not new to ssis but am trying to deal with promoting of ssis config files differently for a specific project. We are using SQL 2008 R2.
    As a standared pattern used for years, we just use SQL Agent, build a job step for the ssis package, add the ssis package as SQL Integration Services Package type from fileshare (not using Integration Services), and add the necessary production
    config files in the configutation tab of the job step. Easy.  We do not execute our packages with DTEXEC command line.
    A new project has the developers leaving the config files in the package - not removing the config files for deployment. Is there a way to override JUST THE CONFIG FILE PATH LOCATION in the job step for ssis package? Remember, we are NOT using dtexec. 
    I was told that /SET might do it but I do not see a good example anywhere of hooking this in and how it works for a CONFIG FILE PATH LOCATION - I see variable overrides but not CONFIG FILE PATH LOCATION. The packages were written with Absolute config file
    path and not Relative path.
    Please understand that my goal is to let them leave the packages as is, we move the config files to the production sever and all we have to do is flip the location of where the config files are sitting for the ssis pacakge to look for them.  We would
    rather NOT have to use DTEXEC command  line with the job step for reasons that I do no need to get into on this forum.
    Any suggestions are appreciated.

    Hi mg30,
    There is no way to overwrite the XML configurations file just through modifying the SQL Server Agent job steps.  The Dtexec utility will apply the default package configurations for the second time after applying the options specified in the command
    lines or other package configurations configured in the job step.
    If the package is not deployed/installed, the Dtexec utility looks for the XML configurations file according to the file path defined in the Package Configurations Organizer window. In this situation, you need to either disable the package configurations
    or modify the XML file path in the BIDS.
    If the package is already deployed/installed, you need to modify the package as above or re-specify the install folder for the package configurations file. 
    Regards,
    Mike Yin
    If you have any feedback on our support, please click
    here
    Mike Yin
    TechNet Community Support

  • How to include resource files in the application and how to retrieve ?

    Hi,
    I want to include resource file in my application jar file and retrieve data from the file ......Is there any way for it? How i create these resources files and how i include them?.........Which classes shall i use for retrieving the data from these files?.........Any kind of help would be appreciated........Iam using NetBeans IDE 6.1,CLDC1.0 and MIDP 2.0........Thanx,in advance..........

    How i create these resources files and how i include them?How you create the files will depend on what resources you need to include.
    [How to ask questions the smart way|http://catb.org/~esr/faqs/smart-questions.html]
    db

  • Load a file located in JAR

    Hi all.
    I've got a folder which contains files, a class which owns the Files (configuration.java). This class is a utility class and is packaged as a jar (conf.jar) which is located in WEB-INF/lib. My files are located in a folder in the same jar than configuration.java
    A servlet, at server startup verify each attribute File in my class (configurationLoader.java).
    How can I load my files ?
    This is what looks like my EAR :
    WEB-INF
    | lib
    | | con.jar (contains configuration.java)
    | | | configuration.java (pkg fr.myclasses)
    | | | file1 (pkg (fr.directory)
    | | | file 2 (pkg fr.directory)
    | | | ...
    I tried to use (File file = new File("directory/file");). As I thought it's useless.
    If someone can help me ...
    Thanks in advance.
    florent_b
    Message was edited by:
    florent_b

    Sounds good to me.
    The other option would have been to leave them in the jar and use the Class.getResourceAsStream method, which searches the classpath for the requested resource.

  • How can i locate the resource file in the weblogic?

    hello
    in struts, i can leave some parameter in a resource file (such as "Application.properties")outside of my code,and get them in the "Action" class by the "getResource" method.
    in my data access tier,i still want to use such a machanism but i can't use the "getResource()" method,for example,there is a ConnectionPool class,i want to read some parameters from a resource file ("param.properties") that is under the same directory as the ConnectionPool class,the following is the code snippet:
    public static void init(DataSource ds){
    myself=new ConnectionPool(ds);
    java.util.Properties prop=new java.util.Properties();
    try{
    java.io.FileInputStream fin=new java.io.FileInputStream("./param.properties");
    prop.load(fin);
    }catch(Exception e){
    e.printStackTrace();
    System.out.println(prop.get("help.create"));
    the "ConnectionPool" class is in the "com.jhtop.task.forum.db.util" package,the "param.properties" is in the same package (com.jhtop.task.forum.db.util),
    but when i execute the program,it tell me that it can't find the file.if i use the absolute path,it works.
    i wonder how can i locate the file path in the weblogic,or what's my current path,or how may i setup my work directory?
    in tomcat,my current directory is bin directory,how about weblogic?
    who can help me?thank you!

    My english is bad and I'm not sure I've well understood your problem.
    How have you created your file ?
    Why do you put it in such a directory and not an other ?

  • Resources files in Multi-JAR distribution

    Hello.
    I'm kind of new to Java and I'm having some serious issues trying to make resource files get packaged into my JAR properly. Actually, this is what I have:
    CompositorX - this is my main project; it just contains a small main class with "static void main" method that creates a new form from another class, which belongs to CompositorXLib.
    CompositorXLib - this is a class library that contains all the classes I wrote specifically for the CompositorX application.
    General - this is a class library that contains lots of general-purpose classes which are used by multiple applications.
    (BTW, is this a good way to organize my classes?)
    Now, I have a bean in General called PictureFrame. PictureFrame's default constructor has to get an image file to display as the default image for the bean. What I'd like to do is get the default image ("defimg.bmp") packed into General's JAR, so that it is always available to PictureFrame, no matter which application creates the PictureFrame. But it doesn't seem to work that way. In my PictureFrame constructor, I have: PictureFrame.class.getClassLoader().getResource("."). I expect it to return a URL that will get put into my General JAR: therefore, I put the resource inside my General/build/classes/. However, when I run my CompositorX app, and it creates a new PictureFrame object, the URL returned by getClassLoader().getResource() is pointing to CompositorX/build/classes/.
    I'm using NetBeans 5.5.1. I could probably figure out how to fix this without NetBeans... but as I'm doing all my dev in NetBeans and I don't want to fight against whatever it's already doing, I was hoping that someone could tell me how to solve this problem in NetBeans.
    Thanks a lot. If I wasn't clear enough, just let me know and I'll try to post a better description.
    -RN

    1) I don't know if
    these will work with a JAR exe, as I've been doing
    some searching and found that people have had
    problems playing wav files embedded in a JAR.It will work fine if you do it correctly.
    2) The Java Sun guide doesn't provide me with enough
    code examples to actually know what I need to do.What don't you know how to do? If you need more help, search for tutorials on google and consult the API.

  • Accessing JARred resource file

    Hi,
    My app uses an XML file. How might I construct the java.io.File so that when I JAR the app, it can be executed from any where on my file system? Currently, I have to hardcode the File absolute path which is very limiting and undesirable.
    e.g: private File configFile = new File("c:\dev\myproj\config\config.xml");
    works, bit I wish to have the resource file bundled in to the JAR, so the path must be relative i.e accessible to the app, no matter where the JAR is executed from. How can I achieve this please?
    thanks
    Paul.

    To find about more about a class, you can always look it up in the API: [http://java.sun.com/javase/6/docs/api/]
    For example, here is the constructor in question:
    [http://java.sun.com/javase/6/docs/api/java/io/InputStreamReader.html#InputStreamReader(java.io.InputStream,%20java.lang.String)]
    Click on the [charset |http://java.sun.com/javase/6/docs/api/java/nio/charset/Charset.html] link for more information about that string.

  • Problem in reading a resource file form JAR

    Problem in finding a resource file from the jar.....
    I have my code in the following directory structure
    rootDir -
         libDir -
              XMLEntities.res
         modelDir -
              File1
              File2
              File3
    Step1 - I create a jar file with root as modelDir and with all its files.
    Step2 - I add XMLEntities.res also to the root of the jar
    If I run my application using
    java -classpath ;C:\aip_build\build_dm\rmi_server_files\dm.jar; model.data_model.ActivateDataManager
    My application which uses Xalan.jar (lyong under ext directory in jdk) does not find XMLEntiries.res.
    If I use my application as under without creating jar my application does find XMLEntites.res
    Can anyone tell me why the application can not find the XMLEntities.res inside jar?

    Sorry I missed one line............
    Problem in finding a resource file from the jar.....
    I have my code in the following directory structure
    rootDir -
    ----libDir -
    --------XMLEntities.res
    ----modelDir -
    --------File1
    --------File2
    --------File3
    Step1 - I create a jar file with root as modelDir and
    with all its files.
    Step2 - I add XMLEntities.res also to the root of the
    jar
    If I run my application using
    java -classpath
    ;C:\aip_build\build_dm\rmi_server_files\dm.jar;
    model.data_model.ActivateDataManager
    My application which uses Xalan.jar (lyong under ext
    directory in jdk) does not find XMLEntiries.res.
    If I use my application as under without creating jar
    my application does find XMLEntites.res
    java -classpath
    ;C:\aip_build\build_dm\rmi_server_files\;C:\aip_build\b
    ild_dm\rmi_server_files\lib
    model.data_model.ActivateDataManager
    Can anyone tell me why the application can not find
    the XMLEntities.res inside jar?try loading the resources as a InputStream
    something like :
    InputStream is = NameOfLoadingClass.class.getClassLoader().getResourceAsStream("XMLEntities.res");
    Hope this might help you in some way.

  • How to raplace resource files in jar file by other files?

    Can I replace resource files (ex: some jpeg file which is in the jar file) when midlet execute on the phone. Is it possible?
    Usualy, we use getResourceAsStream(filename) to get resource data as stream.
    Is there some API function like 'setResource(filenmae,stream)' ??
    Assume that I have a javaME application which displays some image in the jar file.
    It is different from general image viewr program because it can display only
    image file in the jar file (it means image file is resource file of java applcation).
    In other words, when application executes, It shows always same image at first.
    but I want that user can change image displayed if user wnat to do. I want to embed
    authoring function into application. So user can replace resource file by other image files on the phone.
    How to do that?

    I already told you, you CAN'T replace resources in a jar file.
    [http://forums.sun.com/thread.jspa?threadID=5334325]
    Look into using rms to save content on a mobile device.
    Now do you have anything else you want to ask?
    db
    edit And it's also rude to repost the question here without posting a response on the other topic you started.
    Edited by: Darryl.Burke

  • Need Help! "Could not locate the resource file in the Configuration folder."

    I had just purchased and installed Adobe Crerative Design Suite last night. Every program works except Dreamweaver, which gives me the error message:"Could not locate the resource file in the Configuration folder. This File is required to run Dreamweaver. Please reinstall the application". I am suspicious because the was a previous version of Dreamweaver on the computer before this installation, but I unistalled it. I do not understand why I get this message. Is there a file somewhere that is missing or at faut. How can I remedy this? Thanks
    ~Todd

    Nadia,
    Your posted resources worked for me. Thank you! After many attempts (to include Adobe's overseas call canter) to resolve the same installation and run errors, I used your suggested steps and I finally have a clean and running install. I did have to take a few extra steps;
    First I downloaded both Cleaning  scripts. For CS4 & CS3.
    Next I downloaded Windows installer/cleaner. I have Windows Vista Home Premium and that is a required installed program to run Adobe's cleaning script.
    Once I was sure I had all the programs/scripts I needed (per your instructions and the instructions found on the Cleaning scripts site) I disconnected my computer from the Internet.
    Then I disabled all running programs especially all Anti-virus and firewall programs and any others that have calls of any kind: i.e. Boinc (Seti), Skype, email programs (Windows Live Mail), etc.
    Next I uninstalled all CS4 products and even though I was told that Macromedia Studio MX 2004 can stay installed (read that on one site and the overseas Tech also reinforced that information) I uninstalled MX 2004.
    I then rebooted and installed the Windows installer/cleaner program and ran the Adobe CS4 cleaner script twice.
    After another reboot I installed Dreamweaver CS4 first, rebooted (can't reboot enough with Windows!) and, yes you guessed it, rebooted.
    I then attempted to open Dreamweaver CS4 and for the first time it ran without the error!
    I then installed Adobe Ps CS4 and rebooted and that work for the first time as well.
    I can't say for sure if Macromedia Studio MX 2004 caused the install errors on the Adobe products but without it and ALL that uninstalling and rebooting and running cleaning scripts and installing and rebooting, Adobe finally felt my computer was clean enough to call it home and work.
    Thank you again for your information and I suggest if anyone else finds their way here that they follow your instructions to the letter. Takes a long time but a proper and clean install will be the result.

  • "Could not locate the Resources file in the Configuration folder"

    While opening DW cs5 on my iMac OS X 10.7.5 a window came up that says:  "Could not locate the Resources file in the Configuration folder. This file is required to run Dreamweaver. Please reinstall the application."
    After downloading and reinstalling Adobe Creative Suite CS5 yesterday per the instruction of Adobe tech support, the application still had the same message when I attempt to open it.  Not sure where else to turn.  Please advise.  Thanks

    See if this previous thread regarding the same issue will help:
    http://forums.adobe.com/message/2274699#2274699
    Nadia
    Adobe Community Expert : Dreamweaver
    Unique CSS Templates | Tutorials | SEO Articles
    http://www.DreamweaverResources.com
    Web Design & Development
    http://www.perrelink.com.au
    http://twitter.com/nadiap

  • App for SharePoint online : Resource files can not with the app install package deployment

    I come from China, my English is not very good, bring you the confusion, I apologize;In the development of the APP to the store, I met a problem, hope someone can help me to solve, thank you very much, specific as follows:
    The development tools: vs2012
    Platform: office 365 development version
    Host:Auto
    Problem presentation:
    Press "F5" debugging running normally,Generate app install package, deploy to test environment, the app page error, tip can't find the resource file"
    error:
    Server Error in '/' Application.
    Object reference not set to an instance of an object.
    Description: An
    unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
    Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
    Source Error: 
    Line 107: <div id="FoundareADUserIndex_PageHead">
    Line 108: <span><img alt="" src="../images/head.png" height= "45px" width="45px" /> </span>
    Line 109: <span style="color: #000000; font-size: 28px; font-weight: bold"><%=HttpContext.GetGlobalResourceObject("FoundareADUserResource", "foundare_index_head").ToString()%></span>&nbsp;
    Line 110:
    Line 111:
    Source File: c:\DWASFiles\sites\fzym9dfaguchcdqnvjrwcr2pqasevj5hpvhmcaydkdg1.0.0.0\VirtualDirectory0\site\wwwroot\Pages\Default.aspx   
    Line: 109 
    Stack Trace: 

    Hi,
    According to your post, my understanding is that you want to use resource files in your SharePoint app project.
    Here is an article for your reference:
    http://msdn.microsoft.com/en-us/library/office/fp179919.aspx
    Code sample: SharePoint 2013: Localize the app web, host web, and remote components of an app
    http://code.msdn.microsoft.com/office/SharePoint-2013-Bookstore-328060fc/sourcecode?fileId=60464&pathId=1536365664
    Best Regards
    Dennis Guo
    TechNet Community Support

  • Which jar files for pcm.system.ISystems package?

    Hi ,
    Which jar files are needed for the packages:
    com.sap.portal.pcm.system.ISystems
    com.sap.portal.pcm.system.ISystem
    and under which path I coul dfind them.
    Thnx
    Regards
    Meesum.

    Hi Meesum
    just install WinRAR (yeah, get a licence, it's worth), point the dir to .../irj/root/WEB-INF/portal/portalapps and search for ISystem*.class - and you're done.
    This time I have done it for you:
    Application com.sap.portal.ivs.api_landscape/lib/com.sap.portal.ivs.api_landscapeapi.jar
    Hope it helps
    Detlev

  • Problem with jar including resource files.

    Have working project (classes + resources (video files)).
    After making executable jar file project still working, but without resource files.
    What can i do?
    Edited by: user13653211 on 08.01.2011 7:33

    Thanks a lot, but my browser redirects me from that link
    "http://docs.sun.com/source/819-0913/author/jar.html"
    to "http://www.oracle.com/technetwork/indexes/documentation/index.html" where I can't find material about discussed subject.
    Edited by: KaryuzinRoman on 19.01.2011 10:44

Maybe you are looking for