Bug 779545 (SOA-1921) - Nullpointer exception in log during server shutdown after running juddi integration test suite.
Summary: Nullpointer exception in log during server shutdown after running juddi integ...
Keywords:
Status: CLOSED NEXTRELEASE
Alias: SOA-1921
Product: JBoss Enterprise SOA Platform 5
Classification: JBoss
Component: Documentation, jUDDI - within SOA
Version: 5.0.0 GA,5.0.0 ER8
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: ---
Assignee: Default User
QA Contact:
URL: http://jira.jboss.org/jira/browse/SOA...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-02-04 09:07 UTC by Marek Baluch
Modified: 2010-10-05 12:53 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-10-05 12:53:46 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
server.log (277.92 KB, text/plain)
2010-02-04 09:08 UTC, Marek Baluch
no flags Details
soa1921demo.zip (4.53 MB, application/x-zip-compressed)
2010-03-25 09:32 UTC, Marek Baluch
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker SOA-1921 0 None None None Never

Description Marek Baluch 2010-02-04 09:07:42 UTC
Affects: Documentation (Ref Guide, User Guide, etc.), Release Notes
project_key: SOA

jUDDI integration test suite passes, but during server shutdown a NullPointerException is thrown.  See attached server log for more information.

The fact that Hibernate repopulates the jUDDI schema (see comments for explanation) has uncovered a new problem. JAXRRegistryImpl tries to retrieve the jboss ESB tModel via it's findService method. If it does not find it then it saves a new record to the database. The problem is that even after a successful save operation the tModel just is not in the database.

This problem exists regardless weather we use a datasource in persistence.xml or direct jdbc.

JAXRRegistryImpl.java code snipp:

// Will be null because the schema is not in the database.
ClassificationScheme cScheme = bqm.findClassificationSchemeByName(findQualifiers, orgCategory);
Collection<Classification> classifications = new ArrayList<Classification>();
// If the scheme returned null, then we have to create a org.jboss.soa.esb.:category scheme to use
if (cScheme == null) {
            	try {
            		ClassificationScheme scheme = blm.createClassificationScheme(orgCategory, orgCategory);
            		ArrayList<ClassificationScheme> cSchemes = new ArrayList<ClassificationScheme>();
                        cSchemes.add(scheme);
                        // scheme was not found so save it !!!
                        BulkResponse br = blm.saveClassificationSchemes(cSchemes);
            	} catch (Exception e) {
            		throw new JAXRException(e);
            	}
                // Wow. The scheme is still null here.
            	cScheme = bqm.findClassificationSchemeByName(findQualifiers, orgCategory);
}

How to reproduce:
-----------------------

1) Reconfigure jUDDI in SOA-P to provide db connections outside the container.
2) Pick an API jUDDI test from juddi-core
3) Add jbossesb-registry.sar/juddi_config to class-path so hibernate can pick up it's config file.
4) Run the test
5) Shutdown the server with ctrl+c and look out for a NullPointerException.

Comment 1 Marek Baluch 2010-02-04 09:08:00 UTC
Attachment: Added: server.log


Comment 2 Marek Baluch 2010-03-22 07:47:04 UTC
The jbossesb tModel is lost from DB after any DB write initiated from an jUDDI integration test. The JAXRRegistryImpl.findService() attempts to save the tModel during server shutdown when the tModel is not found, but even after the save is made the tModel is not in the database.

Comment 3 Marek Baluch 2010-03-22 14:23:59 UTC
We loose the jboss esb tModel because jUDDI during startup does not find the "root" publisher in the DB and runs the whole registration process again. During the registration process it uses the juddi_custom_install_data from juddi_core-3.x.x.jar file which does not include the jboss esb data.

The final question is why it is unable to find the "root" publisher.

Comment 4 Marek Baluch 2010-03-24 12:21:45 UTC
The cause why we loose the jboss esb tModel is caused by hibernate - The whole jUDDI database schema is redeployed by hibernate due hibernate.hbm2ddl.auto=create parameter, when a new EntityManager object is created by Install.alreadyInstalled() method and the configuration is picked up. This is not a problem.

Comment 5 Len DiMaggio 2010-03-24 12:29:35 UTC
Affects: Added: [Documentation (Ref Guide, User Guide, etc.), Release Notes]


Comment 7 Marek Baluch 2010-03-25 09:32:17 UTC
Attached reproducer.

1) setup properties in quickstarts.properties file.
2) ant customize-server (enabled out of container juddi connections)
3) start server
4) ant test

Comment 8 Marek Baluch 2010-03-25 09:32:17 UTC
Attachment: Added: soa1921demo.zip


Comment 10 Jiri Sedlacek 2010-10-05 12:53:45 UTC
Verified in version 5.1.0.ER2


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