Skip to main content

Problem:

  • Product Name: VisiBroker for Java
  • Product Version: 8.0
  • Product Component: Interceptor
  • Platform/OS Version: All
  • Java Version: 1.5 and 1.6  
     

One of the incompatibilities between JDK1.5 and 1.6 against the CORBA specifications 3.0 is the IORInterceptor_3_0. It has been raised as an urgent issue #5430 in the specifications, causing "java.lang.NoSuchMethodError: org.omg.PortableInterceptor.IORInterceptor_3_0.adapter_manager_state_changed(Ljava/lang/String;S)V" exception to be thrown when using the `java` command, instead of `vbj`.

The IOR Interceptor is used to establish tagged components in the profiles within an IOR. For more details, please refer to section 21.5 of CORBA specs 3.0. IORInterceptor_3_0 interface, which inherits the IORInterceptor, is added in the CORBA specs 3.0. This is an example of the interface declaration for IORInterceptor_3_0

// IDL
 // File: PortableInterceptor.idl
 :
 typedef string AdapterManagerId;
 typedef short AdapterState ;
 :
 local interface IORInterceptor_3_0 : IORInterceptor {
 void components_established( in IORInfo info ) ;
 void adapter_manager_state_changed( in AdapterManagerId id,
 in AdapterState state );
 void adapter_state_changed( in ObjectReferenceTemplateSeq
 templates, in AdapterState state ) ;
 };


Java"s IORInterceptor_3_0 interface has the following signature for the adapter_manager_state_changed:

void adapter_manager_state_changed(int id, short state);

Note the difference of the first parameter"s data type (string and int). When the PortableServer::POAManager::activate() is invoked, the adapter_manager_state_changed will be invoked as required by the specifications due to the change of POA state from holding to active.

If it is run in the VisiBroker for Java orb, it wills invokes the adapter_manager_state_changed(int id, short state). However, VisiBroker ORB is compliant to the CORBA specification 3.0 and expects to pass a string to the first parameter. JVM at this point can not find the correct signature and throws "java.lang.NoSuchMethodError: org.omg.PortableInterceptor.IORInterceptor_3_0.adapter_manager_state_changed(Ljava/lang/String;S)V" exception.

Here"s the full stack when running the examples\\vbroker\\security\\bank_ssl:

Exception in thread "main" java.lang.NoSuchMethodError: org.omg.PortableInterceptor.IORInterceptor_3_0.adapter_manager_state_changed(Ljava/lang/String;S)V 
at com.inprise.vbroker.poa.POAManagerImpl.updateAllPOAs(Unknown Source)
at com.inprise.vbroker.poa.POAManagerImpl.activate(Unknown Source)
at SecureServer.main(SecureServer.java:48)


 

Resolution:

 
Micro Focus recommend to use the product command `vbj` over the `java` to run VisiBroker applications in order to preset necessary parameters prior to loading ORB-related classes. However, if you need to use the `java` executable, the following property has to be passed to the JVM to avoid the java.lang.NoSuchMethodError exception above:

-Djava.endorsed.dirs=\\lib\\endorsed


Modify the to the full directory path where your VisiBroker is installed.

This property will tell JVM to use the JAR files on that directory specified as VisiBroker"s JAR files, instead of the JDK"s.

vbjendorse.jar contains the VisiBroker"s implementation on IORInterceptor_3_0Operations.class under the org.omg.PortableInterceptor package.

To test this case, you can do the following:
1. Go to "\\examples\\vbroker\\security\\bank_ssl"
2. Compile the java codes
3. Run the example as:
 
 
 

C:\\Borland\\VisiBroker8\\examples\\vbroker\\security\\bank_ssl>java -classpath ".;C:\\Borland\\VisiBroker8\\lib\\vbjorb.jar;C:\\Borland\\VisiBroker8\\lib\\lm.jar;C:\\Borland\\VisiBroker8\\lib\\sanct6.jar;C:\\Borland\\VisiBroker8\\lib\\log4j.jar;C:\\Borland\\VisiBroker8\\lib\\vbsec.jar"
-Dborland.enterprise.licenseDir=C:\\Borland\\VisiBroker8\\var
-Dborland.enterprise.licenseDefaultDir=C:\\Borland\\VisiBroker8\\bin\\..\\license
-Dorg.omg.CORBA.ORB.inprise.vbroker.orb.ORB
-Dvbroker.log.enable=true
-Dvbroker.log.logLevel=7
-Dvbroker.log.default.appenders=stdout,rolling
-Dvbroker.log.default.appender.rolling.logDir=.
-Dvbroker.log.default.appender.rolling.fileName=server.log
-Djava.endorsed.dirs=\\lib\\endorsed\\vbjendorse.jar
-DORBpropStorage=java_server.properties SecureServer


 


#Security
#VisiBroker