Auto JAR creation.

Hi there,
I am trying to create a JAR file from within a program. This Jar file is intended to contain the client program and required file to be viewed by other users.
I was reading the jar package API (i.e JarStreamIn/Out classes but they seem to rely on an existing Jar file ).
Is there anyway of creating a jar file from the application?
Thank you

thank you
The example you posted guided me towards the solution...
here it is... It seems to be doing what I needed... at least so far...
try{
       this.fos = new FileOutputStream(this.fileName);
       this.jos = new JarOutputStream(fos, new Manifest(new FileInputStream(manifest)));
    }catch(Exception e){
System.out.println("Error: " + e);
    }//end ScoobyJarMaker
    public void doJar(){
          try {
             for (int i = 0; i < this.archiveFiles.length ; i++){
                String fPath = this.archiveFiles;
                    FileInputStream fis = new FileInputStream(fPath);
                    BufferedInputStream bis = new BufferedInputStream(fis);
                    JarEntry fileEntry = new JarEntry(fPath);
                    //JarEntry fileEntry = new JarEntry(fis);
                    jos.putNextEntry(fileEntry);
                    byte[] data = new byte[1024];
                    int byteCount;
                    while ((byteCount = bis.read(data, 0, 1024)) > -1) {
                         jos.write(data, 0, byteCount);
     }//end for
jos.close();
          } catch (IOException e) {
System.out.println("JAR ERROR : " + e);

Similar Messages

  • Auto PO creation from PR through ME58 problem.

    Hi experts.
    We are providing facility to our client  auto po creation from PR through Me58 transaction code.
    I am facing amazing problem is that it is working fine in development client , not working in Quality and  Production client , exactly  problem is that ME58 u2013 Ordering Assigned Purchase requisition  & Process Assignment  Create PO , Purchase order cannot be created, PR  shift in document overview , it means user want to drag and drop in purchase order then system create PO , this problem I am facing in Quality & Production , but it is working fine in development server there is no need to drag and drop , immediately after Process assignment Create PO , system directly convert PR into PO  just only need to check and save PO. I compare everything with development & quality data including material master , source list and everything still I am unable to understand where is the problem , is there any customization settings related to auto po ?  pls. suggest any solution to solve this issue.
    Kumar

    Hi,
    Config setting.
    Settings for Automatic PO creation is:
    1. Select the Automatic PO check box/option in Purchasing view of material master
    2. Select the Automatic PO option in the purchasing data view of Vendor master
    3. Maintain Purchase info record
    4. ME56- Assign the vendors to PR's
    5. ME58- Create PO via assignment list(PR-> PO)
    6. ME57- Assign and process PR's
    7. ME59N - Create PO automatically via PR
    Above step by step procedure is involved in the Automatic PO creation.
    SAM

  • Auto PO creation from PR

    Dear All,
    I have done all process required for Auto PO creation from PR. With TCode Me59 i am able to create a PO also but some field in PO are blank like in header level Additional  tab - Validity Start and Validity End, in Communication tab - Your Reference and Our Reference.
    And while using ME59N, its shows error
    "PO cannot be created
    PO header data still faulty
    Enter Our Reference
    Enter Validity End
    Enter Validity Start
    Enter Your Reference
    Requisition could not be converted"
    How will i fill these field. Any link from info record or source list. These field are necessary in PO.
    Please anybody help me to solve this issue.

    Yes Sir. You have said the right thing. At first i have done the same that make these fields optional. but here as per our business these fields are mandatory for PO. Is there any other way that we forcefully enter data in these fields.
    And one more thing i want to ask, i have created PR through MRP run, in this how could i maintain fixed vendor, valuation type, purch org, info record. These all things are necessary to create auto PO creation. Now what are we doing that we create PR through MRP run and then go to change PR enter all these thing and then run ME59N. After that the same problem some fields are blank in PO.
    Please suggest me any other way to maintain this....

  • Problem during Auto PO Creation

    Hi
       Im using a user exit for Auto PO functinality ..
       I have following conditions for creation of Auto PO
       1) For PR with source of supply as Info record will not be converted in PO automatiocally as Info record contains historical prices..
       PR can be assigned source from Source list, contract or quota arrangment for converting it in PO automatically.
        I have maintained all settings require din VM and MM for Auto PO creation..
       Still these PR which satisfies above criterion are not converted in PO automatically..
       when i tried to convert these PR in PO using me21n , i get the message as conditions not mainined so i have to maintain conditions and net price manually..
    then PO can be created manually..
      so what im missing for Auto PO functionality..
    Thanks..

    Hi,
    I would recommend that you add your contract data to the source list for the material, then you will see it proposed as a possible source for this material.
    The problem with source lists are that if you do not have one the system will propose all existing sources for you to choose from. If you DO have a source list the system will ONLY propose sources from that source list.
    One option is to use the auto generation transaction ME05 as a regular batch job to keep the sources up to date.
    But if you want the outline agreement to be the proposed source when there are others to choose from then select this as the default in the source list.
    So I think that your problem is that your agreements are not in the source lists that you have.
    Steve B

  • Auto PO  creation using purchase requisition

    Hi,
    I have tried the following steps for auto PO creation using purchase requisition.
    i. Maintain Auto PO in Material master Purchasing view
    ii. Select Automatic purchase order in Vendor master- Purchase data
    iii. Maintain info-record
    iv. Create PR through ME51
    v. enable source determination during creation of PR
    vi. Execute using ME59N
    But Auto PO is creating with the same document type (e.g NB) which is used while creating purchase requisition (e.g NB). Following steps have done in SPRO.
    1. SPRO - MM - Purchasing - purchase requisition - define  document type
    a. NB- PR document type LINK TO DI01- PO document type
    2. SPRO - MM - Purchasing - Purchase order - Define document type
    a. DI01- PO document type LINK TO NB- PR document type
    3. There is no linking from NB - NB & DI01 - DI01 but still it is creating auto PO with document type NB iif requisition has been created with document type NB.
    Please suggest on this . waiting for ur quick response.
    Thanks...
    ARATI.
    Thanks!
    Arati.
    Edited by: Rakesh Gupta on Aug 20, 2009 11:00 AM

    Hi
    Please check the below thread
    PR to PO  via  ME59 -Doc type issue
    Thanks/karthik

  • Auto PO creation from service PR(ME59N)

    Hi All,
    We have service PR's and need to convert to PO's automatically via ME59N.
    I have followed below steps but unable to convert to Po's getting message no Pr's found while executeting ME59N
    checked VMR and Automatic PO check box selected.
    Step1: Creating PR for services
    Step2: and assigned source to this PR through t.code: ME56 (contract existed for this vendor)
    Step3:Run the ME59Nby giving PR Number, but PO is not created
    what could be the reason..is any idea about auto PO creation for Service PR's
    Incase of material i can successfully converts PR's PO's but services i can't.
    Thanks in Advance,
    Warm regards,
    Venkat
    MM/SRM Consultant

    Hi venkat
    it should create a PO if the contract is valid..
    Note 733045 - Wrong Interface values passed to Services for ME59N
    When transaction ME59N is used to convert service purchase requisition
    (PR) to purchase order (PO),the program within the ME59N transaction
    calls the service package with the wrong interface values.
    The following example illustrates one such case :
    A Service PR is created and an Outline agreement is assigned as a source of supply to the PR.
    when the transation ME59N is executed using the PR's the system performs a mandatory check against the Tax code and tax code has to be entered against each service line to complete the transaction even though the tax code is maintained as a condition.
    In the above situation,system behaves in a correct manner for the
    transaction ME59 but fails for the transaction ME59N.
    Other terms
    MS_SERVICE_PACKAGE , ME59N , ME59 , WITHOUT_SCREEN , COPY_SERVICES
    Reason and Prerequisites
    The calling program of the transaction ME59N calls the function
    MS_SERVICE_PACKAGE of services with the wrong interface values.
    is it applicable for you?

  • Issue with Auto PO creation

    Hello Gurus,
    Kindly help me with this issue.
    I have user who is using ME59 for the auto PO creation.When he runs this transaction with the "TEST RUN" flaged,in the result screen he is able to see a mesasage as "PO creation successfull" along with the vendor number for which PO has been created.
    But along with above  message he also needs material number & quantity  for which the PO has been created.
    Kindly let me know how to proceed with this request.

    It is not possible in standard , not for test run and not for production run, not with any customizing and I have not found any OSS note that may allow that.
    For any further information in the log you have to modify the program.

  • Auto po creation after save sales order.

    Hi, Experts,
    A s per  my business requirement, We have mapped configuratin for auto PR creation at a time of order if stock not available, But system not create automatic PO after save sales order. I want to crate Automatic PO after save sales order, it is possible i know , But for that which type for configuration require i don't know, can anybody give me solution for this issue.
    Thankls a lot in advance,
    Regards:
    Happy

    Hi,
    It's possible to create PO automatically after sales order is saved.
    1. Set up back-to-back, i.e. PR can be automatically created after the SO is saved.
    2. Item category - make sure 'Create PO automatically' checkbox  is ticked.
    3. Enterprise Structure --> Sales Organization - ensure that PO type, purchasing group etc. is maintained.
    4. Transaction code SWETYPV - Ensure that both checkboxes are ticked for BO (object category), BUS2032 (object type), ALECREATEE/CHANGED and ERRORCHANGINGPURORD/ERRORCREATINGPURORD.
    5. Optional: You could execute BD86 to check for consistencies (note that you can still get it work even if BD86 shows errors)
    Regards,
    HweeLing

  • Auto PO creation

    Dear all,
    i would like to create the 50 Purchase requsition to 50 purchase order automatically.not manually. i have tried in me59 but i failed to create the Pos.
    Kindly advise how to use me59 t.code for creating the pos.
    Regards,
    Renuga.A

    Dear Renuga,
    For auto PO creation, just check have you done following pre-requisites
    1. Auto PO check for Material
    2. Auto PO check for Vendor
    3. Sourse list / Info-record
    4. Assignment of vendor to PR. ( If sourse determination is there, just check whether sourse is assigned to in PR)
    5. Then run ME59 as per your selection criteria
    Please close the issue if it resolves your problem
    Thanks,
    krishna reddy

  • JAR creation failed , for Command bean DC

    Hi Experts,
    I am trying to access an EJB module DC from WebDynpro through Java bean model DC.
    In this when i tried to create a Jar file of the Java bean model, i got this error.
    JAR creation failed. See details for additional information.
    Problem writing /LocalDevelopmentdc_aptcbsap.com/bin/pg/com/atos/apt/bean/APTCommandBean.class to JAR: duplicate entry: pg/com/atos/apt/bean/APTCommandBean.class
    I have created in all total 4 DC
    1) EJB DC
    2) EAR DC
    3) Java bean DC
    4) WebDynpro DC
    I have reffered to the tutorial : Using EJBs in Web Dynpro application.
    Can you tell me what am i missing?
    Ashish Shah

    Hi Sridhar,
    Thanks for your suggestion.
    I have built and deployed the EAR DC.
    But When I added the following referencesto Java bean DC
    1) EAR DC , EJB DC
    2) ejb20.jar
    and i tried to build java bean DC project, it throws error for these referenced DC.
    And these referenced DCs are removed from the project.
    Do i have to add anything in the Public part of EJB or EAR DC?
    Can you tell me how to add those references in Public part and how to utilise them in other projects?
    Regards,
    Ashish Shah

  • Jar creation from JBuilder file structure

    Hi,
    I've got a program written in jBuilder 4. It does not have the jar creation feature.
    So I've created a jar manually, but I'm having problems finding the main class from the manifest.
    I've created the manifest with no problems:
    Manifest-Version: 1.0
    Main-Class: Application1
    Created-By: me
    Where Application1 is the name of my main class. I've even tried chnging the file path to Application1 such as:
    Main-Class: programfile/classes/programname/Application1
    But whenever I create the jar and double click on it I get an error saying that cannot find main class.
    Does anybody know how to access the main class from a program created in JBuilder???
    Cheers for any help,
    Al

    Cheers for the suggestion, but I managed to sort the problem.
    For anyone else out there who's trying to jar a JBuilder file manually:
    You only need to jar the "class" folder that JBuilder creates for you, not ther entire project. (If you have a file containing images then that will need to be included as well).
    If you've not named your main class the same as the pakage name, then the mane of your main class is packagename.main
    For example if your package is called "Program" and your main class is called "Main" then you need to include the following line in the manifest:
    Main-Class: Program.Main
    Hopes this helps someone.
    Al

  • JAR creation failed. See details for additional information.-invalid header

    Hi
    I am working with 2 databases , 1 is oracle and the other is sybase in my java application.
    The java application gets data from both the databases and creates 3 output files and 1 audit log file .
    Now i tried creating the jar file
    my manifest file looks like this :
    Manifest-Version: 1.0
    Sealed: true
    Main-Class: tableA
    Class-Path:jtds-1.2.jar;classes12.jar ----------------------------> is this correct .
    Now when i try to create the jar file it gives me an err
    JAR creation failed. See details for additional information.-
    invalid header field
    invalid header field
    ANyone pls help me ... I am creating the jar file like rhis
    export -> selecting JAR file -> selecting 1 and 3 rd checkboxes ->location of the jar file -> next->selecting 2 checkboxes in JAR PACKAGING OPTIONS -> ( my question is how to create the manifest file with class-path , their is no option ) so i am creating the manifest file and creating the jar file and then adding the class-path to the manifest file and removing the jar file and recreating the jar file now selecting the manifest file .
    is this giving the above error --> if so how to create the manifest file before creating the jar file with class-path and main class

    Double post: [http://forums.sun.com/thread.jspa?threadID=5358017&messageID=10559776#10559776]

  • Auto WT creation while doing partial GR in inbound delivery

    Hi All,
    We need auto WT creation once GR got completed. It is working fine using PPF if entire item GR got completed. But if we are doing partial GR , WT is not getting created.
    We do GR partially with HU and WT need to create for that HU only.
    Please help me if you have any idea about this.
    Thanks,
    Srikanth.A

    Hi experts,
    I have the same problem.
    We have deliveries with several items and we are using Tx /SCWM/GR for the partial GR (for each item).
    The partial posting to the ERP works fine.
    After the posting we want to create the putaway warehouse task only for the item for which we posted the GR. Unfortunatley the creation only starts (by PPF) if the GR is posted for whole delivery and for all items.
    Is there a way (by PPF) to initiate the creation of the WT only for the item for which the GR is posted?
    Thanks
    Ralf 

  • Weblogic jar creation in Jbuilder 8

    Hi,
    I have installed Weblogic Server 7.0 and Jbuilder 8. I configure Weblogic as the
    application server, but there is one service (Jar Creation) which is never enabled.
    Why? Isn't it possible to create JAR files for weblogic as I did in Jbuilder 6?
    Should I use any weblogic specific tool for doing so?
    The JAR files I create with Jbuilder8 don't contain the stub and skeleton classes
    I need!!!! In Jbuilder6 it was not necessary to specify a server application for
    every service, just one for all, and it worked fine, generating everything I needed
    in my JAR.
    Help!!!!

    Is there any bea newsgroup for JBuilder, as far as there's a JBuilder Weblogic
    Edition version launched or should I try in Borland's newgroups?
    "Slava Imeshev" <[email protected]> wrote:
    Hi Ignacio,
    I suggest contacting Borland support or posting this question in the
    related
    jbuilder newsgroup.
    Regards,
    Slava Imeshev
    "Ignacio" <[email protected]> wrote in message
    news:[email protected]..
    Hi,
    I have installed Weblogic Server 7.0 and Jbuilder 8. I configure Weblogicas the
    application server, but there is one service (Jar Creation) which isnever
    enabled.
    Why? Isn't it possible to create JAR files for weblogic as I did inJbuilder 6?
    Should I use any weblogic specific tool for doing so?
    The JAR files I create with Jbuilder8 don't contain the stub and skeletonclasses
    I need!!!! In Jbuilder6 it was not necessary to specify a serverapplication for
    every service, just one for all, and it worked fine, generating everythingI needed
    in my JAR.
    Help!!!!

  • How to disable application jar creation in tmp folder

    Hi
    I am deploying an application on clustered server.
    Everytime i deploy application a jar(for the application) is getting created in admin server's tmp folder in the folder WLTEMP_APP_DOWNLOADS/<application_name>/<application_name.jar>
    I am deploying application in exploded format and one of its functionality is to generate csv files.
    As Weblogic seems to be referring the application_name.jar I get a 404 error whenever csv files are accessed in UI.
    Could somebody please suggest the settings to disable the application jar creation.

    The issue was with weblogic caching.
    The server was creating a jar of the application in a tmp folder for every deployment .
    Due to this any new file generated within deployment path was not being identified.
    Disabling caching on admin server resolved the issue.

Maybe you are looking for

  • External Hard Drive "You don't have permission" intermittent issue

    Hi - We have three iMacs that are networked using Airport Extreme.  Computer 'A' has an external USB hard drive plugged in to it.  I have "file sharing" turned on, and using "get info", I have shared the external hard drive with Computer 'B' and Comp

  • Can I set up two email accounts?

    I have set up my Gmail account in Firefox. I now wish to set up a different Gmail account which I use for community purposes. Can I have more than one account in Firefox, as I had in MS Outlook?

  • Yosemite finder doesn't display file count?

    I just installed Yosemite (10.10.2) on a clean drive in my MacBook Pro 6,2 and I'm trying to figure out how to get Finder to display a count of files at the bottom of the finder windows. I'm used to it displaying something like "356 files. 49 files s

  • Upgraded to firefox 3.6.6 lost my mozilla firefox toolbar. how do I get it back

    Lost my mozilla firefox toolbar, after upgrading to firefox 3.6.6. How do I get it back. Can I restore to previous version, so I can have toolbar back. == This happened == Just once or twice == upgraded to firefox 3.6.6

  • PO Modeling help

    hello, I have a question about modeling. i need to create a report where users want to see po status by each month. example: PO 12 was open in January 2010 and was closed in Feb. 2010. now when user wants to run the report  for 2 months they want to