Written by

Question prashantha M · Aug 2, 2020

Kafka Java Host

I'm trying to produce Kafka Message to Topic using Java Objects. I have build Business operation and  Jar file and trying to execute. I'm getting following exception 

Terminating Job 8316 / 'IrisKafkaProducer' with Status = ERROR #5046: Error executing java command 'init() returned: "ERROR #5034: Invalid status code structure ("java.sql.SQLException: [InterSystems IRIS JDBC] Communication link failure: Access Denied")"'. Java may not be installed correctly on your system., %QuitTask=

Getting following trace at Audit Database

2020-08-02 14:30:06.822 %System %Login LoginFailure 8318     com.intersystems.gateway.Jav login failure Details
  2020-08-02 14:30:02.558 %System %Login LoginFailure 8315     com.intersystems.gateway.Jav login failure Details
  2020-08-02 14:30:02.268 %System %Login Login 6256 qq0JACa9Sa _Ensemble %Service_Login

Could somebody help me out here

Comments

Eduard Lebedyuk · Aug 2, 2020

Looks like there's some issues with InterSystems IRIS accessing Java Gateway.

Are there some additional Details available in audit log?

Here's a sample implementation of Kafka Producer via PEX Java BO.

0
prashantha M  Aug 2, 2020 to Eduard Lebedyuk

It’s giving issue for credentials , I have set Superuser and password, I’m able to call through Irissession 

could you please help better understanding of the credentials, after mapping user with admin Privileged user also it’s not working 

0
Eduard Lebedyuk  Aug 2, 2020 to prashantha M

I'm not sure where you get the credentials error.

The flow should be from InterSystems IRIS to Java BS/BO and it's credential-less.

Check the docs.

0
prashantha M  Aug 3, 2020 to Eduard Lebedyuk

I followed same steps and having same issue , let me past sample and highlighted <Property name="Credentials">, after giving right credentials, its failing  
 

 

Spoiler

 

<Class name="iris.Kafka.IRISKafkaProducer">

<Description>

Java Business Operation which runs Java class iris.Kafka.IRISKafkaProducer</Description>

<Super>Ens.Java.Operation.PassthroughOperation</Super>

<TimeChanged>65521,53538.454697</TimeChanged>

<TimeCreated>65521,53538.450249</TimeCreated>

<GeneratedBy>EnsPortal.GenerateJBHFrame</GeneratedBy>

<Property name="Address">

<Description>

IP address or name of the machine where the Java Gateway Server is located.</Description>

<Type>%String</Type>

<InitialExpression>"127.0.0.1"</InitialExpression>

</Property>

<Property name="Credentials">

<Description>

Credentials for Java to use when authenticating with IRIS</Description>

<Type>%String</Type>

<InitialExpression>"SuperUser"</InitialExpression>

</Property>

<Property name="JarFile">

<Description>

Path to JAR file containing Java-side implementation of this Business Operation</Description>

<Type>%String</Type>

<InitialExpression>"/home/irisowner/IRIS/dev/java/lib/kafka/IRISKafkaProducer_1.2.jar"</InitialExpression>

<Parameter name="MAXLEN" value="255"/>

</Property>

<Property name="JavaGatewayService">

<Description>

Name of the Config Item for the Java Gateway Server. If specified, the Address and Port of the selected Java Gateway Server override any values entered in the Address and Port settings.</Description>

<Type>%String</Type>

<InitialExpression>"Initiator"</InitialExpression>

</Property>

<Property name="Port">

<Description>

TCP port number for communication between the Java Gateway Server and the proxy classes in IRIS.</Description>

<Type>%String</Type>

<InitialExpression>55555</InitialExpression>

</Property>

<Parameter name="JavaClass">

<Default>iris.Kafka.IRISKafkaProducer</Default>

</Parameter>

</Class>

0
Eduard Lebedyuk  Aug 3, 2020 to prashantha M

Try EnsLib.PEX.BusinessOperation.

0
prashantha M  Aug 3, 2020 to Eduard Lebedyuk

Tried getting following exception

Terminating Job 20085 / 'KafkaProducer' with Status = ERROR #8104: Gateway Exception: <GATEWAY> java.lang.NoClassDefFoundError java.lang.Class.forName0(Native Method) Could not initialize class example.KafkaBusinessOperation, %QuitTask=
 

0
prashantha M  Aug 3, 2020 to prashantha M

I have all the required class files and dependencies , I'm facing some crazy issue , while setting up Java host, when I try to import Jar file , it tells class files doesn't exist , but if I unzip the jar files , I can all the class files 

0
Kevin Chan  Aug 3, 2020 to prashantha M

If you run "jar -tf" onto the jar file,  does the directory structure of the jar file match example/KafkaBusinessOperation?

0
prashantha M  Aug 4, 2020 to Kevin Chan

yes , its showing the required class files...is there any JDK version issues or any configuration required

0
prashantha M  Aug 4, 2020 to Kevin Chan

I'm getting following exception when i try to create Java Business Hosts and import the jar files, i have implemented with PEX BO/BS

The selected file does not contain any classes which can be imported as a java business host.  Try selecting a different jar file

0
Leonardo Carvalho  Jul 19, 2021 to prashantha M

I'm having the same issue. How did you fix it?

0