Updating Specific Jar in an EAR file
Hi All,
Is it possible to update only some jar files in an EAR file.
This is what I wanted to do. My EAR structure is something like this-
A.ear
+ B.jar
+ APP-INF/lib/C.jar
I want to update the B.jar and C.jar with a few class files that I have. Will it be possible to; inside ear and update the specific jar.
I know if it is a single jar - then that jar -u does the trick.
Thanks much in advance,
- Anand<pre></pre>
Hi,
I haven't tried what you're asking specifically, but an EAR is, I believe, a .ZIP file with a specific directory structure. So, I'm thinking that you should be able to either:
1) Unzip the EAR, copy the new JAR (overwriting the old JAR), then re-zip to build the new EAR, or
2) Just use a ZIP tool to do an update of the JAR(s) to replaced.
Jim
Similar Messages
-
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 -
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. -
Where to put Third Party Jars in an .ear file
Where to put Third Party Jar files in an .ear file so that they can be packaged along with the entire application and thus bypass the trouble of putting the third party .jars inside the application server lib directory and set the class path.
Just put them in the root of your EAR. You can specify them in the classpath of your EJB JAR's manifest.
-
Libraries (.jar, .zip) in ear file.
Hi !
Sorry if someone asked this before.
I have a package (.jar) which would like to be shared by both ejb and war
component, I put them in the ear/lib/, and add an entry in the manifest
file. Somehow I couldn't access those package after deployed in iPlanet, nor
seeing them being extracted to any directories. Do I have to put 2 copies in
each of them in iPlanet ? Or there's any other way to work around this ?
Thanks,
BrandonHi,
I haven't tried out this, please try to include this .jar file in one
of the path where the path in application server points to. This might
help. You can find the application server's classpath in
Software/iPlanet->Application Server->6.0->Java->Classpath.
Regards
Raj
Brandon wrote:
Hi !
Sorry if someone asked this before.
I have a package (.jar) which would like to be shared by both ejb and war
component, I put them in the ear/lib/, and add an entry in the manifest
file. Somehow I couldn't access those package after deployed in iPlanet, nor
seeing them being extracted to any directories. Do I have to put 2 copies in
each of them in iPlanet ? Or there's any other way to work around this ?
Thanks,
Brandon -
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 -
EJB - JAR or EAR file reloading - how to get it to work consistently.
We are using wl 6.0 sp2 rp2 - with 2 WL instances on the same box.
We have always seemed to have had this headache with WL - getting EJB's
to reload consistently.
Does anyone have a sequence of steps they follow to get good consistent
reloading results from both an EJB in its own JAR or an EAR file?
If we just copy the file over sometimes it seems to reload and sometimes
not.
If we try to use the console to "install an application" again sometimes
it deploys the EJB's to the wrong server instance!
Also is there anyway in the Weblogic deployment descriptor to specify
which instance the EJB should be deployed against?
Thanks
TomSTARTMODE is only available in WLS 6.1 and not WLS 6.0.
Deepak Vohra wrote:
Tom
Edit the startWeblogic Command Script.
set STARTMODE=false
Deepak
Tom Gerber wrote:
Is STARTMODE available in 6.0??? I thought that was new to 6.1.
I'm running on NT so do I set this on the Java command line as a
-DSTARTMODE=false or is it a regular environment variable?
Tom
Deepak Vohra wrote:
Tom
In startWebLogic script set STATRTMODE=false
STARTMODE=false starts server in development mode.
Deepak
Tom Gerber wrote:
We are using wl 6.0 sp2 rp2 - with 2 WL instances on the same box.
We have always seemed to have had this headache with WL - getting EJB's
to reload consistently.
Does anyone have a sequence of steps they follow to get good consistent
reloading results from both an EJB in its own JAR or an EAR file?
If we just copy the file over sometimes it seems to reload and sometimes
not.
If we try to use the console to "install an application" again sometimes
it deploys the EJB's to the wrong server instance!
Also is there anyway in the Weblogic deployment descriptor to specify
which instance the EJB should be deployed against?
Thanks
Tom
Rajesh Mirchandani
Developer Relations Engineer
BEA Support -
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
-
Error after Deploying a .ear File
Hi,
I have deployed an .ear file on the SAP J2EE engine 6.20 on EP6.0 sp2. When I access one of the JSP's, I am getting a NoClassDefFound exception even though the particular jar (xml-apis.jar) file containing the class is in the additional-lib directory. Also, the jar file has been added to the classpath in go.bat? What other changes are to be done for a successful deployment?
Environment :EP6.0, sp2 hotfix4 on Windows 2003, MS SQL server DB.
Please reply ASAP
Thanks
Bhanuhello,
have you tried including the 3rd party jar in your EAR file itself?
i use a number of external jars in my web app and ejb, including some xml parsing classes. what i did was to put them all in the EAR, at the root level, in other words, not in a sub-directory. then in my WAR's meta-inf/MANIFEST.MF file reference them in the Class-path. do simililar thing for the ejbs if necessary.
when you tried to use the inqxml instead, did you make a reference in manager/referecen.txt from your app to the inqmy library? if so, did you look into the inqmyxml.jar to see if the Node class is actually there?
regards,
wentao -
Error deploying a .ear file - Urgent
Hi,
I am trying to deploy an .ear file on the SAP J2EE engine. I am getting a NoClassDefFound exception even though the particular jar (xml-apis.jar) file containing the class is in the additional-lib directory. Also, the jar file has been added to the classpath in go.bat? What other changes are to be done for a successful deployment?
Environment :EP6.0, sp2 hotfix4 on Windows 2003, MS SQL server DB.
Please reply ASAP
Thanks
Bhanuhello,
have you tried including the 3rd party jar in your EAR file itself?
i use a number of external jars in my web app and ejb, including some xml parsing classes. what i did was to put them all in the EAR, at the root level, in other words, not in a sub-directory. then in my WAR's meta-inf/MANIFEST.MF file reference them in the Class-path. do simililar thing for the ejbs if necessary.
when you tried to use the inqxml instead, did you make a reference in manager/referecen.txt from your app to the inqmy library? if so, did you look into the inqmyxml.jar to see if the Node class is actually there?
regards,
wentao -
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
-
How to use application params in .EAR files
When we build an ear file , Weblogic-application.xml provides application-param
tag?
are they similar to env-entry in ejb-jar.xml.
Can I use application-param tag to define a configurable params
say myName and value as "Harshad"
How do i read it in the application say a simple java class that is included in
a jar inside the ear file.application-param tag in weblogic-application.xml may be used to define parameters:
webapp.encoding.default
webapp.encoding.usevmdefault
webapp.getrealpath.accept_context_path
http://e-docs.bea.com/wls/docs81/programming/app_xml.html#1034632
"Harshad Nanal" <[email protected]> wrote:
>
When we build an ear file , Weblogic-application.xml provides application-param
tag?
are they similar to env-entry in ejb-jar.xml.
Can I use application-param tag to define a configurable params
say myName and value as "Harshad"
How do i read it in the application say a simple java class that is included
in
a jar inside the ear file. -
Help to solve problem with packaging log4j in a EAR file
Hi All
i struggle hard to create a EAR composed of EJB JARs and WARs and the programs
in these JARs and WARs use log4j to log msg. Because i want all J2EE apps to have
their own version of log4j library, i package log4j.jar in the EAR file. Below
is my EAR package structure
EJB1.jar
EJB2.jar
SharedUtilities.jar
log4j.jar
log4j.properties
WEBAPP1.war
WEBAPP2.war
META-INF/manifest.mf
For both EJB1.jar and EJB2.jar's META-INF/manifest.mf, there is a below entries
Manifest-Version: 1.0
Class-Path: SharedUtilities.jar log4j.jar
However, my program always hit below runtime error.
[java] Caused by: javax.ejb.TransactionRolledbackLocalException: EJB Exception:
: java.lang.NoClassDefFoundError: org/apache/log4j/PropertyConfigurator
But the program in EJB1.jar and EJB2.jar seem to have no such problem in loading
classes in SharedUtilities.jar. The problem can be eliminated if i put log4j.jar
at system classpath. Can anybody provide me with info on how to package a log4j
library within a EAR package ?
In addition, where should i put the log4j.properties so that it will be at search
path of log4j and automatically loaded by log4j lib
regards
DannyHi Slava Imeshev
I am a bit confused about your reply. As said, the log4j.jar was packaged in my
ear file. If the log4j.jar was not packaged in ear file, how come the ejb classloader
can locate it.
Secondly, if log4j.jar is included in system classpath, the ejb also can load
log4j classes by system classloader. No "NoClassDeffound" exception is thrown.
regards
dso
"Slava Imeshev" <[email protected]> wrote:
"dso" <[email protected]> wrote in message
news:[email protected]...
Hi Slava Imeshev
thanks for your response. I am a bit confused about your answer.
i can't understand why u said the classloader COULD loadorg/apache/log4j/PropertyConfigurator.
According to the error msg, it said
" java.lang.NoClassDefFoundError: org/apache/log4j/PropertyConfigurator".
Seemingly,
this class in log4j.jar could not be located. But as i said in lastquestion,
i seemed to have properly
edit the "META-INF/manifest.mf" in EJB1.jar and EJB2.jar to includelog4j.jar
in "Class-path" attribute. And my EJB classes have no problem in loadingclasses
in SharedUtilities.jar. Would u please elaborate on it in more details?
Sure. NoClassDefFoundError means that a DEPENDING class
can not be loaded. If the classloader were not able to load the class
itself, it would give you ClassNotFoundException.
Just make sure that you don't have the same packages in
the ear and in the class path so that you don't have classes
loaded by system classloader trying to load classes loaded
by ejb classloaders.
regards
dso
"Slava Imeshev" <[email protected]> wrote:
First, this error means that classloader was able to load
org/apache/log4j/PropertyConfigurator, but cold not load
one of depending classes. I'd inspect the CLASSPATH
to see if there are any log4 classes there.
Second, you can package your log4.properties into
log4.jar itself.
Regards,
Slava Imeshev
"dso" <[email protected]> wrote in message
news:[email protected]...
Hi All
i struggle hard to create a EAR composed of EJB JARs and WARs and
the
programs
in these JARs and WARs use log4j to log msg. Because i want all
J2EE
apps
to have
their own version of log4j library, i package log4j.jar in the EARfile.
Below
is my EAR package structure
EJB1.jar
EJB2.jar
SharedUtilities.jar
log4j.jar
log4j.properties
WEBAPP1.war
WEBAPP2.war
META-INF/manifest.mf
For both EJB1.jar and EJB2.jar's META-INF/manifest.mf, there is
a below
entries
Manifest-Version: 1.0
Class-Path: SharedUtilities.jar log4j.jar
However, my program always hit below runtime error.
[java] Caused by: javax.ejb.TransactionRolledbackLocalException:EJB
Exception:
: java.lang.NoClassDefFoundError: org/apache/log4j/PropertyConfigurator
But the program in EJB1.jar and EJB2.jar seem to have no such problemin
loading
classes in SharedUtilities.jar. The problem can be eliminated if
i
put
log4j.jar
at system classpath. Can anybody provide me with info on how to
package
a
log4j
library within a EAR package ?
In addition, where should i put the log4j.properties so that it
will
be at
search
path of log4j and automatically loaded by log4j lib
regards
Danny -
Error Undeploying a EAR File Containing Resource Adapter
Hi,
I am trying to undeploy a ear file that contains a
1) one inbound R.A(resource adapter),
2) one outbound R.A and
3) few EJBs.
The undeploy command "java -jar admin.jar undelpoy..." executes without any error, however the thread process started by the inbound adapter keep running even after undeployment.
Is there a way to cleanly undeploy a resource adapter (that would delete all the threads created by resource adapter) that's part of a ear file?
Note: The inbound adapter's deregisterEndpoint method does include the code to call the destroy method on the thread it created.
Thanks,
Bhupenhello,
have you tried including the 3rd party jar in your EAR file itself?
i use a number of external jars in my web app and ejb, including some xml parsing classes. what i did was to put them all in the EAR, at the root level, in other words, not in a sub-directory. then in my WAR's meta-inf/MANIFEST.MF file reference them in the Class-path. do simililar thing for the ejbs if necessary.
when you tried to use the inqxml instead, did you make a reference in manager/referecen.txt from your app to the inqmy library? if so, did you look into the inqmyxml.jar to see if the Node class is actually there?
regards,
wentao -
Referencing a jar inside an ear
Hi,
I have a program where I need to get a reference to a jar inside an ear
file. For example, I have this variable set:
$WL_HOME/config/mydomain/applications/test.ear and I want to set a variable
for a jar inside this ear.
Does anyone know the best way to do that?
ThanksWhen you say "set a variable", do you mean read an XML or properties file
and modify it and write it back?
It is relatively simple using the java.util.zip / java.util.jar packages.
Editing XML is a little harder; I would suggest relying on something like
JDOM or the libs from The Mind Electric.
Peace,
Cameron Purdy
Tangosol Inc.
Tangosol Coherence: Clustered Coherent Cache for J2EE
Information at http://www.tangosol.com/
"Diane Curley" <[email protected]> wrote in message
news:[email protected]..
Hi,
I have a program where I need to get a reference to a jar inside an ear
file. For example, I have this variable set:
$WL_HOME/config/mydomain/applications/test.ear and I want to set avariable
for a jar inside this ear.
Does anyone know the best way to do that?
Thanks
Maybe you are looking for
-
Hi, I have a problem retrieving a ResultSet from a REF CURSOR. I am using and OCI driver and Oracle 9i. Mi Code is like this: public static void main(String[] args) throws ClassNotFoundException, SQLException { Class.forName("oracle.jdbc.driver.Oracl
-
Automatic population table form
I have table form. I need to automatic populate certain fields of this table form with values based on selections made by users in their select lists. As in this example http://htmldb.oracle.com/pls/otn/f?p=31517:106:3816553832235531::::: Suppose, 1
-
Hello All, I have subscreen in which i created a table control. The problem is when i have a tbale control on subscreen the program dumps but where as when i have one field in sub screen the program doesn't dump. Could any please help me to solve the
-
Page Navigation portlet - 3.0.9
I want to create a page navigation portlet in 3.0.9, similar to that in 9.0.2. How can this be done? I want the portlet to navigate between pages and sub pages and I do not want to use the nasty default navigation link that appears on sub-pages in 3.
-
No "sign in" option shown on updated home screen, what now ?
Recent microsoft updates stopped Firefox on my computer,(error 404) but I managed to find a way to update it, but I now have a firefox screen with google as my search engine, but there is no place on the home screen that allows me to sign in to my go