Creating a JAR File for a program that depends on other JAR files
Hi, I'm pretty new to this so it shouldn't be terribly hard to answer:
I have a program which uses JGoodies. There are 2 JGoodies .jar files in the same directory as my program. So I compile it by doing:
javac -extdirs . NameOfMyProgram.java
First off, is this the best way to do it? Is there any way of 'calling' these JAR files from within NameOfMyProgram.java?
Secondly, if I then try to run it by doing java NameOfMyProgram, it doesn't work; can't find the JGoodies stuff. I end up having to add the classpaths of the unzipped JGoodies directories.
So I have 2 questions:
1. How can I execute my file so that it reads from the JAR files, not the big expanded folders that I unzipped?
2. How can I create a JAR file that reads the JGoodies files properly? Right now, I have a Manifest.txt file that looks like:
Main-Class: NameOfMyProgram
Class-Path: forms-1.0.5.jar
Class-Path: looks-1.3.1.jar
Thanks a lot for your help!
- learn how to use mysql JDBC
- pack JDBC driver only
- remotely access your DB
- set proper security level for your app
Similar Messages
-
Need to create a driver class for a program i have made...
hey guys im new to these forums and someone told me that i could get help on here if i get in a bind...my problem is that i need help creating a driver class for a program that i have created and i dont know what to do. i need to know how to do this is because my professor told us after i was 2/3 done my project that we need at least 2 class files for our project, so i need at least 2 class files for it to run... my program is as follows:
p.s might be kinda messy, might need to put it into a text editor
Cipher.java
This program encodes and decodes text strings using a cipher that
can be specified by the user.
import java.io.*;
public class Cipher
public static void printID()
// output program ID
System.out.println ("*********************");
System.out.println ("* Cipher *");
System.out.println ("* *");
System.out.println ("* *");
System.out.println ("* *");
System.out.println ("* CS 181-03 *");
System.out.println ("*********************");
public static void printMenu()
// output menu
System.out.println("\n\n****************************" +
"\n* 1. Set cipher code. *" +
"\n* 2. Encode text. *" +
"\n* 3. Decode coded text. *" +
"\n* 4. Exit the program *" +
"\n****************************");
public static String getText(BufferedReader input, String prompt)
throws IOException
// prompt the user and get their response
System.out.print(prompt);
return input.readLine();
public static int getInteger(BufferedReader input, String prompt)
throws IOException
// prompt and get response from user
String text = getText(input, prompt);
// convert it to an integer
return (new Integer(text).intValue());
public static String encode(String original, int offset)
// declare constants
final int ALPHABET_SIZE = 26; // used to wrap around A-Z
String encoded = ""; // base for string to return
char letter; // letter being processed
// convert message to upper case
original = original.toUpperCase();
// process each character of the message
for (int index = 0; index < original.length(); index++)
// get the letter and determine whether or not to
// add the cipher value
letter = original.charAt(index);
if (letter >='A' && letter <= 'Z')
// is A-Z, so add offset
// determine whether result will be out of A-Z range
if ((letter + offset) > 'Z') // need to wrap around to 'A'
letter = (char)(letter - ALPHABET_SIZE + offset);
else
if ((letter + offset) < 'A') // need to wrap around to 'Z'
letter = (char)(letter + ALPHABET_SIZE + offset);
else
letter = (char) (letter + offset);
// build encoded message string
encoded = encoded + letter;
return encoded;
public static String decode(String original, int offset)
// declare constants
final int ALPHABET_SIZE = 26; // used to wrap around A-Z
String decoded = ""; // base for string to return
char letter; // letter being processed
// make original message upper case
original = original.toUpperCase();
// process each letter of message
for (int index = 0; index < original.length(); index++)
// get letter and determine whether to subtract cipher value
letter = original.charAt(index);
if (letter >= 'A' && letter <= 'Z')
// is A-Z, so subtract cipher value
// determine whether result will be out of A-Z range
if ((letter - offset) < 'A') // wrap around to 'Z'
letter = (char)(letter + ALPHABET_SIZE - offset);
else
if ((letter - offset) > 'Z') // wrap around to 'A'
letter = (char)(letter - ALPHABET_SIZE - offset);
else
letter = (char) (letter - offset);
// build decoded message
decoded = decoded + letter;
return decoded;
// main controls flow throughout the program, presenting a
// menu of options the user.
public static void main (String[] args) throws IOException
// declare constants
final String PROMPT_CHOICE = "Enter your choice: ";
final String PROMPT_VALID = "\nYou must enter a number between 1" +
" and 4 to indicate your selection.\n";
final String PROMPT_CIPHER = "\nEnter the offset value for a caesar " +
"cipher: ";
final String PROMPT_ENCODE = "\nEnter the text to encode: ";
final String PROMPT_DECODE = "\nEnter the text to decode: ";
final String SET_STR = "1"; // selection of 1 at main menu
final String ENCODE_STR = "2"; // selection of 2 at main menu
final String DECODE_STR = "3"; // selection of 3 at main menu
final String EXIT_STR = "4"; // selection of 4 at main menu
final int SET = 1; // menu choice 1
final int ENCODE = 2; // menu choice 2
final int DECODE =3; // menu choice 4
final int EXIT = 4; // menu choice 3
final int ALPHABET_SIZE = 26; // number of elements in alphabet
// declare variables
boolean finished = false; // whether or not to exit program
String text; // input string read from keyboard
int choice; // menu choice selected
int offset = 0; // caesar cipher offset
// declare and instantiate input objects
InputStreamReader reader = new InputStreamReader(System.in);
BufferedReader input = new BufferedReader(reader);
// Display program identification
printID();
// until the user selects the exit option, display the menu
// and respond to the choice
do
// Display menu of options
printMenu();
// Prompt user for an option and read input
text = getText(input, PROMPT_CHOICE);
// While selection is not valid, prompt for correct info
while (!text.equals(SET_STR) && !text.equals(ENCODE_STR) &&
!text.equals(EXIT_STR) && !text.equals(DECODE_STR))
text = getText(input, PROMPT_VALID + PROMPT_CHOICE);
// convert choice to an integer
choice = new Integer(text).intValue();
// respond to the choice selected
switch(choice)
case SET:
// get the cipher value from the user and constrain to
// -25..0..25
offset = getInteger(input, PROMPT_CIPHER);
offset %= ALPHABET_SIZE;
break;
case ENCODE:
// get message to encode from user, and encode it using
// the current cipher value
text = getText(input, PROMPT_ENCODE);
text = encode(text, offset);
System.out.println("Encoded text is: " + text);
break;
case DECODE:
// get message to decode from user, and decode it using
// the current cipher value
text = getText(input, PROMPT_DECODE);
text = decode(text, offset);
System.out.println("Decoded text is: " + text);
break;
case EXIT:
// set exit flag to true
finished = true ;
break;
} // end of switch on choice
} while (!finished); // end of outer do loop
// Thank user
System.out.println("Thank you for using Cipher for all your" +
" code breaking and code making needs.");
}My source in code format...sorry guys :)
Cipher.java
This program encodes and decodes text strings using a cipher that
can be specified by the user.
import java.io.*;
public class Cipher
public static void printID()
// output program ID
System.out.println ("*********************");
System.out.println ("* Cipher *");
System.out.println ("* *");
System.out.println ("* *");
System.out.println ("* *");
System.out.println ("* CS 181-03 *");
System.out.println ("*********************");
public static void printMenu()
// output menu
System.out.println("\n\n****************************" +
"\n* 1. Set cipher code. *" +
"\n* 2. Encode text. *" +
"\n* 3. Decode coded text. *" +
"\n* 4. Exit the program *" +
"\n****************************");
public static String getText(BufferedReader input, String prompt)
throws IOException
// prompt the user and get their response
System.out.print(prompt);
return input.readLine();
public static int getInteger(BufferedReader input, String prompt)
throws IOException
// prompt and get response from user
String text = getText(input, prompt);
// convert it to an integer
return (new Integer(text).intValue());
public static String encode(String original, int offset)
// declare constants
final int ALPHABET_SIZE = 26; // used to wrap around A-Z
String encoded = ""; // base for string to return
char letter; // letter being processed
// convert message to upper case
original = original.toUpperCase();
// process each character of the message
for (int index = 0; index < original.length(); index++)
// get the letter and determine whether or not to
// add the cipher value
letter = original.charAt(index);
if (letter >='A' && letter <= 'Z')
// is A-Z, so add offset
// determine whether result will be out of A-Z range
if ((letter + offset) > 'Z') // need to wrap around to 'A'
letter = (char)(letter - ALPHABET_SIZE + offset);
else
if ((letter + offset) < 'A') // need to wrap around to 'Z'
letter = (char)(letter + ALPHABET_SIZE + offset);
else
letter = (char) (letter + offset);
// build encoded message string
encoded = encoded + letter;
return encoded;
public static String decode(String original, int offset)
// declare constants
final int ALPHABET_SIZE = 26; // used to wrap around A-Z
String decoded = ""; // base for string to return
char letter; // letter being processed
// make original message upper case
original = original.toUpperCase();
// process each letter of message
for (int index = 0; index < original.length(); index++)
// get letter and determine whether to subtract cipher value
letter = original.charAt(index);
if (letter >= 'A' && letter <= 'Z')
// is A-Z, so subtract cipher value
// determine whether result will be out of A-Z range
if ((letter - offset) < 'A') // wrap around to 'Z'
letter = (char)(letter + ALPHABET_SIZE - offset);
else
if ((letter - offset) > 'Z') // wrap around to 'A'
letter = (char)(letter - ALPHABET_SIZE - offset);
else
letter = (char) (letter - offset);
// build decoded message
decoded = decoded + letter;
return decoded;
// main controls flow throughout the program, presenting a
// menu of options the user.
public static void main (String[] args) throws IOException
// declare constants
final String PROMPT_CHOICE = "Enter your choice: ";
final String PROMPT_VALID = "\nYou must enter a number between 1" +
" and 4 to indicate your selection.\n";
final String PROMPT_CIPHER = "\nEnter the offset value for a caesar " +
"cipher: ";
final String PROMPT_ENCODE = "\nEnter the text to encode: ";
final String PROMPT_DECODE = "\nEnter the text to decode: ";
final String SET_STR = "1"; // selection of 1 at main menu
final String ENCODE_STR = "2"; // selection of 2 at main menu
final String DECODE_STR = "3"; // selection of 3 at main menu
final String EXIT_STR = "4"; // selection of 4 at main menu
final int SET = 1; // menu choice 1
final int ENCODE = 2; // menu choice 2
final int DECODE =3; // menu choice 4
final int EXIT = 4; // menu choice 3
final int ALPHABET_SIZE = 26; // number of elements in alphabet
// declare variables
boolean finished = false; // whether or not to exit program
String text; // input string read from keyboard
int choice; // menu choice selected
int offset = 0; // caesar cipher offset
// declare and instantiate input objects
InputStreamReader reader = new InputStreamReader(System.in);
BufferedReader input = new BufferedReader(reader);
// Display program identification
printID();
// until the user selects the exit option, display the menu
// and respond to the choice
do
// Display menu of options
printMenu();
// Prompt user for an option and read input
text = getText(input, PROMPT_CHOICE);
// While selection is not valid, prompt for correct info
while (!text.equals(SET_STR) && !text.equals(ENCODE_STR) &&
!text.equals(EXIT_STR) && !text.equals(DECODE_STR))
text = getText(input, PROMPT_VALID + PROMPT_CHOICE);
// convert choice to an integer
choice = new Integer(text).intValue();
// respond to the choice selected
switch(choice)
case SET:
// get the cipher value from the user and constrain to
// -25..0..25
offset = getInteger(input, PROMPT_CIPHER);
offset %= ALPHABET_SIZE;
break;
case ENCODE:
// get message to encode from user, and encode it using
// the current cipher value
text = getText(input, PROMPT_ENCODE);
text = encode(text, offset);
System.out.println("Encoded text is: " + text);
break;
case DECODE:
// get message to decode from user, and decode it using
// the current cipher value
text = getText(input, PROMPT_DECODE);
text = decode(text, offset);
System.out.println("Decoded text is: " + text);
break;
case EXIT:
// set exit flag to true
finished = true ;
break;
} // end of switch on choice
} while (!finished); // end of outer do loop
// Thank user
System.out.println("Thank you for using Cipher for all your" +
" code breaking and code making needs.");
} -
How many softwares are there to create a setup file for java programs
Hi, i am new to java
I want to know how many softwares are there to create a setup file for java programs.
I know one software i.e java launcher to create a setup file.
I want to know about any other softwares are available to create a setup file for java programs.
I created a setup file for swings program in JCreator.
And don't think that i am wastiing ur time with this question .
Help me regarding this topic.
Thanks in Advancesuperstar wrote:
I want to know how many softwares are there to create a setup file for java programs.13, no wait, 42.
I know one software i.e java launcher to create a setup file.You should clearly identify what you think you already know.
I want to know about any other softwares are available to create a setup file for java programs.
I created a setup file for swings program in JCreator.Is this the one you talked before, or is this different?
And don't think that i am wasting ur time with this question .Why should I not think that? -
Hi Everyone,
I have a program that sends information(analog output) to lab windows cvi in the form of a text file or user input.
The program runs on the computers that I have the field point explorer and lab windows cvi installed on. In order to run the program without always installing labwindows/cvi and field point; I wanted to create an executable file that could be load on another computer.
I used the create distribution kit part of labwindows/cvi to do this.After creating the distribution kit, I then installed it
to another computer.
My user interface appears on the screen, when the user clicks on the exe. file, but no data is sent to the field point module. I know that the data is being read from the user and textfile because in it appears in the uir.
The following are some details about the problem:
1. On another computer without labwindows/cvi and field point explorer not installed - no data is sent to field point module
I know this because a current is being read on the current meter connected to field point module.
My questions are the following:
1. What are the possible reasons for the data not being sent to the field point module?
2. Do I still need to create an iak. (Installing Field point Explorer) file stored on any new computer that I install my created distribution kit file too?
Thankyou very much for any help that you can provide. I greatly appreciate it.
Faen9901Re: Hello, I have created a distribution kit for my program.The problem is that the when the program is installed onto another computer, it fails to communicate with field point (Using FP-AO-200 and FP-AO-1000). Help is greatly appreciated, Thanks faen9901Faen9901,
1) If you do not install FieldPoint Explorer, the FieldPoint Server is not installed so there is nothing on the target computer that knows how to talk to the FieldPoint system.
2) Yes, you need an IAK file on the target computer. Assuming the settings (i.e. com port#) are identical you can simply include the iak file as part of the distribution.
3) You also need to include as part of your installer the file "fplwmgr.dll". If this file is not installed, your program will not be able to access the FieldPoint Server. Alternatively, this file is installed automatically if FieldPoint Explorer detects LabWindows/CVI or Measurement Studio Development versions on the target computer or if you choose to do a custom FieldPoint Explorer installation and
choose to provide LabWindows/CVI support.
Regards,
Aaron -
Enable to create ldt file for specific program using FNDLOAD submit request
hi ALL ,
i am trying to create .ldt file for specific program but the things is that following program creating .ldt file for all the program which are available on instance .
please suggest me if i did anything wrong in my code ...
DECLARE
req_id fnd_concurrent_requests.request_id%TYPE;
BEGIN
fnd_global.apps_initialize (user_id => 1012001,
resp_id => 20420,
resp_appl_id => 1
req_id :=
fnd_request.submit_request
(application => 'FND',
program => 'FNDLOAD',
description => NULL,
start_time => NULL,
sub_request => FALSE,
argument1 => 'DOWNLOAD' ---Mode - UPLOAD
argument2 => '@fnd:patch/115/import/afcpprog.lct'
-- -LCT File
argument3 => '/tmp/concqueues.ldt' -- -
argument4 => 'PROGRAM',
argument5 => 'XXFUJI'
,argument6 => 'XXSAG_FILE_DATA'
DBMS_OUTPUT.put_line ('req_id= ' || req_id);
COMMIT;
END;
thanks in advance
sagarthanks for your reply ... Alex
... but... no i don't wanna create concurrent program for fndload neither i want to use FNDLOAD script ... the above FNDLOAD Submit request program worked for me and using that i have created ldt but my problem is that program is creating ldt for all program which are registered , it's not picking my my file which i pass as a parameter ...please have look into my code ...
and please suggest me ..
thanks
sagar -
Looking for a program that can handel import and export of palm doc files
I am looking for a program that can handel the import and export of palm doc Files that can convert them to to either txt or RTF files for Vista 32, running Palm Desktop 7.1.
Could anyone give me a few suggestions of any plug-ins that would be good me?
Hearns
Post relates to: Palm IIIxe
This question was solved.
View Solution.Ok, you need to clean uninstall Palm desktop 6.2. Install Palm desktop 4.1.4 and download and install documents to go version 6.
Here are the clean uninstall instructioins for Vista.
You should first make a copy of your data to have just in case something
happens. You can find your data files by going to Start --> Documents -->
Palm OS Desktop. Highlight your Palm Desktop username and right click and
copy. Then go to your PC desktop right click on a blank spot and select paste.
If this is the first time you are installing Palm desktop and encountering a problem, skip the previous step.
Now you want to uninstall Palm Desktop and remove everything that has to do
with Palm Desktop from your computer.
Go to the following locations on the PC and delete the folders listed below.
C:\Program Files\Palm or Palm One
C:\Users\[Vista Login Name]\appdata\local\virtualstore\Program Files\Palm or
PalmOne
C:\Users\[Vista Login Name]\appdata
*Note you may need to view hidden folders to get to appdata. To do that go
into your control panel and open folder options. Go to view tab and uncheck
hide hidden files.
Once this is done you will need to delete some registry keys from your PC Operating System.
Word of warning, going here and deleting the wrong thing can cause your PC
from starting up, crashing and deletion of programs and data. If you feel
you are unsure of yourself, see if you have a friend that can help you or a
PC technician that you can pay to help you. This procedure will show them everything they need to delete. To make sure we have a good copy of the current registry, we need to do a backup of the Registry.
Go to start on the PC, in the search field type "regedit.exe" without quotes.
Highlight COMPUTER, go to File --> Export. Should pop up with a Save As box.
Current location is fine, should be in My Documents or save to a location you will remember. In the file name on the bottom type "backup[todaysdate]" i.e. backup07072008. Next, the hard part.
The easiest way to make sure your working with the correct key, highlight the key i.e. palm quick install, and press delete on your keyboard. It will ask you, are you sure. Say yes. Do the same thing for all keys below.
If you make a mistake, stop what you are doing. And call a PC technician.
BUT do not turn off your computer.
The reg keys are as follows (Note: some of theses reg keys will not be here
but if they are delete them)
* HKEY_CURRENT_USER\Software\U.S. Robotics\Palm Quick Install
* HKEY_CURRENT_USER\Software\U.S. Robotics\PalmOne File Transfer
* HKEY_CURRENT_USER\Software\U.S. Robotics\Pilot Desktop
* HKEY_CURRENT_USER\Software\Palm
* HKEY_CURRENT_USER\Software\Palm, Inc.
* HKEY_CURRENT_USER\Software\PalmDesktopAutorun
* HKEY_CURRENT_USER\Software\palmOne
* HKEY_CURRENT_USER\Software\PalmSource
* HKEY_LOCAL_MACHINE\Software\PalmSource or anything else that says palm
Next reboot your computer.
Then reinstall your palm desktop from the CD and do a hotsync. Use the username that is on the handheld. -
Where are the files for the Backups that show up in About This Mac - Storage?
Where are the files for the Backups that show up in About This Mac - Storage?
My new Macbook Pro 13 retina has 1TB flash drive. But despite my TimeMachine being in a TimeCapsule my Macintosh HD shows 277 Gb of space has Backups. What is this for? How can I delete it?OS X Lion and newer Mac OS X versions create local snapshots in portable Macs if Time Machine is enabled. See > http://pondini.org/TM/30.html
You don't have to worry about. They are stored in a kind of volume named "MobileBackups", but they appear as stored in your hard drive. To delete them, open System Preferences > Time Machine, and turn off Time Machine. Then, turn it on. However, you don't need to delete them, as they will be deleted when your hard drive gets full -
Creating ABAP Unit Tests for Report Programs
How can we create ABAP unit test for report programs.
Please explain the steps?Hi Devendra.
I would like to suggest some references which are as below:
[SAP HELP - Complete ABAP unit|http://help.sap.com/saphelp_nw04/helpdata/en/a2/8a1b602e858645b8aac1559b638ea4/frameset.htm]
[SDN - Reference for ABAP unit testing|about unit testing;
Hope that's usefull.
Good Luck & Regards.
Harsh Dave
Edited by: Harsh Dave on Jul 14, 2008 2:13 PM
Edited by: Harsh Dave on Jul 14, 2008 2:20 PM -
Is there any script or batch program that can pick a xml file...
Hi,
Is there any script or batch program that can pick a .xml file from a folder and place it in a different folder on the same directory periodically without using an XI interface.
Thanks,
npHi Nadini,
Please refer below link for how to sechdule a batch file.
[Schedule Batch File-How to?|http://www.tech-archive.net/Archive/WinXP/microsoft.public.windowsxp.general/2006-04/msg01349.html]
And please refer below links for how to write a batch file and other one as batch file commands.
http://www.wikihow.com/Write-a-Batch-File
http://www.aumha.org/a/batches.php
these two links was a click away in google :).
regards
Aashish Sinha -
I have created a Muse site for a client that wishes to host with Business Catalyst. How do I publish the site with their account rather than using one of my free sites? This is so I can keep my free ones for personal projects but also so they can pay for their own hosting. I am happy to set it all up for them but not sure what to do.
Hi
You can use their BC login details and use them , which on publish the site will be under their account.
Please change the BC login from Edit > Preferences > Publish > Switch Accounts , for Mac it would Adobe Muse > Preferences
Thanks,
Sanjit -
Looking for a program that updates my external HD
I have all my music on a seperate external HD. I looking for a program that will update the drive when i purchase or add music to my main Mac. Ideally it will happen automatically when i attach the drive to my Mac. thanks
We would have been better able to provide advice if you'd said that up front.
Here are some additional sync utilities:
syncOtunes
TuneRanger
SuperSync
Syncopation -
Apple should have a file for stolen iPods that prevents iTune activation.
Apple should have a file for stolen iPods that prevents iTune activation. This would provide at least some deterrent or frustration for the SOB who steals. Mine was stolen: Serial number: 8M9086ZX2C7....just in case someone sees it....Oh and it has my name engraved on the back.
These links may be helpful.
How to Track and Report Stolen iPad
http://www.ipadastic.com/tutorials/how-to-track-and-report-stolen-ipad
Reporting a lost or stolen Apple product
http://support.apple.com/kb/ht2526
Report Stolen iPad Tips and iPad Theft Prevention
http://www.stolen-property.com/report-stolen-ipad.php
How to recover a lost or stolen iPad
http://ipadhelp.com/ipad-help/how-to-recover-a-lost-or-stolen-ipad/
How to Find a Stolen iPad
http://www.ehow.com/how_7586429_stolen-ipad.html
Apple Product Lost or Stolen
http://sites.google.com/site/appleclubfhs/support/advice-and-articles/lost-or-st olen
Oops! iForgot My New iPad On the Plane; Now What?
http://online.wsj.com/article/SB10001424052702303459004577362194012634000.html
How to Find Your iPad Serial Number
http://www.ipadastic.com/tutorials/how-to-find-your-ipad-serial-number
Cheers, Tom -
I want to create a cover page for a document that is not included in the page count. How can I do this?
Menu > Insert > Section Break at bottom of cover page.
click in following page > Inspector > Layout > Section > Page Numbers > Start at: 1
Peter -
Bpel deployment fails for all processes that have revision other than 1.0.
Using: Release *10.1.3.3.1*
Hello All,
Bpel deployment fails for all processes that have revision other than *1.0*.
We have been attempting to deploy several BPEL projects via ANT script to a target environment and are encountering failures to deploy for every project which isn’t a (revision 1.0). We are getting the following error whenever we try to deploy a process with a revision other than 1.0:
D:\TJ_AutoDeploy\BPEL_AutoDeploy_BETA\build.xml:65: BPEL archive doesnt exist in directory "{0}"
at com.collaxa.cube.ant.taskdefs.DeployRemote.getJarFile(DeployRemote.java:254)
at com.collaxa.cube.ant.taskdefs.DeployRemote.deployProcess(DeployRemote.java:409)
at com.collaxa.cube.ant.taskdefs.DeployRemote.execute(DeployRemote.java:211)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
at org.apache.tools.ant.Main.runBuild(Main.java:668)
at org.apache.tools.ant.Main.startAnt(Main.java:187)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
The structure of our automated deployment script is as follows:
First, a batch script calls (Jdeveloper_BPEL_Prompt.bat) in order to set all necessary environment variables i.e. ORACLE_HOME, BPEL_HOME, ANT_HOME, etc for ant.
Next, the script lists every .jar file within the directory to an .ini file called BPEL_List.ini. Furthermore, BPEL_DIR, ADMIN_USER and ADMIN_PSWD variables are set and initialized respectively to:
- “.” – point to directory where script is running from because all the BPEL processes are located here
- “oc4jadmin”
- “*********” (whatever the password for out environment is)
We’ve developed a method to have the script prompt the user to select the target environment to deploy to. Once the user selects the appropriate environment, the script goes through the BPEL_List.ini files and a loop tells it that for every BPEL process listed:
DO ant
-Dprocess.name=%%b
-Drev= !Rev!
-Dpath=%BPEL_DIR%
-Ddomain=default
-Dadmin.user=%ADMIN_USER%
-Dadmin.password=%ADMIN_PWD%
-Dhttp.hostname=%HOST%
-Dhttp.port=%PORT%
-Dverbose=true
(What’s happening is that the variables in the batch file are being passed on to the ANT script where *%%b* is the process name, !rev! is revision #, and so on…)
The loop goes through each line in the BPEL_List.ini and tokenizes the BPEL process into 3 parts *(%%a, %%b, and %%c)* but we only extract 2 parts: *%%b* (process name) and *%%c* which becomes !Rev! (revision number).
Example:
Sample BPEL process:
bpel_ThisIsProcess1_1.0.jar
bpel_ThisIsProcess2_SOAv2.19.0.001B.jar
After tokenizing:
%%a %%b %%c
bpel ThisIsProcess1 1.0.jar
bpel ThisIsProcess2 SOAv2.19.0.001B.jar
*!Rev!* and not *%%c* because *%%c* will return whatever the revision number is + the “.jar” file extension as illustrated above. So to circumvent this, we parse *%%c* so that the last 4 characters are stripped. Such is done like this:
set RevN=%%c
set RevN=!RevN:~0,-4!
Hence, the usage of !Rev!.
Below is a screenshot post of the ANT build.xml that goes with our script:
<!--<?xml version="1.0"?>-->
<!--BUILD.XML-->
<project name="bpel.deploy" default="deployProcess" basedir=".">
<!--
This ant build file was generated by JDev to deploy the BPEL process.
DONOT EDIT THIS JDEV GENERATED FILE. Any customization should be done
in default target in user created pre-build.xml or post-build.xml
-->
<property name="process.dir" value="${basedir}" />
<!-- Set BPEL process name -->
<!--
<xmlproperty file="${process.dir}/bpel/bpel.xml"/>
<property name="process.name" value="${BPELSuitcase.BPELProcess(id)}"/>
<property name="rev" value="${BPELSuitcase(rev)}"/>
-->
<property environment="env"/>
<!-- Set bpel.home from developer prompt's environment variable BPEL_HOME -->
<condition property="bpel.home" value="${env.BPEL_HOME}">
<available file="${env.BPEL_HOME}/utilities/ant-orabpel.xml" />
</condition>
<!-- show that both bpel and oracle.home are located (TESTING purposes ONLY) -->
<!-- <echo>HERE:${env.BPEL_HOME} ${env.ORACLE_HOME}</echo> -->
<!-- END TESTING -->
<!--If bpel.home is not yet using env.BPEL_HOME, set it for JDev -->
<property name="oracle.home" value="${env.ORACLE_HOME}" />
<property name="bpel.home" value="${oracle.home}/bpel" />
<!--First override from build.properties in process.dir, if available-->
<property file="${process.dir}/build.properties"/>
<!--import custom ant tasks for the BPEL PM-->
<import file="${bpel.home}/utilities/ant-orabpel.xml" />
<!--Use deployment related default properties-->
<property file="${bpel.home}/utilities/ant-orabpel.properties" />
<!-- *************************************************************************************** -->
<target name="deployProcess">
<tstamp>
<format property="timestamp" pattern="MM-dd-yyyy HH:mm:ss" />
</tstamp>
<!-- WRITE TO LOG FILE #tjas -->
<record name="build_verbose.log" loglevel="verbose" append="true" />
<record name="build_debug.log" loglevel="debug" append="true" />
<echo></echo>
<echo>####################################################################</echo>
<echo>BPEL_AutoDeploy initiated @ ${timestamp}</echo>
<echo>--------------------------------------------------------------------</echo>
<echo>Deploying ${process.name} on ${http.hostname} port ${http.port} </echo>
<echo>--------------------------------------------------------------------</echo>
<deployProcess
user="${admin.user}"
password="${admin.password}"
domain="${domain}"
process="${process.name}"
rev="${rev}"
dir="${process.dir}/${path}"
hostname="${http.hostname}"
httpport="${http.port}"
verbose="${verbose}" />
<sleep seconds="30" />
<!--<echo message="${process.name} deployment logged to ${build_verbose.log}"/>
<echo message="${process.name} deployment logged to ${build.log}"/> -->
</target>
<!-- *************************************************************************************** -->
</project>
SUMMARY OF ISSUE AT HAND:
~ Every bpel process w/ 1.0 revision deploys with no problems
~ At first I would get an invalid character error most likely due to the “!” preceding “Rev”, but then I decided to set rev=”false” in the build.xml file. That didn’t work quite well. In another attempt, I decided to leave the –Drev= attribute within the batch script blank. That still led to 1.0s going through. My next thought was deploying something other than a 1.0, such as 1.2 or 2.0 and that’s when I realized that if it wasn’t a 1.0, it refused to go through.
QUESTIONS:
1. IS THERE A WAY TO HAVE ANT LOOK INTO THE BPEL PROCESS AND PULL THE REVISION ID?
2. WHAT ARE WE DOING WRONG? ARE WE MISSING ANYTHING?
3. DID WE GO TOO FAR? MEANING, IS THERE A MUCH EASIER WAY WE OVERLOOKED/FORGOT/OR DON’T KNOW ABOUT THAT EXISTS?
Edited by: 793292 on Jul 28, 2011 12:38 PMOnly thing i can think of is instead of using a MAC ACL , u cud jus use the default class
Policy Map Test
class class-default
police 56000 8000 exceed-action drop
Class Map match-any class-default (id 0)
Match any
You would be saving a MAC-ACL ;-). -
Creating Installer Files for SAP Programs
Hi All,
I have created one Z* transaction and I would like to create a installer file for this transaction. It includes tables, screens and reports and I would like to make it a installer file. All these objetcs are under one transport request. Any kind of help would be great in this regard.Hi,
There is no concept of installer files in SAP. You can only transport the request to a different system and can start running the transaction code in the system.
ABAP cannot be running as a stand alone EXE file, it needs the SAP environment.
REgards,
Ravi
Note : Please mark all the helpful answers
Maybe you are looking for
-
How should I cut out people on bicycles with a background of a forest?
Dear Everyone, I have an image of three people on bicycles in a forest - I need to cut the people/bicycles out of the background for use in a photo collage. Since the nooks and crannies in and around the bicycle are so small, I am not sure that even
-
How to pass wild card '%' value from the parameter to the query
Hello everyone, I have following 2 problems 1) I was trying to do some thing like below select * from emp where ename like 'J%' for this i have used the following code select * from emp where ename like :P_ENAME and before running the query in the pa
-
This is my first Mac, so I am not sure if I have missed something along the way. I really would appreciate any suggestions.....
-
.dxf to .fxd/z
I have used the Adobe Illustrator plugin to convert from .dxf to .fxd/z. Unfortunately the resulting file does not display in a simple JavaFX program. Is this a problem with the conversion process itself, or with the runtime? The source and target fi
-
When we scan to email using HP Director for our CM2320nf mfp Color Laser all in one, we need it to go to MS Outlook 2011 for Mac as default. There is no option in HP Director preferences to select Outlook. The only 2 options are Mail (Mac Mail), or E