I am trying to deploy an EAR file in JBoss. After doing some research, I learned that it can be extremely complicated.
First off, the structure of the ear file:
I am trying to migrate this over from a weblogic deployment, so I realize that the APP-INF directory might not be JBoss specific, but i would like to try to keep the structure if possible.
In the jboss-app.xml file, I have the following:
and in the applicationl.xml I have this:
Anyway, my problem stems from the fact that while all the jar's are added properly to the classpath (by adding <library-directory>lib</library-directory> to the application.xml file), but the APP-INF/classes directory is not. (on a side note, is having the <library-directory> element and module elements for the core.jar and tag.jar files redundant? These are in the lib folder, in addition to 3rd party libs that are not my company's code) Unfortunately, I have no idea how I would add this directory as well. I would like to stay away from modifying all the individual war files' manifest files if possible.
I tried adding a <classpath> element to the jboss-service.xml file in the conf directory of the server configuration, but it didn't work.
What is the right way to do this? I am fairly new to JBoss (and to a lesser degree, the world of application servers and ear deployments), and still don't think I fully understand the JBoss way of doing things, but I'm tasked with this so I need to learn by doing, and hopefully learn the right way in the process to streamline this ear deployment and make it as standardized as possible.
Here are some sites I've been looking at that gave me some guidance, but didn't seem to address this specific issue:
RedHat Deploy EAR with EJB3 JAR
Raible Designs JBoss ClassLoader Logic
Detail Focused JBoss EAR Classloading
Thanks in advance for any help.
Mike Mall wrote: (on a side note, is having the <library-directory> element and module elements for the core.jar and tag.jar files redundant?
Yes, that makes it redundant. I would recommend removing that entry from the application.xml.
and hopefully learn the right way in the process to streamline this ear deployment and make it as standardized as possible.
The only way to standardize this is to remove the dependency on the APP-INF folder, which is weblogic specific
But if that's too complicated, then maybe there is a possible way to get this working in JBoss AS (not sure of other application servers). Which exact version of JBoss AS do you use? Depending on the version, we probably might be able to try and get this to work.
Oh yea, sorry I completely forgot to add that information.
I'm using JBoss 4.3. And ideally I would like to make the ear standardized for JBoss, but in case that doesn't fly with management and other developers, I might have to keep the APP-INF folder and/or the current layout. So, keeping that in mind...
Would it be better to remove the module elements for the two jars or the library-directory element? I don't know why those two modules are there (considering that in total there are about 30 libraries that are used), but I'm assuming the previous coder had some reason to add the two in house jars there, or he/she did not know JBoss that well. But from my understanding, you are basically staying that I can either a) add all the jars (first and third party) as module elements in the application.xml (which I have seen suggested on other sites, although that would be a pain to do for all the jars involved, and would have to be modified if any new jars are added or removed), or b) just add the library-directory element and point to lib (or remove it all together since lib is the default directory anyway).
Following (b), is it kosher to just drop the classes directory with all the properties files into the lib folder? I'm assuming that the classpath would be generated using the lib directory and then recursively down into classes and any subdirectories after that. This does not seem like the cleanest solution however.
Anyway, thanks for the continued help!
I went ahead and did some more research and tried to change the UseJBossWebLoader attribue in the jboss-service.xml of the jboss-web.deployer to true, but that didn't help. I tried adding the lib directory to the MANIFEST.MF file in the war, that didn't help. I tried adding the jars as modules in the application.xml, and that didn't help. This actually caused the classes directory to not be found in the classpath for some reason.
So im back at the current error which seems to tell me that the war can't access a class in a library on the classpath. It is my understanding that if UseJBossWebLoader is true, then the manifest files in each of the wars do not need an explicit Class-Path definition since the JBoss classloader handles it. Tried that (tried both deleting the entire class-path and keeping the auto created path in place in the manifest file in the war), didn't solve anything. Tried the other way, by adding the explicit jar that it said it was missing to the manifest file and changing UseJBossWebLoader to false, and it actually took a step back by throwing an error that said it couldn't find the properties files in the classes directory that I put in lib.
Any suggestions? Any ideas on a good starting point? It bothers me that some of these changes (which seem to just overlap one another in terms of classpath definition) result in such different errors, which leads me to believe that there are more problems than just a classpath issue.
Thanks in advance.