Community
Participate
Working Groups
While generating a PL/SQL provider service from a datable package fails with NPE: java.lang.NullPointerException at org.eclipse.persistence.tools.dbws.DBWSBuilder.buildOROXProjectsForAdvancedPLS QLProcedure(DBWSBuilder.java:932) at org.eclipse.persistence.tools.dbws.DBWSBuilder.buildOROXProjects(DBWSBuilder.j ava:774) at org.eclipse.persistence.tools.dbws.DBWSBuilder.build(DBWSBuilder.java:514) at oracle.jdeveloper.webservices.model.toplink.dbws.generator.TopLinkDBInvokeBuil der.action(TopLinkDBInvokeBuilder.java:315) at oracle.jdeveloper.webservices.model.generator.GeneratorAction.run(GeneratorAct ion.java:142) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java :886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908 ) at java.lang.Thread.run(Thread.java:619)
This issue occurs when there are more than two stored procedures being processed, and at least one of them is considered a PLSQL Procedure Operation. Here's the problem: we initially iterate over each OperationModel (there is one per stored procedure) and create DbStoredProcedure instances accordingly. A list of these DbStoredProcedure instances is created for each OPModel, and stored in a global list (of lists of DbStoredProcedure instances). Later on, we process each OPModel again (building projects) and a PLSQLHelperObjectsBuilder is created - this holds DatabaseType info for each procedure in the OPModel. During processing we want to create a PLSQLStoredProcedureCall for each stored procedure in the current OPModel. In order to create the PLSQLStoredProcedureCall for a given stored procedure, we need the DbStoredProcedure instance created earlier, and the DatabaseType for that DbStoredProcedure instance, which is in the PLSQLHelperObjectsBuilder. The NPE occurs because the code iterates over the global list of DbStoredProcedure instances, and tries to match up each DbStoredProcedure with an entry in the PLSQLHelperObjectsBuilder (to get the corresponding DatabaseType); since the PLSQLHelperObjectsBuilder was created for the current OPModel, and hence only knows types for this OPModel's stored procedures, at some point the PLSQLHelperObjectsBuilder will return null. In addition, if two stored procedures had the same name it is possible that the wrong DatabaseType could be returned from the PLSQLHelperObjectsBuilder.
Created attachment 190286 [details] Proposed Fix.
Created attachment 190419 [details] Supporting tests.
Reviewed by: michael.norman@oracle.com Tests: all unit tests pass as expected; dbws/testing/visit/P1P4testWebServiceSuite Revision: 9078
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink