How to Create a jar war or ear--Probelms in deploying

I have the following dir structure. I am using Struts 1.1 and weblogic 7.0
APP
+jsp
+WEB-INF
+ ---lib
+--- classes
+----com
--ap
--action
--beans
--handler
--service
--client
--ejb
--valueobject
1> Do I need to create a ear file since i want both the ejb (under service folder) and war as reusable components. Whenever we have a EJB component do we always need to have an EAR file??
2> Whats the best way to create the jar, war or ear file. I am facing great difficulty in deploying the war.Do we need to set any classpath before we create the war and jar files except for the deployment descriptors.I have created the ejb descriptors correctly through ejbc.
3>I have kept struts.jar,log4j.jar under lib folder. However when i create the ear and try to deploy it under weblogic it deploys the war file but gives error in deploying the jar which has the ejb. I have aslo validated the jar using ejbc.
It gives error indicating that it requires struts.jar in classpath. If we give the classpath of struts.jar at system leve the Application deploys with ease..Can anyone tell whats the error.The jar does not use any strust component .
4>Also the valueobject which has some beans which are used to populate the jsp through Actionformbean. Is it ok if we give refrences in both ejb jar and war?
ie while creating jar and war folder have the valueobject in both the files or will it lead to any errors..
Thanks in Advance
....

Yes, I have tried that. But, as the server is running and the jars are in use, it throws and EditFailedException

Similar Messages

  • 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.

  • How to create a .jar file in wlcs3.1

    hello friends,
    hi friends, im working on weblogic commerce server3.1 . i dont know how to create a .jar file in weblogic commerce server3.1. can any one knows send email to me.
    thanks.
    hari

    $JDK_HOME/bin/jar (%JDK_HOME%\bin\jar) shows you the syntax
    where JDK_HOME is your jdk installation directory.
    Kumar
    hari wrote:
    hello friends,
    hi friends, im working on weblogic commerce server3.1 . i dont know how to create a .jar file in weblogic commerce server3.1. can any one knows send email to me.
    thanks.
    hari

  • How to create a PAR file from EAR file

    Hi,
       I have created an Web Dynpro Application . When i deploy it in Remote J2EE Engine, it will deploy as EAR file. It then runs as normal Web Application in Web browser. My requirement is to create an iView for my Web dynpro appn in EP. That is possible only by creating a PAR file. so How to create an PAR file from EAR in NWDS(NetWeaver Developer Studio).
    How to access the EAR file in NWDS or J2EE ?
    Thanks in Advance ,
    By
    Saravanan

    Hi,
    To create a iview,
    log on to portal, New iView and select SAP webdynpro iview.
    It will ask for namespace which is usually , local/Project Name
    and application name is the name of the application.
    We dont have to create par file for this requirement

  • Jar, War or Ear file ?

    Hi,
    I am a total newbie in J2EE technology.
    I am currently using Sun One Application. Using the sample application, it produces all the Jar, War and Ear files.
    My understanding is Jar is produced to be a library-like usage.
    War is for web application.
    And Ear is for what?? oops EJB? Can someone tell me?
    Anyway, my concern is, if I am to produce Ear, war, or Jar file after deploy, I have problems doing the testing. Let's say I want to modify the Jsp file, then I have to use ant to compile all, undeploy the instance and deploy again.
    Any better way?

    your jar files contain your EJBs, your WAR file contains your web application (JSPs, servlets and support) and these are all bundled into your EAR file. All of these files are just zip-formatted archives, you can look at them all via the jar tool (or something like WinZip, if you are so inclined). Each of these will contain a descriptor file (in XML format) - check out the J2EE spec on it.
    Lee

  • How to create executable jar files??

    how to create executable jar files??
    thx :)

    Using JAR Files to Deploy
    http://developer.java.sun.com/developer/onlineTraining/Programming/BasicJava2/jar.html#jar

  • How to share dependant jars across rars & ears / avoid classcast exceptions

    <b>How can one share dependant jars between a ear application and a resource adapter and avoid getting a ClassCastException? </b>
    <P>
    In some appservers(such as Oracle) the resource adapter is the parent of your ear classloader, so a single instance multiple classloader problem doesn't occur. But in some appservers such as BEA Weblogic this isn't the case. Not sure why BEA decided to make resource adapter class loader seperate and not the parent of ear loader...
    <P>
    If I bundle the resource adapter specific classes in the corresponding module archive file, I will get a class cast exception, becos I will have a <i>single instance and multiple class loader situation</i> (assuming resource adapters uses its own classloader).
    <P>
    Second question related to the above: Web logic documentation recommends that we bundle the common files in APP-INF direcotory for embedded resource adapter apps. If I start bundling the resource adapter in an ear file, for every ear app we will have a rar bundled. What about the JNDI names? won't you have to rename the resource adapter differently for each ear so that there is no jndi name clash? Doesn't this defeat the purpose of having one common connector for all apps?
    <P>
    Here is a detailed description of what I want:
    Let say you have a ear file. Let's say there is a common.jar shared between your ear application (say the ejb module uses it), and your resource adapter.
    <P>
    In the case of Oracle's OC4J I can see there won't be any problem of having this common.jar part of the resource adapter(RA). When the RA class loader loads the rar, it makes sure the common.jar files are accessible in the chain of all class loaders it is a parent of. So, the ear loader, ejb loader etc...will have visibility -> hence no class cast exception.
    <p>
    But what do clients do when they want to have their ear deployable across multiple appservers not just oc4j. BEA recently changed their class loader structure...their resource loader is no longer parent of the ear, so the ejb app in the ear doesn't have visibility into common.jar packaged with rar. So, the only solution was to bundle the common.jar file with the ear. But this causes problems, because we can have a situation where certain object instances (that are not serialized or copied) can be shared across class loaders. This ends up in the single instance multiple class loader situation->hence classcastexception.
    <p>
    The only solution I found was to make the common.jar file a shared library. That way only one copy of the class files are there for both the rar and the ear and its visibility is there not only for rar but for ear since it is loaded by the system class loader or shared library class loader (if ther eis one such).
    <P>
    Please convey best practise recommendation.
    Sudhakar

    Pete <[email protected]> wrote:
    Is there a way to have a non-EJB jar at the EJB classloader level ? Sure, just add it to the Class-Path: manifest entry in your ejb.jar.
    Dimitri

  • How to create a .jar file for the BPEL project

    hi all,
    how can i create a .jar file for my BPEL project, i am trying to deploy the project but getting an error :
    "Error: [Error ORABPEL-10902]: compilation failed [Description]: in "C:\OraBPELPM\integration\jdev\jdev\mywork\Workspace_BPELDemo\BPEL_Report\BPEL_Report.bpel", XML parsing failed because "". [Potential fix]: n/a. "
    and when doubel cliking on this error Jdev take me to the beginning of the ".bpel" file.
    I 'm really stuck in here i am not able to deploy the process!
    Thanks,
    Rana

    Rana:
    If you haven't already, I would post this question in the BPEL forum. I would expect a much better turnaround there.
    Johnny Lee

  • How to access a jar file in EAR file?

    I have a EAR file which contains EJB.jar file and util.jar file. Outside of EAR, I mean in client side, I need to reference util.jar file. How can I access it?
    EAR structure is
    |--+META-INF/
    |--|---application.xml
    |--|---manifest.mf
    |--EJB.jar
    |--|---+MEAT-INF/
    |--|---|--- deployment descriptors...
    |--|---|--- manifest.mf
    |--|--- EJB classes
    |--Util.jar
    Util.jar must be executed in server side. If I just add Util.jar in client program's classpath, when client program is executed, serverside Util.jar is executed? Or what else I should do in the client program to reference server-side Util.jar?

    Excellent question. I don't see any client-jar in your EAR file structure. So I am assuming you are writing a separate client application which will talk to the ejbs deployed as part of this EAR. You need to do the following:
    Write another EAR file with the following structure:
    ear:
    META-INF/application.xml
    util.jar
    client.jar
    client.jar should have a META-INF/MANIFEST.MF and that should contain Class-Path:util.jar and value for Main-Class attribute.
    Now deploy this new ear to your application server and execute it using Application Client Container that comes with your app server.
    If you don't want to write another EAR file, then bundle th client.jar in your original EAR file.
    Points to note are:
    you have to repackage util.jar again inside this ear file.
    For portability reason, you should use Class-Path manifest entry in client.jar. Refer to http://java.sun.com/j2ee/verified/packaging.html and J2EE platform spec section #8.2.
    Hope this helps,
    Sahoo

  • How to create a jar file which is in the remote system?

    Hi,
    I have a set of files that resides in a remote system,which have to be "jar"red. I have a firewall in between. I want to create a jar file out of the files situated in the remote system.How do i go about this process.?

    Hi,
    You can't do that in a simple way. You need to have a port open in the firewall, and you need to have a server process on the remote machine.
    Kaj

  • How to create a Jar with only class files?

    Dear all,
    I want to create a jar file with only classes.My class files and java files are in different folders under com .
    say
    com
    in com there are two folders
    folder 1 -- subfolder 1
    folder 2 -- subfolder 2
    like this.
    If i want to create a jar file from com directory how should i give the jar command.Again my jar should contain only .class files.
    Any help will be appreciated
    Thanks
    lekshmi

    It doesn't work.Says "No such class or directory"
    Any other way Or is it possible to do so?Read the link I posted and create the statement to make your structure. I was thinking you were inside the com directory but if you are above it you will need something like this instead:
    jar -cf test.jar com\*.class com\subfolder1\*.class com\subfoler2\*.class
    But either way don't just copy and past this. Think about what is does so that you can make it work for you.
    Also, you might want to look into using Ant if you are going to be building this a lot.

  • How to create a JAR

    Hi
    I'm very new to Java. I have a private project to do a little admin application for bulk changes to my itunes library via their COM API. Previously I used several javascripts to do this so I don't expect a lot of work to adapt them to Java. I use eclipse and have downloaded com4j (https://com4j.dev.java.net/servlets/ProjectDocumentList) to create wrappers to the COM-objects in iTunes. the quick intro to com4j say that the wrappers are created by the tlbimp.jar. I know that JAR is a a java archive created by jdk using jar.exe but I can't get out a tlbimp.jar file how much i try. If I do something like this
    jar -cvf tlbimp.jar *
    Does that make sense? What prerequisites are important? Does jar.exe have to be in som path variable in windows? Should I be in the folder where the classes are or one level up? Anything else
    Edited by: 802710 on 2010-okt-15 03:16

    802710 wrote:
    Hi
    I'm very new to Java. I have a private project to do a little admin application for bulk changes to my itunes library via their COM API. Previously I used several javascripts to do this so I don't expect a lot of work to adapt them to Java. I use eclipse and have downloaded com4j (https://com4j.dev.java.net/servlets/ProjectDocumentList) to create wrappers to the COM-objects in iTunes. the quick intro to com4j say that the wrappers are created by the tlbimp.jar. I know that JAR is a a java archive created by jdk using jar.exe but I can't get out a tlbimp.jar file how much i try. If I do something like this
    jar -cvf tlbimp.jar *
    Does that make sense? What prerequisites are important? Does jar.exe have to be in som path variable in windows? Should I be in the folder where the classes are or one level up? Anything elseIt sounds to me like the documentation is saying that Java classes in the tlbimp.jar are used to create the wrappers - you do not need to create that jar. I bet if you look at the zip file you downloaded, you will find tlbimp.jar inside the zip file. You need to extract that jar and any other jars inside the zip file and configure Eclipse to use them.

  • How to create a Jar files

    I m New in java i want to create a jar files but i dont know how please anyone help me and answer my question thanks.

    Hi muhammadawood,
    Creating a jar file is easy. First of all, a jar file is not much more than a zip file. You can use your favorite zip program (ie. zip, WinZip, pkzip, etc) to create the jar. To do this, zip all your classes together into a zip file. Then, rename the file w/ a .jar extension. This method doesn't support a small set of features defined by jar, but it will work nonetheless.
    If you are using the Forte IDE, it has the ability to create a jar from a menu.
    Regards,
    Nick G.

  • How to create sbconfig.jar automatically?

    Hi All,
    I have a osb project in SVN(subversion).what i want is to check out the osb project from SVN and create sbconfig.jar ,and than deploy this jar to OSB server...
    But i want this whole process to be automated.. ie using script...
    does any one how idea how can i do this?
    Regards
    Rohan

    Hi Rohan,
    OSB is configuration based product hence you may not be able to build jars using artifacts like .proxy and .biz files. Scripts work only in conjunction with server.
    You may refer -
    Create sbconfig.jar for OSB project using script
    Regards,
    Anuj
    Edited by: Anuj Dwivedi, TCS on Jul 22, 2010 12:32 PM

  • How programmatically create a jar?

    How do I create a jar from inside java class?

    thanks rsully! That def. helped. Here's the complete program:
    http://forum.java.sun.com/thread.jsp?forum=22&thread=196383

Maybe you are looking for