SymmetricDS MalformedURLException

767 views Asked by At

I'm configuring two instances of SymmetricDS 3.6.12. The server instance is working in a Glassfish 3 server, using 8181 port as https. The client instance is running as a service (in jetty) with https port in 31417. The two instances are configured and running. The sym_tables at the client was updated with the data from the server, however none of the tables I want synchronize is working. I'm getting this error in server:

2014-11-25 23:34:31,493 WARN [ERPServer] [FileSyncService] [erpserver-file_push-1] Could not communicate with node 'PDV:19742872000153:19742872000153' at https://fe80:0:0:0:0:5efe:c0a8:18f%net10:31417/sync/19742872000153 because of unexpected error
java.net.MalformedURLException: Stream handler unavailable due to: For input string: "0:0:0:0:5efe:c0a8:18f%net10:31417"
at java.net.URL.<init>(URL.java:619)
at java.net.URL.<init>(URL.java:482)
at java.net.URL.<init>(URL.java:431)
at org.jumpmind.symmetric.transport.http.HttpTransportManager.getFilePushTransport(HttpTransportManager.java:217)
at org.jumpmind.symmetric.service.impl.FileSyncService.pushFilesToNode(FileSyncService.java:606)
at org.jumpmind.symmetric.service.impl.FileSyncService.execute(FileSyncService.java:593)
at org.jumpmind.symmetric.service.impl.NodeCommunicationService$2.run(NodeCommunicationService.java:307)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.IllegalStateException: Stream handler unavailable due to: For input string: "0:0:0:0:5efe:c0a8:18f%net10:31417"
at org.apache.felix.framework.URLHandlersStreamHandlerProxy.parseURL(URLHandlersStreamHandlerProxy.java:431)
at java.net.URL.<init>(URL.java:614)
... 9 more

MORE INFORMATION

The server is configured this way:

engine.name=ERPServer
group.id=ERP
external.id=19742872000153ERP
registration.url=
sync.url=https://$(ipAddress):8181/symmetric_ds/sync/$(engineName)

The client is configured this way:

engine.name=19742872000153
group.id=PDV
external.id=19742872000153
registration.url=https://192.168.1.150:8181/symmetric_ds/sync/ERPServer
sync.url=https://$(ipAddress):31417/sync/$(engineName)

I've checked the IPv6 that the client is using (fe80:0:0:0:0:5efe:c0a8:18f%net10) and verified that it is a valid IP. Looking at this part of error message:

java.net.MalformedURLException: Stream handler unavailable due to: For input string: "0:0:0:0:5efe:c0a8:18f%net10:31417"

we can see that the url doesn't have the first part of the ip (fe80), instead the port is present at the url (31417). Is this a SymmetricDS bug? Is there something I could do to solve this problem?

2

There are 2 answers

0
brevleq On BEST ANSWER

The problem was solved simply using square brackets in configuration file. As @dave_thompson_085 said in a comment

Colon : in URL authority separates the port (and password if used) but also is used in IPv6 "literal" format so that needs square brackets.

So I've configured the sync url this way:

sync.url=https://[$(ipAddress)]:31417/sync/$(engineName)

and did the same in the node table.

2
Boris Pavlović On

The registration url is hardcoded:

registration.url=https://192.168.1.150:8181/symmetric_ds/sync/ERPServer

and that's the reason why the client successfully registers. The problem is with the ipAddress variables substitution. Check why it's replaced with fe80:0:0:0:0:5efe:c0a8:18f%net10 at the client and have it fixed.