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
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 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
-
Deploying war OR ear file in 10.1.3 standalone OC4J
I've read the several threads on how to deploy a war file and/or ear file for OC4J but haven't seen anyone having the same issue I'm having.
I've tried deploying manually, from the command line using admin.jar, as well as the enterprise manager. It appears that when OC4J is looking for a jar file containing EJB's. But my app has none and there is no jar file that it finds.
Here is what the console reports when I try to deploy using admin.jar ->
http://www.gordongridley.us/2007/02/oc4j-console-when-trying-to-deploy.html
OK - so I try to deploy using the Enterprise Manager instead to see if the UI has some options that I can change for not forcing an EJB jar file lookup. Here is a video of what I did ->
http://www.gordongridley.us/2007/02/attempting-to-deploy-war-using-oc4j.html
Do I really need to have a jar file with EJB's to deploy a WAR/EAR file?Hi Gordon,
The source of your ills is this entry in the application.xml descriptor:
<module>
<ejb>TomaxCMAdmin.jar</ejb>
</module>
Remove that, and you should be good to go (assuming you aren't referencing any other non-existent JARs).
Thanks
Dan Hynes -
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.
-
Deploy .war or .ear file to sun java web server 7.0 update 4
Hi
This could be a very daft question, but still I would like to get a clarification.
My clients are a financial organisation, and for security and various other reasons they accept only .ear files. But this time the development and deployment would be done on Sun Java Web Server 7.0 update 4 . Now since its a web server I don't think I can deploy an .ear file.
But sure I would like to get an answer from the experts here, is it possible to deploy and .ear file to Sun Java Web Server 7.0 before I can go back to my clients.
Please help me here as I'm in a real big confusion here. Your help would be highly valuable to me.
Thanks
JagdishHi
Thanks for the reply and I appreciate your help. Well I tried deploying an .ear file directly and web server 7 complains that it doesn't have a .war extension, understandably so.
And then ripping apart the .ear file and deploying the .war file does work, as is expected of a web server.
Well, about my customer is a bank and they have a very tight security policy, and why they need an .ear file is beyond my understanding. Well as far as this issue is concerned, I need a strong point so that I can get back to them that we need to comply to the third party software.
But I didn't wan't to get back to them saying we can only provide a .war file and then later find out an .ear file could have done the job. And being seen as the technical experts we can't afford to make any mistake.
Thanks
Jagdish -
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 -
Deploy war or ear file to Websphere Server
Anyone knows how to deploy .war file to Websphere Application Server after building the completed JSF web application from Creator tool? Or how to deploy the application developed in Creator to other servers such IBM Websphere, JBoss ...etc.
By theory, to put on server, any web ear files can be dropped into web contents directory of each server. In my case, I put war file on IBM Websphere 5.1, but it did not work.
Thanks in advance.
VTT_Did you use the export war facility on your project in the project navigator? this should work fine.
Note you will need to create your datasources etc using hte admin tools for the server of your choice.
There may also be some library requirements for JSF that your server doesn't have - I know this is true for tomcat, for example... see
http://swforum.sun.com/jive/thread.jspa?threadID=46057&tstart=0
hth,
Val -
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 -
Fail to deploy ear file to AS10g
Hi friends,
I use Jdev10g to generate ear file and dcmctl to deploy to AS10g. Something must have been wrong but I couldn't work it out. Really need your help.
--info: Project:"Master Detail page using ADF"
http://www.oracle.com/technology/sample_code/products/jdev/10g/ADF_ComplexMasterDetail.zip
--Here are my WAR and EAR file
unzip -l ../ias904/mywork/ADF_ComplexMasterDetail.ear
Archive: /raid1/oracle/ias904/mywork/ADF_ComplexMasterDetail.ear
Length Date Time Name
104 09-21-04 13:28 META-INF/MANIFEST.MF
4730626 09-21-04 13:28 ADF_ComplexMasterDetail.war
439 09-21-04 10:39 META-INF/application.xml
285 09-21-04 10:36 META-INF/orion-application.xml
4731454 4 files
unzip -l ../ias904/mywork/ADF_ComplexMasterDetail.war
Archive: /raid1/oracle/ias904/mywork/ADF_ComplexMasterDetail.war
Length Date Time Name
104 09-21-04 13:28 META-INF/MANIFEST.MF
3175 09-21-04 13:28 WEB-INF/classes/DataBindings.cpx
439 09-21-04 11:17 WEB-INF/classes/META-INF/application.xml
575 09-21-04 13:26 WEB-INF/classes/META-INF/data-sources.xml
285 09-21-04 11:17 WEB-INF/classes/META-INF/orion-application.xml
613 09-21-04 13:26 WEB-INF/classes/Model.jpx
881 09-21-04 13:28 WEB-INF/classes/connections.xml
1844 09-21-04 13:26 WEB-INF/classes/model/DepartmentManagersView.xml
4004 09-21-04 13:26 WEB-INF/classes/model/Departments.xml
3849 09-21-04 13:26 WEB-INF/classes/model/DepartmentsImpl.class
1975 09-21-04 13:26 WEB-INF/classes/model/DepartmentsView.xml
364 09-21-04 13:26 WEB-INF/classes/model/DepartmentsViewImpl.class
1329 09-21-04 13:26 WEB-INF/classes/model/DeptMgrFkAssoc.xml
1091 09-21-04 13:26 WEB-INF/classes/model/DeptMgrFkLink.xml
1336 09-21-04 13:26 WEB-INF/classes/model/EmpDeptFkAssoc.xml
1095 09-21-04 13:26 WEB-INF/classes/model/EmpDeptFkLink.xml
1332 09-21-04 13:26 WEB-INF/classes/model/EmpJobFkAssoc.xml
1343 09-21-04 13:26 WEB-INF/classes/model/EmpManagerFkAssoc.xml
1098 09-21-04 13:26 WEB-INF/classes/model/EmpManagerFkLink.xml
9312 09-21-04 13:26 WEB-INF/classes/model/Employees.xml
7121 09-21-04 13:26 WEB-INF/classes/model/EmployeesImpl.class
3836 09-21-04 13:26 WEB-INF/classes/model/EmployeesView.xml
1135 09-21-04 13:26 WEB-INF/classes/model/EmployeesViewImpl.class
2842 09-21-04 13:26 WEB-INF/classes/model/Jobs.xml
3368 09-21-04 13:26 WEB-INF/classes/model/JobsImpl.class
997 09-21-04 13:26 WEB-INF/classes/model/client/EmployeesViewClient.class
239 09-21-04 13:26 WEB-INF/classes/model/common/EmployeesView.class
1210 09-21-04 13:26 WEB-INF/classes/model/common/bc4j.xcfg
1273 09-21-04 13:26 WEB-INF/classes/model/hrService.xml
1717 09-21-04 13:26 WEB-INF/classes/model/hrServiceImpl.class
2152 09-21-04 13:26 WEB-INF/classes/model/model.xml
3591 09-21-04 11:17 WEB-INF/classes/view/BrowseAllEmployeesAction.class
1122 09-21-04 11:17 WEB-INF/classes/view/BrowseEmployeesInDeptAction.class
1179 09-21-04 11:17 WEB-INF/classes/view/QueryEmployeesAction.class
4529 09-21-04 11:17 WEB-INF/classes/view/UIModels/browseAllDepartmentsUIModel.xml
5104 09-21-04 11:17 WEB-INF/classes/view/UIModels/browseAllEmployeesUIModel.xml
6195 09-21-04 11:17 WEB-INF/classes/view/UIModels/browseEmployeesInDeptUIModel.xml
4436 09-21-04 11:17 WEB-INF/classes/view/UIModels/editEmployeeInDeptUIModel.xml
4300 09-21-04 11:17 WEB-INF/classes/view/UIModels/editEmployeeUIModel.xml
3742 09-21-04 11:17 WEB-INF/classes/view/UIModels/masterDetailUIModel.xml
3631 09-21-04 11:17 WEB-INF/classes/view/UIModels/queryAllDepartmentsUIModel.xml
6130 09-21-04 11:17 WEB-INF/classes/view/UIModels/queryEmployeesInDeptUIModel.xml
2174 09-21-04 11:17 WEB-INF/classes/view/UIModels/queryEmployeesUIModel.xml
1010 09-21-04 13:28 WEB-INF/classes/view/resources/AppSampleResources.properties
3581 09-21-04 13:28 WEB-INF/classes/view/resources/ApplicationResources.properties
1810 09-21-04 11:17 WEB-INF/classes/view/util/HelpDispatcherAction.class
49438 05-14-04 19:28 WEB-INF/lib/adf-controller.jar
163279 05-14-04 19:28 WEB-INF/lib/bc4jhtml.jar
42730 05-14-04 19:29 WEB-INF/lib/bc4juixtags.jar
118726 06-30-03 11:50 WEB-INF/lib/commons-beanutils.jar
165119 06-30-03 11:50 WEB-INF/lib/commons-collections.jar
109096 06-30-03 11:50 WEB-INF/lib/commons-digester.jar
112307 05-11-04 17:17 WEB-INF/lib/commons-el.jar
22379 06-30-03 11:50 WEB-INF/lib/commons-fileupload.jar
63980 06-30-03 11:50 WEB-INF/lib/commons-lang.jar
31605 06-30-03 11:50 WEB-INF/lib/commons-logging.jar
46865 06-30-03 11:50 WEB-INF/lib/commons-validator.jar
140889 05-14-04 19:29 WEB-INF/lib/datatags.jar
17747 05-14-04 19:29 WEB-INF/lib/graphtags.jar
65368 06-30-03 11:50 WEB-INF/lib/jakarta-oro.jar
191881 01-28-04 03:32 WEB-INF/lib/jaxen-full.jar
3086 05-11-04 17:17 WEB-INF/lib/jsp-el-api.jar
21128 01-28-04 03:32 WEB-INF/lib/jstl.jar
3503 05-11-04 17:17 WEB-INF/lib/oracle-el.jar
23563 01-28-04 03:32 WEB-INF/lib/saxpath.jar
515490 01-28-04 03:32 WEB-INF/lib/standard.jar
498051 06-30-03 11:50 WEB-INF/lib/struts.jar
1271111 01-28-04 03:32 WEB-INF/lib/xalan.jar
2529 03-01-04 04:34 appsample_files/10gwelcome.gif
37314 03-03-04 00:26 appsample_files/blaf-en-ie-6.css
62 04-04-03 06:32 appsample_files/c-ghb.gif
61 04-04-03 06:32 appsample_files/c-ghbr.gif
66 04-04-03 06:32 appsample_files/c-ghcb.gif
145 04-04-03 06:32 appsample_files/c-ghct.gif
49 04-04-03 06:32 appsample_files/c-ght.gif
68 04-04-03 06:32 appsample_files/c-ghtl.gif
68 04-04-03 06:32 appsample_files/c-ghtr.gif
5395 03-03-04 00:26 appsample_files/mod_jdeveloper.css
661 01-29-04 08:35 appsample_files/return.gif
1870 03-02-04 20:23 appsample_files/sample_footer.jsp
7957 03-02-04 08:04 appsample_files/sample_header.jsp
1544 03-02-04 20:20 appsample_files/sample_help_footer.jsp
1490 03-02-04 20:19 appsample_files/sample_help_header.jsp
747 03-26-04 17:08 appsample_files/sample_sidebar.jsp
2105 04-04-03 06:47 appsample_files/samples.gif
272 04-04-03 07:19 appsample_files/wwv_help.gif
4974 03-05-04 21:35 browseAllDepartments.jsp
5730 03-08-04 23:31 browseAllEmployees.jsp
5213 03-08-04 15:01 browseEmployeesInDept.jsp
2594 03-03-04 00:22 css/jdeveloper.css
3485 03-03-04 21:37 editDepartment.jsp
5063 03-08-04 23:27 editEmployee.jsp
2686 02-12-04 10:18 editEmployeeInDept.jsp
3279 03-08-04 14:50 help/MasterDetailJSPKey.jsp
14710 03-06-04 14:03 help/helpSection1.jsp
15223 03-08-04 23:47 help/helpSection2.jsp
16556 03-08-04 23:09 help/helpSection3.jsp
2191 03-03-04 20:37 help/helpSection4.jsp
36555 03-08-04 13:37 help/images/StrutsPageFlow.jpg
19352 03-03-04 22:13 help/images/section1_flow.gif
8532 03-08-04 13:41 help/images/section2_flow.gif
5454 03-08-04 19:08 help/images/section3_flow.gif
247 02-09-04 14:58 images/ViewObject.gif
806 02-11-04 09:33 images/sideMenuBottom.gif
833 02-11-04 09:31 images/sideMenuBottomC.gif
806 02-11-04 09:29 images/sideMenuRight.gif
806 02-11-04 09:33 images/sideMenuTop.gif
831 02-11-04 09:31 images/sideMenuTopC.gif
1739 04-05-04 16:59 index.jsp
5272 03-03-04 20:53 masterDetail.jsp
6132 03-26-04 17:06 queryAllDepartments.jsp
5104 03-08-04 23:34 queryEmployees.jsp
9543 03-08-04 23:33 queryEmployeesInDept.jsp
5468 02-18-04 10:11 sideMenu.jsp
517075 02-09-04 15:07 web-inf/lib/standard.jar
227 09-21-04 11:15 web-inf/orion-web.xml
8868 02-09-04 14:54 web-inf/struts-bean.tld
10175 09-20-04 14:42 web-inf/struts-config.xml
65029 02-12-04 10:52 web-inf/struts-html-el.tld
66192 02-10-04 12:03 web-inf/struts-html.tld
2513 02-12-04 10:53 web-inf/web.xml
4713475 121 files
--when I deployed on AS10g using:
"dcmctl
deployApplication -file ../ias904/mywork/ADF_ComplexMasterDetail.ear -a jdev9051samples/JSPMasterDetail"
I got following error:
ADMN-300158
Jar file: /var/tmp/jar64914.tmp is missing its standard xml descriptor located at WEB-INF/web.xml
oracle.ias.sysmgmt.deployment.j2ee.exception.J2eeDeploymentException: Jar file: /var/tmp/jar64914.tmp is missing its standard xml descriptor located at WEB-INF/web.xml
Resolution:
at oracle.ias.sysmgmt.deployment.j2ee.file.WarFile.<init>(Unknown Source)
at oracle.ias.sysmgmt.deployment.j2ee.file.EarFile.init(Unknown Source)
at oracle.ias.sysmgmt.deployment.j2ee.file.EarFile.<init>(Unknown Source)
at oracle.ias.sysmgmt.deployment.j2ee.file.EarFile.<init>(Unknown Source)
at oracle.ias.sysmgmt.deployment.j2ee.console.EarDeployerImpl.<init>(Unknown Source)
at oracle.ias.sysmgmt.deployment.j2ee.console.J2eeDeploymentImpl.getEarDeployer(Unknown Source)
at oracle.ias.sysmgmt.deployment.j2ee.console.J2eeDeploymentImpl.getEarDeployer(Unknown Source)
at oracle.ias.sysmgmt.cmdline.DcmCmdLine.deployApp(Unknown Source)
at oracle.ias.sysmgmt.cmdline.DcmCmdLine.execute(Unknown Source)
at oracle.ias.sysmgmt.cmdline.DcmCmdLine.main(Unknown Source)
Thanks in advance.I wish there is a forum for JDev like asktom.oracle.com for DBA.
I posted several questions but receive no feedback.
future never wait :-( -
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 -
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
Maybe you are looking for
-
How to pair first gen Apple TV to iTunes 11
I need help paring an Apple TV first generation to iTunes for the first time. I am staying in a hotel so I brought my Apple TV and laptop that I factory restored to try to watch a my iTunes movies but I don't know how to have it sync whith my compute
-
Trasporting songs from 30 GB video ipod to computer
I got my songs from my brothers computer because we both use it and he left for college so i need to put my songs on my ipod onto my other computer anyone know how i can do this it would be greatly appreciated. Thank you Ipod video 30 GB Windows 20
-
MMS Not Working After 4.2 Update (Lost my Unlimited Plan, too!)
Ah, the return of the new and improved "Viewmymessage.com" After updating to the new 0S 4.2, I not only lost the ability to send and receive MMS messages (I checked, it's turned on under settings|messages|MMS), but AT&T has conveniently dropped me fr
-
I am facing difficulty in boot X4170 - Solaris 10 SunOS Release 5.10 Version Generic_144489-09 64-bit Copyright (c) 1983, 2011, Oracle and/or its affiliates. All rights reserved. Cannot mount root on /scsi_vhci/disk@g5000c50031fbf00b:a fstype ufs pan
-
Out of nowhere, my brushes started acting up. The preview of my brush is different from the results. Im attaching a picture of my cursor preferences as well as an example of whats going on! Please help me out!