This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 1007055 - Uploading a JAR does not result in the data objects being available in the user interface
Uploading a JAR does not result in the data objects being available in the us...
Product: JBoss BPMS Platform 6
Classification: JBoss
Component: Business Central (Show other bugs)
Unspecified Unspecified
high Severity urgent
: ER5
: 6.0.0
Assigned To: Walter Medvedeo
Radovan Synek
Depends On:
Blocks: bpms6_ux/brms6_ux
  Show dependency treegraph
Reported: 2013-09-11 15:50 EDT by Catherine Robson
Modified: 2014-08-06 16:09 EDT (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Summary: Instead of the system informing the user about a JAR with unsatisfied dependencies, the system allows the upload of the JAR into a project. This then causes various issues in the Data Modeler, Guided Rules Editor and the Guided Decision Table with the Project unable to be used due to the unsatisfied dependency.
Story Points: ---
Clone Of:
Last Closed: 2014-08-06 16:09:13 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
The added JAR (9.44 KB, application/x-java-archive)
2013-09-12 04:15 EDT, Pedro Zapata
no flags Details
external-pojos.jar (2.33 KB, application/x-java-archive)
2013-09-16 11:45 EDT, Walter Medvedeo
no flags Details
error message - Data Modeler (34.93 KB, image/png)
2013-10-18 06:42 EDT, Radovan Synek
no flags Details
error message - Guided Rule editor (39.42 KB, image/png)
2013-10-18 06:42 EDT, Radovan Synek
no flags Details
Dependencies check (51.49 KB, image/png)
2013-10-23 10:19 EDT, Walter Medvedeo
no flags Details

  None (edit)
Description Catherine Robson 2013-09-11 15:50:00 EDT
Description of problem:
User had a JAR file with some classes in it and uploaded this into their M2 repository.  They then added this as a dependency to their project, but the classes in this jar were not available anywhere within the project for use.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:

Actual results:

Expected results:

Additional info:
Comment 2 Pedro Zapata 2013-09-12 04:15:20 EDT
Created attachment 796669 [details]
The added JAR

Added the cigna.jar that was trying to be added as a dependency. Please note this .jar is missing dependencies, since the underlying error is a ClassNotFound exception for a class not present in the .jar file.

However, this error should be captured and displayed to inform the user that the jar is invalid either at the project import level and/or data modeler level.
Comment 3 Walter Medvedeo 2013-09-12 12:56:50 EDT
The provided cigna.jar file, has a class "Claim" (see below) with a member "private member;" but the class is not defined in the jar file.
When the build system tries to build the project a class not found exception is thrown. And the user gets an error popup with the following message:

Error: "An error occurred when the requested data model was loaded from server". The server error is: ""

public class Claim  implements{
    private static final long serialVersionUID = 1L;
    private java.util.Date dateOfService;
    private java.lang.String claimId;
    private java.math.BigDecimal copay;
    private java.math.BigDecimal amountNotCovered;
    private java.math.BigDecimal allowableAmount;
    private java.lang.String description;
    private java.math.BigDecimal deductible;
    private java.math.BigDecimal amountBilled;
    private java.lang.String code;
    private java.lang.String patientName;
    private int age;
    private java.util.List<> listOfService;
    private member;
Comment 4 Walter Medvedeo 2013-09-16 11:42:08 EDT
When the test was done with a well formed .jar file (see the attached file external-pojos.jar) the following issue was found.

1) go to the "Guvnor M2 Repository Explorer" and upload the "external-pojos.jar" file.

2) Create an empty project

3) Go to the project dependencies and add a dependency to the "external-pojos" maven artifact loaded in step 1)

4) save the project.

5) Open the datamodeler and create a data object X.

6) Add a field Y to the data object X, of type "org.kie.external.ExternalClientBean".

(when you click on the field type combobox you will see an option " - ext - org.kie.external.ExternalClientBean". This means that you have a type to select that is form an external dependency).

7) Save the project.

8) When the project is saved you will see the following error in the "Problems window"

org.kie.external.ExternalClientBean cannot be resolved to a type
Comment 5 Walter Medvedeo 2013-09-16 11:45:25 EDT
Created attachment 798326 [details]
Comment 6 Mario Fusco 2013-09-17 09:26:57 EDT
The kproject classloader (the one also referring to the classes contained in external jars) was used to compile drl, but not java classes. I fixed this here
Comment 10 Radovan Synek 2013-10-18 06:41:28 EDT
Using external-pojos.jar as a dependency works just fine - I am able to see packages and class from this jar in Data Modeler, Guided Decision Table Wizard, etc.

However, using the cigna.jar results in buggy behaviour of all editors I tried with:

Guided Rule editor: Opens with white screen, no ability to edit, error message appears - see the attached screenshots.

Guided Decision Table: the same behaviour as Guided Rule editor. I case GDT with wizard has been chosen, the table cannot be even created - clicking on "OK" on "Create new" screen is without any response.

Data Modeler: Error message appears, after that there are no classes and no packages available. I expected to see classes and packages from the project and from other JAR files, but there is simply nothing.

I wonder if the JAR with unsatisfied dependencies could be somehow isolated and user informed about this JAR won't be included in the project? Using such a JAR as project's dependency should not break Business Central in this way.
Comment 11 Radovan Synek 2013-10-18 06:42:21 EDT
Created attachment 813710 [details]
error message - Data Modeler
Comment 12 Radovan Synek 2013-10-18 06:42:49 EDT
Created attachment 813711 [details]
error message - Guided Rule editor
Comment 13 Prakash Aradhya 2013-10-21 12:00:59 EDT
Walter, can you clarify what you mean by well formed jar ?  
Are there steps user should take defining the dependencies and/or create some definition file before uploading it ?
If so, it needs to be documented clearly.  Also, there should be appropriate error shown to the user if uploaded file does not meet the definition.
Comment 14 Mario Fusco 2013-10-22 04:55:39 EDT
There's no much I can do on the core side about this. I am reassigning this ticket to Walter who will trigger the project building in a try/catch block in order to try to report the problems encountered during the compilation phase in a more graceful way.
Comment 15 Walter Medvedeo 2013-10-23 10:17:59 EDT
Additional verification was added in order to detect mal formed .jars like the cigna.jar as earlier as possible. Typically when we manage the dependencies for a given project.

When we set the dependencies for a project and save it, the project is compiled. At this moment we will try to detect also errors in the dependencies .jar files. Obviously an external .jar file can have whatever thing, and eventually can come from whatever origin. So it can always have errors that we cant detect, etc.

With the verification added we can at least detect some mal formed cases like the cigna.jar and give some feedback to the user in the "Problems" widget.
When the user saves the project, If we detect an error in the dependencies jars It will be informed in the "Problems" widget.

In the attached screen I show the error message that the user will get when he updates de dependencies for a proyect using the cigna.jar file. (You must save the project in order to materialize the changes and do the internal verification)

Responding the previous query, a "well formed .jar file" in this context is a .jar file that don't have missing clases like the cignar.jar.
The cigna.jar file isn't well formed, because it have the following scenario.
A class X uses a class Y, but the class Y is not in the .jar file, and that's why this cigna.jar file generates the error.
Comment 16 Walter Medvedeo 2013-10-23 10:19:55 EDT
Created attachment 815438 [details]
Dependencies check
Comment 17 Walter Medvedeo 2013-10-23 10:21:28 EDT
The described improvement was implemented in the following commits.


Comment 18 Radovan Synek 2013-12-03 07:19:21 EST
Verified on BRMS-6.0.0.ER5

Note You need to log in before you can comment on or make changes to this bug.