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.
Related
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.
I'm using Eclipse Neon 4.6 and Tomcat 8. I have my deployment assembly set with external jars via user libs and dependent projects. When I clean and build the project only the dependent project's jar files are added to Tomcat's WEB-INF/lib folder, not the 3rd party external jars even though they are specified in user libs and the lib is in the deployment descriptor. Any ideas as to why Tomcat isn't automatically coping the user lib jar files? One interesting note is that if I put the jar files in the project's WEB-INF/lib folder they are not picked up at run time either. I have also tried adding WEB-INF/lib to the deployment descriptor without any luck.
So I figured this. Turns out I correctly had libraries as dependencies in the project but did not mark them for export in Project | properties | Java build path | Order and Export. I had to check the libs for export. Now they are included in the WEB-INF/lib folder when I create the project WAR file.
I am using JBOSS 7
In my custom jar I am implementing an Interface. The interface is in a jar packaged with ECM.ear file. Unless I put my custom jar inside the web-inf/lib folder (of the war file located in ear file) I am getting ClassNotFoundException w.r.to the interface.
I created a module for my custom jar but I don't how to set up a dependency with ear file. I copied the jar containing the interface say mdm.jar and placed it in the module and also added an entry in the resource root of module.xml. After restarting I am getting ClassNotFoundException for the classes referred by mdm.jar, which arein ear file.
How to achieve this dependency?
Thanks,
Raghu
JBOSS 7 needs you to place the packaged jar files in the lib folders of your web-inf/lib or the ear/lib cos of the Class Loading Precedence that JBOSS server follows.
Alternatively you could load it as a module, but you need to specify any addition of this kind outside of JBOSS default supplied modules using your MANIFEST file or jboss-deployment-structure.xml
This link should provide you more insight on what would suit you best.
Hope it helps.
I have the log4j.properties and another .properties file under src and it works deployed in gwt dev mode. To build the war to launch to tomcat I use an ant script that compiles the .java classes and puts them in a JAR file. The JAR file gets copied into the WEB-INF folder in the war file.
The app runs fine when I don't use log4j but it can't find the properties file when I attempt to use log4j. All of the answers I see say WEB-INF/classes, but my project doesn't have a WEB-INF/classes directory, instead the JAR file that was copied to WEB-INF contains my projects classes.
You have to put log4j.properties (or log4j.xml) file into directory or JAR that is considered by your servlet-container as resource in Classpath.
So, simply create WEB-INF/classes directory and put it there, or pack it into your JAR.
See also Where should I put the log4j.properties file? - it could be useful.
I have a proprietary application and its war file is available to us. I need to basically add a jsp page to the current application.
I was thinking i will write the independent jsp, java files build a war and add it to the proprietary war file.
Or
i will write the jsp, java files and add it to the same war.
Can i make a new war and make the proprietory to interact..
Which option is better.
I think you could unpack the war, then add your jsp. After that, re-build the war file.
Yes. Just unpack the war and add your custom content. Your libraries go in WEB-INF/lib and your classes in WEB-INF/classes. You can also add servlets, filters, and listeners to web.xml as needed.