Bug 1100187 - business-central fails to build a project which depends on org.springframework:spring-jdbc and com.sun.xml.bind:jaxb-xjc
Summary: business-central fails to build a project which depends on org.springframewor...
Keywords:
Status: CLOSED EOL
Alias: None
Product: JBoss BPMS Platform 6
Classification: Retired
Component: Business Central
Version: 6.0.1
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ER1
: ---
Assignee: Mario Fusco
QA Contact: Ivo Bek
URL:
Whiteboard:
Depends On:
Blocks: 1115479 1115481
TreeView+ depends on / blocked
 
Reported: 2014-05-22 08:13 UTC by Toshiya Kobayashi
Modified: 2020-03-27 20:11 UTC (History)
6 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2020-03-27 20:11:38 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Toshiya Kobayashi 2014-05-22 08:13:53 UTC
Description of problem:

This is a continuation of BZ1099393.

There seem to be more cases to be handled as WARN rather then ERROR in org.guvnor.common.services.builder.Builder.build().

A) java.lang.SecurityException

If you have a dependency of org.springframework:spring-jdbc in a project, "Build & Deploy" fails and you will get ERROR logs.

====
16:42:50,559 ERROR [org.guvnor.common.services.builder.Builder] (http-localhost.localdomain/127.0.0.1:8080-2) Verification of class org.apache.derby.client.ClientXAConnection failed and will not be available for authoring.
...
====

The root Exception is not logged but with a debugger, I observed:

  java.lang.SecurityException: sealing violation: package org.apache.derby.jdbc is sealed

B) java.lang.NullPointerException

If you have a dependency of com.sun.xml.bind:jaxb-xjc in a project, "Build & Deploy" fails and you will get ERROR logs.

====
16:58:16,905 ERROR [org.guvnor.common.services.builder.Builder] (http-localhost.localdomain/127.0.0.1:8080-2) Verification of class 1.0.com.sun.tools.xjc.runtime.Util failed and will not be available for authoring.
...
====

The root Exception is not logged but with a debugger, I observed:

  java.lang.NullPointerException

Because kieModuleMetaData.getClass() returns null and then a NPE is thrown in getClassSource().

Builder.java
====
                try {
                    final Class clazz = kieModuleMetaData.getClass( packageName,
                                                                    className );
                    final TypeSource typeSource = getClassSource( kieModuleMetaData,
                                                                  clazz );
...
                } catch ( Throwable e ) {
                    final String msg = MessageFormat.format( ERROR_EXTERNAL_CLASS_VERIFICATON,
                                                             fullyQualifiedClassName );
                    logger.error( msg );
                    results.addBuildMessage( makeErrorMessage( msg ) );
                }
====

Probably it should be treated as WARN as soon as kieModuleMetaData.getClass() returns null.

Steps to Reproduce:

1. Create a new project in business-central
2. "Add" these dependencies in Project Editor.

 Group ID : org.springframework
 Artifact ID : spring-jdbc
 Version ID : 3.1.1.RELEASE

 Group ID : com.sun.xml.bind
 Artifact ID : jaxb-xjc
 Version ID : 2.2.1.1

3. Press "Build&Deploy"

Actual results:

ERROR level messages are logged and build failed.

Expected results:

Only WARN level messages are logged and build successful.

Additional Information:

In addition to the above, can you fix Builder.build() to log the original Exception?

Comment 1 Mario Fusco 2014-06-13 08:13:13 UTC
Fixed by https://github.com/droolsjbpm/guvnor/commit/9e42c09bf

Comment 3 Mario Fusco 2014-07-17 08:03:47 UTC
Cherry-picked to 6.0.x branch with https://github.com/droolsjbpm/guvnor/commit/a791d57af

Comment 5 Ivo Bek 2014-08-26 12:55:35 UTC
Verification failed in BPMS 6.0.3.ER1

When I use just the spring-jdbc dependency I will get the following exception as WARN:

14:38:58,894 WARN  [org.guvnor.common.services.builder.Builder] (EJB default - 4) Verification of class org.apache.derby.client.am.Connection failed and will not be available for authoring.
Please check the necessary external dependencies for this project are configured correctly.: java.lang.SecurityException: sealing violation: package org.apache.derby.jdbc is sealed

However, the build fails. From the description of the BZ that should not happen.

The build also fails when I try to build a project containing spring-jdbc and jaxb-xjc dependencies.

The project only with the jaxb-xjc dependency is built successfully.

Comment 10 Ivo Bek 2014-08-27 07:52:45 UTC
Thanks Mario. I have one idea what it could cause it, hence I will try it today.

Verified in BPMS 6.0.3.ER1.


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