Creating War , not Jar file.

I am trying to create my EJB and i created my web project. The problem seems that my JBoss will not recognize and deploy my table perhaps due to the structure of the war file.
My entities are working perfectly as they work, and have already been tested.
ANyway, what i want is some help into getting my build.xml into making a jar file and sending that one instead of the the war file..
Can someone please let me a link of where i should look ? Or what i should include in the xml file in order to create the file
sTevoo.
P.s - I am using netbeans 6
Ps - I wasnt sure if i had to post here or in the Deploying - Java Archive (JAR) Files

  <property name="jboss.deploy.dir" value="/home/stevoo/jboss-4.2.2.GA/server/default/deploy"/>
    <property name="librarydir" value="${basedir}/lib"/>
    <property name="src.dir" value="src"/>
    <property name="build.dir" value="build"/>
    <property name="dist.dir" value="dist"/>
    <property name="bin.dir" value="bin"/>
    <target name="prepare">
        <delete dir="${bin.dir}"/>
        <mkdir dir="${bin.dir}"/> 
        <mkdir dir="${bin.dir}/META-INF"/>
    </target>
    <!--Set Libs-->
    <path id="libraries">
        <fileset dir="${librarydir}">
            <include name="*.jar"/>
            <include name="*.zip"/>
        </fileset>
    </path>
    <target name="compile1" depends="prepare">
        <javac srcdir="${src.dir}" destdir="${bin.dir}">
            <classpath refid="libraries"/>
        </javac>
        <echo message="Compile ...." />
    </target>
    <target name="compile" depends="compile1">
        <copy file="${src.dir}/conf/log4j.properties" todir="${bin.dir}/META-INF/"/>
        <copy file="${src.dir}/conf/MANIFEST.MF" todir="${bin.dir}/META-INF/"/> 
        <copy file="${src.dir}/conf/persistence.xml" todir="${bin.dir}/META-INF/"/>
        <jar basedir="${bin.dir}" destfile="${dist.dir}/test.jar"/>
        <echo message="Build...." />
    </target>
    <target name="run" depends="compile">
        <copy file="${dist.dir}/test.jar" todir="${jboss.deploy.dir}"/> 
        <echo message="Run ... ${jboss.deploy.dir}"/>
    </target>
    After a whole day of changing and tweaking and all .... this sort of works.
Some more tweakong and done.
Just in case any one else wants this,,,

Similar Messages

  • Are JDev autogenerated paths needed to create ear, war and jar files ?

    Hi
    We want to create ear, war and jar files from Ant build script generated from JDeveloper 11.1.1.7.
    We also like to use ojdeploy with it.
    In the process of creating build.xml files from projects, we see these paths.
    We also have standalone Weblogic installed with ADF runtime 11.1.1.7
    Questions:
    1- Do we need these path ids to generate ear, jar, war files properly and then deploy the ear to our standalone Weblogic so that our webapp can run ok ?
    2- Why are they generated, if they are not needed
    From research, it appears that we don't need these paths except to keep ant targets of init, compile, exec etc with ojdeploy.
    3- Is that true ?
    We are afraid that because no paths are listed in the build.xml, then when we deploy the ear app, it cant use the ADF runtime on the standalone WLS.
    Thanks in advance for answering.
    Sincerely
    eg of paths generated below:
      <path id="library.SOA.Designtime"/>
      <path id="library.SOA.Runtime"/>
      <path id="library.BPEL.Runtime"/>
      <path id="library.Mediator.Runtime"/>
      <path id="library.MDS.Runtime">
        <pathelement location="{oracle.middleware}/oracle_common/modules/oracle.mds_11.1.1/mdsrt.jar"/>
      </path>
      <path id="library.BC4J.Service.Runtime">
        <pathelement location="{oracle.middleware}/oracle_common/modules/oracle.adf.model_11.1.1/adfbcsvc.jar"/>
        <pathelement location="{oracle.middleware}/oracle_common/modules/oracle.adf.model_11.1.1/adfbcsvc-share.jar"/>
        <pathelement location="{oracle.middleware}/oracle_common/modules/commonj.sdo_2.1.0.jar"/>
        <pathelement location="{oracle.middleware}/modules/org.eclipse.persistence_1.1.0.0_2-1.jar"/>
        <pathelement location="{oracle.middleware}/oracle_common/modules/oracle.webservices_11.1.1/wsclient.jar"/>
        <pathelement location="{oracle.middleware}/oracle_common/modules/oracle.web-common_11.1.1.jar"/>
      </path>
      <path id="library.TopLink">
        <pathelement location="{oracle.middleware}/modules/com.oracle.toplink_1.0.0.0_11-1-1-5-0.jar"/>
        <pathelement location="{oracle.middleware}/modules/org.eclipse.persistence_1.1.0.0_2-1.jar"/>
        <pathelement location="{oracle.middleware}/modules/com.bea.core.antlr.runtime_2.7.7.jar"/>
        <pathelement location="{oracle.middleware}/modules/javax.persistence_1.0.0.0_2-0-0.jar"/>
      </path>
      <path id="library.Oracle.Rules"/>
      <path id="classpath">
        <path refid="library.SOA.Designtime"/>
        <path refid="library.SOA.Runtime"/>
        <path refid="library.BPEL.Runtime"/>
        <path refid="library.Mediator.Runtime"/>
        <path refid="library.MDS.Runtime"/>
        <path refid="library.BC4J.Service.Runtime"/>
        <path refid="library.TopLink"/>
        <path refid="library.Oracle.Rules"/>
      </path>

    There are two different things here. Using ant to build the class files and then building an ear from the class files and other resources.
    The building part needs the libraries if you use javac as compiler. Building an ear file only needs the path to the jar files which are packed into the ear.
    In this sense you need the pages you see in the build.xml.
    Then Jdev offers another way: ojdeploy. This tool is a Jdev without a gui.
    You can use this tool and build the classes for each project of a workspace and to build build war and ear file. This is just like you click the rebuild button for each project and then the deploy the projects and application. If you use this approach you don't need the generated path ids as the whole build process is done inside Jdev as it's done on your developer pc.
    Timo

  • How to create a client jar file???

    How do I create a client jar file for the client program? Please see my attached
    ejb-jar.xml. I compiled the my EJB and deployed it successfully. However, I couldn't
    find the client jar anywhere. I use the weblogic admin console DD editor, I can
    see that the edit field has been populated with my client jar file name defined
    in the ejb-jar.xml. However, I searched entire system, I could not locate this
    jar anywhere.
    How do I do that? If someone knows how to do it, please let me know. Thank you
    very much.
    [ejb-jar.xml]

    How do I create a client jar file for the client program? Please see my attached
    ejb-jar.xml. I compiled the my EJB and deployed it successfully. However, I couldn't
    find the client jar anywhere. I use the weblogic admin console DD editor, I can
    see that the edit field has been populated with my client jar file name defined
    in the ejb-jar.xml. However, I searched entire system, I could not locate this
    jar anywhere.
    How do I do that? If someone knows how to do it, please let me know. Thank you
    very much.
    [ejb-jar.xml]

  • Creating a simple jar file

    I am trying to create a simple jar file for a swing application. I have used some third party api in the application.
    However when i create a jar of the application using JDeveloper it seems to add all the third party class files too into the jar which i definately dont want. How do i do the same.

    I presume you used a JAR deployment profile. Check the profile settings under "Dependency Analyzer". You might have checked there some jars you don't want to be included in the final package and the option "Include all of their contents..." is selected. Uncheck the ones you do not want to be included in the output archive.
    Florin

  • Unable to create an executable jar file

    Hi,
    I am unable to create an executable jar file,
    I am using the command as follows:
    C\> jar cvfm MyJarName.jar manifest.txt Demo.class
    where as Demo.class has appropriate main method; manifest.txt contains [ Main-Class: Demo ] and a new line
    Please help.
    thanks & regards
    M K Rayapudi
    Edited by: R6i on Apr 30, 2009 5:15 AM

    Your jar is perfectly generated, but your machine has a problem with .jar file associations.
    You have two options:
    1. Play with the registry. Dangereous if you are not used to.
    2. Reinstall the jre.
    Just to verify my theory, open a command prompt and the command:
    reg query HKCR\jarfile\shell\open\command
    What does it say? I have executed your command , here is the output
    HKEY_CLASSES_ROOT\jarfile\shell\open\command
        (Default)    REG_SZ    "C:\Program Files\Java\jre6\bin\javaw.exe" -jar "%1" %*I am not getting anything from this command, can you please explain clearly.
    thanks & regards
    M K Rayapudi
    Edited by: R6i on May 3, 2009 10:18 PM

  • Dreamweaver cs4 or mx2004 may built .war or .jar files for deployment in a jsp server (Tomcat) ? If no, and use Dreamweaver  how do these files ?

    Dreamweaver cs4 or mx2004 may built .war or .jar files for deployment in a jsp server (Tomcat) ? If no, and use Dreamweaver  how do these files ?

    if I use Eclipse IDE for compilation[make *.war & *.jar files from *.java like claimBeans.java], I must use also Eclipse for upload/deploy ? Or for upload ONLY I may use and dreamweaver ? The jsp section of dreamweaver, is for app not require compilation, like from Code from:JSP STANDARD TAG LIBRARY , only ?
    Basically whatever I may do with "JavaBeans", "Servlets" etc (*.java files) needed to get compiled, I may also do it with JSP STANDARD TAG LIBRARY etc NOT NEEDED Compilation, so if I do not understand how to compile&deploy *.war & *.jar files , I may use instead the latter way ?

  • Creating an exacutable jar file in netbeans

    Hey, how can i create an exacutable jar file in netbeans ?

    i guess you already have a project created, if you don't create a new java application project.
    Then you need to do the following:
    1. Set the main class. This is the class that will run first.
    for this you need to right click in the project node, select properties, then run and in the Main Class field put the main class.
    2. Set the classpath: you need to put all the libraries or resources you use in your project.
    to do that right click the libraries node, select properties, then add library and add all the libraries that your project needs
    by doing this steps netbeans will create your manifest file and the jar that will create will be executable.
    Hope this helps.
    Escobar5

  • Strip classes actually  used in a jar file to create a smaller jar file?

    I am creating a applet using java3d and the jar files add up to over 4meg ( j3dcore.jar j3dutils.jar vecmath.jar). Is there a way you can strip out only the classes your applet uses and create a smaller jar file so that the download isn't as big? Currently takes a long while for the applet to start because it downloads the Java 3D library in its entirety.

    Most likely those classes that you use also use other classes that you don't use ...

  • How to create a running jar-file

    I created a "Java Class Library" project including 20 class files in several packages and some libraries.
    Because I would like to start the project from the console, I added the main-class property (right-click project, Properties, Run). Then I cleaned and built the project and tried to start it with the following command:
    java -jar PROJECTNAME.jarBut it won't work, because the archive is not complete: MANIFEST.MF lacks the main-class and all involved libraries.
    I managed to add the main-class attribute manually, but adding all library references seems to be very error-prone.
    So does anyone know if I did something wrong or if this is a bug of Creator?
    Regards,
    Felix

    The main intent of this project type is to provide a libraray which normally wouldn't run with a "main". I suggest you use NetBeans to create a "Java Application" project. Here's what is in the README.txt file produced with the jar. This looks like what you're looking to do. So you can create the Jar in NetBeans then if you want to use it in Java Studio Creator, you can add it to the Creator project. Also, if you caught the news at JavaOne, we are providing Creator features for a pack that will run in NetBeans so you won't have to switch back and forth between the tools. Keep an eye on the NetBeans and Creator web sites for more info.
    Thanks!
    -David
    README.txt
    ========================
    BUILD OUTPUT DESCRIPTION
    ========================
    When you build an Java application project that has a main class, the IDE
    automatically copies all of the JAR
    files on the projects classpath to your projects dist/lib folder. The IDE
    also adds each of the JAR files to the Class-Path element in the application
    JAR files manifest file (MANIFEST.MF).
    To run the project from the command line, go to the dist folder and
    type the following:
    java -jar "JavaApplication3.jar"
    To distribute this project, zip up the dist folder (including the lib folder)
    and distribute the ZIP file.
    Notes:
    * If two JAR files on the project classpath have the same name, only the first
    JAR file is copied to the lib folder.
    * If the classpath contains a folder of classes or resources, none of the
    classpath elements are copied to the dist folder.
    * If a library on the projects classpath also has a Class-Path element
    specified in the manifest,the content of the Class-Path element has to be on
    the projects runtime path.
    * To set a main class in a standard Java project, right-click the project node
    in the Projects window and choose Properties. Then click Run and enter the
    class name in the Main Class field. Alternatively, you can manually type the
    class name in the manifest Main-Class element.

  • Creating a weblogic.jar file?

    I am looking to minimize my client size java app, which makes use of EJBs.
    I am using the verboseToZip utility that is described at:
    http://www.weblogic.com/docs51/techdeploy/verbosetozip.html
    It has reduced the size of the jar from 35MB to about 700K. The application
    has problems starting up, however. I get the exception shown below. Any
    idea what this means? I looked in the jar file, and sure enough there are
    classes in a directory named: com/rsa/jsafe. The error occurs when getting
    the EJB home object (at the start of the application).
    Thanks,
    Mike
    ------------------------------------------Exception-------------------------
    Exception in thread "main" java.lang.NoClassDefFoundError:
    COM/rsa/jsafe/JSAFE_InvalidUseException
    at
    weblogic.security.WLMessageDigest.getInstance(WLMessageDigest.java:53)
    at
    weblogic.security.MD5RandomBitsSource.seed(MD5RandomBitsSource.java:56)
    at weblogic.rjvm.LocalRJVM.<init>(LocalRJVM.java:108)
    at weblogic.rjvm.LocalRJVM.getLocalRJVM(LocalRJVM.java:85)
    at weblogic.rjvm.RJVMManager.getLocalRJVM(RJVMManager.java:89)
    at weblogic.rjvm.RJVMManager.initialize(RJVMManager.java:78)
    at weblogic.kernel.Kernel.ensureInitialized(Kernel.java:137)
    at weblogic.rjvm.ServerURL.findOrCreateRJVM(ServerURL.java:182)
    at
    weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialCon
    textFactoryDelegate.java:195)
    at
    weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialCon
    textFactoryDelegate.java:148)
    at
    weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFact
    ory.java:123)
    at
    javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:668)
    at
    javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:246)
    at javax.naming.InitialContext.init(InitialContext.java:222)
    at javax.naming.InitialContext.<init>(InitialContext.java:198)
    at
    com.ecocap.daemon2.dbthread.setupContextAndObjects(dbthread.java:1064)
    at com.ecocap.daemon2.dbthread.<init>(dbthread.java:48)
    at com.ecocap.daemon2.DaemonFrame.<init>(DaemonFrame.java:45)
    at com.ecocap.daemon2.daemon.<init>(daemon.java:27)
    at com.ecocap.daemon2.daemon.main(daemon.java:184)

    Don,
    Thanks for responding so quickly. You are correct - I am on Windows. I
    didn't realize it was a case sensitivity problem. Anyway, I took your third
    option, since it was the least painful for me and everything worked.
    Thanks,
    Mike
    "Don Ferguson" <[email protected]> wrote in message
    news:[email protected]...
    Let me guess: this is on Windows. I bet the problem concernscase-insensitive
    file names. When creating the client jar, a "com" directory was created.When
    it came time for the COM directory, Windows just treated it as equivalentto
    "com". However java does not. There are a variety of solutions:
    a) use Unix to build the client jar
    b) use ant to extract the appropriate subset of classes from weblogic.jarwhen
    creating the client.jar (bypassing the filesystem).
    c) move the COM stuff to a separate directory tree, and use somecombination of
    jar -C or jar -u to create the client.jar.
    Don
    Michael DiChiappari wrote:
    I am looking to minimize my client size java app, which makes use of
    EJBs.
    I am using the verboseToZip utility that is described at:
    http://www.weblogic.com/docs51/techdeploy/verbosetozip.html
    It has reduced the size of the jar from 35MB to about 700K. Theapplication
    has problems starting up, however. I get the exception shown below.Any
    idea what this means? I looked in the jar file, and sure enough thereare
    classes in a directory named: com/rsa/jsafe. The error occurs whengetting
    the EJB home object (at the start of the application).
    Thanks,
    Mike
    ------------------------------------------Exception-------------------------
    Exception in thread "main" java.lang.NoClassDefFoundError:
    COM/rsa/jsafe/JSAFE_InvalidUseException
    at
    weblogic.security.WLMessageDigest.getInstance(WLMessageDigest.java:53)
    at
    weblogic.security.MD5RandomBitsSource.seed(MD5RandomBitsSource.java:56)
    at weblogic.rjvm.LocalRJVM.<init>(LocalRJVM.java:108)
    at weblogic.rjvm.LocalRJVM.getLocalRJVM(LocalRJVM.java:85)
    at weblogic.rjvm.RJVMManager.getLocalRJVM(RJVMManager.java:89)
    at weblogic.rjvm.RJVMManager.initialize(RJVMManager.java:78)
    at weblogic.kernel.Kernel.ensureInitialized(Kernel.java:137)
    at weblogic.rjvm.ServerURL.findOrCreateRJVM(ServerURL.java:182)
    at
    weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialCon
    textFactoryDelegate.java:195)
    at
    weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialCon
    textFactoryDelegate.java:148)
    at
    weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFact
    ory.java:123)
    at
    javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:668)
    at
    javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:246)
    at javax.naming.InitialContext.init(InitialContext.java:222)
    at javax.naming.InitialContext.<init>(InitialContext.java:198)
    at
    com.ecocap.daemon2.dbthread.setupContextAndObjects(dbthread.java:1064)
    at com.ecocap.daemon2.dbthread.<init>(dbthread.java:48)
    at com.ecocap.daemon2.DaemonFrame.<init>(DaemonFrame.java:45)
    at com.ecocap.daemon2.daemon.<init>(daemon.java:27)
    at com.ecocap.daemon2.daemon.main(daemon.java:184)

  • Creating an executable jar-file including a custom package

    I am trying to learn how to create executable jar-files. I have managed this with a single class. However having a class which is an extention of another class which in turn belongs to custom package, I can't make it work.Running the program normally is not a problem. I don't think the problem is the actual code, but I will include it here anyway. I create the jar-file using:
    jar -cmf Direkt2b.txt Direkt2b.jar *.class
    where Direkt2b.txt is just:
    Main-Class: Diriekt2b
    Only the main class-file is included this way. Copying the other file to the same directory before creation doesn't help either. There is no error messages, the jar-file just refuses to run no matter what.
    The main-class:
    import java.awt.*;
    import extra.*;
    class Direkt2b extends ExtendedFrame {
         Font f;
         Direkt2b() {
              f = new Font("SansSerif", Font.BOLD, 24);
              setBackground(Color.yellow);
              setSize(400,150);
         public void paint(Graphics g) {
              g.setFont(f);
              g.setColor(Color.blue);
              g.drawString("V?lkommen till Java Direkt", 45, 100);
         public static void main (String[] arg) {
              Direkt2b d2 = new Direkt2b();
              d2.setVisible(true);
    The help-class:
    package extra;
    import java.awt.*;
    import java.awt.event.*;
    public class ExtendedFrame extends Frame {
         private static boolean first = true;
         private boolean isFirst = first;
         public ExtendedFrame() {
              addWindowListener(theListener);
              first=false;
         WindowAdapter theListener = new WindowAdapter () {
              public void windowClosing(WindowEvent e) {
              dispose();
              if (isFirst)
                   System.exit(0);
    }

    My problem wasn't really getting more than one class in a jar-file,
    but rather that my jar-file with multiple classes wouldn't execute.
    Reading the original post I realized that maybe I was unclear about that.
    However I have solved the problem now so for anybody reading this
    thread in the future I will tell you how.
    The general setting is this: You have a bunch of self-made help-classes
    organized in some classdirectory somewhere in the filesystem. You use these
    in your programming from time to time. You have set a classpath-varible
    in your OS such that Java could find your help-classes.
    Now you want to create executable jar-files so that you could publish your work.
    My problem was that while I added all needed classes in a jar-file, the main-class
    couldn't find the others because they were referenced incorrectly. The solution I
    came up with may not be elegant, but it works. I copied the main-class and all directories
    (only one in my case) just as they appear in the classpath-directory, to the same temporary
    directory. Then I created the jar-file from there, using: jar -cmfv Direkt2b.txt Direkt2b.jar Direkt2b.class extra/*.class
    I suspected that incorrect referencing was the problem and I tried several variations on the theme above
    before giving up and writing the first post. Part the problem was that I didn't get any error messages,
    just an annoying error-sound double-clicking the jar-file. I learned later that you could run jar-files from
    the command -prompt using: java -jar myjarfile.jar. This way you get a more useful response.
    I guess there is a way to include the classpath instead somehow, but I will use my method for now.
    I hope this was helpful to somebody.

  • How do I create an executable JAR File ?

    Hi,
    Let's say I have several Class Files that perform a special task.
    How do I bundle them in a JAR file and make it executable, so that the user simply types "prog.jar" and is happy.
    I wonder how that works, as I have to tell the starting point for execution.
    Does anybody now ?
    cu
    Oliver

    Three importants things to do :
    - don't forget to indicate in your manifest.mf the main class and the pacckage
    ex:
    Manifest-Version: 1.0
    Main-Class: mypackage.MyMainClass
    Created-By: 1.3.0 (Sun Microsystems Inc.)
    - don't forget to associate the .jar file with the application java.exe -jar -classpath %CLASSPATH%
    - don't forget to set the environment CLASSPATH correctly
    Hope this help
    Jean

  • Creating an Executable jar file

    Hello ! I have a application that has been fully developed and all i want to do is to create an executable file using my own icon so that whenever it is double clicked it opens up the appliation.
    Please provide an example fro easy refrence.
    Thanks

    i have the procedure for creating executable jar file in a separate file.
    if u r interested then mail me at:
    [email protected]
    regards
    Md. Afroze

  • Create a complete jar file with jscreator

    Please provide all details for creating a jar file with jscreator for this 77 year old puzzle creator

    Hi,
    I would suggest switching to NetBeans IDE. It allows for the following:
    - Ability to run with latest JDK release
    - Enabled with the latest Java technologies
    - Support for a greater number of application servers
    The following will help with migration (if you already have a project setup in Creator)
    http://www.netbeans.org/kb/60/web/creator-migration.html
    Also, the following article describes how to create and Distribute Executable JAR Files in NetBeans
    http://www.netbeans.org/kb/articles/javase-deploy.html
    NetBeans website for downloads and other information;
    http://www.netbeans.org/index.html

  • Creating Pages using jar file

    When I wrap up my JAR file (contains JSPs and classes) and use the portal interface to upload to a JAR file and point to the main JSP page - when I run it, it cannot find the class files that should be wrapped inside the JAR file. I can't find ANY documentation on how to do this, so any help would be appreciated. Thanks.

    From the PDK article Java Server Pages Support In Oracle9iAS Portal, located on Portal Center:
    In the current version of Portal, the support for JAR files is limited to the JAR files that have a set or combination of JSP pages, HTML files, and image files. No class files placed in a JAR file will be recognized by the container. As a workaround, you can put your class files in the /WEB-INF/classes directory.

Maybe you are looking for