This discussion is archived
4 Replies Latest reply: Sep 3, 2012 8:02 AM by 956641 RSS

EclipseLink-Redeploying a DBWS WS on PL/SQL package after changing return

956641 Newbie
Currently Being Moderated
Issue concerning: EclipseLink 2.4.1 (DBWS) on WebLogic

Hi,

I've created a DBWS webservice based on a Oracle (10g) PL/SQL package, by using EclipseLink DBWS builder. The PL/SQL function exposed as a webservice call has a Object type return type, e.g.:

create or replace type eclipse_type as
object
(
num number
);
/
create or replace package test_eclipselink_pkg as
function test return eclipse_type;
end;
/

As I understand it, EclipseLink-DBWS translates this Oracle object type to an Java type when calling the PL/SQL function over JDBC and translates the Java object to XML to be encapsulated in a SOAP message.

The problem is that when changing the specification of the return type (e.g. changing the name of the field num to nmb in the Oracle type eclipse_type) of the Oracle PL/SQL function, regenerating the webservice (WAR-file) with DBWS builder and redeploying it on WebLogic 10.3.6, calling the webservice results in a java.lang.reflect.InvocationTargetException.

Restarting the WebLogic server (or the appropriate managed server) resolves the problem, what shouldn't be a problem in a development environment, but is not always possible in a production environment.

The problem seems to be that redeploying the webservice doesn't result in the XR Operations/Queries being recreated and as a result the old result type definition is used.

Has anybody a solution for this problem?

Kind regards,
Jan
  • 1. Re: EclipseLink-Redeploying a DBWS WS on PL/SQL package after changing return
    cdelahun Pro
    Currently Being Moderated
    I'm not that familar with the setup you describe, but it sounds like when redeploying the service, the underlying EclipseLink sessions are not being logged out and then recreated with the new classloader. How are you obtaining the session?

    Best Regards,
    Chris
  • 2. Re: EclipseLink-Redeploying a DBWS WS on PL/SQL package after changing return
    956641 Newbie
    Currently Being Moderated
    Hi Chris,

    Thanks for your response! In answer to your question "How are you obtaining the session?" the answer is: I don't know :-)
    To clarify this: the tool DBWS Builder - delivered by the EclipseLink project - generates a WAR file which contains this hierarchy:

    * WEB-INF folder

    *** classes folder

    ****** dbws folder:
    ********* ProviderListener.class (which impelements ServletContextListener)
    ********* DBWSProvider.class (which implements Provider<SOAPMessage>)

    ****** META-INF folder:
    ********* eclipselink-dbws.xml (which lists the queries executed and the session file used)
    ********* eclipselink-dbws-or.xml (which lists the OR mappings and PL/SQL procedure or functions the queries are using)
    ********* eclipselink-dbws-ox.xml (which lists the OX mappings)
    ********* eclipselink-dbws-sessions.xml (which describes a session of type "server-session" with the server platform (WebLogic 10), the logging level the OX mapping file and the login type (Database - Platofrm Oracle 11) and a session of type "database-session" with the OX mapping file and a logging level)

    *** wsdl folder: this contains the WSDL and the XSD file which describes the webservice


    This all generated - by the DBWS Builder tool - based on a DBWS builderfile that only contains a Database, a datasource, a log level, a SOAP version and a list of PL/SQL procedures that should be wrapped into a webservice call.

    So there's no user code involved for obtaining EclipseLink sessions. I believe that indeed that when redeploying the WAR-file, the underlying EclipseLink sessions are not being logged out, but I have no idea how to change this. All suggestions are welcome! I hope it doesn't mean losing the ability to generate the complete webservice "from a XML file" (the DBWS builder file), but we'll see about that later.

    Kind regards,
    Jan

    Edited by: user5198974 on Aug 27, 2012 2:32 AM
  • 3. Re: EclipseLink-Redeploying a DBWS WS on PL/SQL package after changing return
    cdelahun Pro
    Currently Being Moderated
    I was pointed to the DBWS code that looks up the sessions, and it should log out any existing sessions when the XRServiceFactory is initialized, but I don't know the flow or if something else isn't being statically held. If possible, I'd recommend modifying the sessoins.xml (eclipselink-dbws-sessions.xml?) to turn logging on to see if this is occuring or if something else is the problem. You might try deploying the service in a ear file and include the eclipselink.jar within the ear so it is used from the local classloader instead of the server classloader. This might workaround the issue if it is something behing held statically at the server level.

    Either way, a bug should be filed so it can be looked into further.

    Best Regards,
    Chris
  • 4. Re: EclipseLink-Redeploying a DBWS WS on PL/SQL package after changing return
    956641 Newbie
    Currently Being Moderated
    Hi,

    I checked the logging while redeploying the WAR file. This part of the output seems to indicate, as you suggested, that the EcliipseLink session is not correctly logged of (InstanceAlreadyExistsException):

    *** <Info> <J2EE Deployment SPI> <BEA-260121> <Initiating redeploy operation for application, PLUS_WS [archive: P:\WS-I\eclipselink-2.4.0\runtime\eclipselink-2.4.1.v20120712-r11838\eclipselink\utils\dbws\output\PLUS_WS.war], to AdminServer .>


    *** <Notice> <Stdout> <BEA-000000> <[EL Warning]: server: 2012-09-03 16:40:16.598--ServerSession(28419523)--Thread(Thread[[ACTIVE] ExecuteThread: '22' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Problem while unregistering MBean: weblogic.management.NoAccessRuntimeException: Access not allowed for subject: principals=[], on ResourceType: Configuration Action: unregister, Target: null>
    *** <Notice> <Stdout> <BEA-000000> <[EL Config]: connection: 2012-09-03

    *** <Notice> <Stdout> <BEA-000000> <[EL Info]: connection: 2012-09-03 16:40:16.599--ServerSession(28419523)--Thread(Thread[[ACTIVE] ExecuteThread: '22' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--schapkaarten-dbws-or-session logout successful>


    *** <Info> <Deployer> <BEA-149060> <Module PLUS_WS.war of application PLUS_WS successfully transitioned from STATE_PREPARED to STATE_NEW on server AdminServer.>

    *** <Notice> <Stdout> <BEA-000000> <[EL Info]: connection: 2012-09-03 16:40:17.07--ServerSession(9455819)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--schapkaarten-dbws-or-session login successful>
    *** <Notice> <Stdout> <BEA-000000> <[EL Warning]: server: 2012-09-03 16:40:17.071--ServerSession(9455819)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Problem while registering MBean: javax.management.InstanceAlreadyExistsException: TopLink:Name=Development-schapkaarten-dbws-or-session,Type=Configuration>
    *** <Notice> <Stdout> <BEA-000000> <[EL Warning]: server: 2012-09-03 16:40:17.071--ServerSession(9455819)--Thread(Thread[[ACTIVE] ExecuteThread: '2' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Problem while registering MBean: javax.management.InstanceAlreadyExistsException: TopLink:Name=Session(schapkaarten-dbws-or-session)>


    What I cannot see, is: who is responsible for this logout? This must be clear so I know I have to log a bug for WebLogic or for EclipseLink.
    Anyone a suggestion how to determine this?

    Thanks,
    Jan

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points