Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [milo-dev] ClientServerExample.java failed and fix bug ?

Hi Kevin,

Endpoint URLs of UaTcpStackServer is below:
-----
UaTcpStackServer startup - opc.tcp://localhost:12685/example bound to /127.0.0.1:12685 [None/None]
UaTcpStackServer startup - opc.tcp://localhost:12685/example bound to /127.0.0.1:12685 [Basic128Rsa15/SignAndEncrypt]

I tried to run ClientServerExample.java with Java8/Apache Felix 4.6.1
on Windows 7 (64bit) (using Netty 4.1.1.Final).

Regards,

--Shigeru

<kevinherron@xxxxxxxxx> wrote, Thu, 30 Jun 2016 06:08:17 -0700

> This error does not happen for me when I run ClientServerExample. What
> endpoint URLs did UaTcpStackServer log that it was binding to on startup?
> 
> On Wed, Jun 29, 2016 at 11:08 PM, Shigeru Ishida <ishida_shigeru@xxxxxxxxxxx
> > wrote:
> 
> > Hi Kevin,
> >
> > I tried to run ClientServerExample.java and this stack trace was output
> > below.
> >
> > ClientServerExample.java)
> > -----
> >
> > https://github.com/eclipse/milo/blob/master/opc-ua-stack/stack-examples/src/main/java/org/eclipse/milo/opcua/stack/examples/ClientServerExample.java
> >
> > stack trace)
> > -----
> > org.eclipse.milo.opcua.stack.server.handlers.UaTcpServerAsymmetricHandler
> > exceptionCaught - [remote=/127.0.0.1:53797] Exception caught; sent
> > ErrorMessage{error=StatusCode{name=Bad_UnexpectedError,
> > value=0x80010000, quality=bad}, reason=java.lang.IllegalArgumentException:
> > securityPolicyUri length cannot be greater than 255 bytes}
> > io.netty.handler.codec.DecoderException:
> > java.lang.IllegalArgumentException: securityPolicyUri length cannot be
> > greater than 255 bytes
> >         at
> > io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:442)
> >         at
> > io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:248)
> >         at
> > io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
> >         at
> > io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:334)
> >         at
> > io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:326)
> >         at
> > io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1320)
> >         at
> > io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
> >         at
> > io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:334)
> >         at
> > io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:905)
> >         at
> > io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:123)
> >         at
> > io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:563)
> >         at
> > io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:504)
> >         at
> > io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:418)
> >         at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:390)
> >         at
> > io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:742)
> >         at java.lang.Thread.run(Unknown Source)
> > Caused by: java.lang.IllegalArgumentException: securityPolicyUri length
> > cannot be greater than 255 bytes
> >         at
> > com.google.common.base.Preconditions.checkArgument(Preconditions.java:122)
> >         at
> > org.eclipse.milo.opcua.stack.core.channel.headers.AsymmetricSecurityHeader.<init>(AsymmetricSecurityHeader.java:44)
> >         at
> > org.eclipse.milo.opcua.stack.core.channel.headers.AsymmetricSecurityHeader.decode(AsymmetricSecurityHeader.java:139)
> >         at
> > org.eclipse.milo.opcua.stack.server.handlers.UaTcpServerAsymmetricHandler.onOpenSecureChannel(UaTcpServerAsymmetricHandler.java:134)
> >         at
> > org.eclipse.milo.opcua.stack.server.handlers.UaTcpServerAsymmetricHandler.decode(UaTcpServerAsymmetricHandler.java:103)
> >         at
> > io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:411)
> >         ... 15 more
> > -----
> >
> > Therefore I modified decode() method in AsymmetricSecurityHeader.java and
> > run it successfully. I will send this patch to you.
> >
> > Regards,
> >
> > --Shigeru


Back to the top