0

I'm developing a custom application for IBM BPM that uses these libraries: Jace.jar, pe.jar, log4j.jar, stax-api.jar, xlxpScanner.jar and xlxpScannerUtils.jar that are used to call a web service.

When I create a java project and add those libraries, it works fine. It also works ok when I create a dynamic web project using tomcat 8 as server; but when using jboss I don't get the expected result when calling the web service. So, does anybody know how to disable the modules that use these libraries? Or where to find information about it?

I want my application to be server independent.

This is my code:

try {
     VWSession vwSession = new VWSession("userName", "userPass", "connPt");
     vwSession.isLoggedOn(); /* It's loaded with 'false' value in jboss. 
                                In tomcat it's loaded with 'true' value */
} catch (Exception e) {
     Logger.getLogger(getClass().getName()).log(Level.FATAL, "Details: ", e);
}
iperezmel78
  • 415
  • 5
  • 20
  • were you able to resolve this @iperezmel78 ? – Sampada Jun 20 '16 at 07:16
  • hi @sampada. Thanks for your reply. I cretaed a module with the required libraries and put the reference in jboss-deployment-structure.xml like you said, but I can't log in trough the web service. I get response from it but the property isLoggedOn() that I obtain contains 'false' value. In tomcat this value is 'true' and don't know what is going on. – iperezmel78 Jun 20 '16 at 16:01
  • Can you post that part of the code? – Sampada Jun 20 '16 at 16:12
  • VWSession is part of IBM's FileNet API. You will need to add the jars from IBM to your module to make this work. – Sampada Jun 21 '16 at 05:35
  • Yes, @Sampada, I have added required jars. The problem is that if I run the project using tomcat 8 it works!. Don't know what's going on jboss server. – iperezmel78 Jun 21 '16 at 22:17
  • Tomcat is an HTTP server and servlet container, whereas JBoss is a full blown Java EE application server. In a lay man terms, tomcat will use your compile time jars in the servlet container to run your application. A Java EE app server will need specific deployment instructions along with what jars to use at deploy time. – Sampada Jun 22 '16 at 02:57

1 Answers1

0

To create an application that is server agnostic, you need to strictly adhere to Java EE specification. Meaning, use only those jars that are bundled as part of the Java EE version you are using. Then too, there are certain deployment descriptors specific to a given application server that would need to be used in some cases. For example - jboss-deployment-structure.xml, ibm-application-bnd.xml, etc.

In your case, xlxpScanner.jar is not a part of the Java EE spec, so making the application server independent is not possible with the current settings. You could look for a replacement of the part of this jar you are using with something Java EE has. In short, get rid of this jar alongwith xlxpScannerUtils.jar.

Alternatively, if you want jboss to run the application properly, add all the jars in a module and give it to the EAR/WAR using jboss-deployment-structure.xml. Details can be found here.

Arjan Tijms
  • 37,782
  • 12
  • 108
  • 140
Sampada
  • 2,931
  • 7
  • 27
  • 39