How to use jBPM 6 as JBOSS EAP module? - java

I have a number of web applications under JBOSS EAP 6.2 which use jBPM 6.
jBPM jars take about 20MB in each WEB-INF/lib so I decided to move them into a separate JBoss module. After that I have issues with classloading because jBPM module's classloader tries to load classes by name defined in web applications and fails to do that (ClassNotFound errors).
So my question is there a way to use jBPM 6 as a JBoss module OR is there a way to load jBPM module's classes using web applications classloaders?
Thank you!

There are modules containing core jars available out-of-the-box:
http://repository.jboss.org/nexus/content/groups/public/org/kie/kie-eap-distributions-bpms-layer/
The slim workbench war using these modules is available here:
http://repository.jboss.org/nexus/content/groups/public/org/kie/kie-eap-distributions-bpms-webapp/
Note that the latest snapshots are targeted to eap 6.3.0.

Related

Using Jboss Arquillian with to ShrinkWrap jboss modules

I have a application which contains the following
some server side logic which are bundled as a jboss module
The EJB layer which is bundle into the EAR
The RESTful layer which is bundled as a war which is in the EAR
Both the EJB and RESTful modules depends on the server side logic modules which are jboss modules. This server side logic has dependencies to other modules such as guava, hibernate, and some home grown modules as well.
Now i want to use Arquillian to write some tests to both EJB and REST layers. But to do that i cannot find any reference how i can include the jboss modules i have in the ShrinkWrap.
I tried searching for documentation but i couldn't find any reference. I only found ShrinkWrap Descriptor library for jboss modules, but not how to ShrinkWrap a complete jboss module with the required jar files.
It would be great if someone point me to a documentation or sample which shows how to ShrinkWrap a complete jboss module.

Can I use jax-rs with j2ee 1.4

I have a 1.4 EAR deployed on WAS 8.5+.
I've created a JAX-RS RESTful service WAR bundled inside the EAR. Ive got a ton of deployment scripts related to this EAR, so I'd prefer not to deploy the war separately.
When reading docs, it's all about JEE6+ compliance
Has anyone actually done this in the real world?

multiple wars on a single tomcat server with different spring

I have two WAR files that i need to deploy on a server.
the catch is that i cant run another tomcat on that server.
deploying two WAR files is easy but, is it possible to run them both while one of them uses
Spring 3.8
and the other one uses
Spring 4.1.4
which is the latest version?
Will it conflict?
answers like "try it out" are acceptable :) but i need to know for sure so i wont have issues in the future.
Thanks
See the following for an explanation of how Tomcat's classloading mechanism works:
http://tomcat.apache.org/tomcat-7.0-doc/class-loader-howto.html
WebappX — A class loader is created for each web application that is
deployed in a single Tomcat instance. All unpacked classes and
resources in the /WEB-INF/classes directory of your web application,
plus classes and resources in JAR files under the /WEB-INF/lib
directory of your web application, are made visible to this web
application, but not to other ones.
If, then, the Spring Jar files are bundled in WEB-INF/lib for each application then you will have no issues. An issue would only arise if they were in some shared location.
two different application under tomcat has two diffferent classpath and classloader so they don't conflict
latest as of today is 4.2.0 (under dev), you can keep track at http://projects.spring.io/spring-framework/

Jboss hibernate jar conflict

We use Jboss 5.1 in which we deploy several of our applications. Now, Jboss has a version of hibernate jars in its common/libs. One of our application uses a newer version of hibernate jars. So, we had the dependency jars packaged in the war that gets deployed in Jboss. The application gets deployed fine, but when we try hitting in, it throws the below exception.
My suspicision is that Jboss is using its own version of hibernate jars, but not the ones packaged in the war....How do i make Jboss uses the hibernate jars that come from the war but not from its common/lib
I prefer to make a change in the concerened application, but not in Jboss as there are several other application which live in the same Jboss instance and I do not want to mess them up by modifiying jars in jboss/common/lib
SEVERE [ContainerResponse] The exception contained within MappableContainerException could not be mapped to a response, re-throwing to the HTTP container
java.lang.NoSuchFieldError: INSTANCE
at org.hibernate.type.StandardBasicTypes.<clinit>(StandardBasicTypes.java:45)
Java EE class loaders are a hierarchy:
Bootstrap
App server
Application
Since the app server class loader finds its version of the Hibernate JARs first, your app is out of luck.
You have to tell JBOSS to prefer application class loader JARs. Google for the config to do so; I don't remember it.
check this link out.. http://huima.wordpress.com/2011/09/16/having-fun-with-jboss-classloader-or-how-i-figured-out-how-to-get-my-application-to-work-in-jboss-5/
there are other links inside the article that explains JBoss class loading in detail, which you could check out as well.
The way I have done it before is by adding jboss-classloading.xml inside WEB-INF of the war with the below contents
<classloading xmlns="urn:jboss:classloading:1.0"
name="yourapp.war"
domain="IsolatedDomain"
import-all="false"
parent-first="false" >
</classloading>

Ear and war for jsf1.1 with tomahawk and ajsx4jsf

I am developing an application with ejb and jsf with tomahawk and ajax4jsf and jsf-api jsf-impl jars at WEB-inf/lib folder..
I have put other jars like iText and POI jars at ear root and it works fine with manifest in war pointing at the ear root..
Do i need to put jsf-api.jar at ear root?
What other jars should I put in WEB-INF/lib folder..(Should I put 'commons' jar in WEB-INF/lib or at EAR root..? )
It depends on your runtime environment, what libraries you need. What webserver/container do you use? Because of the different web- and application server, there are different libraries provided by the vendors. Sometimes you have to configure your own jars, sometimes not. I think with Apache Tomcat 7 you have to add the JSF files to your lib directory. But by using JBoss or Glassfish you don't need it, because they are Java EE 6 (Web Profile) certified. By the way, what JSF, EJB and a4j version do use? It looks like some old stuff. I guess you are using an application server, because of EJB. In that case you don't have to add the libraries of JSF and Apache Commons, because the AS will provide it usually.
I would recommend to create a Maven Project. It is not so difficult at all and you can define the libraries in one XML file.

Categories