Read only archive ; use https://github.com/JacORB/JacORB/issues for new issues

Bug 1017

Summary: Server request interceptor doesn't works
Product: JacORB Reporter: Kujtim Hyseni <kujtimhyseni>
Component: otherAssignee: Mailinglist to track bugs <jacorb-bugs>
Status: RESOLVED FIXED    
Severity: enhancement CC: jacorb
Priority: P5    
Version: 3.4   
Hardware: PC   
OS: Windows NT   
Attachments: Client, server and server request interceptor code for given server

Description Kujtim Hyseni 2015-08-23 08:32:06 UTC
Created attachment 468 [details]
Client, server and server request interceptor code for given server

I am trying to use server request interceptor but it doesn't works at all. I am registering it as states in respective examples and trying to use it. Its constructor is run and server notifies that 1 server request interceptor is registered but it doesn't reacts on client requests i.e. it's methods are not called when client initiates request and when it receives response from server.
Attached you may find the whole code I am using.
Comment 1 Nick Cross 2015-08-24 04:50:27 UTC
You are activating two orbs and activating the object in the first ORB (which doesn't have server interceptors). Removing the second ORB fixes the problem for me ( or just put the interceptors in the correct ORB ).
Comment 2 Kujtim Hyseni 2015-08-27 09:42:21 UTC
(In reply to Nick Cross from comment #1)
> You are activating two orbs and activating the object in the first ORB
> (which doesn't have server interceptors). Removing the second ORB fixes the
> problem for me ( or just put the interceptors in the correct ORB ).

Hi Nick,

can you modify the code as you proposing and send me the code to my email address?

Kujtim
Comment 3 Nick Cross 2015-08-27 09:54:02 UTC

diff -b -B -w original/ConnManServer.java ConnManServer.java
9c9,11
<         org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(args, null);
---
>         java.util.Properties props = new java.util.Properties();
>         props.put("org.omg.PortableInterceptor.ORBInitializerClass.ServerInitializer","ServerInitializer");
>         org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(args, props);
30d31
<         orb = orb.init(args, props);
Comment 4 Kujtim Hyseni 2015-08-27 09:57:34 UTC
I have made changes as suggested and it works! But, there is still an issue how to send Server's ior to server interceptor to identify the instance of the server instance or maybe it is included in server interceptor's methods arguments (ServerRequestInfo)?
Comment 5 Nick Cross 2015-08-27 10:42:03 UTC
Interceptors are created and registered on ORB construction. You would have to design your application to account for this.
Comment 6 Kujtim Hyseni 2015-08-27 10:59:30 UTC
The code I uploaded is based on example you provided few months through jacorb-dev-list forum but they don't work. Can you adopt the code I uploaded to include server IOR in props too?

Kujtim