Jboss 4.2.3 custom shared lib - deployment

I am in the process of moving the shared libraries to some custom jboss lib folder.
Right now as I see, libs are placed under
1)Jboss/lib folder
2)Jboss/server/FM/lib
3)WebInf/Lib in the webapp's
Now I want to move some of the libs which are shared by the webapp's in shared lib but not under jboss/server/FM/lib as I want them to at separate folder something like below:
jboss/server/FM/lib/custom.
I would still like libraries to loaded from Jboss/server/Fm/lib as well.
Is there any way to do in Jboss 4.2.3
I had a look at the similar questions on stackoverflow but I couldnt find any satisfactory answer.
Thanks

Just add in JBoss/server/TM/conf/jboss-service.xml after line
<classpath codebase="${jboss.server.lib.url:lib}" archives="*"/>
another line
<classpath codebase="${jboss.server.lib.url:lib}/custom" archives="*"/>
and restart.

Related

ext plugin not working in liferay 6.1.2 jboss7

I created an ext-plugin for extending Liferay LDAP DefaultPortalToLDAPConverter. I created an ext plugin in eclipse. In the ext-impl/src/main/java/com/liferay/portal/security/ldap/CustomPortalToLDAPConverter i extended DefaultPortalToLDAPConverter and kept only the changed methods in my class. Also I added in ext-spring.xml
<bean id="portalToLDAPConverter" class="com.liferay.portal.security.ldap.CustomPortalToLDAPConverter" />
and then deployed the ext. The deployment went well without any errors. But the changes did not take place. Is there anything wrong in what I am doing? I use jboss7.1.1-final bundled Liferay6.1.2. I build using maven and then deploy by placing the war file in liferay-home/deploy. Then I tried restarting the server. Now I could see that my ext-spring.xml is missing in the jar file. Is there any specific reason for this? Please help.
Most of the tutorials say that the META-INF should be placed in the ext-impl/src or ext-impl/src/main folder. Doing so was not placing my ext-spring.xml in the jar build. Shifting the jar to ext-impl/src/main/resources helped and the META-INF was detected. Upon restarting, the changes took effect.
Not compiled files that are meant to be put inside of class-path of resulting artifact should be placed in main/resources path: http://maven.apache.org/guides/getting-started/index.html#How_do_I_add_resources_to_my_JAR

Where is the bin folder of GWT Internal Jetty Server in DevMode?

I need to put some property files (config file required by a library) in the starting path of the Jetty server in DevMode but could not figure out where to put them. Where should I put them?
I googled but no luck for that. Any help is appreciated.
You need to share your project set up information. Maven? Also mention whether property file is for app or jetty and what you are trying to achieve.
Also you can try putting up the properties file in web-inf/classes if it is project specific.
I am guessing you are not using any standard GWT project set up. It will be very difficult to proceed further even if you get this solved. I recommend you should go with gwt standard set up. You can reference GWT samples folder from here.
Use Hello project set up as template. If you are beginner also read up on https://developers.google.com/web-toolkit/doc/latest/RefCommandLineTools#webAppCreator.
If you use maven in your project, placing them in the src/main/resources should work.
Otherwise put it in your WEB-INF/classes

JBoss Custom lib directory

I have this third party framework which comes with a huge set of dependent libraries, which by the way, have not yet been indexed in any Maven repository. I want to use this framework with some Web Apps, but for obvious reasons I don't want to put all those libraries under WEB-INF/lib, neither do I want just to place them all under server/default/lib to avoid mixing them with other local and third party libraries.
Is there some way under JBoss 4.2.2 or higher to specify a custom lib directory for certain Web Apps? It's possible and/or advisable to have something like server/default/lib/myAppLib?
Any suggestion on this regard?
You can add the following entry in your server/default/conf/jboss-service.xml for putting your jars in server/default/myLibDir:
<classpath codebase="myLibDir" archives="*"/>
To my knowledge, you have three options:
Package you WARs in an EAR and move the library JARs out of WEB-INF/lib and
place them in a lib folder at the root of the EAR. No extra configuration required. This (non portable) solution is described in Configuring JBoss shared libs.
Move the library JARs out of WEB-INF/lib and place them into server/xxx/lib.
Deploy the JARs in the deploy/ folder and disable WAR file class loader isolation.
I don't recommend option #3. Option #2 is what you don't want. This leaves us with option #1 (which is IMO the cleanest).
Related questions
Jboss shared library
In JBoss can I configure a “shared library” location?

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.

NetBeans Library using JNI

Can I have a Library defined that makes use of JNI in NetBeans?
Seems the library definition only allows Jars or Folders.
How can I assure that the DLL follows the jar file when the app is built?
Assuming you are referring to building a NetBeans Platform App (or module), then you can place the DLL in the "release/modules/lib/" folder. This is per the platform FAQ:
http://wiki.netbeans.org/DevFaqNativeLibraries
Additional information here:
http://bits.netbeans.org/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/api.html#jni
If you are asking more generally, then I think most people package the DLL inside the jar, then extract it to a temp location upon application startup. e.g.
How to make a JAR file that includes DLL files?
If that's not what you're looking for, then you'll need to provide more information as to what you're trying to do.
netbeans won't do it on its own, but since it uses ant behind the scenes there's a workaround.
you should create a subdirectory named jni in your project directory (c:\path\to\mynetbeansproject\jni), put all the .dll, .so and .jnilib files in there (the native stuff), and add the following lines to the build.xml file you find in your project directory, just before the </project> tag:
<target name="-post-compile">
<copy todir="${dist.dir}/lib">
<fileset dir="jni" />
</copy>
</target>
then add the jar file to your project just like you always do. :)
the snippet you inserted in build.xml will make sure that the native libraries follow your jar files in the dist/lib folder when you invoke "Clean and Build" from within netbeans (or ant from the command line); the jvm will look for the .dll (.so, .jnilib) files in the same directory as the .jar that's loading them, so it will work.
note that this won't make your project run from within netbeans, because… I'm not really sure what goes on, but it looks like the library path (LD_LIBRARY_PATH) doesn't include your projects' libraries, and there's no way I know of changing it from within netbeans. just put your native libraries in /Library/Java/Extensions on mac os x, or just stash them in c:\windows\system32 under windows. if you're running a 64 bit windows with a 64 bit jvm, I have no clue; if you're running linux, you probably know where to stash them, but /usr/lib/java might be a good bet.
I tested the following solution while using NetBeans 7.0.1 and it worked, but I don't know if it works in early versions, too.
The solution is easy and works per NetBeans module. So, if you have a suite, don't place its JNI files into suite project, instead, place the JNI files that you want into the module itself. Do:
Find a NetBeans module project that you want (or need, or think) to place your JNI libraries (them with extension .DLL, .so and .jnilib, by eg);
At Projects, right click at the module node, click at Properties menu;
In the Project Properties dialog, click at Libraries and Wrapped JARs. You must add any external library there. I added the RxTX jar library. After add your external libraries, the Netbeans Ant script will copy all files/folders from the directory your_project_dir/release to the right location when you build the solution.
So, place your native libraries at your_project_dir/release/lib. If you want, you can create subdirectories for each target platform that you need, as: your_project_dir/release/lib/amd64, your_project_dir/release/lib/sparc32
To know, more, read:
http://bits.netbeans.org/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/api.html#jni
Regards,
marciowb.info