Unable to access .ear/lib jars in ear's subdeployments - jboss

Some utility jars which are required by multiple EJBs are in the .ear\lib folder, and these jars should be available for all the EJBs but EJBs can not access classes of lib folder.
This structure was working fine in wildly 10.1.0 but after migrating to 20.0.1, it is not working.
Can someone help me, why lib files are not loaded?
Thanks

Related

JBoss equivalent for Weblogic APP-INF/classes

In Weblogic, inside an EAR, you can put classes under APP-INF/classes folder. These classes are shared across all EAR modules (WAR's, EJB's, JAR's).
Does JBoss allow any similar path?
We do not want to package these classes under a JAR.
I found a workaround with the JAR "upacked" libraries. I put all my classes under a folder lib/myFakeJAR.jar/, where lib is the libraries folder of my EAR.

JBoss jar library files

In JBoss, if you have an ear archive file, the way to tell the environment the place
of the lib folder, where it can find the library files, is the application.xml file.
Now I splitted the ear file into separate .war and .jar files. I do not have an ear folder anymore, so I deploy the war and jars directly in JBoss.
In the war archive I have the html and servlet files. In the jar archive I have the bean files. Now the library files are just needed by the java beans, not by the servlets.
So I need a folder in the .jar file to put the lib files and a way to tell the system the place of this folder.
If you want to have your jar libraries inside an ejb-jar: you can't, the standard specification doesn't allow you to have a jar inside another jar. Maybe some vendors provide specific solutions for that, but those are not standard. The standard solution would be to place all the related jars inside an ear. What you can do, and it's standard, is placing library jars inside the WEB-INF/lib directory of a war; but ejb-jar don't provide a similar structure.

How can I specify an external dependency in JBoss 5

OK so I have a couple of jars that I need for my JBoss application to run. Under normal circumstances, I would just copy these jars into my apps WEB-INF/lib folder and rock on.
However, these jars are part of a third party library and they have dependencies on a whole host of .dlls and other stuff in the directory where they live. So I can't just copy the jars because the copies won't work because they don't have all of the stuff surrounding them like the originals do.
What I want to do, then, is tell JBoss where to look to find these jars, which will be in C:/Program Files/SomeDirectory/Common. I tried just adding these jars to my ClassPath, but that doesn't work because JBoss's classloader won't use that for user apps (right?).
Is there a way I can tell JBoss's Class loader "Hey, look over here! These are the jars you want!"?

Eclipse user library variables and jar export to WEB-INF/lib

I have a workspace with nearly fifty web projects in it. In an effort to streamline classpath entries, I have created a user library variable and added all required jars to it. Next, I removed the individual classpath (build) entries from each of the fifty projects and replaced them with my single user library variable. Everything was going great until I deployed one of my projects from Eclipse to Tomcat and discovered the list of jars on the user library variable were not being copied to the WEB-INF/lib folder.
Does anyone know of a way to specify that these libraries get copied to the deployment source? I experimented with the Java EE Module Dependency tab, but the jars were not copied even after selecting the name of the user library set.
Try FatJar
From my experience, Eclipse is not good at packaging all external Jars for you, but FatJar will do the trick.

tomcat 5.5 web.xml change WEB-INF/lib directory

I have a jruby rails app that has some jar dependencies in rails lib/java. I prefer this to just putting them straight in lib as it separates my java libs from ruby libs. Works locally using jruby. Problem is, on deploy, tomcat is looking for a bunch of these jars (such as jruby) in WEB-INF/lib, not WEB-INF/lib/java.
I think i need to put some config in the web.xml that tells tomcat to also look in lib/java, but i can't find ANY docs on the matter.
I don't want to modify tomcat's system wide classpath, I just want to tell its class loader to check a directory other than WEB-INF/lib for this particular app only
Can anyone enlighten me on how to do this?
you can't change this directory, j2ee spec says that all libs go in WEB-INF/lib. That is where they are supposed to go.
Just stay with your two directories in your project folder, but join them, when creating your .war file. This should be pretty easy with apache ant and other build tools.