I have developed a web-service client and tested it as ear on local jboss always. this ear work fine. Now I want to create war for this application. whenever I tries:
project:export:war file
in eclipse, it creates war without any third party dependency jars files added to it. This war does not gets deployed on jboss successfully.
Can anybody guide me hw to create war from ear.
you cannot create war from ear. ear is enterprise archive, and war is web archive. ear may contain many war files. So when you are creating war using eclipse, it creates a web archive. To add your third party jars, put them into the lib folder of your web application, that way it will be included into your war.
Related
Can I deploy an application without WAR/EAR in JBoss 6.4.0 eap ?
I need to migrate an application from Weblogic to JBoss. Is it possible to do so without creating the WAR ?
Deploy your app as an exploded set of files within directories, rather than packaged up within war and ear files. For example, assume you have xxx.ear which contains aaa.war. Under the deploy directory, create a directory named xxx.ear. In that directory create two more directories aaa.war. Into those directories place the contents of the two war files. Also, in the xxx.ear directory place the rest of the contents that would have been in the ear file, such as the META-INF/application.xml file.
Now, for example, you can easily add deploy/xxx.ear/aaa.war/some-new-file.html or edit deploy/xxx.ear/aaa.war/some-file.jsp.
I recently migrated from JBoss EAR 6.4.0 to 7.0.0. In my deployments folder, I have a EAR containing numerous JAR files of my project. When I unpack the file after building, all files are there as desired.
But as soon as I start the server and the EAR file gets unpacked by JBoss, a couple of my project JARs vanish. The files are simply not there, so my server starts incompletely and my EJB client cannot connect ("No EJB receiver for handling...").
Is there any 'smart' mechanism in JBoss that may cause this behaviour?
My colleagues are working on the same project (but different IDE) with no problems.
You must specify each jar as a module in the application.xml file in the ear context.
<display-name>Your-ear-file-display-name</display-name>
<module>
<java>YourEJBJar.jar</java>
</module>
...
I have an enterprise application .ear which includes few war files.
My .ear file also includes the jersey-server.jar and log4j.jar
These jar files are also part of the shared library that is mapped to the ear.
I would want to remove these files from ear altogether as they are already part of shared library.
when i remove these jars from ear, the http resource that is part of the war files goes unrecognized, 404 error and logs are not redirected to log files.
Can't I remove these files from the ear, use just shared libraries, which helps in reducing the size of the ear ?
Application is deployed in Websphere 8.
Thanks,
Ravi.
I have an application which I am deploying on GlassFish. It has an EJB-tier with (JPA) Entites and EJBs to get access and write to the database and it has 3 (independent) web apps. Everything is built with Maven.
ServerApplication
|
+-ServerApplication-ear
+-ServerApplication-ejb
|
+-GrumpyCat (war)
+-HummingBird (war)
+-Koala (war)
All three war projects depend on the ejb project. When compiling/building the ear, it copies the war files to the ear project and then I can deploy the ear file on GlassFish.
This works fine, all 4 modules (the ejb, and the 3 war) get deployed without problems and I can access the 3 war projects like:
myServer.com/GrumpyCat
myServer.com/HummingBird
myServer.com/Koala
My problem is, that I can't deploy a single war project on its own. For example when I change something in the koala project, I would like to be able to build only the koala.war and deploy it on the server, without having to upload and deploy the complete ear file.
But when deploying, GlassFish tells me either :
there is already a project deployed on Koala (true, it was deployed together with the ear)
or (when I change the build-version) it doesn't "know" the ejbs and I get a number of ClassNotFound Exceptions.
Is there a way to deploy the modules of the application one by one?
Your second approach is the way to go if you really want to deploy them individually. However, you are seeing a ClassNotFound exception because the WARs are individual projects and as such don't have access to the EAR's class path.
To make that work, you have to add the public API of your application to your WAR's classpath. The public API consists of at least the EJB's remote interfaces of the EJBS that you would like to access from the WAR and any DTOs used in your API.
The easiest way is to create a separate package (such as com.example.api) and let a build tools such as ant or Maven bundle that api package together with your EJBs and your WARs, or you create a myapp-api.jar and include it in the respective class-paths.
Then you can remove the WARs from the EAR and deploy them as separate projects.
Say there is a ear1, inside ear1 there are war1 and war2. Structure likes below
ear1
lib
war1
war2
We use glassfish as the server and maven as the build tool. After deploy the ear1 onto glassfish, war1 got broken which because of a jar inside WEB-INF/lib of war2.
I have to pointed out this jar file is not in the lib directory of ear level or in the war1.
After remove that jar in war2 in the glassfish server application directory and restart glassfish, war1 will be ok. But the thing is war2 need that jar in order to work.
I have no idea why war1 will pick up that jar in war2 runtime and how to solve it.
I do not know if this would be possible for you. But what if you create a project as a pom.xml (aggregator) and inside it, some different submodules (lib, war1, war2). And instead of deploying the whole ear in the server, deploy separately in the server the war1 and the war2.