Junit and Ear file

I have a ear file **
and want to write junit test cases for some classes in the ear.
the ear file has the following structure:
->ear
----> ejb.jar
----> utils.jar
----> some.jar
----> app-inf
------------> lib/third.jar
----> meta-inf
----------->application.xml
Q1) Do i have to have the ear file running inside the container to test it?
Q2) I just want to write test case for some standalong classes in utils.jar..but
when i run juni ant task with classpath=ear , its gives classnot found, alghouth
the uitls.jar is part of the ear?
please help.
thanks

Hi,
"java guy" <[email protected]> wrote in message news:[email protected]..
I have a ear file **
and want to write junit test cases for some classes in the ear.
the ear file has the following structure:
->ear
----> ejb.jar
----> utils.jar
----> some.jar
----> app-inf
------------> lib/third.jar
----> meta-inf
----------->application.xml
Q1) Do i have to have the ear file running inside the container to test it?Yes if you are going to test classes that require to run within a container.
Such classes could be EJB and servlets.
Q2) I just want to write test case for some standalong classes in utils.jar..but
when i run juni ant task with classpath=ear , its gives classnot found, alghouth
the uitls.jar is part of the ear?EAR itself is a JAR file. Java classloader does not look for classes
in jars that are packaged in to a jar.
To test your utility jar you should place/access it outside of the EAR.
Regards,
Slava Imeshev

Similar Messages

  • I have a created a directory structure ias\ias-samples\myapps\src\docroot.In docroot folder i have a single jsp.i created a war file having that jsp,and ear file having the war file

    I deployed the ear file.Now i try calling http://localhost/myapps/test.jsp ??
    i'm i doing the right thing ?

    Hi,
    This is right provided you have installed the webserver & app server
    on the same machine and the port number for the web server is 80 by
    default.
    Regards
    Raj
    Arif Khan wrote:
    I have a created a directory structure
    ias\ias-samples\myapps\src\docroot.In docroot folder i have a single
    jsp.i created a war file having that jsp,and ear file having the war
    file
    I deployed the ear file.Now i try calling
    http://localhost/myapps/test.jsp ??
    i'm i doing the right thing ?
    Try our New Web Based Forum at http://softwareforum.sun.com
    Includes Access to our Product Knowledge Base!

  • Difference between .jar, .war and .ear file

    Hi,
    I am pretty new to J2EE technology.
    I would like to know what is the difference between .jar, .war and .ear files and how they are deployed on webserver.
    Thanks,

    Files with a .jar extension or JAR files, are essentially just a collection of files compressed using the ZIP/ZLIB compression format.
    JAR (short for Java Archive) files were introduced in the early days of Java as a means to conveniently package and distribute Java applications and components. Since then, a number of additions to the Java platform have followed suit. The introduction of the EAR file is one such addition.
    An EAR (Enterprise Archive) file is a JAR file that contains a J2EE application.
    A J2EE application is a group of Web modules that collectively perform as a single entity.
    A Web Module is an entity consisting of one or more resources such as HTML files, Java class files, XML files, etc. Web Modules are packaged in Web Archive (WAR) files.
    Looking at it from a top-down view, EAR files contain JAR files and WAR files. Packaging resources in WAR files, JAR files and eventually EAR files, makes it easy to reuse and reassemble components as new J2EE applications and distribute them to new environments.
    For example, Tomcat deals only with WAR files.
    So, in order to auto-deploy a Web application to a Tomcat environment, you must place an application's WAR file in the appropriate directory or use Tomcat's deployment tools to manually deploy the file.
    If you already have an EAR file that contains the WAR file, you can extract the WAR file and use it as is. If you do not have the EAR file or the WAR file, you can use any number of compliant tools to create the WAR file. Tomcat is a servlet/JSP container available from the jakarta.apache.org site.

  • Difference between .war file and .ear file

    Hi,
    what is the difference between .war file and .ear file ?
    Please let me know with appropriate explanation.

    War file means web application archive. It is archived file having a collection of JSP, servlets and static pages that together costitute a web application. It contains one WEB-INF directory which will have a file named web.xml which defines the structure of the web application.
    On the other side EAR file is Enterprise application archive. It is file having packaged content of one or more modules into a single archive so that the deployment of all the modules can be done simultaneously on the application server. It also contains XML files called deployment descriptors which gives the details of the deployment method. This deployment descriptor will be present in the folder META-INF folder.
    So the main difference betwwen the two is that Ear file is having collection of various modules to be deployed on the application server while the WAR file is used to deploy the web applications.

  • Porting *.war files and *.ear files to Weblogic 10.3

    If we can figure this issue out, I'll see if I can't publish/post a
    maven-based solution in the Maven and Oracle forums so that others
    will not have to go through our pain.
    We are having all the usual problems regarding where Weblogic expects
    to find things and what exclusions need to be made in weblogic.xml for
    war files and weblogic-application.xml for ear files. Any insights
    would be deeply appreciated.
    Here is what our exploded war structure currently looks like.
    |____index.jsp
    |____WEB-INF
    | |____lib
    | | |____...a long list of jar files
    | |____tags
    | | |____...a short list of tag files
    | |____applicationContext.xml
    | |____web.xml
    | |____content
    | | |____...a bunch of jsps
    | |____tlds
    | | |____...some tlds
    | |____classes
    | | |____mailProperties.properties
    | | |____struts.xml
    | | |____logback.xml
    | | |____com ... the root of our class heiarchy
    |____images
    | |____...a list of images
    |____META-INF
    | |____maven
    | | |____com
    | | | |____project-name
    | | | | |____pom.xml
    | | | | |____pom.properties
    | |____MANIFEST.MF
    |____script
    | |____...some java script files
    |____style
    | |____...some css files
    Exceptions when trying to deploy are as follows:
    INFO: ... initialized Struts-Spring integration successfully
    java.lang.Exception: Could not load
    servers/AdminServer/tmp//appmergegen_1254502686535_OurApp/war/WEB-INF/classes/com...
    at com.opensymphony.xwork2.util.finder.ClassFinder.readClassDef(ClassFinder.java:745)
    at com.opensymphony.xwork2.util.finder.ClassFinder.<init>(ClassFinder.java:148)
    The exception above repeats for every .class file found below
    WEB-INF/classes/com, i.e. the the ones in this module rather than the
    ones in included modules.
    Checking the file system shows that there is no such directory as
    "appmergegen_1254502686535_conap". I'm uncertain if there is actually
    supposed to be anything there, but it would seem like it.
    I've a theory that if we can solve the above issue, we can solve the
    rest ourselves.
    It would also be handy to know what packages may cause conflicts.

    Alright, my research points to the idea that this might have something to do with staging. Since this is a dev setup we don't have any managed servers or anything. All we have is AdminServer and that is it. We have only one domain and it is "base_domain". Does anyone know if this is wrong?

  • Java proxy and EAR file in NDS

    Hi,
    I'm new in java and also proxy development and I need some help
    I have followed the pdf how to create java proxies in 3.0.
    But i have some doubts:
    Must I delete aii*.jar libraries from the EAR create?
    I have no other .jar archive in that .ear... why? I suppose that is not correct and why my EJB module .jar is not included?
    Thanks
    carme,

    Hi, Shabarish
    I have followed the same steps point out in this two blogs.
    I recreated all my EJB project and application.
    The EAR file created only contains:
    guidgenerator.jar
    aii_utilxi_misc.jar
    aii_proxy_xirt.jar
    aii_msg_runtime.jar
    sda-dd.xml
    application-j2ee-engine.xml
    application.xml
    Sap_manifest.mf
    Manifest.mf
    and also a file WITHOUT NAME and size 0.
    That is not correct... right?

  • Is there a maximum size for and EAR file?

    I'm using Jdeveloper 10.1.3.3.0. I've used it to deploy to OAS before with success. This past week I added a ton of content to the site. Now when I deploy the ear file is over 1GB. It used to be 120MB. During the deploy process the log shows "Deployment Incomplete". I never get the dialog box to complete the deployment (i.e. to undeploy the app then finish deployment).
    I've checked the disk space on OAS and have 7GB free.
    Is there some adjustment that I need to make? Is there a size limit? If so, how do I get my content on to the site?
    TIA,
    Dave

    Update on manually deploying my application.
    On OAS:
    I tried uploading from local machine to server in step 2 but after 10 minutes or so it had appeared to hang.
    I retried after manually copying the file to the server. In this case I got to step 2 where I set application attributes. On step 3 I left defaults and clicked deploy. In the progress message window after the Unpacking ...ear message I received error message:
    Operation failed with error: java.lang.OutOfMemoryError.
    I'm sure that I can increase memory to the compiler with a command line flag. Finding the command line though...
    It looks like the /tmp directory size is part of the problem. It's only .9GB.
    Note:
    On the jdeveloper side when I deployed to EAR I checked the compress flag. That reduced the overall size by 150MB.
    Regards,
    Dave
    Edited by: dgress on Jan 7, 2009 11:37 AM

  • Weblogic startup class and EAR file

    Hi,
    I am using WL 8.1.5.
    I have a weblogic starup class MyStartup that implements T3StartupDef. (it does not specify package).
    I jar-ed it. And I placed MyStartup.jar file into the MyEA.ear file. And I placed that into applications dir.
    With WL Console I defined the startup class and for the ClassName specified MyStartup.
    Yet I get the java.lang.ClassNotFoundException.
    I also have a Manifest.mf file with
    Class-Path: MyStartup.jar
    Please help me solve this problem, I literally don't know what to do next.
    MB

    Hi,
    thanks.
    This seems like a completely opposite method of the depplying startup class with weblogic console.
    Does my class still need to implement T3StartupDef?
    I get this exception. And my classnotfound is still there.
    Exception:weblogic.management.ApplicationException: startup.MyStartup
         at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.createContainer(SlaveDeployer.java:2484)
         at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(SlaveDeployer.java:2396)
         at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:883)
         at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeployer.java:591)
         at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:500)
         at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:25)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
    Regards,
    MB

  • Difference between SAP Ear and EAR file in Netweaver 7.3

    Hi all,
    when exporting a EAR file created in nwds 7.3 i get two options to export SAP EAR and EAR . What's the difference between two.and also Target runtime drop down showing sap runtime . What does that signify?
    Please specify.
    Regards
    Prasad

    Hi all,
    when exporting a EAR file created in nwds 7.3 i get two options to export SAP EAR and EAR . What's the difference between two.and also Target runtime drop down showing sap runtime . What does that signify?
    Please specify.
    Regards
    Prasad

  • Deployment and .ear files

    I have two questions; one may relate to the other.
    First, I would like to know the best way to deploy Session beans which have dependencies on other EJBs, be they Entity Beans or other Session Beans. The dependency is limited to the implementation class, not the interfaces. I have tried just putting all my EJBs in the classpath in startWebLogic.sh, but I get the "bean cannot be redeployed while the server is running" warning. Is there another way?
    Second, I have read of .ear files, which seem to be a good way of dealing with many EJBs/JSPs en masse(I'm working with ~100 EJBs and ~2000 JSPs). However, I haven't found anything on exactly what they are, how to use them, or how to generate them.
    If anyone has these answers, or can point me to a good site on the matter, I'd appreciate it.
    Thanks, --Tom Seufert

    Hi Tom,
    The "best" way to generate EAR files is to use an IDE that has built-in
    tools to do it -OR- to use ANT (kind of an xml-based gnu-make-like utility
    for Java).
    Most dev groups that I've seen start by using .sh/.cmd (i.e. batch) files to
    generate the JAR/WAR/EAR files. ANT allows you to do things like
    dependency-based builds, to avoid re-generating parts that are not
    necessary. That was very handy with WL 5.1 when EJBC could take several
    minutes (even running locally with a fast compiler like JIKES). (I have
    only used ANT a tiny bit, but Jesse Tilly who frequents this newsgroup is an
    expert with it.)
    The EAR is just a means to bundle different parts of your application
    together. For example, your EJBs will be bundled into a JAR, and your JSPs
    will be bundled into a WAR, and you can put both into an EAR. WL6.0 will
    accept an EAR file for deployment, will auto-deploy, and will even re-deploy
    it if the EAR changes!
    The easiest way to build a JAR or WAR or EAR file within a batch or build
    file is to use the JAR command. If you have a directory structure that is
    exactly how the JAR file will be layed out, then I believe the command is
    "jar -cfm0 my.jar *" or "jar -cfm0 my.jar .".
    Peace,
    Cameron Purdy
    Tangosol, Inc.
    http://www.tangosol.com
    +1.617.623.5782
    WebLogic Consulting Available
    "Tom Seufert" <[email protected]> wrote in message
    news:[email protected]...
    >
    >
    I have two questions; one may relate to the other.
    First, I would like to know the best way to deploy Session beans whichhave dependencies on other EJBs, be they Entity Beans or other Session
    Beans. The dependency is limited to the implementation class, not the
    interfaces. I have tried just putting all my EJBs in the classpath in
    startWebLogic.sh, but I get the "bean cannot be redeployed while the server
    is running" warning. Is there another way?
    >
    Second, I have read of .ear files, which seem to be a good way of dealingwith many EJBs/JSPs en masse(I'm working with ~100 EJBs and ~2000 JSPs).
    However, I haven't found anything on exactly what they are, how to use them,
    or how to generate them.
    >
    If anyone has these answers, or can point me to a good site on the matter,I'd appreciate it.
    >
    Thanks, --Tom Seufert

  • JSPC classpath and .ear files (WLS6.0)

              We're just beginning to use weblogic 6.0, and would like to make use of the .ear file format for deployment. The odd thing is that the system seems to have a problem with compiling JSPs that rely on our code that's bundled in the jsp as an EJB element.
              We tried placing the non-ejb specific code outside the EJB jar file and in the war file's web-inf/lib directory, but the EJB woudln't deploy. So we stuffed all our non-web specific classes in one big jar, named it the EJB jar for the .ear file, and deployed the whole mess.
              The EJB jar deploys fine, but now the JSP's inside the WAR file won't compile because the system doesn't automatically know how to find the .jar file inside the .ear file.
              What should we do? Thanks in advance for any help,
              Tim
              

              We're just beginning to use weblogic 6.0, and would like to make use of the .ear file format for deployment. The odd thing is that the system seems to have a problem with compiling JSPs that rely on our code that's bundled in the jsp as an EJB element.
              We tried placing the non-ejb specific code outside the EJB jar file and in the war file's web-inf/lib directory, but the EJB woudln't deploy. So we stuffed all our non-web specific classes in one big jar, named it the EJB jar for the .ear file, and deployed the whole mess.
              The EJB jar deploys fine, but now the JSP's inside the WAR file won't compile because the system doesn't automatically know how to find the .jar file inside the .ear file.
              What should we do? Thanks in advance for any help,
              Tim
              

  • JMS Listener classpath and EAR files

    I am trying to deploy our application using the EAR file format on Weblogic
    6.0 sp2.
    In order to use JMS sessionPools, we call
    SessionPoolFactory.getServerSessionPool() API (which takes our JMS
    Message listener class name as a string), from our startup servlet.
    Can any one tell me in which classpath this listener class should be defined
    ? System, EJB or Web application classpath ?
    I have put the relevant jar file in the EAR as well as the EAR manifest
    file, but I get
    weblogic.jms.common.ConfigurationException: Listener class, <class name>,
    not found.
    Is there any way around this (apart from putting it in the System class
    path) ?
    Can anyone help out here ?
    Thanks.
    - Venky

    I am trying to deploy our application using the EAR file format on Weblogic
    6.0 sp2.
    In order to use JMS sessionPools, we call
    SessionPoolFactory.getServerSessionPool() API (which takes our JMS
    Message listener class name as a string), from our startup servlet.
    Can any one tell me in which classpath this listener class should be defined
    ? System, EJB or Web application classpath ?
    I have put the relevant jar file in the EAR as well as the EAR manifest
    file, but I get
    weblogic.jms.common.ConfigurationException: Listener class, <class name>,
    not found.
    Is there any way around this (apart from putting it in the System class
    path) ?
    Can anyone help out here ?
    Thanks.
    - Venky

  • WL6.1sp2: Autodeploy and ear files - probable bug

    I've a beef with autodeploy in WL6.1sp2 when working
    with full-blown ear files.
    If I change an API in one of my beans or add an API then
    drop that updated ear file into the applications directory,
    it doesn't work.
    For some reason the autodeploy mechanisms have a tmp
    directory for my ear in the main wlserver6.1 directory
    (such as: tmp_ejbipusushi8880) that seems to be getting
    in the way. When I delete that, the autodeploy then works.
    (Skipping a couple of cleanup bits, restart, etc.)
    Thus, I think there's a bug lurking in the autodeploy
    mechanisms. What a pain that was to figure out how to get
    around.
    Joel

    Hi..
    Please see my reply to your previous posting. If that doesn't help then
    please open a case with support.
    Thanks,
    Michael
    Joel Riedesel wrote:
    I've a beef with autodeploy in WL6.1sp2 when working
    with full-blown ear files.
    If I change an API in one of my beans or add an API then
    drop that updated ear file into the applications directory,
    it doesn't work.
    For some reason the autodeploy mechanisms have a tmp
    directory for my ear in the main wlserver6.1 directory
    (such as: tmp_ejbipusushi8880) that seems to be getting
    in the way. When I delete that, the autodeploy then works.
    (Skipping a couple of cleanup bits, restart, etc.)
    Thus, I think there's a bug lurking in the autodeploy
    mechanisms. What a pain that was to figure out how to get
    around.
    Joel--
    Michael Young
    Developer Relations Engineer
    BEA Support

  • Can u plz tell me what are PAR files and EAR files

    i can't understand what r these plz tell me

    Hi Aravind,
    Look here: /thread/172969 [original link is broken]
    hope this helps you,

  • 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

Maybe you are looking for