Natural RPC Java access always throws ArrayIndexOutOfBound

  • Natural 4.1.3 on VSE
  • Broker EntireX 7.1.1.70 on Windows XP Prof
  • Java Client with EntireX Stub 7.1.1.70 on Windows XP Prof

Natural RPC Server (VSE) registers at Broker on windows. When accessing natural rpc server from java stub we get always the exception ArrayIndexOutOfBoundException, independently from the used IDL.

By the way if we use a broker on linux the problem keeps the same.

java.lang.ArrayIndexOutOfBoundsException
at java.lang.System.arraycopy(Native Method)
at com.softwareag.entirex.base.e.b(Unknown Source)
at com.softwareag.entirex.aci.u.a(Unknown Source)
at com.softwareag.entirex.aci.u.a(Unknown Source)
at com.softwareag.entirex.aci.RPCService.a(Unknown Source)
at com.softwareag.entirex.aci.RPCService.callServerRetry(Unknown Source)
at com.softwareag.nld.ista.backend.rpc.IstaS832AdapterL.case832s(IstaS832AdapterL.java:141)
at com.softwareag.nld.ista.backend.rpc.RealEstateManagerRpc.getSummaryForOfficeId(RealEstateManagerRpc.java:143)
at com.softwareag.nld.ista.casabac.SA832DemoDialogModel.callServerSummary(SA832DemoDialogModel.java:275)
at com.softwareag.nld.ista.casabac.SA832DemoDialogModel.search(SA832DemoDialogModel.java:220)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.casabac.server.InteractionModel.invokeMethodInternally(Unknown Source)
at com.casabac.server.InteractionModel.invokeMethod(Unknown Source)
at com.casabac.server.XMLProcessor.processXML(Unknown Source)
at com.casabac.server.Connector.doPost(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Unknown Source)

Any ideas ?

Thanks in advance
Dirk Holbeck

Hi Dirk,

can you please run the Java client app with -Dentirex.trace=2 and provide the output.

Here comes the trace output:

2005-04-22 14:17:36.822/http-8080-Processor25 Trace started:
2005-04-22 14:17:36.822/http-8080-Processor25 EntireX Java Runtime, Version: 7.1.1.70, Date: 02 Feb 2005
2005-04-22 14:17:36.822/http-8080-Processor25 Java version=1.4.2_03
2005-04-22 14:17:36.822/http-8080-Processor25 Java vendor=Sun Microsystems Inc.
2005-04-22 14:17:36.822/http-8080-Processor25 Java class version=48.0
2005-04-22 14:17:36.822/http-8080-Processor25 OS name=Windows XP
2005-04-22 14:17:36.822/http-8080-Processor25 OS version=5.1
2005-04-22 14:17:36.822/http-8080-Processor25 OS architecture=x86
2005-04-22 14:17:36.822/http-8080-Processor25 Default encoding=Cp1252
2005-04-22 14:17:36.832/http-8080-Processor25 Country=DE Language=de
2005-04-22 14:17:36.832/http-8080-Processor25 Language code=de
2005-04-22 14:17:36.832/http-8080-Processor25 Country code=null
2005-04-22 14:17:36.832/http-8080-Processor25 Timezone=Europe/Berlin
2005-04-22 14:17:36.832/http-8080-Processor25 File encoding=Cp1252
2005-04-22 14:17:36.832/http-8080-Processor25 BrokerId ETB001:10050 resolved to ETB001:10050 (poolsize=32,timeout=300s)
2005-04-22 14:17:37.974/Thread-34 CleanupPool for “ETB001:10050”: started, timeout = 300000 ms
2005-04-22 14:18:13.095/http-8080-Processor25 Running on an ASCII machine.
2005-04-22 14:18:13.095/http-8080-Processor25 Using API version 3 for Broker ETB001:10050
2005-04-22 14:18:13.095/http-8080-Processor25 KERNELVERS(BID=ETB001:10050,UID=RPC/DAEKSV4/CALLNAT,PU=0000000000000000000000000000)
2005-04-22 14:18:13.105/http-8080-Processor25 Allocating new socket for ETB001:10050 (0)
2005-04-22 14:18:13.175/http-8080-Processor25 TcpNodelay enabled
2005-04-22 14:18:13.185/http-8080-Processor25 Using API version 7 for Broker ETB001:10050
2005-04-22 14:18:13.185/http-8080-Processor25 KERNELVERS returns: EC=00000000,TXT=Version 7.1.1.60 Platform Windows XP Pro,PU=05Apr22-125750-000001-000005,API=7
2005-04-22 14:18:13.205/http-8080-Processor25 SEND(BID=ETB001:10050,UID=RPC/DAEKSV4/CALLNAT,CID=NONE,SC=RPC,SN=DAEKSV4,SV=CALLNAT,W=60S,SL=205,RL=7168,API=7,PU=05Apr22-125750-000001-000005)

Sending Data 205 bytes:
00000000 31313130 30303030 30303030 30303030 |1110000000000000|
00000010 30303030 30202020 20202020 20203030 |00000 00|
00000020 20202020 20202020 20202020 20202020 | |
-same as above-
00000040 20202049 4E303030 30202020 20303030 | IN0000 000|
00000050 31393330 30303030 30303030 30313220 |193000000000012 |
00000060 20202020 20202020 20202020 20202020 | |
-same as above-
000000C0 2E4C423D 372C5649 54455252 41 |.LB=7,VITERRA |

Received Data 256 bytes:
00000000 31313130 30303030 30303030 30303030 |1110000000000000|
00000010 30303030 30202020 20202020 20203030 |00000 00|
00000020 20202020 20202020 20202020 20202020 | |
-same as above-
00000040 30352049 4E303030 30202020 20303030 |05 IN0000 000|
00000050 31393330 30303030 30303030 30363320 |193000000000063 |
00000060 20202020 20202020 20202020 20202020 | |
-same as above-
000000C0 2E53543D 372C4E41 54555241 4C4D563D |.ST=7,NATURALMV=|
000000D0 342C3230 31305356 3D352C36 31313020 |4,2010SV=5,6110 |
000000E0 53503D32 362C5653 452F4553 41202F20 |SP=26,VSE/ESA / |
000000F0 20202020 2020202F 42415443 48202020 | /BATCH |
2005-04-22 14:18:13.265/http-8080-Processor25 SEND returns: EC=00000000,TXT=Successful response,RETL=256,UOWST=RECV_NONE
2005-04-22 14:18:13.285/http-8080-Processor25 Connected to NATURAL VSE/ESA / /BATCH Version 6110
2005-04-22 14:18:13.285/http-8080-Processor25 Maximum version supported by RPC Server is 2010
2005-04-22 14:18:13.285/http-8080-Processor25 Using RPC version 2000
2005-04-22 14:18:13.295/http-8080-Processor25 SEND(BID=ETB001:10050,UID=RPC/DAEKSV4/CALLNAT,CID=NONE,SC=RPC,SN=DAEKSV4,SV=CALLNAT,W=60S,SL=2584,RL=7168,API=7,PU=05Apr22-125750-000001-000005)

Sending Data 2584 bytes:
00000000 32303030 2A525043 2A303030 30303030 |2000RPC0000000|
00000010 30393230 30303030 30303130 39303030 |0920000000109000|
00000020 30303030 32303130 30303030 30303035 |0000201000000005|
00000030 31303030 30303030 32353230 30303030 |1000000025200000|
00000040 30323333 32303030 30303030 30202020 |0233200000000 |
00000050 4E433030 30303030 30303037 4C423D37 |NC0000000007LB=7|
00000060 2C564954 45525241 5549443D 31392C52 |,VITERRAUID=19,R|
00000070 50432F44 41454B53 56342F43 414C4C4E |PC/DAEKSV4/CALLN|
00000080 4154504D 3D382C43 41534538 33325350 |ATPM=8,CASE832SP|
00000090 543D3532 2C456E74 69726558 204A6176 |T=52,EntireX Jav|
000000A0 61205250 4320436C 69656E74 20372E31 |a RPC Client 7.1|
000000B0 2E312E37 30205769 6E646F77 73205850 |.1.70 Windows XP|
000000C0 20352E31 20783836 2E4D5031 302C304D | 5.1 x86.MP10,0M|
000000D0 50342C30 4D503130 2C304D50 342C304D |P4,0MP10,0MP4,0M|
000000E0 4131302C 302C3130 304D4135 2C302C31 |A10,0,100MA5,0,1|
000000F0 30304D4E 372C302C 3130302E 2B393130 |00MN7,0,100.+910|
00000100 30303030 3030302B 30353031 2B393139 |0000000+0501+919|
00000110 39393939 3939302B 30353033 20202020 |9999990+0503 |
00000120 20202020 20202020 20202020 20202020 | |
-same as above-
000006F0 20202020 20202020 2B303030 30303030 | +0000000|
00000700 2B303030 30303030 2B303030 30303030 |+0000000+0000000|
-same as above-

Received Data 216 bytes:
00000000 32303030 2A525043 2A303030 30303030 |2000RPC0000000|
00000010 30393230 30303030 30303133 31303030 |0920000000131000|
00000020 30303030 30303030 30303030 30303030 |0000000000000000|
-same as above-
00000040 30303030 30303030 38363937 38202020 |0000000086978 |
00000050 4E433030 30303030 30303030 4E443D39 |NC0000000000ND=9|
00000060 342C3139 30365365 72766572 30323032 |4,1906Server0202|
00000070 30352C32 30303043 414C4C4E 4154504D |05,2000CALLNATPM|
00000080 3D382C43 41534538 33325350 543D3532 |=8,CASE832SPT=52|
00000090 2C456E74 69726558 204A6176 61205250 |,EntireX Java RP|
000000A0 4320436C 69656E74 20372E31 2E312E37 |C Client 7.1.1.7|
000000B0 30205769 6E646F77 73205850 20202020 |0 Windows XP |
000000C0 20202020 2020204E 453D3138 2C303146 | NE=18,01F|
000000D0 4E415453 52564420 |NATSRVD |
2005-04-22 14:18:14.326/http-8080-Processor25 SEND returns: EC=00000000,TXT=Successful response,RETL=216,UOWST=RECV_NONE

Looks like you have a rotten Natural installation on VSE.
Natural returns a NAT 6978 plus some garbage which the Java RPC runtime cannot handle.

[i]NAT6978: Version error on :1:, reason :2: :3:.

Expl. Reason: 1: Version of Natural nucleus and version of SYSRPC do not
agree. After the reason, the current version and the
required version are indicated in the message.
2: Server does not support this version.

Actn. Use the correct version(s).[/i]

Problem solved !

Natural error 6978 was caused by the fact that UID in RPC call was longer than 16 Bytes. Because no userid was set in java client the UID was set to RPC/DAEKSV4/CALLNAT (>16 Bytes) by default - this seems to be a problem in natural vse. after setting a shorter userid in the java client by using methods RPCService.setRPCUserId() and RPCService.setRPCPassword() the problem disappeared.

Thanks for the good support.

Dirk

Good to hear that the issue is solved !

But one thing puzzles me a bit. You say that the Java app does not set a userid and a default one was used. However the EntireX Java RPC runtime does allow an empty userid. So I suspect that somewhere in your application you will find
new Broker(“ETB001:10050”, “RPC/DAEKSV4/CALLNAT”)
the second parameter being the userid.

Additional hint for Natural Error 6978 and ArrayIndexOutOfBound:

We got the “ArrayIndexOutOfBound” error (reason again Natural Error 6978) again although we set UID to a short value (like “sag”)
=> solution this time: we had to set name of natural library via method setLibraryName() in java rpc stub.

Regards,
Dirk