Actually I use MyEclise to develop and deploy a enterprise project(EAR file).
I use Java Build Path to add some other projects and link sources, and added several jar files (as external jar and user library) to my project. (I used J2EE technology and there are some default jar of course )
By myeclise deploying manager I deployed my project on weblogic base_domain and then by weblogic console I deploy it on weblogic.
All is set and there is no problem in all steps.
Now I wanna to create EAR file manually, first I created WAR file which included some jsf files and web-inf directory contains classes, lib directories and some important file like web.xml , facec-config.xml and etc.
In classes folder I have .class files which build correctly from .java files, and on lib directory**I copied all jar file from web-inf/lib directory** which created automatically by myeclipse deploying manager on weblogic base domain folder.
I added this War file into EAR file along APP-INF directory which contains all jar files from APP-INF/lib directory on weblogic base domain folder and META-INF directorywhat contains application.xml file.
When I deploy this ear file on weblogic there is so many error and problems.
Could you tell me what is the correct way to create that EAR file.
Thanks in advance
If you have an enterprise project, just export the EAR file. Right click the enterprise project, select Export, then select MyEclipse JEE->Ear File and follow instructions on the wizard (basically, specify a destination for the EAR file, on the file system). This should give you an EAR file that contains the same as what was deployed on Weblogic.
Related
Recently I have developed Java based web application and used maven for making a build.
As per standard convention, I have added all the .properties file in folder "src/main/resources". After deployment of .war in tomcat, I wanted to edit properties file without making new build. Is it possible to edit the properties ? If Yes, In which folder I can find the properties file ? (I could not find the properties file in the server /tomcat folders)
If this is a web application, inside the war,you should be able to find the contents of src/main/resources in below location:
war -> WEB-INF -> classes folder.
You can edit the properties file there, restart and it should work.
Just got to the folder where your war is located somewhere in your system.
Target > War > Web-Inf > Classes.
Make changes and redeploy.
I have a java application(not a EJB, not a MDB, it has a class implements ApplicationLifecycleListener). I build this java application into a jar file then create an EAR file include this jar, deploy the EAR file on a weblogic server, it works perfectly fine.
Now I want to use weblogic deployment plan to update some of the values in a configuration file which located inside the jar file. I generated the deployment plan, but it does not recognize my configuration XML file. I tried manually add it to the deployment plan, and use the deployment plan to redeploy this application. But nothing is updated.
I have read some examples of updating ejbs, but did not find anything about update a JAR's configuration inside an EAR, can anyone please give me example or send leave a link on how to properly use weblogic deployment plan to update a configuration file inside a JAR which is packed within an EAR file. Thanks.
You probably have to place the XML file in a jar file with same name under the same path as the original and use this jar in AppFileOverrides.
I have developed a dynamic web application in Eclipse. I am using Tomcat as a server. In my lib folder I have placed one non-jar files( addressing.mar ). This file is necessary other wise I get an error in my application.
Now I export my project as war file and then deploy the project on Tomcat server. When I run the project I get an exception because addressing.mar cannot be found in the lib folder of the project. I don't know why addressing.mar isn't exported. If I manually place file in it, it is working, but I need a better solution.
Right click the project, open properties.
Under the Deployment Assembly page, you can configure what resources to include during export and their path in the WAR file. Just include your jar there and it will show up next time you export.
So I was given a WAR 'file', but upon downloading it I noticed that it is actually a folder, not a WAR file. Trying to open this folder in Netbeans is not working, because it is expecting a war file, not a folder.
I attempted "War-ing" the folder, which worked. Netbeans can now open the file, however none of the files can be edited.
This was tested using apache's ode.war in NetBeans 8.0:
Unzip the war file
In the unzipped folder, you will see WEB-INF/, META-INF/, etc., create a sub-folder named web in the unzipped folder.
Put everything else into web (now they will be web/WEB-INF/, web/js/, ...)
Go to netbeans, new project -> java web -> web application with existing sources
Pretty much just press next all the way through. voilĂ , it's done.
If you don't have eclipse handy, just place the war file into the webapps folder of Tomcat, go to the bin folder of Tomcat and run startup. Tomcat will automatically extract the war file for you. Now go to the webapps folder and you'll find another folder there, with the same name as your war.
I couldn't find an option to import a war directly into Netbeans (strange. Perhaps someone could create this feature and submit it as a patch to Netbeans). The folder which gets extracted into the Tomcat folder can be used as the Netbeans project. It's advisable to copy it to some other folder first. Import by File > New Project > Web application with existing sources.
Eclipse has an option to export a war and include the sources with it too, so there's a chance that the source files are in the war too.
I use the jstl library in my project, but as an external jar. After exporting my project to a .war file, these libraries are not included and I'm getting errors. How do I make sure the library is included in my war file?
Also, an unrelated question, if an ear file would have only one war module, is there a point to making it an .ear instead of .war
If you have put the jstl jars inside WebContent directory they will be packed in your WAR file. But if you are loading them from somewhere else make sure that you have them in your export list (Project Properties -> Java Build Path -> Order and Export).
If you have an EAR file you can make some extra settings in your application.xml file, or even some container specific ones.